@ai-matrx/api 0.1.7 → 0.1.9

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 (122) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/account.d.cts +1 -1
  3. package/dist/account.d.ts +1 -1
  4. package/dist/agents.cjs +11 -11
  5. package/dist/agents.d.cts +1 -1
  6. package/dist/agents.d.ts +1 -1
  7. package/dist/agents.js +1 -1
  8. package/dist/ai.cjs +2 -2
  9. package/dist/ai.d.cts +1 -1
  10. package/dist/ai.d.ts +1 -1
  11. package/dist/ai.js +1 -1
  12. package/dist/apps.cjs +5 -5
  13. package/dist/apps.d.cts +1 -1
  14. package/dist/apps.d.ts +1 -1
  15. package/dist/apps.js +1 -1
  16. package/dist/architecture.cjs +10 -10
  17. package/dist/architecture.d.cts +1 -1
  18. package/dist/architecture.d.ts +1 -1
  19. package/dist/architecture.js +1 -1
  20. package/dist/audio.cjs +4 -4
  21. package/dist/audio.d.cts +1 -1
  22. package/dist/audio.d.ts +1 -1
  23. package/dist/audio.js +1 -1
  24. package/dist/chat.cjs +11 -11
  25. package/dist/chat.d.cts +1 -1
  26. package/dist/chat.d.ts +1 -1
  27. package/dist/chat.js +1 -1
  28. package/dist/{chunk-2FJPWNXG.js → chunk-PIVTHTVR.js} +22 -7
  29. package/dist/{chunk-UO3H55R3.cjs → chunk-PMGKZ4FT.cjs} +22 -7
  30. package/dist/code.cjs +6 -6
  31. package/dist/code.d.cts +1 -1
  32. package/dist/code.d.ts +1 -1
  33. package/dist/code.js +1 -1
  34. package/dist/commerce.d.cts +1 -1
  35. package/dist/commerce.d.ts +1 -1
  36. package/dist/communications.cjs +4 -4
  37. package/dist/communications.d.cts +1 -1
  38. package/dist/communications.d.ts +1 -1
  39. package/dist/communications.js +1 -1
  40. package/dist/computer.cjs +3 -3
  41. package/dist/computer.d.cts +1 -1
  42. package/dist/computer.d.ts +1 -1
  43. package/dist/computer.js +1 -1
  44. package/dist/content.cjs +4 -4
  45. package/dist/content.d.cts +1 -1
  46. package/dist/content.d.ts +1 -1
  47. package/dist/content.js +1 -1
  48. package/dist/crm.cjs +2 -2
  49. package/dist/crm.d.cts +1 -1
  50. package/dist/crm.d.ts +1 -1
  51. package/dist/crm.js +1 -1
  52. package/dist/data.d.cts +1 -1
  53. package/dist/data.d.ts +1 -1
  54. package/dist/education.cjs +4 -4
  55. package/dist/education.d.cts +1 -1
  56. package/dist/education.d.ts +1 -1
  57. package/dist/education.js +1 -1
  58. package/dist/files.cjs +20 -20
  59. package/dist/files.d.cts +1 -1
  60. package/dist/files.d.ts +1 -1
  61. package/dist/files.js +1 -1
  62. package/dist/human-resources.d.cts +1 -1
  63. package/dist/human-resources.d.ts +1 -1
  64. package/dist/{index-Xx6L_pWk.d.cts → index-C3ZlP3BI.d.cts} +13 -1
  65. package/dist/{index-Xx6L_pWk.d.ts → index-C3ZlP3BI.d.ts} +13 -1
  66. package/dist/index.cjs +697 -53
  67. package/dist/index.d.cts +792 -12
  68. package/dist/index.d.ts +792 -12
  69. package/dist/index.js +636 -3
  70. package/dist/integrations.cjs +3 -3
  71. package/dist/integrations.d.cts +1 -1
  72. package/dist/integrations.d.ts +1 -1
  73. package/dist/integrations.js +1 -1
  74. package/dist/intelligence.cjs +19 -8
  75. package/dist/intelligence.d.cts +3 -648
  76. package/dist/intelligence.d.ts +3 -648
  77. package/dist/intelligence.js +14 -3
  78. package/dist/keys.generated-CK_C5UXG.d.cts +658 -0
  79. package/dist/keys.generated-CK_C5UXG.d.ts +658 -0
  80. package/dist/knowledge.cjs +42 -42
  81. package/dist/knowledge.d.cts +1 -1
  82. package/dist/knowledge.d.ts +1 -1
  83. package/dist/knowledge.js +1 -1
  84. package/dist/legal.cjs +6 -6
  85. package/dist/legal.d.cts +1 -1
  86. package/dist/legal.d.ts +1 -1
  87. package/dist/legal.js +1 -1
  88. package/dist/marketing.cjs +76 -76
  89. package/dist/marketing.d.cts +1 -1
  90. package/dist/marketing.d.ts +1 -1
  91. package/dist/marketing.js +1 -1
  92. package/dist/masterwork.cjs +32 -32
  93. package/dist/masterwork.d.cts +1 -1
  94. package/dist/masterwork.d.ts +1 -1
  95. package/dist/masterwork.js +1 -1
  96. package/dist/media.cjs +11 -11
  97. package/dist/media.d.cts +1 -1
  98. package/dist/media.d.ts +1 -1
  99. package/dist/media.js +1 -1
  100. package/dist/net.d.cts +1 -1
  101. package/dist/net.d.ts +1 -1
  102. package/dist/platform.cjs +3 -3
  103. package/dist/platform.d.cts +1 -1
  104. package/dist/platform.d.ts +1 -1
  105. package/dist/platform.js +1 -1
  106. package/dist/publish.cjs +7 -7
  107. package/dist/publish.d.cts +1 -1
  108. package/dist/publish.d.ts +1 -1
  109. package/dist/publish.js +1 -1
  110. package/dist/stream.cjs +10 -10
  111. package/dist/stream.d.cts +1 -1
  112. package/dist/stream.d.ts +1 -1
  113. package/dist/stream.js +1 -1
  114. package/dist/web.cjs +26 -26
  115. package/dist/web.d.cts +1 -1
  116. package/dist/web.d.ts +1 -1
  117. package/dist/web.js +1 -1
  118. package/dist/workflows.cjs +13 -13
  119. package/dist/workflows.d.cts +1 -1
  120. package/dist/workflows.d.ts +1 -1
  121. package/dist/workflows.js +1 -1
  122. package/package.json +4 -4
