@ai-matrx/api 0.1.27 → 0.1.29
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.
- package/CHANGELOG.md +28 -1
- package/dist/account.d.cts +2 -2
- package/dist/account.d.ts +2 -2
- package/dist/agents.cjs +11 -11
- package/dist/agents.d.cts +2 -2
- package/dist/agents.d.ts +2 -2
- package/dist/agents.js +1 -1
- package/dist/ai.cjs +2 -2
- package/dist/ai.d.cts +2 -2
- package/dist/ai.d.ts +2 -2
- package/dist/ai.js +1 -1
- package/dist/apps.cjs +5 -5
- package/dist/apps.d.cts +2 -2
- package/dist/apps.d.ts +2 -2
- package/dist/apps.js +1 -1
- package/dist/architecture.cjs +24 -12
- package/dist/architecture.d.cts +43 -3
- package/dist/architecture.d.ts +43 -3
- package/dist/architecture.js +12 -2
- package/dist/audio.cjs +39 -39
- package/dist/audio.d.cts +2 -2
- package/dist/audio.d.ts +2 -2
- package/dist/audio.js +2 -2
- package/dist/chat.cjs +11 -11
- package/dist/chat.d.cts +4 -2
- package/dist/chat.d.ts +4 -2
- package/dist/chat.js +1 -1
- package/dist/{chunk-OVQM6CSX.cjs → chunk-BI6C3CD7.cjs} +3 -3
- package/dist/{chunk-MFZXWYK6.js → chunk-BIHYNQOU.js} +1 -1
- package/dist/{chunk-BHSHMV22.cjs → chunk-G3OJBGCU.cjs} +1 -1
- package/dist/{chunk-6GYZDL2H.js → chunk-IAB7JCVA.js} +1 -1
- package/dist/{chunk-MKN4EXSQ.cjs → chunk-Q6BD7FVP.cjs} +37 -37
- package/dist/{chunk-OWI6FDHV.js → chunk-QCDALTHR.js} +1 -1
- package/dist/{chunk-76S6F7O3.cjs → chunk-VGXUUEFE.cjs} +4 -4
- package/dist/{chunk-G6FXF44G.js → chunk-Z2UOMPC4.js} +1 -1
- package/dist/code.cjs +6 -6
- package/dist/code.d.cts +2 -2
- package/dist/code.d.ts +2 -2
- package/dist/code.js +1 -1
- package/dist/commerce.d.cts +2 -2
- package/dist/commerce.d.ts +2 -2
- package/dist/communications.cjs +4 -4
- package/dist/communications.d.cts +2 -2
- package/dist/communications.d.ts +2 -2
- package/dist/communications.js +1 -1
- package/dist/computer.cjs +4 -4
- package/dist/computer.d.cts +2 -2
- package/dist/computer.d.ts +2 -2
- package/dist/computer.js +1 -1
- package/dist/content.cjs +4 -4
- package/dist/content.d.cts +2 -2
- package/dist/content.d.ts +2 -2
- package/dist/content.js +1 -1
- package/dist/crm.cjs +2 -2
- package/dist/crm.d.cts +2 -2
- package/dist/crm.d.ts +2 -2
- package/dist/crm.js +1 -1
- package/dist/data.cjs +10 -4
- package/dist/data.d.cts +49 -3
- package/dist/data.d.ts +49 -3
- package/dist/data.js +7 -2
- package/dist/education.cjs +4 -4
- package/dist/education.d.cts +2 -2
- package/dist/education.d.ts +2 -2
- package/dist/education.js +1 -1
- package/dist/files.cjs +228 -228
- package/dist/files.d.cts +2 -2
- package/dist/files.d.ts +2 -2
- package/dist/files.js +2 -2
- package/dist/human-resources.d.cts +2 -2
- package/dist/human-resources.d.ts +2 -2
- package/dist/{index-DseWSnYe.d.cts → index-DyDNKgdB.d.cts} +2 -2
- package/dist/{index-DseWSnYe.d.ts → index-DyDNKgdB.d.ts} +2 -2
- package/dist/index.cjs +86 -64
- package/dist/index.d.cts +13 -2
- package/dist/index.d.ts +13 -2
- package/dist/index.js +30 -8
- package/dist/integrations.cjs +5 -5
- package/dist/integrations.d.cts +2 -2
- package/dist/integrations.d.ts +2 -2
- package/dist/integrations.js +1 -1
- package/dist/intelligence.cjs +6 -6
- package/dist/intelligence.d.cts +2 -2
- package/dist/intelligence.d.ts +2 -2
- package/dist/intelligence.js +1 -1
- package/dist/knowledge.cjs +42 -42
- package/dist/knowledge.d.cts +2 -2
- package/dist/knowledge.d.ts +2 -2
- package/dist/knowledge.js +1 -1
- package/dist/legal.cjs +6 -6
- package/dist/legal.d.cts +2 -2
- package/dist/legal.d.ts +2 -2
- package/dist/legal.js +1 -1
- package/dist/marketing.cjs +78 -78
- package/dist/marketing.d.cts +2 -2
- package/dist/marketing.d.ts +2 -2
- package/dist/marketing.js +1 -1
- package/dist/masterwork.cjs +32 -32
- package/dist/masterwork.d.cts +2 -2
- package/dist/masterwork.d.ts +2 -2
- package/dist/masterwork.js +1 -1
- package/dist/media.cjs +11 -11
- package/dist/media.d.cts +2 -2
- package/dist/media.d.ts +2 -2
- package/dist/media.js +1 -1
- package/dist/platform.cjs +27 -27
- package/dist/platform.d.cts +2 -2
- package/dist/platform.d.ts +2 -2
- package/dist/platform.js +2 -2
- package/dist/publish.cjs +7 -7
- package/dist/publish.d.cts +2 -2
- package/dist/publish.d.ts +2 -2
- package/dist/publish.js +1 -1
- package/dist/recording.cjs +17 -17
- package/dist/recording.js +4 -4
- package/dist/schemas.d.cts +1 -1
- package/dist/schemas.d.ts +1 -1
- package/dist/stream.cjs +10 -10
- package/dist/stream.d.cts +1 -1
- package/dist/stream.d.ts +1 -1
- package/dist/stream.js +1 -1
- package/dist/types.d.cts +107 -5
- package/dist/types.d.ts +107 -5
- package/dist/web.cjs +26 -26
- package/dist/web.d.cts +2 -2
- package/dist/web.d.ts +2 -2
- package/dist/web.js +1 -1
- package/dist/workflows.cjs +19 -13
- package/dist/workflows.d.cts +33 -3
- package/dist/workflows.d.ts +33 -3
- package/dist/workflows.js +7 -2
- package/package.json +2 -2
package/dist/files.d.cts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { A as Api, C as CallOptions, a as ApiStream, N as NdjsonEvent, J as JsonOrStream, S as SseEvent } from './index-
|
|
1
|
+
import { A as Api, C as CallOptions, a as ApiStream, N as NdjsonEvent, J as JsonOrStream, S as SseEvent } from './index-DyDNKgdB.cjs';
|
|
2
2
|
import { JsonValue, Asset, MediaRef, UserAnalysisPreferencesResponse, StorageImportResult } from './schemas.cjs';
|
|
3
3
|
import '@ai-matrx/auth/credentials';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* GENERATED by @ai-matrx/api scripts/generate.mjs from aidream/api-contract — never edit by hand.
|
|
7
|
-
* CONTRACT_SHA256
|
|
7
|
+
* CONTRACT_SHA256 2e22230d01e754f5ae210e0932290279956cc04757022cfee77b6d128f1c667c
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/** ActivePageIdsResponse */
|
package/dist/files.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { A as Api, C as CallOptions, a as ApiStream, N as NdjsonEvent, J as JsonOrStream, S as SseEvent } from './index-
|
|
1
|
+
import { A as Api, C as CallOptions, a as ApiStream, N as NdjsonEvent, J as JsonOrStream, S as SseEvent } from './index-DyDNKgdB.js';
|
|
2
2
|
import { JsonValue, Asset, MediaRef, UserAnalysisPreferencesResponse, StorageImportResult } from './schemas.js';
|
|
3
3
|
import '@ai-matrx/auth/credentials';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* GENERATED by @ai-matrx/api scripts/generate.mjs from aidream/api-contract — never edit by hand.
|
|
7
|
-
* CONTRACT_SHA256
|
|
7
|
+
* CONTRACT_SHA256 2e22230d01e754f5ae210e0932290279956cc04757022cfee77b6d128f1c667c
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/** ActivePageIdsResponse */
|
package/dist/files.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { activePagesEndpoint, addGroupMember, appGenerateDirectoryStructure, appGenerateDirectoryStructurePost, assetsPdfCompress, assetsPdfCompressMultipart, assetsPreview, assetsPreviewMultipart, authorizeStorage, batchExtract, boxCallback, browseProviderFolder, bulkDeleteFiles, bulkFromCandidatesEndpoint, bulkMoveFiles, bulkMoveFolders, bulkOpDiscriminator, call, cancelDownload, childFileShare, classifyPagesEndpoint, cleanDocumentContent, cloudDebug, cloudFilesBridgeDeleteFile, cloudFilesBridgeGetFile, cloudFilesBridgeListFiles, cloudInstanceDryRun, compressPdf, configureSync, convertOfficePdf, copyFile, createAnnotationEndpoint, createEntityEndpoint, createFileShareLink, createFolder, createFolderShareLink, createGroup, createMapping, createNode, createPresignedUpload, cropPages, deactivateShareLink, deleteAnnotationEndpoint, deleteEntityEndpoint, deleteFolder, deleteMapping, deleteNode, deletePages, detectRepeatedRegionsEndpoint, disconnectStorage, dismissDownload, downloadFile, downloadShare, downloadSharedChildFile, downloadSharedFile, downloadStream, downloadVersion, drainMediaHealQueue, dropboxCallback, duplicatePages, enqueueDownload, escrowRecover, escrowWrappingKey, excludePageEndpoint, extractAtBboxEndpoint, extractAudio, extractAudioOnFiles, extractPages, extractReadingOrderEndpoint, extractRegionEndpoint, extractTables, extractTextFromPdf, extractTextRemote, extractedTextEndpoint, fetchAnalysis, fetchLabelCatalog, filesDeleteFile, filesGetFile, filesListFiles, filesystemIndexAction, filesystemStatus, finalizePresignedUpload, findPaths, findSimilarEndpoint, flattenAnnotationsEndpoint, fullPipeline, generateDirectoryStructureJson, getAnalysisPreferences, getAsset, getCloudSettings, getDocument, getDownload, getFileAsAsset, getFileAsAssetOnFiles, getFileByPath, getFileDocument, getFileLineageSummary, getFileRagStatus, getFileTree, getFolder, getIndexingSettings, getInstanceInfo, getPageEndpoint, getPlaces, getQuota, getStorageUsage, getVersion, grantFilePermission, grantFolderPermission, health, heartbeat, importProviderFile, includePageEndpoint, ingestFileForRag, ingestFileForRagStream, insertPages, integrationsAidream, keyFindingsEndpoint, listAdapters, listAnnotationsEndpoint, listChanges, listDirectory, listDocuments, listDownloads, listEntitiesEndpoint, listFilePermissions, listFileShareLinks, listFiles, listFolderPermissions, listFolderShareLinks, listFolders, listGroupMembers, listGroupsIndex, listInstances, listMappings, listNodes, listOverridesEndpoint, listPagesEndpoint, listPresets, listTrash, manifestEndpoint, mergePdfs, mintFileSession, mintFileSessionOnFiles, moveNode, overridePageTextEndpoint, patchAsset, patchFolder, pdfFromImages, prepareOpen, processWithAi, promoteToEntityEndpoint, pullSettings, pushSettings, putAnalysisPreferences, putFile, readContent, readiness, reconfigureSync, redactMask, redactPatternEndpoint, redactPatternsCatalog, redactRegionsEndpoint, redactRepeatedRegionsEndpoint, redactRestore, refreshAnalysis, refreshFileRag, refreshStorage, removeGroupMember, renameFile, renameNode, renderAllPages, renderMoreVariants, renderPage, renderPageWithOverlayEndpoint, renderThumbnail, reorderPages, reportObservation, resetSettings, resolve, restoreFile, revokeFilePermission, revokeFolderPermission, revokeSession, rotatePageEndpoint, rotatePages, saveContent, saveNewVersion, scrubEndpoint, searchContent, searchEndpoint, searchFiles, searchSemantic, selectPdfPages, snapBboxEndpoint, splitPdf, stripMetadataEndpoint, stripRepeatedRegionsEndpoint, studioPresets, studioRender, syncChanges, syncFolders, triggerSync, tusCreate, tusCreateOnFiles, tusDelete, tusDeleteOnFiles, tusHead, tusHeadOnFiles, tusOptions, tusOptionsOnFiles, tusPatch, tusPatchOnFiles, updateAnnotationEndpoint, updateCloudSettings, updateEntityEndpoint, updateFileMetadata, updateIndexingSettings, updateInstanceName, updatePriorityRoots, uploadAsset, uploadFile, versionsListVersions, versionsRestoreVersion, virtualListVersions, virtualRestoreVersion } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
export { activePagesEndpoint, addGroupMember, appGenerateDirectoryStructure, appGenerateDirectoryStructurePost, assetsPdfCompress, assetsPdfCompressMultipart, assetsPreview, assetsPreviewMultipart, authorizeStorage, batchExtract, boxCallback, browseProviderFolder, bulkDeleteFiles, bulkFromCandidatesEndpoint, bulkMoveFiles, bulkMoveFolders, bulkOpDiscriminator, call, cancelDownload, childFileShare, classifyPagesEndpoint, cleanDocumentContent, cloudDebug, cloudFilesBridgeDeleteFile, cloudFilesBridgeGetFile, cloudFilesBridgeListFiles, cloudInstanceDryRun, compressPdf, configureSync, convertOfficePdf, copyFile, createAnnotationEndpoint, createEntityEndpoint, createFileShareLink, createFolder, createFolderShareLink, createGroup, createMapping, createNode, createPresignedUpload, cropPages, deactivateShareLink, deleteAnnotationEndpoint, deleteEntityEndpoint, deleteFolder, deleteMapping, deleteNode, deletePages, detectRepeatedRegionsEndpoint, disconnectStorage, dismissDownload, downloadFile, downloadShare, downloadSharedChildFile, downloadSharedFile, downloadStream, downloadVersion, drainMediaHealQueue, dropboxCallback, duplicatePages, enqueueDownload, escrowRecover, escrowWrappingKey, excludePageEndpoint, extractAtBboxEndpoint, extractAudio, extractAudioOnFiles, extractPages, extractReadingOrderEndpoint, extractRegionEndpoint, extractTables, extractTextFromPdf, extractTextRemote, extractedTextEndpoint, fetchAnalysis, fetchLabelCatalog, filesDeleteFile, filesGetFile, filesListFiles, filesystemIndexAction, filesystemStatus, finalizePresignedUpload, findPaths, findSimilarEndpoint, flattenAnnotationsEndpoint, fullPipeline, generateDirectoryStructureJson, getAnalysisPreferences, getAsset, getCloudSettings, getDocument, getDownload, getFileAsAsset, getFileAsAssetOnFiles, getFileByPath, getFileDocument, getFileLineageSummary, getFileRagStatus, getFileTree, getFolder, getIndexingSettings, getInstanceInfo, getPageEndpoint, getPlaces, getQuota, getStorageUsage, getVersion, grantFilePermission, grantFolderPermission, health, heartbeat, importProviderFile, includePageEndpoint, ingestFileForRag, ingestFileForRagStream, insertPages, integrationsAidream, keyFindingsEndpoint, listAdapters, listAnnotationsEndpoint, listChanges, listDirectory, listDocuments, listDownloads, listEntitiesEndpoint, listFilePermissions, listFileShareLinks, listFiles, listFolderPermissions, listFolderShareLinks, listFolders, listGroupMembers, listGroupsIndex, listInstances, listMappings, listNodes, listOverridesEndpoint, listPagesEndpoint, listPresets, listTrash, manifestEndpoint, mergePdfs, mintFileSession, mintFileSessionOnFiles, moveNode, overridePageTextEndpoint, patchAsset, patchFolder, pdfFromImages, prepareOpen, processWithAi, promoteToEntityEndpoint, pullSettings, pushSettings, putAnalysisPreferences, putFile, readContent, readiness, reconfigureSync, redactMask, redactPatternEndpoint, redactPatternsCatalog, redactRegionsEndpoint, redactRepeatedRegionsEndpoint, redactRestore, refreshAnalysis, refreshFileRag, refreshStorage, removeGroupMember, renameFile, renameNode, renderAllPages, renderMoreVariants, renderPage, renderPageWithOverlayEndpoint, renderThumbnail, reorderPages, reportObservation, resetSettings, resolve, restoreFile, revokeFilePermission, revokeFolderPermission, revokeSession, rotatePageEndpoint, rotatePages, saveContent, saveNewVersion, scrubEndpoint, searchContent, searchEndpoint, searchFiles, searchSemantic, selectPdfPages, snapBboxEndpoint, splitPdf, stripMetadataEndpoint, stripRepeatedRegionsEndpoint, studioPresets, studioRender, syncChanges, syncFolders, triggerSync, tusCreate, tusCreateOnFiles, tusDelete, tusDeleteOnFiles, tusHead, tusHeadOnFiles, tusOptions, tusOptionsOnFiles, tusPatch, tusPatchOnFiles, updateAnnotationEndpoint, updateCloudSettings, updateEntityEndpoint, updateFileMetadata, updateIndexingSettings, updateInstanceName, updatePriorityRoots, uploadAsset, uploadFile, versionsListVersions, versionsRestoreVersion, virtualListVersions, virtualRestoreVersion } from './chunk-QCDALTHR.js';
|
|
2
|
+
import './chunk-BIHYNQOU.js';
|
|
3
3
|
import './chunk-KIEAFMKB.js';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { A as Api, C as CallOptions } from './index-
|
|
1
|
+
import { A as Api, C as CallOptions } from './index-DyDNKgdB.cjs';
|
|
2
2
|
import { JsonValue } from './schemas.cjs';
|
|
3
3
|
import '@ai-matrx/auth/credentials';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* GENERATED by @ai-matrx/api scripts/generate.mjs from aidream/api-contract — never edit by hand.
|
|
7
|
-
* CONTRACT_SHA256
|
|
7
|
+
* CONTRACT_SHA256 2e22230d01e754f5ae210e0932290279956cc04757022cfee77b6d128f1c667c
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/** E-13's body, byte-for-byte against the frozen stub. */
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { A as Api, C as CallOptions } from './index-
|
|
1
|
+
import { A as Api, C as CallOptions } from './index-DyDNKgdB.js';
|
|
2
2
|
import { JsonValue } from './schemas.js';
|
|
3
3
|
import '@ai-matrx/auth/credentials';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* GENERATED by @ai-matrx/api scripts/generate.mjs from aidream/api-contract — never edit by hand.
|
|
7
|
-
* CONTRACT_SHA256
|
|
7
|
+
* CONTRACT_SHA256 2e22230d01e754f5ae210e0932290279956cc04757022cfee77b6d128f1c667c
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/** E-13's body, byte-for-byte against the frozen stub. */
|
|
@@ -190,10 +190,10 @@ declare function readMatrxSseStream(stream: ReadableStream<Uint8Array>, options?
|
|
|
190
190
|
|
|
191
191
|
/**
|
|
192
192
|
* GENERATED by @ai-matrx/api scripts/generate.mjs from aidream/api-contract — never edit by hand.
|
|
193
|
-
* CONTRACT_SHA256
|
|
193
|
+
* CONTRACT_SHA256 2e22230d01e754f5ae210e0932290279956cc04757022cfee77b6d128f1c667c
|
|
194
194
|
*/
|
|
195
195
|
/** The server contract's hash; the Python `matrx-api` and any native client carry the same value. */
|
|
196
|
-
declare const CONTRACT_SHA256 = "
|
|
196
|
+
declare const CONTRACT_SHA256 = "2e22230d01e754f5ae210e0932290279956cc04757022cfee77b6d128f1c667c";
|
|
197
197
|
/** Which deployment answers (api-deployments.json): default base URLs and the existing env names that override them. */
|
|
198
198
|
declare const DEPLOYMENTS: {
|
|
199
199
|
readonly files: {
|
|
@@ -190,10 +190,10 @@ declare function readMatrxSseStream(stream: ReadableStream<Uint8Array>, options?
|
|
|
190
190
|
|
|
191
191
|
/**
|
|
192
192
|
* GENERATED by @ai-matrx/api scripts/generate.mjs from aidream/api-contract — never edit by hand.
|
|
193
|
-
* CONTRACT_SHA256
|
|
193
|
+
* CONTRACT_SHA256 2e22230d01e754f5ae210e0932290279956cc04757022cfee77b6d128f1c667c
|
|
194
194
|
*/
|
|
195
195
|
/** The server contract's hash; the Python `matrx-api` and any native client carry the same value. */
|
|
196
|
-
declare const CONTRACT_SHA256 = "
|
|
196
|
+
declare const CONTRACT_SHA256 = "2e22230d01e754f5ae210e0932290279956cc04757022cfee77b6d128f1c667c";
|
|
197
197
|
/** Which deployment answers (api-deployments.json): default base URLs and the existing env names that override them. */
|
|
198
198
|
declare const DEPLOYMENTS: {
|
|
199
199
|
readonly files: {
|
package/dist/index.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var chunkFNIYADWI_cjs = require('./chunk-FNIYADWI.cjs');
|
|
4
4
|
var chunkMVXD6WI6_cjs = require('./chunk-MVXD6WI6.cjs');
|
|
5
|
-
var
|
|
5
|
+
var chunkG3OJBGCU_cjs = require('./chunk-G3OJBGCU.cjs');
|
|
6
6
|
var chunk2SXAAKGV_cjs = require('./chunk-2SXAAKGV.cjs');
|
|
7
7
|
var format = require('@ai-matrx/kit/format');
|
|
8
8
|
|
|
@@ -44,7 +44,7 @@ function buildMatrxRequestBody(body, scope) {
|
|
|
44
44
|
}
|
|
45
45
|
const bodyOrganizationId = base.organization_id;
|
|
46
46
|
if (scope.organization_id !== void 0 && bodyOrganizationId !== void 0 && (typeof bodyOrganizationId !== "string" || bodyOrganizationId.trim() !== scope.organization_id)) {
|
|
47
|
-
throw new
|
|
47
|
+
throw new chunkG3OJBGCU_cjs.OrganizationContextError(
|
|
48
48
|
"organization_context_mismatch",
|
|
49
49
|
"Request body organization_id must match the request context organization."
|
|
50
50
|
);
|
|
@@ -116,14 +116,14 @@ function parseMatrxNdjsonResponse(response, signal, hooks = {}) {
|
|
|
116
116
|
};
|
|
117
117
|
async function* events() {
|
|
118
118
|
if (!response.body) {
|
|
119
|
-
throw new
|
|
119
|
+
throw new chunkG3OJBGCU_cjs.BackendApiError({
|
|
120
120
|
code: "internal_error",
|
|
121
121
|
detail: "Response has no body",
|
|
122
122
|
userMessage: "No response received from server"
|
|
123
123
|
});
|
|
124
124
|
}
|
|
125
125
|
try {
|
|
126
|
-
for await (const envelope of
|
|
126
|
+
for await (const envelope of chunkG3OJBGCU_cjs.readMatrxNdjsonStream(response.body, {
|
|
127
127
|
...signal ? { signal } : {},
|
|
128
128
|
...hooks.onMalformedLine ? { onMalformedLine: hooks.onMalformedLine } : {},
|
|
129
129
|
...hooks.onUnknownEnvelope ? { onUnknownEnvelope: hooks.onUnknownEnvelope } : {}
|
|
@@ -135,7 +135,7 @@ function parseMatrxNdjsonResponse(response, signal, hooks = {}) {
|
|
|
135
135
|
if (signal?.aborted || error instanceof Error && error.name === "AbortError") {
|
|
136
136
|
return;
|
|
137
137
|
}
|
|
138
|
-
const transportError = error instanceof
|
|
138
|
+
const transportError = error instanceof chunkG3OJBGCU_cjs.BackendApiError ? error : new chunkG3OJBGCU_cjs.StreamTransportError({
|
|
139
139
|
detail: error instanceof Error ? error.message : "The response stream ended unexpectedly.",
|
|
140
140
|
details: error,
|
|
141
141
|
...ids.requestId ? { requestId: ids.requestId } : {}
|
|
@@ -152,7 +152,7 @@ async function httpErrorFrom(response) {
|
|
|
152
152
|
const serverDetail = await response.json().catch(() => void 0);
|
|
153
153
|
return {
|
|
154
154
|
type: response.status >= 400 && response.status < 500 ? "validation_error" : "http_error",
|
|
155
|
-
message:
|
|
155
|
+
message: chunkG3OJBGCU_cjs.extractMatrxErrorMessage(serverDetail) ?? bareStatusSentence(response.status),
|
|
156
156
|
status: response.status,
|
|
157
157
|
serverDetail
|
|
158
158
|
};
|
|
@@ -160,7 +160,7 @@ async function httpErrorFrom(response) {
|
|
|
160
160
|
async function executeMatrxCall(request, hooks = {}) {
|
|
161
161
|
const upper = request.method.toUpperCase();
|
|
162
162
|
const sendsBody = request.stream || upper !== "GET" && upper !== "HEAD";
|
|
163
|
-
const { response } = await
|
|
163
|
+
const { response } = await chunkG3OJBGCU_cjs.sendOnWire({
|
|
164
164
|
url: request.url,
|
|
165
165
|
method: request.method,
|
|
166
166
|
headers: request.headers,
|
|
@@ -210,11 +210,11 @@ async function sendMatrxRequest(url, init = {}, options = {}) {
|
|
|
210
210
|
headers[name] = value;
|
|
211
211
|
});
|
|
212
212
|
const fetchOptions = {};
|
|
213
|
-
for (const key of
|
|
213
|
+
for (const key of chunkG3OJBGCU_cjs.WIRE_FETCH_OPTION_KEYS) {
|
|
214
214
|
if (init[key] !== void 0) fetchOptions[key] = init[key];
|
|
215
215
|
}
|
|
216
216
|
try {
|
|
217
|
-
const { response, controller } = await
|
|
217
|
+
const { response, controller } = await chunkG3OJBGCU_cjs.sendOnWire({
|
|
218
218
|
url,
|
|
219
219
|
method: init.method ?? "GET",
|
|
220
220
|
fetchOptions,
|
|
@@ -237,7 +237,7 @@ async function sendMatrxRequest(url, init = {}, options = {}) {
|
|
|
237
237
|
throw callerSignal?.reason instanceof Error ? callerSignal.reason : new DOMException("The request was cancelled.", "AbortError");
|
|
238
238
|
}
|
|
239
239
|
if (options.timeoutMs !== void 0 && chunk2SXAAKGV_cjs.isNetError(error) && (error.code === "connect-timeout" || error.code === "total-timeout")) {
|
|
240
|
-
throw new
|
|
240
|
+
throw new chunkG3OJBGCU_cjs.BackendApiError({
|
|
241
241
|
code: "request_timeout",
|
|
242
242
|
detail: `${init.method ?? "GET"} ${url} exceeded ${options.timeoutMs}ms`,
|
|
243
243
|
userMessage: "The request timed out \u2014 please retry.",
|
|
@@ -251,7 +251,7 @@ async function sendMatrxRequest(url, init = {}, options = {}) {
|
|
|
251
251
|
}
|
|
252
252
|
}
|
|
253
253
|
async function readMatrxJsonResponse(response) {
|
|
254
|
-
if (!response.ok) throw await
|
|
254
|
+
if (!response.ok) throw await chunkG3OJBGCU_cjs.parseHttpError(response);
|
|
255
255
|
if (response.status === 204) return null;
|
|
256
256
|
return await response.json();
|
|
257
257
|
}
|
|
@@ -261,7 +261,7 @@ function classifyStatus(status) {
|
|
|
261
261
|
return status >= 400 && status < 500 ? "validation_error" : "http_error";
|
|
262
262
|
}
|
|
263
263
|
function normalizeMatrxError(err) {
|
|
264
|
-
if (err instanceof
|
|
264
|
+
if (err instanceof chunkG3OJBGCU_cjs.OrganizationContextError) {
|
|
265
265
|
return {
|
|
266
266
|
type: "validation_error",
|
|
267
267
|
message: err.message,
|
|
@@ -273,7 +273,7 @@ function normalizeMatrxError(err) {
|
|
|
273
273
|
if (err instanceof DOMException && err.name === "AbortError") {
|
|
274
274
|
return { type: "abort_error", message: "Request was cancelled." };
|
|
275
275
|
}
|
|
276
|
-
if (err instanceof
|
|
276
|
+
if (err instanceof chunkG3OJBGCU_cjs.MatrxApiError) {
|
|
277
277
|
return {
|
|
278
278
|
type: classifyStatus(err.status),
|
|
279
279
|
message: honestTransportMessage(err.message, err.status),
|
|
@@ -283,7 +283,7 @@ function normalizeMatrxError(err) {
|
|
|
283
283
|
name: err.name
|
|
284
284
|
};
|
|
285
285
|
}
|
|
286
|
-
if (err instanceof
|
|
286
|
+
if (err instanceof chunkG3OJBGCU_cjs.BackendApiError) {
|
|
287
287
|
return {
|
|
288
288
|
type: "network_error",
|
|
289
289
|
message: honestTransportMessage(
|
|
@@ -379,9 +379,9 @@ function createMatrxTransport(options) {
|
|
|
379
379
|
const resolve = resolveTarget ?? (() => ({ baseUrl }));
|
|
380
380
|
const resolveOrganizationId = (callOrganizationId) => {
|
|
381
381
|
if (organizationId === void 0) return null;
|
|
382
|
-
if (callOrganizationId !== null) return
|
|
382
|
+
if (callOrganizationId !== null) return chunkG3OJBGCU_cjs.requireOrganizationContext(callOrganizationId);
|
|
383
383
|
const candidate = typeof organizationId === "function" ? organizationId() : organizationId;
|
|
384
|
-
return
|
|
384
|
+
return chunkG3OJBGCU_cjs.requireOrganizationContext(candidate);
|
|
385
385
|
};
|
|
386
386
|
return {
|
|
387
387
|
async fetch(path, init) {
|
|
@@ -392,7 +392,7 @@ function createMatrxTransport(options) {
|
|
|
392
392
|
let overHeaders = callOrganizationId === null ? policyHeaders : stripOrganizationHeader(policyHeaders);
|
|
393
393
|
const orgId = resolveOrganizationId(callOrganizationId);
|
|
394
394
|
if (orgId !== null) {
|
|
395
|
-
overHeaders =
|
|
395
|
+
overHeaders = chunkG3OJBGCU_cjs.applyOrganizationContextHeader(overHeaders, orgId);
|
|
396
396
|
}
|
|
397
397
|
const wireHeaders = callOrganizationId === null ? { ...init.headers } : stripOrganizationHeader({ ...init.headers });
|
|
398
398
|
const info = {
|
|
@@ -405,7 +405,7 @@ function createMatrxTransport(options) {
|
|
|
405
405
|
diagnostics?.onRequest?.(info);
|
|
406
406
|
let response;
|
|
407
407
|
try {
|
|
408
|
-
({ response } = await
|
|
408
|
+
({ response } = await chunkG3OJBGCU_cjs.sendOnWire(
|
|
409
409
|
{
|
|
410
410
|
url,
|
|
411
411
|
method: init.method,
|
|
@@ -429,11 +429,11 @@ function createMatrxTransport(options) {
|
|
|
429
429
|
}
|
|
430
430
|
if (!response.ok && !expectedErrorStatuses?.includes(response.status)) {
|
|
431
431
|
const serverDetail = await response.clone().json().catch(() => void 0);
|
|
432
|
-
const code =
|
|
432
|
+
const code = chunkG3OJBGCU_cjs.extractMatrxErrorCode(serverDetail);
|
|
433
433
|
diagnostics?.onError?.(
|
|
434
434
|
{
|
|
435
435
|
type: classifyStatus(response.status),
|
|
436
|
-
message:
|
|
436
|
+
message: chunkG3OJBGCU_cjs.extractMatrxErrorMessage(serverDetail) ?? `HTTP ${response.status}`,
|
|
437
437
|
status: response.status,
|
|
438
438
|
serverDetail,
|
|
439
439
|
...code ? { code } : {}
|
|
@@ -532,6 +532,10 @@ function runWaitTimeoutMessage(kind, modelLabel, seconds) {
|
|
|
532
532
|
var WARM_PATH = "/ai/warm";
|
|
533
533
|
var DEFAULT_COALESCE_MS = 50;
|
|
534
534
|
var DEFAULT_DEDUPE_MS = 6e4;
|
|
535
|
+
var DEFAULT_RETRY_DELAYS_MS = [2e3, 8e3, 3e4];
|
|
536
|
+
function isTransientStatus(status) {
|
|
537
|
+
return status === 408 || status === 425 || status === 429 || status >= 500 && status !== 501;
|
|
538
|
+
}
|
|
535
539
|
var SWEEP_AT = 256;
|
|
536
540
|
var QUEUE_MAX = 64;
|
|
537
541
|
function itemId(item) {
|
|
@@ -545,6 +549,7 @@ function createWarmup(options) {
|
|
|
545
549
|
organizationId,
|
|
546
550
|
coalesceMs = DEFAULT_COALESCE_MS,
|
|
547
551
|
dedupeMs = DEFAULT_DEDUPE_MS,
|
|
552
|
+
retryDelaysMs = DEFAULT_RETRY_DELAYS_MS,
|
|
548
553
|
now = Date.now
|
|
549
554
|
} = options;
|
|
550
555
|
const sentAt = /* @__PURE__ */ new Map();
|
|
@@ -594,6 +599,9 @@ function createWarmup(options) {
|
|
|
594
599
|
if (batch.length === 0) return;
|
|
595
600
|
const keys = batch.map((i) => `${current}|${itemId(i)}`);
|
|
596
601
|
keys.forEach((k) => inFlight.add(k));
|
|
602
|
+
send(batch, keys, reason, current, 0);
|
|
603
|
+
}
|
|
604
|
+
function send(batch, keys, reason, sendScope, attempt2) {
|
|
597
605
|
const settle = (ok) => {
|
|
598
606
|
const t = now();
|
|
599
607
|
for (const k of keys) {
|
|
@@ -601,6 +609,21 @@ function createWarmup(options) {
|
|
|
601
609
|
if (ok) sentAt.set(k, t);
|
|
602
610
|
}
|
|
603
611
|
};
|
|
612
|
+
const failed = (transient, detail) => {
|
|
613
|
+
const delay = retryDelaysMs[attempt2];
|
|
614
|
+
if (transient && delay !== void 0) {
|
|
615
|
+
setTimeout(() => {
|
|
616
|
+
if (currentScope() !== sendScope) {
|
|
617
|
+
settle(false);
|
|
618
|
+
return;
|
|
619
|
+
}
|
|
620
|
+
send(batch, keys, reason, sendScope, attempt2 + 1);
|
|
621
|
+
}, delay);
|
|
622
|
+
return;
|
|
623
|
+
}
|
|
624
|
+
settle(false);
|
|
625
|
+
announce(attempt2 > 0 ? `${detail} after ${attempt2 + 1} attempts` : detail);
|
|
626
|
+
};
|
|
604
627
|
try {
|
|
605
628
|
const org = organizationId ? organizationId() : null;
|
|
606
629
|
void transport.fetch(WARM_PATH, {
|
|
@@ -612,12 +635,11 @@ function createWarmup(options) {
|
|
|
612
635
|
body: JSON.stringify({ reason, items: batch })
|
|
613
636
|
}).then(
|
|
614
637
|
(response) => {
|
|
615
|
-
|
|
616
|
-
|
|
638
|
+
if (response.ok) settle(true);
|
|
639
|
+
else failed(isTransientStatus(response.status), `HTTP ${response.status}`);
|
|
617
640
|
},
|
|
618
641
|
(err) => {
|
|
619
|
-
|
|
620
|
-
announce(String(err));
|
|
642
|
+
failed(true, String(err));
|
|
621
643
|
}
|
|
622
644
|
);
|
|
623
645
|
} catch (err) {
|
|
@@ -712,7 +734,7 @@ async function readServerDetail(response) {
|
|
|
712
734
|
}
|
|
713
735
|
}
|
|
714
736
|
async function throwApiError(path, response) {
|
|
715
|
-
throw new
|
|
737
|
+
throw new chunkG3OJBGCU_cjs.MatrxApiError({
|
|
716
738
|
status: response.status,
|
|
717
739
|
path,
|
|
718
740
|
serverDetail: await readServerDetail(response)
|
|
@@ -733,7 +755,7 @@ function toRunHandle(response, options) {
|
|
|
733
755
|
return {
|
|
734
756
|
requestId: response.headers.get("X-Request-ID"),
|
|
735
757
|
conversationId: response.headers.get("X-Conversation-ID"),
|
|
736
|
-
events:
|
|
758
|
+
events: chunkG3OJBGCU_cjs.readMatrxNdjsonStream(response.body, {
|
|
737
759
|
...options.signal ? { signal: options.signal } : {},
|
|
738
760
|
...options.maxReadAhead !== void 0 ? { maxReadAhead: options.maxReadAhead } : {},
|
|
739
761
|
...options.onMalformedLine ? { onMalformedLine: options.onMalformedLine } : {},
|
|
@@ -756,7 +778,7 @@ async function requestStream(transport, path, options) {
|
|
|
756
778
|
});
|
|
757
779
|
if (!response.ok) return throwApiError(path, response);
|
|
758
780
|
if (!response.body) {
|
|
759
|
-
throw new
|
|
781
|
+
throw new chunkG3OJBGCU_cjs.MatrxApiError({
|
|
760
782
|
status: response.status,
|
|
761
783
|
path,
|
|
762
784
|
serverDetail: { code: "missing_response_body" },
|
|
@@ -816,7 +838,7 @@ async function getRuntimeOperationStatus(transport, requestId, options = {}) {
|
|
|
816
838
|
{ method: "GET", ...options.signal ? { signal: options.signal } : {} }
|
|
817
839
|
);
|
|
818
840
|
} catch (error) {
|
|
819
|
-
if (error instanceof
|
|
841
|
+
if (error instanceof chunkG3OJBGCU_cjs.MatrxApiError && error.status === 404) return null;
|
|
820
842
|
throw error;
|
|
821
843
|
}
|
|
822
844
|
}
|
|
@@ -831,7 +853,7 @@ async function getRuntimeOperationsByLink(transport, linkKind, linkId, options =
|
|
|
831
853
|
{ method: "GET", ...options.signal ? { signal: options.signal } : {} }
|
|
832
854
|
);
|
|
833
855
|
} catch (error) {
|
|
834
|
-
if (error instanceof
|
|
856
|
+
if (error instanceof chunkG3OJBGCU_cjs.MatrxApiError && error.status === 404) return null;
|
|
835
857
|
throw error;
|
|
836
858
|
}
|
|
837
859
|
}
|
|
@@ -872,7 +894,7 @@ async function* followRuntimeOperationEvents(transport, executionId, options = {
|
|
|
872
894
|
...options.signal ? { signal: options.signal } : {}
|
|
873
895
|
}
|
|
874
896
|
);
|
|
875
|
-
const frames =
|
|
897
|
+
const frames = chunkG3OJBGCU_cjs.readMatrxSseStream(
|
|
876
898
|
response.body,
|
|
877
899
|
options.onIncomplete ? { onIncomplete: options.onIncomplete } : {}
|
|
878
900
|
);
|
|
@@ -1075,7 +1097,7 @@ async function openMatrxStream(transport, path, options = {}) {
|
|
|
1075
1097
|
return toRunHandle(response, options);
|
|
1076
1098
|
}
|
|
1077
1099
|
function withRunOrganization(transport, organizationId) {
|
|
1078
|
-
const orgId =
|
|
1100
|
+
const orgId = chunkG3OJBGCU_cjs.requireOrganizationContext(organizationId);
|
|
1079
1101
|
return {
|
|
1080
1102
|
fetch: (path, init) => transport.fetch(path, {
|
|
1081
1103
|
...init,
|
|
@@ -1102,7 +1124,7 @@ async function followWorkflowRunEvents(transport, runId, options) {
|
|
|
1102
1124
|
throw error;
|
|
1103
1125
|
}
|
|
1104
1126
|
try {
|
|
1105
|
-
for await (const frame of
|
|
1127
|
+
for await (const frame of chunkG3OJBGCU_cjs.readMatrxSseStream(
|
|
1106
1128
|
response.body
|
|
1107
1129
|
)) {
|
|
1108
1130
|
if (frame.event === "end") return { ended: true };
|
|
@@ -1148,7 +1170,7 @@ async function resumeOrRejoin(transport, resumeCall, options) {
|
|
|
1148
1170
|
} catch (error) {
|
|
1149
1171
|
const target = readLiveRunRejoin(error);
|
|
1150
1172
|
if (!target) {
|
|
1151
|
-
if (error instanceof
|
|
1173
|
+
if (error instanceof chunkG3OJBGCU_cjs.MatrxApiError && isResumeConflict(error)) {
|
|
1152
1174
|
return { kind: "resume_conflict", error };
|
|
1153
1175
|
}
|
|
1154
1176
|
throw error;
|
|
@@ -1564,7 +1586,7 @@ async function reportProviderSessionUsage(transport, usage, options = {}) {
|
|
|
1564
1586
|
});
|
|
1565
1587
|
return "ok";
|
|
1566
1588
|
} catch (error) {
|
|
1567
|
-
if (error instanceof
|
|
1589
|
+
if (error instanceof chunkG3OJBGCU_cjs.MatrxApiError) {
|
|
1568
1590
|
const status = error.status;
|
|
1569
1591
|
if (status >= 400 && status < 500 && status !== 401 && status !== 408 && status !== 425 && status !== 429) {
|
|
1570
1592
|
console.warn(`[provider-usage] server refused ${usage.provider} usage ${usage.usage_id} (${status})`);
|
|
@@ -1574,9 +1596,9 @@ async function reportProviderSessionUsage(transport, usage, options = {}) {
|
|
|
1574
1596
|
return "retry";
|
|
1575
1597
|
}
|
|
1576
1598
|
}
|
|
1577
|
-
var
|
|
1599
|
+
var DEFAULT_RETRY_DELAYS_MS2 = [1e3, 4e3, 15e3, 6e4, 18e4];
|
|
1578
1600
|
function createProviderUsageReporter(options) {
|
|
1579
|
-
const delays = options.retryDelaysMs ??
|
|
1601
|
+
const delays = options.retryDelaysMs ?? DEFAULT_RETRY_DELAYS_MS2;
|
|
1580
1602
|
const sleep = options.sleep ?? ((ms) => new Promise((resolve) => setTimeout(resolve, ms)));
|
|
1581
1603
|
const seen = /* @__PURE__ */ new Set();
|
|
1582
1604
|
const inflight = /* @__PURE__ */ new Set();
|
|
@@ -2260,115 +2282,115 @@ Object.defineProperty(exports, "toCredentialsPort", {
|
|
|
2260
2282
|
});
|
|
2261
2283
|
Object.defineProperty(exports, "BackendApiError", {
|
|
2262
2284
|
enumerable: true,
|
|
2263
|
-
get: function () { return
|
|
2285
|
+
get: function () { return chunkG3OJBGCU_cjs.BackendApiError; }
|
|
2264
2286
|
});
|
|
2265
2287
|
Object.defineProperty(exports, "CONTRACT_SHA256", {
|
|
2266
2288
|
enumerable: true,
|
|
2267
|
-
get: function () { return
|
|
2289
|
+
get: function () { return chunkG3OJBGCU_cjs.CONTRACT_SHA256; }
|
|
2268
2290
|
});
|
|
2269
2291
|
Object.defineProperty(exports, "DEPLOYMENTS", {
|
|
2270
2292
|
enumerable: true,
|
|
2271
|
-
get: function () { return
|
|
2293
|
+
get: function () { return chunkG3OJBGCU_cjs.DEPLOYMENTS; }
|
|
2272
2294
|
});
|
|
2273
2295
|
Object.defineProperty(exports, "DOMAINS", {
|
|
2274
2296
|
enumerable: true,
|
|
2275
|
-
get: function () { return
|
|
2297
|
+
get: function () { return chunkG3OJBGCU_cjs.DOMAINS; }
|
|
2276
2298
|
});
|
|
2277
2299
|
Object.defineProperty(exports, "MatrxApiError", {
|
|
2278
2300
|
enumerable: true,
|
|
2279
|
-
get: function () { return
|
|
2301
|
+
get: function () { return chunkG3OJBGCU_cjs.MatrxApiError; }
|
|
2280
2302
|
});
|
|
2281
2303
|
Object.defineProperty(exports, "OrganizationContextError", {
|
|
2282
2304
|
enumerable: true,
|
|
2283
|
-
get: function () { return
|
|
2305
|
+
get: function () { return chunkG3OJBGCU_cjs.OrganizationContextError; }
|
|
2284
2306
|
});
|
|
2285
2307
|
Object.defineProperty(exports, "StreamTransportError", {
|
|
2286
2308
|
enumerable: true,
|
|
2287
|
-
get: function () { return
|
|
2309
|
+
get: function () { return chunkG3OJBGCU_cjs.StreamTransportError; }
|
|
2288
2310
|
});
|
|
2289
2311
|
Object.defineProperty(exports, "applyOrganizationContextHeader", {
|
|
2290
2312
|
enumerable: true,
|
|
2291
|
-
get: function () { return
|
|
2313
|
+
get: function () { return chunkG3OJBGCU_cjs.applyOrganizationContextHeader; }
|
|
2292
2314
|
});
|
|
2293
2315
|
Object.defineProperty(exports, "assertOrganizationMatchesOperation", {
|
|
2294
2316
|
enumerable: true,
|
|
2295
|
-
get: function () { return
|
|
2317
|
+
get: function () { return chunkG3OJBGCU_cjs.assertOrganizationMatchesOperation; }
|
|
2296
2318
|
});
|
|
2297
2319
|
Object.defineProperty(exports, "assertQueryOrganizationMatchesContext", {
|
|
2298
2320
|
enumerable: true,
|
|
2299
|
-
get: function () { return
|
|
2321
|
+
get: function () { return chunkG3OJBGCU_cjs.assertQueryOrganizationMatchesContext; }
|
|
2300
2322
|
});
|
|
2301
2323
|
Object.defineProperty(exports, "createApi", {
|
|
2302
2324
|
enumerable: true,
|
|
2303
|
-
get: function () { return
|
|
2325
|
+
get: function () { return chunkG3OJBGCU_cjs.createApi; }
|
|
2304
2326
|
});
|
|
2305
2327
|
Object.defineProperty(exports, "createOrganizationOperation", {
|
|
2306
2328
|
enumerable: true,
|
|
2307
|
-
get: function () { return
|
|
2329
|
+
get: function () { return chunkG3OJBGCU_cjs.createOrganizationOperation; }
|
|
2308
2330
|
});
|
|
2309
2331
|
Object.defineProperty(exports, "describeBackendFailure", {
|
|
2310
2332
|
enumerable: true,
|
|
2311
|
-
get: function () { return
|
|
2333
|
+
get: function () { return chunkG3OJBGCU_cjs.describeBackendFailure; }
|
|
2312
2334
|
});
|
|
2313
2335
|
Object.defineProperty(exports, "extractMatrxErrorCode", {
|
|
2314
2336
|
enumerable: true,
|
|
2315
|
-
get: function () { return
|
|
2337
|
+
get: function () { return chunkG3OJBGCU_cjs.extractMatrxErrorCode; }
|
|
2316
2338
|
});
|
|
2317
2339
|
Object.defineProperty(exports, "extractMatrxErrorMessage", {
|
|
2318
2340
|
enumerable: true,
|
|
2319
|
-
get: function () { return
|
|
2341
|
+
get: function () { return chunkG3OJBGCU_cjs.extractMatrxErrorMessage; }
|
|
2320
2342
|
});
|
|
2321
2343
|
Object.defineProperty(exports, "getUserMessage", {
|
|
2322
2344
|
enumerable: true,
|
|
2323
|
-
get: function () { return
|
|
2345
|
+
get: function () { return chunkG3OJBGCU_cjs.getUserMessage; }
|
|
2324
2346
|
});
|
|
2325
2347
|
Object.defineProperty(exports, "isBinaryType", {
|
|
2326
2348
|
enumerable: true,
|
|
2327
|
-
get: function () { return
|
|
2349
|
+
get: function () { return chunkG3OJBGCU_cjs.isBinaryType; }
|
|
2328
2350
|
});
|
|
2329
2351
|
Object.defineProperty(exports, "isGenericUserMessage", {
|
|
2330
2352
|
enumerable: true,
|
|
2331
|
-
get: function () { return
|
|
2353
|
+
get: function () { return chunkG3OJBGCU_cjs.isGenericUserMessage; }
|
|
2332
2354
|
});
|
|
2333
2355
|
Object.defineProperty(exports, "isStreamTransportLost", {
|
|
2334
2356
|
enumerable: true,
|
|
2335
|
-
get: function () { return
|
|
2357
|
+
get: function () { return chunkG3OJBGCU_cjs.isStreamTransportLost; }
|
|
2336
2358
|
});
|
|
2337
2359
|
Object.defineProperty(exports, "openJsonOrStream", {
|
|
2338
2360
|
enumerable: true,
|
|
2339
|
-
get: function () { return
|
|
2361
|
+
get: function () { return chunkG3OJBGCU_cjs.openJsonOrStream; }
|
|
2340
2362
|
});
|
|
2341
2363
|
Object.defineProperty(exports, "openStream", {
|
|
2342
2364
|
enumerable: true,
|
|
2343
|
-
get: function () { return
|
|
2365
|
+
get: function () { return chunkG3OJBGCU_cjs.openStream; }
|
|
2344
2366
|
});
|
|
2345
2367
|
Object.defineProperty(exports, "parseCallApiError", {
|
|
2346
2368
|
enumerable: true,
|
|
2347
|
-
get: function () { return
|
|
2369
|
+
get: function () { return chunkG3OJBGCU_cjs.parseCallApiError; }
|
|
2348
2370
|
});
|
|
2349
2371
|
Object.defineProperty(exports, "parseHttpError", {
|
|
2350
2372
|
enumerable: true,
|
|
2351
|
-
get: function () { return
|
|
2373
|
+
get: function () { return chunkG3OJBGCU_cjs.parseHttpError; }
|
|
2352
2374
|
});
|
|
2353
2375
|
Object.defineProperty(exports, "parseHttpErrorBody", {
|
|
2354
2376
|
enumerable: true,
|
|
2355
|
-
get: function () { return
|
|
2377
|
+
get: function () { return chunkG3OJBGCU_cjs.parseHttpErrorBody; }
|
|
2356
2378
|
});
|
|
2357
2379
|
Object.defineProperty(exports, "parsePersistedBackendError", {
|
|
2358
2380
|
enumerable: true,
|
|
2359
|
-
get: function () { return
|
|
2381
|
+
get: function () { return chunkG3OJBGCU_cjs.parsePersistedBackendError; }
|
|
2360
2382
|
});
|
|
2361
2383
|
Object.defineProperty(exports, "parseStreamError", {
|
|
2362
2384
|
enumerable: true,
|
|
2363
|
-
get: function () { return
|
|
2385
|
+
get: function () { return chunkG3OJBGCU_cjs.parseStreamError; }
|
|
2364
2386
|
});
|
|
2365
2387
|
Object.defineProperty(exports, "requireOrganizationContext", {
|
|
2366
2388
|
enumerable: true,
|
|
2367
|
-
get: function () { return
|
|
2389
|
+
get: function () { return chunkG3OJBGCU_cjs.requireOrganizationContext; }
|
|
2368
2390
|
});
|
|
2369
2391
|
Object.defineProperty(exports, "unwrapUpstreamError", {
|
|
2370
2392
|
enumerable: true,
|
|
2371
|
-
get: function () { return
|
|
2393
|
+
get: function () { return chunkG3OJBGCU_cjs.unwrapUpstreamError; }
|
|
2372
2394
|
});
|
|
2373
2395
|
Object.defineProperty(exports, "AbortedError", {
|
|
2374
2396
|
enumerable: true,
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { M as MatrxStreamEnvelope, b as MatrxNdjsonIssue, U as UploadProgress, c as MatrxStreamEnvelopeObservation, d as MatrxSseFrame } from './index-
|
|
2
|
-
export { A as Api, e as ApiRequestInfo, a as ApiStream, f as AuthTier, g as CONTRACT_SHA256, C as CallOptions, h as CreateApiOptions, D as DEPLOYMENTS, i as DOMAINS, j as DeploymentName, E as Environment, H as HttpMethod, J as JsonOrStream, N as NdjsonEvent, O as OperationArgs, k as OperationDescriptor, l as OrgRule, S as SseEvent, m as StreamKind, n as createApi, o as isBinaryType, p as openJsonOrStream, q as openStream } from './index-
|
|
1
|
+
import { M as MatrxStreamEnvelope, b as MatrxNdjsonIssue, U as UploadProgress, c as MatrxStreamEnvelopeObservation, d as MatrxSseFrame } from './index-DyDNKgdB.cjs';
|
|
2
|
+
export { A as Api, e as ApiRequestInfo, a as ApiStream, f as AuthTier, g as CONTRACT_SHA256, C as CallOptions, h as CreateApiOptions, D as DEPLOYMENTS, i as DOMAINS, j as DeploymentName, E as Environment, H as HttpMethod, J as JsonOrStream, N as NdjsonEvent, O as OperationArgs, k as OperationDescriptor, l as OrgRule, S as SseEvent, m as StreamKind, n as createApi, o as isBinaryType, p as openJsonOrStream, q as openStream } from './index-DyDNKgdB.cjs';
|
|
3
3
|
import { CredentialsPort } from '@ai-matrx/auth/credentials';
|
|
4
4
|
export { API_KEY_PREFIX, CredentialsPort, CredentialsSetting, MATRX_HEADERS, MatrxCredential, MatrxCredentialKind, credentialToHeaders, toCredentialsPort } from '@ai-matrx/auth/credentials';
|
|
5
5
|
export { AbortedError, ConnectTimeoutError, HeartbeatTimeoutError, HttpError, NetError, NetErrorCode, NetworkError, OfflineError, ResilientFetchOptions, ResilientFetchResult, RetryOptions, StreamMonitorOptions, TotalTimeoutError, extractErrorMessage, isNetError, isTransportFailure, monitorStream, resilientFetch, toNetError, withRetry } from './net.cjs';
|
|
@@ -837,6 +837,12 @@ declare function runWaitTimeoutMessage(kind: RunOutputKind, modelLabel: string |
|
|
|
837
837
|
* out → nothing is sent. Until the server endpoint exists the call answers 404
|
|
838
838
|
* and the primitive stays silent (one `console.debug`, once).
|
|
839
839
|
*
|
|
840
|
+
* TRANSIENT FAILURES ARE RETRIED. A server rollover (a release every ~30 min)
|
|
841
|
+
* answers `Failed to fetch` or a 502/503/504 for a few seconds — exactly when a
|
|
842
|
+
* warm-up matters most, because the new server's caches are cold. A batch that
|
|
843
|
+
* fails that way goes again after `retryDelaysMs` (default 2s, 8s, 30s) while
|
|
844
|
+
* the scope is unchanged; a refusal (4xx other than 408/425/429) never retries.
|
|
845
|
+
*
|
|
840
846
|
* Auth, base URL and `X-Organization-Id` are the injected `MatrxTransport`'s
|
|
841
847
|
* job, exactly as for every other call in this package.
|
|
842
848
|
*/
|
|
@@ -874,6 +880,11 @@ interface CreateWarmupOptions {
|
|
|
874
880
|
coalesceMs?: number;
|
|
875
881
|
/** Per-scope per-item dedupe window after a 2xx. Default 60_000ms. */
|
|
876
882
|
dedupeMs?: number;
|
|
883
|
+
/**
|
|
884
|
+
* Delay before each retry of a batch that failed transiently (network error,
|
|
885
|
+
* 408/425/429/5xx); its length is the retry budget. Default 2s, 8s, 30s.
|
|
886
|
+
*/
|
|
887
|
+
retryDelaysMs?: readonly number[];
|
|
877
888
|
/** Clock, for tests. Default `Date.now`. */
|
|
878
889
|
now?: () => number;
|
|
879
890
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { M as MatrxStreamEnvelope, b as MatrxNdjsonIssue, U as UploadProgress, c as MatrxStreamEnvelopeObservation, d as MatrxSseFrame } from './index-
|
|
2
|
-
export { A as Api, e as ApiRequestInfo, a as ApiStream, f as AuthTier, g as CONTRACT_SHA256, C as CallOptions, h as CreateApiOptions, D as DEPLOYMENTS, i as DOMAINS, j as DeploymentName, E as Environment, H as HttpMethod, J as JsonOrStream, N as NdjsonEvent, O as OperationArgs, k as OperationDescriptor, l as OrgRule, S as SseEvent, m as StreamKind, n as createApi, o as isBinaryType, p as openJsonOrStream, q as openStream } from './index-
|
|
1
|
+
import { M as MatrxStreamEnvelope, b as MatrxNdjsonIssue, U as UploadProgress, c as MatrxStreamEnvelopeObservation, d as MatrxSseFrame } from './index-DyDNKgdB.js';
|
|
2
|
+
export { A as Api, e as ApiRequestInfo, a as ApiStream, f as AuthTier, g as CONTRACT_SHA256, C as CallOptions, h as CreateApiOptions, D as DEPLOYMENTS, i as DOMAINS, j as DeploymentName, E as Environment, H as HttpMethod, J as JsonOrStream, N as NdjsonEvent, O as OperationArgs, k as OperationDescriptor, l as OrgRule, S as SseEvent, m as StreamKind, n as createApi, o as isBinaryType, p as openJsonOrStream, q as openStream } from './index-DyDNKgdB.js';
|
|
3
3
|
import { CredentialsPort } from '@ai-matrx/auth/credentials';
|
|
4
4
|
export { API_KEY_PREFIX, CredentialsPort, CredentialsSetting, MATRX_HEADERS, MatrxCredential, MatrxCredentialKind, credentialToHeaders, toCredentialsPort } from '@ai-matrx/auth/credentials';
|
|
5
5
|
export { AbortedError, ConnectTimeoutError, HeartbeatTimeoutError, HttpError, NetError, NetErrorCode, NetworkError, OfflineError, ResilientFetchOptions, ResilientFetchResult, RetryOptions, StreamMonitorOptions, TotalTimeoutError, extractErrorMessage, isNetError, isTransportFailure, monitorStream, resilientFetch, toNetError, withRetry } from './net.js';
|
|
@@ -837,6 +837,12 @@ declare function runWaitTimeoutMessage(kind: RunOutputKind, modelLabel: string |
|
|
|
837
837
|
* out → nothing is sent. Until the server endpoint exists the call answers 404
|
|
838
838
|
* and the primitive stays silent (one `console.debug`, once).
|
|
839
839
|
*
|
|
840
|
+
* TRANSIENT FAILURES ARE RETRIED. A server rollover (a release every ~30 min)
|
|
841
|
+
* answers `Failed to fetch` or a 502/503/504 for a few seconds — exactly when a
|
|
842
|
+
* warm-up matters most, because the new server's caches are cold. A batch that
|
|
843
|
+
* fails that way goes again after `retryDelaysMs` (default 2s, 8s, 30s) while
|
|
844
|
+
* the scope is unchanged; a refusal (4xx other than 408/425/429) never retries.
|
|
845
|
+
*
|
|
840
846
|
* Auth, base URL and `X-Organization-Id` are the injected `MatrxTransport`'s
|
|
841
847
|
* job, exactly as for every other call in this package.
|
|
842
848
|
*/
|
|
@@ -874,6 +880,11 @@ interface CreateWarmupOptions {
|
|
|
874
880
|
coalesceMs?: number;
|
|
875
881
|
/** Per-scope per-item dedupe window after a 2xx. Default 60_000ms. */
|
|
876
882
|
dedupeMs?: number;
|
|
883
|
+
/**
|
|
884
|
+
* Delay before each retry of a batch that failed transiently (network error,
|
|
885
|
+
* 408/425/429/5xx); its length is the retry budget. Default 2s, 8s, 30s.
|
|
886
|
+
*/
|
|
887
|
+
retryDelaysMs?: readonly number[];
|
|
877
888
|
/** Clock, for tests. Default `Date.now`. */
|
|
878
889
|
now?: () => number;
|
|
879
890
|
}
|