@ziggs-ai/ziggs-mcp 0.30.2 → 0.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,27 +1,3 @@
1
- import { type Creds } from '@ziggs-ai/api-client';
2
- /** One catalog row as the picker reads it. */
3
- export interface ToolPickOption {
4
- name: string;
5
- line: string;
6
- }
7
- /**
8
- * - `pick` one tool does the need: `tool` names it.
9
- * - `nothing_fits` no tool does it.
10
- * - `unsure` / `off` no answer worth giving: show the list.
11
- */
12
- export interface ToolPickAnswer {
13
- how: 'pick' | 'nothing_fits' | 'unsure' | 'off';
14
- tool?: string;
15
- confidence?: number;
16
- }
17
- /** Null means "no answer": the surface shows the list it always has. */
18
- export type PickTool = (need: string, options: ToolPickOption[]) => Promise<ToolPickAnswer | null>;
19
- /**
20
- * The backend picker: `POST /internal/tool-pick` with this connection's key.
21
- * The model call and its key live on the backend, since this server also runs
22
- * on a caller's own machine. Any failure is null, including the 404 from a
23
- * backend that predates the route.
24
- */
25
- export declare function backendToolPick(creds: Creds): PickTool;
1
+ export { backendToolPick, type ToolPickOption, type ToolPickAnswer, type PickTool } from '@ziggs-ai/api-client';
26
2
  /** What the picker is told a tool does: its title and the first sentence it says. */
27
3
  export declare function pickLine(title: string, description: string): string;
package/dist/toolPick.js CHANGED
@@ -1,37 +1,4 @@
1
- import { buildCredsHeaders, getBackendUrl } from '@ziggs-ai/api-client';
2
- /** A listing is always the fallback, so waiting long for a pick buys nothing. */
3
- const TIMEOUT_MS = 6000;
4
- /**
5
- * The backend picker: `POST /internal/tool-pick` with this connection's key.
6
- * The model call and its key live on the backend, since this server also runs
7
- * on a caller's own machine. Any failure is null, including the 404 from a
8
- * backend that predates the route.
9
- */
10
- export function backendToolPick(creds) {
11
- return async (need, options) => {
12
- if (!creds.operatorKey)
13
- return null;
14
- try {
15
- const res = await fetch(`${getBackendUrl()}/internal/tool-pick`, {
16
- method: 'POST',
17
- headers: buildCredsHeaders(creds),
18
- body: JSON.stringify({ need, options }),
19
- signal: AbortSignal.timeout(TIMEOUT_MS),
20
- });
21
- if (!res.ok) {
22
- await res.body?.cancel().catch(() => undefined);
23
- return null;
24
- }
25
- const data = (await res.json().catch(() => null));
26
- if (!data || typeof data.how !== 'string')
27
- return null;
28
- return data;
29
- }
30
- catch {
31
- return null;
32
- }
33
- };
34
- }
1
+ export { backendToolPick } from '@ziggs-ai/api-client';
35
2
  /** What the picker is told a tool does: its title and the first sentence it says. */
