@dexto/agent-management 1.5.2 → 1.5.4

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.
Files changed (87) hide show
  1. package/dist/config/config-enrichment.d.ts +4 -3
  2. package/dist/config/config-enrichment.d.ts.map +1 -1
  3. package/dist/config/discover-prompts.cjs +24 -19
  4. package/dist/config/discover-prompts.d.ts +13 -5
  5. package/dist/config/discover-prompts.d.ts.map +1 -1
  6. package/dist/config/discover-prompts.js +24 -19
  7. package/dist/index.cjs +6 -1
  8. package/dist/index.d.ts +2 -0
  9. package/dist/index.d.ts.map +1 -1
  10. package/dist/index.js +2 -0
  11. package/dist/preferences/index.cjs +2 -0
  12. package/dist/preferences/index.d.ts +2 -2
  13. package/dist/preferences/index.d.ts.map +1 -1
  14. package/dist/preferences/index.js +3 -1
  15. package/dist/preferences/loader.cjs +39 -41
  16. package/dist/preferences/loader.d.ts +7 -5
  17. package/dist/preferences/loader.d.ts.map +1 -1
  18. package/dist/preferences/loader.js +39 -41
  19. package/dist/preferences/schemas.cjs +14 -2
  20. package/dist/preferences/schemas.d.ts +37 -0
  21. package/dist/preferences/schemas.d.ts.map +1 -1
  22. package/dist/preferences/schemas.js +12 -1
  23. package/dist/runtime/AgentPool.cjs +181 -0
  24. package/dist/runtime/AgentPool.d.ts +76 -0
  25. package/dist/runtime/AgentPool.d.ts.map +1 -0
  26. package/dist/runtime/AgentPool.js +160 -0
  27. package/dist/runtime/AgentRuntime.cjs +225 -0
  28. package/dist/runtime/AgentRuntime.d.ts +77 -0
  29. package/dist/runtime/AgentRuntime.d.ts.map +1 -0
  30. package/dist/runtime/AgentRuntime.js +201 -0
  31. package/dist/runtime/approval-delegation.cjs +97 -0
  32. package/dist/runtime/approval-delegation.d.ts +30 -0
  33. package/dist/runtime/approval-delegation.d.ts.map +1 -0
  34. package/dist/runtime/approval-delegation.js +73 -0
  35. package/dist/runtime/error-codes.cjs +40 -0
  36. package/dist/runtime/error-codes.d.ts +17 -0
  37. package/dist/runtime/error-codes.d.ts.map +1 -0
  38. package/dist/runtime/error-codes.js +16 -0
  39. package/dist/runtime/errors.cjs +135 -0
  40. package/dist/runtime/errors.d.ts +40 -0
  41. package/dist/runtime/errors.d.ts.map +1 -0
  42. package/dist/runtime/errors.js +111 -0
  43. package/dist/runtime/index.cjs +53 -0
  44. package/dist/runtime/index.d.ts +19 -0
  45. package/dist/runtime/index.d.ts.map +1 -0
  46. package/dist/runtime/index.js +26 -0
  47. package/dist/runtime/schemas.cjs +64 -0
  48. package/dist/runtime/schemas.d.ts +69 -0
  49. package/dist/runtime/schemas.d.ts.map +1 -0
  50. package/dist/runtime/schemas.js +35 -0
  51. package/dist/runtime/types.cjs +16 -0
  52. package/dist/runtime/types.d.ts +94 -0
  53. package/dist/runtime/types.d.ts.map +1 -0
  54. package/dist/runtime/types.js +0 -0
  55. package/dist/tool-provider/error-codes.cjs +35 -0
  56. package/dist/tool-provider/error-codes.d.ts +11 -0
  57. package/dist/tool-provider/error-codes.d.ts.map +1 -0
  58. package/dist/tool-provider/error-codes.js +11 -0
  59. package/dist/tool-provider/errors.cjs +81 -0
  60. package/dist/tool-provider/errors.d.ts +19 -0
  61. package/dist/tool-provider/errors.d.ts.map +1 -0
  62. package/dist/tool-provider/errors.js +57 -0
  63. package/dist/tool-provider/index.cjs +46 -0
  64. package/dist/tool-provider/index.d.ts +16 -0
  65. package/dist/tool-provider/index.d.ts.map +1 -0
  66. package/dist/tool-provider/index.js +16 -0
  67. package/dist/tool-provider/runtime-service.cjs +390 -0
  68. package/dist/tool-provider/runtime-service.d.ts +83 -0
  69. package/dist/tool-provider/runtime-service.d.ts.map +1 -0
  70. package/dist/tool-provider/runtime-service.js +366 -0
  71. package/dist/tool-provider/schemas.cjs +73 -0
  72. package/dist/tool-provider/schemas.d.ts +83 -0
  73. package/dist/tool-provider/schemas.d.ts.map +1 -0
  74. package/dist/tool-provider/schemas.js +48 -0
  75. package/dist/tool-provider/spawn-agent-tool.cjs +89 -0
  76. package/dist/tool-provider/spawn-agent-tool.d.ts +10 -0
  77. package/dist/tool-provider/spawn-agent-tool.d.ts.map +1 -0
  78. package/dist/tool-provider/spawn-agent-tool.js +65 -0
  79. package/dist/tool-provider/tool-provider.cjs +44 -0
  80. package/dist/tool-provider/tool-provider.d.ts +24 -0
  81. package/dist/tool-provider/tool-provider.d.ts.map +1 -0
  82. package/dist/tool-provider/tool-provider.js +20 -0
  83. package/dist/tool-provider/types.cjs +16 -0
  84. package/dist/tool-provider/types.d.ts +17 -0
  85. package/dist/tool-provider/types.d.ts.map +1 -0
  86. package/dist/tool-provider/types.js +0 -0
  87. package/package.json +2 -2
