@myagentroam/agent 0.11.48 → 0.11.49
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.
|
@@ -9,7 +9,9 @@ import { childResources } from './resources.js';
|
|
|
9
9
|
import { sharedSessionHistory } from './history.js';
|
|
10
10
|
const delegationPrompt = [
|
|
11
11
|
'# Delegation and coordination',
|
|
12
|
-
'
|
|
12
|
+
'Handle focused or tightly coupled work locally by default.',
|
|
13
|
+
'Delegate a clearly separable subtask when parallel progress or context savings materially outweigh coordination overhead.',
|
|
14
|
+
'Do not split work merely because agents are available.',
|
|
13
15
|
'Give each child an objective, necessary context, expected output, and a read-only boundary or non-overlapping write scope.',
|
|
14
16
|
'Follow up through the direct delegate by default; inspect deeper Sessions only when a concrete issue needs independent verification.',
|
|
15
17
|
'While children run, continue meaningful non-overlapping work. Do not redo delegated work. Wait only when the next step needs the result.',
|
|
@@ -129,17 +129,18 @@ function options(value, wait) {
|
|
|
129
129
|
if (!value || typeof value !== 'object' || Array.isArray(value))
|
|
130
130
|
throw new AgentError('MAR_AGENT_TOOL_INPUT_INVALID', 'Code Exec options must be an object.');
|
|
131
131
|
const input = value;
|
|
132
|
+
const action = wait && input.action === null ? undefined : input.action;
|
|
132
133
|
const yieldMs = input.yieldMs ?? (wait ? limits.codeDefaultWaitYieldMs : limits.codeDefaultYieldMs);
|
|
133
134
|
if (!Number.isSafeInteger(yieldMs) ||
|
|
134
135
|
Number(yieldMs) < 0 ||
|
|
135
136
|
Number(yieldMs) > (wait ? limits.codeMaxWaitYieldMs : limits.codeMaxYieldMs) ||
|
|
136
137
|
(wait && (typeof input.cellId !== 'string' || !input.cellId)) ||
|
|
137
|
-
(
|
|
138
|
+
(action !== undefined && action !== 'poll' && action !== 'cancel'))
|
|
138
139
|
throw new AgentError('MAR_AGENT_TOOL_INPUT_INVALID', 'Code Exec options are out of range.');
|
|
139
140
|
return {
|
|
140
141
|
cellId: input.cellId,
|
|
141
142
|
yieldMs: Number(yieldMs),
|
|
142
|
-
action:
|
|
143
|
+
action: action ?? 'poll'
|
|
143
144
|
};
|
|
144
145
|
}
|
|
145
146
|
/** Session-owned execution, separate from the cancellable model-tool wait. */
|