@@ -16,6 +16,11 @@ interface MatrxStreamEnvelope<TData = unknown> {
16
16
  data: TData;
17
17
  /** Monotonic transport sequence from full envelopes, when supplied. */
18
18
  stream_seq?: number;
19
+ /**
20
+ * The request's latency id, on the ONE frame the server wrote first after the AI
21
+ * provider responded. The client stamps its receipt (LEG 3 of the run's latency).
22
+ */
23
+ latency_mark?: string;
19
24
  }
20
25
  interface MatrxNdjsonIssue {
21
26
  line: string;
@@ -78,7 +83,7 @@ declare function createMatrxNdjsonFramer(options?: MatrxNdjsonFramerOptions): Ma
78
83
  declare function readMatrxNdjsonStream(body: ReadableStream<Uint8Array>, options?: ReadMatrxNdjsonOptions): AsyncGenerator<MatrxStreamEnvelope, void, undefined>;
79
84
 
80
85
  /**
81
- * `@ai-matrx/agents/stream/sse` — the Matrx SSE frame kernel.
86
+ * `@ai-matrx/api/stream` — the Matrx SSE frame kernel.
82
87
  *
83
88
  * Two Matrx clients hand-rolled the identical `text/event-stream` framing —
84
89
  * the same separator regex, the same field parsing, the same CRLF incident —
@@ -326,6 +331,13 @@ interface CreateApiOptions {
326
331
  retryAttempts?: number;
327
332
  /** Mints the `X-Request-Id`. Default `crypto.randomUUID()`. */
328
333
  requestId?: () => string;
334
+ /**
335
+ * Called once when the server answers 401: refresh the credential (e.g. the
336
+ * host's session refresh) and resolve `true` to retry the call ONCE with the
337
+ * fresh credential, `false` to surface the 401. A second 401 is never
338
+ * retried. Omit to surface every 401 as-is.
339
+ */
340
+ refreshCredentials?: () => Promise<boolean>;
329
341
  /** Extra headers on every call (never overrides credentials or org). */
330
342
  headers?: Record<string, string>;
331
343
  /** Observability sink; the client works fully without it. */
@@ -16,6 +16,11 @@ interface MatrxStreamEnvelope<TData = unknown> {
16
16
  data: TData;
17
17
  /** Monotonic transport sequence from full envelopes, when supplied. */
18
18
  stream_seq?: number;
19
+ /**
20
+ * The request's latency id, on the ONE frame the server wrote first after the AI
21
+ * provider responded. The client stamps its receipt (LEG 3 of the run's latency).
22
+ */
23
+ latency_mark?: string;
19
24
  }
20
25
  interface MatrxNdjsonIssue {
21
26
  line: string;
@@ -78,7 +83,7 @@ declare function createMatrxNdjsonFramer(options?: MatrxNdjsonFramerOptions): Ma
78
83
  declare function readMatrxNdjsonStream(body: ReadableStream<Uint8Array>, options?: ReadMatrxNdjsonOptions): AsyncGenerator<MatrxStreamEnvelope, void, undefined>;
79
84
 
80
85
  /**
81
- * `@ai-matrx/agents/stream/sse` — the Matrx SSE frame kernel.
86
+ * `@ai-matrx/api/stream` — the Matrx SSE frame kernel.
82
87
  *
83
88
  * Two Matrx clients hand-rolled the identical `text/event-stream` framing —
84
89
  * the same separator regex, the same field parsing, the same CRLF incident —
@@ -326,6 +331,13 @@ interface CreateApiOptions {
326
331
  retryAttempts?: number;
327
332
  /** Mints the `X-Request-Id`. Default `crypto.randomUUID()`. */
328
333
  requestId?: () => string;
334
+ /**
335
+ * Called once when the server answers 401: refresh the credential (e.g. the
336
+ * host's session refresh) and resolve `true` to retry the call ONCE with the
337
+ * fresh credential, `false` to surface the 401. A second 401 is never
338
+ * retried. Omit to surface every 401 as-is.
339
+ */
340
+ refreshCredentials?: () => Promise<boolean>;
329
341
  /** Extra headers on every call (never overrides credentials or org). */
330
342
  headers?: Record<string, string>;
331
343
  /** Observability sink; the client works fully without it. */