@nuvin/nuvin-core 1.5.1 → 1.5.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.
package/dist/VERSION CHANGED
@@ -1,4 +1,4 @@
1
1
  {
2
- "version": "1.5.1",
3
- "commit": "c15f31a"
2
+ "version": "1.5.2",
3
+ "commit": "f0799f5"
4
4
  }
package/dist/index.js CHANGED
@@ -3048,7 +3048,7 @@ var AssignTool = class {
3048
3048
  properties: {
3049
3049
  description: {
3050
3050
  type: "string",
3051
- description: 'Explanation of why this task is being delegated (e.g., "Delegate code review to specialist agent")'
3051
+ description: "A summary of the task to be performed by the delegated agent. Be specific about the desired outcome. From 5-10 words."
3052
3052
  },
3053
3053
  agent: {
3054
3054
  type: "string",
@@ -3056,10 +3056,10 @@ var AssignTool = class {
3056
3056
  },
3057
3057
  task: {
3058
3058
  type: "string",
3059
- description: "Task description (3-4 sentences explaining what to do)"
3059
+ description: "Detailed description of the task to be performed by the agent."
3060
3060
  }
3061
3061
  },
3062
- required: ["agent", "task"]
3062
+ required: ["agent", "task", "description"]
3063
3063
  };
3064
3064
  /**
3065
3065
  * Update the enabled agents configuration
@@ -3196,7 +3196,7 @@ var LLMResolver = class {
3196
3196
  };
3197
3197
 
3198
3198
  // src/agent-manager.ts
3199
- var DEFAULT_TIMEOUT_MS = 3e5;
3199
+ var DEFAULT_TIMEOUT_MS = 3e6;
3200
3200
  var MAX_DELEGATION_DEPTH = 3;
3201
3201
  var AgentManager = class {
3202
3202
  constructor(delegatingConfig, delegatingTools, llmFactory, eventCallback, configResolver) {
@@ -3394,25 +3394,34 @@ var AgentManager = class {
3394
3394
  * Execute agent task with timeout
3395
3395
  */
3396
3396
  async executeWithTimeout(orchestrator, taskDescription, timeoutMs, signal) {
3397
- return new Promise((resolve6, reject) => {
3398
- const timer = setTimeout(() => {
3399
- reject(new Error(`Task execution timeout after ${timeoutMs}ms`));
3400
- }, timeoutMs);
3401
- const abortHandler = () => {
3402
- clearTimeout(timer);
3403
- reject(new Error("Sub-agent execution aborted by user"));
3404
- };
3405
- signal?.addEventListener("abort", abortHandler);
3406
- orchestrator.send(taskDescription, { conversationId: "default", signal }).then((response) => {
3407
- clearTimeout(timer);
3408
- signal?.removeEventListener("abort", abortHandler);
3409
- resolve6(response);
3410
- }).catch((error) => {
3411
- clearTimeout(timer);
3412
- signal?.removeEventListener("abort", abortHandler);
3413
- reject(error);
3414
- });
3415
- });
3397
+ const timeoutController = new AbortController();
3398
+ const combinedSignal = signal ? AbortSignal.any([signal, timeoutController.signal]) : timeoutController.signal;
3399
+ let timer;
3400
+ try {
3401
+ return await Promise.race([
3402
+ orchestrator.send(taskDescription, {
3403
+ conversationId: "default",
3404
+ signal: combinedSignal
3405
+ }),
3406
+ new Promise((_, reject) => {
3407
+ if (signal?.aborted) {
3408
+ reject(new Error("Sub-agent execution aborted by user"));
3409
+ return;
3410
+ }
3411
+ signal?.addEventListener("abort", () => reject(new Error("Sub-agent execution aborted by user")), {
3412
+ once: true
3413
+ });
3414
+ }),
3415
+ new Promise((_, reject) => {
3416
+ timer = setTimeout(() => {
3417
+ timeoutController.abort();
3418
+ reject(new Error(`Task execution timeout after ${timeoutMs}ms`));
3419
+ }, timeoutMs);
3420
+ })
3421
+ ]);
3422
+ } finally {
3423
+ if (timer) clearTimeout(timer);
3424
+ }
3416
3425
  }
3417
3426
  /**
3418
3427
  * Get active specialist agent count
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuvin/nuvin-core",
3
- "version": "1.5.1",
3
+ "version": "1.5.2",
4
4
  "description": "",
5
5
  "private": false,
6
6
  "main": "dist/index.js",