@myagentroam/agent 0.10.28 → 0.10.29
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.
|
@@ -1770,7 +1770,7 @@ function strictFunctionSchema(value, optional = false) {
|
|
|
1770
1770
|
if (value === null || typeof value !== 'object' || Array.isArray(value))
|
|
1771
1771
|
return value;
|
|
1772
1772
|
const schema = value;
|
|
1773
|
-
const supportedSchema = Object.fromEntries(Object.entries(schema).filter(([keyword]) => keyword !== 'propertyNames'));
|
|
1773
|
+
const supportedSchema = Object.fromEntries(Object.entries(schema).filter(([keyword]) => keyword !== 'propertyNames' && keyword !== 'uniqueItems'));
|
|
1774
1774
|
if (schema.type === 'object') {
|
|
1775
1775
|
const properties = record(schema.properties);
|
|
1776
1776
|
const required = new Set(Array.isArray(schema.required) ? schema.required : []);
|
|
@@ -182,8 +182,11 @@ export class ExecTool {
|
|
|
182
182
|
throw new MarAgentError('MAR_AGENT_PROCESS_NOT_FOUND', 'Managed process was not found.');
|
|
183
183
|
if (input.action === 'poll' && input.yieldMs)
|
|
184
184
|
await waitForProcessChange(process, Math.min(Math.max(input.yieldMs, 0), TOOL_EXECUTION_LIMITS.execMaxPollYieldMs), signal);
|
|
185
|
-
if (input.action === 'write')
|
|
185
|
+
if (input.action === 'write') {
|
|
186
|
+
if (process.status !== 'running')
|
|
187
|
+
throw new MarAgentError('MAR_AGENT_TOOL_INPUT_INVALID', 'Completed process cannot accept input.');
|
|
186
188
|
process.child.stdin.write(input.data);
|
|
189
|
+
}
|
|
187
190
|
if (input.action === 'cancel')
|
|
188
191
|
await this.#terminate(process, true);
|
|
189
192
|
const result = this.#result(input.processId, process);
|
|
@@ -267,6 +270,7 @@ export class ExecTool {
|
|
|
267
270
|
...(child.exitCode === null ? {} : { exitCode: child.exitCode }),
|
|
268
271
|
...(child.signalCode == null ? {} : { exitSignal: child.signalCode }),
|
|
269
272
|
finalized: false,
|
|
273
|
+
terminalResultReturned: false,
|
|
270
274
|
waiters: new Set()
|
|
271
275
|
};
|
|
272
276
|
this.#processes.set(id, managed);
|
|
@@ -493,6 +497,7 @@ export class ExecTool {
|
|
|
493
497
|
if (process.native ||
|
|
494
498
|
process.status === 'running' ||
|
|
495
499
|
!process.finalized ||
|
|
500
|
+
!process.terminalResultReturned ||
|
|
496
501
|
this.#processes.get(id) !== process)
|
|
497
502
|
return;
|
|
498
503
|
this.#processes.delete(id);
|
|
@@ -562,6 +567,9 @@ export class ExecTool {
|
|
|
562
567
|
return managed.terminate;
|
|
563
568
|
}
|
|
564
569
|
#result(id, process) {
|
|
570
|
+
// Uncollected terminal output is a live resource, not an expiring replay.
|
|
571
|
+
if (process.status !== 'running')
|
|
572
|
+
process.terminalResultReturned = true;
|
|
565
573
|
const stdout = consumeOutput(process.stdout);
|
|
566
574
|
const stderr = consumeOutput(process.stderr);
|
|
567
575
|
return {
|