@ai-matrx/api 0.1.36 → 0.1.37
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 +11 -1
- package/dist/{chunk-YTEOFGFC.js → chunk-DIRPTJVH.js} +8 -1
- package/dist/{chunk-FNIYADWI.cjs → chunk-OOZ3H4CS.cjs} +8 -0
- package/dist/index.cjs +8 -10
- package/dist/index.d.cts +3 -4
- package/dist/index.d.ts +3 -4
- package/dist/index.js +3 -7
- package/dist/net.cjs +6 -2
- package/dist/net.d.cts +4 -1
- package/dist/net.d.ts +4 -1
- package/dist/net.js +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -2,14 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
### Unreleased
|
|
4
4
|
|
|
5
|
+
- **`isBareTransportCode` is also on `/net` (2026-10-17).** Moved to `src/net/transport-code.ts` (pure, no client) and re-exported by the root as before, so a server-side reader (`@ai-matrx/data` `/access`) imports it without the root. Additive. Consumer action: none.
|
|
5
6
|
- **Warm-up retries transient failures.** `createWarmup` re-sends a batch that failed with a network error or 408/425/429/5xx (not 501) after 2s, 8s and 30s while the scope is unchanged — a server rollover is exactly when a warm-up matters. New option `retryDelaysMs` (its length is the budget; `[]` disables). Refusals never retry. Consumer action: none.
|
|
6
7
|
- **Removed** the deprecated aliases `ENDPOINTS.ai.chat` (use `ENDPOINTS.ai.manual`) and `ENDPOINTS.utilities.pdfExtractText` (use `ENDPOINTS.pdf.extractText`); no importer existed. Added `FEATURE.md`. Consumer action: none.
|
|
7
8
|
|
|
8
|
-
## 0.1.
|
|
9
|
+
## 0.1.37
|
|
9
10
|
|
|
10
11
|
UNVERIFIED: this release has no Unreleased entry and the source comparison could not be made (the caller supplied no source comparison). Whether source changed is unknown; consumer action is unknown.
|
|
11
12
|
Check the package's gitHead on npm against this version's gitHead: `git diff <previous gitHead> <this gitHead> -- apps/shared/api/src`.
|
|
12
13
|
|
|
14
|
+
## 0.1.36
|
|
15
|
+
|
|
16
|
+
SOURCE CHANGED WITH NO RELEASE NOTE. This release shipped source changes that nobody described in an Unreleased entry,
|
|
17
|
+
so they may include breaking API changes. Consumer action is UNKNOWN: read the diff before upgrading.
|
|
18
|
+
Diff: `git diff 8bfa484e3a 24a38ba927 -- apps/shared/api/src`
|
|
19
|
+
|
|
20
|
+
Changed shipped source files (1):
|
|
21
|
+
- `apps/shared/api/src/intelligence/keys.generated.ts`
|
|
22
|
+
|
|
13
23
|
## 0.1.35
|
|
14
24
|
|
|
15
25
|
SOURCE CHANGED WITH NO RELEASE NOTE. This release shipped source changes that nobody described in an Unreleased entry,
|
|
@@ -54,4 +54,11 @@ async function* monitorStream(source, opts = {}) {
|
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
// src/net/transport-code.ts
|
|
58
|
+
var BARE_TRANSPORT_CODE = /^\s*(?:HTTP|HTTP\s*Error|Status(?:\s*Code)?)?\s*[:\-]?\s*\d{3}\s*[.:!]?\s*$/i;
|
|
59
|
+
function isBareTransportCode(text) {
|
|
60
|
+
if (!text) return false;
|
|
61
|
+
return BARE_TRANSPORT_CODE.test(text);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export { isBareTransportCode, monitorStream };
|
|
@@ -56,4 +56,12 @@ async function* monitorStream(source, opts = {}) {
|
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
+
// src/net/transport-code.ts
|
|
60
|
+
var BARE_TRANSPORT_CODE = /^\s*(?:HTTP|HTTP\s*Error|Status(?:\s*Code)?)?\s*[:\-]?\s*\d{3}\s*[.:!]?\s*$/i;
|
|
61
|
+
function isBareTransportCode(text) {
|
|
62
|
+
if (!text) return false;
|
|
63
|
+
return BARE_TRANSPORT_CODE.test(text);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
exports.isBareTransportCode = isBareTransportCode;
|
|
59
67
|
exports.monitorStream = monitorStream;
|
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkOOZ3H4CS_cjs = require('./chunk-OOZ3H4CS.cjs');
|
|
4
4
|
var chunkMVXD6WI6_cjs = require('./chunk-MVXD6WI6.cjs');
|
|
5
5
|
var chunkW7VYU3YW_cjs = require('./chunk-W7VYU3YW.cjs');
|
|
6
6
|
var chunk2SXAAKGV_cjs = require('./chunk-2SXAAKGV.cjs');
|
|
@@ -59,11 +59,6 @@ function buildMatrxRequestBody(body, scope) {
|
|
|
59
59
|
if (scope.task_id !== void 0) scopeFields.task_id = scope.task_id;
|
|
60
60
|
return { ...scopeFields, ...base };
|
|
61
61
|
}
|
|
62
|
-
var BARE_TRANSPORT_CODE = /^\s*(?:HTTP|HTTP\s*Error|Status(?:\s*Code)?)?\s*[:\-]?\s*\d{3}\s*[.:!]?\s*$/i;
|
|
63
|
-
function isBareTransportCode(text) {
|
|
64
|
-
if (!text) return false;
|
|
65
|
-
return BARE_TRANSPORT_CODE.test(text);
|
|
66
|
-
}
|
|
67
62
|
function bareStatusSentence(status) {
|
|
68
63
|
if (status === 401 || status === 403) {
|
|
69
64
|
return "The server would not let this request through \u2014 your session may have expired, or this account may not have access here. Sign in again, and if it repeats, ask an administrator.";
|
|
@@ -80,7 +75,7 @@ function bareStatusSentence(status) {
|
|
|
80
75
|
return "The server refused this request and sent no reason with it \u2014 the missing reason is itself a defect worth reporting. Reload the page and try once more; if it repeats, report it with the request id above.";
|
|
81
76
|
}
|
|
82
77
|
function honestTransportMessage(raw, status) {
|
|
83
|
-
if (raw && !isBareTransportCode(raw)) return raw;
|
|
78
|
+
if (raw && !chunkOOZ3H4CS_cjs.isBareTransportCode(raw)) return raw;
|
|
84
79
|
return bareStatusSentence(status ?? 0);
|
|
85
80
|
}
|
|
86
81
|
var SENSITIVE_HEADER_NAME = /authorization|cookie|token|api[-_]?key/i;
|
|
@@ -320,7 +315,7 @@ function normalizeMatrxError(err) {
|
|
|
320
315
|
status
|
|
321
316
|
};
|
|
322
317
|
}
|
|
323
|
-
if (isBareTransportCode(err.message)) {
|
|
318
|
+
if (chunkOOZ3H4CS_cjs.isBareTransportCode(err.message)) {
|
|
324
319
|
const status = Number.parseInt(err.message.replace(/\D+/g, ""), 10);
|
|
325
320
|
return {
|
|
326
321
|
type: classifyStatus(status),
|
|
@@ -2270,9 +2265,13 @@ var ENDPOINTS = {
|
|
|
2270
2265
|
}
|
|
2271
2266
|
};
|
|
2272
2267
|
|
|
2268
|
+
Object.defineProperty(exports, "isBareTransportCode", {
|
|
2269
|
+
enumerable: true,
|
|
2270
|
+
get: function () { return chunkOOZ3H4CS_cjs.isBareTransportCode; }
|
|
2271
|
+
});
|
|
2273
2272
|
Object.defineProperty(exports, "monitorStream", {
|
|
2274
2273
|
enumerable: true,
|
|
2275
|
-
get: function () { return
|
|
2274
|
+
get: function () { return chunkOOZ3H4CS_cjs.monitorStream; }
|
|
2276
2275
|
});
|
|
2277
2276
|
Object.defineProperty(exports, "API_KEY_PREFIX", {
|
|
2278
2277
|
enumerable: true,
|
|
@@ -2492,7 +2491,6 @@ exports.followWorkflowRunEvents = followWorkflowRunEvents;
|
|
|
2492
2491
|
exports.getRuntimeOperationStatus = getRuntimeOperationStatus;
|
|
2493
2492
|
exports.getRuntimeOperationsByLink = getRuntimeOperationsByLink;
|
|
2494
2493
|
exports.honestTransportMessage = honestTransportMessage;
|
|
2495
|
-
exports.isBareTransportCode = isBareTransportCode;
|
|
2496
2494
|
exports.isEmptyProviderUsage = isEmptyProviderUsage;
|
|
2497
2495
|
exports.isJobOutputKind = isJobOutputKind;
|
|
2498
2496
|
exports.isLiveStreamUnavailable = isLiveStreamUnavailable;
|
package/dist/index.d.cts
CHANGED
|
@@ -2,7 +2,7 @@ import { M as MatrxStreamEnvelope, b as MatrxNdjsonIssue, U as UploadProgress, c
|
|
|
2
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-D7z-_LrQ.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
|
-
export { AbortedError, ConnectTimeoutError, HeartbeatTimeoutError, HttpError, NetError, NetErrorCode, NetworkError, OfflineError, ResilientFetchOptions, ResilientFetchResult, RetryOptions, StreamMonitorOptions, TotalTimeoutError, extractErrorMessage, isNetError, isTransportFailure, monitorStream, resilientFetch, toNetError, withRetry } from './net.cjs';
|
|
5
|
+
export { AbortedError, ConnectTimeoutError, HeartbeatTimeoutError, HttpError, NetError, NetErrorCode, NetworkError, OfflineError, ResilientFetchOptions, ResilientFetchResult, RetryOptions, StreamMonitorOptions, TotalTimeoutError, extractErrorMessage, isBareTransportCode, isNetError, isTransportFailure, monitorStream, resilientFetch, toNetError, withRetry } from './net.cjs';
|
|
6
6
|
import { g as MandateKey, b as DynamicMandateKey } from './keys.generated-DS6DQfbq.cjs';
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -559,8 +559,7 @@ declare const MATRX_UI_ONLY_BODY_FIELDS: ReadonlySet<string>;
|
|
|
559
559
|
* Other scope fields keep caller-wins behaviour.
|
|
560
560
|
*/
|
|
561
561
|
declare function buildMatrxRequestBody(body: unknown, scope: MatrxCallScope): Record<string, unknown>;
|
|
562
|
-
|
|
563
|
-
declare function isBareTransportCode(text: string | null | undefined): boolean;
|
|
562
|
+
|
|
564
563
|
/**
|
|
565
564
|
* A BARE STATUS CODE IS NEVER A SENTENCE. What a person reads when the server
|
|
566
565
|
* answered an error with no readable message. The status itself rides
|
|
@@ -2688,4 +2687,4 @@ declare const ENDPOINTS: {
|
|
|
2688
2687
|
};
|
|
2689
2688
|
};
|
|
2690
2689
|
|
|
2691
|
-
export { BackendApiError, type BackendApiErrorData, type BackendErrorCode, type BackendFailureExplanation, type CreateMatrxTransportOptions, type CreateWarmupOptions, ENDPOINTS, type EndpointOverrideConfig, type ExecuteMatrxCallHooks, type ExecuteMatrxCallRequest, type FollowRuntimeOperationOptions, type FollowRuntimeOperationToEndOptions, type FollowRuntimeOperationToEndResult, type FollowServerJobOptions, type FollowUnavailableRejoinOptions, type JsonRequestOptions, MATRX_LIVE_STREAM_UNAVAILABLE, MATRX_RESUME_CONFLICT, MATRX_RUN_IN_PROGRESS, MATRX_UI_ONLY_BODY_FIELDS, type MatrxAgentStartRequest, MatrxApiError, type MatrxCallError, type MatrxCallResult, type MatrxCallScope, type MatrxCancelResponse, type MatrxChatMessage, type MatrxClientSessionProvider, type MatrxClientToolResult, type MatrxCompletedRun, type MatrxContextAnchor, type MatrxConversationContinueRequest, type MatrxConversationResumeRequest, type MatrxConversationStart, type MatrxEphemeralConversation, type MatrxFollowedOutcome, type MatrxHttpErrorLike, type MatrxHttpMethod, type MatrxJsonObject, type MatrxJsonValue, type MatrxLiveRunRejoin, type MatrxLiveStreamUnavailable, type MatrxMandateStartRequest, type MatrxOperationEventsPage, type MatrxOperationFollowEvent, type MatrxOperationStatusResponse, type MatrxOperationsByLinkResponse, type MatrxPendingCallSummary, type MatrxQueryParams, type MatrxRequestInfo, type MatrxRequestScope, MatrxRunError, type MatrxRunHandle, type MatrxRunPickup, type MatrxRunPickupSettlement, type MatrxRuntimeExecutionStatus, type MatrxRuntimeOperationEvent, type MatrxRuntimeOperationView, type MatrxStoredConversationContinue, type MatrxStoredConversationCreate, type MatrxStreamCallOptions, type MatrxStreamCursorStamp, type MatrxStreamIds, type MatrxStreamParse, type MatrxToolResultsResponse, type MatrxTransport, type MatrxTransportDiagnostics, type MatrxTransportRequest, type MatrxTransportTarget, type MatrxTurnFields, OrganizationContextError, type OrganizationContextErrorCode, type OrganizationOperation, type ParseMatrxNdjsonResponseHooks, type ProviderSessionFailure, type ProviderSessionFailureVerdict, type ProviderSessionUsage, type ProviderSessionUsageReceipt, type ProviderUsageReporter, type ProviderUsageReporterOptions, type ProviderUsageSendResult, type QueryValue, RUN_OUTPUT_KINDS, RUN_STREAM_LIFETIME_BACKSTOP_MS, RUN_WAIT_KNOB_FEATURE, type ResumeOrRejoinOptions, type ResumeOrRejoinOutcome, type RunAgentToCompletionOptions, type RunOutputKind, type RunWait, type RunWaitKnobReader, type SendMatrxRequestOptions, type ServerJobFinalStatus, type ServerJobOutcome, type ServerJobPath, type ServerJobStatus, type ServerJobTarget, type SettleRunPickupOptions, type StreamReplayCursor, type StreamReplayCursorOptions, type StreamRequestOptions, StreamTransportError, TERMINAL_MATRX_RUNTIME_STATUSES, type UpstreamErrorPayload, WARM_PATH, type WarmItem, type WarmReason, type Warmup, applyOrganizationContextHeader, assertOrganizationMatchesOperation, assertQueryOrganizationMatchesContext, bareStatusSentence, buildMatrxRequestBody, buildMatrxRequestUrl, buildQuery, buildSafeRequestLog, cancelAgentRun, continueAgentConversation, continueEphemeralConversationStart, continueStoredConversationStart, createMatrxTransport, createOrganizationOperation, createProviderUsageReporter, createStreamReplayCursor, createWarmup, describeBackendFailure, encodePathSegment, executeMatrxCall, extractMatrxErrorCode, extractMatrxErrorMessage, followRuntimeOperationEvents, followRuntimeOperationToEnd, followServerJob, followUnavailableRejoin, followWorkflowRunEvents, getRuntimeOperationStatus, getRuntimeOperationsByLink, getUserMessage, honestTransportMessage,
|
|
2690
|
+
export { BackendApiError, type BackendApiErrorData, type BackendErrorCode, type BackendFailureExplanation, type CreateMatrxTransportOptions, type CreateWarmupOptions, ENDPOINTS, type EndpointOverrideConfig, type ExecuteMatrxCallHooks, type ExecuteMatrxCallRequest, type FollowRuntimeOperationOptions, type FollowRuntimeOperationToEndOptions, type FollowRuntimeOperationToEndResult, type FollowServerJobOptions, type FollowUnavailableRejoinOptions, type JsonRequestOptions, MATRX_LIVE_STREAM_UNAVAILABLE, MATRX_RESUME_CONFLICT, MATRX_RUN_IN_PROGRESS, MATRX_UI_ONLY_BODY_FIELDS, type MatrxAgentStartRequest, MatrxApiError, type MatrxCallError, type MatrxCallResult, type MatrxCallScope, type MatrxCancelResponse, type MatrxChatMessage, type MatrxClientSessionProvider, type MatrxClientToolResult, type MatrxCompletedRun, type MatrxContextAnchor, type MatrxConversationContinueRequest, type MatrxConversationResumeRequest, type MatrxConversationStart, type MatrxEphemeralConversation, type MatrxFollowedOutcome, type MatrxHttpErrorLike, type MatrxHttpMethod, type MatrxJsonObject, type MatrxJsonValue, type MatrxLiveRunRejoin, type MatrxLiveStreamUnavailable, type MatrxMandateStartRequest, type MatrxOperationEventsPage, type MatrxOperationFollowEvent, type MatrxOperationStatusResponse, type MatrxOperationsByLinkResponse, type MatrxPendingCallSummary, type MatrxQueryParams, type MatrxRequestInfo, type MatrxRequestScope, MatrxRunError, type MatrxRunHandle, type MatrxRunPickup, type MatrxRunPickupSettlement, type MatrxRuntimeExecutionStatus, type MatrxRuntimeOperationEvent, type MatrxRuntimeOperationView, type MatrxStoredConversationContinue, type MatrxStoredConversationCreate, type MatrxStreamCallOptions, type MatrxStreamCursorStamp, type MatrxStreamIds, type MatrxStreamParse, type MatrxToolResultsResponse, type MatrxTransport, type MatrxTransportDiagnostics, type MatrxTransportRequest, type MatrxTransportTarget, type MatrxTurnFields, OrganizationContextError, type OrganizationContextErrorCode, type OrganizationOperation, type ParseMatrxNdjsonResponseHooks, type ProviderSessionFailure, type ProviderSessionFailureVerdict, type ProviderSessionUsage, type ProviderSessionUsageReceipt, type ProviderUsageReporter, type ProviderUsageReporterOptions, type ProviderUsageSendResult, type QueryValue, RUN_OUTPUT_KINDS, RUN_STREAM_LIFETIME_BACKSTOP_MS, RUN_WAIT_KNOB_FEATURE, type ResumeOrRejoinOptions, type ResumeOrRejoinOutcome, type RunAgentToCompletionOptions, type RunOutputKind, type RunWait, type RunWaitKnobReader, type SendMatrxRequestOptions, type ServerJobFinalStatus, type ServerJobOutcome, type ServerJobPath, type ServerJobStatus, type ServerJobTarget, type SettleRunPickupOptions, type StreamReplayCursor, type StreamReplayCursorOptions, type StreamRequestOptions, StreamTransportError, TERMINAL_MATRX_RUNTIME_STATUSES, type UpstreamErrorPayload, WARM_PATH, type WarmItem, type WarmReason, type Warmup, applyOrganizationContextHeader, assertOrganizationMatchesOperation, assertQueryOrganizationMatchesContext, bareStatusSentence, buildMatrxRequestBody, buildMatrxRequestUrl, buildQuery, buildSafeRequestLog, cancelAgentRun, continueAgentConversation, continueEphemeralConversationStart, continueStoredConversationStart, createMatrxTransport, createOrganizationOperation, createProviderUsageReporter, createStreamReplayCursor, createWarmup, describeBackendFailure, encodePathSegment, executeMatrxCall, extractMatrxErrorCode, extractMatrxErrorMessage, followRuntimeOperationEvents, followRuntimeOperationToEnd, followServerJob, followUnavailableRejoin, followWorkflowRunEvents, getRuntimeOperationStatus, getRuntimeOperationsByLink, getUserMessage, honestTransportMessage, isEmptyProviderUsage, isGenericUserMessage, isJobOutputKind, isLiveStreamUnavailable, isResumeConflict, isServerJobSettled, isStreamTransportLost, listConversationPendingToolCalls, listRuntimeOperationEvents, listUserPendingToolCalls, mintMatrxConversationId, newEphemeralConversationStart, newStoredConversationStart, normalizeMatrxError, openMatrxStream, parseCallApiError, parseHttpError, parseHttpErrorBody, parseMatrxNdjsonResponse, parsePersistedBackendError, parseStreamError, pickServerJobOperation, preconnectServer, providerSessionFailureBody, providerSessionUsageBody, readConversationOrganizationId, readLiveRunRejoin, readLiveRunRequestId, readLiveStreamUnavailable, readMatrxErrorCode, readMatrxErrorCodeFromMessage, readMatrxJsonResponse, readStreamCursor, redactUrlForRequestLog, rejoinRuntimeOperation, reportProviderSessionFailure, reportProviderSessionUsage, requestJson, requestStream, requireOrganizationContext, resetPreconnectedForTests, resolveEndpointPath, resolveRunWaitWith, resumeAgentConversation, resumeOrRejoin, runAgentToCompletion, runJobLabel, runOutputKindFromModalities, runWaitKnobKey, runWaitTimeoutMessage, runtimeOperationRejoinPath, sendMatrxRequest, serverJobRejoinHandle, settleRunPickup, shouldReportMatrxCallError, startAgentRun, startMandateRun, streamErrorText, submitAgentToolResults, toRunHandle, unwrapUpstreamError, withRunOrganization };
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { M as MatrxStreamEnvelope, b as MatrxNdjsonIssue, U as UploadProgress, c
|
|
|
2
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-D7z-_LrQ.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
|
-
export { AbortedError, ConnectTimeoutError, HeartbeatTimeoutError, HttpError, NetError, NetErrorCode, NetworkError, OfflineError, ResilientFetchOptions, ResilientFetchResult, RetryOptions, StreamMonitorOptions, TotalTimeoutError, extractErrorMessage, isNetError, isTransportFailure, monitorStream, resilientFetch, toNetError, withRetry } from './net.js';
|
|
5
|
+
export { AbortedError, ConnectTimeoutError, HeartbeatTimeoutError, HttpError, NetError, NetErrorCode, NetworkError, OfflineError, ResilientFetchOptions, ResilientFetchResult, RetryOptions, StreamMonitorOptions, TotalTimeoutError, extractErrorMessage, isBareTransportCode, isNetError, isTransportFailure, monitorStream, resilientFetch, toNetError, withRetry } from './net.js';
|
|
6
6
|
import { g as MandateKey, b as DynamicMandateKey } from './keys.generated-DS6DQfbq.js';
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -559,8 +559,7 @@ declare const MATRX_UI_ONLY_BODY_FIELDS: ReadonlySet<string>;
|
|
|
559
559
|
* Other scope fields keep caller-wins behaviour.
|
|
560
560
|
*/
|
|
561
561
|
declare function buildMatrxRequestBody(body: unknown, scope: MatrxCallScope): Record<string, unknown>;
|
|
562
|
-
|
|
563
|
-
declare function isBareTransportCode(text: string | null | undefined): boolean;
|
|
562
|
+
|
|
564
563
|
/**
|
|
565
564
|
* A BARE STATUS CODE IS NEVER A SENTENCE. What a person reads when the server
|
|
566
565
|
* answered an error with no readable message. The status itself rides
|
|
@@ -2688,4 +2687,4 @@ declare const ENDPOINTS: {
|
|
|
2688
2687
|
};
|
|
2689
2688
|
};
|
|
2690
2689
|
|
|
2691
|
-
export { BackendApiError, type BackendApiErrorData, type BackendErrorCode, type BackendFailureExplanation, type CreateMatrxTransportOptions, type CreateWarmupOptions, ENDPOINTS, type EndpointOverrideConfig, type ExecuteMatrxCallHooks, type ExecuteMatrxCallRequest, type FollowRuntimeOperationOptions, type FollowRuntimeOperationToEndOptions, type FollowRuntimeOperationToEndResult, type FollowServerJobOptions, type FollowUnavailableRejoinOptions, type JsonRequestOptions, MATRX_LIVE_STREAM_UNAVAILABLE, MATRX_RESUME_CONFLICT, MATRX_RUN_IN_PROGRESS, MATRX_UI_ONLY_BODY_FIELDS, type MatrxAgentStartRequest, MatrxApiError, type MatrxCallError, type MatrxCallResult, type MatrxCallScope, type MatrxCancelResponse, type MatrxChatMessage, type MatrxClientSessionProvider, type MatrxClientToolResult, type MatrxCompletedRun, type MatrxContextAnchor, type MatrxConversationContinueRequest, type MatrxConversationResumeRequest, type MatrxConversationStart, type MatrxEphemeralConversation, type MatrxFollowedOutcome, type MatrxHttpErrorLike, type MatrxHttpMethod, type MatrxJsonObject, type MatrxJsonValue, type MatrxLiveRunRejoin, type MatrxLiveStreamUnavailable, type MatrxMandateStartRequest, type MatrxOperationEventsPage, type MatrxOperationFollowEvent, type MatrxOperationStatusResponse, type MatrxOperationsByLinkResponse, type MatrxPendingCallSummary, type MatrxQueryParams, type MatrxRequestInfo, type MatrxRequestScope, MatrxRunError, type MatrxRunHandle, type MatrxRunPickup, type MatrxRunPickupSettlement, type MatrxRuntimeExecutionStatus, type MatrxRuntimeOperationEvent, type MatrxRuntimeOperationView, type MatrxStoredConversationContinue, type MatrxStoredConversationCreate, type MatrxStreamCallOptions, type MatrxStreamCursorStamp, type MatrxStreamIds, type MatrxStreamParse, type MatrxToolResultsResponse, type MatrxTransport, type MatrxTransportDiagnostics, type MatrxTransportRequest, type MatrxTransportTarget, type MatrxTurnFields, OrganizationContextError, type OrganizationContextErrorCode, type OrganizationOperation, type ParseMatrxNdjsonResponseHooks, type ProviderSessionFailure, type ProviderSessionFailureVerdict, type ProviderSessionUsage, type ProviderSessionUsageReceipt, type ProviderUsageReporter, type ProviderUsageReporterOptions, type ProviderUsageSendResult, type QueryValue, RUN_OUTPUT_KINDS, RUN_STREAM_LIFETIME_BACKSTOP_MS, RUN_WAIT_KNOB_FEATURE, type ResumeOrRejoinOptions, type ResumeOrRejoinOutcome, type RunAgentToCompletionOptions, type RunOutputKind, type RunWait, type RunWaitKnobReader, type SendMatrxRequestOptions, type ServerJobFinalStatus, type ServerJobOutcome, type ServerJobPath, type ServerJobStatus, type ServerJobTarget, type SettleRunPickupOptions, type StreamReplayCursor, type StreamReplayCursorOptions, type StreamRequestOptions, StreamTransportError, TERMINAL_MATRX_RUNTIME_STATUSES, type UpstreamErrorPayload, WARM_PATH, type WarmItem, type WarmReason, type Warmup, applyOrganizationContextHeader, assertOrganizationMatchesOperation, assertQueryOrganizationMatchesContext, bareStatusSentence, buildMatrxRequestBody, buildMatrxRequestUrl, buildQuery, buildSafeRequestLog, cancelAgentRun, continueAgentConversation, continueEphemeralConversationStart, continueStoredConversationStart, createMatrxTransport, createOrganizationOperation, createProviderUsageReporter, createStreamReplayCursor, createWarmup, describeBackendFailure, encodePathSegment, executeMatrxCall, extractMatrxErrorCode, extractMatrxErrorMessage, followRuntimeOperationEvents, followRuntimeOperationToEnd, followServerJob, followUnavailableRejoin, followWorkflowRunEvents, getRuntimeOperationStatus, getRuntimeOperationsByLink, getUserMessage, honestTransportMessage,
|
|
2690
|
+
export { BackendApiError, type BackendApiErrorData, type BackendErrorCode, type BackendFailureExplanation, type CreateMatrxTransportOptions, type CreateWarmupOptions, ENDPOINTS, type EndpointOverrideConfig, type ExecuteMatrxCallHooks, type ExecuteMatrxCallRequest, type FollowRuntimeOperationOptions, type FollowRuntimeOperationToEndOptions, type FollowRuntimeOperationToEndResult, type FollowServerJobOptions, type FollowUnavailableRejoinOptions, type JsonRequestOptions, MATRX_LIVE_STREAM_UNAVAILABLE, MATRX_RESUME_CONFLICT, MATRX_RUN_IN_PROGRESS, MATRX_UI_ONLY_BODY_FIELDS, type MatrxAgentStartRequest, MatrxApiError, type MatrxCallError, type MatrxCallResult, type MatrxCallScope, type MatrxCancelResponse, type MatrxChatMessage, type MatrxClientSessionProvider, type MatrxClientToolResult, type MatrxCompletedRun, type MatrxContextAnchor, type MatrxConversationContinueRequest, type MatrxConversationResumeRequest, type MatrxConversationStart, type MatrxEphemeralConversation, type MatrxFollowedOutcome, type MatrxHttpErrorLike, type MatrxHttpMethod, type MatrxJsonObject, type MatrxJsonValue, type MatrxLiveRunRejoin, type MatrxLiveStreamUnavailable, type MatrxMandateStartRequest, type MatrxOperationEventsPage, type MatrxOperationFollowEvent, type MatrxOperationStatusResponse, type MatrxOperationsByLinkResponse, type MatrxPendingCallSummary, type MatrxQueryParams, type MatrxRequestInfo, type MatrxRequestScope, MatrxRunError, type MatrxRunHandle, type MatrxRunPickup, type MatrxRunPickupSettlement, type MatrxRuntimeExecutionStatus, type MatrxRuntimeOperationEvent, type MatrxRuntimeOperationView, type MatrxStoredConversationContinue, type MatrxStoredConversationCreate, type MatrxStreamCallOptions, type MatrxStreamCursorStamp, type MatrxStreamIds, type MatrxStreamParse, type MatrxToolResultsResponse, type MatrxTransport, type MatrxTransportDiagnostics, type MatrxTransportRequest, type MatrxTransportTarget, type MatrxTurnFields, OrganizationContextError, type OrganizationContextErrorCode, type OrganizationOperation, type ParseMatrxNdjsonResponseHooks, type ProviderSessionFailure, type ProviderSessionFailureVerdict, type ProviderSessionUsage, type ProviderSessionUsageReceipt, type ProviderUsageReporter, type ProviderUsageReporterOptions, type ProviderUsageSendResult, type QueryValue, RUN_OUTPUT_KINDS, RUN_STREAM_LIFETIME_BACKSTOP_MS, RUN_WAIT_KNOB_FEATURE, type ResumeOrRejoinOptions, type ResumeOrRejoinOutcome, type RunAgentToCompletionOptions, type RunOutputKind, type RunWait, type RunWaitKnobReader, type SendMatrxRequestOptions, type ServerJobFinalStatus, type ServerJobOutcome, type ServerJobPath, type ServerJobStatus, type ServerJobTarget, type SettleRunPickupOptions, type StreamReplayCursor, type StreamReplayCursorOptions, type StreamRequestOptions, StreamTransportError, TERMINAL_MATRX_RUNTIME_STATUSES, type UpstreamErrorPayload, WARM_PATH, type WarmItem, type WarmReason, type Warmup, applyOrganizationContextHeader, assertOrganizationMatchesOperation, assertQueryOrganizationMatchesContext, bareStatusSentence, buildMatrxRequestBody, buildMatrxRequestUrl, buildQuery, buildSafeRequestLog, cancelAgentRun, continueAgentConversation, continueEphemeralConversationStart, continueStoredConversationStart, createMatrxTransport, createOrganizationOperation, createProviderUsageReporter, createStreamReplayCursor, createWarmup, describeBackendFailure, encodePathSegment, executeMatrxCall, extractMatrxErrorCode, extractMatrxErrorMessage, followRuntimeOperationEvents, followRuntimeOperationToEnd, followServerJob, followUnavailableRejoin, followWorkflowRunEvents, getRuntimeOperationStatus, getRuntimeOperationsByLink, getUserMessage, honestTransportMessage, isEmptyProviderUsage, isGenericUserMessage, isJobOutputKind, isLiveStreamUnavailable, isResumeConflict, isServerJobSettled, isStreamTransportLost, listConversationPendingToolCalls, listRuntimeOperationEvents, listUserPendingToolCalls, mintMatrxConversationId, newEphemeralConversationStart, newStoredConversationStart, normalizeMatrxError, openMatrxStream, parseCallApiError, parseHttpError, parseHttpErrorBody, parseMatrxNdjsonResponse, parsePersistedBackendError, parseStreamError, pickServerJobOperation, preconnectServer, providerSessionFailureBody, providerSessionUsageBody, readConversationOrganizationId, readLiveRunRejoin, readLiveRunRequestId, readLiveStreamUnavailable, readMatrxErrorCode, readMatrxErrorCodeFromMessage, readMatrxJsonResponse, readStreamCursor, redactUrlForRequestLog, rejoinRuntimeOperation, reportProviderSessionFailure, reportProviderSessionUsage, requestJson, requestStream, requireOrganizationContext, resetPreconnectedForTests, resolveEndpointPath, resolveRunWaitWith, resumeAgentConversation, resumeOrRejoin, runAgentToCompletion, runJobLabel, runOutputKindFromModalities, runWaitKnobKey, runWaitTimeoutMessage, runtimeOperationRejoinPath, sendMatrxRequest, serverJobRejoinHandle, settleRunPickup, shouldReportMatrxCallError, startAgentRun, startMandateRun, streamErrorText, submitAgentToolResults, toRunHandle, unwrapUpstreamError, withRunOrganization };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { isBareTransportCode } from './chunk-DIRPTJVH.js';
|
|
2
|
+
export { isBareTransportCode, monitorStream } from './chunk-DIRPTJVH.js';
|
|
2
3
|
export { API_KEY_PREFIX, MATRX_HEADERS, credentialToHeaders, toCredentialsPort } from './chunk-7MZPBCFV.js';
|
|
3
4
|
import { OrganizationContextError, sendOnWire, WIRE_FETCH_OPTION_KEYS, BackendApiError, parseHttpError, MatrxApiError, applyOrganizationContextHeader, extractMatrxErrorCode, extractMatrxErrorMessage, readMatrxNdjsonStream, readMatrxSseStream, requireOrganizationContext, StreamTransportError } from './chunk-NRTRYB7K.js';
|
|
4
5
|
export { BackendApiError, CONTRACT_SHA256, DEPLOYMENTS, DOMAINS, MatrxApiError, OrganizationContextError, StreamTransportError, applyOrganizationContextHeader, assertOrganizationMatchesOperation, assertQueryOrganizationMatchesContext, createApi, createOrganizationOperation, describeBackendFailure, extractMatrxErrorCode, extractMatrxErrorMessage, getUserMessage, isBinaryType, isGenericUserMessage, isStreamTransportLost, openJsonOrStream, openStream, parseCallApiError, parseHttpError, parseHttpErrorBody, parsePersistedBackendError, parseStreamError, requireOrganizationContext, unwrapUpstreamError } from './chunk-NRTRYB7K.js';
|
|
@@ -59,11 +60,6 @@ function buildMatrxRequestBody(body, scope) {
|
|
|
59
60
|
if (scope.task_id !== void 0) scopeFields.task_id = scope.task_id;
|
|
60
61
|
return { ...scopeFields, ...base };
|
|
61
62
|
}
|
|
62
|
-
var BARE_TRANSPORT_CODE = /^\s*(?:HTTP|HTTP\s*Error|Status(?:\s*Code)?)?\s*[:\-]?\s*\d{3}\s*[.:!]?\s*$/i;
|
|
63
|
-
function isBareTransportCode(text) {
|
|
64
|
-
if (!text) return false;
|
|
65
|
-
return BARE_TRANSPORT_CODE.test(text);
|
|
66
|
-
}
|
|
67
63
|
function bareStatusSentence(status) {
|
|
68
64
|
if (status === 401 || status === 403) {
|
|
69
65
|
return "The server would not let this request through \u2014 your session may have expired, or this account may not have access here. Sign in again, and if it repeats, ask an administrator.";
|
|
@@ -2270,4 +2266,4 @@ var ENDPOINTS = {
|
|
|
2270
2266
|
}
|
|
2271
2267
|
};
|
|
2272
2268
|
|
|
2273
|
-
export { ENDPOINTS, MATRX_LIVE_STREAM_UNAVAILABLE, MATRX_RESUME_CONFLICT, MATRX_RUN_IN_PROGRESS, MATRX_UI_ONLY_BODY_FIELDS, MatrxRunError, RUN_OUTPUT_KINDS, RUN_STREAM_LIFETIME_BACKSTOP_MS, RUN_WAIT_KNOB_FEATURE, TERMINAL_MATRX_RUNTIME_STATUSES, WARM_PATH, bareStatusSentence, buildMatrxRequestBody, buildMatrxRequestUrl, buildQuery, buildSafeRequestLog, cancelAgentRun, continueAgentConversation, continueEphemeralConversationStart, continueStoredConversationStart, createMatrxTransport, createProviderUsageReporter, createStreamReplayCursor, createWarmup, encodePathSegment, executeMatrxCall, followRuntimeOperationEvents, followRuntimeOperationToEnd, followServerJob, followUnavailableRejoin, followWorkflowRunEvents, getRuntimeOperationStatus, getRuntimeOperationsByLink, honestTransportMessage,
|
|
2269
|
+
export { ENDPOINTS, MATRX_LIVE_STREAM_UNAVAILABLE, MATRX_RESUME_CONFLICT, MATRX_RUN_IN_PROGRESS, MATRX_UI_ONLY_BODY_FIELDS, MatrxRunError, RUN_OUTPUT_KINDS, RUN_STREAM_LIFETIME_BACKSTOP_MS, RUN_WAIT_KNOB_FEATURE, TERMINAL_MATRX_RUNTIME_STATUSES, WARM_PATH, bareStatusSentence, buildMatrxRequestBody, buildMatrxRequestUrl, buildQuery, buildSafeRequestLog, cancelAgentRun, continueAgentConversation, continueEphemeralConversationStart, continueStoredConversationStart, createMatrxTransport, createProviderUsageReporter, createStreamReplayCursor, createWarmup, encodePathSegment, executeMatrxCall, followRuntimeOperationEvents, followRuntimeOperationToEnd, followServerJob, followUnavailableRejoin, followWorkflowRunEvents, getRuntimeOperationStatus, getRuntimeOperationsByLink, honestTransportMessage, isEmptyProviderUsage, isJobOutputKind, isLiveStreamUnavailable, isResumeConflict, isServerJobSettled, listConversationPendingToolCalls, listRuntimeOperationEvents, listUserPendingToolCalls, mintMatrxConversationId, newEphemeralConversationStart, newStoredConversationStart, normalizeMatrxError, openMatrxStream, parseMatrxNdjsonResponse, pickServerJobOperation, preconnectServer, providerSessionFailureBody, providerSessionUsageBody, readConversationOrganizationId, readLiveRunRejoin, readLiveRunRequestId, readLiveStreamUnavailable, readMatrxErrorCode, readMatrxErrorCodeFromMessage, readMatrxJsonResponse, readStreamCursor, redactUrlForRequestLog, rejoinRuntimeOperation, reportProviderSessionFailure, reportProviderSessionUsage, requestJson, requestStream, resetPreconnectedForTests, resolveEndpointPath, resolveRunWaitWith, resumeAgentConversation, resumeOrRejoin, runAgentToCompletion, runJobLabel, runOutputKindFromModalities, runWaitKnobKey, runWaitTimeoutMessage, runtimeOperationRejoinPath, sendMatrxRequest, serverJobRejoinHandle, settleRunPickup, shouldReportMatrxCallError, startAgentRun, startMandateRun, streamErrorText, submitAgentToolResults, toRunHandle, withRunOrganization };
|
package/dist/net.cjs
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkOOZ3H4CS_cjs = require('./chunk-OOZ3H4CS.cjs');
|
|
4
4
|
var chunk2SXAAKGV_cjs = require('./chunk-2SXAAKGV.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
+
Object.defineProperty(exports, "isBareTransportCode", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () { return chunkOOZ3H4CS_cjs.isBareTransportCode; }
|
|
11
|
+
});
|
|
8
12
|
Object.defineProperty(exports, "monitorStream", {
|
|
9
13
|
enumerable: true,
|
|
10
|
-
get: function () { return
|
|
14
|
+
get: function () { return chunkOOZ3H4CS_cjs.monitorStream; }
|
|
11
15
|
});
|
|
12
16
|
Object.defineProperty(exports, "AbortedError", {
|
|
13
17
|
enumerable: true,
|
package/dist/net.d.cts
CHANGED
|
@@ -201,4 +201,7 @@ interface StreamMonitorOptions {
|
|
|
201
201
|
*/
|
|
202
202
|
declare function monitorStream<T>(source: AsyncIterable<T>, opts?: StreamMonitorOptions): AsyncGenerator<T, void, undefined>;
|
|
203
203
|
|
|
204
|
-
|
|
204
|
+
/** True when a candidate sentence is really just the status line wearing words. */
|
|
205
|
+
declare function isBareTransportCode(text: string | null | undefined): boolean;
|
|
206
|
+
|
|
207
|
+
export { AbortedError, ConnectTimeoutError, HeartbeatTimeoutError, HttpError, NetError, type NetErrorCode, NetworkError, OfflineError, type ResilientFetchOptions, type ResilientFetchResult, type RetryOptions, type StreamMonitorOptions, TotalTimeoutError, extractErrorMessage, isBareTransportCode, isNetError, isTransportFailure, monitorStream, resilientFetch, toNetError, withRetry };
|
package/dist/net.d.ts
CHANGED
|
@@ -201,4 +201,7 @@ interface StreamMonitorOptions {
|
|
|
201
201
|
*/
|
|
202
202
|
declare function monitorStream<T>(source: AsyncIterable<T>, opts?: StreamMonitorOptions): AsyncGenerator<T, void, undefined>;
|
|
203
203
|
|
|
204
|
-
|
|
204
|
+
/** True when a candidate sentence is really just the status line wearing words. */
|
|
205
|
+
declare function isBareTransportCode(text: string | null | undefined): boolean;
|
|
206
|
+
|
|
207
|
+
export { AbortedError, ConnectTimeoutError, HeartbeatTimeoutError, HttpError, NetError, type NetErrorCode, NetworkError, OfflineError, type ResilientFetchOptions, type ResilientFetchResult, type RetryOptions, type StreamMonitorOptions, TotalTimeoutError, extractErrorMessage, isBareTransportCode, isNetError, isTransportFailure, monitorStream, resilientFetch, toNetError, withRetry };
|
package/dist/net.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { monitorStream } from './chunk-
|
|
1
|
+
export { isBareTransportCode, monitorStream } from './chunk-DIRPTJVH.js';
|
|
2
2
|
export { AbortedError, ConnectTimeoutError, HeartbeatTimeoutError, HttpError, NetError, NetworkError, OfflineError, TotalTimeoutError, extractErrorMessage, isNetError, isTransportFailure, resilientFetch, toNetError, withRetry } from './chunk-KIEAFMKB.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-matrx/api",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.37",
|
|
4
4
|
"description": "The one way every app talks to every AI Matrx server: generated from the server contract, split by domain so an app loads only the requests it calls. Transport, five credential kinds, organization binding, streams, job follow. No screens, app state or database code.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -385,9 +385,9 @@
|
|
|
385
385
|
"./package.json": "./package.json"
|
|
386
386
|
},
|
|
387
387
|
"dependencies": {
|
|
388
|
-
"@ai-matrx/auth": "latest",
|
|
389
388
|
"@ai-matrx/browser-audio": "latest",
|
|
390
|
-
"@ai-matrx/kit": "latest"
|
|
389
|
+
"@ai-matrx/kit": "latest",
|
|
390
|
+
"@ai-matrx/auth": "latest"
|
|
391
391
|
},
|
|
392
392
|
"devDependencies": {
|
|
393
393
|
"@arethetypeswrong/cli": "^0.18.5",
|
|
@@ -439,5 +439,5 @@
|
|
|
439
439
|
"check:sections": "node scripts/section-probe.mjs \"$PWD\"",
|
|
440
440
|
"verify:tarball": "node scripts/verify-tarball.mjs"
|
|
441
441
|
},
|
|
442
|
-
"gitHead": "
|
|
442
|
+
"gitHead": "b887d4308f04cff5b70036c6f94054e51598bb56"
|
|
443
443
|
}
|