@ai-matrx/agents 0.37.0 → 0.38.1
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 +23 -4
- 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 +5 -0
- package/dist/generated/api-types.d.ts +5 -0
- 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-klzs6I1T.d.cts → keys.generated-DNRbtHNx.d.cts} +4 -4
- package/dist/{keys.generated-klzs6I1T.d.ts → keys.generated-DNRbtHNx.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 +5 -0
- package/mandates/snapshots/keys.0.37.1.json +653 -0
- 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/package.json +2 -2
|
@@ -71265,6 +71265,11 @@ interface components {
|
|
|
71265
71265
|
message?: string | null;
|
|
71266
71266
|
/** Resource Ids */
|
|
71267
71267
|
resource_ids?: string[];
|
|
71268
|
+
/**
|
|
71269
|
+
* Copies
|
|
71270
|
+
* @default 0
|
|
71271
|
+
*/
|
|
71272
|
+
copies?: number;
|
|
71268
71273
|
};
|
|
71269
71274
|
/**
|
|
71270
71275
|
* DirectivePublishReport
|
|
@@ -71265,6 +71265,11 @@ interface components {
|
|
|
71265
71265
|
message?: string | null;
|
|
71266
71266
|
/** Resource Ids */
|
|
71267
71267
|
resource_ids?: string[];
|
|
71268
|
+
/**
|
|
71269
|
+
* Copies
|
|
71270
|
+
* @default 0
|
|
71271
|
+
*/
|
|
71272
|
+
copies?: number;
|
|
71268
71273
|
};
|
|
71269
71274
|
/**
|
|
71270
71275
|
* DirectivePublishReport
|
package/dist/index.cjs
CHANGED
|
@@ -122,6 +122,7 @@ __export(index_exports, {
|
|
|
122
122
|
readLiveStreamUnavailable: () => readLiveStreamUnavailable,
|
|
123
123
|
readMatrxErrorCode: () => readMatrxErrorCode,
|
|
124
124
|
readMatrxErrorCodeFromMessage: () => readMatrxErrorCodeFromMessage,
|
|
125
|
+
readMatrxJsonResponse: () => readMatrxJsonResponse,
|
|
125
126
|
readMatrxNdjsonStream: () => readMatrxNdjsonStream,
|
|
126
127
|
readMatrxSseStream: () => readMatrxSseStream,
|
|
127
128
|
redactUrlForRequestLog: () => redactUrlForRequestLog,
|
|
@@ -141,6 +142,7 @@ __export(index_exports, {
|
|
|
141
142
|
runWaitKnobKey: () => runWaitKnobKey,
|
|
142
143
|
runWaitTimeoutMessage: () => runWaitTimeoutMessage,
|
|
143
144
|
runtimeOperationRejoinPath: () => runtimeOperationRejoinPath,
|
|
145
|
+
sendMatrxRequest: () => sendMatrxRequest,
|
|
144
146
|
settleRunPickup: () => settleRunPickup,
|
|
145
147
|
shouldReportMatrxCallError: () => shouldReportMatrxCallError,
|
|
146
148
|
startAgentRun: () => startAgentRun,
|
|
@@ -1492,13 +1494,15 @@ function buildMatrxRequestUrl(baseUrl, pathTemplate, pathParams, queryParams) {
|
|
|
1492
1494
|
}
|
|
1493
1495
|
const fullPath = resolvedPath.startsWith("/api/") ? resolvedPath.slice(4) : resolvedPath;
|
|
1494
1496
|
const url = `${baseUrl}${fullPath}`;
|
|
1495
|
-
if (queryParams
|
|
1496
|
-
const
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
)
|
|
1500
|
-
|
|
1501
|
-
|
|
1497
|
+
if (queryParams) {
|
|
1498
|
+
const search = new URLSearchParams();
|
|
1499
|
+
for (const [key, value] of Object.entries(queryParams)) {
|
|
1500
|
+
if (value === null || value === void 0) continue;
|
|
1501
|
+
const values = Array.isArray(value) ? value : [value];
|
|
1502
|
+
for (const entry of values) search.append(key, String(entry));
|
|
1503
|
+
}
|
|
1504
|
+
const qs = search.toString();
|
|
1505
|
+
if (qs) return `${url}${url.includes("?") ? "&" : "?"}${qs}`;
|
|
1502
1506
|
}
|
|
1503
1507
|
return url;
|
|
1504
1508
|
}
|
|
@@ -1682,6 +1686,44 @@ async function executeMatrxCall(request, hooks = {}) {
|
|
|
1682
1686
|
...parsed.conversationId !== null ? { conversationId: parsed.conversationId } : {}
|
|
1683
1687
|
};
|
|
1684
1688
|
}
|
|
1689
|
+
async function sendMatrxRequest(url, init = {}, options = {}) {
|
|
1690
|
+
const callerSignal = options.signal ?? init.signal ?? void 0;
|
|
1691
|
+
if (options.timeoutMs === void 0) {
|
|
1692
|
+
return fetch(url, { ...init, ...callerSignal ? { signal: callerSignal } : {} });
|
|
1693
|
+
}
|
|
1694
|
+
const controller = new AbortController();
|
|
1695
|
+
const onCallerAbort = () => controller.abort(callerSignal?.reason);
|
|
1696
|
+
if (callerSignal) {
|
|
1697
|
+
if (callerSignal.aborted) controller.abort(callerSignal.reason);
|
|
1698
|
+
else callerSignal.addEventListener("abort", onCallerAbort, { once: true });
|
|
1699
|
+
}
|
|
1700
|
+
let timedOut = false;
|
|
1701
|
+
const timer = setTimeout(() => {
|
|
1702
|
+
timedOut = true;
|
|
1703
|
+
controller.abort();
|
|
1704
|
+
}, options.timeoutMs);
|
|
1705
|
+
try {
|
|
1706
|
+
return await fetch(url, { ...init, signal: controller.signal });
|
|
1707
|
+
} catch (error) {
|
|
1708
|
+
if (timedOut) {
|
|
1709
|
+
throw new BackendApiError({
|
|
1710
|
+
code: "request_timeout",
|
|
1711
|
+
detail: `${init.method ?? "GET"} ${url} exceeded ${options.timeoutMs}ms`,
|
|
1712
|
+
userMessage: "The request timed out \u2014 please retry.",
|
|
1713
|
+
status: 504
|
|
1714
|
+
});
|
|
1715
|
+
}
|
|
1716
|
+
throw error;
|
|
1717
|
+
} finally {
|
|
1718
|
+
clearTimeout(timer);
|
|
1719
|
+
callerSignal?.removeEventListener("abort", onCallerAbort);
|
|
1720
|
+
}
|
|
1721
|
+
}
|
|
1722
|
+
async function readMatrxJsonResponse(response) {
|
|
1723
|
+
if (!response.ok) throw await parseHttpError(response);
|
|
1724
|
+
if (response.status === 204) return null;
|
|
1725
|
+
return await response.json();
|
|
1726
|
+
}
|
|
1685
1727
|
|
|
1686
1728
|
// matrx/client.ts
|
|
1687
1729
|
function classifyStatus(status) {
|