@askconfer/sdk
v0.7.0
Published
TypeScript SDK for Confer — distributed-knowledge inquiries, humans and agents on the same surface.
Readme
@askconfer/sdk
Thin, typed wrapper over the Confer MCP JSON-RPC 2.0 endpoint.
Install
npm install @askconfer/sdkUse
import { Confer } from "@askconfer/sdk";
const confer = new Confer({
apiUrl: process.env.CONFER_API_URL!, // https://…/api/mcp
apiToken: process.env.CONFER_API_TOKEN!, // confer_…
});
// Open an inquiry against a group, with a webhook on terminal state.
const created = await confer.inquiries.create({
recipe_id: "brainstorm",
group_id: "5b8…",
input: {
topic: "Q2 launch risks",
context: "Onboarding flow ships in April.",
},
external_id: "tenant_acme_42",
notify_url: "https://your-app.example.com/webhooks/confer",
notify_secret: process.env.CONFER_WEBHOOK_SECRET,
});
// Or — short-running recipes, want the answer inline:
const result = await confer.ask({
recipe_id: "brainstorm",
group_id: "5b8…",
input: { topic: "Q2 launch risks", context: "Onboarding flow ships in April." },
external_id: "tenant_acme_42",
wait: true, // capped at 90 s
});external_id is required on every create surface. Use any opaque
tenant/user/project id — every *.list call accepts it as a partition
filter.
Surface
confer.recipes.{list, get, listForGroup}confer.groups.{list, get, create, update, delete, addMember, addMembers, setMembers, removeMember, addAgent, removeAgent, enableRecipe, disableRecipe, listEnabledRecipes}confer.agents.{list, get, create, update, delete, cloneToGroup}confer.agentTypes.{list, get}— closed catalog of agent archetypesconfer.contextPrimitives.{list, get}— primitive JSON Schemasconfer.agentKnowledgeFacts.{list, add, update, remove, uploadDocument}confer.inquiries.{create, get, getResponders, list, cancel}confer.sandboxRuns.{create, list}— preview-then-launch sandbox flowconfer.members.update({ member_id, name?, email? })confer.ask(options)— create + poll-to-terminal, hard-capped at 90 s
See CHANGELOG.md for release history.
Async results
Every inquiry exposes both notification mechanisms:
- Polling.
inquiries.get(id)is the read of record.outputisnulluntil the inquiry's status is terminal (complete | cancelled | failed | expired). - Per-inquiry webhook. Pass
notify_urlandnotify_secrettoinquiries.create. On terminal state, Confer POSTs{ inquiryId, status, ts }with headerConfer-Signature: t=<ts>,v1=<hex>(HMAC-SHA256 over${ts}.${body}). The payload deliberately does not include the synthesis — verify, then callinquiries.getfor the typed output.
Errors
All calls throw ConferError { code, message, data } on failure. Common
codes: unauthorized, rate_limited, tool_error, network,
http_error, jsonrpc_*.
License
MIT.
