@ziggs-ai/api-client 0.9.10 → 0.9.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.
Files changed (62) 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/context.d.ts +4 -4
  11. package/dist/capabilities/context.js +6 -6
  12. package/dist/capabilities/discovery.js +1 -1
  13. package/dist/capabilities/grants.d.ts +3 -3
  14. package/dist/capabilities/grants.js +3 -3
  15. package/dist/capabilities/links.js +1 -1
  16. package/dist/capabilities/marketplace.d.ts +1 -1
  17. package/dist/capabilities/marketplace.js +1 -1
  18. package/dist/capabilities/payments.js +1 -1
  19. package/dist/capabilities/proposeProviderId.d.ts +1 -1
  20. package/dist/capabilities/proposeProviderId.js +1 -1
  21. package/dist/capabilities/types.d.ts +3 -3
  22. package/dist/capabilities/types.js +2 -2
  23. package/dist/http/AgentSearchClient.d.ts +1 -2
  24. package/dist/http/AgreementClient.d.ts +11 -21
  25. package/dist/http/AgreementClient.js +29 -59
  26. package/dist/http/ArtifactsClient.d.ts +8 -8
  27. package/dist/http/ArtifactsClient.js +10 -10
  28. package/dist/http/ChatClient.d.ts +3 -3
  29. package/dist/http/ChatClient.js +6 -6
  30. package/dist/http/ConnectionsClient.d.ts +8 -8
  31. package/dist/http/ConnectionsClient.js +7 -7
  32. package/dist/http/ContextDiscoveryClient.d.ts +1 -1
  33. package/dist/http/ContextGrantsClient.d.ts +7 -7
  34. package/dist/http/ContextGrantsClient.js +3 -3
  35. package/dist/http/ContextReadClient.d.ts +3 -3
  36. package/dist/http/ContextReadClient.js +4 -4
  37. package/dist/http/GrantsClient.d.ts +4 -4
  38. package/dist/http/GrantsClient.js +1 -1
  39. package/dist/http/InboxClient.d.ts +9 -5
  40. package/dist/http/InboxClient.js +13 -6
  41. package/dist/http/MarketplaceClient.js +3 -3
  42. package/dist/http/OrgsClient.d.ts +10 -10
  43. package/dist/http/OrgsClient.js +11 -11
  44. package/dist/http/PaymentsClient.d.ts +4 -4
  45. package/dist/http/PaymentsClient.js +7 -7
  46. package/dist/http/TaskClient.d.ts +6 -6
  47. package/dist/http/TaskClient.js +3 -3
  48. package/dist/http/agreementFlows.d.ts +3 -3
  49. package/dist/http/agreementFlows.js +2 -2
  50. package/dist/http/grants.d.ts +1 -1
  51. package/dist/http/grants.js +1 -1
  52. package/dist/http/index.js +1 -1
  53. package/dist/http/operatorHeaders.d.ts +2 -2
  54. package/dist/http/operatorHeaders.js +2 -2
  55. package/dist/index.js +2 -2
  56. package/dist/shared/apiError.d.ts +1 -1
  57. package/dist/shared/apiError.js +1 -1
  58. package/dist/shared/rateLimit.d.ts +2 -2
  59. package/dist/shared/rateLimit.js +2 -2
  60. package/dist/types.d.ts +30 -28
  61. package/dist/types.js +4 -4
  62. package/package.json +2 -2
@@ -26,7 +26,7 @@ export declare function parseErrorCode(responseBody: string): string | null;
26
26
  * not reproduce the hot-retry it is meant to stop.
27
27
  *
28
28
  * Lives next to {@link throwApiError} so every client path (not only the poll
29
- * surface) can honour the server's number (ZIG-1124).
29
+ * surface) can honour the server's number.
30
30
  */
