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,157 @@
|
|
|
1
|
+
import { createHmac, randomBytes, timingSafeEqual } from "node:crypto";
|
|
2
|
+
import { readPath, toRevision, toSubject } from "./rules.js";
|
|
3
|
+
// ---------------------------------------------------------------------------
|
|
4
|
+
// Webhook deliveries for triggers (A-70): the signing secret, signature checks
|
|
5
|
+
// on the raw bytes, and turning a delivery into an event envelope.
|
|
6
|
+
// Update (A-126): for webhook jobs (a trigger is now a job with `when.kind: "webhook"`).
|
|
7
|
+
//
|
|
8
|
+
// - "standard" — Standard Webhooks (standardwebhooks.com): webhook-id,
|
|
9
|
+
// webhook-timestamp and webhook-signature ("v1,<base64>", space separated);
|
|
10
|
+
// HMAC-SHA256 over "<id>.<timestamp>.<body>" with the base64-decoded secret;
|
|
11
|
+
// the timestamp must be within 5 minutes, so a captured request cannot be
|
|
12
|
+
// replayed later.
|
|
13
|
+
// - "github" — X-Hub-Signature-256 ("sha256=<hex>"), HMAC-SHA256 over the body
|
|
14
|
+
// with the secret's text. GitHub signs no timestamp, so none is enforced;
|
|
15
|
+
// X-GitHub-Delivery is the event id (a redelivery keeps it, so it dedupes),
|
|
16
|
+
// and X-GitHub-Event (+ the body's "action") is the type.
|
|
17
|
+
//
|
|
18
|
+
// Comparisons are constant-time. Nothing here throws for a bad request: the
|
|
19
|
+
// result says what is wrong, for a 4xx answer.
|
|
20
|
+
// ---------------------------------------------------------------------------
|
|
21
|
+
/** A webhook signature older or newer than this is refused. */
|
|
22
|
+
export const WEBHOOK_TOLERANCE_MS = 5 * 60_000;
|
|
23
|
+
const SECRET_PREFIX = "whsec_";
|
|
24
|
+
/** A fresh signing secret: "whsec_" + 32 random bytes in base64. */
|
|
25
|
+
export function generateWebhookSecret() {
|
|
26
|
+
return SECRET_PREFIX + randomBytes(32).toString("base64");
|
|
27
|
+
}
|
|
28
|
+
/** Sign a Standard Webhooks delivery — what a sender does (tests, the docs' example). */
|
|
29
|
+
export function signStandardWebhook(secret, id, timestamp, body) {
|
|
30
|
+
const mac = createHmac("sha256", standardKey(secret))
|
|
31
|
+
.update(`${id}.${timestamp}.`)
|
|
32
|
+
.update(toBytes(body))
|
|
33
|
+
.digest("base64");
|
|
34
|
+
return `v1,${mac}`;
|
|
35
|
+
}
|
|
36
|
+
/** Sign a GitHub-style delivery: the X-Hub-Signature-256 value. */
|
|
37
|
+
export function signGithubWebhook(secret, body) {
|
|
38
|
+
return `sha256=${createHmac("sha256", Buffer.from(secret, "utf8")).update(toBytes(body)).digest("hex")}`;
|
|
39
|
+
}
|
|
40
|
+
/** Undefined when the signature is valid, otherwise why it is not. */
|
|
41
|
+
export function verifyWebhookSignature(scheme, secret, request, now) {
|
|
42
|
+
const body = toBytes(request.body);
|
|
43
|
+
if (scheme === "github") {
|
|
44
|
+
const header = request.headers["x-hub-signature-256"];
|
|
45
|
+
if (!header?.startsWith("sha256="))
|
|
46
|
+
return "missing X-Hub-Signature-256";
|
|
47
|
+
return safeEqual(header, signGithubWebhook(secret, body)) ? undefined : "the signature does not match";
|
|
48
|
+
}
|
|
49
|
+
const id = request.headers["webhook-id"];
|
|
50
|
+
const timestamp = request.headers["webhook-timestamp"];
|
|
51
|
+
const signatures = request.headers["webhook-signature"];
|
|
52
|
+
if (!id || !timestamp || !signatures)
|
|
53
|
+
return "missing webhook-id, webhook-timestamp or webhook-signature";
|
|
54
|
+
const seconds = Number(timestamp);
|
|
55
|
+
if (!Number.isInteger(seconds))
|
|
56
|
+
return "webhook-timestamp is not a number of seconds";
|
|
57
|
+
if (Math.abs(now - seconds * 1000) > WEBHOOK_TOLERANCE_MS)
|
|
58
|
+
return "webhook-timestamp is too old or in the future";
|
|
59
|
+
const expected = signStandardWebhook(secret, id, seconds, body);
|
|
60
|
+
const ok = signatures.split(" ").some((s) => s.startsWith("v1,") && safeEqual(s, expected));
|
|
61
|
+
return ok ? undefined : "the signature does not match";
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* The event a verified delivery carries, or an error message. A CloudEvents body
|
|
65
|
+
* (with "specversion") supplies id, source, type, subject, time and data; a
|
|
66
|
+
* Standard Webhooks body supplies type, timestamp and data; a GitHub delivery
|
|
67
|
+
* is its whole body.
|
|
68
|
+
*/
|
|
69
|
+
export function parseWebhookEvent(source, request) {
|
|
70
|
+
let body;
|
|
71
|
+
try {
|
|
72
|
+
body = JSON.parse(Buffer.from(toBytes(request.body)).toString("utf8"));
|
|
73
|
+
}
|
|
74
|
+
catch {
|
|
75
|
+
return { error: "the body is not JSON" };
|
|
76
|
+
}
|
|
77
|
+
if (typeof body !== "object" || body === null || Array.isArray(body))
|
|
78
|
+
return { error: "the body must be a JSON object" };
|
|
79
|
+
const b = body;
|
|
80
|
+
let envelope;
|
|
81
|
+
if (typeof b["specversion"] === "string") {
|
|
82
|
+
// CloudEvents (structured mode).
|
|
83
|
+
const id = str(b["id"]);
|
|
84
|
+
const type = str(b["type"]);
|
|
85
|
+
if (!id || !type)
|
|
86
|
+
return { error: "a CloudEvents body needs id and type" };
|
|
87
|
+
envelope = {
|
|
88
|
+
sourceEventId: id,
|
|
89
|
+
source: str(b["source"]) ?? "webhook",
|
|
90
|
+
type,
|
|
91
|
+
...(toSubject(b["subject"]) !== undefined ? { subject: toSubject(b["subject"]) } : {}),
|
|
92
|
+
...(isoTime(b["time"]) ? { time: isoTime(b["time"]) } : {}),
|
|
93
|
+
data: b["data"] ?? null,
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
else if (source.signature === "github") {
|
|
97
|
+
const id = request.headers["x-github-delivery"];
|
|
98
|
+
const event = request.headers["x-github-event"];
|
|
99
|
+
if (!id || !event)
|
|
100
|
+
return { error: "missing X-GitHub-Delivery or X-GitHub-Event" };
|
|
101
|
+
const action = str(b["action"]);
|
|
102
|
+
envelope = { sourceEventId: id, source: "github", type: action ? `${event}.${action}` : event, data: body };
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
const id = request.headers["webhook-id"];
|
|
106
|
+
const type = str(b["type"]);
|
|
107
|
+
if (!id)
|
|
108
|
+
return { error: "missing webhook-id" };
|
|
109
|
+
if (!type)
|
|
110
|
+
return { error: 'the body needs a "type"' };
|
|
111
|
+
envelope = {
|
|
112
|
+
sourceEventId: id,
|
|
113
|
+
source: "webhook",
|
|
114
|
+
type,
|
|
115
|
+
...(isoTime(b["timestamp"]) ? { time: isoTime(b["timestamp"]) } : {}),
|
|
116
|
+
data: b["data"] ?? body,
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
// The job's mapping picks the subject / revision when the body did not set one.
|
|
120
|
+
const view = { type: envelope.type, ...(envelope.subject !== undefined ? { subject: envelope.subject } : {}), source: envelope.source, data: envelope.data };
|
|
121
|
+
if (envelope.subject === undefined && source.subjectPath) {
|
|
122
|
+
const subject = toSubject(readPath(view, source.subjectPath));
|
|
123
|
+
if (subject !== undefined)
|
|
124
|
+
envelope.subject = subject;
|
|
125
|
+
}
|
|
126
|
+
if (source.revisionPath) {
|
|
127
|
+
const revision = toRevision(readPath(view, source.revisionPath));
|
|
128
|
+
if (revision !== undefined)
|
|
129
|
+
envelope.revision = revision;
|
|
130
|
+
}
|
|
131
|
+
if (envelope.sourceEventId.length > 200)
|
|
132
|
+
return { error: "the event id is longer than 200 characters" };
|
|
133
|
+
if (envelope.type.length > 200)
|
|
134
|
+
return { error: "the event type is longer than 200 characters" };
|
|
135
|
+
return envelope;
|
|
136
|
+
}
|
|
137
|
+
function standardKey(secret) {
|
|
138
|
+
return Buffer.from(secret.startsWith(SECRET_PREFIX) ? secret.slice(SECRET_PREFIX.length) : secret, "base64");
|
|
139
|
+
}
|
|
140
|
+
function toBytes(body) {
|
|
141
|
+
return typeof body === "string" ? Buffer.from(body, "utf8") : body;
|
|
142
|
+
}
|
|
143
|
+
function safeEqual(a, b) {
|
|
144
|
+
const x = Buffer.from(a, "utf8");
|
|
145
|
+
const y = Buffer.from(b, "utf8");
|
|
146
|
+
return x.length === y.length && timingSafeEqual(x, y);
|
|
147
|
+
}
|
|
148
|
+
function str(value) {
|
|
149
|
+
return typeof value === "string" && value.trim() !== "" ? value : undefined;
|
|
150
|
+
}
|
|
151
|
+
function isoTime(value) {
|
|
152
|
+
if (typeof value !== "string" && typeof value !== "number")
|
|
153
|
+
return undefined;
|
|
154
|
+
const ms = typeof value === "number" ? value * 1000 : Date.parse(value);
|
|
155
|
+
return Number.isFinite(ms) ? new Date(ms).toISOString() : undefined;
|
|
156
|
+
}
|
|
157
|
+
//# sourceMappingURL=webhook.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhook.js","sourceRoot":"","sources":["../../../../../src/components/multi-agent-orchestration/agent/job-manager/webhook.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACvE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAM7D,8EAA8E;AAC9E,+EAA+E;AAC/E,mEAAmE;AACnE,yFAAyF;AACzF,EAAE;AACF,wEAAwE;AACxE,+EAA+E;AAC/E,gFAAgF;AAChF,6EAA6E;AAC7E,qBAAqB;AACrB,gFAAgF;AAChF,6EAA6E;AAC7E,+EAA+E;AAC/E,6DAA6D;AAC7D,EAAE;AACF,4EAA4E;AAC5E,+CAA+C;AAC/C,8EAA8E;AAE9E,+DAA+D;AAC/D,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,GAAG,MAAM,CAAC;AAC/C,MAAM,aAAa,GAAG,QAAQ,CAAC;AAE/B,oEAAoE;AACpE,MAAM,UAAU,qBAAqB;IACnC,OAAO,aAAa,GAAG,WAAW,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAC5D,CAAC;AAED,yFAAyF;AACzF,MAAM,UAAU,mBAAmB,CAAC,MAAc,EAAE,EAAU,EAAE,SAAiB,EAAE,IAAyB;IAC1G,MAAM,GAA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AAC,CAAC;IACjC,MAAM,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IACjC,OAAO,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,IAAI,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACxD,CAAC;AAED,SAAS,GAAG,CAAC,KAAc;IACzB,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AAC9E,CAAC;AAED,SAAS,OAAO,CAAC,KAAc;IAC7B,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,SAAS,CAAC;IAC7E,MAAM,EAAE,GAAG,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACxE,OAAO,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;AACtE,CAAC"}
|
package/dist/components/multi-agent-orchestration/agent/memory-system/components/memory.d.ts
CHANGED
|
@@ -15,6 +15,13 @@ export declare class Memory {
|
|
|
15
15
|
constructor(deps: MemoryDeps);
|
|
16
16
|
evaluateMessages(messages: Message[]): Promise<MemoryRecord[]>;
|
|
17
17
|
private _extractFromMessages;
|
|
18
|
+
/** Rebuild the compacted user profile (USER.md). Returns null when the LLM returned nothing. */
|
|
19
|
+
compactUserMemory(current: string): Promise<string | null>;
|
|
20
|
+
/** Rebuild the compacted memory (MEMORY.md). Returns null when the LLM returned nothing. */
|
|
21
|
+
compactMemory(current: string): Promise<string | null>;
|
|
22
|
+
/** Refine the agent's soul (SOUL.md). Returns null when the LLM returned nothing. */
|
|
23
|
+
compactSoul(current: string): Promise<string | null>;
|
|
24
|
+
private _compact;
|
|
18
25
|
private _existingKeyCatalog;
|
|
19
26
|
private _handleDuplicate;
|
|
20
27
|
private _createRecord;
|
package/dist/components/multi-agent-orchestration/agent/memory-system/components/memory.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../../../../../src/components/multi-agent-orchestration/agent/memory-system/components/memory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mDAAmD,CAAC;AACrF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,KAAK,EACV,YAAY,EAIb,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../../../../../src/components/multi-agent-orchestration/agent/memory-system/components/memory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mDAAmD,CAAC;AACrF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,KAAK,EACV,YAAY,EAIb,MAAM,oBAAoB,CAAC;AAuK5B,MAAM,WAAW,UAAU;IACzB,YAAY,EAAE,YAAY,CAAC;IAC3B,WAAW,EAAE,WAAW,CAAC;IACzB,yFAAyF;IACzF,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,qBAAa,MAAM;IACjB,OAAO,CAAC,KAAK,CAAe;IAC5B,OAAO,CAAC,KAAK,CAAc;IAC3B,OAAO,CAAC,OAAO,CAAS;IAExB,YAAY,IAAI,EAAE,UAAU,EAI3B;IAMK,gBAAgB,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,CA6BnE;YAMa,oBAAoB;IAuClC,gGAAgG;IAC1F,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAE/D;IAED,4FAA4F;IACtF,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAE3D;IAED,qFAAqF;IAC/E,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAEzD;YAEa,QAAQ;YA2CR,mBAAmB;YAuBnB,gBAAgB;YAuBhB,aAAa;CAuB5B"}
|
|
@@ -4,40 +4,144 @@
|
|
|
4
4
|
// Given recent conversation messages, the LLM decides what facts, preferences,
|
|
5
5
|
// or decisions are worth remembering and extracts clean typed records.
|
|
6
6
|
// ---------------------------------------------------------------------------
|
|
7
|
-
const SYSTEM_PROMPT = `You are a memory extraction engine for an AI agent.
|
|
8
|
-
You receive a batch of recent conversation messages between a user and an assistant.
|
|
9
|
-
|
|
10
|
-
Your job:
|
|
11
|
-
1. Identify facts, preferences, decisions, or procedures worth storing as long-term memories.
|
|
12
|
-
2. Extract each as a clean, structured memory record.
|
|
13
|
-
|
|
14
|
-
Rules:
|
|
15
|
-
- Tool telemetry ("Tool X completed", "Tool X called") is NOT worth remembering unless it reveals a reusable fact about the environment.
|
|
16
|
-
- User preferences, corrections, decisions, and recurring facts ARE worth remembering.
|
|
17
|
-
- Write each memory value as a clean, concise statement — not the raw message text.
|
|
18
|
-
- Detect the language of the input. Write memory values in the SAME language as the user's input.
|
|
19
|
-
- For technical terms, keep them in English regardless of the surrounding language.
|
|
20
|
-
- If no messages are worth remembering, return an empty array.
|
|
21
|
-
|
|
22
|
-
Keys:
|
|
23
|
-
- You may receive a list of EXISTING KEYS grouped by scope. If a memory is about the same topic as an existing key, reuse that exact key — even if the value changed.
|
|
24
|
-
- Only create a new key when no existing key covers the topic.
|
|
25
|
-
- A key names the topic, not the value: lowercase snake_case, 1–4 words (e.g. unit_system, not uses_metric).
|
|
26
|
-
|
|
27
|
-
Respond with ONLY a JSON array (no markdown fences):
|
|
28
|
-
[
|
|
29
|
-
{
|
|
30
|
-
"kind": "user_preference" | "fact" | "decision" | "procedure" | "task_state" | "source_reference",
|
|
31
|
-
"scope": "user" | "project" | "profile" | "organization" | "task",
|
|
32
|
-
"subject": "who or what this is about",
|
|
33
|
-
"key": "short unique identifier for dedup (e.g. response_language, deploy_process)",
|
|
34
|
-
"value": "clean memory statement",
|
|
35
|
-
"confidence": "explicit" | "verified" | "inferred" | "unverified"
|
|
36
|
-
}
|
|
7
|
+
const SYSTEM_PROMPT = `You are a memory extraction engine for an AI agent.
|
|
8
|
+
You receive a batch of recent conversation messages between a user and an assistant.
|
|
9
|
+
|
|
10
|
+
Your job:
|
|
11
|
+
1. Identify facts, preferences, decisions, or procedures worth storing as long-term memories.
|
|
12
|
+
2. Extract each as a clean, structured memory record.
|
|
13
|
+
|
|
14
|
+
Rules:
|
|
15
|
+
- Tool telemetry ("Tool X completed", "Tool X called") is NOT worth remembering unless it reveals a reusable fact about the environment.
|
|
16
|
+
- User preferences, corrections, decisions, and recurring facts ARE worth remembering.
|
|
17
|
+
- Write each memory value as a clean, concise statement — not the raw message text.
|
|
18
|
+
- Detect the language of the input. Write memory values in the SAME language as the user's input.
|
|
19
|
+
- For technical terms, keep them in English regardless of the surrounding language.
|
|
20
|
+
- If no messages are worth remembering, return an empty array.
|
|
21
|
+
|
|
22
|
+
Keys:
|
|
23
|
+
- You may receive a list of EXISTING KEYS grouped by scope. If a memory is about the same topic as an existing key, reuse that exact key — even if the value changed.
|
|
24
|
+
- Only create a new key when no existing key covers the topic.
|
|
25
|
+
- A key names the topic, not the value: lowercase snake_case, 1–4 words (e.g. unit_system, not uses_metric).
|
|
26
|
+
|
|
27
|
+
Respond with ONLY a JSON array (no markdown fences):
|
|
28
|
+
[
|
|
29
|
+
{
|
|
30
|
+
"kind": "user_preference" | "fact" | "decision" | "procedure" | "task_state" | "source_reference",
|
|
31
|
+
"scope": "user" | "project" | "profile" | "organization" | "task",
|
|
32
|
+
"subject": "who or what this is about",
|
|
33
|
+
"key": "short unique identifier for dedup (e.g. response_language, deploy_process)",
|
|
34
|
+
"value": "clean memory statement",
|
|
35
|
+
"confidence": "explicit" | "verified" | "inferred" | "unverified"
|
|
36
|
+
}
|
|
37
37
|
]`;
|
|
38
|
+
const COMPACTED_USER_MEMORY_PROMPT = `# Task: Build a concise, useful profile of me
|
|
39
|
+
|
|
40
|
+
Review the conversation history, saved memory, and any sources I explicitly provide. Create a structured profile that another AI agent can use to understand my background, current work, preferences, and recurring projects.
|
|
41
|
+
|
|
42
|
+
## Source and accuracy rules
|
|
43
|
+
|
|
44
|
+
- Use only information available in the conversation history, saved memory, or sources I provide.
|
|
45
|
+
- Do not invent, infer, or fill gaps with guesses. If something is uncertain, leave it out or label it as an inference.
|
|
46
|
+
- Mark where information came from:
|
|
47
|
+
- **(user stated)** — I directly said it.
|
|
48
|
+
- **(prior sessions)** — It appeared in earlier conversations or saved memory.
|
|
49
|
+
- **(source: [name or URL])** — It came from a website, document, or other supplied source.
|
|
50
|
+
- **(inferred)** — It is a reasonable interpretation, but I did not state it directly.
|
|
51
|
+
- Keep claims from external sources separate from details learned in conversations. Do not present website claims as independently verified facts.
|
|
52
|
+
- Add an “as of” date to facts that may change, such as roles, products, plans, employment, health goals, or current projects. Preserve older dates when useful.
|
|
53
|
+
- If sources conflict, prefer the newest direct statement. Briefly note meaningful conflicts instead of silently choosing one.
|
|
54
|
+
- Include only details that could help an AI give more relevant answers. Avoid sensitive personal information, credentials, exact addresses, and unrelated one-off details.
|
|
55
|
+
- Preserve useful names, technical terms, product details, decisions, constraints, and lessons learned. Summarize repeated topics without flattening important specifics.
|
|
56
|
+
- Use clear, compact Markdown. Remove empty sections and avoid repeating the same fact in multiple places.
|
|
57
|
+
|
|
58
|
+
## Output format
|
|
59
|
+
|
|
60
|
+
# [Preferred name] — Profile
|
|
61
|
+
|
|
62
|
+
*Compiled [date]. Sections marked **(source: …)** come from external or supplied sources; other details come from conversation history.*
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## Who
|
|
67
|
+
|
|
68
|
+
- **Name and location:**
|
|
69
|
+
- **Languages:**
|
|
70
|
+
- **Profession and background:**
|
|
71
|
+
- **Areas of expertise:**
|
|
72
|
+
|
|
73
|
+
## Companies and products
|
|
74
|
+
|
|
75
|
+
### [Company or product name]
|
|
76
|
+
|
|
77
|
+
- **What it is:**
|
|
78
|
+
- **Audience or problem it serves:**
|
|
79
|
+
- **Products and services:**
|
|
80
|
+
- **Positioning or track record:** Include only if sourced.
|
|
81
|
+
- **Relationship to my other work:**
|
|
82
|
+
|
|
83
|
+
### [Repeat for other companies or products]
|
|
84
|
+
|
|
85
|
+
## Current and recurring work
|
|
86
|
+
|
|
87
|
+
### [Project or area]
|
|
88
|
+
|
|
89
|
+
- **Purpose and status:**
|
|
90
|
+
- **Technical stack and architecture:**
|
|
91
|
+
- **Key features or workflows:**
|
|
92
|
+
- **Important decisions, constraints, or open questions:**
|
|
93
|
+
- **Relevant dates:**
|
|
94
|
+
|
|
95
|
+
## Technical profile and preferences
|
|
96
|
+
|
|
97
|
+
- **Languages and frameworks:**
|
|
98
|
+
- **Cloud, databases, and infrastructure:**
|
|
99
|
+
- **Tools and libraries:**
|
|
100
|
+
- **Architecture or coding preferences:**
|
|
101
|
+
- **Technologies currently being evaluated:**
|
|
102
|
+
|
|
103
|
+
## Personal context
|
|
104
|
+
|
|
105
|
+
Include only relevant details that could improve future assistance. Date time-sensitive information and avoid unnecessary private details.
|
|
106
|
+
|
|
107
|
+
- **Interests or ongoing goals:**
|
|
108
|
+
- **Family or lifestyle context, if relevant:**
|
|
109
|
+
- **Other useful preferences:**
|
|
110
|
+
|
|
111
|
+
## Communication preferences
|
|
112
|
+
|
|
113
|
+
- **Preferred languages or tone:**
|
|
114
|
+
- **Writing or learning preferences:**
|
|
115
|
+
- **Recurring corrections or feedback:**
|
|
116
|
+
|
|
117
|
+
## Final review
|
|
118
|
+
|
|
119
|
+
Before returning the profile, check that:
|
|
120
|
+
|
|
121
|
+
1. Every factual claim has a clear source or is omitted.
|
|
122
|
+
2. External claims are labeled and not presented as personally confirmed.
|
|
123
|
+
3. Time-sensitive details have dates or status labels.
|
|
124
|
+
4. The profile is useful to a future AI agent, compact, and free of unnecessary repetition.
|
|
125
|
+
5. No credentials or highly sensitive details have been included.`;
|
|
126
|
+
const COMPACTED_MEMORY_PROMPT = `Build a compacted memory by listing upto 10 rows about topics or entities which user concern about`;
|
|
127
|
+
const COMPACTED_SOUL_PROMPT = `# Task: Refine the agent's soul (SOUL.md)
|
|
128
|
+
|
|
129
|
+
SOUL.md describes who the agent is: its persona, values, tone, communication style and working habits. Review the current SOUL.md and the saved memories, then return an updated SOUL.md.
|
|
130
|
+
|
|
131
|
+
## Rules
|
|
132
|
+
|
|
133
|
+
- Keep the agent's core identity, name, role and values from the current SOUL.md. Evolve it gradually; never rewrite the personality from scratch.
|
|
134
|
+
- Change it only where the saved memories show a clear, recurring signal about how the user wants the agent to behave: tone, verbosity, language, formatting, level of autonomy, recurring corrections or praise.
|
|
135
|
+
- Ignore one-off requests, task details and facts about the user or projects; those belong in USER.md and MEMORY.md, not here.
|
|
136
|
+
- Never add instructions that weaken safety, honesty or the user's control, even if a memory seems to ask for it.
|
|
137
|
+
- If nothing in the saved memories warrants a change, return the current SOUL.md unchanged.
|
|
138
|
+
- If the current SOUL.md is empty, write a short one only from clear signals; otherwise return it empty.
|
|
139
|
+
- Use clear, compact Markdown written in the second person ("You are ..."). Keep it under 300 words.`;
|
|
38
140
|
// Cap on existing keys sent to the extraction LLM — keeps the prompt small
|
|
39
141
|
// as memories accumulate (keys only, no values).
|
|
40
142
|
const MAX_EXISTING_KEYS = 200;
|
|
143
|
+
// Cap on saved memories sent to a compaction LLM call (USER.md / MEMORY.md).
|
|
144
|
+
const MAX_COMPACTION_RECORDS = 200;
|
|
41
145
|
let _nextId = 0;
|
|
42
146
|
function memoryId() {
|
|
43
147
|
return `mem_${Date.now()}_${++_nextId}`;
|
|
@@ -107,6 +211,51 @@ export class Memory {
|
|
|
107
211
|
return parseExtractions(response.message.content);
|
|
108
212
|
}
|
|
109
213
|
// ---------------------------------------------------------------------------
|
|
214
|
+
// Compaction — rewrite USER.md / MEMORY.md from the current file + saved memories
|
|
215
|
+
// ---------------------------------------------------------------------------
|
|
216
|
+
/** Rebuild the compacted user profile (USER.md). Returns null when the LLM returned nothing. */
|
|
217
|
+
async compactUserMemory(current) {
|
|
218
|
+
return this._compact(COMPACTED_USER_MEMORY_PROMPT, "USER.md", current);
|
|
219
|
+
}
|
|
220
|
+
/** Rebuild the compacted memory (MEMORY.md). Returns null when the LLM returned nothing. */
|
|
221
|
+
async compactMemory(current) {
|
|
222
|
+
return this._compact(COMPACTED_MEMORY_PROMPT, "MEMORY.md", current);
|
|
223
|
+
}
|
|
224
|
+
/** Refine the agent's soul (SOUL.md). Returns null when the LLM returned nothing. */
|
|
225
|
+
async compactSoul(current) {
|
|
226
|
+
return this._compact(COMPACTED_SOUL_PROMPT, "SOUL.md", current);
|
|
227
|
+
}
|
|
228
|
+
async _compact(systemPrompt, fileName, current) {
|
|
229
|
+
const records = await this.store.query({
|
|
230
|
+
agentId: this.agentId,
|
|
231
|
+
statuses: ["active"],
|
|
232
|
+
limit: MAX_COMPACTION_RECORDS,
|
|
233
|
+
});
|
|
234
|
+
if (records.length === 0)
|
|
235
|
+
return null;
|
|
236
|
+
const memories = records
|
|
237
|
+
.map((r) => {
|
|
238
|
+
const label = r.subject ? `${r.subject} — ${r.key}` : r.key;
|
|
239
|
+
return `- [${r.kind}/${r.scope}] ${label}: ${r.value} (as of ${r.updatedAt ?? r.observedAt})`;
|
|
240
|
+
})
|
|
241
|
+
.join("\n");
|
|
242
|
+
const userContent = [
|
|
243
|
+
`TODAY: ${new Date().toISOString().slice(0, 10)}`,
|
|
244
|
+
`CURRENT ${fileName}:\n${current.trim() || "(empty)"}`,
|
|
245
|
+
`SAVED MEMORIES:\n${memories}`,
|
|
246
|
+
`Respond with ONLY the new content of ${fileName} (Markdown, no code fences).`,
|
|
247
|
+
].join("\n\n");
|
|
248
|
+
const response = await this.model.chat([
|
|
249
|
+
{ role: "system", content: systemPrompt },
|
|
250
|
+
{ role: "user", content: userContent },
|
|
251
|
+
]);
|
|
252
|
+
if (response.stopReason === "max_tokens") {
|
|
253
|
+
throw new Error(`${fileName} compaction truncated (output tokens: ${response.usage.outputTokens})`);
|
|
254
|
+
}
|
|
255
|
+
const text = stripMarkdownFence(response.message.content);
|
|
256
|
+
return text || null;
|
|
257
|
+
}
|
|
258
|
+
// ---------------------------------------------------------------------------
|
|
110
259
|
// Existing key catalog — distinct active keys grouped by scope, one line each
|
|
111
260
|
// e.g. "user: response_language, unit_system"
|
|
112
261
|
// ---------------------------------------------------------------------------
|
|
@@ -178,6 +327,16 @@ function normalizeKey(key) {
|
|
|
178
327
|
.replace(/^_|_$/g, "");
|
|
179
328
|
}
|
|
180
329
|
// ---------------------------------------------------------------------------
|
|
330
|
+
// Strip one wrapping ```/```markdown/```md fence from a compaction reply
|
|
331
|
+
// ---------------------------------------------------------------------------
|
|
332
|
+
function stripMarkdownFence(content) {
|
|
333
|
+
return content
|
|
334
|
+
.trim()
|
|
335
|
+
.replace(/^```(?:markdown|md)?[ \t]*\r?\n/i, "")
|
|
336
|
+
.replace(/\r?\n```$/, "")
|
|
337
|
+
.trim();
|
|
338
|
+
}
|
|
339
|
+
// ---------------------------------------------------------------------------
|
|
181
340
|
// Parse the LLM's JSON array — tolerant of markdown fences, strict otherwise
|
|
182
341
|
// ---------------------------------------------------------------------------
|
|
183
342
|
function parseExtractions(content) {
|
package/dist/components/multi-agent-orchestration/agent/memory-system/components/memory.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory.js","sourceRoot":"","sources":["../../../../../../src/components/multi-agent-orchestration/agent/memory-system/components/memory.ts"],"names":[],"mappings":"AAUA,8EAA8E;AAC9E,mDAAmD;AACnD,EAAE;AACF,+EAA+E;AAC/E,uEAAuE;AACvE,8EAA8E;AAE9E,MAAM,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8BpB,CAAC;
|
|
1
|
+
{"version":3,"file":"memory.js","sourceRoot":"","sources":["../../../../../../src/components/multi-agent-orchestration/agent/memory-system/components/memory.ts"],"names":[],"mappings":"AAUA,8EAA8E;AAC9E,mDAAmD;AACnD,EAAE;AACF,+EAA+E;AAC/E,uEAAuE;AACvE,8EAA8E;AAE9E,MAAM,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8BpB,CAAC;AAEH,MAAM,4BAA4B,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kEAuF6B,CAAA;AAElE,MAAM,uBAAuB,GAAG,oGAAoG,CAAA;AAEpI,MAAM,qBAAqB,GAAG;;;;;;;;;;;;qGAYuE,CAAA;AAWrG,2EAA2E;AAC3E,iDAAiD;AACjD,MAAM,iBAAiB,GAAG,GAAG,CAAC;AAE9B,6EAA6E;AAC7E,MAAM,sBAAsB,GAAG,GAAG,CAAC;AAEnC,IAAI,OAAO,GAAG,CAAC,CAAC;AAChB,SAAS,QAAQ;IACf,OAAO,OAAO,IAAI,CAAC,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AAC1C,CAAC;AASD,MAAM,OAAO,MAAM;IACT,KAAK,CAAe;IACpB,KAAK,CAAc;IACnB,OAAO,CAAS;IAExB,YAAY,IAAgB;QAC1B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC;QAC/B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC;QAC9B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,O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AC,OAAO,CAAC,MAAM,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;IAC7F,OAAO,MAA+B,CAAC;AACzC,CAAC"}
|
|
@@ -4,11 +4,25 @@ import type { ModelManager } from "../model-manager/model-manager.js";
|
|
|
4
4
|
import type { ConsolidationResult, RetrievalQuery, RetrievalResult } from "./types/pipeline.js";
|
|
5
5
|
import type { MemoryConfig } from "./types/config.js";
|
|
6
6
|
import type { AgentProfile } from "../types.js";
|
|
7
|
+
/** The initial context files a consolidation pass compacts (USER.md / MEMORY.md / SOUL.md). */
|
|
8
|
+
export interface CompactedMemoryFiles {
|
|
9
|
+
userMd?: string;
|
|
10
|
+
memoryMd?: string;
|
|
11
|
+
soulMd?: string;
|
|
12
|
+
}
|
|
7
13
|
export interface MemorySystemDeps {
|
|
8
14
|
persistence: PersistenceHub;
|
|
9
15
|
eventBus: EventBus;
|
|
10
16
|
modelManager: ModelManager;
|
|
11
17
|
profile: AgentProfile;
|
|
18
|
+
/** The agent's current USER.md / MEMORY.md / SOUL.md, read before each compaction. */
|
|
19
|
+
getMemoryFiles?: () => CompactedMemoryFiles;
|
|
20
|
+
/**
|
|
21
|
+
* Called after a consolidation pass rebuilt USER.md, MEMORY.md and/or SOUL.md — only the
|
|
22
|
+
* rebuilt files are set. The owner (Agent) applies and saves them. Without it,
|
|
23
|
+
* no compaction runs.
|
|
24
|
+
*/
|
|
25
|
+
onMemoryFilesCompacted?: (files: CompactedMemoryFiles) => Promise<void>;
|
|
12
26
|
}
|
|
13
27
|
/** Per-memory trace detail — ids, labels and scores only, never the memory value. */
|
|
14
28
|
export interface RecalledMemoryTrace {
|
|
@@ -68,12 +82,15 @@ export declare class MemorySystem {
|
|
|
68
82
|
*/
|
|
69
83
|
private indexBuilt;
|
|
70
84
|
private agentId;
|
|
85
|
+
private getMemoryFiles?;
|
|
86
|
+
private onMemoryFilesCompacted?;
|
|
71
87
|
constructor(deps: MemorySystemDeps);
|
|
72
88
|
/** Start trigger-driven consolidation (EventBus subscriptions + interval timer). */
|
|
73
89
|
start(): void;
|
|
74
90
|
/** Stop triggers and wait for an in-flight pass. Never starts a new pass. */
|
|
75
91
|
dispose(): Promise<void>;
|
|
76
92
|
consolidate(sessionId: string): Promise<ConsolidationResult[]>;
|
|
93
|
+
private compactMemoryFiles;
|
|
77
94
|
recall(query: RetrievalQuery): Promise<RetrievalResult[]>;
|
|
78
95
|
/** Build the index if it is still cold. Returns rebuild stats, or null if it was already built. */
|
|
79
96
|
private ensureIndex;
|
package/dist/components/multi-agent-orchestration/agent/memory-system/memory-system.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory-system.d.ts","sourceRoot":"","sources":["../../../../../src/components/multi-agent-orchestration/agent/memory-system/memory-system.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6CAA6C,CAAC;AAClF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAGtE,OAAO,KAAK,EACV,mBAAmB,EACnB,cAAc,EACd,eAAe,EAChB,MAAM,qBAAqB,CAAC;AAM7B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,MAAM,WAAW,gBAAgB;IAC/B,WAAW,EAAE,cAAc,CAAC;IAC5B,QAAQ,EAAE,QAAQ,CAAC;IACnB,YAAY,EAAE,YAAY,CAAC;IAC3B,OAAO,EAAC,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"memory-system.d.ts","sourceRoot":"","sources":["../../../../../src/components/multi-agent-orchestration/agent/memory-system/memory-system.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6CAA6C,CAAC;AAClF,OAAO,KAAK,EAAE,QAAQ,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
|
49
49
|
*/
|
|
50
50
|
indexBuilt = false;
|
|
51
51
|
agentId;
|
|
52
|
+
getMemoryFiles;
|
|
53
|
+
onMemoryFilesCompacted;
|
|
52
54
|
constructor(deps) {
|
|
53
55
|
this.agentId = deps.profile.id;
|
|
56
|
+
this.getMemoryFiles = deps.getMemoryFiles;
|
|
57
|
+
this.onMemoryFilesCompacted = deps.onMemoryFilesCompacted;
|
|
54
58
|
this.memory = new Memory({
|
|
55
59
|
modelManager: deps.modelManager,
|
|
56
60
|
memoryStore: deps.persistence.memory,
|
|
@@ -107,9 +111,56 @@ export class MemorySystem {
|
|
|
107
111
|
// Rebuild index after consolidation (promotions, expirations, merges)
|
|
108
112
|
await this.indexing.rebuild();
|
|
109
113
|
this.indexBuilt = true;
|
|
114
|
+
// Saved memories changed — rebuild the compacted files from them
|
|
115
|
+
if (results.length > 0)
|
|
116
|
+
await this.compactMemoryFiles();
|
|
110
117
|
return results;
|
|
111
118
|
}
|
|
112
119
|
// ---------------------------------------------------------------------------
|
|
120
|
+
// Compaction — after consolidation: update compacted user memory (USER.md, only
|
|
121
|
+
// when MemoryConfig.updateUser allows it) and update compacted memory (MEMORY.md)
|
|
122
|
+
// Update: and refine the soul (SOUL.md, only when MemoryConfig.updateSoul allows it)
|
|
123
|
+
// ---------------------------------------------------------------------------
|
|
124
|
+
async compactMemoryFiles() {
|
|
125
|
+
if (!this.onMemoryFilesCompacted)
|
|
126
|
+
return;
|
|
127
|
+
const current = this.getMemoryFiles?.() ?? {};
|
|
128
|
+
const files = {};
|
|
129
|
+
// A failed compaction is logged, not thrown: the pass itself succeeded and its
|
|
130
|
+
// checkpoint already advanced, so failing here would only hide its results.
|
|
131
|
+
if (this.config.updateUser) {
|
|
132
|
+
try {
|
|
133
|
+
const userMd = await this.memory.compactUserMemory(current.userMd ?? "");
|
|
134
|
+
if (userMd && userMd !== current.userMd)
|
|
135
|
+
files.userMd = userMd;
|
|
136
|
+
}
|
|
137
|
+
catch (err) {
|
|
138
|
+
console.error(`[memory] agent=${this.agentId} USER.md compaction failed:`, err);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
try {
|
|
142
|
+
const memoryMd = await this.memory.compactMemory(current.memoryMd ?? "");
|
|
143
|
+
if (memoryMd && memoryMd !== current.memoryMd)
|
|
144
|
+
files.memoryMd = memoryMd;
|
|
145
|
+
}
|
|
146
|
+
catch (err) {
|
|
147
|
+
console.error(`[memory] agent=${this.agentId} MEMORY.md compaction failed:`, err);
|
|
148
|
+
}
|
|
149
|
+
if (this.config.updateSoul) {
|
|
150
|
+
try {
|
|
151
|
+
const soulMd = await this.memory.compactSoul(current.soulMd ?? "");
|
|
152
|
+
if (soulMd && soulMd !== current.soulMd)
|
|
153
|
+
files.soulMd = soulMd;
|
|
154
|
+
}
|
|
155
|
+
catch (err) {
|
|
156
|
+
console.error(`[memory] agent=${this.agentId} SOUL.md compaction failed:`, err);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
if (files.userMd === undefined && files.memoryMd === undefined && files.soulMd === undefined)
|
|
160
|
+
return;
|
|
161
|
+
await this.onMemoryFilesCompacted(files);
|
|
162
|
+
}
|
|
163
|
+
// ---------------------------------------------------------------------------
|
|
113
164
|
// Retrieval — recall relevant memories for current context
|
|
114
165
|
// ---------------------------------------------------------------------------
|
|
115
166
|
async recall(query) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory-system.js","sourceRoot":"","sources":["../../../../../src/components/multi-agent-orchestration/agent/memory-system/memory-system.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAOpD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"memory-system.js","sourceRoot":"","sources":["../../../../../src/components/multi-agent-orchestration/agent/memory-system/memory-system.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAOpD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AAqDjF,MAAM,uBAAuB,GAAG,CAAC,CAAC;AAElC,SAAS,sBAAsB,CAAC,OAA0B;IACxD,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE;QACvC,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,OAAO,MAAM,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;QAChF,OAAO,MAAM,MAAM,CAAC,IAAI,KAAK,KAAK,KAAK,MAAM,CAAC,KAAK,EAAE,CAAC;IACxD,CAAC,CAAC,CAAC;IACH,OAAO;QACL,sBAAsB;QACtB,4JAA4J;QAC5J,GAAG,KAAK;KACT,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC;AAED,MAAM,OAAO,YAAY;IACvB;;OAEG;IACK,MAAM,CAAS;IACvB;;OAEG;IACK,QAAQ,CAAW;IAC3B;;OAEG;IACK,QAAQ,CAAW;IAC3B;;OAEG;IACK,SAAS,CAAY;IAC7B;;OAEG;IACK,QAAQ,CAAW;IAC3B;;OAEG;IACK,SAAS,CAAyB;IAElC,MAAM,CAAe;IAC7B;;;;OAI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AAC,CAAC,aAAa;gBAC9B,cAAc,EAAE,CAAC,CAAC,cAAc;gBAChC,YAAY,EAAE,CAAC,CAAC,YAAY;gBAC5B,eAAe,EAAE,CAAC,CAAC,eAAe;aACnC,CAAC,CAAC;YACH,UAAU;YACV,YAAY,EAAE,OAAO,KAAK,IAAI;YAC9B,GAAG,CAAC,OAAO,IAAI,EAAE,cAAc,EAAE,OAAO,CAAC,UAAU,EAAE,YAAY,EAAE,OAAO,CAAC,YAAY,EAAE,CAAC;SAC3F,CAAC;IACJ,CAAC;IAED,8EAA8E;IAC9E,yBAAyB;IACzB,8EAA8E;IAE9E,YAAY,CAAC,MAAoB;QAC/B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YACpB,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QAC9C,CAAC;QACD,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;IACzB,CAAC;CACF"}
|
|
@@ -18,6 +18,11 @@ export declare class ModelManager {
|
|
|
18
18
|
stream(messages: Message[], options?: ModelOptions): AsyncIterable<StreamChunk>;
|
|
19
19
|
countTokens(messages: Message[]): Promise<number>;
|
|
20
20
|
listProviders(): string[];
|
|
21
|
+
/**
|
|
22
|
+
* The model ids the agent's provider offers (A-100: the chat's /model command).
|
|
23
|
+
* Undefined when the provider has no catalog or none is registered.
|
|
24
|
+
*/
|
|
25
|
+
listModels(): Promise<string[] | undefined>;
|
|
21
26
|
setDefaultProvider(provider: string | undefined): void;
|
|
22
27
|
setDefaultModel(model: string | undefined): void;
|
|
23
28
|
setDefaultInferenceConfig(config: DefaultInferenceConfig): void;
|