aec-agent 1.0.3 → 1.0.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.
- package/dist/agent-core.d.ts +123 -3
- package/dist/agent-core.d.ts.map +1 -1
- package/dist/agent-core.js +219 -23
- package/dist/agent-core.js.map +1 -1
- package/dist/components/artifact-hub/artifact-hub.d.ts +11 -1
- package/dist/components/artifact-hub/artifact-hub.d.ts.map +1 -1
- package/dist/components/artifact-hub/artifact-hub.js +21 -1
- package/dist/components/artifact-hub/artifact-hub.js.map +1 -1
- package/dist/components/channel-platform-hub/adapter-kit.d.ts +51 -0
- package/dist/components/channel-platform-hub/adapter-kit.d.ts.map +1 -0
- package/dist/components/channel-platform-hub/adapter-kit.js +153 -0
- package/dist/components/channel-platform-hub/adapter-kit.js.map +1 -0
- package/dist/components/channel-platform-hub/channel-platform-hub.d.ts +34 -0
- package/dist/components/channel-platform-hub/channel-platform-hub.d.ts.map +1 -0
- package/dist/components/channel-platform-hub/channel-platform-hub.js +52 -0
- package/dist/components/channel-platform-hub/channel-platform-hub.js.map +1 -0
- package/dist/components/channel-platform-hub/discord/discord-adapter.d.ts +57 -0
- package/dist/components/channel-platform-hub/discord/discord-adapter.d.ts.map +1 -0
- package/dist/components/channel-platform-hub/discord/discord-adapter.js +412 -0
- package/dist/components/channel-platform-hub/discord/discord-adapter.js.map +1 -0
- package/dist/components/channel-platform-hub/slack/slack-adapter.d.ts +56 -0
- package/dist/components/channel-platform-hub/slack/slack-adapter.d.ts.map +1 -0
- package/dist/components/channel-platform-hub/slack/slack-adapter.js +349 -0
- package/dist/components/channel-platform-hub/slack/slack-adapter.js.map +1 -0
- package/dist/components/channel-platform-hub/slack/slack-mrkdwn.d.ts +3 -0
- package/dist/components/channel-platform-hub/slack/slack-mrkdwn.d.ts.map +1 -0
- package/dist/components/channel-platform-hub/slack/slack-mrkdwn.js +70 -0
- package/dist/components/channel-platform-hub/slack/slack-mrkdwn.js.map +1 -0
- package/dist/components/channel-platform-hub/teams/teams-adapter.d.ts +51 -0
- package/dist/components/channel-platform-hub/teams/teams-adapter.d.ts.map +1 -0
- package/dist/components/channel-platform-hub/teams/teams-adapter.js +333 -0
- package/dist/components/channel-platform-hub/teams/teams-adapter.js.map +1 -0
- package/dist/components/channel-platform-hub/telegram/telegram-adapter.d.ts +46 -0
- package/dist/components/channel-platform-hub/telegram/telegram-adapter.d.ts.map +1 -0
- package/dist/components/channel-platform-hub/telegram/telegram-adapter.js +304 -0
- package/dist/components/channel-platform-hub/telegram/telegram-adapter.js.map +1 -0
- package/dist/components/channel-platform-hub/telegram/telegram-markdown.d.ts +3 -0
- package/dist/components/channel-platform-hub/telegram/telegram-markdown.d.ts.map +1 -0
- package/dist/components/channel-platform-hub/telegram/telegram-markdown.js +87 -0
- package/dist/components/channel-platform-hub/telegram/telegram-markdown.js.map +1 -0
- package/dist/components/channel-platform-hub/types.d.ts +290 -0
- package/dist/components/channel-platform-hub/types.d.ts.map +1 -0
- package/dist/components/channel-platform-hub/types.js +23 -0
- package/dist/components/channel-platform-hub/types.js.map +1 -0
- package/dist/components/event-handler/event-dispatcher.d.ts +28 -3
- package/dist/components/event-handler/event-dispatcher.d.ts.map +1 -1
- package/dist/components/event-handler/event-dispatcher.js +77 -13
- package/dist/components/event-handler/event-dispatcher.js.map +1 -1
- package/dist/components/event-handler/events.d.ts +316 -15
- package/dist/components/event-handler/events.d.ts.map +1 -1
- package/dist/components/event-handler/events.js +94 -2
- package/dist/components/event-handler/events.js.map +1 -1
- package/dist/components/event-handler/types.d.ts +26 -0
- package/dist/components/event-handler/types.d.ts.map +1 -1
- package/dist/components/group-hub/group-hub.d.ts +117 -0
- package/dist/components/group-hub/group-hub.d.ts.map +1 -0
- package/dist/components/group-hub/group-hub.js +334 -0
- package/dist/components/group-hub/group-hub.js.map +1 -0
- package/dist/components/group-hub/group-turns.d.ts +109 -0
- package/dist/components/group-hub/group-turns.d.ts.map +1 -0
- package/dist/components/group-hub/group-turns.js +834 -0
- package/dist/components/group-hub/group-turns.js.map +1 -0
- package/dist/components/group-hub/member-prompt.d.ts +28 -0
- package/dist/components/group-hub/member-prompt.d.ts.map +1 -0
- package/dist/components/group-hub/member-prompt.js +111 -0
- package/dist/components/group-hub/member-prompt.js.map +1 -0
- package/dist/components/group-hub/recipients.d.ts +10 -0
- package/dist/components/group-hub/recipients.d.ts.map +1 -0
- package/dist/components/group-hub/recipients.js +83 -0
- package/dist/components/group-hub/recipients.js.map +1 -0
- package/dist/components/group-hub/thread.d.ts +57 -0
- package/dist/components/group-hub/thread.d.ts.map +1 -0
- package/dist/components/group-hub/thread.js +126 -0
- package/dist/components/group-hub/thread.js.map +1 -0
- package/dist/components/group-hub/types.d.ts +277 -0
- package/dist/components/group-hub/types.d.ts.map +1 -0
- package/dist/components/group-hub/types.js +51 -0
- package/dist/components/group-hub/types.js.map +1 -0
- package/dist/components/llm-provider-hub/providers/anthropic-provider.d.ts.map +1 -1
- package/dist/components/llm-provider-hub/providers/anthropic-provider.js +22 -2
- package/dist/components/llm-provider-hub/providers/anthropic-provider.js.map +1 -1
- package/dist/components/llm-provider-hub/providers/bedrock-provider.d.ts.map +1 -1
- package/dist/components/llm-provider-hub/providers/bedrock-provider.js +15 -3
- package/dist/components/llm-provider-hub/providers/bedrock-provider.js.map +1 -1
- package/dist/components/llm-provider-hub/providers/model-info-mappers.d.ts.map +1 -1
- package/dist/components/llm-provider-hub/providers/model-info-mappers.js +27 -0
- package/dist/components/llm-provider-hub/providers/model-info-mappers.js.map +1 -1
- package/dist/components/llm-provider-hub/providers/openai-compatible-provider.d.ts.map +1 -1
- package/dist/components/llm-provider-hub/providers/openai-compatible-provider.js +10 -3
- package/dist/components/llm-provider-hub/providers/openai-compatible-provider.js.map +1 -1
- package/dist/components/llm-provider-hub/providers/openai-subscription-provider.d.ts +1 -0
- package/dist/components/llm-provider-hub/providers/openai-subscription-provider.d.ts.map +1 -1
- package/dist/components/llm-provider-hub/providers/openai-subscription-provider.js +35 -3
- package/dist/components/llm-provider-hub/providers/openai-subscription-provider.js.map +1 -1
- package/dist/components/llm-provider-hub/types.d.ts +20 -0
- package/dist/components/llm-provider-hub/types.d.ts.map +1 -1
- package/dist/components/llm-provider-hub/types.js +5 -0
- package/dist/components/llm-provider-hub/types.js.map +1 -1
- package/dist/components/multi-agent-orchestration/agent/agent-loop/agent-loop.d.ts +87 -8
- package/dist/components/multi-agent-orchestration/agent/agent-loop/agent-loop.d.ts.map +1 -1
- package/dist/components/multi-agent-orchestration/agent/agent-loop/agent-loop.js +465 -62
- package/dist/components/multi-agent-orchestration/agent/agent-loop/agent-loop.js.map +1 -1
- package/dist/components/multi-agent-orchestration/agent/agent-loop/components/compactor.d.ts +14 -1
- package/dist/components/multi-agent-orchestration/agent/agent-loop/components/compactor.d.ts.map +1 -1
- package/dist/components/multi-agent-orchestration/agent/agent-loop/components/compactor.js +25 -1
- package/dist/components/multi-agent-orchestration/agent/agent-loop/components/compactor.js.map +1 -1
- package/dist/components/multi-agent-orchestration/agent/agent-loop/components/counter.d.ts +14 -1
- package/dist/components/multi-agent-orchestration/agent/agent-loop/components/counter.d.ts.map +1 -1
- package/dist/components/multi-agent-orchestration/agent/agent-loop/components/counter.js +14 -22
- package/dist/components/multi-agent-orchestration/agent/agent-loop/components/counter.js.map +1 -1
- package/dist/components/multi-agent-orchestration/agent/agent-loop/components/harness-executor.d.ts +41 -3
- package/dist/components/multi-agent-orchestration/agent/agent-loop/components/harness-executor.d.ts.map +1 -1
- package/dist/components/multi-agent-orchestration/agent/agent-loop/components/harness-executor.js +152 -44
- package/dist/components/multi-agent-orchestration/agent/agent-loop/components/harness-executor.js.map +1 -1
- package/dist/components/multi-agent-orchestration/agent/agent-loop/components/run-trace.d.ts +15 -0
- package/dist/components/multi-agent-orchestration/agent/agent-loop/components/run-trace.d.ts.map +1 -1
- package/dist/components/multi-agent-orchestration/agent/agent-loop/components/run-trace.js +35 -1
- package/dist/components/multi-agent-orchestration/agent/agent-loop/components/run-trace.js.map +1 -1
- package/dist/components/multi-agent-orchestration/agent/agent-loop/components/summarizer.d.ts +10 -1
- package/dist/components/multi-agent-orchestration/agent/agent-loop/components/summarizer.d.ts.map +1 -1
- package/dist/components/multi-agent-orchestration/agent/agent-loop/components/summarizer.js +39 -6
- package/dist/components/multi-agent-orchestration/agent/agent-loop/components/summarizer.js.map +1 -1
- package/dist/components/multi-agent-orchestration/agent/agent-loop/components/summarizer.types.d.ts +2 -1
- package/dist/components/multi-agent-orchestration/agent/agent-loop/components/summarizer.types.d.ts.map +1 -1
- package/dist/components/multi-agent-orchestration/agent/agent-loop/functions/context-usage.d.ts +47 -0
- package/dist/components/multi-agent-orchestration/agent/agent-loop/functions/context-usage.d.ts.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/agent-loop/functions/context-usage.js +61 -0
- package/dist/components/multi-agent-orchestration/agent/agent-loop/functions/context-usage.js.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/agent-loop/functions/memory-recall.d.ts +1 -1
- package/dist/components/multi-agent-orchestration/agent/agent-loop/functions/memory-recall.d.ts.map +1 -1
- package/dist/components/multi-agent-orchestration/agent/agent-loop/functions/memory-recall.js +1 -1
- package/dist/components/multi-agent-orchestration/agent/agent-loop/functions/memory-recall.js.map +1 -1
- package/dist/components/multi-agent-orchestration/agent/agent-loop/types.d.ts +131 -8
- package/dist/components/multi-agent-orchestration/agent/agent-loop/types.d.ts.map +1 -1
- package/dist/components/multi-agent-orchestration/agent/agent-loop/types.js +17 -1
- package/dist/components/multi-agent-orchestration/agent/agent-loop/types.js.map +1 -1
- package/dist/components/multi-agent-orchestration/agent/agent.d.ts +101 -15
- package/dist/components/multi-agent-orchestration/agent/agent.d.ts.map +1 -1
- package/dist/components/multi-agent-orchestration/agent/agent.js +415 -44
- package/dist/components/multi-agent-orchestration/agent/agent.js.map +1 -1
- package/dist/components/multi-agent-orchestration/agent/channel-manager/channel-manager.d.ts +245 -1
- package/dist/components/multi-agent-orchestration/agent/channel-manager/channel-manager.d.ts.map +1 -1
- package/dist/components/multi-agent-orchestration/agent/channel-manager/channel-manager.js +1583 -0
- package/dist/components/multi-agent-orchestration/agent/channel-manager/channel-manager.js.map +1 -1
- package/dist/components/multi-agent-orchestration/agent/channel-manager/channel-prompts.d.ts +76 -0
- package/dist/components/multi-agent-orchestration/agent/channel-manager/channel-prompts.d.ts.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/channel-manager/channel-prompts.js +236 -0
- package/dist/components/multi-agent-orchestration/agent/channel-manager/channel-prompts.js.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/channel-manager/text.d.ts +15 -0
- package/dist/components/multi-agent-orchestration/agent/channel-manager/text.d.ts.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/channel-manager/text.js +80 -0
- package/dist/components/multi-agent-orchestration/agent/channel-manager/text.js.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/channel-manager/turn-stream.d.ts +13 -0
- package/dist/components/multi-agent-orchestration/agent/channel-manager/turn-stream.d.ts.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/channel-manager/turn-stream.js +41 -0
- package/dist/components/multi-agent-orchestration/agent/channel-manager/turn-stream.js.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/channel-manager/turn-view.d.ts +69 -0
- package/dist/components/multi-agent-orchestration/agent/channel-manager/turn-view.d.ts.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/channel-manager/turn-view.js +210 -0
- package/dist/components/multi-agent-orchestration/agent/channel-manager/turn-view.js.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/channel-manager/types.d.ts +76 -0
- package/dist/components/multi-agent-orchestration/agent/channel-manager/types.d.ts.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/channel-manager/types.js +7 -0
- package/dist/components/multi-agent-orchestration/agent/channel-manager/types.js.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/command-manager/built-in-commands.d.ts +37 -0
- package/dist/components/multi-agent-orchestration/agent/command-manager/built-in-commands.d.ts.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/command-manager/built-in-commands.js +544 -0
- package/dist/components/multi-agent-orchestration/agent/command-manager/built-in-commands.js.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/command-manager/command-manager.d.ts +75 -0
- package/dist/components/multi-agent-orchestration/agent/command-manager/command-manager.d.ts.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/command-manager/command-manager.js +299 -0
- package/dist/components/multi-agent-orchestration/agent/command-manager/command-manager.js.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/command-manager/parse.d.ts +17 -0
- package/dist/components/multi-agent-orchestration/agent/command-manager/parse.d.ts.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/command-manager/parse.js +19 -0
- package/dist/components/multi-agent-orchestration/agent/command-manager/parse.js.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/command-manager/types.d.ts +197 -0
- package/dist/components/multi-agent-orchestration/agent/command-manager/types.d.ts.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/command-manager/types.js +3 -0
- package/dist/components/multi-agent-orchestration/agent/command-manager/types.js.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/context-manager/context-manager.d.ts +37 -1
- package/dist/components/multi-agent-orchestration/agent/context-manager/context-manager.d.ts.map +1 -1
- package/dist/components/multi-agent-orchestration/agent/context-manager/context-manager.js +54 -2
- package/dist/components/multi-agent-orchestration/agent/context-manager/context-manager.js.map +1 -1
- package/dist/components/multi-agent-orchestration/agent/conversation-manager/conversation-manager.d.ts +118 -14
- package/dist/components/multi-agent-orchestration/agent/conversation-manager/conversation-manager.d.ts.map +1 -1
- package/dist/components/multi-agent-orchestration/agent/conversation-manager/conversation-manager.js +239 -50
- package/dist/components/multi-agent-orchestration/agent/conversation-manager/conversation-manager.js.map +1 -1
- package/dist/components/multi-agent-orchestration/agent/conversation-manager/conversation.d.ts +34 -0
- package/dist/components/multi-agent-orchestration/agent/conversation-manager/conversation.d.ts.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/conversation-manager/conversation.js +74 -0
- package/dist/components/multi-agent-orchestration/agent/conversation-manager/conversation.js.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/conversation-manager/turn-gate.d.ts +49 -0
- package/dist/components/multi-agent-orchestration/agent/conversation-manager/turn-gate.d.ts.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/conversation-manager/turn-gate.js +171 -0
- package/dist/components/multi-agent-orchestration/agent/conversation-manager/turn-gate.js.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/job-manager/clock.d.ts +43 -0
- package/dist/components/multi-agent-orchestration/agent/job-manager/clock.d.ts.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/job-manager/clock.js +116 -0
- package/dist/components/multi-agent-orchestration/agent/job-manager/clock.js.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/job-manager/internal-events.d.ts +17 -0
- package/dist/components/multi-agent-orchestration/agent/job-manager/internal-events.d.ts.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/job-manager/internal-events.js +93 -0
- package/dist/components/multi-agent-orchestration/agent/job-manager/internal-events.js.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/job-manager/job-manager.d.ts +208 -0
- package/dist/components/multi-agent-orchestration/agent/job-manager/job-manager.d.ts.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/job-manager/job-manager.js +1207 -0
- package/dist/components/multi-agent-orchestration/agent/job-manager/job-manager.js.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/job-manager/rules.d.ts +129 -0
- package/dist/components/multi-agent-orchestration/agent/job-manager/rules.d.ts.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/job-manager/rules.js +598 -0
- package/dist/components/multi-agent-orchestration/agent/job-manager/rules.js.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/job-manager/schedule.d.ts +15 -0
- package/dist/components/multi-agent-orchestration/agent/job-manager/schedule.d.ts.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/job-manager/schedule.js +113 -0
- package/dist/components/multi-agent-orchestration/agent/job-manager/schedule.js.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/job-manager/timers.d.ts +8 -0
- package/dist/components/multi-agent-orchestration/agent/job-manager/timers.d.ts.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/job-manager/timers.js +33 -0
- package/dist/components/multi-agent-orchestration/agent/job-manager/timers.js.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/job-manager/types.d.ts +495 -0
- package/dist/components/multi-agent-orchestration/agent/job-manager/types.d.ts.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/job-manager/types.js +50 -0
- package/dist/components/multi-agent-orchestration/agent/job-manager/types.js.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/job-manager/webhook.d.ts +37 -0
- package/dist/components/multi-agent-orchestration/agent/job-manager/webhook.d.ts.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/job-manager/webhook.js +157 -0
- package/dist/components/multi-agent-orchestration/agent/job-manager/webhook.js.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/memory-system/components/memory.d.ts +7 -0
- package/dist/components/multi-agent-orchestration/agent/memory-system/components/memory.d.ts.map +1 -1
- package/dist/components/multi-agent-orchestration/agent/memory-system/components/memory.js +189 -30
- package/dist/components/multi-agent-orchestration/agent/memory-system/components/memory.js.map +1 -1
- package/dist/components/multi-agent-orchestration/agent/memory-system/memory-system.d.ts +17 -0
- package/dist/components/multi-agent-orchestration/agent/memory-system/memory-system.d.ts.map +1 -1
- package/dist/components/multi-agent-orchestration/agent/memory-system/memory-system.js +51 -0
- package/dist/components/multi-agent-orchestration/agent/memory-system/memory-system.js.map +1 -1
- package/dist/components/multi-agent-orchestration/agent/model-manager/model-manager.d.ts +5 -0
- package/dist/components/multi-agent-orchestration/agent/model-manager/model-manager.d.ts.map +1 -1
- package/dist/components/multi-agent-orchestration/agent/model-manager/model-manager.js +16 -0
- package/dist/components/multi-agent-orchestration/agent/model-manager/model-manager.js.map +1 -1
- package/dist/components/multi-agent-orchestration/agent/secret-manager/secret-manager.d.ts +41 -0
- package/dist/components/multi-agent-orchestration/agent/secret-manager/secret-manager.d.ts.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/secret-manager/secret-manager.js +98 -0
- package/dist/components/multi-agent-orchestration/agent/secret-manager/secret-manager.js.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/secret-manager/types.d.ts +37 -0
- package/dist/components/multi-agent-orchestration/agent/secret-manager/types.d.ts.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/secret-manager/types.js.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/skill-manager/skill-manager.d.ts.map +1 -1
- package/dist/components/multi-agent-orchestration/agent/skill-manager/skill-manager.js +1 -0
- package/dist/components/multi-agent-orchestration/agent/skill-manager/skill-manager.js.map +1 -1
- package/dist/components/multi-agent-orchestration/agent/subagent-manager/brief.d.ts +21 -0
- package/dist/components/multi-agent-orchestration/agent/subagent-manager/brief.d.ts.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/subagent-manager/brief.js +113 -0
- package/dist/components/multi-agent-orchestration/agent/subagent-manager/brief.js.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/subagent-manager/child-loop.d.ts +52 -0
- package/dist/components/multi-agent-orchestration/agent/subagent-manager/child-loop.d.ts.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/subagent-manager/child-loop.js +63 -0
- package/dist/components/multi-agent-orchestration/agent/subagent-manager/child-loop.js.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/subagent-manager/semaphore.d.ts +18 -0
- package/dist/components/multi-agent-orchestration/agent/subagent-manager/semaphore.d.ts.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/subagent-manager/semaphore.js +56 -0
- package/dist/components/multi-agent-orchestration/agent/subagent-manager/semaphore.js.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/subagent-manager/subagent-manager.d.ts +128 -0
- package/dist/components/multi-agent-orchestration/agent/subagent-manager/subagent-manager.d.ts.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/subagent-manager/subagent-manager.js +661 -0
- package/dist/components/multi-agent-orchestration/agent/subagent-manager/subagent-manager.js.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/subagent-manager/types.d.ts +307 -0
- package/dist/components/multi-agent-orchestration/agent/subagent-manager/types.d.ts.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/subagent-manager/types.js +60 -0
- package/dist/components/multi-agent-orchestration/agent/subagent-manager/types.js.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/tool-manager/tool-manager.d.ts +14 -3
- package/dist/components/multi-agent-orchestration/agent/tool-manager/tool-manager.d.ts.map +1 -1
- package/dist/components/multi-agent-orchestration/agent/tool-manager/tool-manager.js +18 -5
- package/dist/components/multi-agent-orchestration/agent/tool-manager/tool-manager.js.map +1 -1
- package/dist/components/multi-agent-orchestration/agent/types.d.ts +84 -1
- package/dist/components/multi-agent-orchestration/agent/types.d.ts.map +1 -1
- package/dist/components/multi-agent-orchestration/multi-agent-orchestration.d.ts +11 -4
- package/dist/components/multi-agent-orchestration/multi-agent-orchestration.d.ts.map +1 -1
- package/dist/components/multi-agent-orchestration/multi-agent-orchestration.js +72 -4
- package/dist/components/multi-agent-orchestration/multi-agent-orchestration.js.map +1 -1
- package/dist/components/persistence-hub/default-stores/memory-channel-store.d.ts +11 -0
- package/dist/components/persistence-hub/default-stores/memory-channel-store.d.ts.map +1 -0
- package/dist/components/persistence-hub/default-stores/memory-channel-store.js +33 -0
- package/dist/components/persistence-hub/default-stores/memory-channel-store.js.map +1 -0
- package/dist/components/persistence-hub/default-stores/memory-group-store.d.ts +21 -0
- package/dist/components/persistence-hub/default-stores/memory-group-store.d.ts.map +1 -0
- package/dist/components/persistence-hub/default-stores/memory-group-store.js +62 -0
- package/dist/components/persistence-hub/default-stores/memory-group-store.js.map +1 -0
- package/dist/components/persistence-hub/default-stores/memory-job-store.d.ts +31 -0
- package/dist/components/persistence-hub/default-stores/memory-job-store.d.ts.map +1 -0
- package/dist/components/persistence-hub/default-stores/memory-job-store.js +234 -0
- package/dist/components/persistence-hub/default-stores/memory-job-store.js.map +1 -0
- package/dist/components/persistence-hub/default-stores/memory-secret-store.d.ts +12 -0
- package/dist/components/persistence-hub/default-stores/memory-secret-store.d.ts.map +1 -0
- package/dist/components/persistence-hub/default-stores/memory-secret-store.js +38 -0
- package/dist/components/persistence-hub/default-stores/memory-secret-store.js.map +1 -0
- package/dist/components/persistence-hub/default-stores/memory-session-store.d.ts.map +1 -1
- package/dist/components/persistence-hub/default-stores/memory-session-store.js +7 -0
- package/dist/components/persistence-hub/default-stores/memory-session-store.js.map +1 -1
- package/dist/components/persistence-hub/default-stores/memory-subagent-run-store.d.ts +10 -0
- package/dist/components/persistence-hub/default-stores/memory-subagent-run-store.d.ts.map +1 -0
- package/dist/components/persistence-hub/default-stores/memory-subagent-run-store.js +30 -0
- package/dist/components/persistence-hub/default-stores/memory-subagent-run-store.js.map +1 -0
- package/dist/components/persistence-hub/default-stores/memory-subagent-type-store.d.ts +9 -0
- package/dist/components/persistence-hub/default-stores/memory-subagent-type-store.d.ts.map +1 -0
- package/dist/components/persistence-hub/default-stores/memory-subagent-type-store.js +17 -0
- package/dist/components/persistence-hub/default-stores/memory-subagent-type-store.js.map +1 -0
- package/dist/components/persistence-hub/persistence-hub.d.ts +41 -0
- package/dist/components/persistence-hub/persistence-hub.d.ts.map +1 -1
- package/dist/components/persistence-hub/persistence-hub.js +41 -0
- package/dist/components/persistence-hub/persistence-hub.js.map +1 -1
- package/dist/components/persistence-hub/types/channel-store.d.ts +12 -0
- package/dist/components/persistence-hub/types/channel-store.d.ts.map +1 -0
- package/dist/components/persistence-hub/types/channel-store.js +2 -0
- package/dist/components/persistence-hub/types/channel-store.js.map +1 -0
- package/dist/components/persistence-hub/types/group-store.d.ts +27 -0
- package/dist/components/persistence-hub/types/group-store.d.ts.map +1 -0
- package/dist/components/persistence-hub/types/group-store.js +2 -0
- package/dist/components/persistence-hub/types/group-store.js.map +1 -0
- package/dist/components/persistence-hub/types/job-store.d.ts +112 -0
- package/dist/components/persistence-hub/types/job-store.d.ts.map +1 -0
- package/dist/components/persistence-hub/types/job-store.js +2 -0
- package/dist/components/persistence-hub/types/job-store.js.map +1 -0
- package/dist/components/persistence-hub/types/secret-store.d.ts +18 -0
- package/dist/components/persistence-hub/types/secret-store.d.ts.map +1 -0
- package/dist/components/persistence-hub/types/secret-store.js +2 -0
- package/dist/components/persistence-hub/types/secret-store.js.map +1 -0
- package/dist/components/persistence-hub/types/session-store.d.ts +5 -0
- package/dist/components/persistence-hub/types/session-store.d.ts.map +1 -1
- package/dist/components/persistence-hub/types/subagent-run-store.d.ts +11 -0
- package/dist/components/persistence-hub/types/subagent-run-store.d.ts.map +1 -0
- package/dist/components/persistence-hub/types/subagent-run-store.js +2 -0
- package/dist/components/persistence-hub/types/subagent-run-store.js.map +1 -0
- package/dist/components/persistence-hub/types/subagent-type-store.d.ts +9 -0
- package/dist/components/persistence-hub/types/subagent-type-store.d.ts.map +1 -0
- package/dist/components/persistence-hub/types/subagent-type-store.js +2 -0
- package/dist/components/persistence-hub/types/subagent-type-store.js.map +1 -0
- package/dist/components/sandbox-hub/docker/docker-sandbox.d.ts +4 -1
- package/dist/components/sandbox-hub/docker/docker-sandbox.d.ts.map +1 -1
- package/dist/components/sandbox-hub/docker/docker-sandbox.js +398 -1
- package/dist/components/sandbox-hub/docker/docker-sandbox.js.map +1 -1
- package/dist/components/sandbox-hub/docker/sandbox-helper.d.ts.map +1 -1
- package/dist/components/sandbox-hub/docker/sandbox-helper.js +386 -5
- package/dist/components/sandbox-hub/docker/sandbox-helper.js.map +1 -1
- package/dist/components/sandbox-hub/host/host-sandbox.d.ts +16 -0
- package/dist/components/sandbox-hub/host/host-sandbox.d.ts.map +1 -1
- package/dist/components/sandbox-hub/host/host-sandbox.js +283 -2
- package/dist/components/sandbox-hub/host/host-sandbox.js.map +1 -1
- package/dist/components/sandbox-hub/sandbox-hub.d.ts +9 -0
- package/dist/components/sandbox-hub/sandbox-hub.d.ts.map +1 -1
- package/dist/components/sandbox-hub/sandbox-hub.js +18 -0
- package/dist/components/sandbox-hub/sandbox-hub.js.map +1 -1
- package/dist/components/sandbox-hub/traced-sandbox.d.ts.map +1 -1
- package/dist/components/sandbox-hub/traced-sandbox.js +32 -0
- package/dist/components/sandbox-hub/traced-sandbox.js.map +1 -1
- package/dist/components/sandbox-hub/types/sandbox.d.ts +106 -1
- package/dist/components/sandbox-hub/types/sandbox.d.ts.map +1 -1
- package/dist/components/sandbox-hub/types/sandbox.js +0 -13
- package/dist/components/sandbox-hub/types/sandbox.js.map +1 -1
- package/dist/components/secret-hub/envelope.d.ts +48 -0
- package/dist/components/secret-hub/envelope.d.ts.map +1 -0
- package/dist/components/secret-hub/envelope.js +157 -0
- package/dist/components/secret-hub/envelope.js.map +1 -0
- package/dist/components/secret-hub/rules.d.ts +33 -0
- package/dist/components/secret-hub/rules.d.ts.map +1 -0
- package/dist/components/secret-hub/rules.js +142 -0
- package/dist/components/secret-hub/rules.js.map +1 -0
- package/dist/components/secret-hub/secret-hub-provider.d.ts +61 -0
- package/dist/components/secret-hub/secret-hub-provider.d.ts.map +1 -0
- package/dist/components/secret-hub/secret-hub-provider.js +73 -0
- package/dist/components/secret-hub/secret-hub-provider.js.map +1 -0
- package/dist/components/secret-hub/secret-hub.d.ts +102 -0
- package/dist/components/secret-hub/secret-hub.d.ts.map +1 -0
- package/dist/components/secret-hub/secret-hub.js +267 -0
- package/dist/components/secret-hub/secret-hub.js.map +1 -0
- package/dist/components/secret-hub/types.d.ts +77 -0
- package/dist/components/secret-hub/types.d.ts.map +1 -0
- package/dist/components/secret-hub/types.js +23 -0
- package/dist/components/secret-hub/types.js.map +1 -0
- package/dist/components/skill-hub/built-in-skills/essential-skills.d.ts +1 -1
- package/dist/components/skill-hub/built-in-skills/essential-skills.d.ts.map +1 -1
- package/dist/components/skill-hub/built-in-skills/essential-skills.js +7 -2
- package/dist/components/skill-hub/built-in-skills/essential-skills.js.map +1 -1
- package/dist/components/skill-hub/built-in-skills/watch-and-notify.d.ts +3 -0
- package/dist/components/skill-hub/built-in-skills/watch-and-notify.d.ts.map +1 -0
- package/dist/components/skill-hub/built-in-skills/watch-and-notify.js +94 -0
- package/dist/components/skill-hub/built-in-skills/watch-and-notify.js.map +1 -0
- package/dist/components/skill-hub/skill-hub.d.ts +9 -1
- package/dist/components/skill-hub/skill-hub.d.ts.map +1 -1
- package/dist/components/skill-hub/skill-hub.js +11 -1
- package/dist/components/skill-hub/skill-hub.js.map +1 -1
- package/dist/components/subagent-hub/built-in-types.d.ts +3 -0
- package/dist/components/subagent-hub/built-in-types.d.ts.map +1 -0
- package/dist/components/subagent-hub/built-in-types.js +24 -0
- package/dist/components/subagent-hub/built-in-types.js.map +1 -0
- package/dist/components/subagent-hub/subagent-hub.d.ts +41 -0
- package/dist/components/subagent-hub/subagent-hub.d.ts.map +1 -0
- package/dist/components/subagent-hub/subagent-hub.js +158 -0
- package/dist/components/subagent-hub/subagent-hub.js.map +1 -0
- package/dist/components/subagent-hub/types.d.ts +40 -0
- package/dist/components/subagent-hub/types.d.ts.map +1 -0
- package/dist/components/subagent-hub/types.js +8 -0
- package/dist/components/subagent-hub/types.js.map +1 -0
- package/dist/components/tool-hub/built-in-tools/artifacts/artifact-helpers.d.ts +4 -1
- package/dist/components/tool-hub/built-in-tools/artifacts/artifact-helpers.d.ts.map +1 -1
- package/dist/components/tool-hub/built-in-tools/artifacts/artifact-helpers.js +4 -0
- package/dist/components/tool-hub/built-in-tools/artifacts/artifact-helpers.js.map +1 -1
- package/dist/components/tool-hub/built-in-tools/artifacts/save-artifact-tool.d.ts.map +1 -1
- package/dist/components/tool-hub/built-in-tools/artifacts/save-artifact-tool.js +4 -1
- package/dist/components/tool-hub/built-in-tools/artifacts/save-artifact-tool.js.map +1 -1
- package/dist/components/tool-hub/built-in-tools/artifacts/update-artifact-tool.d.ts.map +1 -1
- package/dist/components/tool-hub/built-in-tools/artifacts/update-artifact-tool.js +4 -1
- package/dist/components/tool-hub/built-in-tools/artifacts/update-artifact-tool.js.map +1 -1
- package/dist/components/tool-hub/built-in-tools/jobs/create-job-tools.d.ts +10 -0
- package/dist/components/tool-hub/built-in-tools/jobs/create-job-tools.d.ts.map +1 -0
- package/dist/components/tool-hub/built-in-tools/jobs/create-job-tools.js +13 -0
- package/dist/components/tool-hub/built-in-tools/jobs/create-job-tools.js.map +1 -0
- package/dist/components/tool-hub/built-in-tools/jobs/job-tool-helpers.d.ts +60 -0
- package/dist/components/tool-hub/built-in-tools/jobs/job-tool-helpers.d.ts.map +1 -0
- package/dist/components/tool-hub/built-in-tools/jobs/job-tool-helpers.js +240 -0
- package/dist/components/tool-hub/built-in-tools/jobs/job-tool-helpers.js.map +1 -0
- package/dist/components/tool-hub/built-in-tools/jobs/list-jobs-tool.d.ts +14 -0
- package/dist/components/tool-hub/built-in-tools/jobs/list-jobs-tool.d.ts.map +1 -0
- package/dist/components/tool-hub/built-in-tools/jobs/list-jobs-tool.js +36 -0
- package/dist/components/tool-hub/built-in-tools/jobs/list-jobs-tool.js.map +1 -0
- package/dist/components/tool-hub/built-in-tools/jobs/manage-job-tool.d.ts +32 -0
- package/dist/components/tool-hub/built-in-tools/jobs/manage-job-tool.d.ts.map +1 -0
- package/dist/components/tool-hub/built-in-tools/jobs/manage-job-tool.js +458 -0
- package/dist/components/tool-hub/built-in-tools/jobs/manage-job-tool.js.map +1 -0
- package/dist/components/tool-hub/built-in-tools/preview/create-preview-tools.d.ts +9 -0
- package/dist/components/tool-hub/built-in-tools/preview/create-preview-tools.d.ts.map +1 -0
- package/dist/components/tool-hub/built-in-tools/preview/create-preview-tools.js +20 -0
- package/dist/components/tool-hub/built-in-tools/preview/create-preview-tools.js.map +1 -0
- package/dist/components/tool-hub/built-in-tools/preview/list-apps-tool.d.ts +12 -0
- package/dist/components/tool-hub/built-in-tools/preview/list-apps-tool.d.ts.map +1 -0
- package/dist/components/tool-hub/built-in-tools/preview/list-apps-tool.js +57 -0
- package/dist/components/tool-hub/built-in-tools/preview/list-apps-tool.js.map +1 -0
- package/dist/components/tool-hub/built-in-tools/preview/open-in-app-tool.d.ts +15 -0
- package/dist/components/tool-hub/built-in-tools/preview/open-in-app-tool.d.ts.map +1 -0
- package/dist/components/tool-hub/built-in-tools/preview/open-in-app-tool.js +80 -0
- package/dist/components/tool-hub/built-in-tools/preview/open-in-app-tool.js.map +1 -0
- package/dist/components/tool-hub/built-in-tools/preview/preview-helpers.d.ts +53 -0
- package/dist/components/tool-hub/built-in-tools/preview/preview-helpers.d.ts.map +1 -0
- package/dist/components/tool-hub/built-in-tools/preview/preview-helpers.js +100 -0
- package/dist/components/tool-hub/built-in-tools/preview/preview-helpers.js.map +1 -0
- package/dist/components/tool-hub/built-in-tools/preview/preview-tool.d.ts +14 -0
- package/dist/components/tool-hub/built-in-tools/preview/preview-tool.d.ts.map +1 -0
- package/dist/components/tool-hub/built-in-tools/preview/preview-tool.js +63 -0
- package/dist/components/tool-hub/built-in-tools/preview/preview-tool.js.map +1 -0
- package/dist/components/tool-hub/built-in-tools/preview/service-tools.d.ts +33 -0
- package/dist/components/tool-hub/built-in-tools/preview/service-tools.d.ts.map +1 -0
- package/dist/components/tool-hub/built-in-tools/preview/service-tools.js +180 -0
- package/dist/components/tool-hub/built-in-tools/preview/service-tools.js.map +1 -0
- package/dist/components/tool-hub/built-in-tools/secrets/create-secret-tools.d.ts +6 -0
- package/dist/components/tool-hub/built-in-tools/secrets/create-secret-tools.d.ts.map +1 -0
- package/dist/components/tool-hub/built-in-tools/secrets/create-secret-tools.js +9 -0
- package/dist/components/tool-hub/built-in-tools/secrets/create-secret-tools.js.map +1 -0
- package/dist/components/tool-hub/built-in-tools/secrets/list-secrets-tool.d.ts +12 -0
- package/dist/components/tool-hub/built-in-tools/secrets/list-secrets-tool.d.ts.map +1 -0
- package/dist/components/tool-hub/built-in-tools/secrets/list-secrets-tool.js +30 -0
- package/dist/components/tool-hub/built-in-tools/secrets/list-secrets-tool.js.map +1 -0
- package/dist/components/tool-hub/built-in-tools/secrets/manage-secret-tool.d.ts +22 -0
- package/dist/components/tool-hub/built-in-tools/secrets/manage-secret-tool.d.ts.map +1 -0
- package/dist/components/tool-hub/built-in-tools/secrets/manage-secret-tool.js +113 -0
- package/dist/components/tool-hub/built-in-tools/secrets/manage-secret-tool.js.map +1 -0
- package/dist/components/tool-hub/built-in-tools/secrets/secret-tool-helpers.d.ts +9 -0
- package/dist/components/tool-hub/built-in-tools/secrets/secret-tool-helpers.d.ts.map +1 -0
- package/dist/components/tool-hub/built-in-tools/secrets/secret-tool-helpers.js +29 -0
- package/dist/components/tool-hub/built-in-tools/secrets/secret-tool-helpers.js.map +1 -0
- package/dist/components/tool-hub/built-in-tools/subagents/spawn-subagent-tool.d.ts +27 -0
- package/dist/components/tool-hub/built-in-tools/subagents/spawn-subagent-tool.d.ts.map +1 -0
- package/dist/components/tool-hub/built-in-tools/subagents/spawn-subagent-tool.js +112 -0
- package/dist/components/tool-hub/built-in-tools/subagents/spawn-subagent-tool.js.map +1 -0
- package/dist/components/tool-hub/built-in-tools/web/http-request-tool.d.ts +43 -0
- package/dist/components/tool-hub/built-in-tools/web/http-request-tool.d.ts.map +1 -0
- package/dist/components/tool-hub/built-in-tools/web/http-request-tool.js +234 -0
- package/dist/components/tool-hub/built-in-tools/web/http-request-tool.js.map +1 -0
- package/dist/components/tool-hub/built-in-tools/web/web-extract-tool.d.ts.map +1 -1
- package/dist/components/tool-hub/built-in-tools/web/web-extract-tool.js +2 -0
- package/dist/components/tool-hub/built-in-tools/web/web-extract-tool.js.map +1 -1
- package/dist/components/tool-hub/built-in-tools/web/web-search-tool.d.ts.map +1 -1
- package/dist/components/tool-hub/built-in-tools/web/web-search-tool.js +2 -0
- package/dist/components/tool-hub/built-in-tools/web/web-search-tool.js.map +1 -1
- package/dist/components/tool-hub/built-in-tools/workspace/run-code-tool.d.ts.map +1 -1
- package/dist/components/tool-hub/built-in-tools/workspace/run-code-tool.js +9 -1
- package/dist/components/tool-hub/built-in-tools/workspace/run-code-tool.js.map +1 -1
- package/dist/components/tool-hub/built-in-tools/workspace/terminal-tool.d.ts.map +1 -1
- package/dist/components/tool-hub/built-in-tools/workspace/terminal-tool.js +9 -2
- package/dist/components/tool-hub/built-in-tools/workspace/terminal-tool.js.map +1 -1
- package/dist/components/tool-hub/built-in-tools/workspace/workspace-helpers.d.ts +17 -0
- package/dist/components/tool-hub/built-in-tools/workspace/workspace-helpers.d.ts.map +1 -1
- package/dist/components/tool-hub/built-in-tools/workspace/workspace-helpers.js +29 -0
- package/dist/components/tool-hub/built-in-tools/workspace/workspace-helpers.js.map +1 -1
- package/dist/components/tool-hub/tool-links.d.ts +9 -0
- package/dist/components/tool-hub/tool-links.d.ts.map +1 -0
- package/dist/components/tool-hub/tool-links.js +11 -0
- package/dist/components/tool-hub/tool-links.js.map +1 -0
- package/dist/components/tool-hub/types.d.ts +101 -1
- package/dist/components/tool-hub/types.d.ts.map +1 -1
- package/dist/index.d.ts +109 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +68 -0
- package/dist/index.js.map +1 -1
- package/dist/kernel/errors/channel-error.d.ts +24 -0
- package/dist/kernel/errors/channel-error.d.ts.map +1 -0
- package/dist/kernel/errors/channel-error.js +15 -0
- package/dist/kernel/errors/channel-error.js.map +1 -0
- package/dist/kernel/errors/command-error.d.ts +12 -0
- package/dist/kernel/errors/command-error.d.ts.map +1 -0
- package/dist/kernel/errors/command-error.js +11 -0
- package/dist/kernel/errors/command-error.js.map +1 -0
- package/dist/kernel/errors/group-error.d.ts +15 -0
- package/dist/kernel/errors/group-error.d.ts.map +1 -0
- package/dist/kernel/errors/group-error.js +10 -0
- package/dist/kernel/errors/group-error.js.map +1 -0
- package/dist/kernel/errors/job-error.d.ts +23 -0
- package/dist/kernel/errors/job-error.d.ts.map +1 -0
- package/dist/kernel/errors/job-error.js +15 -0
- package/dist/kernel/errors/job-error.js.map +1 -0
- package/dist/kernel/errors/secret-error.d.ts +19 -0
- package/dist/kernel/errors/secret-error.d.ts.map +1 -0
- package/dist/kernel/errors/secret-error.js +10 -0
- package/dist/kernel/errors/secret-error.js.map +1 -0
- package/dist/kernel/errors/session-error.d.ts +5 -1
- package/dist/kernel/errors/session-error.d.ts.map +1 -1
- package/dist/kernel/errors/session-error.js.map +1 -1
- package/dist/kernel/errors/subagent-error.d.ts +19 -0
- package/dist/kernel/errors/subagent-error.d.ts.map +1 -0
- package/dist/kernel/errors/subagent-error.js +10 -0
- package/dist/kernel/errors/subagent-error.js.map +1 -0
- package/dist/kernel/interfaces/kernel.d.ts +15 -0
- package/dist/kernel/interfaces/kernel.d.ts.map +1 -1
- package/dist/kernel/types.d.ts +80 -1
- package/dist/kernel/types.d.ts.map +1 -1
- package/dist/testing/fake-channel.d.ts +60 -0
- package/dist/testing/fake-channel.d.ts.map +1 -0
- package/dist/testing/fake-channel.js +135 -0
- package/dist/testing/fake-channel.js.map +1 -0
- package/dist/testing/in-memory-sandbox.d.ts +4 -1
- package/dist/testing/in-memory-sandbox.d.ts.map +1 -1
- package/dist/testing/in-memory-sandbox.js +63 -3
- package/dist/testing/in-memory-sandbox.js.map +1 -1
- package/dist/testing/mock-session-store.d.ts.map +1 -1
- package/dist/testing/mock-session-store.js +7 -0
- package/dist/testing/mock-session-store.js.map +1 -1
- package/package.json +2 -1
- package/dist/components/multi-agent-orchestration/agent/scheduled-job-manager/scheduled-job-manager.d.ts +0 -38
- package/dist/components/multi-agent-orchestration/agent/scheduled-job-manager/scheduled-job-manager.d.ts.map +0 -1
- package/dist/components/multi-agent-orchestration/agent/scheduled-job-manager/scheduled-job-manager.js +0 -155
- package/dist/components/multi-agent-orchestration/agent/scheduled-job-manager/scheduled-job-manager.js.map +0 -1
- package/dist/components/multi-agent-orchestration/agent/scheduled-job-manager/types.d.ts +0 -27
- package/dist/components/multi-agent-orchestration/agent/scheduled-job-manager/types.d.ts.map +0 -1
- package/dist/components/multi-agent-orchestration/agent/scheduled-job-manager/types.js.map +0 -1
- /package/dist/components/multi-agent-orchestration/agent/{scheduled-job-manager → secret-manager}/types.js +0 -0
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { citeLinkNote } from "../../tool-links.js";
|
|
2
|
+
import { argError, numberArg, stringArg, withSandbox } from "../workspace/workspace-helpers.js";
|
|
3
|
+
// A-124 phase 2: dev servers in the agent's sandbox. A service is a long-running process
|
|
4
|
+
// (npm run dev, a Python server) the user sees live next to the chat through the preview
|
|
5
|
+
// origin, hot reload included. start_service returns a "service://<name>/" link
|
|
6
|
+
// (ToolResult.link, A-132); the host turns it into a URL on an origin of its own.
|
|
7
|
+
/** How long start_service waits for the port before it answers. */
|
|
8
|
+
const START_WAIT_MS = 30_000;
|
|
9
|
+
const LOG_TAIL_BYTES = 4_000;
|
|
10
|
+
/** The link of a service (its root page). */
|
|
11
|
+
export function serviceLink(name) {
|
|
12
|
+
return { uri: `service://${name}/`, name, type: "service" };
|
|
13
|
+
}
|
|
14
|
+
function noServices(tool) {
|
|
15
|
+
return argError(tool, "this agent's sandbox cannot run services — use preview for static pages");
|
|
16
|
+
}
|
|
17
|
+
function describe(s) {
|
|
18
|
+
const state = s.status === "exited" ? `exited${s.exitCode !== undefined && s.exitCode !== null ? ` (code ${s.exitCode})` : ""}` : s.status;
|
|
19
|
+
return `${s.name} · ${state} · port ${s.port} · ${s.command}`;
|
|
20
|
+
}
|
|
21
|
+
async function logTail(env, name) {
|
|
22
|
+
const logs = await env.serviceLogs(name, { maxBytes: LOG_TAIL_BYTES }).catch(() => null);
|
|
23
|
+
if (!logs || !logs.text.trim())
|
|
24
|
+
return "(no output)";
|
|
25
|
+
return `${logs.truncated ? "…" : ""}${logs.text.trimEnd()}`;
|
|
26
|
+
}
|
|
27
|
+
const sleep = (ms, signal) => new Promise((resolve) => {
|
|
28
|
+
const t = setTimeout(resolve, ms);
|
|
29
|
+
signal?.addEventListener("abort", () => { clearTimeout(t); resolve(); }, { once: true });
|
|
30
|
+
});
|
|
31
|
+
/** start_service — start a dev server and show it live. */
|
|
32
|
+
export class StartServiceTool {
|
|
33
|
+
name = "tool:start-service";
|
|
34
|
+
version = "1.0.0";
|
|
35
|
+
definition = {
|
|
36
|
+
name: "start_service",
|
|
37
|
+
description: "Start a long-running web server in your workspace (a dev server with hot reload, an API, a Python server) " +
|
|
38
|
+
"and show it to the user live next to the chat. The command gets its port in $PORT and must listen on it " +
|
|
39
|
+
'on 127.0.0.1 — e.g. "npx vite --host 127.0.0.1 --port $PORT", "python3 -m http.server $PORT --bind 127.0.0.1". ' +
|
|
40
|
+
"It keeps running after this call; edits to its files show up through its own reload. Your sandbox may have no " +
|
|
41
|
+
"internet, so dependencies must already be installed. For plain HTML files use preview instead.",
|
|
42
|
+
parameters: {
|
|
43
|
+
type: "object",
|
|
44
|
+
properties: {
|
|
45
|
+
name: { type: "string", description: 'Short name, lower-case letters, digits and dashes, e.g. "web"' },
|
|
46
|
+
command: { type: "string", description: "Shell command that starts the server (use $PORT)" },
|
|
47
|
+
cwd: { type: "string", description: "Folder to run it in (default: your working directory)" },
|
|
48
|
+
port: { type: "number", description: "Only when the server cannot take $PORT: the fixed port it listens on" },
|
|
49
|
+
},
|
|
50
|
+
required: ["name", "command"],
|
|
51
|
+
},
|
|
52
|
+
risk: "draft",
|
|
53
|
+
sandboxOperation: "exec",
|
|
54
|
+
};
|
|
55
|
+
async execute(args, context) {
|
|
56
|
+
const name = stringArg(args, "name")?.trim();
|
|
57
|
+
const command = stringArg(args, "command")?.trim();
|
|
58
|
+
if (!name)
|
|
59
|
+
return argError("start_service", '"name" is required');
|
|
60
|
+
if (!command)
|
|
61
|
+
return argError("start_service", '"command" is required');
|
|
62
|
+
const cwd = stringArg(args, "cwd")?.trim();
|
|
63
|
+
const port = numberArg(args, "port");
|
|
64
|
+
return withSandbox("start_service", context, async (env) => {
|
|
65
|
+
if (!env.startService || !env.listServices)
|
|
66
|
+
return noServices("start_service");
|
|
67
|
+
const started = await env.startService({ name, command, ...(cwd ? { cwd } : {}), ...(port !== undefined ? { port: Math.floor(port) } : {}) }, { signal: context.signal });
|
|
68
|
+
let info = started;
|
|
69
|
+
const deadline = Date.now() + START_WAIT_MS;
|
|
70
|
+
while (info.status === "starting" && Date.now() < deadline && !context.signal?.aborted) {
|
|
71
|
+
await sleep(500, context.signal);
|
|
72
|
+
info = (await env.listServices({ signal: context.signal })).find((s) => s.name === name) ?? info;
|
|
73
|
+
}
|
|
74
|
+
if (info.status === "exited") {
|
|
75
|
+
return {
|
|
76
|
+
content: `start_service: ${name} exited${info.exitCode != null ? ` with code ${info.exitCode}` : ""} before it listened on port ${info.port}. Its output:\n${await logTail(env, name)}`,
|
|
77
|
+
isError: true,
|
|
78
|
+
retryable: false,
|
|
79
|
+
metadata: { name, port: info.port, status: info.status },
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
const link = serviceLink(name);
|
|
83
|
+
const content = info.status === "listening"
|
|
84
|
+
? `${name} is running on port ${info.port} — the user sees it live next to the chat.${citeLinkNote(link)}`
|
|
85
|
+
: `${name} started but is not listening on port ${info.port} yet (still starting after ${START_WAIT_MS / 1000} s). ` +
|
|
86
|
+
`Check it with list_services / service_logs. Its output so far:\n${await logTail(env, name)}${citeLinkNote(link)}`;
|
|
87
|
+
return { content, link, metadata: { name, port: info.port, status: info.status } };
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
/** stop_service — stop a running service. */
|
|
92
|
+
export class StopServiceTool {
|
|
93
|
+
name = "tool:stop-service";
|
|
94
|
+
version = "1.0.0";
|
|
95
|
+
definition = {
|
|
96
|
+
name: "stop_service",
|
|
97
|
+
description: "Stop one of your running services (see list_services). Its preview stops working.",
|
|
98
|
+
parameters: {
|
|
99
|
+
type: "object",
|
|
100
|
+
properties: { name: { type: "string", description: "The service's name" } },
|
|
101
|
+
required: ["name"],
|
|
102
|
+
},
|
|
103
|
+
risk: "draft",
|
|
104
|
+
sandboxOperation: "exec",
|
|
105
|
+
};
|
|
106
|
+
async execute(args, context) {
|
|
107
|
+
const name = stringArg(args, "name")?.trim();
|
|
108
|
+
if (!name)
|
|
109
|
+
return argError("stop_service", '"name" is required');
|
|
110
|
+
return withSandbox("stop_service", context, async (env) => {
|
|
111
|
+
if (!env.stopService)
|
|
112
|
+
return noServices("stop_service");
|
|
113
|
+
const stopped = await env.stopService(name, { signal: context.signal });
|
|
114
|
+
if (!stopped)
|
|
115
|
+
return argError("stop_service", `there is no service named "${name}" — see list_services`);
|
|
116
|
+
return { content: `Stopped ${name}.`, metadata: { name, status: stopped.status } };
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
/** list_services — the agent's services and their state. */
|
|
121
|
+
export class ListServicesTool {
|
|
122
|
+
name = "tool:list-services";
|
|
123
|
+
version = "1.0.0";
|
|
124
|
+
definition = {
|
|
125
|
+
name: "list_services",
|
|
126
|
+
description: "List your services (started with start_service): name, state (starting, listening, exited), port and command.",
|
|
127
|
+
parameters: { type: "object", properties: {}, required: [] },
|
|
128
|
+
risk: "read-only",
|
|
129
|
+
sandboxOperation: "fs.read",
|
|
130
|
+
};
|
|
131
|
+
async execute(_args, context) {
|
|
132
|
+
return withSandbox("list_services", context, async (env) => {
|
|
133
|
+
if (!env.listServices)
|
|
134
|
+
return noServices("list_services");
|
|
135
|
+
const services = await env.listServices({ signal: context.signal });
|
|
136
|
+
if (services.length === 0)
|
|
137
|
+
return { content: "No services. Start one with start_service.", metadata: { count: 0 } };
|
|
138
|
+
return {
|
|
139
|
+
content: `${services.length} service${services.length === 1 ? "" : "s"}:\n${services.map(describe).join("\n")}`,
|
|
140
|
+
metadata: { count: services.length, services: services.map((s) => ({ name: s.name, status: s.status, port: s.port })) },
|
|
141
|
+
};
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
/** service_logs — the end of a service's output. */
|
|
146
|
+
export class ServiceLogsTool {
|
|
147
|
+
name = "tool:service-logs";
|
|
148
|
+
version = "1.0.0";
|
|
149
|
+
definition = {
|
|
150
|
+
name: "service_logs",
|
|
151
|
+
description: "Read the end of a service's output (stdout and stderr) — to see why it fails or what it printed.",
|
|
152
|
+
parameters: {
|
|
153
|
+
type: "object",
|
|
154
|
+
properties: {
|
|
155
|
+
name: { type: "string", description: "The service's name" },
|
|
156
|
+
max_bytes: { type: "number", description: "How much of the end to return (default 8000)" },
|
|
157
|
+
},
|
|
158
|
+
required: ["name"],
|
|
159
|
+
},
|
|
160
|
+
risk: "read-only",
|
|
161
|
+
sandboxOperation: "fs.read",
|
|
162
|
+
};
|
|
163
|
+
async execute(args, context) {
|
|
164
|
+
const name = stringArg(args, "name")?.trim();
|
|
165
|
+
if (!name)
|
|
166
|
+
return argError("service_logs", '"name" is required');
|
|
167
|
+
const maxBytes = numberArg(args, "max_bytes");
|
|
168
|
+
return withSandbox("service_logs", context, async (env) => {
|
|
169
|
+
if (!env.serviceLogs)
|
|
170
|
+
return noServices("service_logs");
|
|
171
|
+
const logs = await env.serviceLogs(name, { maxBytes: maxBytes && maxBytes > 0 ? Math.floor(maxBytes) : 8_000, signal: context.signal });
|
|
172
|
+
const text = logs.text.trimEnd();
|
|
173
|
+
return {
|
|
174
|
+
content: text ? `${logs.truncated ? "…" : ""}${text}` : `${name} printed nothing yet.`,
|
|
175
|
+
metadata: { name, truncated: logs.truncated },
|
|
176
|
+
};
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
//# sourceMappingURL=service-tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service-tools.js","sourceRoot":"","sources":["../../../../../src/components/tool-hub/built-in-tools/preview/service-tools.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAEhG,yFAAyF;AACzF,yFAAyF;AACzF,gFAAgF;AAChF,kFAAkF;AAElF,mEAAmE;AAC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CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;YACxI,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;YACjC,OAAO;gBACL,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC,CAAC,GAAG,IAAI,uBAAuB;gBACtF,QAAQ,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE;aAC9C,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ToolHandler } from "../../types.js";
|
|
2
|
+
/** Tool names of the secret tools (A-101), for agent allowlists. */
|
|
3
|
+
export declare const SECRET_TOOL_NAMES: readonly ["list_secrets", "manage_secret"];
|
|
4
|
+
/** Both secret tools — register them with `core.useTool()`. http_request is a web tool (HttpRequestTool). */
|
|
5
|
+
export declare function createSecretTools(): ToolHandler[];
|
|
6
|
+
//# sourceMappingURL=create-secret-tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-secret-tools.d.ts","sourceRoot":"","sources":["../../../../../src/components/tool-hub/built-in-tools/secrets/create-secret-tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAIlD,oEAAoE;AACpE,eAAO,MAAM,iBAAiB,YAAI,cAAc,EAAE,eAAe,CAAU,CAAC;AAE5E,6GAA6G;AAC7G,wBAAgB,iBAAiB,IAAI,WAAW,EAAE,CAEjD"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ListSecretsTool } from "./list-secrets-tool.js";
|
|
2
|
+
import { ManageSecretTool } from "./manage-secret-tool.js";
|
|
3
|
+
/** Tool names of the secret tools (A-101), for agent allowlists. */
|
|
4
|
+
export const SECRET_TOOL_NAMES = ["list_secrets", "manage_secret"];
|
|
5
|
+
/** Both secret tools — register them with `core.useTool()`. http_request is a web tool (HttpRequestTool). */
|
|
6
|
+
export function createSecretTools() {
|
|
7
|
+
return [new ListSecretsTool(), new ManageSecretTool()];
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=create-secret-tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-secret-tools.js","sourceRoot":"","sources":["../../../../../src/components/tool-hub/built-in-tools/secrets/create-secret-tools.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D,oEAAoE;AACpE,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,cAAc,EAAE,eAAe,CAAU,CAAC;AAE5E,6GAA6G;AAC7G,MAAM,UAAU,iBAAiB;IAC/B,OAAO,CAAC,IAAI,eAAe,EAAE,EAAE,IAAI,gBAAgB,EAAE,CAAC,CAAC;AACzD,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ToolContext, ToolDefinition, ToolHandler, ToolOutput } from "../../types.js";
|
|
2
|
+
/**
|
|
3
|
+
* list_secrets (A-101) — read-only. The secrets this agent can use: its own and the global
|
|
4
|
+
* ones it enabled, with what each is for and where it may be used. Never values.
|
|
5
|
+
*/
|
|
6
|
+
export declare class ListSecretsTool implements ToolHandler {
|
|
7
|
+
readonly name = "tool:list-secrets";
|
|
8
|
+
readonly version = "1.0.0";
|
|
9
|
+
readonly definition: ToolDefinition;
|
|
10
|
+
execute(_args: Record<string, unknown>, context: ToolContext): Promise<ToolOutput>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=list-secrets-tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-secrets-tool.d.ts","sourceRoot":"","sources":["../../../../../src/components/tool-hub/built-in-tools/secrets/list-secrets-tool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAG3F;;;GAGG;AACH,qBAAa,eAAgB,YAAW,WAAW;IACjD,QAAQ,CAAC,IAAI,uBAAuB;IACpC,QAAQ,CAAC,OAAO,WAAW;IAC3B,QAAQ,CAAC,UAAU,EAAE,cAAc,CAOjC;IAEI,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,CASvF;CACF"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { describeSecret, secretToolError } from "./secret-tool-helpers.js";
|
|
2
|
+
/**
|
|
3
|
+
* list_secrets (A-101) — read-only. The secrets this agent can use: its own and the global
|
|
4
|
+
* ones it enabled, with what each is for and where it may be used. Never values.
|
|
5
|
+
*/
|
|
6
|
+
export class ListSecretsTool {
|
|
7
|
+
name = "tool:list-secrets";
|
|
8
|
+
version = "1.0.0";
|
|
9
|
+
definition = {
|
|
10
|
+
name: "list_secrets",
|
|
11
|
+
description: "List the secrets (API keys, tokens) you can use: name, what it is for, which tools may use it and which hosts it may be sent to. " +
|
|
12
|
+
"Values are never shown — use a secret with {{secret:NAME}} in http_request, or `secrets` in terminal / run_code.",
|
|
13
|
+
parameters: { type: "object", properties: {} },
|
|
14
|
+
risk: "read-only",
|
|
15
|
+
};
|
|
16
|
+
async execute(_args, context) {
|
|
17
|
+
if (!context.secrets)
|
|
18
|
+
return { content: "list_secrets: this agent has no secret store.", isError: true, retryable: false };
|
|
19
|
+
try {
|
|
20
|
+
const secrets = await context.secrets.list();
|
|
21
|
+
if (!secrets.length)
|
|
22
|
+
return { content: "You have no secrets yet." };
|
|
23
|
+
return { content: secrets.map((s) => `- ${describeSecret(s)}`).join("\n") };
|
|
24
|
+
}
|
|
25
|
+
catch (err) {
|
|
26
|
+
return secretToolError("list_secrets", err);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=list-secrets-tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-secrets-tool.js","sourceRoot":"","sources":["../../../../../src/components/tool-hub/built-in-tools/secrets/list-secrets-tool.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3E;;;GAGG;AACH,MAAM,OAAO,eAAe;IACjB,IAAI,GAAG,mBAAmB,CAAC;IAC3B,OAAO,GAAG,OAAO,CAAC;IAClB,UAAU,GAAmB;QACpC,IAAI,EAAE,cAAc;QACpB,WAAW,EACT,mIAAmI;YACnI,kHAAkH;QACpH,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,EAAE;QAC9C,IAAI,EAAE,WAAW;KAClB,CAAC;IAEF,KAAK,CAAC,OAAO,CAAC,KAA8B,EAAE,OAAoB;QAChE,IAAI,CAAC,OAAO,CAAC,OAAO;YAAE,OAAO,EAAE,OAAO,EAAE,+CAA+C,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;QAC3H,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;YAC7C,IAAI,CAAC,OAAO,CAAC,MAAM;gBAAE,OAAO,EAAE,OAAO,EAAE,0BAA0B,EAAE,CAAC;YACpE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QAC9E,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,eAAe,CAAC,cAAc,EAAE,GAAG,CAAC,CAAC;QAC9C,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ToolContext, ToolDefinition, ToolHandler, ToolOutput } from "../../types.js";
|
|
2
|
+
/**
|
|
3
|
+
* manage_secret (A-101) — creates, changes and deletes this agent's own secrets.
|
|
4
|
+
*
|
|
5
|
+
* The model never handles a value: "create" and "set_value" ask the user to type it into a
|
|
6
|
+
* masked field (InteractionHandler.requestSecret), and it goes from there straight to the
|
|
7
|
+
* SecretHub. The result only says what was stored. A chat app or an unattended run can't
|
|
8
|
+
* take a value, so those actions fail there.
|
|
9
|
+
*
|
|
10
|
+
* Risk "consequential": every call waits for the user's approval (they see the name, the
|
|
11
|
+
* allowed hosts and tools). Global secrets are managed by people only (the host's UI/API).
|
|
12
|
+
* Subagents never get this tool.
|
|
13
|
+
*/
|
|
14
|
+
export declare class ManageSecretTool implements ToolHandler {
|
|
15
|
+
readonly name = "tool:manage-secret";
|
|
16
|
+
readonly version = "1.0.0";
|
|
17
|
+
readonly definition: ToolDefinition;
|
|
18
|
+
execute(args: Record<string, unknown>, context: ToolContext): Promise<ToolOutput>;
|
|
19
|
+
/** The value the user typed into the masked field, or undefined when they cancelled. */
|
|
20
|
+
private askValue;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=manage-secret-tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manage-secret-tool.d.ts","sourceRoot":"","sources":["../../../../../src/components/tool-hub/built-in-tools/secrets/manage-secret-tool.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAM3F;;;;;;;;;;;GAWG;AACH,qBAAa,gBAAiB,YAAW,WAAW;IAClD,QAAQ,CAAC,IAAI,wBAAwB;IACrC,QAAQ,CAAC,OAAO,WAAW;IAC3B,QAAQ,CAAC,UAAU,EAAE,cAAc,CAmBjC;IAEI,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,CAyCtF;IAED,wFAAwF;YAC1E,QAAQ;CAyBvB"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { SecretError } from "../../../../kernel/errors/secret-error.js";
|
|
2
|
+
import { checkSecretName, normalizeDefinition } from "../../../secret-hub/rules.js";
|
|
3
|
+
import { raceAbort } from "../../../multi-agent-orchestration/agent/agent-loop/components/abort.js";
|
|
4
|
+
import { describeSecret, secretToolError, stringList } from "./secret-tool-helpers.js";
|
|
5
|
+
const ACTIONS = ["create", "update", "set_value", "delete"];
|
|
6
|
+
/**
|
|
7
|
+
* manage_secret (A-101) — creates, changes and deletes this agent's own secrets.
|
|
8
|
+
*
|
|
9
|
+
* The model never handles a value: "create" and "set_value" ask the user to type it into a
|
|
10
|
+
* masked field (InteractionHandler.requestSecret), and it goes from there straight to the
|
|
11
|
+
* SecretHub. The result only says what was stored. A chat app or an unattended run can't
|
|
12
|
+
* take a value, so those actions fail there.
|
|
13
|
+
*
|
|
14
|
+
* Risk "consequential": every call waits for the user's approval (they see the name, the
|
|
15
|
+
* allowed hosts and tools). Global secrets are managed by people only (the host's UI/API).
|
|
16
|
+
* Subagents never get this tool.
|
|
17
|
+
*/
|
|
18
|
+
export class ManageSecretTool {
|
|
19
|
+
name = "tool:manage-secret";
|
|
20
|
+
version = "1.0.0";
|
|
21
|
+
definition = {
|
|
22
|
+
name: "manage_secret",
|
|
23
|
+
description: "Create, change or delete one of your secrets (an API key or token the user wants you to use). " +
|
|
24
|
+
"create / set_value: the user types the value into a masked field — never ask for it in the chat and never put a value in these arguments. " +
|
|
25
|
+
"Set allowed_hosts to the API host(s) the key is for (e.g. api.example.com, or *.example.com); a secret with no hosts can't be sent anywhere. " +
|
|
26
|
+
"allowed_tools defaults to http_request; add terminal or run_code only when a command needs the key as an environment variable.",
|
|
27
|
+
parameters: {
|
|
28
|
+
type: "object",
|
|
29
|
+
properties: {
|
|
30
|
+
action: { type: "string", enum: [...ACTIONS], description: "create, update (description/hosts/tools), set_value (a new value), delete" },
|
|
31
|
+
name: { type: "string", description: "Upper-case name, e.g. OPENWEATHER_API_KEY — what you write in {{secret:NAME}}" },
|
|
32
|
+
description: { type: "string", description: "What the key is for (create/update)" },
|
|
33
|
+
allowed_hosts: { type: "array", items: { type: "string" }, description: "Hosts it may be sent to (create/update)" },
|
|
34
|
+
allowed_tools: { type: "array", items: { type: "string" }, description: 'Tools that may use it (create/update), default ["http_request"]' },
|
|
35
|
+
},
|
|
36
|
+
required: ["action", "name"],
|
|
37
|
+
},
|
|
38
|
+
risk: "consequential",
|
|
39
|
+
};
|
|
40
|
+
async execute(args, context) {
|
|
41
|
+
const secrets = context.secrets;
|
|
42
|
+
if (!secrets)
|
|
43
|
+
return { content: "manage_secret: this agent has no secret store.", isError: true, retryable: false };
|
|
44
|
+
const action = args["action"];
|
|
45
|
+
if (!ACTIONS.includes(action))
|
|
46
|
+
return { content: `manage_secret: action must be one of ${ACTIONS.join(", ")}`, isError: true, retryable: false };
|
|
47
|
+
try {
|
|
48
|
+
const name = checkSecretName(args["name"]);
|
|
49
|
+
const definition = {
|
|
50
|
+
...(typeof args["description"] === "string" ? { description: args["description"] } : {}),
|
|
51
|
+
...(stringList(args, "allowed_hosts") ? { allowedHosts: stringList(args, "allowed_hosts") } : {}),
|
|
52
|
+
...(stringList(args, "allowed_tools") ? { allowedTools: stringList(args, "allowed_tools") } : {}),
|
|
53
|
+
};
|
|
54
|
+
const own = (await secrets.list()).find((s) => s.name === name && s.scope === "agent");
|
|
55
|
+
switch (action) {
|
|
56
|
+
case "create": {
|
|
57
|
+
if (own)
|
|
58
|
+
throw new SecretError(`you already have a secret named ${name} — use set_value to give it a new value`, "already_exists");
|
|
59
|
+
const meta = normalizeDefinition(definition);
|
|
60
|
+
const value = await this.askValue(context, { name, ...meta });
|
|
61
|
+
if (value === undefined)
|
|
62
|
+
return { content: `The user cancelled — secret ${name} was not created.`, retryable: false };
|
|
63
|
+
const created = await secrets.create({ name, ...meta }, value);
|
|
64
|
+
return { content: `Stored secret ${describeSecret(created)}. Use it as {{secret:${name}}}.` };
|
|
65
|
+
}
|
|
66
|
+
case "update": {
|
|
67
|
+
if (!own)
|
|
68
|
+
throw new SecretError(`you have no secret named ${name}`, "not_found");
|
|
69
|
+
return { content: `Updated secret ${describeSecret(await secrets.update(name, definition))}.` };
|
|
70
|
+
}
|
|
71
|
+
case "set_value": {
|
|
72
|
+
if (!own)
|
|
73
|
+
throw new SecretError(`you have no secret named ${name}`, "not_found");
|
|
74
|
+
const value = await this.askValue(context, { ...own, replacing: true });
|
|
75
|
+
if (value === undefined)
|
|
76
|
+
return { content: `The user cancelled — secret ${name} keeps its value.`, retryable: false };
|
|
77
|
+
return { content: `Secret ${describeSecret(await secrets.setValue(name, value))} has a new value.` };
|
|
78
|
+
}
|
|
79
|
+
case "delete": {
|
|
80
|
+
if (!own)
|
|
81
|
+
throw new SecretError(`you have no secret named ${name}`, "not_found");
|
|
82
|
+
await secrets.delete(name);
|
|
83
|
+
return { content: `Deleted secret ${name}.` };
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
catch (err) {
|
|
88
|
+
return secretToolError("manage_secret", err);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
/** The value the user typed into the masked field, or undefined when they cancelled. */
|
|
92
|
+
async askValue(context, secret) {
|
|
93
|
+
const handler = context.interaction;
|
|
94
|
+
if (!handler?.requestSecret) {
|
|
95
|
+
throw new SecretError("no one can enter a secret value here — ask the user to add it in the web app (Capabilities → Secrets)", "unavailable");
|
|
96
|
+
}
|
|
97
|
+
const outcome = await raceAbort(handler.requestSecret({
|
|
98
|
+
sessionId: context.sessionId,
|
|
99
|
+
...(context.agentId ? { agentId: context.agentId } : {}),
|
|
100
|
+
...(context.toolCallId ? { toolCallId: context.toolCallId } : {}),
|
|
101
|
+
name: secret.name,
|
|
102
|
+
...(secret.description ? { description: secret.description } : {}),
|
|
103
|
+
allowedHosts: secret.allowedHosts,
|
|
104
|
+
allowedTools: secret.allowedTools,
|
|
105
|
+
...(secret.replacing ? { replacing: true } : {}),
|
|
106
|
+
}), context.signal);
|
|
107
|
+
if (outcome.aborted)
|
|
108
|
+
return undefined;
|
|
109
|
+
const value = outcome.value.value;
|
|
110
|
+
return typeof value === "string" && value.length ? value : undefined;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=manage-secret-tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manage-secret-tool.js","sourceRoot":"","sources":["../../../../../src/components/tool-hub/built-in-tools/secrets/manage-secret-tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACpF,OAAO,EAAE,SAAS,EAAE,MAAM,yEAAyE,CAAC;AAEpG,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEvF,MAAM,OAAO,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,CAAU,CAAC;AAGrE;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,gBAAgB;IAClB,IAAI,GAAG,oBAAoB,CAAC;IAC5B,OAAO,GAAG,OAAO,CAAC;IAClB,UAAU,GAAmB;QACpC,IAAI,EAAE,eAAe;QACrB,WAAW,EACT,gGAAgG;YAChG,4IAA4I;YAC5I,+IAA+I;YAC/I,gIAAgI;QAClI,UAAU,EAAE;YACV,IAAI,EAAE,QAAQ;YACd,UAAU,EA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,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;IACvE,CAAC;CACF"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { AgentSecretInfo } from "../../../multi-agent-orchestration/agent/secret-manager/types.js";
|
|
2
|
+
import type { ToolOutput } from "../../types.js";
|
|
3
|
+
/** One secret as the model sees it — metadata only. */
|
|
4
|
+
export declare function describeSecret(s: AgentSecretInfo): string;
|
|
5
|
+
/** A failed secret operation as a tool error. SecretErrors are never retried (the same call fails again). */
|
|
6
|
+
export declare function secretToolError(tool: string, err: unknown): ToolOutput;
|
|
7
|
+
/** A string list argument, trimmed; undefined when absent. Throws on a wrong type. */
|
|
8
|
+
export declare function stringList(args: Record<string, unknown>, key: string): string[] | undefined;
|
|
9
|
+
//# sourceMappingURL=secret-tool-helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secret-tool-helpers.d.ts","sourceRoot":"","sources":["../../../../../src/components/tool-hub/built-in-tools/secrets/secret-tool-helpers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kEAAkE,CAAC;AACxG,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD,uDAAuD;AACvD,wBAAgB,cAAc,CAAC,CAAC,EAAE,eAAe,GAAG,MAAM,CASzD;AAED,6GAA6G;AAC7G,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,GAAG,UAAU,CAGtE;AAED,sFAAsF;AACtF,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAO3F"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { SecretError } from "../../../../kernel/errors/secret-error.js";
|
|
2
|
+
/** One secret as the model sees it — metadata only. */
|
|
3
|
+
export function describeSecret(s) {
|
|
4
|
+
const parts = [
|
|
5
|
+
`${s.name} (${s.scope === "agent" ? "yours" : "global"})`,
|
|
6
|
+
...(s.description ? [s.description] : []),
|
|
7
|
+
`tools: ${s.allowedTools.join(", ") || "none"}`,
|
|
8
|
+
`hosts: ${s.allowedHosts.join(", ") || "none"}`,
|
|
9
|
+
s.lastUsedAt ? `last used ${s.lastUsedAt}` : "never used",
|
|
10
|
+
];
|
|
11
|
+
return parts.join(" · ");
|
|
12
|
+
}
|
|
13
|
+
/** A failed secret operation as a tool error. SecretErrors are never retried (the same call fails again). */
|
|
14
|
+
export function secretToolError(tool, err) {
|
|
15
|
+
if (err instanceof SecretError)
|
|
16
|
+
return { content: `${tool}: ${err.message}`, isError: true, retryable: false };
|
|
17
|
+
return { content: `${tool}: ${err instanceof Error ? err.message : String(err)}`, isError: true };
|
|
18
|
+
}
|
|
19
|
+
/** A string list argument, trimmed; undefined when absent. Throws on a wrong type. */
|
|
20
|
+
export function stringList(args, key) {
|
|
21
|
+
const v = args[key];
|
|
22
|
+
if (v === undefined || v === null)
|
|
23
|
+
return undefined;
|
|
24
|
+
if (!Array.isArray(v) || v.some((x) => typeof x !== "string")) {
|
|
25
|
+
throw new SecretError(`"${key}" must be a list of strings`, "invalid_argument");
|
|
26
|
+
}
|
|
27
|
+
return v.map((x) => x.trim()).filter(Boolean);
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=secret-tool-helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secret-tool-helpers.js","sourceRoot":"","sources":["../../../../../src/components/tool-hub/built-in-tools/secrets/secret-tool-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AAIxE,uDAAuD;AACvD,MAAM,UAAU,cAAc,CAAC,CAAkB;IAC/C,MAAM,KAAK,GAAG;QACZ,GAAG,CAAC,CAAC,IAAI,KAAK,CAAC,CA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AC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC,EAAE,CAAC;QAC9D,MAAM,IAAI,WAAW,CAAC,IAAI,GAAG,6BAA6B,EAAE,kBAAkB,CAAC,CAAC;IAClF,CAAC;IACD,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AACxD,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ToolContext, ToolDefinition, ToolHandler, ToolOutput } from "../../types.js";
|
|
2
|
+
/** Tool name of spawn_subagent, for agent allowlists. */
|
|
3
|
+
export declare const SPAWN_SUBAGENT_TOOL_NAME = "spawn_subagent";
|
|
4
|
+
/**
|
|
5
|
+
* spawn_subagent (A-105) — hands a bounded task to one of the agent's subagents (another
|
|
6
|
+
* agent profile on its allowlist, AgentProfile.subagents) and waits for the child's final
|
|
7
|
+
* report. Design revision: the target is a subagent type from the library (a specialist
|
|
8
|
+
* that runs inside this agent, with its tools and sandbox) or an allowed existing agent. The child starts in a fresh session of its own: it sees only this brief, never
|
|
9
|
+
* this conversation, and its report comes back as untrusted data for this agent to check
|
|
10
|
+
* and use in its own reply. It is not a hand-off — the child never talks to the user.
|
|
11
|
+
*
|
|
12
|
+
* Several calls in one model response run in parallel (up to the agent's maxConcurrent);
|
|
13
|
+
* every child of a turn shares that turn's budget (runs, tokens, tool calls, time).
|
|
14
|
+
*
|
|
15
|
+
* Risk "consequential": a child spends tokens and acts with its own tools, so every call
|
|
16
|
+
* waits for the user's approval. The child's own approval-gated tools ask the user too —
|
|
17
|
+
* the parent's approval is never a grant for the child.
|
|
18
|
+
*
|
|
19
|
+
* Errors are never retried by the harness: a retry would start another child.
|
|
20
|
+
*/
|
|
21
|
+
export declare class SpawnSubagentTool implements ToolHandler {
|
|
22
|
+
readonly name = "tool:spawn-subagent";
|
|
23
|
+
readonly version = "1.0.0";
|
|
24
|
+
readonly definition: ToolDefinition;
|
|
25
|
+
execute(args: Record<string, unknown>, context: ToolContext): Promise<ToolOutput>;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=spawn-subagent-tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spawn-subagent-tool.d.ts","sourceRoot":"","sources":["../../../../../src/components/tool-hub/built-in-tools/subagents/spawn-subagent-tool.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE3F,yDAAyD;AACzD,eAAO,MAAM,wBAAwB,mBAAmB,CAAC;AAEzD;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,iBAAkB,YAAW,WAAW;IACnD,QAAQ,CAAC,IAAI,yBAAyB;IACtC,QAAQ,CAAC,OAAO,WAAW;IAC3B,QAAQ,CAAC,UAAU,EAAE,cAAc,CAkCjC;IAEI,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,CAgDtF;CACF"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { SubagentError } from "../../../../kernel/errors/subagent-error.js";
|
|
2
|
+
import { describeResult } from "../../../multi-agent-orchestration/agent/subagent-manager/brief.js";
|
|
3
|
+
import { SUBAGENT_BRIEF_LIMITS } from "../../../multi-agent-orchestration/agent/subagent-manager/types.js";
|
|
4
|
+
/** Tool name of spawn_subagent, for agent allowlists. */
|
|
5
|
+
export const SPAWN_SUBAGENT_TOOL_NAME = "spawn_subagent";
|
|
6
|
+
/**
|
|
7
|
+
* spawn_subagent (A-105) — hands a bounded task to one of the agent's subagents (another
|
|
8
|
+
* agent profile on its allowlist, AgentProfile.subagents) and waits for the child's final
|
|
9
|
+
* report. Design revision: the target is a subagent type from the library (a specialist
|
|
10
|
+
* that runs inside this agent, with its tools and sandbox) or an allowed existing agent. The child starts in a fresh session of its own: it sees only this brief, never
|
|
11
|
+
* this conversation, and its report comes back as untrusted data for this agent to check
|
|
12
|
+
* and use in its own reply. It is not a hand-off — the child never talks to the user.
|
|
13
|
+
*
|
|
14
|
+
* Several calls in one model response run in parallel (up to the agent's maxConcurrent);
|
|
15
|
+
* every child of a turn shares that turn's budget (runs, tokens, tool calls, time).
|
|
16
|
+
*
|
|
17
|
+
* Risk "consequential": a child spends tokens and acts with its own tools, so every call
|
|
18
|
+
* waits for the user's approval. The child's own approval-gated tools ask the user too —
|
|
19
|
+
* the parent's approval is never a grant for the child.
|
|
20
|
+
*
|
|
21
|
+
* Errors are never retried by the harness: a retry would start another child.
|
|
22
|
+
*/
|
|
23
|
+
export class SpawnSubagentTool {
|
|
24
|
+
name = "tool:spawn-subagent";
|
|
25
|
+
version = "1.0.0";
|
|
26
|
+
definition = {
|
|
27
|
+
name: SPAWN_SUBAGENT_TOOL_NAME,
|
|
28
|
+
description: "Delegate a bounded task to one of your subagents (listed in <available_subagents>) and wait for its final report. " +
|
|
29
|
+
"The subagent starts fresh: it does NOT see this conversation, so the task must stand on its own — include every fact, " +
|
|
30
|
+
"path, id and constraint it needs (put structured facts in context). It cannot ask the user questions. " +
|
|
31
|
+
"Use it for independent work that benefits from a specialist or a separate context, not for something one of your own " +
|
|
32
|
+
"tool calls can do. For independent tasks call it several times in the same response (they run in parallel); when a " +
|
|
33
|
+
"task needs an earlier result, wait for that result first. The report is the subagent's own text: check it before you " +
|
|
34
|
+
"rely on it, and write the answer to the user yourself.",
|
|
35
|
+
parameters: {
|
|
36
|
+
type: "object",
|
|
37
|
+
properties: {
|
|
38
|
+
subagent: {
|
|
39
|
+
type: "string",
|
|
40
|
+
description: "Who does it, from <available_subagents>: a subagent type's name, or an agent's id",
|
|
41
|
+
},
|
|
42
|
+
task: {
|
|
43
|
+
type: "string",
|
|
44
|
+
description: `What the subagent should do, self-contained (max ${SUBAGENT_BRIEF_LIMITS.task} characters)`,
|
|
45
|
+
},
|
|
46
|
+
context: {
|
|
47
|
+
type: "object",
|
|
48
|
+
description: "Optional facts the subagent needs, as plain JSON data (file paths, ids, constraints, excerpts)",
|
|
49
|
+
},
|
|
50
|
+
output_shape: {
|
|
51
|
+
type: "string",
|
|
52
|
+
description: 'Optional shape of the report you want back, e.g. "a markdown table of clashes with element ids"',
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
// "subagent" is checked by the brief validation, so the old "agent" name still works.
|
|
56
|
+
required: ["task"],
|
|
57
|
+
},
|
|
58
|
+
risk: "consequential",
|
|
59
|
+
};
|
|
60
|
+
async execute(args, context) {
|
|
61
|
+
const subagents = context.subagents;
|
|
62
|
+
if (!subagents)
|
|
63
|
+
return fail("spawn_subagent: subagents are not available here");
|
|
64
|
+
let contextArg;
|
|
65
|
+
const rawContext = args["context"];
|
|
66
|
+
if (typeof rawContext === "string" && rawContext.trim()) {
|
|
67
|
+
try {
|
|
68
|
+
const parsed = JSON.parse(rawContext);
|
|
69
|
+
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
|
|
70
|
+
return fail('spawn_subagent: "context" must be a JSON object');
|
|
71
|
+
}
|
|
72
|
+
contextArg = parsed;
|
|
73
|
+
}
|
|
74
|
+
catch {
|
|
75
|
+
return fail('spawn_subagent: "context" must be a JSON object');
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
else if (typeof rawContext === "object" && rawContext !== null && !Array.isArray(rawContext)) {
|
|
79
|
+
contextArg = rawContext;
|
|
80
|
+
}
|
|
81
|
+
try {
|
|
82
|
+
const run = await subagents.spawn({
|
|
83
|
+
// "agent" was the parameter's name before subagent types (A-105 revision).
|
|
84
|
+
agentId: typeof args["subagent"] === "string" && args["subagent"].trim() ? args["subagent"] : typeof args["agent"] === "string" ? args["agent"] : "",
|
|
85
|
+
task: typeof args["task"] === "string" ? args["task"] : "",
|
|
86
|
+
...(contextArg ? { context: contextArg } : {}),
|
|
87
|
+
...(typeof args["output_shape"] === "string" && args["output_shape"].trim() ? { outputShape: args["output_shape"] } : {}),
|
|
88
|
+
}, {
|
|
89
|
+
sessionId: context.sessionId,
|
|
90
|
+
...(context.runId ? { runId: context.runId } : {}),
|
|
91
|
+
...(context.toolCallId ? { toolCallId: context.toolCallId } : {}),
|
|
92
|
+
...(context.signal ? { signal: context.signal } : {}),
|
|
93
|
+
...(context.interaction ? { interaction: context.interaction } : {}),
|
|
94
|
+
});
|
|
95
|
+
const ok = run.status === "completed" || run.status === "partial";
|
|
96
|
+
return {
|
|
97
|
+
content: describeResult(run),
|
|
98
|
+
...(ok ? {} : { isError: true }),
|
|
99
|
+
retryable: false,
|
|
100
|
+
metadata: { subagentRun: run },
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
catch (err) {
|
|
104
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
105
|
+
return fail(err instanceof SubagentError ? `spawn_subagent refused: ${message}` : `spawn_subagent failed: ${message}`);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
function fail(content) {
|
|
110
|
+
return { content, isError: true, retryable: false };
|
|
111
|
+
}
|
|
112
|
+
//# sourceMappingURL=spawn-subagent-tool.js.map
|