@ziggs-ai/api-client 0.9.10 → 0.9.12

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.
Files changed (63) hide show
  1. package/README.md +1 -1
  2. package/dist/ConnectionManager.d.ts +1 -1
  3. package/dist/ConnectionManager.js +1 -1
  4. package/dist/capabilities/agreements.d.ts +1 -1
  5. package/dist/capabilities/agreements.js +1 -1
  6. package/dist/capabilities/artifacts.d.ts +3 -3
  7. package/dist/capabilities/artifacts.js +6 -6
  8. package/dist/capabilities/chat.d.ts +4 -4
  9. package/dist/capabilities/chat.js +5 -5
  10. package/dist/capabilities/connections.js +13 -8
  11. package/dist/capabilities/context.d.ts +4 -4
  12. package/dist/capabilities/context.js +6 -6
  13. package/dist/capabilities/discovery.js +1 -1
  14. package/dist/capabilities/grants.d.ts +3 -3
  15. package/dist/capabilities/grants.js +3 -3
  16. package/dist/capabilities/links.js +1 -1
  17. package/dist/capabilities/marketplace.d.ts +1 -1
  18. package/dist/capabilities/marketplace.js +1 -1
  19. package/dist/capabilities/payments.js +1 -1
  20. package/dist/capabilities/proposeProviderId.d.ts +1 -1
  21. package/dist/capabilities/proposeProviderId.js +1 -1
  22. package/dist/capabilities/types.d.ts +3 -3
  23. package/dist/capabilities/types.js +2 -2
  24. package/dist/http/AgentSearchClient.d.ts +1 -2
  25. package/dist/http/AgreementClient.d.ts +11 -21
  26. package/dist/http/AgreementClient.js +29 -59
  27. package/dist/http/ArtifactsClient.d.ts +8 -8
  28. package/dist/http/ArtifactsClient.js +10 -10
  29. package/dist/http/ChatClient.d.ts +3 -3
  30. package/dist/http/ChatClient.js +6 -6
  31. package/dist/http/ConnectionsClient.d.ts +8 -8
  32. package/dist/http/ConnectionsClient.js +7 -7
  33. package/dist/http/ContextDiscoveryClient.d.ts +1 -1
  34. package/dist/http/ContextGrantsClient.d.ts +7 -7
  35. package/dist/http/ContextGrantsClient.js +3 -3
  36. package/dist/http/ContextReadClient.d.ts +3 -3
  37. package/dist/http/ContextReadClient.js +4 -4
  38. package/dist/http/GrantsClient.d.ts +4 -4
  39. package/dist/http/GrantsClient.js +1 -1
  40. package/dist/http/InboxClient.d.ts +9 -5
  41. package/dist/http/InboxClient.js +13 -6
  42. package/dist/http/MarketplaceClient.js +3 -3
  43. package/dist/http/OrgsClient.d.ts +10 -10
  44. package/dist/http/OrgsClient.js +11 -11
  45. package/dist/http/PaymentsClient.d.ts +4 -4
  46. package/dist/http/PaymentsClient.js +7 -7
  47. package/dist/http/TaskClient.d.ts +6 -6
  48. package/dist/http/TaskClient.js +3 -3
  49. package/dist/http/agreementFlows.d.ts +3 -3
  50. package/dist/http/agreementFlows.js +2 -2
  51. package/dist/http/grants.d.ts +1 -1
  52. package/dist/http/grants.js +1 -1
  53. package/dist/http/index.js +1 -1
  54. package/dist/http/operatorHeaders.d.ts +2 -2
  55. package/dist/http/operatorHeaders.js +2 -2
  56. package/dist/index.js +2 -2
  57. package/dist/shared/apiError.d.ts +1 -1
  58. package/dist/shared/apiError.js +1 -1
  59. package/dist/shared/rateLimit.d.ts +2 -2
  60. package/dist/shared/rateLimit.js +2 -2
  61. package/dist/types.d.ts +30 -28
  62. package/dist/types.js +4 -4
  63. package/package.json +2 -2
@@ -2,7 +2,7 @@ import { getBackendUrl } from '../utils/urlUtils.js';
2
2
  import { buildOperatorHeaders } from './operatorHeaders.js';
3
3
  import { throwApiError } from '../shared/apiError.js';
4
4
  /**
5
- * ZIG-411 context grant management — list / issue / delegate / revoke.
5
+ * context grant management — list / issue / delegate / revoke.
6
6
  */
