@yeaft/webchat-agent 0.1.927 → 0.1.929

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yeaft/webchat-agent",
3
- "version": "0.1.927",
3
+ "version": "0.1.929",
4
4
  "description": "Remote agent for Yeaft WebChat — connects worker machines to the central server",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -179,7 +179,8 @@ export default defineTool({
179
179
  description: `Create a sub-agent to work on an independent task in parallel.
180
180
 
181
181
  Sub-agents run in their own context and can be given a concrete mission
182
- with an expected_output schema and a budget (max_tokens/max_turns/wall_time_ms).
182
+ with an optional expected_output schema. Optional budget limits
183
+ (max_tokens/max_turns/wall_time_ms) act as safety cutoffs only when supplied.
183
184
  Pick a preset persona to pre-wire a tool subset and model tier:
184
185
  - explorer : fast, read-only scout (Read/Grep/Glob/ListDir)
185
186
  - implementer: builder with full work tools (primary model)
@@ -188,8 +189,8 @@ Pick a preset persona to pre-wire a tool subset and model tier:
188
189
 
189
190
  Guidelines:
190
191
  - Give a clear, focused mission — what "done" looks like
191
- - Use expected_output to pin the structure you want back
192
- - Always set a budget for unbounded missions
192
+ - Use expected_output when the return shape matters
193
+ - Add a budget only when you need an explicit safety cutoff
193
194
  - Use PromptAgent to communicate, WaitAgent to collect results, CloseAgent to finalize`,
194
195
  parameters: {
195
196
  type: 'object',
@@ -218,11 +219,11 @@ Guidelines:
218
219
  budget: {
219
220
  type: 'object',
220
221
  properties: {
221
- max_tokens: { type: 'number' },
222
- max_turns: { type: 'number' },
223
- wall_time_ms: { type: 'number' },
222
+ max_tokens: { type: 'number', description: 'Optional token ceiling; no default limit is applied' },
223
+ max_turns: { type: 'number', description: 'Optional turn ceiling; no default limit is applied' },
224
+ wall_time_ms: { type: 'number', description: 'Optional elapsed-time ceiling in milliseconds; no default limit is applied' },
224
225
  },
225
- description: 'Budget limits; exceeding any returns { status: "budget_exceeded", partial_output, reason }',
226
+ description: 'Optional safety limits; no max_tokens/max_turns/wall_time_ms defaults are applied. Exceeding an explicit limit returns { status: "budget_exceeded", partial_output, reason }',
226
227
  },
227
228
  cwd: {
228
229
  type: 'string',
@@ -10,7 +10,9 @@ export default defineTool({
10
10
  description: `Wait for a sub-agent to complete its task and retrieve the result.
11
11
 
12
12
  Returns the agent's final result or current status if still running.
13
- Use after sending a task to an agent via PromptAgent.`,
13
+ Use after sending a task to an agent via PromptAgent.
14
+
15
+ The default wait is 30000ms. Callers may request up to 300000ms (5 minutes).`,
14
16
  parameters: {
15
17
  type: 'object',
16
18
  properties: {
@@ -20,16 +22,22 @@ Use after sending a task to an agent via PromptAgent.`,
20
22
  },
21
23
  timeout_ms: {
22
24
  type: 'number',
23
- description: 'Maximum time to wait in milliseconds (default: 30000)',
25
+ minimum: 0,
26
+ maximum: 300000,
27
+ description: 'Maximum time to wait in milliseconds (default: 30000, max: 300000 / 5 minutes)',
24
28
  },
25
29
  },
26
30
  required: ['agent_id'],
27
31
  },
32
+ timeoutMs: 305000,
28
33
  isConcurrencySafe: () => true,
29
34
  isReadOnly: () => true,
30
35
  async execute(input, ctx) {
31
36
  const { agent_id, timeout_ms = 30000 } = input;
32
37
  if (!agent_id) return JSON.stringify({ error: 'agent_id is required' });
38
+ if (typeof timeout_ms !== 'number' || !Number.isFinite(timeout_ms) || timeout_ms < 0 || timeout_ms > 300000) {
39
+ return JSON.stringify({ error: 'timeout_ms must be a number between 0 and 300000' });
40
+ }
33
41
 
34
42
  const agents = getAgentRegistry();
35
43
  const agent = agents.get(agent_id);