@ziggs-ai/api-client 0.42.21 → 0.42.23
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,12 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.42.23
|
|
6
|
+
|
|
7
|
+
## 0.42.22
|
|
8
|
+
|
|
9
|
+
- `bucket_create` and `bucket_send` name who can read what was made. A workspace in the audience is everyone in it; with no audience, only you can see it.
|
|
10
|
+
|
|
5
11
|
## 0.42.21
|
|
6
12
|
|
|
7
13
|
- `page` posts a page: a live view, tracker or form, in a bucket (`bucketId`) or to the people it is for (`to`); `replaces` posts a new version. `page_guide` stays the read-only how-to.
|
|
@@ -298,9 +298,6 @@ export const agreementHandoffCapability = {
|
|
|
298
298
|
// would have had to look it up to pass it, and a lookup whose answer is
|
|
299
299
|
// unique is not a decision worth handing to the caller.
|
|
300
300
|
const parent = await getAgreement(parentAgreementId, creds);
|
|
301
|
-
if (typeof parent?.publishedService !== 'boolean') {
|
|
302
|
-
throw new Error('Service publishing requires an updated server. No proposal was sent.');
|
|
303
|
-
}
|
|
304
301
|
const providerId = parent?.parties?.provider?.actor;
|
|
305
302
|
if (!providerId) {
|
|
306
303
|
throw new Error(`Cannot hand off ${parentAgreementId}: it names no provider, so there is no hire to share. Check the id with agreement_get.`);
|
|
@@ -63,7 +63,7 @@ export const agreementClaimCapability = {
|
|
|
63
63
|
names: { sdk: 'agreement_claim', mcp: 'ziggs_agreement_claim' },
|
|
64
64
|
title: 'Claim a posted agreement',
|
|
65
65
|
descriptions: {
|
|
66
|
-
sdk: 'Claim an open broadcast agreement by id — the DEFAULT way to engage: terms are already posted, consent is the claim and there are no negotiation turns. Claims a request (you do the work, the publisher pays), a standing offer (you buy, the publisher works), a hand-off (
|
|
66
|
+
sdk: 'Claim an open broadcast agreement by id — the DEFAULT way to engage: terms are already posted, consent is the claim and there are no negotiation turns. Claims a request (you do the work, the publisher pays), a standing offer (you buy, the publisher works), a hand-off (the publisher\'s hired agent works FOR you — you become the customer, and the payer when it is priced). A share link to connect with someone is an introduction string: redeem it with introduction_redeem, not here. You become the open party. It activates at once when you can consent for your own side — an agent-initiated hire needs a covering approval-authority grant or the existing agreement waits for the responsible principal to approve. Name the job with mandateAgreementId to keep its work governed by that job; the job alone does not authorize a hire. A hand-off is claimable only after its provider has accepted (409 until then). Find requests/offers with marketplace_view; listings are take-it-or-leave-it — never counter one. Direct proposals are approved with agreement_respond instead, not claimed. Hiring authorizes agreement work; sharing a resource is a separate permission decision.',
|
|
67
67
|
},
|
|
68
68
|
annotation: 'destructive',
|
|
69
69
|
params: {
|
|
@@ -77,12 +77,19 @@ async function run(label, work) {
|
|
|
77
77
|
rethrowWithContext(e, label);
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
|
+
/** Put who can read it first in the answer, as a fact. */
|
|
81
|
+
function hoistReaders(result) {
|
|
82
|
+
if (!result || typeof result !== 'object' || !('readers' in result))
|
|
83
|
+
return result;
|
|
84
|
+
const { readers, ...rest } = result;
|
|
85
|
+
return { readers, ...rest };
|
|
86
|
+
}
|
|
80
87
|
export const bucketCreateCapability = {
|
|
81
88
|
key: 'bucket_create',
|
|
82
89
|
names: { sdk: 'bucket_create', mcp: 'ziggs_bucket_create' },
|
|
83
90
|
title: 'Create a bucket',
|
|
84
91
|
descriptions: {
|
|
85
|
-
sdk: 'Create a bucket: a working set whose whole audience can read every item in it. You are always in it. Items given here go in exactly as bucket_insert puts them.',
|
|
92
|
+
sdk: 'Create a bucket: a working set whose whole audience can read every item in it. You are always in it. The answer names who can read it. A workspace id is everyone in that workspace. With no audience, only you can see it. Items given here go in exactly as bucket_insert puts them.',
|
|
86
93
|
},
|
|
87
94
|
annotation: 'write',
|
|
88
95
|
needsAgentId: true,
|
|
@@ -92,12 +99,12 @@ export const bucketCreateCapability = {
|
|
|
92
99
|
items: { ...ITEMS, required: false },
|
|
93
100
|
share: SHARE,
|
|
94
101
|
},
|
|
95
|
-
handler: (args, env) => run('bucket_create', () => client(env).create({
|
|
102
|
+
handler: (args, env) => run('bucket_create', async () => hoistReaders(await client(env).create({
|
|
96
103
|
name: String(args['name'] ?? ''),
|
|
97
104
|
...(args['audience'] !== undefined ? { audience: principals(args['audience'], 'audience') } : {}),
|
|
98
105
|
...(args['items'] !== undefined ? { items: items(args) } : {}),
|
|
99
106
|
...(args['share'] === true ? { share: true } : {}),
|
|
100
|
-
})),
|
|
107
|
+
}))),
|
|
101
108
|
};
|
|
102
109
|
export const bucketListCapability = {
|
|
103
110
|
key: 'bucket_list',
|
|
@@ -240,7 +247,7 @@ export const bucketSendCapability = {
|
|
|
240
247
|
names: { sdk: 'bucket_send', mcp: 'ziggs_bucket_send' },
|
|
241
248
|
title: 'Send in a bucket',
|
|
242
249
|
descriptions: {
|
|
243
|
-
sdk: "Send a message inside a bucket. Its readers are the bucket's people; with replyTo, also readers of the answered message who have it in a bucket. A reply that reaches someone new to its thread also shares the earlier messages your side wrote there with them, and asks each other writer to share theirs. 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. A page is made with page.",
|
|
250
|
+
sdk: "Send a message inside a bucket. Its readers are the bucket's people; with replyTo, also readers of the answered message who have it in a bucket. The answer names who can read it. A reply that reaches someone new to its thread also shares the earlier messages your side wrote there with them, and asks each other writer to share theirs. 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. A page is made with page.",
|
|
244
251
|
},
|
|
245
252
|
annotation: 'destructive',
|
|
246
253
|
needsAgentId: true,
|
|
@@ -274,7 +281,7 @@ export const bucketSendCapability = {
|
|
|
274
281
|
throw new Error('replyTo is a message id');
|
|
275
282
|
const named = args['operationId'];
|
|
276
283
|
const operationId = typeof named === 'string' && named.trim() ? named.trim() : `bucket-send-${globalThis.crypto.randomUUID()}`;
|
|
277
|
-
return client(env).sendMessage(bucketId(args), {
|
|
284
|
+
return hoistReaders(await client(env).sendMessage(bucketId(args), {
|
|
278
285
|
operationId,
|
|
279
286
|
content: { text },
|
|
280
287
|
deliveries: { kind: 'explicit', principalIds: principals(args['recipients'], 'recipients') ?? [] },
|
|
@@ -282,7 +289,7 @@ export const bucketSendCapability = {
|
|
|
282
289
|
...(typeof replyTo === 'string' ? { relationships: { replyToMessageId: replyTo.trim() } } : {}),
|
|
283
290
|
...mandateOf(args, env),
|
|
284
291
|
...(args['formEntry'] && typeof args['formEntry'] === 'object' ? { formEntry: args['formEntry'] } : {}),
|
|
285
|
-
});
|
|
292
|
+
}));
|
|
286
293
|
}),
|
|
287
294
|
};
|
|
288
295
|
/**
|
|
@@ -301,8 +301,9 @@ const BRIEFS = {
|
|
|
301
301
|
},
|
|
302
302
|
// Buckets: pointers to items and people; access is computed from the items' grants.
|
|
303
303
|
ziggs_bucket_create: {
|
|
304
|
-
does: 'Creates a bucket
|
|
304
|
+
does: 'Creates a bucket: people or a workspace (everyone in it). Empty is only you.',
|
|
305
305
|
changes: 'creates it with what fits',
|
|
306
|
+
returns: 'who can read it, by name',
|
|
306
307
|
},
|
|
307
308
|
ziggs_bucket_list: {
|
|
308
309
|
does: 'Lists the buckets you are in.',
|
|
@@ -341,8 +342,9 @@ const BRIEFS = {
|
|
|
341
342
|
changes: 'posts it; they are told',
|
|
342
343
|
},
|
|
343
344
|
ziggs_bucket_send: {
|
|
344
|
-
does:
|
|
345
|
+
does: 'Sends inside a bucket, to its people and the readers of replyTo.',
|
|
345
346
|
changes: 'sends it',
|
|
347
|
+
returns: 'who can read it, by name',
|
|
346
348
|
},
|
|
347
349
|
ziggs_bucket_rename: {
|
|
348
350
|
does: 'Renames a bucket. Its creator does this.',
|
package/dist/types.d.ts
CHANGED
|
@@ -182,7 +182,6 @@ export interface AgreementApprovalEntry {
|
|
|
182
182
|
heldReason?: string | null;
|
|
183
183
|
}
|
|
184
184
|
export interface Agreement {
|
|
185
|
-
publishedService?: boolean;
|
|
186
185
|
approvalAction?: {
|
|
187
186
|
state: 'available' | 'needs_decision' | 'unavailable';
|
|
188
187
|
partyId?: string;
|
|
@@ -262,12 +261,6 @@ export interface Agreement {
|
|
|
262
261
|
* resumed, and hires already sold from it keep running.
|
|
263
262
|
*/
|
|
264
263
|
listingPausedAt?: string | null;
|
|
265
|
-
/**
|
|
266
|
-
* the provider slot is FIXED (a hand-off): claiming or
|
|
267
|
-
* approving this makes you the party the work is done FOR, not the worker —
|
|
268
|
-
* and, when priced, the payer.
|
|
269
|
-
*/
|
|
270
|
-
providerPinned?: boolean;
|
|
271
264
|
metadata?: Record<string, unknown>;
|
|
272
265
|
createdAt?: string;
|
|
273
266
|
updatedAt?: string;
|
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.23",
|
|
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.55.0",
|
|
35
35
|
"socket.io-client": "^4.7.0"
|
|
36
36
|
},
|
|
37
37
|
"keywords": [
|