36
3
  export function pickLine(title, description) {
37
4
  const first = description.split(/(?<=\.)\s/)[0] ?? '';
package/dist/tools.js CHANGED
@@ -348,14 +348,13 @@ export function registerZiggsTools(server, creds, cfg) {
348
348
  chatId: z.string().optional().describe('Chat id for conversation history'),
349
349
  taskId: z.string().optional().describe('Exact task to load bottom-up, without a chat'),
350
350
  agreementId: z.string().optional().describe('Exact agreement scope; required if no task or chat is named'),
351
- messageId: z.string().optional().describe('Exact incoming message that determines the work scope'),
352
351
  artifactId: z.string().optional().describe('Exact triggering artifact to include alongside the work context'),
353
352
  maxMessages: z.number().optional().describe('Optional message history cap'),
354
353
  contextGrantId: z
355
354
  .string()
356
355
  .optional()
357
356
  .describe('Optional grant id when reading under a context grant'),
358
- }, readOnly('Catch up on a chat'), async ({ chatId, taskId, agreementId, messageId, artifactId, maxMessages, contextGrantId }) => {
357
+ }, readOnly('Catch up on a chat'), async ({ chatId, taskId, agreementId, artifactId, maxMessages, contextGrantId }) => {
359
358
  try {
360
359
  if (!chatId && !taskId && !agreementId)
361
360
  throw new Error('Name a taskId, agreementId, or chatId');
@@ -365,7 +364,7 @@ export function registerZiggsTools(server, creds, cfg) {
365
364
  // connection's lane when no chat is named.
366
365
  const client = new ContextReadClient(creds.operatorKey, creds.agentId, undefined, chatId || creds.laneId);
367
366
  const result = await client.snapshot(chatId ?? `agrn-${agreementId ?? taskId}`, {
368
- taskId, agreementId, messageId, artifactId,
367
+ taskId, agreementId, artifactId,
369
368
  maxMessages,
370
369
  contextGrantId,
371
370
  });
@@ -441,7 +440,7 @@ export function registerZiggsTools(server, creds, cfg) {
441
440
  chatId: z
442
441
  .string()
443
442
  .optional()
444
- .describe('Room to send in. Omit when using `to`, or to reply in a room the host already bound. Explicit chatId wins over `to`.'),
443
+ .describe('Room to send in. Omit when using `to`. Explicit chatId wins over `to`.'),
445
444
  to: z
446
445
  .string()
447
446
  .optional()
@@ -449,7 +448,7 @@ export function registerZiggsTools(server, creds, cfg) {
449
448
  receiverId: z
450
449
  .string()
451
450
  .optional()
452
- .describe("Receiver id for the message. Prefer a real user/agent id when you have one. Cross-org masked counterparties arrive as opaque `rpb_*` refs — echo that same ref back here; the backend resolves it in-room (do not look it up, wake, or pay against it). Optional: with one other participant in the room, it is the recipient; with several, Jev may select one when confident. Otherwise the message remains room context with no specific wake. The last writer is never an automatic recipient. A named receiver must already hold write here; naming somebody is not how they get in. Pass 'human' to broadcast to the people in the room."),
451
+ .describe("Receiver id for the message. Leave it out to write back in this room, and name someone only when you mean them. To name a masked party, pass its `rpb_` ref as it came; do not look it up, wake it, or pay against it. With one other participant, they are the recipient. With several, Jev may select one when confident. Otherwise the message stays in the room with no specific wake. A named receiver must already hold write here; naming somebody is not how they get in. Pass 'human' to address the people in the room."),
453
452
  conversationAgreementId: z.string().optional().describe('The agreement this message is under. Required when a send was refused with WORK_SELECTION_REQUIRED: pick one of its choices. Room history never selects it.'),
454
453
  underAgreementId: z.string().optional().describe('The agreement authorizing your run. It follows you across rooms and does not make the recipient your customer.'),
455
454
  taskId: z.string().optional().describe('Task being discussed; its agreement determines this message’s work scope.'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ziggs-ai/ziggs-mcp",
3
- "version": "0.30.2",
3
+ "version": "0.31.0",
4
4
  "description": "MCP server for Claude Code, Cursor, and other MCP hosts — act as your Ziggs delegate agent",
5
5
  "type": "module",
6
6
  "bin": {
@@ -39,7 +39,7 @@
39
39
  },
40
40
  "dependencies": {
41
41
  "@modelcontextprotocol/sdk": "^1.29.0",
42
- "@ziggs-ai/api-client": "0.30.2",
42
+ "@ziggs-ai/api-client": "0.31.0",
43
43
  "dotenv": "^16.6.1",
44
44
  "zod": "^3.24.2",
45
45
  "zod-to-json-schema": "^3.25.1"
@@ -103,7 +103,7 @@ See [references/untrusted-input.md](references/untrusted-input.md).
103
103
  When coordinating with another org’s delegate:
104
104
 
105
105
  1. Inbox → read new messages in the shared chat. Counterparties may appear as opaque `rpb_*` / `psn_*` presentation refs (plus a `presentation` face) — not as raw account ids.
106
- 2. Reply with **`ziggs_chat_send`** (echo an `rpb_*` receiverId as-is; do not look it up, wake, or pay against it) or drive **`ziggs_agreement_buy`** / **`ziggs_agreement_respond`** as appropriate.
106
+ 2. To write back in this room, leave the receiver out of **`ziggs_chat_send`**, and name someone only when you mean them. To name a masked party, pass its `rpb_` ref as it came; do not look it up, wake it, or pay against it. Or drive **`ziggs_agreement_buy`** / **`ziggs_agreement_respond`** as appropriate.
107
107
  3. Ack the handled envelope (`ackTo`) before ending the turn.
108
108
 
109
109
  ## Boarding checklist (cold session)