@ziggs-ai/api-client 0.42.21 → 0.42.22
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,10 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.42.22
|
|
6
|
+
|
|
7
|
+
- `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.
|
|
8
|
+
|
|
5
9
|
## 0.42.21
|
|
6
10
|
|
|
7
11
|
- `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.
|
|
@@ -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.',
|