@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.
Files changed (38) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/content-transfer/index.cjs.map +1 -1
  3. package/dist/content-transfer/index.js.map +1 -1
  4. package/dist/content-transfer/react/index.cjs.map +1 -1
  5. package/dist/content-transfer/react/index.js.map +1 -1
  6. package/dist/generated/api-types.cjs.map +1 -1
  7. package/dist/generated/api-types.d.cts +4 -4
  8. package/dist/generated/api-types.d.ts +4 -4
  9. package/dist/index.cjs +49 -7
  10. package/dist/index.cjs.map +1 -1
  11. package/dist/index.d.cts +2 -2
  12. package/dist/index.d.ts +2 -2
  13. package/dist/index.js +49 -7
  14. package/dist/index.js.map +1 -1
  15. package/dist/{keys.generated-DL-5LCNz.d.cts → keys.generated-DxqNwOgr.d.cts} +4 -4
  16. package/dist/{keys.generated-DL-5LCNz.d.ts → keys.generated-DxqNwOgr.d.ts} +4 -4
  17. package/dist/mandates/index.cjs +2 -2
  18. package/dist/mandates/index.cjs.map +1 -1
  19. package/dist/mandates/index.d.cts +2 -2
  20. package/dist/mandates/index.d.ts +2 -2
  21. package/dist/mandates/index.js +2 -2
  22. package/dist/mandates/index.js.map +1 -1
  23. package/dist/matrx/index.cjs +49 -7
  24. package/dist/matrx/index.cjs.map +1 -1
  25. package/dist/matrx/index.d.cts +35 -3
  26. package/dist/matrx/index.d.ts +35 -3
  27. package/dist/matrx/index.js +49 -7
  28. package/dist/matrx/index.js.map +1 -1
  29. package/dist/portable/mcp.cjs.map +1 -1
  30. package/dist/portable/mcp.js.map +1 -1
  31. package/dist/react/index.cjs.map +1 -1
  32. package/dist/react/index.js.map +1 -1
  33. package/generated/api-types.ts +4 -4
  34. package/mandates/snapshots/keys.0.37.2.json +653 -0
  35. package/mandates/snapshots/keys.0.38.0.json +653 -0
  36. package/mandates/snapshots/keys.0.38.1.json +653 -0
  37. package/mandates/snapshots/keys.0.38.2.json +653 -0
  38. package/package.json +2 -2
@@ -41223,7 +41223,7 @@ interface paths {
41223
41223
  * challenge; this is the door for the challenge nobody could detect — a
41224
41224
  * person or an agent that can SEE the block says so, and the session is
41225
41225
  * checkpointed and reopened through their computer with the same run id.
41226
- * Contract: ``common-docs/systems/platform/residential-egress/FEATURE.md``.
41226
+ * Contract: ``common-docs/systems/architecture/residential-egress/FEATURE.md``.
41227
41227
  */
41228
41228
  post: operations["retry_through_home_computer_browser_manager_runs__run_id__retry_through_home_computer_post"];
41229
41229
  delete?: never;
@@ -58558,7 +58558,7 @@ interface components {
58558
58558
  */
58559
58559
  change_role: "apply" | "edit" | "revert";
58560
58560
  /** Actor Tier */
58561
- actor_tier?: ("ai" | "code" | "human") | null;
58561
+ actor_tier?: ("agent" | "system" | "user") | null;
58562
58562
  /** Actor System */
58563
58563
  actor_system?: string | null;
58564
58564
  /** Actor Id */
@@ -62438,7 +62438,7 @@ interface components {
62438
62438
  * sets it: only the Browser Manager knows that a blocked page was retried
62439
62439
  * through the person's own computer. It rides the command reply because that
62440
62440
  * is where the agent and the panel read the answer, and rule 5 of
62441
- * ``common-docs/systems/platform/residential-egress/FEATURE.md`` says a page
62441
+ * ``common-docs/systems/architecture/residential-egress/FEATURE.md`` says a page
62442
62442
  * fetched through a person's computer always says so.
62443
62443
  */
62444
62444
  CommandEgress: {
@@ -187733,7 +187733,7 @@ interface operations {
187733
187733
  unit_token?: ("agent" | "tool" | "workflow") | null;
187734
187734
  unit_id?: string | null;
187735
187735
  change_role?: ("apply" | "edit" | "revert") | null;
187736
- actor_tier?: ("ai" | "code" | "human") | null;
187736
+ actor_tier?: ("agent" | "ai" | "code" | "human" | "system" | "user") | null;
187737
187737
  /** @description Only changes a Hindsight finding caused. */
187738
187738
  with_findings_only?: boolean;
187739
187739
  limit?: number;
@@ -41223,7 +41223,7 @@ interface paths {
41223
41223
  * challenge; this is the door for the challenge nobody could detect — a
41224
41224
  * person or an agent that can SEE the block says so, and the session is
41225
41225
  * checkpointed and reopened through their computer with the same run id.
41226
- * Contract: ``common-docs/systems/platform/residential-egress/FEATURE.md``.
41226
+ * Contract: ``common-docs/systems/architecture/residential-egress/FEATURE.md``.
41227
41227
  */
41228
41228
  post: operations["retry_through_home_computer_browser_manager_runs__run_id__retry_through_home_computer_post"];
41229
41229
  delete?: never;
@@ -58558,7 +58558,7 @@ interface components {
58558
58558
  */
58559
58559
  change_role: "apply" | "edit" | "revert";
58560
58560
  /** Actor Tier */
58561
- actor_tier?: ("ai" | "code" | "human") | null;
58561
+ actor_tier?: ("agent" | "system" | "user") | null;
58562
58562
  /** Actor System */
58563
58563
  actor_system?: string | null;
58564
58564
  /** Actor Id */
@@ -62438,7 +62438,7 @@ interface components {
62438
62438
  * sets it: only the Browser Manager knows that a blocked page was retried
62439
62439
  * through the person's own computer. It rides the command reply because that
62440
62440
  * is where the agent and the panel read the answer, and rule 5 of
62441
- * ``common-docs/systems/platform/residential-egress/FEATURE.md`` says a page
62441
+ * ``common-docs/systems/architecture/residential-egress/FEATURE.md`` says a page
62442
62442
  * fetched through a person's computer always says so.
62443
62443
  */
62444
62444
  CommandEgress: {
@@ -187733,7 +187733,7 @@ interface operations {
187733
187733
  unit_token?: ("agent" | "tool" | "workflow") | null;
187734
187734
  unit_id?: string | null;
187735
187735
  change_role?: ("apply" | "edit" | "revert") | null;
187736
- actor_tier?: ("ai" | "code" | "human") | null;
187736
+ actor_tier?: ("agent" | "ai" | "code" | "human" | "system" | "user") | null;
187737
187737
  /** @description Only changes a Hindsight finding caused. */
187738
187738
  with_findings_only?: boolean;
187739
187739
  limit?: number;
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 && Object.keys(queryParams).length > 0) {
1496
- const qs = new URLSearchParams(
1497
- Object.fromEntries(
1498
- Object.entries(queryParams).map(([k, v]) => [k, String(v)])
1499
- )
1500
- ).toString();
1501
- return `${url}?${qs}`;
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) {