@ziggs-ai/api-client 0.10.4 → 0.11.0

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 (42) hide show
  1. package/dist/capabilities/agreementVerbs.d.ts +2 -2
  2. package/dist/capabilities/agreementVerbs.js +19 -19
  3. package/dist/capabilities/agreements.d.ts +1 -1
  4. package/dist/capabilities/agreements.js +5 -5
  5. package/dist/capabilities/artifacts.d.ts +4 -2
  6. package/dist/capabilities/artifacts.js +168 -33
  7. package/dist/capabilities/chat.d.ts +2 -3
  8. package/dist/capabilities/chat.js +5 -6
  9. package/dist/capabilities/connections.js +1 -1
  10. package/dist/capabilities/context.js +3 -0
  11. package/dist/capabilities/grants.d.ts +7 -6
  12. package/dist/capabilities/grants.js +9 -8
  13. package/dist/capabilities/index.d.ts +2 -2
  14. package/dist/capabilities/index.js +2 -2
  15. package/dist/capabilities/links.d.ts +1 -1
  16. package/dist/capabilities/links.js +5 -7
  17. package/dist/capabilities/marketplace.js +20 -14
  18. package/dist/capabilities/payments.d.ts +24 -8
  19. package/dist/capabilities/payments.js +28 -392
  20. package/dist/capabilities/proposeProviderId.d.ts +1 -1
  21. package/dist/capabilities/proposeProviderId.js +1 -1
  22. package/dist/http/AgreementClient.d.ts +24 -19
  23. package/dist/http/AgreementClient.js +22 -14
  24. package/dist/http/ChatClient.d.ts +1 -0
  25. package/dist/http/ChatClient.js +4 -1
  26. package/dist/http/ConnectionsClient.js +12 -1
  27. package/dist/http/ContextGrantsClient.d.ts +15 -1
  28. package/dist/http/ContextGrantsClient.js +2 -0
  29. package/dist/http/ContextReadClient.d.ts +14 -5
  30. package/dist/http/GrantsClient.d.ts +14 -0
  31. package/dist/http/GrantsClient.js +18 -2
  32. package/dist/http/MarketplaceClient.d.ts +6 -6
  33. package/dist/http/MarketplaceClient.js +11 -11
  34. package/dist/http/TaskClient.d.ts +5 -0
  35. package/dist/http/TaskClient.js +2 -0
  36. package/dist/http/agreementFlows.d.ts +4 -4
  37. package/dist/http/agreementFlows.js +9 -10
  38. package/dist/http/grants.d.ts +28 -0
  39. package/dist/http/index.d.ts +2 -2
  40. package/dist/index.d.ts +1 -1
  41. package/dist/types.d.ts +44 -15
  42. package/package.json +1 -1
package/dist/types.d.ts CHANGED
@@ -287,14 +287,34 @@ export type MessageHandler = (text: string, metadata: MessageMetadata) => Promis
287
287
  * on this side validates a delivery kind at runtime (the server does that on the
288
288
  * way in), and exhaustiveness checking is purely type-level.
289
289
  */
290
- export type InboxDeliveryKind = 'message' | 'artifact' | 'task-state' | 'agreement' | 'quest';
290
+ export type InboxDeliveryKind = 'message' | 'artifact' | 'task-state' | 'agreement' | 'request';
291
+ /** The two mailbox owners. Agents own no mailbox — they read through grants. */
292
+ export type InboxPartyKind = 'human' | 'org';
293
+ /** One mailbox this reader's merged view includes. */
294
+ export interface InboxSourceRef {
295
+ partyId: string;
296
+ partyKind: InboxPartyKind;
297
+ }
291
298
  /**
292
- * One thing addressed to this agent. A reference, never content — following it
293
- * (a chat read, a task read) is where this agent's grants are enforced.
299
+ * One row in this reader's merged view. A reference, never content — following
300
+ * it (a chat read, a task read) is where this agent's grants are enforced.
301
+ *
302
+ * "Mine to act on" is `assigneeId === my agent id`, nothing else. A row
303
+ * without my stamp is context I may read, never a wake and never mine to ack
304
+ * as handled.
294
305
  */
