@ziggs-ai/api-client 0.42.4 → 0.42.5

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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.42.5
6
+
5
7
  ## 0.42.4
6
8
 
7
9
  - `SessionsClient.hold(messageId, sessionId?)` holds a conversation by any message in it and returns its `rootMessageId`; it no longer takes an execution id. `AssistantSessionRow.heldThreadIds` replaces `heldExecutionIds`.
@@ -165,7 +165,7 @@ const BRIEFS = {
165
165
  ziggs_artifact_find: {
166
166
  does: 'Searches artifacts you can read by name, filename or body. coverage and notSearched say what was and was not searched.',
167
167
  },
168
- ziggs_message_send: { does: 'Sends a canonical command with independent readers: a reply or work. New thread: ziggs_bucket_create, then ziggs_bucket_send.', changes: 'delivers a message and grants its readers access; a request wakes the agents it reaches' },
168
+ ziggs_message_send: { does: 'Sends a canonical command with independent readers: a reply or work. A first message starts in a bucket: ziggs_bucket_create, then ziggs_bucket_send.', changes: 'delivers a message and grants its readers access; a request wakes the agents it reaches' },
169
169
  ziggs_message_replies: { does: 'Reads authorized causal replies by messageId; a reference grants no access and receipt expiry does not erase history.' },
170
170
  ziggs_message_read: { does: 'Reads an exact message by messageId under current access and execution policy. Does not acknowledge its receipt.' },
171
171
  ziggs_message_list: { does: 'Queries authorized messages by participants, agreement or task. Filters select history, not authority.' },
@@ -232,7 +232,7 @@ const BRIEFS = {
232
232
  },
233
233
  // Agents, links and introductions
234
234
  ziggs_agent_search: {
235
- does: 'Finds agents in the store, your workspaces and your own; teammates come back as people. A row you already hire says already hired and names that agreement and workspace.',
235
+ does: 'Finds agents in the store, your workspaces and your own; teammates come back as people; people you are connected with are in ziggs_link_list. A row you hire says already hired and names that agreement and workspace.',
236
236
  },
237
237
  ziggs_agent_get: {
238
238
  does: 'Reads one agent’s profile by exact id, with how to hire it: listingAgreementId to claim, acceptsProposals for a direct proposal.',
@@ -242,7 +242,7 @@ const BRIEFS = {
242
242
  changes: 'sends the invitation; a link gives reach, not work or money',
243
243
  },
244
244
  ziggs_link_list: {
245
- does: 'Lists your links. peer.id is the person on the other side.',
245
+ does: 'Lists your links: the people you are connected with, your contacts. peer.id is the person on the other side.',
246
246
  next: 'ziggs_bucket_create with peer.id',
247
247
  },
248
248
  ziggs_introduction_mint: {
@@ -266,9 +266,9 @@ const BRIEFS = {
266
266
  },
267
267
  // Connections and points
268
268
  ziggs_connection_list: {
269
- does: 'Lists third-party connections (GitHub, Jira, MCP servers) you hold grants on, with grant health; never credentials. They are listed, not callable over this connection.',
269
+ does: 'Lists third-party connections (GitHub, Jira, MCP servers) you hold grants on, with grant health; never credentials; not people (ziggs_link_list). Listed, not callable over this connection.',
270
270
  compact: {
271
- does: 'Lists third-party connections (GitHub, Jira, MCP servers) you hold grants on, with grant health; never credentials.',
271
+ does: 'Lists third-party connections (GitHub, Jira, MCP servers) you hold grants on, with grant health; never credentials. Not people: those are in ziggs_link_list.',
272
272
  },
273
273
  },
274
274
  ziggs_connection_request: {
@@ -1,5 +1,11 @@
1
- import { type CapabilityDefinition } from './types.js';
1
+ import { type CapabilityDefinition, type CapabilityParam } from './types.js';
2
2
  export declare const readMessageCapability: CapabilityDefinition;
3
+ /**
4
+ * The command's real shape, the same keys the server accepts (contracts
5
+ * `parseMessageCommand`), so a caller sees it in the schema and a wrong key is
6
+ * refused by name before it is sent.
7
+ */
8
+ export declare const MESSAGE_COMMAND_PARAM: CapabilityParam;
3
9
  export declare const sendMessageCapability: CapabilityDefinition;
4
10
  export declare const readRepliesCapability: CapabilityDefinition;
5
11
  export declare const queryMessagesCapability: CapabilityDefinition;
@@ -2,7 +2,24 @@ import { MessageRecordsClient } from '../http/MessageRecordsClient.js';
2
2
  import { fullCreds } from './types.js';
3
3
  const client = (env) => { const creds = fullCreds(env); return new MessageRecordsClient(creds.operatorKey, creds.agentId, env.baseUrl); };
4
4
  export const readMessageCapability = { key: 'message_read', names: { sdk: 'message_read', mcp: 'ziggs_message_read' }, title: 'Read exact message', descriptions: { sdk: 'Read one authorized message. Returns content, intent (fyi or request), independent readers/recipients and authorized relationships. Does not acknowledge delivery.' }, annotation: 'read-only', needsAgentId: true, params: { messageId: { type: 'string', required: true } }, handler: (args, env) => client(env).get(String(args.messageId)) };
5
- export const sendMessageCapability = { key: 'message_send', names: { sdk: 'message_send', mcp: 'ziggs_message_send' }, title: 'Send message', descriptions: { sdk: 'Send the canonical command: operationId; content:{text}; audience:{kind:"explicit",principalIds:[...]}; deliveries:{kind:"explicit",principalIds:[...]}; intent:"fyi" or "request". A request wakes the agents it is delivered to; an fyi is delivered and filed, never woken on. Nothing records whether a request was answered: a reply is a message with relationships.replyToMessageId. Optional mandate:{agreementId,taskId}, relationships:{replyToMessageId,taskIds,artifacts}, exact sources. A new conversation starts in a bucket: bucket_create with its people, then bucket_send; this tool answers a message or writes under work. Reuse operationId unchanged on retry. Refused with "Nothing authorizes giving … access to this message" means you have no contact basis for that reader (membership, a link, an agreement or a listing): ask its owner with access_request scopeKind=contact and scopeId=that reader, then send once they approve.' }, annotation: 'destructive', needsAgentId: true, params: { command: { type: 'object', required: true, description: 'MessageCommand with explicit independent audience, deliveries, intent and optional mandate.' } }, handler: (args, env) => client(env).send(args.command) };
5
+ const principals = { type: 'object', required: true, properties: { kind: { type: 'string', enum: ['explicit'], required: true }, principalIds: { type: 'array', required: true, items: { type: 'string' } } } };
6
+ /**
7
+ * The command's real shape, the same keys the server accepts (contracts
8
+ * `parseMessageCommand`), so a caller sees it in the schema and a wrong key is
9
+ * refused by name before it is sent.
10
+ */
11
+ export const MESSAGE_COMMAND_PARAM = { type: 'object', required: true, properties: {
12
+ operationId: { type: 'string', required: true, description: 'Reuse on retry.' },
13
+ content: { type: 'object', required: true, properties: { text: { type: 'string', required: true } } },
14
+ audience: principals,
15
+ deliveries: principals,
16
+ intent: { type: 'string', required: true, enum: ['fyi', 'request'] },
17
+ mandate: { type: 'object', properties: { agreementId: { type: 'string', required: true }, taskId: { type: 'string' } } },
18
+ relationships: { type: 'object', properties: { replyToMessageId: { type: 'string' }, taskIds: { type: 'array', items: { type: 'string' } }, artifacts: { type: 'array', items: { type: 'object' } } } },
19
+ sources: { type: 'array', items: { type: 'object' } },
20
+ page: { type: 'object' },
21
+ } };
22
+ export const sendMessageCapability = { key: 'message_send', names: { sdk: 'message_send', mcp: 'ziggs_message_send' }, title: 'Send message', descriptions: { sdk: 'Send the canonical command: operationId; content:{text}; audience:{kind:"explicit",principalIds:[...]}; deliveries:{kind:"explicit",principalIds:[...]}; intent:"fyi" or "request". A request wakes the agents it is delivered to; an fyi is delivered and filed, never woken on. Nothing records whether a request was answered: a reply is a message with relationships.replyToMessageId. Optional mandate:{agreementId,taskId}, relationships:{replyToMessageId,taskIds,artifacts}, exact sources. A new conversation starts in a bucket: bucket_create with its people, then bucket_send; this tool answers a message or writes under work. Reuse operationId unchanged on retry. Refused with "Nothing authorizes giving … access to this message" means you have no contact basis for that reader (membership, a link, an agreement or a listing): ask its owner with access_request scopeKind=contact and scopeId=that reader, then send once they approve.' }, annotation: 'destructive', needsAgentId: true, params: { command: MESSAGE_COMMAND_PARAM }, handler: (args, env) => client(env).send(args.command) };
6
23
  export const readRepliesCapability = { key: 'message_replies', names: { sdk: 'message_replies', mcp: 'ziggs_message_replies' }, title: 'Read replies', descriptions: { sdk: 'Read currently authorized causal replies; links never grant access. Continue using nextCursor as before.' }, annotation: 'read-only', needsAgentId: true, params: { messageId: { type: 'string', required: true }, before: { type: 'string' }, limit: { type: 'number' } }, handler: (args, env) => client(env).replies(String(args.messageId), { before: args.before, limit: args.limit }) };
7
24
  export const queryMessagesCapability = { key: 'message_list', names: { sdk: 'message_list', mcp: 'ziggs_message_list' }, title: 'Query messages', descriptions: { sdk: 'Query authorized messages. Use conversationOf with an exact message id to browse messages connected by readable reply relationships; use nextCursor as before for earlier turns. Select conversationOf independently of agreementId, taskId or participantIds. History never selects authority.' }, annotation: 'read-only', needsAgentId: true, params: { conversationOf: { type: 'string', description: 'Authorized anchor message; follows readable causal links, never a reader roster. Each result still requires read access and any execution input authorization.' }, q: { type: 'string' }, senderId: { type: 'string' }, recipientIds: { type: 'array', items: { type: 'string' } }, agreementId: { type: 'string' }, taskId: { type: 'string' }, participantIds: { type: 'array', items: { type: 'string' } }, before: { type: 'string' }, limit: { type: 'number' } }, handler: (args, env) => client(env).list(args) };
8
25
  export const messageControlsCapability = { key: 'message_controls', names: { sdk: 'message_controls', mcp: 'ziggs_message_controls' }, title: 'Inspect message mandate', descriptions: { sdk: 'Discover recipients and current authority under an explicitly selected agreement/task without reading message history.' }, annotation: 'read-only', needsAgentId: true, params: { q: { type: 'string' }, senderId: { type: 'string' }, recipientIds: { type: 'array', items: { type: 'string' } }, agreementId: { type: 'string', required: true }, taskId: { type: 'string' } }, handler: (args, env) => client(env).controls(String(args.agreementId), args.taskId) };
@@ -17,6 +17,12 @@ export interface CapabilityParam {
17
17
  properties?: Record<string, unknown>;
18
18
  required?: string[];
19
19
  };
20
+ /**
21
+ * Only for type 'object': its fields, published in the tool's schema. When
22
+ * given, the object takes exactly these keys and a caller's other key is
23
+ * refused by name. Left out, the object is open.
24
+ */
25
+ properties?: Record<string, CapabilityParam>;
20
26
  }
21
27
  /**
22
28
  * Runtime context a surface adapter hands the shared handler. `creds.agentId`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ziggs-ai/api-client",
3
- "version": "0.42.4",
3
+ "version": "0.42.5",
4
4
  "description": "HTTP and WebSocket client for the Ziggs backend API",
5
5
  "homepage": "https://ziggsai.com/docs",
6
6
  "bugs": {
@@ -31,7 +31,7 @@
31
31
  "test:watch": "node --import tsx/esm --test --watch test/*.test.ts"
32
32
  },
33
33
  "dependencies": {
34
- "@ziggs-ai/contracts": "0.49.1",
34
+ "@ziggs-ai/contracts": "0.50.1",
35
35
  "socket.io-client": "^4.7.0"
36
36
  },
37
37
  "keywords": [