@ziggs-ai/api-client 0.42.9 → 0.42.11
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 +16 -0
- package/dist/capabilities/buckets.js +8 -1
- package/dist/capabilities/context.js +5 -4
- package/dist/capabilities/index.d.ts +1 -0
- package/dist/capabilities/index.js +1 -0
- package/dist/capabilities/mcpBriefs.js +6 -0
- package/dist/capabilities/messaging.js +3 -1
- package/dist/capabilities/pageGuide.d.ts +8 -0
- package/dist/capabilities/pageGuide.js +120 -0
- package/dist/http/BucketsClient.d.ts +4 -129
- package/dist/http/BucketsClient.js +2 -6
- package/dist/http/ContextOpenClient.d.ts +2 -0
- package/dist/http/ContextOpenClient.js +3 -0
- package/dist/http/MessageRecordsClient.d.ts +2 -6
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.42.11
|
|
6
|
+
|
|
7
|
+
- `page_guide` / `ziggs_page_guide` returns how to build a working page. `bucket_send`'s `page` field says to read it first.
|
|
8
|
+
|
|
9
|
+
- `access_request` takes `permission: 'work'` with `scopeKind: 'task'`: a yes makes the asker that task's assignee, to work it and nothing more.
|
|
10
|
+
|
|
11
|
+
## 0.42.10
|
|
12
|
+
|
|
13
|
+
- Message pages, bucket views/contents/items, and form command fields come from `@ziggs-ai/contracts` 0.50.8 instead of a second copy. `message_send` and `bucket_send` publish the `PageForm` / `FormEntry` shape.
|
|
14
|
+
|
|
15
|
+
- `open` now sends `html: true` (it was accepted but dropped). `forms` and `formEntry` on `message_send` and `bucket_send` describe their shape, and `bucket_send` passes `forms` without a page through so the server says why it is refused.
|
|
16
|
+
|
|
17
|
+
- `open` on an HTML page returns its text (words, labels and options, no style or script) with `textOf: 'html'`; `html: true` returns the HTML as written.
|
|
18
|
+
|
|
19
|
+
- `message_send` and `bucket_send` take `forms` (with a page: its forms, fields and choices) and `formEntry` (`{form, fields}`, replying to the page version filled). The server checks an entry against that version's forms and sends it to the page's poster as a request.
|
|
20
|
+
|
|
5
21
|
## 0.42.9
|
|
6
22
|
|
|
7
23
|
- `bucket_send` with `page` says that a page sent as a reply is the page's new version, and only the page's side may send one.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BucketsClient, BUCKET_ITEM_KINDS, } from '../http/BucketsClient.js';
|
|
2
2
|
import { ArtifactsClient } from '../http/ArtifactsClient.js';
|
|
3
3
|
import { fullCreds, rethrowWithContext } from './types.js';
|
|
4
|
+
import { pageGuideCapability } from './pageGuide.js';
|
|
4
5
|
/**
|
|
5
6
|
* The bucket operations as tools, one per route.
|
|
6
7
|
*
|
|
@@ -246,9 +247,11 @@ export const bucketSendCapability = {
|
|
|
246
247
|
text: { type: 'string', required: true },
|
|
247
248
|
page: {
|
|
248
249
|
type: 'string',
|
|
249
|
-
description: "A full HTML document (<!DOCTYPE html>), saved as a file that goes with the message. Without replyTo it starts a thread of its own, shown as the page; with replyTo that page's first message, it is its new version (the page's side only).",
|
|
250
|
+
description: "Read page_guide (MCP: ziggs_page_guide) before writing a page. A full HTML document (<!DOCTYPE html>), saved as a file that goes with the message. Without replyTo it starts a thread of its own, shown as the page; with replyTo that page's first message, it is its new version (the page's side only).",
|
|
250
251
|
},
|
|
251
252
|
pageName: { type: 'string', description: 'Short, stable name of the page.' },
|
|
253
|
+
forms: { type: 'array', description: 'With page: the page\'s forms, fields and choices.', items: { type: 'object', required: ['name', 'fields'], properties: { name: { type: 'string' }, fields: { type: 'array', items: { type: 'object', properties: { name: { type: 'string' }, label: { type: 'string' }, choices: { type: 'array', items: { type: 'string' } }, freeText: { type: 'boolean' } } } } } } },
|
|
254
|
+
formEntry: { type: 'object', description: 'Reply to the page version filled; goes to its poster.', properties: { form: { type: 'string', required: true }, fields: { type: 'object' } } },
|
|
252
255
|
recipients: {
|
|
253
256
|
type: 'array',
|
|
254
257
|
items: { type: 'string' },
|
|
@@ -286,6 +289,9 @@ export const bucketSendCapability = {
|
|
|
286
289
|
// The message carries the page. Without replyTo it starts a thread of
|
|
287
290
|
// its own. Whoever reads the message opens the page: no share needed.
|
|
288
291
|
...(page ? { page } : {}),
|
|
292
|
+
// Passed as given: forms without a page is refused by the server, with why.
|
|
293
|
+
...(Array.isArray(args['forms']) ? { forms: args['forms'] } : {}),
|
|
294
|
+
...(args['formEntry'] && typeof args['formEntry'] === 'object' ? { formEntry: args['formEntry'] } : {}),
|
|
289
295
|
});
|
|
290
296
|
return page ? { ...sent, page: { artifactId: page.id, address: `/pages/${sent.message.rootMessageId}` } } : sent;
|
|
291
297
|
}),
|
|
@@ -380,6 +386,7 @@ export const bucketDeleteCapability = {
|
|
|
380
386
|
handler: (args, env) => run('bucket_delete', () => client(env).delete(bucketId(args))),
|
|
381
387
|
};
|
|
382
388
|
export const BUCKET_CAPABILITIES = [
|
|
389
|
+
pageGuideCapability,
|
|
383
390
|
bucketCreateCapability,
|
|
384
391
|
bucketListCapability,
|
|
385
392
|
bucketReadCapability,
|
|
@@ -354,6 +354,7 @@ export const openCapability = {
|
|
|
354
354
|
cursor: { type: 'string', description: 'Opaque cursor from a prior open page' },
|
|
355
355
|
after: { type: 'string', description: 'ISO timestamp for a forward-delta' },
|
|
356
356
|
limit: { type: 'number', description: 'Page size' },
|
|
357
|
+
html: { type: 'boolean', description: 'A page comes as its text; true for its HTML' },
|
|
357
358
|
},
|
|
358
359
|
needsAgentId: true,
|
|
359
360
|
handler: async (args, env) => {
|
|
@@ -413,14 +414,14 @@ export const accessRequestCapability = {
|
|
|
413
414
|
title: 'Request access for yourself or named readers',
|
|
414
415
|
annotation: 'destructive', needsAgentId: true,
|
|
415
416
|
descriptions: {
|
|
416
|
-
sdk: 'Request optional bounded access to one message, artifact, agreement context or task, or ask to send messages to a destination (scopeKind=contact). Creates only a pending approval; never grants access or approves. Choose recipientId when several approvers are offered; with one, it is selected automatically: your work brief offers them for this wake — workBrief.actingFor.customer.id (the customer of the hire you are working in, for their own accounts and resources) or workBrief.actingFor.operator.id (your operator, for tools you bring). Anyone else is refused, and the refusal lists who you can ask. Artifact requests go to the selected approver inbox; no conversation is needed. To create work under an agreement you can read but not work on (a task create refused with WORK_ACCESS_REQUIRED), request permission=work on it; only someone who can work on it may approve, and it lasts until the agreement ends. Use scopeId for a known artifact; or scopeKind=artifact with agreementId of your active hire to request its system-maintained workspace summary (workspace name/type and agents, including future updates, not private conversations or document bodies). Send the returned appUrl, wait for human approval, then follow the returned resume action. To arrange reading of one artifact for others, name them in holders (agents by id, people or workspaces by their authorized principal IDs); include yourself only if you need to read it too. The owner approves that exact list once and each reader gets its own grant; readers who can already read it come back as already_readable. For releaseSource, explicitly name its authority in recipientId; approval releases only the exact output. Hiring alone grants no source access. Revocation and expiry are checked by the system.',
|
|
417
|
+
sdk: 'Request optional bounded access to one message, artifact, agreement context or task, or ask to send messages to a destination (scopeKind=contact). Creates only a pending approval; never grants access or approves. Choose recipientId when several approvers are offered; with one, it is selected automatically: your work brief offers them for this wake — workBrief.actingFor.customer.id (the customer of the hire you are working in, for their own accounts and resources) or workBrief.actingFor.operator.id (your operator, for tools you bring). Anyone else is refused, and the refusal lists who you can ask. Artifact requests go to the selected approver inbox; no conversation is needed. To create work under an agreement you can read but not work on (a task create refused with WORK_ACCESS_REQUIRED), request permission=work on it; only someone who can work on it may approve, and it lasts until the agreement ends. To work on one task only, request permission=work with scopeKind=task: a yes makes you its assignee. Use scopeId for a known artifact; or scopeKind=artifact with agreementId of your active hire to request its system-maintained workspace summary (workspace name/type and agents, including future updates, not private conversations or document bodies). Send the returned appUrl, wait for human approval, then follow the returned resume action. To arrange reading of one artifact for others, name them in holders (agents by id, people or workspaces by their authorized principal IDs); include yourself only if you need to read it too. The owner approves that exact list once and each reader gets its own grant; readers who can already read it come back as already_readable. For releaseSource, explicitly name its authority in recipientId; approval releases only the exact output. Hiring alone grants no source access. Revocation and expiry are checked by the system.',
|
|
417
418
|
},
|
|
418
419
|
params: {
|
|
419
420
|
scopeKind: { type: 'string', required: true, enum: ['message', 'artifact', 'agreement', 'task', 'contact'], description: 'contact: ask to send messages to scopeId (a person, an agent or a workspace inbox). One-way; it reads nothing and gives no reply path.' },
|
|
420
421
|
scopeId: { type: 'string', description: 'Original resource id. Omit when using a hire agreementId to request its workspace summary.' },
|
|
421
422
|
agreementId: { type: 'string', description: 'Artifact scope only: current hire id, used instead of scopeId to request the system-maintained workspace summary.' },
|
|
422
423
|
reason: { type: 'string', required: true, description: 'Why access is needed and who will receive the reply or summary' },
|
|
423
|
-
permission: { type: 'string', enum: ['read', 'work'], description: 'read by default. work: agreement work
|
|
424
|
+
permission: { type: 'string', enum: ['read', 'work'], description: 'read by default. work: agreement work, or with scopeKind=task, that task.' },
|
|
424
425
|
temporal: { type: 'string', enum: ['from-start'], description: 'Retained resource access uses from-start; owner policy remains authoritative.' },
|
|
425
426
|
durationHours: { type: 'number', description: 'Integer 1–168 hours after approval; default 24' },
|
|
426
427
|
// Not required here: the server requires it, and a request without it
|
|
@@ -465,8 +466,8 @@ export const accessRequestCapability = {
|
|
|
465
466
|
const permission = args.permission ?? 'read';
|
|
466
467
|
if (!['read', 'work'].includes(String(permission)))
|
|
467
468
|
throw new Error('permission must be read or work');
|
|
468
|
-
if (permission === 'work' && scopeKind !== 'agreement')
|
|
469
|
-
throw new Error('Only agreement
|
|
469
|
+
if (permission === 'work' && scopeKind !== 'agreement' && scopeKind !== 'task')
|
|
470
|
+
throw new Error('Only an agreement or a task may request work permission');
|
|
470
471
|
if (contact && args.permission !== undefined && permission !== 'read')
|
|
471
472
|
throw new Error('A contact request asks to send only; omit permission');
|
|
472
473
|
if (args.temporal !== undefined && args.temporal !== 'from-start')
|
|
@@ -13,6 +13,7 @@ export { TASK_CAPABILITIES, listTasksCapability, cancelTaskCapability, passTaskO
|
|
|
13
13
|
export { AGREEMENT_PROPOSE_PROVIDER_ID_DESCRIPTION } from './proposeProviderId.js';
|
|
14
14
|
export { MARKETPLACE_CAPABILITIES, marketplaceViewCapability } from './marketplace.js';
|
|
15
15
|
export { GRANTS_CAPABILITIES, listGrantsCapability } from './grants.js';
|
|
16
|
+
export { PAGE_GUIDE, pageGuideCapability } from './pageGuide.js';
|
|
16
17
|
export { BUCKET_CAPABILITIES, bucketCreateCapability, bucketListCapability, bucketReadCapability, bucketInsertCapability, bucketRemoveCapability, bucketAddMembersCapability, bucketJoinCapability, bucketSendCapability, bucketRemoveMemberCapability, bucketDuplicateCapability, bucketRenameCapability, bucketDeleteCapability, } from './buckets.js';
|
|
17
18
|
export { CONTEXT_CAPABILITIES, contextReadCapability, openCapability, accessExplainCapability, contextDelegateCapability, accessRequestCapability, contextExpandReachCapability, contextDiscoverGrantableCapability, contextBounds, resolveOrgScopeId, explainRefusedRead, RESOURCE_HIDDEN_MESSAGE, RESOURCE_UNREADABLE_MESSAGE, type RefusedRead, } from './context.js';
|
|
18
19
|
export { CONNECTION_CAPABILITIES, connectionProxyCapability, requestConnectionCapability, } from './connections.js';
|
|
@@ -13,6 +13,7 @@ export { TASK_CAPABILITIES, listTasksCapability, cancelTaskCapability, passTaskO
|
|
|
13
13
|
export { AGREEMENT_PROPOSE_PROVIDER_ID_DESCRIPTION } from './proposeProviderId.js';
|
|
14
14
|
export { MARKETPLACE_CAPABILITIES, marketplaceViewCapability } from './marketplace.js';
|
|
15
15
|
export { GRANTS_CAPABILITIES, listGrantsCapability } from './grants.js';
|
|
16
|
+
export { PAGE_GUIDE, pageGuideCapability } from './pageGuide.js';
|
|
16
17
|
export { BUCKET_CAPABILITIES, bucketCreateCapability, bucketListCapability, bucketReadCapability, bucketInsertCapability, bucketRemoveCapability, bucketAddMembersCapability, bucketJoinCapability, bucketSendCapability, bucketRemoveMemberCapability, bucketDuplicateCapability, bucketRenameCapability, bucketDeleteCapability, } from './buckets.js';
|
|
17
18
|
export { CONTEXT_CAPABILITIES, contextReadCapability, openCapability, accessExplainCapability, contextDelegateCapability, accessRequestCapability, contextExpandReachCapability, contextDiscoverGrantableCapability, contextBounds, resolveOrgScopeId, explainRefusedRead, RESOURCE_HIDDEN_MESSAGE, RESOURCE_UNREADABLE_MESSAGE, } from './context.js';
|
|
18
19
|
export { CONNECTION_CAPABILITIES, connectionProxyCapability, requestConnectionCapability, } from './connections.js';
|
|
@@ -322,8 +322,14 @@ const BRIEFS = {
|
|
|
322
322
|
does: "Brings another bucket's people and items in. Who cannot read an item needs onMisfit share.",
|
|
323
323
|
changes: 'adds them',
|
|
324
324
|
},
|
|
325
|
+
ziggs_page_guide: {
|
|
326
|
+
does: 'Returns how to build a page that works: window.ziggs, forms, feeding, and the fallback text.',
|
|
327
|
+
when: 'before writing a page',
|
|
328
|
+
next: 'ziggs_bucket_send with page',
|
|
329
|
+
},
|
|
325
330
|
ziggs_bucket_send: {
|
|
326
331
|
does: "Sends inside a bucket, to its people and the readers of replyTo.",
|
|
332
|
+
when: 'a page, after ziggs_page_guide',
|
|
327
333
|
changes: 'sends it',
|
|
328
334
|
},
|
|
329
335
|
ziggs_bucket_rename: {
|
|
@@ -17,7 +17,9 @@ export const MESSAGE_COMMAND_PARAM = { type: 'object', required: true, propertie
|
|
|
17
17
|
mandate: { type: 'object', properties: { agreementId: { type: 'string', required: true }, taskId: { type: 'string' } } },
|
|
18
18
|
relationships: { type: 'object', properties: { replyToMessageId: { type: 'string' }, taskIds: { type: 'array', items: { type: 'string' } }, artifacts: { type: 'array', items: { type: 'object' } } } },
|
|
19
19
|
sources: { type: 'array', items: { type: 'object' } },
|
|
20
|
-
page: { type: 'object' },
|
|
20
|
+
page: { type: 'object', properties: { kind: { type: 'string', enum: ['artifact'], required: true }, id: { type: 'string', required: true }, sha256: { type: 'string', required: true } } },
|
|
21
|
+
forms: { type: 'array', description: 'With page: the page\'s forms, fields and choices.', items: { type: 'object', required: ['name', 'fields'], properties: { name: { type: 'string' }, fields: { type: 'array', items: { type: 'object', properties: { name: { type: 'string' }, label: { type: 'string' }, choices: { type: 'array', items: { type: 'string' } }, freeText: { type: 'boolean' } } } } } } },
|
|
22
|
+
formEntry: { type: 'object', description: 'Reply to the page version filled; goes to its poster.', properties: { form: { type: 'string', required: true }, fields: { type: 'object' } } },
|
|
21
23
|
} };
|
|
22
24
|
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. A reply that names a reader new to its thread also shares the earlier messages your side wrote there with them, and asks each other writer in it to share theirs; those stay closed to the new reader until that writer says yes. 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) };
|
|
23
25
|
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 }) };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { CapabilityDefinition } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* How to build a page that works. One text, returned by `page_guide` /
|
|
4
|
+
* `ziggs_page_guide`. Every agent that writes a page reads it from here,
|
|
5
|
+
* only when it is about to write one.
|
|
6
|
+
*/
|
|
7
|
+
export declare const PAGE_GUIDE = "LIVE HTML PAGES\n- A page is a thread shown as HTML instead of messages. When asked for a live view or a form,\n post one: bucket_send in the bucket you work in, with page (a complete HTML document that\n starts with <!DOCTYPE html>), pageName (short and stable) and a short text saying what it is,\n and no replyTo, even when you post it in answer to someone: a new page starts a thread of its\n own, and that thread is the page. Name whoever asked in recipients so they are told.\n Everyone in the bucket opens that thread as the page. Its own address is the result's\n page.address (/pages/<thread>); use it, never invent one.\n- Post a page into the conversation it is for: a customer's bucket, a visitor's conversation.\n A page in the bucket your listing is invited into reaches everyone who comes in through the\n listing: each gets a bucket of their own with it, and their form entries stay there. Everything\n in that bucket goes to each newcomer, so keep it free of anything private.\n- To change a page, post the new one in the same thread: bucket_send with replyTo the page's first\n message, the same pageName and the new page. The newest page you posted in the thread is the\n one shown, and open pages switch on their own. Only you, the poster, can replace it.\n- A page runs as the signed-in VIEWER, not you. Fetch every viewer's data when it opens. Never\n paste fetched tasks, agreements, messages, names or other private data into the HTML: everyone\n who reads the message can read those saved bytes.\n- Use inline CSS and inline JavaScript. No CDNs, imports, external images, fetch, websockets,\n cookies or storage. Optional images must be embedded data URLs. Do not add a CSP; Ziggs\n supplies it. Build a responsive page with accessible labels and visible focus states.\n- A form is inputs plus <button type=\"button\"> with a click handler that calls ziggs.submit.\n Never use a <form> that submits or a type=\"submit\" button: the page's frame blocks form\n submission, so a submit handler never runs and the button does nothing.\n- Plain HTML must say \"Open this as a page to use it\". When window.ziggs is present, replace\n that fallback with the live view. A file opened on its own shows a static preview.\n- window.ziggs is injected before your script. Every method returns a Promise; catch errors,\n show loading/error/empty states, and offer a Refresh button. Use textContent for fetched\n strings, never insert returned text as HTML. Call only what the view needs, not every method.\n- The page's own thread:\n * ziggs.thread({limit?,before?}) -> {page:{rootMessageId,messageId,artifactId}, messages,\n nextCursor}: the newest messages of the thread the viewer can read, oldest to newest; pass\n nextCursor as before for older ones. Form entries and your updates are in it. page.messageId\n is the version on show; skip it and the first message when listing.\n * ziggs.on('reply', fn) runs fn({messageId, at}) when a message lands in the thread; read again\n there (ziggs.thread() or ziggs.message(messageId)) instead of polling.\n A page knows its thread only: it never reads a bucket or an agreement of its own.\n- Read API for the viewer's own Ziggs (objects list the stable fields; absent values are null):\n * ziggs.me() -> {userId, username, orgId}, always the viewer and current workspace.\n * ziggs.tasks({state?, limit?, cursor?}) -> {tasks, hasMore, nextCursor}. Each task has\n taskId, agreementId, title, description, state, processing, assigneeId, dueAt, createdAt,\n updatedAt, heldByDeps, heldByParentReview, waitingOn: null | {kind,id,since}.\n state is active/completed/failed/cancelled; omit for all. limit is 1..100 (default 50).\n * ziggs.task(taskId) -> {task}, with the same fields. A shared agreement does NOT imply\n access to all its tasks; respect refused reads. Task lists contain only readable work.\n * ziggs.attention() -> {items, truncated, hasMore}. Items have key, at, source.\n A source=decision item has decision: {kind,id,title,requestedByDisplayName,\n requestedByOrgName,requestedAt,amountCents,expiresAt}.\n A source=notice item has notice: {kind,resourceId,agreementId,taskId,ts,reason}.\n This does not mark anything seen. Indicate capped results when truncated/hasMore is set.\n * ziggs.agreements() -> {agreements:[{agreementId,status,engagementKind,description,\n createdAt,updatedAt,parties:{payer,provider,proposedTo,creator}}]}.\n Each party side has {principal,actor}; roles may overlap. Do not infer permissions from roles.\n * ziggs.messages({agreementId?,taskId?,participantIds?,limit?,before?}) -> {messages,nextCursor}.\n Messages retain messageId, content, timestamp, sender, readers, mandate and relationships.\n Read one with ziggs.message(id), or replies with ziggs.replies(id,{before?}).\n Reads do not acknowledge receipts, complete work or grant access.\n * ziggs.artifacts({limit?,before?}) -> {artifacts,latestSequence,truncated}.\n Each artifact has artifactId,name,contentType,timestamp. No bodies are embedded in this\n listing. limit is 1..100 (default 50); before is the oldest returned timestamp for older rows.\n * ziggs.open(kind,id) -> {opened:true}; kind is message, task, agreement, or decision. Call\n from a button the person clicks. Use decision.id to open its review in Ziggs's own UI.\n- Reads use the viewer's current workspace and existing permissions. Pages cannot select a\n different user, workspace, grant or arbitrary endpoint. The only writes are the two calls\n under FORMS ON A PAGE; a page cannot hire, approve, pay or change settings.\n- Minimal script pattern: if (window.ziggs) { load(); ziggs.on('reply', load); }\n async function load() { try {\n const {messages} = await ziggs.thread({limit: 50});\n document.getElementById('status').textContent = messages.length + ' messages';\n } catch (error) { document.getElementById('status').textContent = error.message; } }\n The example assumes a <p id=\"status\">Open this as a page to use it</p> in the HTML.\n\nFEEDING A PAGE\n- Put your data on a page as replies in its thread, never by posting a new page for each change:\n bucket_send with replyTo the page's message, no recipients (nobody is told, nobody is woken),\n intent fyi, and text holding the data as JSON, for example {\"feed\":\"ops\",\"data\":{...}}.\n Open pages get it at once through ziggs.on('reply'); a page opened later reads it with\n ziggs.thread().\n- Every reply is kept; the page decides what it needs. Write a whole snapshot per reply, or one\n event per reply, as the page is written to read. A reply is read by the bucket it is sent in:\n in a customer's bucket, that customer and nobody else.\n\nFORMS ON A PAGE\n- Calls run as the viewer after Ziggs's own confirmation outside the frame. Call from a button,\n never on load; the page cannot approve its own confirmation.\n * ziggs.submit(form, fields) -> the sent message: a form entry, a reply in the page's thread\n to you, the page's poster, asking you, so you wake. fields is a flat object of strings,\n numbers, booleans or null (1..100 keys, strings up to 4000 characters). The text is JSON:\n {\"form\":name,\"fields\":{...}}. It lands where the thread is: a customer's entry stays in\n their own bucket.\n * ziggs.send(command): the same MessageCommand used by message_send: operationId,\n content:{text}, audience:{kind:'explicit',principalIds:[...]},\n deliveries:{kind:'explicit',principalIds:[...]}, intent:'fyi' or 'request'.\n A request wakes every agent in deliveries; an FYI only lands in their inbox.\n Optional mandate:{agreementId,taskId} must name the explicitly selected work.\n relationships may name an exact reply or artifact version. References grant no access.\n Scoped endpoint refs from ziggs.message(id) apply only to a reply to that exact message.\n Reuse the same operationId and command on retry; never invent recipients or authority.\n- Both refuse a cancelled confirmation or unavailable access. Keep the form filled on\n failure, show the error, and disable the submit button while its call is pending.\n- Use fixed form names and field keys. When an entry wakes you, answer in the same thread:\n bucket_send with replyTo the entry; the person who sent it is told. Their page sees your\n answer through ziggs.on('reply').\n";
|
|
8
|
+
export declare const pageGuideCapability: CapabilityDefinition;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How to build a page that works. One text, returned by `page_guide` /
|
|
3
|
+
* `ziggs_page_guide`. Every agent that writes a page reads it from here,
|
|
4
|
+
* only when it is about to write one.
|
|
5
|
+
*/
|
|
6
|
+
export const PAGE_GUIDE = `LIVE HTML PAGES
|
|
7
|
+
- A page is a thread shown as HTML instead of messages. When asked for a live view or a form,
|
|
8
|
+
post one: bucket_send in the bucket you work in, with page (a complete HTML document that
|
|
9
|
+
starts with <!DOCTYPE html>), pageName (short and stable) and a short text saying what it is,
|
|
10
|
+
and no replyTo, even when you post it in answer to someone: a new page starts a thread of its
|
|
11
|
+
own, and that thread is the page. Name whoever asked in recipients so they are told.
|
|
12
|
+
Everyone in the bucket opens that thread as the page. Its own address is the result's
|
|
13
|
+
page.address (/pages/<thread>); use it, never invent one.
|
|
14
|
+
- Post a page into the conversation it is for: a customer's bucket, a visitor's conversation.
|
|
15
|
+
A page in the bucket your listing is invited into reaches everyone who comes in through the
|
|
16
|
+
listing: each gets a bucket of their own with it, and their form entries stay there. Everything
|
|
17
|
+
in that bucket goes to each newcomer, so keep it free of anything private.
|
|
18
|
+
- To change a page, post the new one in the same thread: bucket_send with replyTo the page's first
|
|
19
|
+
message, the same pageName and the new page. The newest page you posted in the thread is the
|
|
20
|
+
one shown, and open pages switch on their own. Only you, the poster, can replace it.
|
|
21
|
+
- A page runs as the signed-in VIEWER, not you. Fetch every viewer's data when it opens. Never
|
|
22
|
+
paste fetched tasks, agreements, messages, names or other private data into the HTML: everyone
|
|
23
|
+
who reads the message can read those saved bytes.
|
|
24
|
+
- Use inline CSS and inline JavaScript. No CDNs, imports, external images, fetch, websockets,
|
|
25
|
+
cookies or storage. Optional images must be embedded data URLs. Do not add a CSP; Ziggs
|
|
26
|
+
supplies it. Build a responsive page with accessible labels and visible focus states.
|
|
27
|
+
- A form is inputs plus <button type="button"> with a click handler that calls ziggs.submit.
|
|
28
|
+
Never use a <form> that submits or a type="submit" button: the page's frame blocks form
|
|
29
|
+
submission, so a submit handler never runs and the button does nothing.
|
|
30
|
+
- Plain HTML must say "Open this as a page to use it". When window.ziggs is present, replace
|
|
31
|
+
that fallback with the live view. A file opened on its own shows a static preview.
|
|
32
|
+
- window.ziggs is injected before your script. Every method returns a Promise; catch errors,
|
|
33
|
+
show loading/error/empty states, and offer a Refresh button. Use textContent for fetched
|
|
34
|
+
strings, never insert returned text as HTML. Call only what the view needs, not every method.
|
|
35
|
+
- The page's own thread:
|
|
36
|
+
* ziggs.thread({limit?,before?}) -> {page:{rootMessageId,messageId,artifactId}, messages,
|
|
37
|
+
nextCursor}: the newest messages of the thread the viewer can read, oldest to newest; pass
|
|
38
|
+
nextCursor as before for older ones. Form entries and your updates are in it. page.messageId
|
|
39
|
+
is the version on show; skip it and the first message when listing.
|
|
40
|
+
* ziggs.on('reply', fn) runs fn({messageId, at}) when a message lands in the thread; read again
|
|
41
|
+
there (ziggs.thread() or ziggs.message(messageId)) instead of polling.
|
|
42
|
+
A page knows its thread only: it never reads a bucket or an agreement of its own.
|
|
43
|
+
- Read API for the viewer's own Ziggs (objects list the stable fields; absent values are null):
|
|
44
|
+
* ziggs.me() -> {userId, username, orgId}, always the viewer and current workspace.
|
|
45
|
+
* ziggs.tasks({state?, limit?, cursor?}) -> {tasks, hasMore, nextCursor}. Each task has
|
|
46
|
+
taskId, agreementId, title, description, state, processing, assigneeId, dueAt, createdAt,
|
|
47
|
+
updatedAt, heldByDeps, heldByParentReview, waitingOn: null | {kind,id,since}.
|
|
48
|
+
state is active/completed/failed/cancelled; omit for all. limit is 1..100 (default 50).
|
|
49
|
+
* ziggs.task(taskId) -> {task}, with the same fields. A shared agreement does NOT imply
|
|
50
|
+
access to all its tasks; respect refused reads. Task lists contain only readable work.
|
|
51
|
+
* ziggs.attention() -> {items, truncated, hasMore}. Items have key, at, source.
|
|
52
|
+
A source=decision item has decision: {kind,id,title,requestedByDisplayName,
|
|
53
|
+
requestedByOrgName,requestedAt,amountCents,expiresAt}.
|
|
54
|
+
A source=notice item has notice: {kind,resourceId,agreementId,taskId,ts,reason}.
|
|
55
|
+
This does not mark anything seen. Indicate capped results when truncated/hasMore is set.
|
|
56
|
+
* ziggs.agreements() -> {agreements:[{agreementId,status,engagementKind,description,
|
|
57
|
+
createdAt,updatedAt,parties:{payer,provider,proposedTo,creator}}]}.
|
|
58
|
+
Each party side has {principal,actor}; roles may overlap. Do not infer permissions from roles.
|
|
59
|
+
* ziggs.messages({agreementId?,taskId?,participantIds?,limit?,before?}) -> {messages,nextCursor}.
|
|
60
|
+
Messages retain messageId, content, timestamp, sender, readers, mandate and relationships.
|
|
61
|
+
Read one with ziggs.message(id), or replies with ziggs.replies(id,{before?}).
|
|
62
|
+
Reads do not acknowledge receipts, complete work or grant access.
|
|
63
|
+
* ziggs.artifacts({limit?,before?}) -> {artifacts,latestSequence,truncated}.
|
|
64
|
+
Each artifact has artifactId,name,contentType,timestamp. No bodies are embedded in this
|
|
65
|
+
listing. limit is 1..100 (default 50); before is the oldest returned timestamp for older rows.
|
|
66
|
+
* ziggs.open(kind,id) -> {opened:true}; kind is message, task, agreement, or decision. Call
|
|
67
|
+
from a button the person clicks. Use decision.id to open its review in Ziggs's own UI.
|
|
68
|
+
- Reads use the viewer's current workspace and existing permissions. Pages cannot select a
|
|
69
|
+
different user, workspace, grant or arbitrary endpoint. The only writes are the two calls
|
|
70
|
+
under FORMS ON A PAGE; a page cannot hire, approve, pay or change settings.
|
|
71
|
+
- Minimal script pattern: if (window.ziggs) { load(); ziggs.on('reply', load); }
|
|
72
|
+
async function load() { try {
|
|
73
|
+
const {messages} = await ziggs.thread({limit: 50});
|
|
74
|
+
document.getElementById('status').textContent = messages.length + ' messages';
|
|
75
|
+
} catch (error) { document.getElementById('status').textContent = error.message; } }
|
|
76
|
+
The example assumes a <p id="status">Open this as a page to use it</p> in the HTML.
|
|
77
|
+
|
|
78
|
+
FEEDING A PAGE
|
|
79
|
+
- Put your data on a page as replies in its thread, never by posting a new page for each change:
|
|
80
|
+
bucket_send with replyTo the page's message, no recipients (nobody is told, nobody is woken),
|
|
81
|
+
intent fyi, and text holding the data as JSON, for example {"feed":"ops","data":{...}}.
|
|
82
|
+
Open pages get it at once through ziggs.on('reply'); a page opened later reads it with
|
|
83
|
+
ziggs.thread().
|
|
84
|
+
- Every reply is kept; the page decides what it needs. Write a whole snapshot per reply, or one
|
|
85
|
+
event per reply, as the page is written to read. A reply is read by the bucket it is sent in:
|
|
86
|
+
in a customer's bucket, that customer and nobody else.
|
|
87
|
+
|
|
88
|
+
FORMS ON A PAGE
|
|
89
|
+
- Calls run as the viewer after Ziggs's own confirmation outside the frame. Call from a button,
|
|
90
|
+
never on load; the page cannot approve its own confirmation.
|
|
91
|
+
* ziggs.submit(form, fields) -> the sent message: a form entry, a reply in the page's thread
|
|
92
|
+
to you, the page's poster, asking you, so you wake. fields is a flat object of strings,
|
|
93
|
+
numbers, booleans or null (1..100 keys, strings up to 4000 characters). The text is JSON:
|
|
94
|
+
{"form":name,"fields":{...}}. It lands where the thread is: a customer's entry stays in
|
|
95
|
+
their own bucket.
|
|
96
|
+
* ziggs.send(command): the same MessageCommand used by message_send: operationId,
|
|
97
|
+
content:{text}, audience:{kind:'explicit',principalIds:[...]},
|
|
98
|
+
deliveries:{kind:'explicit',principalIds:[...]}, intent:'fyi' or 'request'.
|
|
99
|
+
A request wakes every agent in deliveries; an FYI only lands in their inbox.
|
|
100
|
+
Optional mandate:{agreementId,taskId} must name the explicitly selected work.
|
|
101
|
+
relationships may name an exact reply or artifact version. References grant no access.
|
|
102
|
+
Scoped endpoint refs from ziggs.message(id) apply only to a reply to that exact message.
|
|
103
|
+
Reuse the same operationId and command on retry; never invent recipients or authority.
|
|
104
|
+
- Both refuse a cancelled confirmation or unavailable access. Keep the form filled on
|
|
105
|
+
failure, show the error, and disable the submit button while its call is pending.
|
|
106
|
+
- Use fixed form names and field keys. When an entry wakes you, answer in the same thread:
|
|
107
|
+
bucket_send with replyTo the entry; the person who sent it is told. Their page sees your
|
|
108
|
+
answer through ziggs.on('reply').
|
|
109
|
+
`;
|
|
110
|
+
export const pageGuideCapability = {
|
|
111
|
+
key: 'page_guide',
|
|
112
|
+
names: { sdk: 'page_guide', mcp: 'ziggs_page_guide' },
|
|
113
|
+
title: 'How to build a page',
|
|
114
|
+
descriptions: {
|
|
115
|
+
sdk: 'How to build a page that works: window.ziggs, forms, feeding the thread, and the fallback text. Read this before writing a page for bucket_send.',
|
|
116
|
+
},
|
|
117
|
+
annotation: 'read-only',
|
|
118
|
+
params: {},
|
|
119
|
+
handler: async () => ({ guide: PAGE_GUIDE }),
|
|
120
|
+
};
|
|
@@ -1,149 +1,24 @@
|
|
|
1
|
-
import type
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* agreement is not an item: it decides who is in a bucket (a hire brings its
|
|
5
|
-
* other side in, or invites them until it starts), never what is in it.
|
|
6
|
-
*/
|
|
7
|
-
export declare const BUCKET_ITEM_KINDS: readonly ["message", "artifact", "task"];
|
|
8
|
-
export type BucketItemKind = (typeof BUCKET_ITEM_KINDS)[number];
|
|
9
|
-
export interface BucketItemRef {
|
|
10
|
-
kind: BucketItemKind;
|
|
11
|
-
id: string;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* An item that does not fit where it was asked to go, or no longer fits where
|
|
15
|
-
* it is. Other members are named only when the caller can read the item.
|
|
16
|
-
*/
|
|
17
|
-
export type BucketMisfit = {
|
|
18
|
-
item: BucketItemRef;
|
|
19
|
-
reason: 'you-cannot-read';
|
|
20
|
-
} | {
|
|
21
|
-
item: BucketItemRef;
|
|
22
|
-
reason: 'members-cannot-read';
|
|
23
|
-
memberIds: string[];
|
|
24
|
-
};
|
|
1
|
+
import { BUCKET_ITEM_KINDS, type BucketAddMembersResult, type BucketContents, type BucketInsertResult, type BucketItemKind, type BucketItemPage, type BucketItemRef, type BucketMisfit, type BucketShare, type BucketThread, type BucketView, type MessageCommand, type MessageCommandResult } from '@ziggs-ai/contracts';
|
|
2
|
+
export { BUCKET_ITEM_KINDS };
|
|
3
|
+
export type { BucketAddMembersResult, BucketContents, BucketInsertResult, BucketItemKind, BucketItemPage, BucketItemRef, BucketMisfit, BucketShare, BucketThread, BucketView, };
|
|
25
4
|
/**
|
|
26
5
|
* What to do when someone being added cannot read an item: share it with
|
|
27
6
|
* them, or split: start a narrower bucket with them and only what everyone
|
|
28
7
|
* can read, leaving this one as it is.
|
|
29
8
|
*/
|
|
30
9
|
export type BucketMisfitChoice = 'share' | 'split';
|
|
31
|
-
export interface BucketView {
|
|
32
|
-
bucketId: string;
|
|
33
|
-
name: string;
|
|
34
|
-
createdBy: string;
|
|
35
|
-
/** Who it is for, as given: people, agents, workspaces. */
|
|
36
|
-
audience: string[];
|
|
37
|
-
/** Goes up when an item leaves or the audience changes. */
|
|
38
|
-
revision: number;
|
|
39
|
-
/** Items held; whether each still fits is computed when the items are read. */
|
|
40
|
-
itemCount: number;
|
|
41
|
-
createdAt: string | null;
|
|
42
|
-
}
|
|
43
|
-
/** One share made because the caller chose to share. */
|
|
44
|
-
export interface BucketShare {
|
|
45
|
-
item: BucketItemRef;
|
|
46
|
-
holderId: string;
|
|
47
|
-
/** `pending` waits for the item owner's yes; the item stays out until then. */
|
|
48
|
-
outcome: 'shared' | 'pending' | 'refused';
|
|
49
|
-
}
|
|
50
|
-
export interface BucketInsertResult {
|
|
51
|
-
bucket: BucketView;
|
|
52
|
-
inserted: BucketItemRef[];
|
|
53
|
-
alreadyIn: BucketItemRef[];
|
|
54
|
-
misfits: BucketMisfit[];
|
|
55
|
-
shared: BucketShare[];
|
|
56
|
-
}
|
|
57
|
-
export interface BucketAddMembersResult {
|
|
58
|
-
bucket: BucketView;
|
|
59
|
-
added: string[];
|
|
60
|
-
shared: BucketShare[];
|
|
61
|
-
/** The narrower bucket a split started, and what it holds. This bucket is left as it was. */
|
|
62
|
-
split: {
|
|
63
|
-
bucket: BucketView;
|
|
64
|
-
items: BucketItemRef[];
|
|
65
|
-
} | null;
|
|
66
|
-
}
|
|
67
10
|
export interface BucketJoinResult {
|
|
68
11
|
bucket: BucketView;
|
|
69
12
|
added: string[];
|
|
70
13
|
joined: BucketItemRef[];
|
|
71
14
|
shared: BucketShare[];
|
|
72
15
|
}
|
|
73
|
-
/** One thread in a bucket, as the reader sees it. */
|
|
74
|
-
export interface BucketThread {
|
|
75
|
-
rootMessageId: string;
|
|
76
|
-
title: string;
|
|
77
|
-
messageCount: number;
|
|
78
|
-
lastAt: string | null;
|
|
79
|
-
/** The reader wrote in it or it was delivered to them. */
|
|
80
|
-
yours: boolean;
|
|
81
|
-
/** The thread holding the message asked about as `current`. */
|
|
82
|
-
current: boolean;
|
|
83
|
-
/** The reader's own threads, other than the current one, come with their latest messages. */
|
|
84
|
-
recent?: Array<{
|
|
85
|
-
messageId: string;
|
|
86
|
-
from: string;
|
|
87
|
-
text: string;
|
|
88
|
-
at: string;
|
|
89
|
-
}>;
|
|
90
|
-
}
|
|
91
|
-
/** What is in a bucket as the reader can read it now: what a run starts from. */
|
|
92
|
-
export interface BucketContents {
|
|
93
|
-
bucket: {
|
|
94
|
-
bucketId: string;
|
|
95
|
-
name: string;
|
|
96
|
-
audience: string[];
|
|
97
|
-
revision: number;
|
|
98
|
-
};
|
|
99
|
-
threads: BucketThread[];
|
|
100
|
-
artifacts: Array<{
|
|
101
|
-
artifactId: string;
|
|
102
|
-
name: string | null;
|
|
103
|
-
}>;
|
|
104
|
-
tasks: Array<{
|
|
105
|
-
taskId: string;
|
|
106
|
-
title: string;
|
|
107
|
-
state: string;
|
|
108
|
-
}>;
|
|
109
|
-
/** The agreements the work here is under, worked out from the work. A chat brought in comes without its agreement. */
|
|
110
|
-
agreements: Array<{
|
|
111
|
-
agreementId: string;
|
|
112
|
-
title: string;
|
|
113
|
-
status: string;
|
|
114
|
-
}>;
|
|
115
|
-
/** Hires waiting for a yes whose people come in here when they start. */
|
|
116
|
-
invites: Array<{
|
|
117
|
-
agreementId: string;
|
|
118
|
-
title: string | null;
|
|
119
|
-
waitingFor: string[];
|
|
120
|
-
}>;
|
|
121
|
-
/** Items held that the reader cannot read here, as they ask now. */
|
|
122
|
-
outOfReach: number;
|
|
123
|
-
}
|
|
124
16
|
/**
|
|
125
17
|
* A message sent inside a bucket: its readers are the bucket's people, and for
|
|
126
18
|
* a reply that names the message it answers, those who read that message and
|
|
127
19
|
* have it in a bucket of theirs. Work goes in only with its other side here.
|
|
128
|
-
* `page` is the HTML file it carries, by its exact version (contracts 0.49).
|
|
129
20
|
*/
|
|
130
|
-
export type BucketMessage = Omit<MessageCommand, 'audience'
|
|
131
|
-
page?: {
|
|
132
|
-
kind: 'artifact';
|
|
133
|
-
id: string;
|
|
134
|
-
sha256: string;
|
|
135
|
-
};
|
|
136
|
-
};
|
|
137
|
-
export interface BucketItemPage {
|
|
138
|
-
/** Items everyone it is for can read right now. */
|
|
139
|
-
items: Array<BucketItemRef & {
|
|
140
|
-
addedBy: string;
|
|
141
|
-
addedAt: string | null;
|
|
142
|
-
}>;
|
|
143
|
-
/** Items held that someone it is for can no longer read. */
|
|
144
|
-
outOfReach: BucketMisfit[];
|
|
145
|
-
nextCursor: string | null;
|
|
146
|
-
}
|
|
21
|
+
export type BucketMessage = Omit<MessageCommand, 'audience'>;
|
|
147
22
|
/**
|
|
148
23
|
* The bucket operations (`/buckets`). A bucket is pointers to items and to who
|
|
149
24
|
* it is for; it stores no permission. Whether everyone can read each item is
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
+
import { BUCKET_ITEM_KINDS, } from '@ziggs-ai/contracts';
|
|
1
2
|
import { getBackendUrl } from '../utils/urlUtils.js';
|
|
2
3
|
import { throwApiError } from '../shared/apiError.js';
|
|
3
4
|
import { buildOperatorHeaders, withoutExecution } from './operatorHeaders.js';
|
|
4
|
-
|
|
5
|
-
* What a bucket can hold: the work. Each item is a pointer, never a copy. An
|
|
6
|
-
* agreement is not an item: it decides who is in a bucket (a hire brings its
|
|
7
|
-
* other side in, or invites them until it starts), never what is in it.
|
|
8
|
-
*/
|
|
9
|
-
export const BUCKET_ITEM_KINDS = ['message', 'artifact', 'task'];
|
|
5
|
+
export { BUCKET_ITEM_KINDS };
|
|
10
6
|
/**
|
|
11
7
|
* The bucket operations (`/buckets`). A bucket is pointers to items and to who
|
|
12
8
|
* it is for; it stores no permission. Whether everyone can read each item is
|
|
@@ -14,6 +14,8 @@ export interface ContextOpenBody {
|
|
|
14
14
|
cursor?: string;
|
|
15
15
|
after?: string;
|
|
16
16
|
limit?: number;
|
|
17
|
+
/** An HTML page comes as its text; true returns the HTML as written. */
|
|
18
|
+
html?: boolean;
|
|
17
19
|
}
|
|
18
20
|
/** Backend-evaluated action, scoped to a resource. Never a permission token. */
|
|
19
21
|
export interface ResourceActionCall {
|
|
@@ -74,5 +74,8 @@ export function normalizeContextOpenBody(args) {
|
|
|
74
74
|
body.after = args['after'];
|
|
75
75
|
if (typeof args['limit'] === 'number')
|
|
76
76
|
body.limit = args['limit'];
|
|
77
|
+
// A page opens as its text; html: true asks for it as written.
|
|
78
|
+
if (args['html'] === true)
|
|
79
|
+
body.html = true;
|
|
77
80
|
return body;
|
|
78
81
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { MessageCommand, MessageCommandResult, MessageRecord, MessagingControls } from '@ziggs-ai/contracts';
|
|
1
|
+
import type { MessageCommand, MessageCommandResult, MessagePage, MessageRecord, MessagingControls } from '@ziggs-ai/contracts';
|
|
2
2
|
export interface MessageQuery {
|
|
3
3
|
conversationOf?: string;
|
|
4
4
|
q?: string;
|
|
@@ -10,10 +10,6 @@ export interface MessageQuery {
|
|
|
10
10
|
before?: string;
|
|
11
11
|
limit?: number;
|
|
12
12
|
}
|
|
13
|
-
export interface MessagePage {
|
|
14
|
-
messages: MessageRecord[];
|
|
15
|
-
nextCursor: string | null;
|
|
16
|
-
}
|
|
17
13
|
/** One command and one representation, independent of navigation. */
|
|
18
14
|
export declare class MessageRecordsClient {
|
|
19
15
|
private readonly operatorKey;
|
|
@@ -30,4 +26,4 @@ export declare class MessageRecordsClient {
|
|
|
30
26
|
}): Promise<MessagePage>;
|
|
31
27
|
controls(agreementId: string, taskId?: string): Promise<MessagingControls>;
|
|
32
28
|
}
|
|
33
|
-
export type { MessageCommand, MessageCommandResult, MessageRecord } from '@ziggs-ai/contracts';
|
|
29
|
+
export type { MessageCommand, MessageCommandResult, MessagePage, MessageRecord, ThreadCurrentPage } from '@ziggs-ai/contracts';
|
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.11",
|
|
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.50.
|
|
34
|
+
"@ziggs-ai/contracts": "0.50.8",
|
|
35
35
|
"socket.io-client": "^4.7.0"
|
|
36
36
|
},
|
|
37
37
|
"keywords": [
|