295
306
  export interface InboxDeliveryRef {
296
307
  kind: InboxDeliveryKind;
297
308
  resourceId: string;
309
+ /** One emit, one id — copies of the same event collapse on this. */
310
+ eventId: string;
311
+ /** The mailbox this copy lives in. */
312
+ partyId: string;
313
+ partyKind: InboxPartyKind;
314
+ /** The ONE agent stamped to act; null when nothing has to. */
315
+ assigneeId: string | null;
316
+ /** The owner's human should see this. */
317
+ needsHuman: boolean;
298
318
  chatId: string | null;
299
319
  agreementId: string | null;
300
320
  taskId: string | null;
@@ -377,10 +397,10 @@ export interface InboxTaskRef {
377
397
  updatedAt: string | null;
378
398
  }
379
399
  /**
380
- * A marketplace quest doorbell. Own channel so the host can
400
+ * A marketplace request doorbell. Own channel so the host can
381
401
  * exact-match triage with zero LLM tokens before any wake.
382
402
  */
383
- export interface InboxQuestRef {
403
+ export interface InboxRequestRef {
384
404
  agreementId: string;
385
405
  /** Exact-match string from the publisher — compare to the agent's tags. */
386
406
  match: string;
@@ -390,27 +410,36 @@ export interface InboxQuestRef {
390
410
  export interface InboxEnvelope {
391
411
  asOf: string;
392
412
  /**
393
- * Unacked deliveries addressed to this agent, newest first. This IS the
394
- * inbox — read straight out of the delivery log, not derived from grants.
413
+ * The mailboxes this reader's view merges — its owner's, plus whatever
414
+ * inbox grants add. Absent on older servers.
415
+ */
416
+ sources?: InboxSourceRef[];
417
+ /**
418
+ * Unacked rows across every source, newest first, copies of one event
419
+ * collapsed. This IS the inbox — read straight out of the party delivery
420
+ * logs, not derived from grants. Rows with `assigneeId === me` are mine to
421
+ * act on; the rest are readable context.
395
422
  */
396
423
  deliveries: InboxDeliveryRef[];
397
424
  /** True when there was more than one envelope's worth; the rest stay unacked. */
398
425
  deliveriesCapped: boolean;
399
- /** The chat-bearing deliveries above, folded by chat. */
426
+ /** This agent's ASSIGNED chat mail, folded by chat. */
400
427
  chats: InboxChatNews[];
401
428
  /**
402
- * Pass to `ack(upTo, { handledResourceIds })` after acting.
403
- * Null when there is nothing to ack. Ack after acting, not after reading:
404
- * a crash in between redelivers. Listing every handled resourceId is what
405
- * stops a partial triage from burying other chats.
429
+ * Opaque watermark bundle. Pass to `ack(upTo, { handledResourceIds })`
430
+ * VERBATIM after acting — never construct or parse one; the per-mailbox
431
+ * positions live inside the value. Null when there is nothing to ack. Ack
432
+ * after acting, not after reading: a crash in between redelivers. Listing
433
+ * every ASSIGNED resourceId is what stops a partial triage from burying
434
+ * work.
406
435
  */
407
436
  ackTo: string | null;
408
437
  /** Open tasks assigned to this agent — the work channel. */
409
438
  tasksAwaitingMe: InboxTaskRef[];
410
439
  truncatedTasks: number;
411
- /** Unacked quest deliveries — triaged before any LLM wake. */
412
- questsAwaitingMe?: InboxQuestRef[];
413
- truncatedQuests?: number;
440
+ /** Unacked request deliveries — triaged before any LLM wake. */
441
+ requestsAwaitingMe?: InboxRequestRef[];
442
+ truncatedRequests?: number;
414
443
  proposalsAwaitingMe: InboxProposalRef[];
415
444
  truncatedProposals: number;
416
445
  connectionRequestsAwaitingMe: InboxConnectionRequestRef[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ziggs-ai/api-client",
3
- "version": "0.10.4",
3
+ "version": "0.11.0",
4
4
  "description": "HTTP and WebSocket client for the Ziggs backend API",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",