31
31
  export declare function parseRetryAfterMs(headers: {
32
32
  get(name: string): string | null;
@@ -75,7 +75,7 @@ const MAX_RETRY_AFTER_MS = 120_000;
75
75
  * not reproduce the hot-retry it is meant to stop.
76
76
  *
77
77
  * Lives next to {@link throwApiError} so every client path (not only the poll
78
- * surface) can honour the server's number (ZIG-1124).
78
+ * surface) can honour the server's number.
79
79
  */
80
80
  export function parseRetryAfterMs(headers) {
81
81
  const explicit = headers.get('retry-after');
@@ -1,7 +1,7 @@
1
1
  import { ApiError, RateLimitedError } from '../types.js';
2
2
  import { parseRetryAfterMs } from './apiError.js';
3
3
  /**
4
- * ZIG-1019 — a 429 is not a generic failure, it is an instruction with a
4
+ * a 429 is not a generic failure, it is an instruction with a
5
5
  * deadline attached.
6
6
  *
7
7
  * The poll surface (`/inbox`, `/context/read`) is capped per actor, and every
@@ -14,7 +14,7 @@ import { parseRetryAfterMs } from './apiError.js';
14
14
  * `RateLimit-Reset` from the standard headers. These helpers carry that number
15
15
  * to whoever is doing the backing off.
16
16
  *
17
- * ZIG-1124 — {@link RateLimitedError} extends {@link ApiError}; non-429 poll
17
+ * {@link RateLimitedError} extends {@link ApiError}; non-429 poll
18
18
  * failures are ApiError too (same shape as {@link throwApiError}).
19
19
  */
20
20
  export { RateLimitedError, parseRetryAfterMs };
@@ -1,7 +1,7 @@
1
1
  import { ApiError, RateLimitedError } from '../types.js';
2
2
  import { parseErrorCode, parseErrorMessage, parseRetryAfterMs, } from './apiError.js';
3
3
  /**
4
- * ZIG-1019 — a 429 is not a generic failure, it is an instruction with a
4
+ * a 429 is not a generic failure, it is an instruction with a
5
5
  * deadline attached.
6
6
  *
7
7
  * The poll surface (`/inbox`, `/context/read`) is capped per actor, and every
@@ -14,7 +14,7 @@ import { parseErrorCode, parseErrorMessage, parseRetryAfterMs, } from './apiErro
14
14
  * `RateLimit-Reset` from the standard headers. These helpers carry that number
15
15
  * to whoever is doing the backing off.
16
16
  *
17
- * ZIG-1124 — {@link RateLimitedError} extends {@link ApiError}; non-429 poll
17
+ * {@link RateLimitedError} extends {@link ApiError}; non-429 poll
18
18
  * failures are ApiError too (same shape as {@link throwApiError}).
19
19
  */
20
20
  export { RateLimitedError, parseRetryAfterMs };
package/dist/types.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * One failure shape for every HTTP client path (ZIG-1124).
2
+ * One failure shape for every HTTP client path.
3
3
  *
4
4
  * `status` and optional machine `code` come from the response; `body` is the
5
5
  * raw text so callers can re-parse without scraping concatenated messages.
@@ -21,7 +21,7 @@ export interface Creds {
21
21
  operatorKey: string;
22
22
  agentId: string;
23
23
  /**
24
- * ZIG-1092 — the lane (chat id, or `agrn-<agreementId>`) this call is being
24
+ * the lane (chat id, or `agrn-<agreementId>`) this call is being
25
25
  * made from. Sent as `X-Ziggs-Lane` so the backend can fence the wake to the
26
26
  * engagement the agent is actually acting inside.
27
27
  *
@@ -49,10 +49,10 @@ export interface Task {
49
49
  agentId?: string;
50
50
  executorId?: string;
51
51
  payerId?: string;
52
- /** Explicit delegation target (ZIG-586) — id of the agent/user this task is assigned to, or null when unassigned. */
52
+ /** Explicit delegation target — id of the agent/user this task is assigned to, or null when unassigned. */
53
53
  assigneeId?: string | null;
54
54
  agreementId?: string;
55
- /** Compact reference to the governing agreement (ZIG-665). Read endpoints
55
+ /** Compact reference to the governing agreement. Read endpoints
56
56
  * never inline the full agreement — fetch it via getAgreement when the
57
57
  * paper-work (money, approvals) matters. */
58
58
  agreement?: AgreementSummary | null;
@@ -79,11 +79,11 @@ export type ProposalStatus = 'pending' | 'approved' | 'rejected' | 'countered' |
79
79
  export declare const AGREEMENT_ENGAGEMENT_KIND: {
80
80
  readonly HIRE: "hire";
81
81
  readonly SERVICE: "service";
82
- /** ZIG-481: a bilateral reach link between two agents (no money, no work). */
82
+ /** a bilateral reach link between two agents (no money, no work). */
83
83
  readonly LINK: "link";
84
84
  };
85
85
  export type EngagementKind = (typeof AGREEMENT_ENGAGEMENT_KIND)[keyof typeof AGREEMENT_ENGAGEMENT_KIND];
86
- /** Compact agreement reference carried by task reads (ZIG-665). */
86
+ /** Compact agreement reference carried by task reads. */
87
87
  export interface AgreementSummary {
88
88
  agreementId: string;
89
89
  description: string;
@@ -143,7 +143,7 @@ export interface Agreement {
143
143
  /** Set on a link that was formed by claiming the invite with this id. */
144
144
  linkInviteTemplateId?: string | null;
145
145
  /**
146
- * ZIG-997/ZIG-1059 — the provider slot is FIXED (a hand-off): claiming or
146
+ * the provider slot is FIXED (a hand-off): claiming or
147
147
  * approving this makes you the party the work is done FOR, not the worker —
148
148
  * and, when priced, the payer.
149
149
  */
@@ -190,13 +190,13 @@ export declare const BROADCAST_TARGETS: readonly ["everyone", "org"];
190
190
  export declare function isBroadcastTarget(id: string | null | undefined): boolean;
191
191
  /**
192
192
  * Persona face id (`psn_*`). Non-addressable — never use for agent lookup,
193
- * wake, or payment parties (ZIG-1137).
193
+ * wake, or payment parties.
194
194
  */
195
195
  export declare function isPersonaRef(id: string | null | undefined): boolean;
196
196
  /**
197
197
  * Room presentation binding id (`rpb_*`). Opaque to account lookup / wake /
198
198
  * pay. Chat sends may echo it as `receiverId` — the backend resolves it in-room
199
- * (ZIG-1137).
199
+ *.
200
200
  */
201
201
  export declare function isRoomPresentationRef(id: string | null | undefined): boolean;
202
202
  /** Either opaque presentation ref (`psn_*` | `rpb_*`). */
@@ -220,7 +220,7 @@ export interface PrincipalPresentation {
220
220
  }
221
221
  export interface MessageMetadata {
222
222
  chatId: string;
223
- /** Stable id for dedup across push + inbox catch-up (ZIG-454). */
223
+ /** Stable id for dedup across push + inbox catch-up. */
224
224
  messageId?: string;
225
225
  userId: string;
226
226
  sender: {
@@ -260,8 +260,8 @@ export interface MessageMetadata {
260
260
  operation?: string | null;
261
261
  agreementId?: string | null;
262
262
  /**
263
- * Message send time from the wire payload (ZIG-860). The live-path inbox
264
- * watermark ack (AgentHost, ZIG-832 P4) needs it — without a timestamp the
263
+ * Message send time from the wire payload. The live-path inbox
264
+ * watermark ack (AgentHost, P4) needs it — without a timestamp the
265
265
  * ack never fires and catch-up re-delivers the chat's whole backlog after a
266
266
  * host eviction, re-running already-answered goals.
267
267
  */
@@ -294,13 +294,13 @@ export interface InboxDeliveryRef {
294
294
  actorId: string | null;
295
295
  ts: string;
296
296
  /**
297
- * ZIG-703 — lifecycle hint when the server includes one (e.g.
297
+ * lifecycle hint when the server includes one (e.g.
298
298
  * `connection_request_fulfilled`). Absent on ordinary doorbells / older servers.
299
299
  */
300
300
  reason?: string | null;
301
- /** ZIG-703 — MCP connection after a fulfilled first-hop request. */
301
+ /** MCP connection after a fulfilled first-hop request. */
302
302
  connectionId?: string | null;
303
- /** ZIG-703 — grant minted for this agent on fulfill. */
303
+ /** grant minted for this agent on fulfill. */
304
304
  grantId?: string | null;
305
305
  }
306
306
  /** Message/artifact deliveries folded by chat, so you can open chats directly. */
@@ -314,11 +314,11 @@ export interface InboxProposalRef {
314
314
  title: string;
315
315
  proposedAt: string | null;
316
316
  /**
317
- * ZIG-1087 — party ids still owing a decision, and the named responder slot.
317
+ * party ids still owing a decision, and the named responder slot.
318
318
  * The inbox lists proposals awaiting the agent OR its human, and only the
319
319
  * agent's own slot is one it can submit; these say which is which.
320
320
  *
321
- * Optional because a backend deployed before ZIG-1087 omits them, and this
321
+ * Optional because a backend deployed before omits them, and this
322
322
  * client is installed independently of the server it talks to. Absent reads
323
323
  * as "no slot of mine", which routes the decision to the human — the safe
324
324
  * direction: it withholds a call, it never invents authority.
@@ -330,20 +330,20 @@ export interface InboxConnectionRequestRef {
330
330
  requestId: string;
331
331
  /**
332
332
  * Non-addressable persona reference for the requester (`psn_*`).
333
- * Never use as an account id for lookup / wake / pay (ZIG-1137).
333
+ * Never use as an account id for lookup / wake / pay.
334
334
  */
335
335
  requesterRef: string;
336
- /** ZIG-1039 — human-readable name for consent cards. */
336
+ /** human-readable name for consent cards. */
337
337
  requesterDisplayName?: string | null;
338
- /** ZIG-1039 — org label for consent cards. */
338
+ /** org label for consent cards. */
339
339
  requesterOrgName?: string | null;
340
340
  message: string | null;
341
341
  requestedAt: string | null;
342
- /** ZIG-1087 — see InboxProposalRef; a link request uses the same gate. */
342
+ /** see InboxProposalRef; a link request uses the same gate. */
343
343
  pendingApprovalPartyIds?: string[];
344
344
  proposedTo?: string | null;
345
345
  }
346
- /** Pull-only MCP: prompt the human when proposals need a decision (ZIG-482 / ZIG-481). */
346
+ /** Pull-only MCP: prompt the human when proposals need a decision. */
347
347
  export interface InboxHumanAttention {
348
348
  required: true;
349
349
  reason: 'proposals_awaiting_me' | 'connection_requests_awaiting_me' | 'multiple';
@@ -354,7 +354,7 @@ export interface InboxHumanAttention {
354
354
  promptUser: string;
355
355
  }
356
356
  /**
357
- * An open task assigned to this agent (ZIG-973). References only — read the
357
+ * An open task assigned to this agent. References only — read the
358
358
  * task for its description/plan/inputs.
359
359
  *
360
360
  * Tasks ride their own channel because assignment IS their delivery: before
@@ -369,7 +369,7 @@ export interface InboxTaskRef {
369
369
  updatedAt: string | null;
370
370
  }
371
371
  /**
372
- * A marketplace quest doorbell (ZIG-1185). Own channel so the host can
372
+ * A marketplace quest doorbell. Own channel so the host can
373
373
  * exact-match triage with zero LLM tokens before any wake.
374
374
  */
375
375
  export interface InboxQuestRef {
@@ -391,14 +391,16 @@ export interface InboxEnvelope {
391
391
  /** The chat-bearing deliveries above, folded by chat. */
392
392
  chats: InboxChatNews[];
393
393
  /**
394
- * Pass to `ack()` after acting. Null when there is nothing to ack. Ack after
395
- * acting, not after reading: a crash in between redelivers.
394
+ * Pass to `ack(upTo, { handledResourceIds })` after acting (ZIG-1305).
395
+ * Null when there is nothing to ack. Ack after acting, not after reading:
396
+ * a crash in between redelivers. Listing every handled resourceId is what
397
+ * stops a partial triage from burying other chats.
396
398
  */
397
399
  ackTo: string | null;
398
- /** Open tasks assigned to this agent — the work channel (ZIG-973). */
400
+ /** Open tasks assigned to this agent — the work channel. */
399
401
  tasksAwaitingMe: InboxTaskRef[];
400
402
  truncatedTasks: number;
401
- /** Unacked quest deliveries (ZIG-1185) — triaged before any LLM wake. */
403
+ /** Unacked quest deliveries — triaged before any LLM wake. */
402
404
  questsAwaitingMe?: InboxQuestRef[];
403
405
  truncatedQuests?: number;
404
406
  proposalsAwaitingMe: InboxProposalRef[];
package/dist/types.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * One failure shape for every HTTP client path (ZIG-1124).
2
+ * One failure shape for every HTTP client path.
3
3
  *
4
4
  * `status` and optional machine `code` come from the response; `body` is the
5
5
  * raw text so callers can re-parse without scraping concatenated messages.
@@ -31,7 +31,7 @@ export class RateLimitedError extends ApiError {
31
31
  export const AGREEMENT_ENGAGEMENT_KIND = {
32
32
  HIRE: 'hire',
33
33
  SERVICE: 'service',
34
- /** ZIG-481: a bilateral reach link between two agents (no money, no work). */
34
+ /** a bilateral reach link between two agents (no money, no work). */
35
35
  LINK: 'link',
36
36
  };
37
37
  /** ⚠️ SYNC: Keep in sync with backend src/chat/chat.types.ts ENTRY_TYPE */
@@ -79,7 +79,7 @@ export function isBroadcastTarget(id) {
79
79
  }
80
80
  /**
81
81
  * Persona face id (`psn_*`). Non-addressable — never use for agent lookup,
82
- * wake, or payment parties (ZIG-1137).
82
+ * wake, or payment parties.
83
83
  */
84
84
  export function isPersonaRef(id) {
85
85
  return typeof id === 'string' && id.startsWith('psn_');
@@ -87,7 +87,7 @@ export function isPersonaRef(id) {
87
87
  /**
88
88
  * Room presentation binding id (`rpb_*`). Opaque to account lookup / wake /
89
89
  * pay. Chat sends may echo it as `receiverId` — the backend resolves it in-room
90
- * (ZIG-1137).
90
+ *.
91
91
  */
92
92
  export function isRoomPresentationRef(id) {
93
93
  return typeof id === 'string' && id.startsWith('rpb_');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ziggs-ai/api-client",
3
- "version": "0.9.10",
3
+ "version": "0.9.11",
4
4
  "description": "HTTP and WebSocket client for the Ziggs backend API",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -27,7 +27,7 @@
27
27
  },
28
28
  "scripts": {
29
29
  "build": "tsc -p tsconfig.json",
30
- "prepack": "npm run build",
30
+ "prepack": "rm -rf dist && npm run build",
31
31
  "test": "node --import tsx/esm --test --test-reporter=spec test/*.test.ts",
32
32
  "test:watch": "node --import tsx/esm --test --watch test/*.test.ts"
33
33
  },