7
7
  export class ContextGrantsClient {
8
8
  operatorKey;
@@ -71,7 +71,7 @@ export class ContextGrantsClient {
71
71
  return { status: 'granted', grant: parsed.grant };
72
72
  }
73
73
  /**
74
- * ZIG-870 — expand a grant you hold into the chat/agreement ids inside its
74
+ * expand a grant you hold into the chat/agreement ids inside its
75
75
  * scope. A grant is a fence, not a listing: discovery says "you hold
76
76
  * org:acme", this says which chats/agreements that covers. Holder-only,
77
77
  * labels-only, grant-fenced server-side.
@@ -96,7 +96,7 @@ export class ContextGrantsClient {
96
96
  };
97
97
  }
98
98
  /**
99
- * ZIG-1037 — share an artifact THIS agent authored with another agent.
99
+ * share an artifact THIS agent authored with another agent.
100
100
  *
101
101
  * Not a delegation: an agent holds no grant over its own output, so there is
102
102
  * no parent to attenuate. Authorship is the authority, held by the agent's
@@ -42,7 +42,7 @@ export interface ContextReadEnvelope<T = unknown> {
42
42
  nextCursor: string | null;
43
43
  latestSequence?: string | null;
44
44
  }
45
- /** Aggregated chat snapshot from `GET /context/snapshot` (ZIG-775 follow-up). */
45
+ /** Aggregated chat snapshot from `GET /context/snapshot` (follow-up). */
46
46
  export interface ContextSnapshotResult {
47
47
  history: unknown[];
48
48
  agreements: unknown[];
@@ -59,7 +59,7 @@ export interface ContextSnapshotResult {
59
59
  chatMissing?: boolean;
60
60
  }
61
61
  /**
62
- * Protocol-first uniform context reads (ZIG-427).
62
+ * Protocol-first uniform context reads.
63
63
  * Wraps `GET /context/read/:type` — one client, one envelope, four types.
64
64
  */
65
65
  export declare class ContextReadClient {
@@ -70,7 +70,7 @@ export declare class ContextReadClient {
70
70
  /**
71
71
  * @param operatorKey Agent-scoped or fleet operator key.
72
72
  * @param agentId Required for fleet keys (sent as X-Agent-Id). Omit for agent-scoped keys.
73
- * @param laneId ZIG-1092 — the wake's lane, sent as X-Ziggs-Lane. This is the
73
+ * @param laneId the wake's lane, sent as X-Ziggs-Lane. This is the
74
74
  * path the dogfood leak ran through: `via=artifact:<other customer's spec>`
75
75
  * was authorised purely because the same agent had authored it.
76
76
  */
@@ -49,7 +49,7 @@ export function parseVia(via) {
49
49
  : null;
50
50
  }
51
51
  /**
52
- * Protocol-first uniform context reads (ZIG-427).
52
+ * Protocol-first uniform context reads.
53
53
  * Wraps `GET /context/read/:type` — one client, one envelope, four types.
54
54
  */
55
55
  export class ContextReadClient {
@@ -60,7 +60,7 @@ export class ContextReadClient {
60
60
  /**
61
61
  * @param operatorKey Agent-scoped or fleet operator key.
62
62
  * @param agentId Required for fleet keys (sent as X-Agent-Id). Omit for agent-scoped keys.
63
- * @param laneId ZIG-1092 — the wake's lane, sent as X-Ziggs-Lane. This is the
63
+ * @param laneId the wake's lane, sent as X-Ziggs-Lane. This is the
64
64
  * path the dogfood leak ran through: `via=artifact:<other customer's spec>`
65
65
  * was authorised purely because the same agent had authored it.
66
66
  */
@@ -106,7 +106,7 @@ export class ContextReadClient {
106
106
  if (!res.ok) {
107
107
  // A 403 here is a legitimate outcome, not a transport failure: addressing
108
108
  // and authorisation are separate, so an agent can be told about mail it
109
- // is not (or is no longer) allowed to open. ZIG-1124 — one ApiError shape
109
+ // is not (or is no longer) allowed to open. one ApiError shape
110
110
  // (429 → RateLimitedError with Retry-After).
111
111
  throw pollSurfaceError(`ContextReadClient.read ${type}`, res, body);
112
112
  }
@@ -143,7 +143,7 @@ export class ContextReadClient {
143
143
  const res = await fetch(url.toString(), { headers });
144
144
  const body = await res.text().catch(() => '');
145
145
  if (!res.ok) {
146
- // ZIG-1124 — ApiError for every non-OK (429 → RateLimitedError).
146
+ // ApiError for every non-OK (429 → RateLimitedError).
147
147
  throw pollSurfaceError('ContextReadClient.snapshot', res, body);
148
148
  }
149
149
  return JSON.parse(body);
@@ -16,7 +16,7 @@ export interface ListGrantsQuery {
16
16
  scopeId?: string;
17
17
  /**
18
18
  * `'holder'` (default) = grants you hold. `'issuer'` = grants you caused
19
- * (ZIG-1217 for agents: author-shares + delegate children).
19
+ * (for agents: author-shares + delegate children).
20
20
  */
21
21
  role?: 'holder' | 'issuer';
22
22
  /** Filter to grants of one health. */
@@ -25,7 +25,7 @@ export interface ListGrantsQuery {
25
25
  limit?: number;
26
26
  }
27
27
  /**
28
- * ZIG-893 / ZIG-956 — a grant rail the caller's operator key cannot read, named
28
+ * a grant rail the caller's operator key cannot read, named
29
29
  * by the backend on `GET /grants` (it silently drops those rails from `items`,
30
30
  * so the unified list tool names what it isn't entitled to instead of
31
31
  * presenting a short list as if it were complete). Replaces the client-side
@@ -41,12 +41,12 @@ export interface ListGrantsResult {
41
41
  hasMore: boolean;
42
42
  /**
43
43
  * Rails the caller can't read, per the backend. Absent when the backend
44
- * predates ZIG-956 or every requested rail was readable.
44
+ * predates or every requested rail was readable.
45
45
  */
46
46
  unreadableRails?: UnreadableRail[];
47
47
  }
48
48
  /**
49
- * ZIG-648 — unified grant listing across every rail. `GET /grants` returns the
49
+ * unified grant listing across every rail. `GET /grants` returns the
50
50
  * canonical GrantView for each grant the caller holds (or, admin-gated, a named
51
51
  * holder), filterable by scope kind and health, with cursor pagination. Replaces
52
52
  * the old per-rail listers (context discovery, connection-grants,
@@ -2,7 +2,7 @@ import { getBackendUrl } from '../utils/urlUtils.js';
2
2
  import { throwApiError } from '../shared/apiError.js';
3
3
  import { buildOperatorHeaders } from './operatorHeaders.js';
4
4
  /**
5
- * ZIG-648 — unified grant listing across every rail. `GET /grants` returns the
5
+ * unified grant listing across every rail. `GET /grants` returns the
6
6
  * canonical GrantView for each grant the caller holds (or, admin-gated, a named
7
7
  * holder), filterable by scope kind and health, with cursor pagination. Replaces
8
8
  * the old per-rail listers (context discovery, connection-grants,
@@ -1,8 +1,8 @@
1
1
  import type { InboxAckResult, InboxEnvelope, InboxReadOptions } from '../types.js';
2
2
  /**
3
- * The doorbell, not the door (ZIG-434): references addressed to this agent
3
+ * The doorbell, not the door: references addressed to this agent
4
4
  * since its last ack — never content. Flow: inbox → read → act → ack
5
- * (ZIG-446). Wraps `GET /inbox` and `POST /inbox/ack`.
5
+ *. Wraps `GET /inbox` and `POST /inbox/ack`.
6
6
  */
7
7
  export declare class InboxClient {
8
8
  private readonly operatorKey;
@@ -17,9 +17,13 @@ export declare class InboxClient {
17
17
  private inboxUrl;
18
18
  getInbox(opts?: InboxReadOptions): Promise<InboxEnvelope>;
19
19
  /**
20
- * Advance this agent's watermark — pass the envelope's `ackTo`. Monotonic
20
+ * Advance this agent's watermark — pass the envelope's `ackTo` plus every
21
+ * `resourceId` handled in `(priorAck, upTo]` (ZIG-1305). Monotonic
21
22
  * server-side: an older value is a no-op, so a replayed ack can never
22
- * redeliver handled work.
23
+ * redeliver handled work. An ack that would bury unlisted deliveries is
24
+ * refused.
23
25
  */
24
- ack(upTo: string): Promise<InboxAckResult>;
26
+ ack(upTo: string, opts?: {
27
+ handledResourceIds?: string[];
28
+ }): Promise<InboxAckResult>;
25
29
  }
@@ -1,9 +1,9 @@
1
1
  import { getBackendUrl } from '../utils/urlUtils.js';
2
2
  import { pollSurfaceError } from '../shared/rateLimit.js';
3
3
  /**
4
- * The doorbell, not the door (ZIG-434): references addressed to this agent
4
+ * The doorbell, not the door: references addressed to this agent
5
5
  * since its last ack — never content. Flow: inbox → read → act → ack
6
- * (ZIG-446). Wraps `GET /inbox` and `POST /inbox/ack`.
6
+ *. Wraps `GET /inbox` and `POST /inbox/ack`.
7
7
  */
8
8
  export class InboxClient {
9
9
  operatorKey;
@@ -47,17 +47,24 @@ export class InboxClient {
47
47
  return JSON.parse(body);
48
48
  }
49
49
  /**
50
- * Advance this agent's watermark — pass the envelope's `ackTo`. Monotonic
50
+ * Advance this agent's watermark — pass the envelope's `ackTo` plus every
51
+ * `resourceId` handled in `(priorAck, upTo]` (ZIG-1305). Monotonic
51
52
  * server-side: an older value is a no-op, so a replayed ack can never
52
- * redeliver handled work.
53
+ * redeliver handled work. An ack that would bury unlisted deliveries is
54
+ * refused.
53
55
  */
54
- async ack(upTo) {
56
+ async ack(upTo, opts = {}) {
55
57
  if (!upTo)
56
58
  throw new Error('InboxClient.ack: upTo is required');
57
59
  const res = await fetch(`${this.baseUrl}/inbox/ack`, {
58
60
  method: 'POST',
59
61
  headers: this.headers(),
60
- body: JSON.stringify({ upTo }),
62
+ body: JSON.stringify({
63
+ upTo,
64
+ ...(opts.handledResourceIds
65
+ ? { handledResourceIds: opts.handledResourceIds }
66
+ : {}),
67
+ }),
61
68
  });
62
69
  const body = await res.text().catch(() => '');
63
70
  if (!res.ok) {
@@ -1,4 +1,4 @@
1
- // ZIG-1111: one shaping rule for every agreement this package parses.
1
+ // one shaping rule for every agreement this package parses.
2
2
  import { shapeAgreement } from './AgreementClient.js';
3
3
  import { getBackendUrl } from '../utils/urlUtils.js';
4
4
  import { throwApiError } from '../shared/apiError.js';
@@ -8,7 +8,7 @@ function buildHeaders(creds) {
8
8
  'content-type': 'application/json',
9
9
  Authorization: `Bearer ${creds.operatorKey}`,
10
10
  'X-Agent-Id': creds.agentId,
11
- // ZIG-1092 — the wake's lane, so the backend can fence this call to the
11
+ // the wake's lane, so the backend can fence this call to the
12
12
  // engagement it belongs to rather than the agent's whole authority.
13
13
  ...(creds.laneId ? { 'X-Ziggs-Lane': creds.laneId } : {}),
14
14
  };
@@ -114,7 +114,7 @@ export class MarketplaceClient {
114
114
  constructor(operatorKey, agentId) {
115
115
  if (!operatorKey)
116
116
  throw new Error('MarketplaceClient: operatorKey is required');
117
- // agentId may be absent for agent-scoped keys (ZIG-642); the Creds-based
117
+ // agentId may be absent for agent-scoped keys; the Creds-based
118
118
  // standalone functions still assert it per call.
119
119
  this.creds = { operatorKey, agentId };
120
120
  }
@@ -6,10 +6,10 @@ export interface MyOrg {
6
6
  role?: string;
7
7
  }
8
8
  /**
9
- * ZIG-739 / ZIG-956 — the operator's full org membership (not just granted
9
+ * the operator's full org membership (not just granted
10
10
  * scopes, which is all the grant listers see). Lets a delegate resolve an org
11
- * name to an id and offer a pick-list instead of demanding a pasted org_... id.
12
- * Moved here from ziggs-mcp so every surface rides the one client (ZIG-894).
11
+ * name to an id and offer a pick-list instead of demanding a pasted org_.. id.
12
+ * Moved here from ziggs-mcp so every surface rides the one client.
13
13
  */
14
14
  export declare function fetchMyOrgs(creds: Creds, baseUrl?: string): Promise<MyOrg[]>;
15
15
  export type OrgResolution = {
@@ -22,26 +22,26 @@ export type OrgResolution = {
22
22
  status: 'not-found';
23
23
  };
24
24
  /**
25
- * ZIG-739 — resolve an org selector (exact org_... id OR a name/handle) against
25
+ * resolve an org selector (exact org_.. id OR a name/handle) against
26
26
  * the operator's memberships. Exact id wins; otherwise case-insensitive name
27
27
  * match. Ambiguous names return the candidates rather than guessing.
28
28
  */
29
29
  export declare function resolveOrgSelector(orgs: MyOrg[], selector: string): OrgResolution;
30
- /** MCP OAuth auto-provisioned delegate id prefix (ZIG-545 / ZIG-852). */
30
+ /** MCP OAuth auto-provisioned delegate id prefix. */
31
31
  export declare const MCP_OAUTH_DELEGATE_AGENT_ID_PREFIX = "claude-delegate--";
32
32
  /** True when `agentId` is an inbound MCP OAuth auto-provisioned delegate. */
33
33
  export declare function isMcpOAuthDelegateAgentId(agentId: string): boolean;
34
34
  /**
35
- * ZIG-640 / ZIG-956 — runtime acting org from the server (self-hire / agent
35
+ * runtime acting org from the server (self-hire / agent
36
36
  * row): GET /agents/claude-delegate/access. Moved here from ziggs-mcp's inline
37
- * fetch (ZIG-894 "one client for every surface").
37
+ * fetch ( "one client for every surface").
38
38
  *
39
39
  * Only valid for MCP OAuth Claude-delegate sessions. Hosted / fleet
40
- * impersonation must use {@link fetchHostedAgentAccess} (ZIG-1272).
40
+ * impersonation must use {@link fetchHostedAgentAccess}.
41
41
  */
42
42
  export declare function fetchDelegateAccess(creds: Creds, baseUrl?: string): Promise<Record<string, unknown>>;
43
43
  /**
44
- * ZIG-1272 — session access for hosted / fleet impersonation (owner key +
44
+ * session access for hosted / fleet impersonation (owner key +
45
45
  * X-Agent-Id, or an agent-scoped key that is not a Claude OAuth delegate).
46
46
  *
47
47
  * `GET /agents/claude-delegate/access` refuses those credentials (or reports
@@ -50,7 +50,7 @@ export declare function fetchDelegateAccess(creds: Creds, baseUrl?: string): Pro
50
50
  */
51
51
  export declare function fetchHostedAgentAccess(creds: Creds, baseUrl?: string): Promise<Record<string, unknown>>;
52
52
  /**
53
- * ZIG-1272 — pick the access reader that matches the acting agent.
53
+ * pick the access reader that matches the acting agent.
54
54
  * Claude OAuth delegates → self-hire status; everything else → hosted path.
55
55
  */
56
56
  export declare function fetchSessionAccess(creds: Creds, baseUrl?: string): Promise<Record<string, unknown>>;
@@ -2,10 +2,10 @@ import { getBackendUrl } from '../utils/urlUtils.js';
2
2
  import { throwApiError } from '../shared/apiError.js';
3
3
  import { buildOperatorHeaders } from './operatorHeaders.js';
4
4
  /**
5
- * ZIG-739 / ZIG-956 — the operator's full org membership (not just granted
5
+ * the operator's full org membership (not just granted
6
6
  * scopes, which is all the grant listers see). Lets a delegate resolve an org
7
- * name to an id and offer a pick-list instead of demanding a pasted org_... id.
8
- * Moved here from ziggs-mcp so every surface rides the one client (ZIG-894).
7
+ * name to an id and offer a pick-list instead of demanding a pasted org_.. id.
8
+ * Moved here from ziggs-mcp so every surface rides the one client.
9
9
  */
10
10
  export async function fetchMyOrgs(creds, baseUrl) {
11
11
  const url = `${baseUrl || getBackendUrl()}/orgs/me`;
@@ -26,7 +26,7 @@ export async function fetchMyOrgs(creds, baseUrl) {
26
26
  }));
27
27
  }
28
28
  /**
29
- * ZIG-739 — resolve an org selector (exact org_... id OR a name/handle) against
29
+ * resolve an org selector (exact org_.. id OR a name/handle) against
30
30
  * the operator's memberships. Exact id wins; otherwise case-insensitive name
31
31
  * match. Ambiguous names return the candidates rather than guessing.
32
32
  */
@@ -42,19 +42,19 @@ export function resolveOrgSelector(orgs, selector) {
42
42
  return { status: 'ambiguous', matches: byName };
43
43
  return { status: 'not-found' };
44
44
  }
45
- /** MCP OAuth auto-provisioned delegate id prefix (ZIG-545 / ZIG-852). */
45
+ /** MCP OAuth auto-provisioned delegate id prefix. */
46
46
  export const MCP_OAUTH_DELEGATE_AGENT_ID_PREFIX = 'claude-delegate--';
47
47
  /** True when `agentId` is an inbound MCP OAuth auto-provisioned delegate. */
48
48
  export function isMcpOAuthDelegateAgentId(agentId) {
49
49
  return !!agentId && agentId.startsWith(MCP_OAUTH_DELEGATE_AGENT_ID_PREFIX);
50
50
  }
51
51
  /**
52
- * ZIG-640 / ZIG-956 — runtime acting org from the server (self-hire / agent
52
+ * runtime acting org from the server (self-hire / agent
53
53
  * row): GET /agents/claude-delegate/access. Moved here from ziggs-mcp's inline
54
- * fetch (ZIG-894 "one client for every surface").
54
+ * fetch ( "one client for every surface").
55
55
  *
56
56
  * Only valid for MCP OAuth Claude-delegate sessions. Hosted / fleet
57
- * impersonation must use {@link fetchHostedAgentAccess} (ZIG-1272).
57
+ * impersonation must use {@link fetchHostedAgentAccess}.
58
58
  */
59
59
  export async function fetchDelegateAccess(creds, baseUrl) {
60
60
  const url = `${baseUrl || getBackendUrl()}/agents/claude-delegate/access`;
@@ -69,7 +69,7 @@ export async function fetchDelegateAccess(creds, baseUrl) {
69
69
  return body ? JSON.parse(body) : {};
70
70
  }
71
71
  /**
72
- * ZIG-1272 — session access for hosted / fleet impersonation (owner key +
72
+ * session access for hosted / fleet impersonation (owner key +
73
73
  * X-Agent-Id, or an agent-scoped key that is not a Claude OAuth delegate).
74
74
  *
75
75
  * `GET /agents/claude-delegate/access` refuses those credentials (or reports
@@ -93,7 +93,7 @@ export async function fetchHostedAgentAccess(creds, baseUrl) {
93
93
  ? parsed.activeOrgId
94
94
  : null;
95
95
  const match = (parsed.orgs ?? []).find((o) => o.orgId === activeOrgId);
96
- // Prefer `activeOrg` (ZIG-1272) — membership list often omits the agent home
96
+ // Prefer `activeOrg` — membership list often omits the agent home
97
97
  // org under fleet impersonation.
98
98
  const fromActive = parsed.activeOrg;
99
99
  const orgName = (typeof fromActive?.name === 'string' && fromActive.name) ||
@@ -111,7 +111,7 @@ export async function fetchHostedAgentAccess(creds, baseUrl) {
111
111
  };
112
112
  }
113
113
  /**
114
- * ZIG-1272 — pick the access reader that matches the acting agent.
114
+ * pick the access reader that matches the acting agent.
115
115
  * Claude OAuth delegates → self-hire status; everything else → hosted path.
116
116
  */
117
117
  export async function fetchSessionAccess(creds, baseUrl) {
@@ -76,12 +76,12 @@ export type WaitForApprovalResult = {
76
76
  approval: PaymentApproval;
77
77
  };
78
78
  /**
79
- * ZIG-894 — the one payments client for every surface (agent-sdk, ziggs-mcp,
79
+ * the one payments client for every surface (agent-sdk, ziggs-mcp,
80
80
  * scripts). Consolidates the former agent-sdk private ZiggsPayClient. Wallet
81
81
  * ops ride the operator key; agent-impersonated calls send X-Agent-Id and are
82
82
  * policy-gated server-side (transfers above threshold return
83
83
  * `approval_required`). Wallet-rail grant mutations (issue / attenuate /
84
- * revoke) live here; grant *listing* is the unified GET /grants (ZIG-648).
84
+ * revoke) live here; grant *listing* is the unified GET /grants.
85
85
  */
86
86
  export declare class PaymentsClient {
87
87
  private readonly operatorKey;
@@ -106,7 +106,7 @@ export declare class PaymentsClient {
106
106
  description?: string;
107
107
  paymentGrantId?: string;
108
108
  }): Promise<HoldResult>;
109
- /** Prefer a single active wallet grant the agent already holds (ZIG-1182). */
109
+ /** Prefer a single active wallet grant the agent already holds. */
110
110
  private resolveAgentPaymentGrantId;
111
111
  release({ holdId, action, toWalletId, idempotencyKey, }: {
112
112
  holdId: string;
@@ -131,7 +131,7 @@ export declare class PaymentsClient {
131
131
  revokeGrant(grantId: string): Promise<RevokeGrantResult>;
132
132
  /**
133
133
  * Live wallet grants the acting agent holds, via the unified GET /grants
134
- * (ZIG-648 retired GET /payments/grants), following the cursor to completion.
134
+ * (retired GET /payments/grants), following the cursor to completion.
135
135
  */
136
136
  listGrants(): Promise<GrantView[]>;
137
137
  createTopUpIntent({ amount, description, currency, }?: {
@@ -6,12 +6,12 @@ function randomIdempotencyKey(prefix = 'op') {
6
6
  return `${prefix}_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 10)}`;
7
7
  }
8
8
  /**
9
- * ZIG-894 — the one payments client for every surface (agent-sdk, ziggs-mcp,
9
+ * the one payments client for every surface (agent-sdk, ziggs-mcp,
10
10
  * scripts). Consolidates the former agent-sdk private ZiggsPayClient. Wallet
11
11
  * ops ride the operator key; agent-impersonated calls send X-Agent-Id and are
12
12
  * policy-gated server-side (transfers above threshold return
13
13
  * `approval_required`). Wallet-rail grant mutations (issue / attenuate /
14
- * revoke) live here; grant *listing* is the unified GET /grants (ZIG-648).
14
+ * revoke) live here; grant *listing* is the unified GET /grants.
15
15
  */
16
16
  export class PaymentsClient {
17
17
  operatorKey;
@@ -50,7 +50,7 @@ export class PaymentsClient {
50
50
  throw new Error('transfer: `to` is required');
51
51
  if (!(Number.isInteger(amount) && amount > 0))
52
52
  throw new Error('transfer: `amount` must be a positive integer (cents)');
53
- // ZIG-1182 — resolve a standing/active grant when the caller omitted one
53
+ // resolve a standing/active grant when the caller omitted one
54
54
  // (Claude/MCP ensureForUser mints it). Explicit id still wins.
55
55
  if (this.agentId && !paymentGrantId) {
56
56
  paymentGrantId = (await this.resolveAgentPaymentGrantId()) ?? undefined;
@@ -93,7 +93,7 @@ export class PaymentsClient {
93
93
  async hold({ amount, idempotencyKey, description, paymentGrantId, }) {
94
94
  if (!(Number.isInteger(amount) && amount > 0))
95
95
  throw new Error('hold: `amount` must be a positive integer (cents)');
96
- // ZIG-1182 — agent holds reserve the owner's wallet; require a grant.
96
+ // agent holds reserve the owner's wallet; require a grant.
97
97
  if (this.agentId && !paymentGrantId) {
98
98
  paymentGrantId = (await this.resolveAgentPaymentGrantId()) ?? undefined;
99
99
  }
@@ -106,7 +106,7 @@ export class PaymentsClient {
106
106
  paymentGrantId,
107
107
  }));
108
108
  }
109
- /** Prefer a single active wallet grant the agent already holds (ZIG-1182). */
109
+ /** Prefer a single active wallet grant the agent already holds. */
110
110
  async resolveAgentPaymentGrantId() {
111
111
  try {
112
112
  const grants = await this.listGrants();
@@ -148,7 +148,7 @@ export class PaymentsClient {
148
148
  }
149
149
  /**
150
150
  * Live wallet grants the acting agent holds, via the unified GET /grants
151
- * (ZIG-648 retired GET /payments/grants), following the cursor to completion.
151
+ * (retired GET /payments/grants), following the cursor to completion.
152
152
  */
153
153
  async listGrants() {
154
154
  const grants = new GrantsClient(this.operatorKey, this.agentId, this.baseUrl);
@@ -239,7 +239,7 @@ export class PaymentsClient {
239
239
  const response = await fetch(`${this.baseUrl}${path}`, init);
240
240
  const text = await response.text();
241
241
  if (!response.ok) {
242
- // ZIG-1124 — ApiError; PaymentsError remains the duck type for `.status`.
242
+ // ApiError; PaymentsError remains the duck type for `.status`.
243
243
  throwApiError(response, text, `HTTP ${response.status}`);
244
244
  }
245
245
  return text ? JSON.parse(text) : null;
@@ -1,7 +1,7 @@
1
1
  import { type Creds, type Task, type TaskState } from '../types.js';
2
2
  /**
3
3
  * When the buyer reviews a task's plan. Task-rail only — an agreement has no
4
- * plan to review, which is why ZIG-1095 cut this from the propose/counter/
4
+ * plan to review, which is why cut this from the propose/counter/
5
5
  * subcontract inputs rather than teaching those routes to keep one.
6
6
  */
7
7
  export type PlanReviewTiming = 'with_proposal' | 'before_execution';
@@ -13,9 +13,9 @@ export interface CreateTaskData {
13
13
  planReviewTiming?: PlanReviewTiming;
14
14
  requireMidWorkPlanAck?: boolean;
15
15
  idempotencyKey?: string;
16
- /** Explicit delegation target (ZIG-586) — must be a party to the agreement; validated server-side. */
16
+ /** Explicit delegation target — must be a party to the agreement; validated server-side. */
17
17
  assigneeId?: string;
18
- /** ZIG-734: prior-step artifact handles consumed as structured input links. */
18
+ /** prior-step artifact handles consumed as structured input links. */
19
19
  inputArtifactIds?: string[];
20
20
  }
21
21
  export declare function createTask(taskData: CreateTaskData, creds: Creds): Promise<Task>;
@@ -38,10 +38,10 @@ export declare function getActiveTasksForChat(chatId: string, creds: Creds): Pro
38
38
  export declare function cancelTask(taskId: string, creds: Creds): Promise<Task>;
39
39
  export declare function getSubtasks(parentTaskId: string, creds: Creds): Promise<Task[]>;
40
40
  export interface PlanReplaceStep {
41
- /** Omit to let the server mint `step-<n>` (ZIG-1268). */
41
+ /** Omit to let the server mint `step-<n>`. */
42
42
  stepId?: string;
43
43
  description: string;
44
- /** Omit to use the array index (ZIG-1268). */
44
+ /** Omit to use the array index. */
45
45
  order?: number;
46
46
  /**
47
47
  * ZIG-1313: step progress. Omit for `pending`. Send `completed` /
@@ -60,7 +60,7 @@ export interface ListTasksOptions {
60
60
  state?: string;
61
61
  cursor?: string;
62
62
  limit?: number;
63
- /** Filter to tasks assigned to this id (ZIG-586). */
63
+ /** Filter to tasks assigned to this id. */
64
64
  assignedTo?: string;
65
65
  }
66
66
  export interface ListTasksResult {
@@ -6,7 +6,7 @@ function buildHeaders(creds) {
6
6
  'content-type': 'application/json',
7
7
  Authorization: `Bearer ${creds.operatorKey}`,
8
8
  'X-Agent-Id': creds.agentId,
9
- // ZIG-1092 — the wake's lane, so the backend can fence this call to the
9
+ // the wake's lane, so the backend can fence this call to the
10
10
  // engagement it belongs to rather than the agent's whole authority.
11
11
  ...(creds.laneId ? { 'X-Ziggs-Lane': creds.laneId } : {}),
12
12
  };
@@ -108,7 +108,7 @@ export async function getActiveTasksForAgent(agentId, creds) {
108
108
  const fromAgent = Array.isArray(data?.['tasks']) ? data['tasks'] : [];
109
109
  if (fromAgent.length > 0)
110
110
  return fromAgent;
111
- // Fallback when /agents/:id/tasks is empty but party-agreement tasks exist (ZIG-802).
111
+ // Fallback when /agents/:id/tasks is empty but party-agreement tasks exist.
112
112
  return getActiveTasksForAgentViaPartyAgreements(agentId, creds);
113
113
  }
114
114
  async function getActiveTasksForAgentViaPartyAgreements(agentId, creds) {
@@ -352,7 +352,7 @@ export class TaskClient {
352
352
  constructor(operatorKey, agentId) {
353
353
  if (!operatorKey)
354
354
  throw new Error('TaskClient: operatorKey is required');
355
- // agentId may be absent for agent-scoped keys (ZIG-642); the Creds-based
355
+ // agentId may be absent for agent-scoped keys; the Creds-based
356
356
  // standalone functions still assert it per call.
357
357
  this.creds = { operatorKey, agentId };
358
358
  }
@@ -1,7 +1,7 @@
1
1
  import { type ClaimedKind, type ProposeTerms } from './AgreementClient.js';
2
2
  import { type Agreement, type Creds, type EngagementKind } from '../types.js';
3
3
  /**
4
- * ZIG-1022 — one propose grammar. Direct, broadcast (quest and standing
4
+ * one propose grammar. Direct, broadcast (quest and standing
5
5
  * offer), and link proposals all flow through here; the surfaces expose a
6
6
  * single propose tool instead of dedicated publish/request tools.
7
7
  *
@@ -23,14 +23,14 @@ export declare function proposeUnified(input: UnifiedProposeInput, creds: Creds)
23
23
  shape: ProposeShape;
24
24
  }>;
25
25
  /**
26
- * ZIG-1021 — one claim verb for any open broadcast: link invite, quest,
26
+ * one claim verb for any open broadcast: link invite, quest,
27
27
  * hand-off, or standing offer.
28
28
  *
29
29
  * One request. This used to read the agreement first to decide which endpoint to
30
30
  * post to, and `GET /agreements/:id` is party-scoped — a claimer is by definition
31
31
  * not yet a party to the broadcast it is claiming, so the routing read 404'd and
32
32
  * every standing offer in the store failed with "Agreement not found" before
33
- * either claim endpoint was called (ZIG-1155). The backend routes it now, where
33
+ * either claim endpoint was called. The backend routes it now, where
34
34
  * the row is readable without being a party to it.
35
35
  *
36
36
  * `kind` arrives on the claim response — the route that did the routing reports
@@ -56,14 +56,14 @@ export async function proposeUnified(input, creds) {
56
56
  return { agreement, shape: 'direct' };
57
57
  }
58
58
  /**
59
- * ZIG-1021 — one claim verb for any open broadcast: link invite, quest,
59
+ * one claim verb for any open broadcast: link invite, quest,
60
60
  * hand-off, or standing offer.
61
61
  *
62
62
  * One request. This used to read the agreement first to decide which endpoint to
63
63
  * post to, and `GET /agreements/:id` is party-scoped — a claimer is by definition
64
64
  * not yet a party to the broadcast it is claiming, so the routing read 404'd and
65
65
  * every standing offer in the store failed with "Agreement not found" before
66
- * either claim endpoint was called (ZIG-1155). The backend routes it now, where
66
+ * either claim endpoint was called. The backend routes it now, where
67
67
  * the row is readable without being a party to it.
68
68
  *
69
69
  * `kind` arrives on the claim response — the route that did the routing reports
@@ -1,5 +1,5 @@
1
1
  /**
2
- * ZIG-646: the one grant shape the backend presents on the wire, mirrored for
2
+ * the one grant shape the backend presents on the wire, mirrored for
3
3
  * SDK consumers. Context, connection, and payment grants all serialise to this
4
4
  * exact object (see backend `src/grants/grant-view.ts`), so a caller reads one
5
5
  * shape to answer "what grants exist, and are they live?" regardless of rail.
@@ -10,7 +10,7 @@ export const CONTEXT_GRANT_SCOPE_KINDS = [
10
10
  'chat',
11
11
  'agreement',
12
12
  'org',
13
- // ZIG-1037: narrowest context scope
13
+ // narrowest context scope
14
14
  'artifact',
15
15
  ];
16
16
  /** Every scope kind across every rail: context + connection + payment. */
@@ -5,7 +5,7 @@ export * from './agreementFlows.js';
5
5
  export * from './ChatClient.js';
6
6
  export { MessagesClient } from './MessagesClient.js';
7
7
  export { ArtifactsClient,
8
- // ZIG-1032: agreement lanes are not chats — callers scope artifact writes with this.
8
+ // agreement lanes are not chats — callers scope artifact writes with this.
9
9
  artifactScopeForSession, AGREEMENT_LANE_PREFIX, } from './ArtifactsClient.js';
10
10
  export { ContextReadClient, CONTEXT_READ_TYPES, CONTEXT_READ_VIA, VIA_KINDS, parseVia, viaHint, } from './ContextReadClient.js';
11
11
  export { ContextDiscoveryClient } from './ContextDiscoveryClient.js';
@@ -1,11 +1,11 @@
1
1
  /**
2
2
  * Auth headers for operator-key HTTP clients. `X-Agent-Id` is only sent when
3
3
  * an agentId is present — agent-scoped keys identify the agent themselves;
4
- * fleet keys must pass one (ZIG-642).
4
+ * fleet keys must pass one.
5
5
  */
6
6
  export declare function buildOperatorHeaders(operatorKey: string, agentId?: string, extra?: Record<string, string>,
7
7
  /**
8
- * ZIG-1092 — the lane this call belongs to, sent as `X-Ziggs-Lane`. The
8
+ * the lane this call belongs to, sent as `X-Ziggs-Lane`. The
9
9
  * backend narrows the wake's reach to the engagement's orgs; omitting it
10
10
  * narrows to the agent's own org, so it can never widen reach.
11
11
  */
@@ -1,11 +1,11 @@
1
1
  /**
2
2
  * Auth headers for operator-key HTTP clients. `X-Agent-Id` is only sent when
3
3
  * an agentId is present — agent-scoped keys identify the agent themselves;
4
- * fleet keys must pass one (ZIG-642).
4
+ * fleet keys must pass one.
5
5
  */
6
6
  export function buildOperatorHeaders(operatorKey, agentId, extra,
7
7
  /**
8
- * ZIG-1092 — the lane this call belongs to, sent as `X-Ziggs-Lane`. The
8
+ * the lane this call belongs to, sent as `X-Ziggs-Lane`. The
9
9
  * backend narrows the wake's reach to the engagement's orgs; omitting it
10
10
  * narrows to the agent's own org, so it can never widen reach.
11
11
  */
package/dist/index.js CHANGED
@@ -4,10 +4,10 @@ export * from './relay/provisionRelayWorkers.js';
4
4
  export { ConnectionManager } from './ConnectionManager.js';
5
5
  export { EntryTypes, ContentTypes, OPEN_AGREEMENT_TARGET, ORG_AGREEMENT_TARGET, BROADCAST_TARGETS, isBroadcastTarget, isPersonaRef, isRoomPresentationRef, isOpaquePresentationRef, AGREEMENT_ENGAGEMENT_KIND, isValidContentType, } from './types.js';
6
6
  export { getBackendUrl } from './utils/urlUtils.js';
7
- // ZIG-652: the host injects the environment; this package never reads it.
7
+ // the host injects the environment; this package never reads it.
8
8
  export { configureApiClient, apiClientConfig } from './config.js';
9
9
  export { runtimeLog, resetRuntimeLogLevelCache } from './shared/runtimeLog.js';
10
- // ZIG-1019 / ZIG-1124: one ApiError shape; 429s carry the server's wait.
10
+ // one ApiError shape; 429s carry the server's wait.
11
11
  export { RateLimitedError, isRateLimited, parseRetryAfterMs, pollSurfaceError, } from './shared/rateLimit.js';
12
12
  // One reader for the one error shape the API answers in — exported so nothing has
13
13
  // to re-implement the field precedence (it was copy-pasted into six clients, and