@ziggs-ai/api-client 0.42.4 → 0.42.6
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 +8 -0
- package/dist/capabilities/buckets.js +2 -2
- package/dist/capabilities/context.js +1 -1
- package/dist/capabilities/discovery.js +1 -3
- package/dist/capabilities/everyday.d.ts +2 -4
- package/dist/capabilities/everyday.js +2 -4
- package/dist/capabilities/links.js +2 -3
- package/dist/capabilities/mcpBriefs.js +6 -6
- package/dist/capabilities/messaging.d.ts +7 -1
- package/dist/capabilities/messaging.js +18 -1
- package/dist/capabilities/types.d.ts +6 -0
- package/dist/http/BucketsClient.d.ts +3 -2
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.42.6
|
|
6
|
+
|
|
7
|
+
- Messaging accepts first messages and replies without a bucket; SDK and MCP guidance keep readers and delivery independent from optional filing.
|
|
8
|
+
|
|
9
|
+
- `bucket_send` with `replyTo` (and `BucketsClient.sendMessage` with `relationships.replyToMessageId`): the reply is also read by everyone who read the message it answers, so a bucket never takes anyone out of a chat; from a run, only those the run may write to. A send that names nothing it answers is still read by the bucket's people only. The server also puts a reply into every other bucket that holds the message it answers and whose people all read it. `recipients` are picked among all of these readers.
|
|
10
|
+
|
|
11
|
+
## 0.42.5
|
|
12
|
+
|
|
5
13
|
## 0.42.4
|
|
6
14
|
|
|
7
15
|
- `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`.
|
|
@@ -237,7 +237,7 @@ export const bucketSendCapability = {
|
|
|
237
237
|
names: { sdk: 'bucket_send', mcp: 'ziggs_bucket_send' },
|
|
238
238
|
title: 'Send in a bucket',
|
|
239
239
|
descriptions: {
|
|
240
|
-
sdk: "Send a message inside a bucket. Its readers are the bucket's people;
|
|
240
|
+
sdk: "Send a message inside a bucket. Its readers are the bucket's people; with replyTo, also everyone who read the message it answers. Name recipients among the readers. To reach anyone else, add them with bucket_add_members first. A request wakes the agents it is delivered to. With page, the message carries an HTML page: its thread shows as that page.",
|
|
241
241
|
},
|
|
242
242
|
annotation: 'destructive',
|
|
243
243
|
needsAgentId: true,
|
|
@@ -252,7 +252,7 @@ export const bucketSendCapability = {
|
|
|
252
252
|
recipients: {
|
|
253
253
|
type: 'array',
|
|
254
254
|
items: { type: 'string' },
|
|
255
|
-
description: 'Who is told, among the
|
|
255
|
+
description: 'Who is told, among the readers. Under work, name at least one person the work is with.',
|
|
256
256
|
},
|
|
257
257
|
intent: { type: 'string', enum: ['fyi', 'request'] },
|
|
258
258
|
replyTo: { type: 'string', description: 'The message this answers. Not for a new page.' },
|
|
@@ -272,7 +272,7 @@ const OPEN_REF_PARAMS = {
|
|
|
272
272
|
};
|
|
273
273
|
function resumeResource(kind, id, env) {
|
|
274
274
|
// After a send grant is approved there is nothing to read: send to the destination.
|
|
275
|
-
//
|
|
275
|
+
// Offer an optional shared bucket with the newly reachable destination.
|
|
276
276
|
if (kind === 'contact')
|
|
277
277
|
return { tool: env.surface === 'mcp' ? 'ziggs_bucket_create' : 'bucket_create', args: { name: 'Conversation', audience: [id] } };
|
|
278
278
|
const tool = kind === 'message' ? 'message_read' : 'open';
|
|
@@ -34,8 +34,6 @@ export const agentSearchCapability = {
|
|
|
34
34
|
throw new Error(result.error ?? result.message ?? 'search failed');
|
|
35
35
|
}
|
|
36
36
|
const send = env.surface === 'mcp' ? 'ziggs_message_send' : 'message_send';
|
|
37
|
-
const bucketCreate = env.surface === 'mcp' ? 'ziggs_bucket_create' : 'bucket_create';
|
|
38
|
-
const bucketSend = env.surface === 'mcp' ? 'ziggs_bucket_send' : 'bucket_send';
|
|
39
37
|
const linkList = env.surface === 'mcp' ? 'ziggs_link_list' : 'link_list';
|
|
40
38
|
const marketplace = env.surface === 'mcp' ? 'ziggs_marketplace_view' : 'marketplace_view';
|
|
41
39
|
const request = env.surface === 'mcp' ? 'ziggs_agreement_request' : 'agreement_request';
|
|
@@ -43,7 +41,7 @@ export const agentSearchCapability = {
|
|
|
43
41
|
const messageThem = people.length
|
|
44
42
|
? {
|
|
45
43
|
people,
|
|
46
|
-
peopleNote: `These are teammates whose name matched. To message the person,
|
|
44
|
+
peopleNote: `These are teammates whose name matched. To message the person, use ${send} with their userId in the command audience and deliveries; which of their agents answers is theirs to decide.`,
|
|
47
45
|
}
|
|
48
46
|
: {};
|
|
49
47
|
const hired = await hireNotes(result.agents ?? [], env);
|
|
@@ -16,10 +16,8 @@ export declare const EVERYDAY_MCP_TOOLS: readonly ["ziggs_inbox", "ziggs_inbox_p
|
|
|
16
16
|
/** Everyday MCP tools the hosted brain does not register. */
|
|
17
17
|
export declare const EVERYDAY_NO_SDK_TWIN: readonly ["ziggs_inbox", "ziggs_inbox_peek", "ziggs_inbox_ack", "ziggs_context_revoke_grant"];
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* with their schemas. The MCP door keeps its size: there they stay in the
|
|
22
|
-
* catalog.
|
|
19
|
+
* Optional organization tools loaded by the hosted brain. Plain messaging
|
|
20
|
+
* needs neither of them. The MCP door keeps these in the catalog.
|
|
23
21
|
*/
|
|
24
22
|
export declare const EVERYDAY_SDK_ONLY: readonly ["bucket_create", "bucket_send"];
|
|
25
23
|
/** SDK names of the everyday set: the MCP list's twins in its order, then the hosted-only ones. */
|
|
@@ -39,10 +39,8 @@ export const EVERYDAY_NO_SDK_TWIN = [
|
|
|
39
39
|
];
|
|
40
40
|
const noSdkTwin = new Set(EVERYDAY_NO_SDK_TWIN);
|
|
41
41
|
/**
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
* with their schemas. The MCP door keeps its size: there they stay in the
|
|
45
|
-
* catalog.
|
|
42
|
+
* Optional organization tools loaded by the hosted brain. Plain messaging
|
|
43
|
+
* needs neither of them. The MCP door keeps these in the catalog.
|
|
46
44
|
*/
|
|
47
45
|
export const EVERYDAY_SDK_ONLY = ['bucket_create', 'bucket_send'];
|
|
48
46
|
/** SDK names of the everyday set: the MCP list's twins in its order, then the hosted-only ones. */
|
|
@@ -8,9 +8,8 @@ export function webAppOrigin(env) {
|
|
|
8
8
|
}
|
|
9
9
|
/** Reach and resource sharing are separate operations with independent consent. */
|
|
10
10
|
export function linkIsReachOnly(env) {
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
return `A link is reach-only and shares no context. To talk, start a bucket with ${create} naming the returned peer.id in audience (never a display face in parties), then ${send} in it. Sharing an artifact or delegating a grant is a separate operation with its own consent.`;
|
|
11
|
+
const send = env.surface === 'mcp' ? 'ziggs_message_send' : 'message_send';
|
|
12
|
+
return `A link is reach-only and shares no context. To talk, use ${send} with the returned peer.id in the command audience and deliveries (never a display face in parties). A bucket is optional. Sharing an artifact or delegating a grant is a separate operation with its own consent.`;
|
|
14
13
|
}
|
|
15
14
|
const LINK_STATUSES = ['active', 'open', 'cancelled', 'all'];
|
|
16
15
|
/**
|
|
@@ -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
|
|
168
|
+
ziggs_message_send: { does: 'Sends the canonical command for first messages and replies with independent readers and recipients. No bucket is required; filing is optional.', 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
|
|
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
|
|
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: {
|
|
@@ -319,7 +319,7 @@ const BRIEFS = {
|
|
|
319
319
|
changes: 'adds them',
|
|
320
320
|
},
|
|
321
321
|
ziggs_bucket_send: {
|
|
322
|
-
does: "Sends
|
|
322
|
+
does: "Sends inside a bucket, to its people and the readers of replyTo.",
|
|
323
323
|
changes: 'sends it',
|
|
324
324
|
},
|
|
325
325
|
ziggs_bucket_rename: {
|
|
@@ -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
|
-
|
|
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. Send first messages and replies directly; no bucket is required. Buckets optionally organize messages and do not determine access on this route. 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`
|
|
@@ -123,8 +123,9 @@ export interface BucketContents {
|
|
|
123
123
|
outOfReach: number;
|
|
124
124
|
}
|
|
125
125
|
/**
|
|
126
|
-
* A message sent inside a bucket: its readers are the bucket's people
|
|
127
|
-
*
|
|
126
|
+
* A message sent inside a bucket: its readers are the bucket's people, and for
|
|
127
|
+
* a reply that names the message it answers, everyone who read that message.
|
|
128
|
+
* `page` is the HTML file it carries, by its exact version (contracts 0.49).
|
|
128
129
|
*/
|
|
129
130
|
export type BucketMessage = Omit<MessageCommand, 'audience'> & {
|
|
130
131
|
page?: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ziggs-ai/api-client",
|
|
3
|
-
"version": "0.42.
|
|
3
|
+
"version": "0.42.6",
|
|
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.
|
|
34
|
+
"@ziggs-ai/contracts": "0.50.1",
|
|
35
35
|
"socket.io-client": "^4.7.0"
|
|
36
36
|
},
|
|
37
37
|
"keywords": [
|