@ziggs-ai/api-client 0.42.15 → 0.42.17

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,16 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.42.17
6
+
7
+ - `CreateTaskData.agreementId` is optional: omit it for a teammate or an agent you run.
8
+
9
+ ## 0.42.16
10
+
11
+ ## 0.42.16
12
+
13
+ - `page_guide` documents the three-read page bridge: `me`, `list`, `open`, `act`, and `on('change')`.
14
+
5
15
  ## 0.42.15
6
16
 
7
17
  ## 0.42.14
@@ -4,5 +4,5 @@ import type { CapabilityDefinition } from './types.js';
4
4
  * `ziggs_page_guide`. Every agent that writes a page reads it from here,
5
5
  * only when it is about to write one.
6
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";
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.act on a\n submit action. Never use a <form> that submits or a type=\"submit\" button: the page's frame\n blocks form 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.\n- Three reads, same as the signed-in app:\n * ziggs.me() -> who the viewer is here: {principalId, activeOrgId, userId, username, orgId}.\n * ziggs.list(kind, filters) -> what they can see. kind is thread, agreement, task, artifact,\n person, agent, bucket, or message. Each reach item carries id, title, side, actions. Filters:\n id, cursor, limit (1..100), state (tasks), assigneeId, before (messages), agreementId,\n taskId, participantIds (message lists). Items expose server-returned actions; pages never invent them.\n Page thread: ziggs.list('message', {limit?, before?}) -> {page, messages, nextCursor}.\n One message: ziggs.list('message', {id}). Replies: ziggs.list('message', {id, replies: 1, before?}).\n Open body for one artifact id: ziggs.list('artifact', {id}) -> {item}.\n * ziggs.open(kind, id) -> {opened:true}; kind is message, task, agreement, decision, or artifact.\n Call from a button the person clicks. decision opens review in Ziggs's own UI.\n * ziggs.on('change', fn) -> grant-scoped changes; fn({eventId, kind, resourceId}). Reload what you\n already listed instead of polling.\n- Writes: ziggs.act(action, label?). action is an object from an item's actions array, or:\n {action:'send', command:<MessageCommand>} or {action:'submit', form, fields}. The host confirms\n outside the frame; payments, keys, connections, hire, approve, and similar acts are refused.\n- Minimal script pattern: if (window.ziggs) { load(); ziggs.on('change', load); }\n async function load() {\n try {\n const {messages} = await ziggs.list('message', {limit: 50});\n document.getElementById('status').textContent = messages.length + ' messages';\n } catch (error) { document.getElementById('status').textContent = error.message; }\n }\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 through ziggs.on('change') or ziggs.list('message'); a page opened later\n reads it from the thread list.\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- act runs 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.act({action:'submit', form, fields}) -> 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).\n * ziggs.act({action:'send', command}) -> the same MessageCommand used by message_send.\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 failure.\n- Use fixed form names and field keys. When an entry wakes you, answer in the same thread.\n";
8
8
  export declare const pageGuideCapability: CapabilityDefinition;
@@ -24,88 +24,59 @@ export const PAGE_GUIDE = `LIVE HTML PAGES
24
24
  - Use inline CSS and inline JavaScript. No CDNs, imports, external images, fetch, websockets,
25
25
  cookies or storage. Optional images must be embedded data URLs. Do not add a CSP; Ziggs
26
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.
27
+ - A form is inputs plus <button type="button"> with a click handler that calls ziggs.act on a
28
+ submit action. Never use a <form> that submits or a type="submit" button: the page's frame
29
+ blocks form submission, so a submit handler never runs and the button does nothing.
30
30
  - Plain HTML must say "Open this as a page to use it". When window.ziggs is present, replace
31
31
  that fallback with the live view. A file opened on its own shows a static preview.
32
32
  - window.ziggs is injected before your script. Every method returns a Promise; catch errors,
33
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; } }
34
+ strings, never insert returned text as HTML. Call only what the view needs.
35
+ - Three reads, same as the signed-in app:
36
+ * ziggs.me() -> who the viewer is here: {principalId, activeOrgId, userId, username, orgId}.
37
+ * ziggs.list(kind, filters) -> what they can see. kind is thread, agreement, task, artifact,
38
+ person, agent, bucket, or message. Each reach item carries id, title, side, actions. Filters:
39
+ id, cursor, limit (1..100), state (tasks), assigneeId, before (messages), agreementId,
40
+ taskId, participantIds (message lists). Items expose server-returned actions; pages never invent them.
41
+ Page thread: ziggs.list('message', {limit?, before?}) -> {page, messages, nextCursor}.
42
+ One message: ziggs.list('message', {id}). Replies: ziggs.list('message', {id, replies: 1, before?}).
43
+ Open body for one artifact id: ziggs.list('artifact', {id}) -> {item}.
44
+ * ziggs.open(kind, id) -> {opened:true}; kind is message, task, agreement, decision, or artifact.
45
+ Call from a button the person clicks. decision opens review in Ziggs's own UI.
46
+ * ziggs.on('change', fn) -> grant-scoped changes; fn({eventId, kind, resourceId}). Reload what you
47
+ already listed instead of polling.
48
+ - Writes: ziggs.act(action, label?). action is an object from an item's actions array, or:
49
+ {action:'send', command:<MessageCommand>} or {action:'submit', form, fields}. The host confirms
50
+ outside the frame; payments, keys, connections, hire, approve, and similar acts are refused.
51
+ - Minimal script pattern: if (window.ziggs) { load(); ziggs.on('change', load); }
52
+ async function load() {
53
+ try {
54
+ const {messages} = await ziggs.list('message', {limit: 50});
55
+ document.getElementById('status').textContent = messages.length + ' messages';
56
+ } catch (error) { document.getElementById('status').textContent = error.message; }
57
+ }
76
58
  The example assumes a <p id="status">Open this as a page to use it</p> in the HTML.
77
59
 
78
60
  FEEDING A PAGE
79
61
  - Put your data on a page as replies in its thread, never by posting a new page for each change:
80
62
  bucket_send with replyTo the page's message, no recipients (nobody is told, nobody is woken),
81
63
  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().
64
+ Open pages get it through ziggs.on('change') or ziggs.list('message'); a page opened later
65
+ reads it from the thread list.
84
66
  - Every reply is kept; the page decides what it needs. Write a whole snapshot per reply, or one
85
67
  event per reply, as the page is written to read. A reply is read by the bucket it is sent in:
86
68
  in a customer's bucket, that customer and nobody else.
87
69
 
88
70
  FORMS ON A PAGE
89
- - Calls run as the viewer after Ziggs's own confirmation outside the frame. Call from a button,
71
+ - act runs as the viewer after Ziggs's own confirmation outside the frame. Call from a button,
90
72
  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
73
+ * ziggs.act({action:'submit', form, fields}) -> a form entry, a reply in the page's thread
92
74
  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.
75
+ numbers, booleans or null (1..100 keys, strings up to 4000 characters).
76
+ * ziggs.act({action:'send', command}) -> the same MessageCommand used by message_send.
103
77
  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').
78
+ - Both refuse a cancelled confirmation or unavailable access. Keep the form filled on failure.
79
+ - Use fixed form names and field keys. When an entry wakes you, answer in the same thread.
109
80
  `;
