@ai-matrx/agents 0.37.1 → 0.38.2
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 +24 -0
- package/dist/content-transfer/index.cjs.map +1 -1
- package/dist/content-transfer/index.js.map +1 -1
- package/dist/content-transfer/react/index.cjs.map +1 -1
- package/dist/content-transfer/react/index.js.map +1 -1
- package/dist/generated/api-types.cjs.map +1 -1
- package/dist/generated/api-types.d.cts +4 -4
- package/dist/generated/api-types.d.ts +4 -4
- package/dist/index.cjs +49 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +49 -7
- package/dist/index.js.map +1 -1
- package/dist/{keys.generated-DL-5LCNz.d.cts → keys.generated-DxqNwOgr.d.cts} +4 -4
- package/dist/{keys.generated-DL-5LCNz.d.ts → keys.generated-DxqNwOgr.d.ts} +4 -4
- package/dist/mandates/index.cjs +2 -2
- package/dist/mandates/index.cjs.map +1 -1
- package/dist/mandates/index.d.cts +2 -2
- package/dist/mandates/index.d.ts +2 -2
- package/dist/mandates/index.js +2 -2
- package/dist/mandates/index.js.map +1 -1
- package/dist/matrx/index.cjs +49 -7
- package/dist/matrx/index.cjs.map +1 -1
- package/dist/matrx/index.d.cts +35 -3
- package/dist/matrx/index.d.ts +35 -3
- package/dist/matrx/index.js +49 -7
- package/dist/matrx/index.js.map +1 -1
- package/dist/portable/mcp.cjs.map +1 -1
- package/dist/portable/mcp.js.map +1 -1
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.js.map +1 -1
- package/generated/api-types.ts +4 -4
- package/mandates/snapshots/keys.0.37.2.json +653 -0
- package/mandates/snapshots/keys.0.38.0.json +653 -0
- package/mandates/snapshots/keys.0.38.1.json +653 -0
- package/mandates/snapshots/keys.0.38.2.json +653 -0
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -4,11 +4,11 @@ export { projectAgentResultForDisplay } from './presentation/result.cjs';
|
|
|
4
4
|
export { AgentProjectionEvent, AgentProjectionOperation, AgentProjectionRenderBlock, AgentProjectionStatus, AgentProjectionTool, AgentRequestProjection, createAgentRequestProjection, projectAgentEvent, projectAgentEvents } from './projection/request.cjs';
|
|
5
5
|
export { DEFAULT_WORKFLOW_PROJECTION_LIMITS, WorkflowNodeProjection, WorkflowNodeStreamEvent, WorkflowProjectionLimits, WorkflowRenderBlockIssue, WorkflowRenderBlockIssueCode, WorkflowRenderFrameSet, createWorkflowNodeProjection, projectWorkflowNodeEvent } from './projection/workflow.cjs';
|
|
6
6
|
export { a as MatrxApiError, M as MatrxTransport, b as MatrxTransportRequest, e as extractMatrxErrorCode, c as extractMatrxErrorMessage } from './transport-CxD0fL8p.cjs';
|
|
7
|
-
export { ApiTargetLogContext, BackendApiError, BackendApiErrorData, BackendErrorCode, BackendFailureExplanation, CreateMatrxTransportOptions, ENDPOINTS, EndpointOverrideConfig, ExecuteMatrxCallHooks, ExecuteMatrxCallRequest, FollowUnavailableRejoinOptions, MATRX_AI_API_VERSION_DEFAULT, MATRX_LIVE_STREAM_UNAVAILABLE, MATRX_RESUME_CONFLICT, MATRX_RUN_IN_PROGRESS, MATRX_UI_ONLY_BODY_FIELDS, MatrxAiApiVersion, MatrxCallError, MatrxCallResult, MatrxCallScope, MatrxClientSessionProvider, MatrxClientToolResult, MatrxFollowedOutcome, MatrxHttpErrorLike, MatrxHttpMethod, MatrxLiveRunRejoin, MatrxLiveStreamUnavailable, MatrxPendingCallSummary, MatrxProtocolDowngrade, MatrxProtocolFallbackOptions, MatrxQueryParams, MatrxRequestInfo, MatrxRunPickup, MatrxRunPickupSettlement, MatrxStreamIds, MatrxStreamParse, MatrxToolResultsResponse, MatrxTransportDiagnostics, MatrxTransportTarget, OrganizationContextError, OrganizationContextErrorCode, OrganizationOperation, ParseMatrxNdjsonResponseHooks, ProviderSessionFailure, ProviderSessionFailureVerdict, RUN_OUTPUT_KINDS, RUN_STREAM_LIFETIME_BACKSTOP_MS, RUN_WAIT_KNOB_FEATURE, ResumeOrRejoinOptions, ResumeOrRejoinOutcome, RunOutputKind, RunWait, RunWaitKnobReader, SettleRunPickupOptions, StreamTransportError, UpstreamErrorPayload, V2_COVERED_AI_PATH_TEMPLATES, aiVersionPathOverrides, applyAiApiVersion, applyDesktopTargetToRequestBody, applyOrganizationContextHeader, assertOrganizationMatchesOperation, assertQueryOrganizationMatchesContext, bareStatusSentence, buildMatrxRequestBody, buildMatrxRequestUrl, buildSafeRequestLog, createMatrxTransport, createOrganizationOperation, describeBackendFailure, executeMatrxCall, fetchWithMatrxProtocolFallback, followUnavailableRejoin, followWorkflowRunEvents, getUserMessage, honestTransportMessage, isBareTransportCode, isCoveredAiPath, isGenericUserMessage, isJobOutputKind, isLiveStreamUnavailable, isResumeConflict, isStreamTransportLost, isV2Path, listConversationPendingToolCalls, listUserPendingToolCalls, logApiTarget, normalizeMatrxError, openMatrxStream, parseCallApiError, parseHttpError, parseHttpErrorBody, parseMatrxNdjsonResponse, parsePersistedBackendError, parseStreamError, providerSessionFailureBody, readConversationOrganizationId, readLiveRunRejoin, readLiveRunRequestId, readLiveStreamUnavailable, readMatrxErrorCode, readMatrxErrorCodeFromMessage, redactUrlForRequestLog, reportProviderSessionFailure, requireOrganizationContext, resolveEndpointPath, resolveRunWaitWith, resumeOrRejoin, runJobLabel, runOutputKindFromModalities, runWaitKnobKey, runWaitTimeoutMessage, runtimeOperationRejoinPath, settleRunPickup, shouldReportMatrxCallError, streamErrorText, submitAgentToolResults, toV1FallbackUrl, toV2Path, unwrapUpstreamError, warmAgent, withRunOrganization } from './matrx/index.cjs';
|
|
7
|
+
export { ApiTargetLogContext, BackendApiError, BackendApiErrorData, BackendErrorCode, BackendFailureExplanation, CreateMatrxTransportOptions, ENDPOINTS, EndpointOverrideConfig, ExecuteMatrxCallHooks, ExecuteMatrxCallRequest, FollowUnavailableRejoinOptions, MATRX_AI_API_VERSION_DEFAULT, MATRX_LIVE_STREAM_UNAVAILABLE, MATRX_RESUME_CONFLICT, MATRX_RUN_IN_PROGRESS, MATRX_UI_ONLY_BODY_FIELDS, MatrxAiApiVersion, MatrxCallError, MatrxCallResult, MatrxCallScope, MatrxClientSessionProvider, MatrxClientToolResult, MatrxFollowedOutcome, MatrxHttpErrorLike, MatrxHttpMethod, MatrxLiveRunRejoin, MatrxLiveStreamUnavailable, MatrxPendingCallSummary, MatrxProtocolDowngrade, MatrxProtocolFallbackOptions, MatrxQueryParams, MatrxRequestInfo, MatrxRunPickup, MatrxRunPickupSettlement, MatrxStreamIds, MatrxStreamParse, MatrxToolResultsResponse, MatrxTransportDiagnostics, MatrxTransportTarget, OrganizationContextError, OrganizationContextErrorCode, OrganizationOperation, ParseMatrxNdjsonResponseHooks, ProviderSessionFailure, ProviderSessionFailureVerdict, RUN_OUTPUT_KINDS, RUN_STREAM_LIFETIME_BACKSTOP_MS, RUN_WAIT_KNOB_FEATURE, ResumeOrRejoinOptions, ResumeOrRejoinOutcome, RunOutputKind, RunWait, RunWaitKnobReader, SendMatrxRequestOptions, SettleRunPickupOptions, StreamTransportError, UpstreamErrorPayload, V2_COVERED_AI_PATH_TEMPLATES, aiVersionPathOverrides, applyAiApiVersion, applyDesktopTargetToRequestBody, applyOrganizationContextHeader, assertOrganizationMatchesOperation, assertQueryOrganizationMatchesContext, bareStatusSentence, buildMatrxRequestBody, buildMatrxRequestUrl, buildSafeRequestLog, createMatrxTransport, createOrganizationOperation, describeBackendFailure, executeMatrxCall, fetchWithMatrxProtocolFallback, followUnavailableRejoin, followWorkflowRunEvents, getUserMessage, honestTransportMessage, isBareTransportCode, isCoveredAiPath, isGenericUserMessage, isJobOutputKind, isLiveStreamUnavailable, isResumeConflict, isStreamTransportLost, isV2Path, listConversationPendingToolCalls, listUserPendingToolCalls, logApiTarget, normalizeMatrxError, openMatrxStream, parseCallApiError, parseHttpError, parseHttpErrorBody, parseMatrxNdjsonResponse, parsePersistedBackendError, parseStreamError, providerSessionFailureBody, readConversationOrganizationId, readLiveRunRejoin, readLiveRunRequestId, readLiveStreamUnavailable, readMatrxErrorCode, readMatrxErrorCodeFromMessage, readMatrxJsonResponse, redactUrlForRequestLog, reportProviderSessionFailure, requireOrganizationContext, resolveEndpointPath, resolveRunWaitWith, resumeOrRejoin, runJobLabel, runOutputKindFromModalities, runWaitKnobKey, runWaitTimeoutMessage, runtimeOperationRejoinPath, sendMatrxRequest, settleRunPickup, shouldReportMatrxCallError, streamErrorText, submitAgentToolResults, toV1FallbackUrl, toV2Path, unwrapUpstreamError, warmAgent, withRunOrganization } from './matrx/index.cjs';
|
|
8
8
|
export { F as FollowRuntimeOperationOptions, a as FollowRuntimeOperationToEndOptions, b as FollowRuntimeOperationToEndResult, M as MatrxAgentStartRequest, c as MatrxCancelResponse, d as MatrxChatMessage, e as MatrxCompletedRun, f as MatrxContextAnchor, g as MatrxConversationContinueRequest, h as MatrxConversationResumeRequest, i as MatrxConversationStart, j as MatrxEphemeralConversation, k as MatrxJsonObject, l as MatrxJsonValue, m as MatrxMandateStartRequest, n as MatrxOperationEventsPage, o as MatrxOperationFollowEvent, p as MatrxOperationStatusResponse, q as MatrxOperationsByLinkResponse, r as MatrxRequestScope, s as MatrxRunError, t as MatrxRunHandle, u as MatrxRuntimeExecutionStatus, v as MatrxRuntimeOperationEvent, w as MatrxRuntimeOperationView, x as MatrxStoredConversationContinue, y as MatrxStoredConversationCreate, z as MatrxStreamCallOptions, A as MatrxTurnFields, R as RunAgentToCompletionOptions, T as TERMINAL_MATRX_RUNTIME_STATUSES, B as cancelAgentRun, C as continueAgentConversation, D as continueEphemeralConversationStart, E as continueStoredConversationStart, G as followRuntimeOperationEvents, H as followRuntimeOperationToEnd, I as getRuntimeOperationStatus, J as getRuntimeOperationsByLink, K as listRuntimeOperationEvents, L as mintMatrxConversationId, N as newEphemeralConversationStart, O as newStoredConversationStart, P as rejoinRuntimeOperation, Q as resumeAgentConversation, S as runAgentToCompletion, U as startAgentRun, V as startMandateRun } from './operations-C9QvBH_2.cjs';
|
|
9
9
|
import '@ai-matrx/data';
|
|
10
10
|
import '@ai-matrx/data/net';
|
|
11
|
-
import './keys.generated-
|
|
11
|
+
import './keys.generated-DxqNwOgr.cjs';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Media reference roles — the builder's side of the one vocabulary.
|
package/dist/index.d.ts
CHANGED
|
@@ -4,11 +4,11 @@ export { projectAgentResultForDisplay } from './presentation/result.js';
|
|
|
4
4
|
export { AgentProjectionEvent, AgentProjectionOperation, AgentProjectionRenderBlock, AgentProjectionStatus, AgentProjectionTool, AgentRequestProjection, createAgentRequestProjection, projectAgentEvent, projectAgentEvents } from './projection/request.js';
|
|
5
5
|
export { DEFAULT_WORKFLOW_PROJECTION_LIMITS, WorkflowNodeProjection, WorkflowNodeStreamEvent, WorkflowProjectionLimits, WorkflowRenderBlockIssue, WorkflowRenderBlockIssueCode, WorkflowRenderFrameSet, createWorkflowNodeProjection, projectWorkflowNodeEvent } from './projection/workflow.js';
|
|
6
6
|
export { a as MatrxApiError, M as MatrxTransport, b as MatrxTransportRequest, e as extractMatrxErrorCode, c as extractMatrxErrorMessage } from './transport-CxD0fL8p.js';
|
|
7
|
-
export { ApiTargetLogContext, BackendApiError, BackendApiErrorData, BackendErrorCode, BackendFailureExplanation, CreateMatrxTransportOptions, ENDPOINTS, EndpointOverrideConfig, ExecuteMatrxCallHooks, ExecuteMatrxCallRequest, FollowUnavailableRejoinOptions, MATRX_AI_API_VERSION_DEFAULT, MATRX_LIVE_STREAM_UNAVAILABLE, MATRX_RESUME_CONFLICT, MATRX_RUN_IN_PROGRESS, MATRX_UI_ONLY_BODY_FIELDS, MatrxAiApiVersion, MatrxCallError, MatrxCallResult, MatrxCallScope, MatrxClientSessionProvider, MatrxClientToolResult, MatrxFollowedOutcome, MatrxHttpErrorLike, MatrxHttpMethod, MatrxLiveRunRejoin, MatrxLiveStreamUnavailable, MatrxPendingCallSummary, MatrxProtocolDowngrade, MatrxProtocolFallbackOptions, MatrxQueryParams, MatrxRequestInfo, MatrxRunPickup, MatrxRunPickupSettlement, MatrxStreamIds, MatrxStreamParse, MatrxToolResultsResponse, MatrxTransportDiagnostics, MatrxTransportTarget, OrganizationContextError, OrganizationContextErrorCode, OrganizationOperation, ParseMatrxNdjsonResponseHooks, ProviderSessionFailure, ProviderSessionFailureVerdict, RUN_OUTPUT_KINDS, RUN_STREAM_LIFETIME_BACKSTOP_MS, RUN_WAIT_KNOB_FEATURE, ResumeOrRejoinOptions, ResumeOrRejoinOutcome, RunOutputKind, RunWait, RunWaitKnobReader, SettleRunPickupOptions, StreamTransportError, UpstreamErrorPayload, V2_COVERED_AI_PATH_TEMPLATES, aiVersionPathOverrides, applyAiApiVersion, applyDesktopTargetToRequestBody, applyOrganizationContextHeader, assertOrganizationMatchesOperation, assertQueryOrganizationMatchesContext, bareStatusSentence, buildMatrxRequestBody, buildMatrxRequestUrl, buildSafeRequestLog, createMatrxTransport, createOrganizationOperation, describeBackendFailure, executeMatrxCall, fetchWithMatrxProtocolFallback, followUnavailableRejoin, followWorkflowRunEvents, getUserMessage, honestTransportMessage, isBareTransportCode, isCoveredAiPath, isGenericUserMessage, isJobOutputKind, isLiveStreamUnavailable, isResumeConflict, isStreamTransportLost, isV2Path, listConversationPendingToolCalls, listUserPendingToolCalls, logApiTarget, normalizeMatrxError, openMatrxStream, parseCallApiError, parseHttpError, parseHttpErrorBody, parseMatrxNdjsonResponse, parsePersistedBackendError, parseStreamError, providerSessionFailureBody, readConversationOrganizationId, readLiveRunRejoin, readLiveRunRequestId, readLiveStreamUnavailable, readMatrxErrorCode, readMatrxErrorCodeFromMessage, redactUrlForRequestLog, reportProviderSessionFailure, requireOrganizationContext, resolveEndpointPath, resolveRunWaitWith, resumeOrRejoin, runJobLabel, runOutputKindFromModalities, runWaitKnobKey, runWaitTimeoutMessage, runtimeOperationRejoinPath, settleRunPickup, shouldReportMatrxCallError, streamErrorText, submitAgentToolResults, toV1FallbackUrl, toV2Path, unwrapUpstreamError, warmAgent, withRunOrganization } from './matrx/index.js';
|
|
7
|
+
export { ApiTargetLogContext, BackendApiError, BackendApiErrorData, BackendErrorCode, BackendFailureExplanation, CreateMatrxTransportOptions, ENDPOINTS, EndpointOverrideConfig, ExecuteMatrxCallHooks, ExecuteMatrxCallRequest, FollowUnavailableRejoinOptions, MATRX_AI_API_VERSION_DEFAULT, MATRX_LIVE_STREAM_UNAVAILABLE, MATRX_RESUME_CONFLICT, MATRX_RUN_IN_PROGRESS, MATRX_UI_ONLY_BODY_FIELDS, MatrxAiApiVersion, MatrxCallError, MatrxCallResult, MatrxCallScope, MatrxClientSessionProvider, MatrxClientToolResult, MatrxFollowedOutcome, MatrxHttpErrorLike, MatrxHttpMethod, MatrxLiveRunRejoin, MatrxLiveStreamUnavailable, MatrxPendingCallSummary, MatrxProtocolDowngrade, MatrxProtocolFallbackOptions, MatrxQueryParams, MatrxRequestInfo, MatrxRunPickup, MatrxRunPickupSettlement, MatrxStreamIds, MatrxStreamParse, MatrxToolResultsResponse, MatrxTransportDiagnostics, MatrxTransportTarget, OrganizationContextError, OrganizationContextErrorCode, OrganizationOperation, ParseMatrxNdjsonResponseHooks, ProviderSessionFailure, ProviderSessionFailureVerdict, RUN_OUTPUT_KINDS, RUN_STREAM_LIFETIME_BACKSTOP_MS, RUN_WAIT_KNOB_FEATURE, ResumeOrRejoinOptions, ResumeOrRejoinOutcome, RunOutputKind, RunWait, RunWaitKnobReader, SendMatrxRequestOptions, SettleRunPickupOptions, StreamTransportError, UpstreamErrorPayload, V2_COVERED_AI_PATH_TEMPLATES, aiVersionPathOverrides, applyAiApiVersion, applyDesktopTargetToRequestBody, applyOrganizationContextHeader, assertOrganizationMatchesOperation, assertQueryOrganizationMatchesContext, bareStatusSentence, buildMatrxRequestBody, buildMatrxRequestUrl, buildSafeRequestLog, createMatrxTransport, createOrganizationOperation, describeBackendFailure, executeMatrxCall, fetchWithMatrxProtocolFallback, followUnavailableRejoin, followWorkflowRunEvents, getUserMessage, honestTransportMessage, isBareTransportCode, isCoveredAiPath, isGenericUserMessage, isJobOutputKind, isLiveStreamUnavailable, isResumeConflict, isStreamTransportLost, isV2Path, listConversationPendingToolCalls, listUserPendingToolCalls, logApiTarget, normalizeMatrxError, openMatrxStream, parseCallApiError, parseHttpError, parseHttpErrorBody, parseMatrxNdjsonResponse, parsePersistedBackendError, parseStreamError, providerSessionFailureBody, readConversationOrganizationId, readLiveRunRejoin, readLiveRunRequestId, readLiveStreamUnavailable, readMatrxErrorCode, readMatrxErrorCodeFromMessage, readMatrxJsonResponse, redactUrlForRequestLog, reportProviderSessionFailure, requireOrganizationContext, resolveEndpointPath, resolveRunWaitWith, resumeOrRejoin, runJobLabel, runOutputKindFromModalities, runWaitKnobKey, runWaitTimeoutMessage, runtimeOperationRejoinPath, sendMatrxRequest, settleRunPickup, shouldReportMatrxCallError, streamErrorText, submitAgentToolResults, toV1FallbackUrl, toV2Path, unwrapUpstreamError, warmAgent, withRunOrganization } from './matrx/index.js';
|
|
8
8
|
export { F as FollowRuntimeOperationOptions, a as FollowRuntimeOperationToEndOptions, b as FollowRuntimeOperationToEndResult, M as MatrxAgentStartRequest, c as MatrxCancelResponse, d as MatrxChatMessage, e as MatrxCompletedRun, f as MatrxContextAnchor, g as MatrxConversationContinueRequest, h as MatrxConversationResumeRequest, i as MatrxConversationStart, j as MatrxEphemeralConversation, k as MatrxJsonObject, l as MatrxJsonValue, m as MatrxMandateStartRequest, n as MatrxOperationEventsPage, o as MatrxOperationFollowEvent, p as MatrxOperationStatusResponse, q as MatrxOperationsByLinkResponse, r as MatrxRequestScope, s as MatrxRunError, t as MatrxRunHandle, u as MatrxRuntimeExecutionStatus, v as MatrxRuntimeOperationEvent, w as MatrxRuntimeOperationView, x as MatrxStoredConversationContinue, y as MatrxStoredConversationCreate, z as MatrxStreamCallOptions, A as MatrxTurnFields, R as RunAgentToCompletionOptions, T as TERMINAL_MATRX_RUNTIME_STATUSES, B as cancelAgentRun, C as continueAgentConversation, D as continueEphemeralConversationStart, E as continueStoredConversationStart, G as followRuntimeOperationEvents, H as followRuntimeOperationToEnd, I as getRuntimeOperationStatus, J as getRuntimeOperationsByLink, K as listRuntimeOperationEvents, L as mintMatrxConversationId, N as newEphemeralConversationStart, O as newStoredConversationStart, P as rejoinRuntimeOperation, Q as resumeAgentConversation, S as runAgentToCompletion, U as startAgentRun, V as startMandateRun } from './operations-C3iHFcnt.js';
|
|
9
9
|
import '@ai-matrx/data';
|
|
10
10
|
import '@ai-matrx/data/net';
|
|
11
|
-
import './keys.generated-
|
|
11
|
+
import './keys.generated-DxqNwOgr.js';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Media reference roles — the builder's side of the one vocabulary.
|
package/dist/index.js
CHANGED
|
@@ -1334,13 +1334,15 @@ function buildMatrxRequestUrl(baseUrl, pathTemplate, pathParams, queryParams) {
|
|
|
1334
1334
|
}
|
|
1335
1335
|
const fullPath = resolvedPath.startsWith("/api/") ? resolvedPath.slice(4) : resolvedPath;
|
|
1336
1336
|
const url = `${baseUrl}${fullPath}`;
|
|
1337
|
-
if (queryParams
|
|
1338
|
-
const
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
)
|
|
1342
|
-
|
|
1343
|
-
|
|
1337
|
+
if (queryParams) {
|
|
1338
|
+
const search = new URLSearchParams();
|
|
1339
|
+
for (const [key, value] of Object.entries(queryParams)) {
|
|
1340
|
+
if (value === null || value === void 0) continue;
|
|
1341
|
+
const values = Array.isArray(value) ? value : [value];
|
|
1342
|
+
for (const entry of values) search.append(key, String(entry));
|
|
1343
|
+
}
|
|
1344
|
+
const qs = search.toString();
|
|
1345
|
+
if (qs) return `${url}${url.includes("?") ? "&" : "?"}${qs}`;
|
|
1344
1346
|
}
|
|
1345
1347
|
return url;
|
|
1346
1348
|
}
|
|
@@ -1524,6 +1526,44 @@ async function executeMatrxCall(request, hooks = {}) {
|
|
|
1524
1526
|
...parsed.conversationId !== null ? { conversationId: parsed.conversationId } : {}
|
|
1525
1527
|
};
|
|
1526
1528
|
}
|
|
1529
|
+
async function sendMatrxRequest(url, init = {}, options = {}) {
|
|
1530
|
+
const callerSignal = options.signal ?? init.signal ?? void 0;
|
|
1531
|
+
if (options.timeoutMs === void 0) {
|
|
1532
|
+
return fetch(url, { ...init, ...callerSignal ? { signal: callerSignal } : {} });
|
|
1533
|
+
}
|
|
1534
|
+
const controller = new AbortController();
|
|
1535
|
+
const onCallerAbort = () => controller.abort(callerSignal?.reason);
|
|
1536
|
+
if (callerSignal) {
|
|
1537
|
+
if (callerSignal.aborted) controller.abort(callerSignal.reason);
|
|
1538
|
+
else callerSignal.addEventListener("abort", onCallerAbort, { once: true });
|
|
1539
|
+
}
|
|
1540
|
+
let timedOut = false;
|
|
1541
|
+
const timer = setTimeout(() => {
|
|
1542
|
+
timedOut = true;
|
|
1543
|
+
controller.abort();
|
|
1544
|
+
}, options.timeoutMs);
|
|
1545
|
+
try {
|
|
1546
|
+
return await fetch(url, { ...init, signal: controller.signal });
|
|
1547
|
+
} catch (error) {
|
|
1548
|
+
if (timedOut) {
|
|
1549
|
+
throw new BackendApiError({
|
|
1550
|
+
code: "request_timeout",
|
|
1551
|
+
detail: `${init.method ?? "GET"} ${url} exceeded ${options.timeoutMs}ms`,
|
|
1552
|
+
userMessage: "The request timed out \u2014 please retry.",
|
|
1553
|
+
status: 504
|
|
1554
|
+
});
|
|
1555
|
+
}
|
|
1556
|
+
throw error;
|
|
1557
|
+
} finally {
|
|
1558
|
+
clearTimeout(timer);
|
|
1559
|
+
callerSignal?.removeEventListener("abort", onCallerAbort);
|
|
1560
|
+
}
|
|
1561
|
+
}
|
|
1562
|
+
async function readMatrxJsonResponse(response) {
|
|
1563
|
+
if (!response.ok) throw await parseHttpError(response);
|
|
1564
|
+
if (response.status === 204) return null;
|
|
1565
|
+
return await response.json();
|
|
1566
|
+
}
|
|
1527
1567
|
|
|
1528
1568
|
// matrx/client.ts
|
|
1529
1569
|
function classifyStatus(status) {
|
|
@@ -3411,6 +3451,7 @@ export {
|
|
|
3411
3451
|
readLiveStreamUnavailable,
|
|
3412
3452
|
readMatrxErrorCode,
|
|
3413
3453
|
readMatrxErrorCodeFromMessage,
|
|
3454
|
+
readMatrxJsonResponse,
|
|
3414
3455
|
readMatrxNdjsonStream,
|
|
3415
3456
|
readMatrxSseStream,
|
|
3416
3457
|
redactUrlForRequestLog,
|
|
@@ -3430,6 +3471,7 @@ export {
|
|
|
3430
3471
|
runWaitKnobKey,
|
|
3431
3472
|
runWaitTimeoutMessage,
|
|
3432
3473
|
runtimeOperationRejoinPath,
|
|
3474
|
+
sendMatrxRequest,
|
|
3433
3475
|
settleRunPickup,
|
|
3434
3476
|
shouldReportMatrxCallError,
|
|
3435
3477
|
startAgentRun,
|