@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
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog — @ai-matrx/api
2
2
 
3
+ ## 0.1.9
4
+
5
+ Automatic changed-only republish (docs/metadata drift since the last tag — see
6
+ `git diff npm/api/v0.1.8..npm/api/v0.1.9 -- apps/shared/api`).
7
+ No source changes intended and no consumer action required.
8
+
9
+ ## 0.1.8
10
+
11
+ Automatic changed-only republish (docs/metadata drift since the last tag — see
12
+ `git diff npm/api/v0.1.7..npm/api/v0.1.8 -- apps/shared/api`).
13
+ No source changes intended and no consumer action required.
14
+
3
15
  ## 0.1.7
4
16
 
5
17
  **Fix: `@ai-matrx/api/credentials` types.** 0.1.6 re-exported auth's credentials with a bare
@@ -1,4 +1,4 @@
1
- import { A as Api, C as CallOptions } from './index-Xx6L_pWk.cjs';
1
+ import { A as Api, C as CallOptions } from './index-C3ZlP3BI.cjs';
2
2
  import { JsonValue, UserAnalysisPreferencesResponse } from './schemas.cjs';
3
3
  import '@ai-matrx/auth/credentials';
4
4
 
package/dist/account.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { A as Api, C as CallOptions } from './index-Xx6L_pWk.js';
1
+ import { A as Api, C as CallOptions } from './index-C3ZlP3BI.js';
2
2
  import { JsonValue, UserAnalysisPreferencesResponse } from './schemas.js';
3
3
  import '@ai-matrx/auth/credentials';
4
4
 
package/dist/agents.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkUO3H55R3_cjs = require('./chunk-UO3H55R3.cjs');
3
+ var chunkPMGKZ4FT_cjs = require('./chunk-PMGKZ4FT.cjs');
4
4
  require('./chunk-2SXAAKGV.cjs');
5
5
 
6
6
  // src/generated/agents.ts
@@ -46,15 +46,15 @@ function getToolById(api, args, options) {
46
46
  }
47
47
  var $agentsStartAgent = { m: "POST", p: "/ai/agent/{agent_id}", d: "aidream", a: "guest", o: "required", s: "ndjson_or_json", n: "agents.agents_start_agent" };
48
48
  function agentsStartAgent(api, args, options) {
49
- return chunkUO3H55R3_cjs.openJsonOrStream(api, $agentsStartAgent, args, options);
49
+ return chunkPMGKZ4FT_cjs.openJsonOrStream(api, $agentsStartAgent, args, options);
50
50
  }
51
51
  var $agentsStartAgentPost = { m: "POST", p: "/ai/agents/{agent_id}", d: "aidream", a: "guest", o: "required", s: "ndjson_or_json", n: "agents.agents_start_agent_post" };
52
52
  function agentsStartAgentPost(api, args, options) {
53
- return chunkUO3H55R3_cjs.openJsonOrStream(api, $agentsStartAgentPost, args, options);
53
+ return chunkPMGKZ4FT_cjs.openJsonOrStream(api, $agentsStartAgentPost, args, options);
54
54
  }
55
55
  var $startMandatedAgent = { m: "POST", p: "/ai/mandates/{mandate_key}", d: "aidream", a: "guest", o: "required", s: "ndjson", n: "agents.start_mandated_agent" };
56
56
  function startMandatedAgent(api, args, options) {
57
- return chunkUO3H55R3_cjs.openStream(api, $startMandatedAgent, args, options);
57
+ return chunkPMGKZ4FT_cjs.openStream(api, $startMandatedAgent, args, options);
58
58
  }
59
59
  var $invalidateAgentCache = { m: "POST", p: "/ai/agents/{agent_id}/invalidate-cache", d: "aidream", a: "guest", o: "required", n: "agents.invalidate_agent_cache" };