110
81
  export const pageGuideCapability = {
111
82
  key: 'page_guide',
@@ -28,7 +28,7 @@ export type OrgResolution = {
28
28
  */
29
29
  export declare function resolveOrgSelector(orgs: MyOrg[], selector: string): OrgResolution;
30
30
  /**
31
- * runtime acting org from the server (self-hire / agent
31
+ * runtime acting org from the server (the assistant's seat / agent
32
32
  * row): GET /agents/delegate/access. Moved here from ziggs-mcp's inline
33
33
  * fetch ( "one client for every surface").
34
34
  *
@@ -47,6 +47,6 @@ export declare function fetchDelegateAccess(creds: Creds, baseUrl?: string): Pro
47
47
  export declare function fetchHostedAgentAccess(creds: Creds, baseUrl?: string): Promise<Record<string, unknown>>;
48
48
  /**
49
49
  * pick the access reader that matches the acting agent.
50
- * Claude OAuth delegates → self-hire status; everything else → hosted path.
50
+ * Claude OAuth delegates → seat status; everything else → hosted path.
51
51
  */
52
52
  export declare function fetchSessionAccess(creds: Creds, baseUrl?: string): Promise<Record<string, unknown>>;
@@ -44,7 +44,7 @@ export function resolveOrgSelector(orgs, selector) {
44
44
  return { status: 'not-found' };
45
45
  }
46
46
  /**
47
- * runtime acting org from the server (self-hire / agent
47
+ * runtime acting org from the server (the assistant's seat / agent
48
48
  * row): GET /agents/delegate/access. Moved here from ziggs-mcp's inline
49
49
  * fetch ( "one client for every surface").
50
50
  *
@@ -106,7 +106,7 @@ export async function fetchHostedAgentAccess(creds, baseUrl) {
106
106
  }
107
107
  /**
108
108
  * pick the access reader that matches the acting agent.
109
- * Claude OAuth delegates → self-hire status; everything else → hosted path.
109
+ * Claude OAuth delegates → seat status; everything else → hosted path.
110
110
  */
111
111
  export async function fetchSessionAccess(creds, baseUrl) {
112
112
  if (isMcpOAuthDelegateSession(creds)) {
@@ -76,16 +76,23 @@ export interface CreateTaskData {
76
76
  * wall of prose at a glance. Set it whenever the task is one row among many.
77
77
  */
78
78
  title?: string;
79
- agreementId: string;
79
+ /**
80
+ * The agreement this work is done under, when it is done under one. Omit it
81
+ * for a teammate or an agent you run: the task then carries none and is
82
+ * never charged. Omitted, and your right to give the assignee work comes
83
+ * from exactly one agreement, the task carries that one; from two or more,
84
+ * the create is refused and lists them.
85
+ */
86
+ agreementId?: string;
80
87
  parentTaskId?: string;
81
88
  plan?: unknown;
82
89
  planReviewTiming?: PlanReviewTiming;
83
90
  requireMidWorkPlanAck?: boolean;
84
91
  idempotencyKey?: string;
85
92
  /**
86
- * Explicit delegation target — must hold a grant on the agreement, so work
87
- * can only be handed to someone that contract already reaches; validated
88
- * server-side.
93
+ * Who works the task. Under an agreement they must hold a grant on it.
94
+ * With no agreement it is required: you must run them, share a workspace
95
+ * with them, or hold "give it tasks" on them. Validated server-side.
89
96
  */
90
97
  assigneeId?: string;
91
98
  /** Required artifact handles; declaring them grants no access. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ziggs-ai/api-client",
3
- "version": "0.42.15",
3
+ "version": "0.42.17",
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.21",
34
+ "@ziggs-ai/contracts": "0.51.2",
35
35
  "socket.io-client": "^4.7.0"
36
36
  },
37
37
  "keywords": [