@arnilo/prism-supervisor 0.0.6 → 0.0.7

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 CHANGED
@@ -1,4 +1,7 @@
1
1
  # Changelog
2
+ ## [0.0.7] - 2026-07-19
3
+
4
+ - Released with the exact 0.0.7 first-party package graph.
2
5
 
3
6
  ## [0.0.6] - 2026-07-19
4
7
 
@@ -93,16 +93,32 @@ export function createSupervisor(options) {
93
93
  redactor: options.redactor ?? childAgent.config.redactor,
94
94
  });
95
95
  const session = agent.createSession({ id: `${delegationId}-session`, metadata: { supervisorId: id, delegationId, resourceId, threadId } });
96
- const result = await abortable(session.run(input, {
97
- signal: controller.signal,
98
- maxToolRounds: limits.maxSteps,
99
- ownership: options.ownership,
100
- redactor: options.redactor,
101
- metadata: { ...request.metadata, supervisorId: id, delegationId, resourceId, threadId, depth },
102
- }), controller.signal);
96
+ let result;
97
+ try {
98
+ result = await abortable(session.run(input, {
99
+ signal: controller.signal,
100
+ limits: {
101
+ maxToolRounds: limits.maxSteps,
102
+ maxToolCalls: limits.maxToolCalls,
103
+ maxTotalTokens: limits.maxTokens,
104
+ maxWallTimeMs: limits.timeoutMs,
105
+ },
106
+ ownership: options.ownership,
107
+ redactor: options.redactor,
108
+ metadata: { ...request.metadata, supervisorId: id, delegationId, resourceId, threadId, depth },
109
+ }), controller.signal);
110
+ }
111
+ catch (error) {
112
+ if (error instanceof AgentRunError && error.result.limit) {
113
+ const label = error.result.limit.limit === "maxTotalTokens" ? "token"
114
+ : error.result.limit.limit === "maxToolCalls" ? "tool-call"
115
+ : error.result.limit.limit === "maxWallTimeMs" ? "timeout"
116
+ : "run";
117
+ throw new SupervisorLimitError(`Delegation ${label} limit exceeded`);
118
+ }
119
+ throw error;
120
+ }
103
121
  const totalTokens = result.usage?.totalTokens ?? ((result.usage?.inputTokens ?? 0) + (result.usage?.outputTokens ?? 0));
104
- if (totalTokens > limits.maxTokens)
105
- throw new SupervisorLimitError("Delegation token limit exceeded");
106
122
  events.publish({ type: "delegation_finished", childId: request.childId, delegationId, depth, status: result.status, totalTokens });
107
123
  await complete(toCompletion(result, request.childId, delegationId, depth, options));
108
124
  completionSent = true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arnilo/prism-supervisor",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "Optional bounded local supervisor delegation and A2A 1.0 interoperability.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -25,7 +25,7 @@
25
25
  "pack:dry-run": "npm pack --dry-run"
26
26
  },
27
27
  "peerDependencies": {
28
- "@arnilo/prism": "0.0.6"
28
+ "@arnilo/prism": "0.0.7"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@arnilo/prism": "file:../.."