@@ -0,0 +1,69 @@
1
+ /**
2
+ * Agent Runtime Schemas
3
+ *
4
+ * Zod schemas for validating runtime configuration and inputs.
5
+ */
6
+ import { z } from 'zod';
7
+ export declare const DEFAULT_MAX_AGENTS = 20;
8
+ export declare const DEFAULT_TASK_TIMEOUT = 300000;
9
+ /**
10
+ * Schema for AgentRuntime configuration
11
+ */
12
+ export declare const AgentRuntimeConfigSchema: z.ZodObject<{
13
+ maxAgents: z.ZodDefault<z.ZodNumber>;
14
+ defaultTaskTimeout: z.ZodDefault<z.ZodNumber>;
15
+ }, "strict", z.ZodTypeAny, {
16
+ maxAgents: number;
17
+ defaultTaskTimeout: number;
18
+ }, {
19
+ maxAgents?: number | undefined;
20
+ defaultTaskTimeout?: number | undefined;
21
+ }>;
22
+ export type ValidatedAgentRuntimeConfig = z.output<typeof AgentRuntimeConfigSchema>;
23
+ /**
24
+ * Schema for SpawnConfig
25
+ * Note: agentConfig is not validated here as it uses the core AgentConfigSchema
26
+ */
27
+ export declare const SpawnConfigSchema: z.ZodObject<{
28
+ agentConfig: z.ZodRecord<z.ZodString, z.ZodUnknown>;
29
+ ephemeral: z.ZodDefault<z.ZodBoolean>;
30
+ agentId: z.ZodOptional<z.ZodString>;
31
+ group: z.ZodOptional<z.ZodString>;
32
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
33
+ }, "strict", z.ZodTypeAny, {
34
+ agentConfig: Record<string, unknown>;
35
+ ephemeral: boolean;
36
+ agentId?: string | undefined;
37
+ group?: string | undefined;
38
+ metadata?: Record<string, unknown> | undefined;
39
+ }, {
40
+ agentConfig: Record<string, unknown>;
41
+ agentId?: string | undefined;
42
+ ephemeral?: boolean | undefined;
43
+ group?: string | undefined;
44
+ metadata?: Record<string, unknown> | undefined;
45
+ }>;
46
+ export type ValidatedSpawnConfig = z.output<typeof SpawnConfigSchema>;
47
+ /**
48
+ * Schema for AgentStatus
49
+ */
50
+ export declare const AgentStatusSchema: z.ZodEnum<["starting", "idle", "running", "stopping", "stopped", "error"]>;
51
+ export type ValidatedAgentStatus = z.output<typeof AgentStatusSchema>;
52
+ /**
53
+ * Schema for AgentFilter
54
+ */
55
+ export declare const AgentFilterSchema: z.ZodObject<{
56
+ group: z.ZodOptional<z.ZodString>;
57
+ status: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["starting", "idle", "running", "stopping", "stopped", "error"]>, z.ZodArray<z.ZodEnum<["starting", "idle", "running", "stopping", "stopped", "error"]>, "many">]>>;
58
+ ephemeral: z.ZodOptional<z.ZodBoolean>;
59
+ }, "strict", z.ZodTypeAny, {
60
+ status?: "error" | "starting" | "idle" | "running" | "stopping" | "stopped" | ("error" | "starting" | "idle" | "running" | "stopping" | "stopped")[] | undefined;
61
+ ephemeral?: boolean | undefined;
62
+ group?: string | undefined;
63
+ }, {
64
+ status?: "error" | "starting" | "idle" | "running" | "stopping" | "stopped" | ("error" | "starting" | "idle" | "running" | "stopping" | "stopped")[] | undefined;
65
+ ephemeral?: boolean | undefined;
66
+ group?: string | undefined;
67
+ }>;
68
+ export type ValidatedAgentFilter = z.output<typeof AgentFilterSchema>;
69
+ //# sourceMappingURL=schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/runtime/schemas.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,kBAAkB,KAAK,CAAC;AACrC,eAAO,MAAM,oBAAoB,SAAS,CAAC;AAM3C;;GAEG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;EAiBc,CAAC;AAEpD,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAMpF;;;GAGG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;EA2BsB,CAAC;AAErD,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAMtE;;GAEG;AACH,eAAO,MAAM,iBAAiB,4EAO5B,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAMtE;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;EAYoB,CAAC;AAEnD,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
@@ -0,0 +1,35 @@
1
+ import { z } from "zod";
2
+ const DEFAULT_MAX_AGENTS = 20;
3
+ const DEFAULT_TASK_TIMEOUT = 3e5;
4
+ const AgentRuntimeConfigSchema = z.object({
5
+ maxAgents: z.number().int().positive().default(DEFAULT_MAX_AGENTS).describe("Maximum total agents managed by this runtime"),
6
+ defaultTaskTimeout: z.number().int().positive().default(DEFAULT_TASK_TIMEOUT).describe("Default task timeout in milliseconds")
7
+ }).strict().describe("Configuration for the AgentRuntime");
8
+ const SpawnConfigSchema = z.object({
9
+ agentConfig: z.record(z.unknown()).describe("Base agent configuration"),
10
+ ephemeral: z.boolean().default(true).describe("Whether agent should be destroyed after task completion"),
11
+ agentId: z.string().min(1).optional().describe("Optional custom agent ID (auto-generated if not provided)"),
12
+ group: z.string().min(1).optional().describe("Optional group identifier for logical grouping"),
13
+ metadata: z.record(z.unknown()).optional().describe("Optional metadata for tracking relationships or context")
14
+ }).strict().describe("Configuration for spawning an agent");
15
+ const AgentStatusSchema = z.enum([
16
+ "starting",
17
+ "idle",
18
+ "running",
19
+ "stopping",
20
+ "stopped",
21
+ "error"
22
+ ]);
23
+ const AgentFilterSchema = z.object({
24
+ group: z.string().optional().describe("Filter by group"),
25
+ status: z.union([AgentStatusSchema, z.array(AgentStatusSchema)]).optional().describe("Filter by status"),
26
+ ephemeral: z.boolean().optional().describe("Filter by ephemeral flag")
27
+ }).strict().describe("Filter options for listing agents");
28
+ export {
29
+ AgentFilterSchema,
30
+ AgentRuntimeConfigSchema,
31
+ AgentStatusSchema,
32
+ DEFAULT_MAX_AGENTS,
33
+ DEFAULT_TASK_TIMEOUT,
34
+ SpawnConfigSchema
35
+ };
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+ var types_exports = {};
16
+ module.exports = __toCommonJS(types_exports);
@@ -0,0 +1,94 @@
1
+ /**
2
+ * Agent Runtime Types
3
+ *
4
+ * Type definitions for the general-purpose agent runtime system that manages
5
+ * the lifecycle of multiple agent instances.
6
+ */
7
+ import type { DextoAgent, AgentConfig } from '@dexto/core';
8
+ /**
9
+ * Configuration for spawning an agent
10
+ */
11
+ export interface SpawnConfig {
12
+ /** Base agent config (LLM, system prompt, tools, etc.) */
13
+ agentConfig: AgentConfig;
14
+ /** Whether agent should be destroyed after task completion (default: true) */
15
+ ephemeral?: boolean;
16
+ /** Optional custom agent ID (auto-generated if not provided) */
17
+ agentId?: string;
18
+ /** Optional group identifier for logical grouping (e.g., parent agent ID) */
19
+ group?: string;
20
+ /** Optional metadata for tracking relationships or context */
21
+ metadata?: Record<string, unknown>;
22
+ /**
23
+ * Optional callback invoked after agent is created but before it starts.
24
+ * Use this to configure approval handlers or other pre-start setup.
25
+ */
26
+ onBeforeStart?: (agent: DextoAgent) => void | Promise<void>;
27
+ }
28
+ /**
29
+ * Status of a managed agent
30
+ */
31
+ export type AgentStatus = 'starting' | 'idle' | 'running' | 'stopping' | 'stopped' | 'error';
32
+ /**
33
+ * Handle to an agent managed by the runtime
34
+ */
35
+ export interface AgentHandle {
36
+ /** Unique identifier for this agent */
37
+ agentId: string;
38
+ /** The DextoAgent instance */
39
+ agent: DextoAgent;
40
+ /** Current status of the agent */
41
+ status: AgentStatus;
42
+ /** Whether this agent should be destroyed after task completion */
43
+ ephemeral: boolean;
44
+ /** When this agent was created */
45
+ createdAt: Date;
46
+ /** Session ID for the agent's conversation */
47
+ sessionId: string;
48
+ /** Optional group identifier (e.g., parent agent ID for sub-agents) */
49
+ group?: string;
50
+ /** Optional metadata */
51
+ metadata?: Record<string, unknown>;
52
+ /** Optional error message if status is 'error' */
53
+ error?: string;
54
+ }
55
+ /**
56
+ * Result from executing a task on an agent
57
+ */
58
+ export interface TaskResult {
59
+ /** Whether the task completed successfully */
60
+ success: boolean;
61
+ /** Final response from the agent */
62
+ response?: string;
63
+ /** Error message if the task failed */
64
+ error?: string;
65
+ /** ID of the agent that executed the task */
66
+ agentId: string;
67
+ /** Token usage for the task */
68
+ tokenUsage?: {
69
+ input: number;
70
+ output: number;
71
+ total: number;
72
+ };
73
+ }
74
+ /**
75
+ * Configuration for the AgentRuntime
76
+ */
77
+ export interface AgentRuntimeConfig {
78
+ /** Maximum total agents managed by this runtime (default: 20) */
79
+ maxAgents?: number;
80
+ /** Default task timeout in milliseconds (default: 300000 = 5 min) */
81
+ defaultTaskTimeout?: number;
82
+ }
83
+ /**
84
+ * Filter options for listing agents
85
+ */
86
+ export interface AgentFilter {
87
+ /** Filter by group */
88
+ group?: string;
89
+ /** Filter by status */
90
+ status?: AgentStatus | AgentStatus[];
91
+ /** Filter by ephemeral flag */
92
+ ephemeral?: boolean;
93
+ }
94
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/runtime/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,WAAW;IACxB,0DAA0D;IAC1D,WAAW,EAAE,WAAW,CAAC;IAEzB,8EAA8E;IAC9E,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,gEAAgE;IAChE,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,6EAA6E;IAC7E,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEnC;;;OAGG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/D;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,MAAM,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,GAAG,OAAO,CAAC;AAE7F;;GAEG;AACH,MAAM,WAAW,WAAW;IACxB,uCAAuC;IACvC,OAAO,EAAE,MAAM,CAAC;IAEhB,8BAA8B;IAC9B,KAAK,EAAE,UAAU,CAAC;IAElB,kCAAkC;IAClC,MAAM,EAAE,WAAW,CAAC;IAEpB,mEAAmE;IACnE,SAAS,EAAE,OAAO,CAAC;IAEnB,kCAAkC;IAClC,SAAS,EAAE,IAAI,CAAC;IAEhB,8CAA8C;IAC9C,SAAS,EAAE,MAAM,CAAC;IAElB,uEAAuE;IACvE,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,wBAAwB;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEnC,kDAAkD;IAClD,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACvB,8CAA8C;IAC9C,OAAO,EAAE,OAAO,CAAC;IAEjB,oCAAoC;IACpC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,uCAAuC;IACvC,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAC;IAEhB,+BAA+B;IAC/B,UAAU,CAAC,EAAE;QACT,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,EAAE,MAAM,CAAC;KACjB,CAAC;CACL;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAC/B,iEAAiE;IACjE,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,qEAAqE;IACrE,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IACxB,sBAAsB;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,uBAAuB;IACvB,MAAM,CAAC,EAAE,WAAW,GAAG,WAAW,EAAE,CAAC;IAErC,+BAA+B;IAC/B,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB"}
File without changes
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var error_codes_exports = {};
20
+ __export(error_codes_exports, {
21
+ AgentSpawnerErrorCode: () => AgentSpawnerErrorCode
22
+ });
23
+ module.exports = __toCommonJS(error_codes_exports);
24
+ var AgentSpawnerErrorCode = /* @__PURE__ */ ((AgentSpawnerErrorCode2) => {
25
+ AgentSpawnerErrorCode2["SPAWNING_DISABLED"] = "agent_spawner_spawning_disabled";
26
+ AgentSpawnerErrorCode2["SPAWN_FAILED"] = "agent_spawner_spawn_failed";
27
+ AgentSpawnerErrorCode2["AGENT_NOT_FOUND"] = "agent_spawner_agent_not_found";
28
+ AgentSpawnerErrorCode2["TASK_FAILED"] = "agent_spawner_task_failed";
29
+ AgentSpawnerErrorCode2["INVALID_CONFIG"] = "agent_spawner_invalid_config";
30
+ return AgentSpawnerErrorCode2;
31
+ })(AgentSpawnerErrorCode || {});
32
+ // Annotate the CommonJS export names for ESM import in node:
33
+ 0 && (module.exports = {
34
+ AgentSpawnerErrorCode
35
+ });
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Agent Spawner Tool Error Codes
3
+ */
4
+ export declare enum AgentSpawnerErrorCode {
5
+ SPAWNING_DISABLED = "agent_spawner_spawning_disabled",
6
+ SPAWN_FAILED = "agent_spawner_spawn_failed",
7
+ AGENT_NOT_FOUND = "agent_spawner_agent_not_found",
8
+ TASK_FAILED = "agent_spawner_task_failed",
9
+ INVALID_CONFIG = "agent_spawner_invalid_config"
10
+ }
11
+ //# sourceMappingURL=error-codes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-codes.d.ts","sourceRoot":"","sources":["../../src/tool-provider/error-codes.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,qBAAqB;IAE7B,iBAAiB,oCAAoC;IACrD,YAAY,+BAA+B;IAG3C,eAAe,kCAAkC;IAGjD,WAAW,8BAA8B;IAGzC,cAAc,iCAAiC;CAClD"}
@@ -0,0 +1,11 @@
1
+ var AgentSpawnerErrorCode = /* @__PURE__ */ ((AgentSpawnerErrorCode2) => {
2
+ AgentSpawnerErrorCode2["SPAWNING_DISABLED"] = "agent_spawner_spawning_disabled";
3
+ AgentSpawnerErrorCode2["SPAWN_FAILED"] = "agent_spawner_spawn_failed";
4
+ AgentSpawnerErrorCode2["AGENT_NOT_FOUND"] = "agent_spawner_agent_not_found";
5
+ AgentSpawnerErrorCode2["TASK_FAILED"] = "agent_spawner_task_failed";
6
+ AgentSpawnerErrorCode2["INVALID_CONFIG"] = "agent_spawner_invalid_config";
7
+ return AgentSpawnerErrorCode2;
8
+ })(AgentSpawnerErrorCode || {});
9
+ export {
10
+ AgentSpawnerErrorCode
11
+ };
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var errors_exports = {};
20
+ __export(errors_exports, {
21
+ AgentSpawnerError: () => AgentSpawnerError
22
+ });
23
+ module.exports = __toCommonJS(errors_exports);
24
+ var import_core = require("@dexto/core");
25
+ var import_error_codes = require("./error-codes.js");
26
+ class AgentSpawnerError {
27
+ static spawningDisabled() {
28
+ return new import_core.DextoRuntimeError(
29
+ import_error_codes.AgentSpawnerErrorCode.SPAWNING_DISABLED,
30
+ import_core.ErrorScope.TOOLS,
31
+ import_core.ErrorType.USER,
32
+ "Agent spawning is disabled in configuration",
33
+ {},
34
+ "Enable spawning in the agent-spawner tool configuration"
35
+ );
36
+ }
37
+ static spawnFailed(cause) {
38
+ return new import_core.DextoRuntimeError(
39
+ import_error_codes.AgentSpawnerErrorCode.SPAWN_FAILED,
40
+ import_core.ErrorScope.TOOLS,
41
+ import_core.ErrorType.SYSTEM,
42
+ `Failed to spawn sub-agent: ${cause}`,
43
+ { cause },
44
+ "Check the configuration and try again"
45
+ );
46
+ }
47
+ static agentNotFound(agentId) {
48
+ return new import_core.DextoRuntimeError(
49
+ import_error_codes.AgentSpawnerErrorCode.AGENT_NOT_FOUND,
50
+ import_core.ErrorScope.TOOLS,
51
+ import_core.ErrorType.NOT_FOUND,
52
+ `Sub-agent '${agentId}' not found`,
53
+ { agentId },
54
+ "Ensure the agent ID is correct and the agent is still active"
55
+ );
56
+ }
57
+ static taskFailed(agentId, cause) {
58
+ return new import_core.DextoRuntimeError(
59
+ import_error_codes.AgentSpawnerErrorCode.TASK_FAILED,
60
+ import_core.ErrorScope.TOOLS,
61
+ import_core.ErrorType.SYSTEM,
62
+ `Task execution failed for agent '${agentId}': ${cause}`,
63
+ { agentId, cause },
64
+ "Check the task requirements and try again"
65
+ );
66
+ }
67
+ static invalidConfig(message) {
68
+ return new import_core.DextoRuntimeError(
69
+ import_error_codes.AgentSpawnerErrorCode.INVALID_CONFIG,
70
+ import_core.ErrorScope.TOOLS,
71
+ import_core.ErrorType.USER,
72
+ `Invalid agent spawner configuration: ${message}`,
73
+ {},
74
+ "Check the configuration and ensure all required fields are provided"
75
+ );
76
+ }
77
+ }
78
+ // Annotate the CommonJS export names for ESM import in node:
79
+ 0 && (module.exports = {
80
+ AgentSpawnerError
81
+ });
@@ -0,0 +1,19 @@
1
+ import { DextoRuntimeError } from '@dexto/core';
2
+ /**
3
+ * Agent Spawner error factory methods
4
+ */
5
+ export declare class AgentSpawnerError {
6
+ static spawningDisabled(): DextoRuntimeError<{}>;
7
+ static spawnFailed(cause: string): DextoRuntimeError<{
8
+ cause: string;
9
+ }>;
10
+ static agentNotFound(agentId: string): DextoRuntimeError<{
11
+ agentId: string;
12
+ }>;
13
+ static taskFailed(agentId: string, cause: string): DextoRuntimeError<{
14
+ agentId: string;
15
+ cause: string;
16
+ }>;
17
+ static invalidConfig(message: string): DextoRuntimeError<{}>;
18
+ }
19
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/tool-provider/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAyB,MAAM,aAAa,CAAC;AAGvE;;GAEG;AACH,qBAAa,iBAAiB;IAC1B,MAAM,CAAC,gBAAgB;IAWvB,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,MAAM;;;IAWhC,MAAM,CAAC,aAAa,CAAC,OAAO,EAAE,MAAM;;;IAWpC,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;;;;IAWhD,MAAM,CAAC,aAAa,CAAC,OAAO,EAAE,MAAM;CAUvC"}
@@ -0,0 +1,57 @@
1
+ import { DextoRuntimeError, ErrorScope, ErrorType } from "@dexto/core";
2
+ import { AgentSpawnerErrorCode } from "./error-codes.js";
3
+ class AgentSpawnerError {
4
+ static spawningDisabled() {
5
+ return new DextoRuntimeError(
6
+ AgentSpawnerErrorCode.SPAWNING_DISABLED,
7
+ ErrorScope.TOOLS,
8
+ ErrorType.USER,
9
+ "Agent spawning is disabled in configuration",
10
+ {},
11
+ "Enable spawning in the agent-spawner tool configuration"
12
+ );
13
+ }
14
+ static spawnFailed(cause) {
15
+ return new DextoRuntimeError(
16
+ AgentSpawnerErrorCode.SPAWN_FAILED,
17
+ ErrorScope.TOOLS,
18
+ ErrorType.SYSTEM,
19
+ `Failed to spawn sub-agent: ${cause}`,
20
+ { cause },
21
+ "Check the configuration and try again"
22
+ );
23
+ }
24
+ static agentNotFound(agentId) {
25
+ return new DextoRuntimeError(
26
+ AgentSpawnerErrorCode.AGENT_NOT_FOUND,
27
+ ErrorScope.TOOLS,
28
+ ErrorType.NOT_FOUND,
29
+ `Sub-agent '${agentId}' not found`,
30
+ { agentId },
31
+ "Ensure the agent ID is correct and the agent is still active"
32
+ );
33
+ }
34
+ static taskFailed(agentId, cause) {
35
+ return new DextoRuntimeError(
36
+ AgentSpawnerErrorCode.TASK_FAILED,
37
+ ErrorScope.TOOLS,
38
+ ErrorType.SYSTEM,
39
+ `Task execution failed for agent '${agentId}': ${cause}`,
40
+ { agentId, cause },
41
+ "Check the task requirements and try again"
42
+ );
43
+ }
44
+ static invalidConfig(message) {
45
+ return new DextoRuntimeError(
46
+ AgentSpawnerErrorCode.INVALID_CONFIG,
47
+ ErrorScope.TOOLS,
48
+ ErrorType.USER,
49
+ `Invalid agent spawner configuration: ${message}`,
50
+ {},
51
+ "Check the configuration and ensure all required fields are provided"
52
+ );
53
+ }
54
+ }
55
+ export {
56
+ AgentSpawnerError
57
+ };
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var tool_provider_exports = {};
20
+ __export(tool_provider_exports, {
21
+ AgentSpawnerConfigSchema: () => import_schemas.AgentSpawnerConfigSchema,
22
+ AgentSpawnerError: () => import_errors.AgentSpawnerError,
23
+ AgentSpawnerErrorCode: () => import_error_codes.AgentSpawnerErrorCode,
24
+ RuntimeService: () => import_runtime_service.RuntimeService,
25
+ SpawnAgentInputSchema: () => import_schemas2.SpawnAgentInputSchema,
26
+ agentSpawnerToolsProvider: () => import_tool_provider.agentSpawnerToolsProvider,
27
+ createSpawnAgentTool: () => import_spawn_agent_tool.createSpawnAgentTool
28
+ });
29
+ module.exports = __toCommonJS(tool_provider_exports);
30
+ var import_tool_provider = require("./tool-provider.js");
31
+ var import_schemas = require("./schemas.js");
32
+ var import_runtime_service = require("./runtime-service.js");
33
+ var import_spawn_agent_tool = require("./spawn-agent-tool.js");
34
+ var import_schemas2 = require("./schemas.js");
35
+ var import_errors = require("./errors.js");
36
+ var import_error_codes = require("./error-codes.js");
37
+ // Annotate the CommonJS export names for ESM import in node:
38
+ 0 && (module.exports = {
39
+ AgentSpawnerConfigSchema,
40
+ AgentSpawnerError,
41
+ AgentSpawnerErrorCode,
42
+ RuntimeService,
43
+ SpawnAgentInputSchema,
44
+ agentSpawnerToolsProvider,
45
+ createSpawnAgentTool
46
+ });
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Agent Spawner Tool Provider
3
+ *
4
+ * Enables agents to spawn sub-agents for task delegation.
5
+ */
6
+ export { agentSpawnerToolsProvider } from './tool-provider.js';
7
+ export { AgentSpawnerConfigSchema } from './schemas.js';
8
+ export type { AgentSpawnerConfig } from './schemas.js';
9
+ export { RuntimeService } from './runtime-service.js';
10
+ export { createSpawnAgentTool } from './spawn-agent-tool.js';
11
+ export { SpawnAgentInputSchema } from './schemas.js';
12
+ export type { SpawnAgentInput } from './schemas.js';
13
+ export type { SpawnAgentOutput } from './types.js';
14
+ export { AgentSpawnerError } from './errors.js';
15
+ export { AgentSpawnerErrorCode } from './error-codes.js';
16
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tool-provider/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAG/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AACxD,YAAY,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAGvD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAGtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAG7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACrD,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAGpD,YAAY,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAGnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { agentSpawnerToolsProvider } from "./tool-provider.js";
2
+ import { AgentSpawnerConfigSchema } from "./schemas.js";
3
+ import { RuntimeService } from "./runtime-service.js";
4
+ import { createSpawnAgentTool } from "./spawn-agent-tool.js";
5
+ import { SpawnAgentInputSchema } from "./schemas.js";
6
+ import { AgentSpawnerError } from "./errors.js";
7
+ import { AgentSpawnerErrorCode } from "./error-codes.js";
8
+ export {
9
+ AgentSpawnerConfigSchema,
10
+ AgentSpawnerError,
11
+ AgentSpawnerErrorCode,
12
+ RuntimeService,
13
+ SpawnAgentInputSchema,
14
+ agentSpawnerToolsProvider,
15
+ createSpawnAgentTool
16
+ };