60
60
  function invalidateAgentCache(api, args, options) {
@@ -62,7 +62,7 @@ function invalidateAgentCache(api, args, options) {
62
62
  }
63
63
  var $mockStream = { m: "POST", p: "/ai/mock-stream/{scenario}", d: "aidream", a: "guest", o: "required", s: "ndjson", n: "agents.mock_stream" };
64
64
  function mockStream(api, args, options) {
65
- return chunkUO3H55R3_cjs.openStream(api, $mockStream, args, options);
65
+ return chunkPMGKZ4FT_cjs.openStream(api, $mockStream, args, options);
66
66
  }
67
67
  var $listScenarios = { m: "GET", p: "/ai/mock-stream/scenarios", d: "aidream", a: "guest", o: "optional", n: "agents.list_scenarios" };
68
68
  function listScenarios(api, args, options) {
@@ -78,11 +78,11 @@ function getUserPromptsAndBuiltins(api, args, options) {
78
78
  }
79
79
  var $startPrompt = { m: "POST", p: "/ai/prompts/{prompt_id}", d: "aidream", a: "guest", o: "required", s: "ndjson", n: "agents.start_prompt" };
80
80
  function startPrompt(api, args, options) {
81
- return chunkUO3H55R3_cjs.openStream(api, $startPrompt, args, options);
81
+ return chunkPMGKZ4FT_cjs.openStream(api, $startPrompt, args, options);
82
82
  }
83
83
  var $startAgentBlocks = { m: "POST", p: "/ai/agents-blocks/{agent_id}", d: "aidream", a: "guest", o: "required", s: "ndjson", n: "agents.start_agent_blocks" };
84
84
  function startAgentBlocks(api, args, options) {
85
- return chunkUO3H55R3_cjs.openStream(api, $startAgentBlocks, args, options);
85
+ return chunkPMGKZ4FT_cjs.openStream(api, $startAgentBlocks, args, options);
86
86
  }
87
87
  var $previewContext = { m: "POST", p: "/ai/context/preview", d: "aidream", a: "guest", o: "required", n: "agents.preview_context" };
88
88
  function previewContext(api, args, options) {
@@ -226,11 +226,11 @@ function judgeFirstRuns(api, args, options) {
226
226
  }
227
227
  var $agentFromChat = { m: "POST", p: "/agent-studio/from-chat", d: "aidream", a: "user", o: "required", s: "ndjson", n: "agents.agent_from_chat" };
228
228
  function agentFromChat(api, args, options) {
229
- return chunkUO3H55R3_cjs.openStream(api, $agentFromChat, args, options);
229
+ return chunkPMGKZ4FT_cjs.openStream(api, $agentFromChat, args, options);
230
230
  }
231
231
  var $adminAgentFromChat = { m: "POST", p: "/admin/agent-studio/from-chat", d: "aidream", a: "admin", o: "exempt", s: "ndjson", n: "agents.admin_agent_from_chat" };
232
232
  function adminAgentFromChat(api, args, options) {
233
- return chunkUO3H55R3_cjs.openStream(api, $adminAgentFromChat, args, options);
233
+ return chunkPMGKZ4FT_cjs.openStream(api, $adminAgentFromChat, args, options);
234
234
  }
235
235
  var $adminToolsListTools = { m: "GET", p: "/admin/tools", d: "aidream", a: "admin", o: "exempt", n: "agents.admin_tools_list_tools" };
236
236
  function adminToolsListTools(api, args, options) {
@@ -266,7 +266,7 @@ function getOrCreateTestSession(api, args, options) {
266
266
  }
267
267
  var $executeToolTest = { m: "POST", p: "/tools/test/execute", d: "aidream", a: "guest", o: "required", s: "ndjson", n: "agents.execute_tool_test" };
268
268
  function executeToolTest(api, args, options) {
269
- return chunkUO3H55R3_cjs.openStream(api, $executeToolTest, args, options);
269
+ return chunkPMGKZ4FT_cjs.openStream(api, $executeToolTest, args, options);
270
270
  }
271
271
  var $getDbSurfaceManifest = { m: "GET", p: "/surfaces/{client_name}/{surface_name}/manifest", d: "aidream", a: "guest", o: "exempt", n: "agents.get_db_surface_manifest" };
272
272
  function getDbSurfaceManifest(api, args, options) {
@@ -298,7 +298,7 @@ function previewVariableBinding(api, args, options) {
298
298
  }
299
299
  var $runMatrixBattle = { m: "POST", p: "/agent-battles/{set_id}/run", d: "aidream", a: "guest", o: "required", s: "ndjson", n: "agents.run_matrix_battle" };
300
300
  function runMatrixBattle(api, args, options) {
301
- return chunkUO3H55R3_cjs.openStream(api, $runMatrixBattle, args, options);
301
+ return chunkPMGKZ4FT_cjs.openStream(api, $runMatrixBattle, args, options);
302
302
  }
303
303
  var $cancelMatrixBattle = { m: "POST", p: "/agent-battles/{set_id}/cancel", d: "aidream", a: "guest", o: "required", n: "agents.cancel_matrix_battle" };
304
304
  function cancelMatrixBattle(api, args, options) {
package/dist/agents.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { A as Api, C as CallOptions, a as ApiStream, N as NdjsonEvent, J as JsonOrStream } from './index-Xx6L_pWk.cjs';
1
+ import { A as Api, C as CallOptions, a as ApiStream, N as NdjsonEvent, J as JsonOrStream } from './index-C3ZlP3BI.cjs';
2
2
  import { JsonValue, ContextAnchor, TextPart, ThinkingPart, ToolCallPart, ToolResultPart, UserImageMediaPart, UserAudioMediaPart, UserVideoMediaPart, UserDocumentMediaPart, UserYouTubeMediaPart, CodeExecPart, CodeResultPart, WebSearchPart, WebpageInputPart, NotesInputPart, TaskInputPart, AgentInputPart, ProjectInputPart, AgentAppInputPart, TranscriptInputPart, TranscriptSessionInputPart, WorkbookInputPart, DocumentInputPart, TableInputPart, ListInputPart, DataInputPart, ContextInputPart, RemarksInputPart, DecisionQuestionsPart, DecisionAnswersPart, SpeechScriptPart, LLMParams, AgentStartRequest, DirectiveItemApplied, DirectiveItemFailed, PageContext, RegisteredToolSpec, InlineToolSpec, AgentToolSpec, ClientContext, UserOverrides, ActionNeeded, PromptStartRequest } from './schemas.cjs';
3
3
  import '@ai-matrx/auth/credentials';
4
4
 
package/dist/agents.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { A as Api, C as CallOptions, a as ApiStream, N as NdjsonEvent, J as JsonOrStream } from './index-Xx6L_pWk.js';
1
+ import { A as Api, C as CallOptions, a as ApiStream, N as NdjsonEvent, J as JsonOrStream } from './index-C3ZlP3BI.js';
2
2
  import { JsonValue, ContextAnchor, TextPart, ThinkingPart, ToolCallPart, ToolResultPart, UserImageMediaPart, UserAudioMediaPart, UserVideoMediaPart, UserDocumentMediaPart, UserYouTubeMediaPart, CodeExecPart, CodeResultPart, WebSearchPart, WebpageInputPart, NotesInputPart, TaskInputPart, AgentInputPart, ProjectInputPart, AgentAppInputPart, TranscriptInputPart, TranscriptSessionInputPart, WorkbookInputPart, DocumentInputPart, TableInputPart, ListInputPart, DataInputPart, ContextInputPart, RemarksInputPart, DecisionQuestionsPart, DecisionAnswersPart, SpeechScriptPart, LLMParams, AgentStartRequest, DirectiveItemApplied, DirectiveItemFailed, PageContext, RegisteredToolSpec, InlineToolSpec, AgentToolSpec, ClientContext, UserOverrides, ActionNeeded, PromptStartRequest } from './schemas.js';
3
3
  import '@ai-matrx/auth/credentials';
4
4
 
package/dist/agents.js CHANGED
@@ -1,4 +1,4 @@
1
- import { openJsonOrStream, openStream } from './chunk-2FJPWNXG.js';
1
+ import { openJsonOrStream, openStream } from './chunk-PIVTHTVR.js';
2
2
  import './chunk-KIEAFMKB.js';
3
3
 
4
4
  // src/generated/agents.ts
package/dist/ai.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkUO3H55R3_cjs = require('./chunk-UO3H55R3.cjs');
3
+ var chunkPMGKZ4FT_cjs = require('./chunk-PMGKZ4FT.cjs');
4
4
  require('./chunk-2SXAAKGV.cjs');
5
5
 
6
6
  // src/generated/ai.ts
@@ -54,7 +54,7 @@ function listModels(api, args, options) {
54
54
  }
55
55
  var $chatCompletions = { m: "POST", p: "/v1/chat/completions", d: "matrx-local", a: "loopback_token", o: "exempt", s: "sse_or_json", n: "ai.chat_completions" };
56
56
  function chatCompletions(api, args, options) {
57
- return chunkUO3H55R3_cjs.openJsonOrStream(api, $chatCompletions, args, options);
57
+ return chunkPMGKZ4FT_cjs.openJsonOrStream(api, $chatCompletions, args, options);
58
58
  }
59
59
  var $audioSpeech = { m: "POST", p: "/v1/audio/speech", d: "matrx-local", a: "loopback_token", o: "exempt", n: "ai.audio_speech" };
60
60
  function audioSpeech(api, args, options) {
package/dist/ai.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { A as Api, C as CallOptions, J as JsonOrStream, S as SseEvent } from './index-Xx6L_pWk.cjs';
1
+ import { A as Api, C as CallOptions, J as JsonOrStream, S as SseEvent } from './index-C3ZlP3BI.cjs';
2
2
  import { JsonValue } from './schemas.cjs';
3
3
  import '@ai-matrx/auth/credentials';
4
4
 
package/dist/ai.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { A as Api, C as CallOptions, J as JsonOrStream, S as SseEvent } from './index-Xx6L_pWk.js';
1
+ import { A as Api, C as CallOptions, J as JsonOrStream, S as SseEvent } from './index-C3ZlP3BI.js';
2
2
  import { JsonValue } from './schemas.js';
3
3
  import '@ai-matrx/auth/credentials';
4
4
 
package/dist/ai.js CHANGED
@@ -1,4 +1,4 @@
1
- import { openJsonOrStream } from './chunk-2FJPWNXG.js';
1
+ import { openJsonOrStream } from './chunk-PIVTHTVR.js';
2
2
  import './chunk-KIEAFMKB.js';
3
3
 
4
4
  // src/generated/ai.ts
package/dist/apps.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkUO3H55R3_cjs = require('./chunk-UO3H55R3.cjs');
3
+ var chunkPMGKZ4FT_cjs = require('./chunk-PMGKZ4FT.cjs');
4
4
  require('./chunk-2SXAAKGV.cjs');
5
5
 
6
6
  // src/generated/apps.ts
@@ -218,7 +218,7 @@ function getInstallStatus(api, args, options) {
218
218
  }
219
219
  var $streamInstallProgress = { m: "GET", p: "/capabilities/install/stream", d: "matrx-local", a: "loopback_token", o: "exempt", s: "sse", n: "apps.stream_install_progress" };
220
220
  function streamInstallProgress(api, args, options) {
221
- return chunkUO3H55R3_cjs.openStream(api, $streamInstallProgress, args, options);
221
+ return chunkPMGKZ4FT_cjs.openStream(api, $streamInstallProgress, args, options);
222
222
  }
223
223
  var $tunnelStatus = { m: "GET", p: "/tunnel/status", d: "matrx-local", a: "public", o: "exempt", n: "apps.tunnel_status" };
224
224
  function tunnelStatus(api, args, options) {
@@ -238,15 +238,15 @@ function getSetupStatus(api, args, options) {
238
238
  }
239
239
  var $runInstall = { m: "POST", p: "/setup/install", d: "matrx-local", a: "loopback_open", o: "exempt", s: "sse", n: "apps.run_install" };
240
240
  function runInstall(api, args, options) {
241
- return chunkUO3H55R3_cjs.openStream(api, $runInstall, args, options);
241
+ return chunkPMGKZ4FT_cjs.openStream(api, $runInstall, args, options);
242
242
  }
243
243
  var $installTranscription = { m: "POST", p: "/setup/install-transcription", d: "matrx-local", a: "loopback_open", o: "exempt", s: "sse", n: "apps.install_transcription" };
244
244
  function installTranscription(api, args, options) {
245
- return chunkUO3H55R3_cjs.openStream(api, $installTranscription, args, options);
245
+ return chunkPMGKZ4FT_cjs.openStream(api, $installTranscription, args, options);
246
246
  }
247
247
  var $streamLogs = { m: "GET", p: "/setup/logs", d: "matrx-local", a: "loopback_open", o: "exempt", s: "sse", n: "apps.stream_logs" };
248
248
  function streamLogs(api, args, options) {
249
- return chunkUO3H55R3_cjs.openStream(api, $streamLogs, args, options);
249
+ return chunkPMGKZ4FT_cjs.openStream(api, $streamLogs, args, options);
250
250
  }
251
251
  var $debugState = { m: "GET", p: "/setup/debug", d: "matrx-local", a: "loopback_open", o: "exempt", n: "apps.debug_state" };
252
252
  function debugState(api, args, options) {
package/dist/apps.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { A as Api, C as CallOptions, a as ApiStream, S as SseEvent } from './index-Xx6L_pWk.cjs';
1
+ import { A as Api, C as CallOptions, a as ApiStream, S as SseEvent } from './index-C3ZlP3BI.cjs';
2
2
  import { JsonValue } from './schemas.cjs';
3
3
  import '@ai-matrx/auth/credentials';
4
4
 
package/dist/apps.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { A as Api, C as CallOptions, a as ApiStream, S as SseEvent } from './index-Xx6L_pWk.js';
1
+ import { A as Api, C as CallOptions, a as ApiStream, S as SseEvent } from './index-C3ZlP3BI.js';
2
2
  import { JsonValue } from './schemas.js';
3
3
  import '@ai-matrx/auth/credentials';
4
4
 
package/dist/apps.js CHANGED
@@ -1,4 +1,4 @@
1
- import { openStream } from './chunk-2FJPWNXG.js';
1
+ import { openStream } from './chunk-PIVTHTVR.js';
2
2
  import './chunk-KIEAFMKB.js';
3
3
 
4
4
  // src/generated/apps.ts
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkUO3H55R3_cjs = require('./chunk-UO3H55R3.cjs');
3
+ var chunkPMGKZ4FT_cjs = require('./chunk-PMGKZ4FT.cjs');
4
4
  require('./chunk-2SXAAKGV.cjs');
5
5
 
6
6
  // src/generated/architecture.ts
@@ -34,27 +34,27 @@ function servingCheck(api, args, options) {
34
34
  }
35
35
  var $searchAsKinds = { m: "POST", p: "/search-kinds/search", d: "aidream", a: "guest", o: "required", s: "ndjson", n: "architecture.search_as_kinds" };
36
36
  function searchAsKinds(api, args, options) {
37
- return chunkUO3H55R3_cjs.openStream(api, $searchAsKinds, args, options);
37
+ return chunkPMGKZ4FT_cjs.openStream(api, $searchAsKinds, args, options);
38
38
  }
39
39
  var $rankLandscapeAsKinds = { m: "POST", p: "/rank-kinds/landscape", d: "aidream", a: "guest", o: "required", s: "ndjson", n: "architecture.rank_landscape_as_kinds" };
40
40
  function rankLandscapeAsKinds(api, args, options) {
41
- return chunkUO3H55R3_cjs.openStream(api, $rankLandscapeAsKinds, args, options);
41
+ return chunkPMGKZ4FT_cjs.openStream(api, $rankLandscapeAsKinds, args, options);
42
42
  }
43
43
  var $ragSearchAsKinds = { m: "POST", p: "/rag-kinds/search", d: "aidream", a: "guest", o: "required", s: "ndjson", n: "architecture.rag_search_as_kinds" };
44
44
  function ragSearchAsKinds(api, args, options) {
45
- return chunkUO3H55R3_cjs.openStream(api, $ragSearchAsKinds, args, options);
45
+ return chunkPMGKZ4FT_cjs.openStream(api, $ragSearchAsKinds, args, options);
46
46
  }
47
47
  var $tableReadAsKinds = { m: "POST", p: "/table-kinds/read", d: "aidream", a: "guest", o: "required", s: "ndjson", n: "architecture.table_read_as_kinds" };
48
48
  function tableReadAsKinds(api, args, options) {
49
- return chunkUO3H55R3_cjs.openStream(api, $tableReadAsKinds, args, options);
49
+ return chunkPMGKZ4FT_cjs.openStream(api, $tableReadAsKinds, args, options);
50
50
  }
51
51
  var $scrapeAsKind = { m: "POST", p: "/scraper-kinds/scrape", d: "aidream", a: "guest", o: "required", s: "ndjson", n: "architecture.scrape_as_kind" };
52
52
  function scrapeAsKind(api, args, options) {
53
- return chunkUO3H55R3_cjs.openStream(api, $scrapeAsKind, args, options);
53
+ return chunkPMGKZ4FT_cjs.openStream(api, $scrapeAsKind, args, options);
54
54
  }
55
55
  var $scrapeManyAsKind = { m: "POST", p: "/scraper-kinds/scrape-many", d: "aidream", a: "guest", o: "required", s: "ndjson", n: "architecture.scrape_many_as_kind" };
56
56
  function scrapeManyAsKind(api, args, options) {
57
- return chunkUO3H55R3_cjs.openStream(api, $scrapeManyAsKind, args, options);
57
+ return chunkPMGKZ4FT_cjs.openStream(api, $scrapeManyAsKind, args, options);
58
58
  }
59
59
  var $saveOutput = { m: "POST", p: "/kind-outputs/save", d: "aidream", a: "guest", o: "required", n: "architecture.save_output" };
60
60
  function saveOutput(api, args, options) {
@@ -78,7 +78,7 @@ function operationStatus(api, args, options) {
78
78
  }
79
79
  var $rejoinOperationStream = { m: "POST", p: "/runtime/operations/{request_id}/rejoin", d: "aidream", a: "guest", o: "required", s: "ndjson", n: "architecture.rejoin_operation_stream" };
80
80
  function rejoinOperationStream(api, args, options) {
81
- return chunkUO3H55R3_cjs.openStream(api, $rejoinOperationStream, args, options);
81
+ return chunkPMGKZ4FT_cjs.openStream(api, $rejoinOperationStream, args, options);
82
82
  }
83
83
  var $operationsByLink = { m: "GET", p: "/runtime/operations/by-link/{link_kind}/{link_id}", d: "aidream", a: "guest", o: "optional", n: "architecture.operations_by_link" };
84
84
  function operationsByLink(api, args, options) {
@@ -90,7 +90,7 @@ function operationEvents(api, args, options) {
90
90
  }
91
91
  var $operationEventsStream = { m: "GET", p: "/runtime/executions/{execution_id}/events/stream", d: "aidream", a: "guest", o: "optional", s: "sse", n: "architecture.operation_events_stream" };
92
92
  function operationEventsStream(api, args, options) {
93
- return chunkUO3H55R3_cjs.openStream(api, $operationEventsStream, args, options);
93
+ return chunkPMGKZ4FT_cjs.openStream(api, $operationEventsStream, args, options);
94
94
  }
95
95
  var $listComputeTargets = { m: "GET", p: "/compute-targets/", d: "aidream", a: "user", o: "required", n: "architecture.list_compute_targets" };
96
96
  function listComputeTargets(api, args, options) {
@@ -690,7 +690,7 @@ function orchestratorProxyFsDelete(api, args, options) {
690
690
  }
691
691
  var $proxyExecStream = { m: "POST", p: "/sandboxes/{sandbox_id}/exec/stream", d: "sandbox-orchestrator", a: "scoped", o: "exempt", s: "sse", n: "architecture.proxy_exec_stream" };
692
692
  function proxyExecStream(api, args, options) {
693
- return chunkUO3H55R3_cjs.openStream(api, $proxyExecStream, args, options);
693
+ return chunkPMGKZ4FT_cjs.openStream(api, $proxyExecStream, args, options);
694
694
  }
695
695
  var $orchestratorProxyGit = { m: "GET", p: "/sandboxes/{sandbox_id}/git/{path}", d: "sandbox-orchestrator", a: "scoped", o: "exempt", n: "architecture.orchestrator_proxy_git" };
696
696
  function orchestratorProxyGit(api, args, options) {
@@ -1,4 +1,4 @@
1
- import { A as Api, C as CallOptions, a as ApiStream, S as SseEvent, N as NdjsonEvent } from './index-Xx6L_pWk.cjs';
1
+ import { A as Api, C as CallOptions, a as ApiStream, S as SseEvent, N as NdjsonEvent } from './index-C3ZlP3BI.cjs';
2
2
  import { JsonValue, ComputeNextDueResponse, SandboxBindingRequest, RunNowResponse, ValidateCronRequest, ValidateCronResponse, DirectiveItemApplied, DirectiveItemFailed } from './schemas.cjs';
3
3
  import '@ai-matrx/auth/credentials';
4
4
 
@@ -1,4 +1,4 @@
1
- import { A as Api, C as CallOptions, a as ApiStream, S as SseEvent, N as NdjsonEvent } from './index-Xx6L_pWk.js';
1
+ import { A as Api, C as CallOptions, a as ApiStream, S as SseEvent, N as NdjsonEvent } from './index-C3ZlP3BI.js';
2
2
  import { JsonValue, ComputeNextDueResponse, SandboxBindingRequest, RunNowResponse, ValidateCronRequest, ValidateCronResponse, DirectiveItemApplied, DirectiveItemFailed } from './schemas.js';
3
3
  import '@ai-matrx/auth/credentials';
4
4
 
@@ -1,4 +1,4 @@
1
- import { openStream } from './chunk-2FJPWNXG.js';
1
+ import { openStream } from './chunk-PIVTHTVR.js';
2
2
  import './chunk-KIEAFMKB.js';
3
3
 
4
4
  // src/generated/architecture.ts
package/dist/audio.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkUO3H55R3_cjs = require('./chunk-UO3H55R3.cjs');
3
+ var chunkPMGKZ4FT_cjs = require('./chunk-PMGKZ4FT.cjs');
4
4
  require('./chunk-2SXAAKGV.cjs');
5
5
 
6
6
  // src/generated/audio.ts
@@ -46,7 +46,7 @@ function textToSpeech(api, args, options) {
46
46
  }
47
47
  var $youtubeTranscript = { m: "POST", p: "/media/youtube/transcript", d: "aidream", a: "guest", o: "required", s: "ndjson", n: "audio.youtube_transcript" };
48
48
  function youtubeTranscript(api, args, options) {
49
- return chunkUO3H55R3_cjs.openStream(api, $youtubeTranscript, args, options);
49
+ return chunkPMGKZ4FT_cjs.openStream(api, $youtubeTranscript, args, options);
50
50
  }
51
51
  var $getStatus = { m: "GET", p: "/wake-word/status", d: "matrx-local", a: "loopback_token", o: "exempt", n: "audio.get_status" };
52
52
  function getStatus(api, args, options) {
@@ -82,7 +82,7 @@ function configureWakeWord(api, args, options) {
82
82
  }
83
83
  var $eventStream = { m: "GET", p: "/wake-word/stream", d: "matrx-local", a: "loopback_token", o: "exempt", s: "sse", n: "audio.event_stream" };
84
84
  function eventStream(api, args, options) {
85
- return chunkUO3H55R3_cjs.openStream(api, $eventStream, args, options);
85
+ return chunkPMGKZ4FT_cjs.openStream(api, $eventStream, args, options);
86
86
  }
87
87
  var $listModels = { m: "GET", p: "/wake-word/models", d: "matrx-local", a: "loopback_token", o: "exempt", n: "audio.list_models" };
88
88
  function listModels(api, args, options) {
@@ -94,7 +94,7 @@ function downloadOwwModel(api, args, options) {
94
94
  }
95
95
  var $downloadModelWithProgress = { m: "POST", p: "/wake-word/models/download-stream", d: "matrx-local", a: "loopback_token", o: "exempt", s: "sse", n: "audio.download_model_with_progress" };
96
96
  function downloadModelWithProgress(api, args, options) {
97
- return chunkUO3H55R3_cjs.openStream(api, $downloadModelWithProgress, args, options);
97
+ return chunkPMGKZ4FT_cjs.openStream(api, $downloadModelWithProgress, args, options);
98
98
  }
99
99
  var $ttsStatus = { m: "GET", p: "/tts/status", d: "matrx-local", a: "loopback_token", o: "exempt", n: "audio.tts_status" };
100
100
  function ttsStatus(api, args, options) {
package/dist/audio.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { A as Api, C as CallOptions, a as ApiStream, S as SseEvent, N as NdjsonEvent } from './index-Xx6L_pWk.cjs';
1
+ import { A as Api, C as CallOptions, a as ApiStream, S as SseEvent, N as NdjsonEvent } from './index-C3ZlP3BI.cjs';
2
2
  import { JsonValue } from './schemas.cjs';
3
3
  import '@ai-matrx/auth/credentials';
4
4
 
package/dist/audio.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { A as Api, C as CallOptions, a as ApiStream, S as SseEvent, N as NdjsonEvent } from './index-Xx6L_pWk.js';
1
+ import { A as Api, C as CallOptions, a as ApiStream, S as SseEvent, N as NdjsonEvent } from './index-C3ZlP3BI.js';
2
2
  import { JsonValue } from './schemas.js';
3
3
  import '@ai-matrx/auth/credentials';
4
4
 
package/dist/audio.js CHANGED
@@ -1,4 +1,4 @@
1
- import { openStream } from './chunk-2FJPWNXG.js';
1
+ import { openStream } from './chunk-PIVTHTVR.js';
2
2
  import './chunk-KIEAFMKB.js';
3
3
 
4
4
  // src/generated/audio.ts
package/dist/chat.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkUO3H55R3_cjs = require('./chunk-UO3H55R3.cjs');
3
+ var chunkPMGKZ4FT_cjs = require('./chunk-PMGKZ4FT.cjs');
4
4
  require('./chunk-2SXAAKGV.cjs');
5
5
 
6
6
  // src/generated/chat.ts
@@ -14,27 +14,27 @@ function conversationsWarmConversationPost(api, args, options) {
14
14
  }
15
15
  var $chat = { m: "POST", p: "/ai/manual", d: "aidream", a: "guest", o: "required", s: "ndjson_or_json", n: "chat.chat" };
16
16
  function chat(api, args, options) {
17
- return chunkUO3H55R3_cjs.openJsonOrStream(api, $chat, args, options);
17
+ return chunkPMGKZ4FT_cjs.openJsonOrStream(api, $chat, args, options);
18
18
  }
19
19
  var $chatPost = { m: "POST", p: "/ai/chat", d: "aidream", a: "guest", o: "required", s: "ndjson_or_json", n: "chat.chat_post" };
20
20
  function chatPost(api, args, options) {
21
- return chunkUO3H55R3_cjs.openJsonOrStream(api, $chatPost, args, options);
21
+ return chunkPMGKZ4FT_cjs.openJsonOrStream(api, $chatPost, args, options);
22
22
  }
23
23
  var $conversationsContinueConversation = { m: "POST", p: "/ai/conversation/{conversation_id}", d: "aidream", a: "guest", o: "required", s: "ndjson", n: "chat.conversations_continue_conversation" };
24
24
  function conversationsContinueConversation(api, args, options) {
25
- return chunkUO3H55R3_cjs.openStream(api, $conversationsContinueConversation, args, options);
25
+ return chunkPMGKZ4FT_cjs.openStream(api, $conversationsContinueConversation, args, options);
26
26
  }
27
27
  var $conversationsContinueConversationPost = { m: "POST", p: "/ai/conversations/{conversation_id}", d: "aidream", a: "guest", o: "required", s: "ndjson", n: "chat.conversations_continue_conversation_post" };
28
28
  function conversationsContinueConversationPost(api, args, options) {
29
- return chunkUO3H55R3_cjs.openStream(api, $conversationsContinueConversationPost, args, options);
29
+ return chunkPMGKZ4FT_cjs.openStream(api, $conversationsContinueConversationPost, args, options);
30
30
  }
31
31
  var $conversationsForkAndRun = { m: "POST", p: "/ai/conversation/{conversation_id}/fork-and-run", d: "aidream", a: "guest", o: "required", s: "ndjson", n: "chat.conversations_fork_and_run" };
32
32
  function conversationsForkAndRun(api, args, options) {
33
- return chunkUO3H55R3_cjs.openStream(api, $conversationsForkAndRun, args, options);
33
+ return chunkPMGKZ4FT_cjs.openStream(api, $conversationsForkAndRun, args, options);
34
34
  }
35
35
  var $conversationsForkAndRunPost = { m: "POST", p: "/ai/conversations/{conversation_id}/fork-and-run", d: "aidream", a: "guest", o: "required", s: "ndjson", n: "chat.conversations_fork_and_run_post" };
36
36
  function conversationsForkAndRunPost(api, args, options) {
37
- return chunkUO3H55R3_cjs.openStream(api, $conversationsForkAndRunPost, args, options);
37
+ return chunkPMGKZ4FT_cjs.openStream(api, $conversationsForkAndRunPost, args, options);
38
38
  }
39
39
  var $conversationsSubmitToolResults = { m: "POST", p: "/ai/conversation/{conversation_id}/tool_results", d: "aidream", a: "guest", o: "required", n: "chat.conversations_submit_tool_results" };
40
40
  function conversationsSubmitToolResults(api, args, options) {
@@ -90,11 +90,11 @@ function conversationsCancelInboxItemDelete(api, args, options) {
90
90
  }
91
91
  var $conversationsResumeConversation = { m: "POST", p: "/ai/conversation/{conversation_id}/resume", d: "aidream", a: "guest", o: "required", s: "ndjson", n: "chat.conversations_resume_conversation" };
92
92
  function conversationsResumeConversation(api, args, options) {
93
- return chunkUO3H55R3_cjs.openStream(api, $conversationsResumeConversation, args, options);
93
+ return chunkPMGKZ4FT_cjs.openStream(api, $conversationsResumeConversation, args, options);
94
94
  }
95
95
  var $conversationsResumeConversationPost = { m: "POST", p: "/ai/conversations/{conversation_id}/resume", d: "aidream", a: "guest", o: "required", s: "ndjson", n: "chat.conversations_resume_conversation_post" };
96
96
  function conversationsResumeConversationPost(api, args, options) {
97
- return chunkUO3H55R3_cjs.openStream(api, $conversationsResumeConversationPost, args, options);
97
+ return chunkPMGKZ4FT_cjs.openStream(api, $conversationsResumeConversationPost, args, options);
98
98
  }
99
99
  var $conversationsGetConversationSandbox = { m: "GET", p: "/ai/conversation/{conversation_id}/sandbox", d: "aidream", a: "guest", o: "optional", n: "chat.conversations_get_conversation_sandbox" };
100
100
  function conversationsGetConversationSandbox(api, args, options) {
@@ -146,11 +146,11 @@ function warmHealthRoute(api, args, options) {
146
146
  }
147
147
  var $directChat = { m: "POST", p: "/ai/chat/direct-chat", d: "aidream", a: "guest", o: "required", s: "ndjson", n: "chat.direct_chat" };
148
148
  function directChat(api, args, options) {
149
- return chunkUO3H55R3_cjs.openStream(api, $directChat, args, options);
149
+ return chunkPMGKZ4FT_cjs.openStream(api, $directChat, args, options);
150
150
  }
151
151
  var $promptExecution = { m: "POST", p: "/ai/chat/prompt-execution", d: "aidream", a: "guest", o: "required", s: "ndjson", n: "chat.prompt_execution" };
152
152
  function promptExecution(api, args, options) {
153
- return chunkUO3H55R3_cjs.openStream(api, $promptExecution, args, options);
153
+ return chunkPMGKZ4FT_cjs.openStream(api, $promptExecution, args, options);
154
154
  }
155
155
  var $v2ChatV2 = { m: "POST", p: "/v2/ai/manual", d: "aidream", a: "guest", o: "required", n: "chat.v2_chat_v2" };
156
156
  function v2ChatV2(api, args, options) {
package/dist/chat.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { A as Api, C as CallOptions, J as JsonOrStream, N as NdjsonEvent, a as ApiStream } from './index-Xx6L_pWk.cjs';
1
+ import { A as Api, C as CallOptions, J as JsonOrStream, N as NdjsonEvent, a as ApiStream } from './index-C3ZlP3BI.cjs';
2
2
  import { JsonValue, ResponseFormatText, ResponseFormatJsonObject, ResponseFormatJsonSchema, TtsVoiceSpeaker, TtsDialogueTurn, MediaRef, ImageLora, CustomTool, CompactionSettings, DictionaryConfig, ContextAnchor, ChatMessageInput, RegisteredToolSpec, InlineToolSpec, AgentToolSpec, ClientContext, UserOverrides, LLMParams, ResourceContextPolicy, IdeState, SandboxBindingRequest, PageContext, CacheBypass, TextPart, ThinkingPart, ToolCallPart, ToolResultPart, UserImageMediaPart, UserAudioMediaPart, UserVideoMediaPart, UserDocumentMediaPart, UserYouTubeMediaPart, CodeExecPart, CodeResultPart, WebSearchPart, WebpageInputPart, NotesInputPart, TaskInputPart, AgentInputPart, ProjectInputPart, AgentAppInputPart, TranscriptInputPart, TranscriptSessionInputPart, WorkbookInputPart, DocumentInputPart, TableInputPart, ListInputPart, DataInputPart, ContextInputPart, RemarksInputPart, DecisionQuestionsPart, DecisionAnswersPart, SpeechScriptPart, AgentStartRequest, PromptStartRequest, ActionNeeded } from './schemas.cjs';
3
3
  import '@ai-matrx/auth/credentials';
4
4
 
package/dist/chat.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { A as Api, C as CallOptions, J as JsonOrStream, N as NdjsonEvent, a as ApiStream } from './index-Xx6L_pWk.js';
1
+ import { A as Api, C as CallOptions, J as JsonOrStream, N as NdjsonEvent, a as ApiStream } from './index-C3ZlP3BI.js';
2
2
  import { JsonValue, ResponseFormatText, ResponseFormatJsonObject, ResponseFormatJsonSchema, TtsVoiceSpeaker, TtsDialogueTurn, MediaRef, ImageLora, CustomTool, CompactionSettings, DictionaryConfig, ContextAnchor, ChatMessageInput, RegisteredToolSpec, InlineToolSpec, AgentToolSpec, ClientContext, UserOverrides, LLMParams, ResourceContextPolicy, IdeState, SandboxBindingRequest, PageContext, CacheBypass, TextPart, ThinkingPart, ToolCallPart, ToolResultPart, UserImageMediaPart, UserAudioMediaPart, UserVideoMediaPart, UserDocumentMediaPart, UserYouTubeMediaPart, CodeExecPart, CodeResultPart, WebSearchPart, WebpageInputPart, NotesInputPart, TaskInputPart, AgentInputPart, ProjectInputPart, AgentAppInputPart, TranscriptInputPart, TranscriptSessionInputPart, WorkbookInputPart, DocumentInputPart, TableInputPart, ListInputPart, DataInputPart, ContextInputPart, RemarksInputPart, DecisionQuestionsPart, DecisionAnswersPart, SpeechScriptPart, AgentStartRequest, PromptStartRequest, ActionNeeded } from './schemas.js';
3
3
  import '@ai-matrx/auth/credentials';
4
4
 
package/dist/chat.js CHANGED
@@ -1,4 +1,4 @@
1
- import { openJsonOrStream, openStream } from './chunk-2FJPWNXG.js';
1
+ import { openJsonOrStream, openStream } from './chunk-PIVTHTVR.js';
2
2
  import './chunk-KIEAFMKB.js';
3
3
 
4
4
  // src/generated/chat.ts
@@ -451,6 +451,9 @@ var DEFAULT_MATRX_NDJSON_READ_AHEAD = 64;
451
451
  function isRecord2(value) {
452
452
  return typeof value === "object" && value !== null && !Array.isArray(value);
453
453
  }
454
+ function latencyMark(value) {
455
+ return typeof value.latency_mark === "string" ? { latency_mark: value.latency_mark } : {};
456
+ }
454
457
  function normalizeMatrxStreamEnvelope(value) {
455
458
  if (!isRecord2(value)) return null;
456
459
  if (typeof value.event === "string") {
@@ -460,7 +463,8 @@ function normalizeMatrxStreamEnvelope(value) {
460
463
  event: value.event,
461
464
  data: value.data,
462
465
  ...streamId === void 0 ? {} : { stream_id: streamId },
463
- ...streamSeq === void 0 ? {} : { stream_seq: streamSeq }
466
+ ...streamSeq === void 0 ? {} : { stream_seq: streamSeq },
467
+ ...latencyMark(value)
464
468
  };
465
469
  }
466
470
  if (value.e === "c" && typeof value.t === "string") {
@@ -470,7 +474,8 @@ function normalizeMatrxStreamEnvelope(value) {
470
474
  event: "chunk",
471
475
  data: { text: value.t },
472
476
  ...streamId === void 0 ? {} : { stream_id: streamId },
473
- ...streamSeq === void 0 ? {} : { stream_seq: streamSeq }
477
+ ...streamSeq === void 0 ? {} : { stream_seq: streamSeq },
478
+ ...latencyMark(value)
474
479
  };
475
480
  }
476
481
  if (value.e === "r" && typeof value.t === "string") {
@@ -480,7 +485,8 @@ function normalizeMatrxStreamEnvelope(value) {
480
485
  event: "reasoning_chunk",
481
486
  data: { text: value.t },
482
487
  ...streamId === void 0 ? {} : { stream_id: streamId },
483
- ...streamSeq === void 0 ? {} : { stream_seq: streamSeq }
488
+ ...streamSeq === void 0 ? {} : { stream_seq: streamSeq },
489
+ ...latencyMark(value)
484
490
  };
485
491
  }
486
492
  return null;
@@ -922,12 +928,13 @@ function createApi(options = {}) {
922
928
  headers["Content-Type"] = "application/json";
923
929
  }
924
930
  }
925
- Object.assign(headers, credentialToHeaders(await credentials.get()));
931
+ const credentialHeaders = credentialToHeaders(await credentials.get());
932
+ Object.assign(headers, credentialHeaders);
926
933
  if (orgId !== null) headers[MATRX_HEADERS.organization] = orgId;
927
934
  options.onRequest?.({ operation: op.n, method: op.m, url, requestId, deployment: op.d });
928
- const attempt = () => resilientFetch(
935
+ const attempt = (sendHeaders = headers) => resilientFetch(
929
936
  url,
930
- { method: op.m, headers, ...body !== void 0 ? { body } : {} },
937
+ { method: op.m, headers: sendHeaders, ...body !== void 0 ? { body } : {} },
931
938
  {
932
939
  ...call?.signal ? { signal: call.signal } : {},
933
940
  connectTimeoutMs: call?.connectTimeoutMs ?? options.connectTimeoutMs ?? DEFAULT_CONNECT_TIMEOUT_MS,
@@ -936,11 +943,19 @@ function createApi(options = {}) {
936
943
  }
937
944
  );
938
945
  const idempotent = op.m === "GET" || op.m === "HEAD";
939
- const { response, controller } = idempotent && retryAttempts > 1 && !op.s ? await withRetry(attempt, {
946
+ const { response, controller } = idempotent && retryAttempts > 1 && !op.s ? await withRetry(() => attempt(), {
940
947
  attempts: retryAttempts,
941
948
  retryOn: isTransportFailure,
942
949
  ...call?.signal ? { signal: call.signal } : {}
943
950
  }) : await attempt();
951
+ if (response.status === 401 && options.refreshCredentials && await options.refreshCredentials()) {
952
+ const retryHeaders = { ...headers };
953
+ for (const name of Object.keys(credentialHeaders)) delete retryHeaders[name];
954
+ Object.assign(retryHeaders, credentialToHeaders(await credentials.get()));
955
+ const retried = await attempt(retryHeaders);
956
+ if (!retried.response.ok) throw await errorFrom(retried.response, interpolate(op.p, args?.path));
957
+ return { response: retried.response, requestId, controller: retried.controller };
958
+ }
944
959
  if (!response.ok) throw await errorFrom(response, interpolate(op.p, args?.path));
945
960
  return { response, requestId, controller };
946
961
  };