@shuyhere/takotako 0.0.1
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/CONTRIBUTING.md +84 -0
- package/LICENSE +21 -0
- package/README.md +171 -0
- package/dist/agents/communication.d.ts +48 -0
- package/dist/agents/communication.d.ts.map +1 -0
- package/dist/agents/communication.js +123 -0
- package/dist/agents/communication.js.map +1 -0
- package/dist/agents/config.d.ts +52 -0
- package/dist/agents/config.d.ts.map +1 -0
- package/dist/agents/config.js +65 -0
- package/dist/agents/config.js.map +1 -0
- package/dist/agents/model-catalog.d.ts +49 -0
- package/dist/agents/model-catalog.d.ts.map +1 -0
- package/dist/agents/model-catalog.js +79 -0
- package/dist/agents/model-catalog.js.map +1 -0
- package/dist/agents/registry.d.ts +71 -0
- package/dist/agents/registry.d.ts.map +1 -0
- package/dist/agents/registry.js +297 -0
- package/dist/agents/registry.js.map +1 -0
- package/dist/agents/roles.d.ts +79 -0
- package/dist/agents/roles.d.ts.map +1 -0
- package/dist/agents/roles.js +174 -0
- package/dist/agents/roles.js.map +1 -0
- package/dist/agents/subagent.d.ts +124 -0
- package/dist/agents/subagent.d.ts.map +1 -0
- package/dist/agents/subagent.js +352 -0
- package/dist/agents/subagent.js.map +1 -0
- package/dist/agents/templates.d.ts +18 -0
- package/dist/agents/templates.d.ts.map +1 -0
- package/dist/agents/templates.js +341 -0
- package/dist/agents/templates.js.map +1 -0
- package/dist/agents/thread-binding.d.ts +77 -0
- package/dist/agents/thread-binding.d.ts.map +1 -0
- package/dist/agents/thread-binding.js +167 -0
- package/dist/agents/thread-binding.js.map +1 -0
- package/dist/auth/agent-profiles.d.ts +46 -0
- package/dist/auth/agent-profiles.d.ts.map +1 -0
- package/dist/auth/agent-profiles.js +97 -0
- package/dist/auth/agent-profiles.js.map +1 -0
- package/dist/auth/allow-from.d.ts +27 -0
- package/dist/auth/allow-from.d.ts.map +1 -0
- package/dist/auth/allow-from.js +118 -0
- package/dist/auth/allow-from.js.map +1 -0
- package/dist/auth/oauth.d.ts +66 -0
- package/dist/auth/oauth.d.ts.map +1 -0
- package/dist/auth/oauth.js +253 -0
- package/dist/auth/oauth.js.map +1 -0
- package/dist/auth/storage.d.ts +69 -0
- package/dist/auth/storage.d.ts.map +1 -0
- package/dist/auth/storage.js +157 -0
- package/dist/auth/storage.js.map +1 -0
- package/dist/cache/file-cache.d.ts +68 -0
- package/dist/cache/file-cache.d.ts.map +1 -0
- package/dist/cache/file-cache.js +176 -0
- package/dist/cache/file-cache.js.map +1 -0
- package/dist/cache/manager.d.ts +69 -0
- package/dist/cache/manager.d.ts.map +1 -0
- package/dist/cache/manager.js +117 -0
- package/dist/cache/manager.js.map +1 -0
- package/dist/cache/symbol-index.d.ts +75 -0
- package/dist/cache/symbol-index.d.ts.map +1 -0
- package/dist/cache/symbol-index.js +267 -0
- package/dist/cache/symbol-index.js.map +1 -0
- package/dist/cache/tool-cache.d.ts +75 -0
- package/dist/cache/tool-cache.d.ts.map +1 -0
- package/dist/cache/tool-cache.js +173 -0
- package/dist/cache/tool-cache.js.map +1 -0
- package/dist/channels/channel.d.ts +156 -0
- package/dist/channels/channel.d.ts.map +1 -0
- package/dist/channels/channel.js +25 -0
- package/dist/channels/channel.js.map +1 -0
- package/dist/channels/cli.d.ts +35 -0
- package/dist/channels/cli.d.ts.map +1 -0
- package/dist/channels/cli.js +94 -0
- package/dist/channels/cli.js.map +1 -0
- package/dist/channels/delivery-queue.d.ts +31 -0
- package/dist/channels/delivery-queue.d.ts.map +1 -0
- package/dist/channels/delivery-queue.js +127 -0
- package/dist/channels/delivery-queue.js.map +1 -0
- package/dist/channels/discord.d.ts +124 -0
- package/dist/channels/discord.d.ts.map +1 -0
- package/dist/channels/discord.js +664 -0
- package/dist/channels/discord.js.map +1 -0
- package/dist/channels/retry.d.ts +31 -0
- package/dist/channels/retry.d.ts.map +1 -0
- package/dist/channels/retry.js +94 -0
- package/dist/channels/retry.js.map +1 -0
- package/dist/channels/telegram.d.ts +69 -0
- package/dist/channels/telegram.d.ts.map +1 -0
- package/dist/channels/telegram.js +499 -0
- package/dist/channels/telegram.js.map +1 -0
- package/dist/channels/tui.d.ts +42 -0
- package/dist/channels/tui.d.ts.map +1 -0
- package/dist/channels/tui.js +126 -0
- package/dist/channels/tui.js.map +1 -0
- package/dist/cli/acp.d.ts +10 -0
- package/dist/cli/acp.d.ts.map +1 -0
- package/dist/cli/acp.js +69 -0
- package/dist/cli/acp.js.map +1 -0
- package/dist/cli/audit.d.ts +11 -0
- package/dist/cli/audit.d.ts.map +1 -0
- package/dist/cli/audit.js +55 -0
- package/dist/cli/audit.js.map +1 -0
- package/dist/cli/cache.d.ts +10 -0
- package/dist/cli/cache.d.ts.map +1 -0
- package/dist/cli/cache.js +77 -0
- package/dist/cli/cache.js.map +1 -0
- package/dist/cli/config.d.ts +5 -0
- package/dist/cli/config.d.ts.map +1 -0
- package/dist/cli/config.js +168 -0
- package/dist/cli/config.js.map +1 -0
- package/dist/cli/cron.d.ts +5 -0
- package/dist/cli/cron.d.ts.map +1 -0
- package/dist/cli/cron.js +192 -0
- package/dist/cli/cron.js.map +1 -0
- package/dist/cli/extensions.d.ts +5 -0
- package/dist/cli/extensions.d.ts.map +1 -0
- package/dist/cli/extensions.js +53 -0
- package/dist/cli/extensions.js.map +1 -0
- package/dist/cli/logs.d.ts +5 -0
- package/dist/cli/logs.d.ts.map +1 -0
- package/dist/cli/logs.js +49 -0
- package/dist/cli/logs.js.map +1 -0
- package/dist/cli/memory.d.ts +5 -0
- package/dist/cli/memory.d.ts.map +1 -0
- package/dist/cli/memory.js +78 -0
- package/dist/cli/memory.js.map +1 -0
- package/dist/cli/message.d.ts +5 -0
- package/dist/cli/message.d.ts.map +1 -0
- package/dist/cli/message.js +69 -0
- package/dist/cli/message.js.map +1 -0
- package/dist/cli/service.d.ts +14 -0
- package/dist/cli/service.d.ts.map +1 -0
- package/dist/cli/service.js +181 -0
- package/dist/cli/service.js.map +1 -0
- package/dist/cli/symphony.d.ts +5 -0
- package/dist/cli/symphony.d.ts.map +1 -0
- package/dist/cli/symphony.js +114 -0
- package/dist/cli/symphony.js.map +1 -0
- package/dist/cli/update.d.ts +5 -0
- package/dist/cli/update.d.ts.map +1 -0
- package/dist/cli/update.js +48 -0
- package/dist/cli/update.js.map +1 -0
- package/dist/commands/channel-setup.d.ts +31 -0
- package/dist/commands/channel-setup.d.ts.map +1 -0
- package/dist/commands/channel-setup.js +138 -0
- package/dist/commands/channel-setup.js.map +1 -0
- package/dist/commands/dispatch.d.ts +48 -0
- package/dist/commands/dispatch.d.ts.map +1 -0
- package/dist/commands/dispatch.js +68 -0
- package/dist/commands/dispatch.js.map +1 -0
- package/dist/commands/model-picker.d.ts +16 -0
- package/dist/commands/model-picker.d.ts.map +1 -0
- package/dist/commands/model-picker.js +120 -0
- package/dist/commands/model-picker.js.map +1 -0
- package/dist/commands/parser.d.ts +32 -0
- package/dist/commands/parser.d.ts.map +1 -0
- package/dist/commands/parser.js +39 -0
- package/dist/commands/parser.js.map +1 -0
- package/dist/commands/registry.d.ts +76 -0
- package/dist/commands/registry.d.ts.map +1 -0
- package/dist/commands/registry.js +351 -0
- package/dist/commands/registry.js.map +1 -0
- package/dist/commands/skill-commands.d.ts +35 -0
- package/dist/commands/skill-commands.d.ts.map +1 -0
- package/dist/commands/skill-commands.js +61 -0
- package/dist/commands/skill-commands.js.map +1 -0
- package/dist/config/resolve.d.ts +25 -0
- package/dist/config/resolve.d.ts.map +1 -0
- package/dist/config/resolve.js +289 -0
- package/dist/config/resolve.js.map +1 -0
- package/dist/config/schema.d.ts +520 -0
- package/dist/config/schema.d.ts.map +1 -0
- package/dist/config/schema.js +123 -0
- package/dist/config/schema.js.map +1 -0
- package/dist/core/agent-loop.d.ts +137 -0
- package/dist/core/agent-loop.d.ts.map +1 -0
- package/dist/core/agent-loop.js +700 -0
- package/dist/core/agent-loop.js.map +1 -0
- package/dist/core/audit.d.ts +87 -0
- package/dist/core/audit.d.ts.map +1 -0
- package/dist/core/audit.js +224 -0
- package/dist/core/audit.js.map +1 -0
- package/dist/core/bootstrap.d.ts +23 -0
- package/dist/core/bootstrap.d.ts.map +1 -0
- package/dist/core/bootstrap.js +162 -0
- package/dist/core/bootstrap.js.map +1 -0
- package/dist/core/context.d.ts +44 -0
- package/dist/core/context.d.ts.map +1 -0
- package/dist/core/context.js +65 -0
- package/dist/core/context.js.map +1 -0
- package/dist/core/cron.d.ts +111 -0
- package/dist/core/cron.d.ts.map +1 -0
- package/dist/core/cron.js +284 -0
- package/dist/core/cron.js.map +1 -0
- package/dist/core/exec-approvals.d.ts +50 -0
- package/dist/core/exec-approvals.d.ts.map +1 -0
- package/dist/core/exec-approvals.js +187 -0
- package/dist/core/exec-approvals.js.map +1 -0
- package/dist/core/heartbeat.d.ts +71 -0
- package/dist/core/heartbeat.d.ts.map +1 -0
- package/dist/core/heartbeat.js +214 -0
- package/dist/core/heartbeat.js.map +1 -0
- package/dist/core/message-queue.d.ts +60 -0
- package/dist/core/message-queue.d.ts.map +1 -0
- package/dist/core/message-queue.js +182 -0
- package/dist/core/message-queue.js.map +1 -0
- package/dist/core/network-policy.d.ts +39 -0
- package/dist/core/network-policy.d.ts.map +1 -0
- package/dist/core/network-policy.js +121 -0
- package/dist/core/network-policy.js.map +1 -0
- package/dist/core/progress.d.ts +48 -0
- package/dist/core/progress.d.ts.map +1 -0
- package/dist/core/progress.js +81 -0
- package/dist/core/progress.js.map +1 -0
- package/dist/core/prompt.d.ts +105 -0
- package/dist/core/prompt.d.ts.map +1 -0
- package/dist/core/prompt.js +411 -0
- package/dist/core/prompt.js.map +1 -0
- package/dist/core/pruning.d.ts +40 -0
- package/dist/core/pruning.d.ts.map +1 -0
- package/dist/core/pruning.js +165 -0
- package/dist/core/pruning.js.map +1 -0
- package/dist/core/rate-limiter.d.ts +64 -0
- package/dist/core/rate-limiter.d.ts.map +1 -0
- package/dist/core/rate-limiter.js +142 -0
- package/dist/core/rate-limiter.js.map +1 -0
- package/dist/core/reactions.d.ts +31 -0
- package/dist/core/reactions.d.ts.map +1 -0
- package/dist/core/reactions.js +67 -0
- package/dist/core/reactions.js.map +1 -0
- package/dist/core/retry-queue.d.ts +56 -0
- package/dist/core/retry-queue.d.ts.map +1 -0
- package/dist/core/retry-queue.js +106 -0
- package/dist/core/retry-queue.js.map +1 -0
- package/dist/core/sanitizer.d.ts +38 -0
- package/dist/core/sanitizer.d.ts.map +1 -0
- package/dist/core/sanitizer.js +181 -0
- package/dist/core/sanitizer.js.map +1 -0
- package/dist/core/secret-scanner.d.ts +39 -0
- package/dist/core/secret-scanner.d.ts.map +1 -0
- package/dist/core/secret-scanner.js +96 -0
- package/dist/core/secret-scanner.js.map +1 -0
- package/dist/core/secrets.d.ts +38 -0
- package/dist/core/secrets.d.ts.map +1 -0
- package/dist/core/secrets.js +137 -0
- package/dist/core/secrets.js.map +1 -0
- package/dist/core/security.d.ts +58 -0
- package/dist/core/security.d.ts.map +1 -0
- package/dist/core/security.js +120 -0
- package/dist/core/security.js.map +1 -0
- package/dist/core/self-awareness.d.ts +19 -0
- package/dist/core/self-awareness.d.ts.map +1 -0
- package/dist/core/self-awareness.js +124 -0
- package/dist/core/self-awareness.js.map +1 -0
- package/dist/core/session-init.d.ts +34 -0
- package/dist/core/session-init.d.ts.map +1 -0
- package/dist/core/session-init.js +68 -0
- package/dist/core/session-init.js.map +1 -0
- package/dist/core/streaming.d.ts +82 -0
- package/dist/core/streaming.d.ts.map +1 -0
- package/dist/core/streaming.js +264 -0
- package/dist/core/streaming.js.map +1 -0
- package/dist/core/symphony/orchestrator.d.ts +61 -0
- package/dist/core/symphony/orchestrator.d.ts.map +1 -0
- package/dist/core/symphony/orchestrator.js +476 -0
- package/dist/core/symphony/orchestrator.js.map +1 -0
- package/dist/core/symphony/status.d.ts +11 -0
- package/dist/core/symphony/status.d.ts.map +1 -0
- package/dist/core/symphony/status.js +133 -0
- package/dist/core/symphony/status.js.map +1 -0
- package/dist/core/symphony/types.d.ts +84 -0
- package/dist/core/symphony/types.d.ts.map +1 -0
- package/dist/core/symphony/types.js +5 -0
- package/dist/core/symphony/types.js.map +1 -0
- package/dist/core/symphony/workflow.d.ts +18 -0
- package/dist/core/symphony/workflow.d.ts.map +1 -0
- package/dist/core/symphony/workflow.js +149 -0
- package/dist/core/symphony/workflow.js.map +1 -0
- package/dist/core/symphony/workspace.d.ts +24 -0
- package/dist/core/symphony/workspace.d.ts.map +1 -0
- package/dist/core/symphony/workspace.js +94 -0
- package/dist/core/symphony/workspace.js.map +1 -0
- package/dist/core/thinking.d.ts +27 -0
- package/dist/core/thinking.d.ts.map +1 -0
- package/dist/core/thinking.js +83 -0
- package/dist/core/thinking.js.map +1 -0
- package/dist/core/thread-bindings.d.ts +47 -0
- package/dist/core/thread-bindings.d.ts.map +1 -0
- package/dist/core/thread-bindings.js +94 -0
- package/dist/core/thread-bindings.js.map +1 -0
- package/dist/core/timezone.d.ts +28 -0
- package/dist/core/timezone.d.ts.map +1 -0
- package/dist/core/timezone.js +72 -0
- package/dist/core/timezone.js.map +1 -0
- package/dist/core/tool-loop-detector.d.ts +41 -0
- package/dist/core/tool-loop-detector.d.ts.map +1 -0
- package/dist/core/tool-loop-detector.js +83 -0
- package/dist/core/tool-loop-detector.js.map +1 -0
- package/dist/core/tool-validator.d.ts +44 -0
- package/dist/core/tool-validator.d.ts.map +1 -0
- package/dist/core/tool-validator.js +175 -0
- package/dist/core/tool-validator.js.map +1 -0
- package/dist/core/typing.d.ts +25 -0
- package/dist/core/typing.d.ts.map +1 -0
- package/dist/core/typing.js +48 -0
- package/dist/core/typing.js.map +1 -0
- package/dist/core/usage-tracker.d.ts +66 -0
- package/dist/core/usage-tracker.d.ts.map +1 -0
- package/dist/core/usage-tracker.js +163 -0
- package/dist/core/usage-tracker.js.map +1 -0
- package/dist/daemon/commands.d.ts +16 -0
- package/dist/daemon/commands.d.ts.map +1 -0
- package/dist/daemon/commands.js +445 -0
- package/dist/daemon/commands.js.map +1 -0
- package/dist/daemon/pid.d.ts +30 -0
- package/dist/daemon/pid.d.ts.map +1 -0
- package/dist/daemon/pid.js +62 -0
- package/dist/daemon/pid.js.map +1 -0
- package/dist/doctor/checks/browser.d.ts +9 -0
- package/dist/doctor/checks/browser.d.ts.map +1 -0
- package/dist/doctor/checks/browser.js +54 -0
- package/dist/doctor/checks/browser.js.map +1 -0
- package/dist/doctor/checks/channels.d.ts +9 -0
- package/dist/doctor/checks/channels.d.ts.map +1 -0
- package/dist/doctor/checks/channels.js +90 -0
- package/dist/doctor/checks/channels.js.map +1 -0
- package/dist/doctor/checks/config.d.ts +10 -0
- package/dist/doctor/checks/config.d.ts.map +1 -0
- package/dist/doctor/checks/config.js +89 -0
- package/dist/doctor/checks/config.js.map +1 -0
- package/dist/doctor/checks/memory.d.ts +10 -0
- package/dist/doctor/checks/memory.d.ts.map +1 -0
- package/dist/doctor/checks/memory.js +82 -0
- package/dist/doctor/checks/memory.js.map +1 -0
- package/dist/doctor/checks/permissions.d.ts +9 -0
- package/dist/doctor/checks/permissions.d.ts.map +1 -0
- package/dist/doctor/checks/permissions.js +53 -0
- package/dist/doctor/checks/permissions.js.map +1 -0
- package/dist/doctor/checks/providers.d.ts +10 -0
- package/dist/doctor/checks/providers.d.ts.map +1 -0
- package/dist/doctor/checks/providers.js +93 -0
- package/dist/doctor/checks/providers.js.map +1 -0
- package/dist/doctor/checks/sessions.d.ts +10 -0
- package/dist/doctor/checks/sessions.d.ts.map +1 -0
- package/dist/doctor/checks/sessions.js +86 -0
- package/dist/doctor/checks/sessions.js.map +1 -0
- package/dist/doctor/doctor.d.ts +35 -0
- package/dist/doctor/doctor.d.ts.map +1 -0
- package/dist/doctor/doctor.js +51 -0
- package/dist/doctor/doctor.js.map +1 -0
- package/dist/doctor/repairs.d.ts +14 -0
- package/dist/doctor/repairs.d.ts.map +1 -0
- package/dist/doctor/repairs.js +34 -0
- package/dist/doctor/repairs.js.map +1 -0
- package/dist/gateway/compaction.d.ts +63 -0
- package/dist/gateway/compaction.d.ts.map +1 -0
- package/dist/gateway/compaction.js +235 -0
- package/dist/gateway/compaction.js.map +1 -0
- package/dist/gateway/gateway.d.ts +94 -0
- package/dist/gateway/gateway.d.ts.map +1 -0
- package/dist/gateway/gateway.js +466 -0
- package/dist/gateway/gateway.js.map +1 -0
- package/dist/gateway/lock.d.ts +24 -0
- package/dist/gateway/lock.d.ts.map +1 -0
- package/dist/gateway/lock.js +88 -0
- package/dist/gateway/lock.js.map +1 -0
- package/dist/gateway/protocol.d.ts +117 -0
- package/dist/gateway/protocol.d.ts.map +1 -0
- package/dist/gateway/protocol.js +5 -0
- package/dist/gateway/protocol.js.map +1 -0
- package/dist/gateway/session.d.ts +123 -0
- package/dist/gateway/session.d.ts.map +1 -0
- package/dist/gateway/session.js +573 -0
- package/dist/gateway/session.js.map +1 -0
- package/dist/hooks/hooks.d.ts +18 -0
- package/dist/hooks/hooks.d.ts.map +1 -0
- package/dist/hooks/hooks.js +45 -0
- package/dist/hooks/hooks.js.map +1 -0
- package/dist/hooks/types.d.ts +112 -0
- package/dist/hooks/types.d.ts.map +1 -0
- package/dist/hooks/types.js +23 -0
- package/dist/hooks/types.js.map +1 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2900 -0
- package/dist/index.js.map +1 -0
- package/dist/media/storage.d.ts +25 -0
- package/dist/media/storage.d.ts.map +1 -0
- package/dist/media/storage.js +97 -0
- package/dist/media/storage.js.map +1 -0
- package/dist/memory/embeddings.d.ts +46 -0
- package/dist/memory/embeddings.d.ts.map +1 -0
- package/dist/memory/embeddings.js +118 -0
- package/dist/memory/embeddings.js.map +1 -0
- package/dist/memory/hybrid.d.ts +35 -0
- package/dist/memory/hybrid.d.ts.map +1 -0
- package/dist/memory/hybrid.js +156 -0
- package/dist/memory/hybrid.js.map +1 -0
- package/dist/memory/markdown.d.ts +48 -0
- package/dist/memory/markdown.d.ts.map +1 -0
- package/dist/memory/markdown.js +228 -0
- package/dist/memory/markdown.js.map +1 -0
- package/dist/memory/store.d.ts +88 -0
- package/dist/memory/store.d.ts.map +1 -0
- package/dist/memory/store.js +21 -0
- package/dist/memory/store.js.map +1 -0
- package/dist/memory/vector.d.ts +24 -0
- package/dist/memory/vector.d.ts.map +1 -0
- package/dist/memory/vector.js +63 -0
- package/dist/memory/vector.js.map +1 -0
- package/dist/mods/mod.d.ts +100 -0
- package/dist/mods/mod.d.ts.map +1 -0
- package/dist/mods/mod.js +242 -0
- package/dist/mods/mod.js.map +1 -0
- package/dist/onboard/channels.d.ts +12 -0
- package/dist/onboard/channels.d.ts.map +1 -0
- package/dist/onboard/channels.js +283 -0
- package/dist/onboard/channels.js.map +1 -0
- package/dist/onboard/models.d.ts +13 -0
- package/dist/onboard/models.d.ts.map +1 -0
- package/dist/onboard/models.js +491 -0
- package/dist/onboard/models.js.map +1 -0
- package/dist/onboard/onboard.d.ts +12 -0
- package/dist/onboard/onboard.d.ts.map +1 -0
- package/dist/onboard/onboard.js +1137 -0
- package/dist/onboard/onboard.js.map +1 -0
- package/dist/providers/anthropic.d.ts +83 -0
- package/dist/providers/anthropic.d.ts.map +1 -0
- package/dist/providers/anthropic.js +583 -0
- package/dist/providers/anthropic.js.map +1 -0
- package/dist/providers/failover.d.ts +46 -0
- package/dist/providers/failover.d.ts.map +1 -0
- package/dist/providers/failover.js +149 -0
- package/dist/providers/failover.js.map +1 -0
- package/dist/providers/litellm.d.ts +38 -0
- package/dist/providers/litellm.d.ts.map +1 -0
- package/dist/providers/litellm.js +349 -0
- package/dist/providers/litellm.js.map +1 -0
- package/dist/providers/openai.d.ts +28 -0
- package/dist/providers/openai.d.ts.map +1 -0
- package/dist/providers/openai.js +321 -0
- package/dist/providers/openai.js.map +1 -0
- package/dist/providers/prompt-cache.d.ts +50 -0
- package/dist/providers/prompt-cache.d.ts.map +1 -0
- package/dist/providers/prompt-cache.js +96 -0
- package/dist/providers/prompt-cache.js.map +1 -0
- package/dist/providers/provider.d.ts +173 -0
- package/dist/providers/provider.d.ts.map +1 -0
- package/dist/providers/provider.js +22 -0
- package/dist/providers/provider.js.map +1 -0
- package/dist/sandbox/config.d.ts +42 -0
- package/dist/sandbox/config.d.ts.map +1 -0
- package/dist/sandbox/config.js +20 -0
- package/dist/sandbox/config.js.map +1 -0
- package/dist/sandbox/container.d.ts +71 -0
- package/dist/sandbox/container.d.ts.map +1 -0
- package/dist/sandbox/container.js +193 -0
- package/dist/sandbox/container.js.map +1 -0
- package/dist/sandbox/sandbox.d.ts +82 -0
- package/dist/sandbox/sandbox.d.ts.map +1 -0
- package/dist/sandbox/sandbox.js +176 -0
- package/dist/sandbox/sandbox.js.map +1 -0
- package/dist/skills/channel-loader.d.ts +18 -0
- package/dist/skills/channel-loader.d.ts.map +1 -0
- package/dist/skills/channel-loader.js +35 -0
- package/dist/skills/channel-loader.js.map +1 -0
- package/dist/skills/extension-loader.d.ts +15 -0
- package/dist/skills/extension-loader.d.ts.map +1 -0
- package/dist/skills/extension-loader.js +63 -0
- package/dist/skills/extension-loader.js.map +1 -0
- package/dist/skills/extension-registry.d.ts +32 -0
- package/dist/skills/extension-registry.d.ts.map +1 -0
- package/dist/skills/extension-registry.js +57 -0
- package/dist/skills/extension-registry.js.map +1 -0
- package/dist/skills/extensions.d.ts +91 -0
- package/dist/skills/extensions.d.ts.map +1 -0
- package/dist/skills/extensions.js +14 -0
- package/dist/skills/extensions.js.map +1 -0
- package/dist/skills/loader.d.ts +64 -0
- package/dist/skills/loader.d.ts.map +1 -0
- package/dist/skills/loader.js +382 -0
- package/dist/skills/loader.js.map +1 -0
- package/dist/skills/marketplace.d.ts +56 -0
- package/dist/skills/marketplace.d.ts.map +1 -0
- package/dist/skills/marketplace.js +183 -0
- package/dist/skills/marketplace.js.map +1 -0
- package/dist/skills/types.d.ts +94 -0
- package/dist/skills/types.d.ts.map +1 -0
- package/dist/skills/types.js +9 -0
- package/dist/skills/types.js.map +1 -0
- package/dist/tools/acp-sessions.d.ts +89 -0
- package/dist/tools/acp-sessions.d.ts.map +1 -0
- package/dist/tools/acp-sessions.js +391 -0
- package/dist/tools/acp-sessions.js.map +1 -0
- package/dist/tools/acp.d.ts +18 -0
- package/dist/tools/acp.d.ts.map +1 -0
- package/dist/tools/acp.js +102 -0
- package/dist/tools/acp.js.map +1 -0
- package/dist/tools/agent-tools.d.ts +24 -0
- package/dist/tools/agent-tools.d.ts.map +1 -0
- package/dist/tools/agent-tools.js +611 -0
- package/dist/tools/agent-tools.js.map +1 -0
- package/dist/tools/browser.d.ts +26 -0
- package/dist/tools/browser.d.ts.map +1 -0
- package/dist/tools/browser.js +242 -0
- package/dist/tools/browser.js.map +1 -0
- package/dist/tools/comms.d.ts +8 -0
- package/dist/tools/comms.d.ts.map +1 -0
- package/dist/tools/comms.js +39 -0
- package/dist/tools/comms.js.map +1 -0
- package/dist/tools/cron-tools.d.ts +9 -0
- package/dist/tools/cron-tools.d.ts.map +1 -0
- package/dist/tools/cron-tools.js +117 -0
- package/dist/tools/cron-tools.js.map +1 -0
- package/dist/tools/exec-safety.d.ts +71 -0
- package/dist/tools/exec-safety.d.ts.map +1 -0
- package/dist/tools/exec-safety.js +141 -0
- package/dist/tools/exec-safety.js.map +1 -0
- package/dist/tools/exec.d.ts +24 -0
- package/dist/tools/exec.d.ts.map +1 -0
- package/dist/tools/exec.js +191 -0
- package/dist/tools/exec.js.map +1 -0
- package/dist/tools/fs.d.ts +15 -0
- package/dist/tools/fs.d.ts.map +1 -0
- package/dist/tools/fs.js +249 -0
- package/dist/tools/fs.js.map +1 -0
- package/dist/tools/git.d.ts +9 -0
- package/dist/tools/git.d.ts.map +1 -0
- package/dist/tools/git.js +56 -0
- package/dist/tools/git.js.map +1 -0
- package/dist/tools/image.d.ts +15 -0
- package/dist/tools/image.d.ts.map +1 -0
- package/dist/tools/image.js +106 -0
- package/dist/tools/image.js.map +1 -0
- package/dist/tools/introspect.d.ts +22 -0
- package/dist/tools/introspect.d.ts.map +1 -0
- package/dist/tools/introspect.js +223 -0
- package/dist/tools/introspect.js.map +1 -0
- package/dist/tools/memory.d.ts +11 -0
- package/dist/tools/memory.d.ts.map +1 -0
- package/dist/tools/memory.js +101 -0
- package/dist/tools/memory.js.map +1 -0
- package/dist/tools/message.d.ts +24 -0
- package/dist/tools/message.d.ts.map +1 -0
- package/dist/tools/message.js +205 -0
- package/dist/tools/message.js.map +1 -0
- package/dist/tools/model.d.ts +14 -0
- package/dist/tools/model.d.ts.map +1 -0
- package/dist/tools/model.js +62 -0
- package/dist/tools/model.js.map +1 -0
- package/dist/tools/policy.d.ts +101 -0
- package/dist/tools/policy.d.ts.map +1 -0
- package/dist/tools/policy.js +168 -0
- package/dist/tools/policy.js.map +1 -0
- package/dist/tools/registry.d.ts +52 -0
- package/dist/tools/registry.d.ts.map +1 -0
- package/dist/tools/registry.js +154 -0
- package/dist/tools/registry.js.map +1 -0
- package/dist/tools/search.d.ts +10 -0
- package/dist/tools/search.d.ts.map +1 -0
- package/dist/tools/search.js +78 -0
- package/dist/tools/search.js.map +1 -0
- package/dist/tools/session.d.ts +13 -0
- package/dist/tools/session.d.ts.map +1 -0
- package/dist/tools/session.js +142 -0
- package/dist/tools/session.js.map +1 -0
- package/dist/tools/spawn.d.ts +10 -0
- package/dist/tools/spawn.d.ts.map +1 -0
- package/dist/tools/spawn.js +72 -0
- package/dist/tools/spawn.js.map +1 -0
- package/dist/tools/symphony.d.ts +12 -0
- package/dist/tools/symphony.d.ts.map +1 -0
- package/dist/tools/symphony.js +142 -0
- package/dist/tools/symphony.js.map +1 -0
- package/dist/tools/system-tools.d.ts +11 -0
- package/dist/tools/system-tools.d.ts.map +1 -0
- package/dist/tools/system-tools.js +39 -0
- package/dist/tools/system-tools.js.map +1 -0
- package/dist/tools/tool.d.ts +119 -0
- package/dist/tools/tool.d.ts.map +1 -0
- package/dist/tools/tool.js +29 -0
- package/dist/tools/tool.js.map +1 -0
- package/dist/tools/web.d.ts +10 -0
- package/dist/tools/web.d.ts.map +1 -0
- package/dist/tools/web.js +105 -0
- package/dist/tools/web.js.map +1 -0
- package/dist/tui/App.d.ts +43 -0
- package/dist/tui/App.d.ts.map +1 -0
- package/dist/tui/App.js +265 -0
- package/dist/tui/App.js.map +1 -0
- package/dist/tui/bridge.d.ts +40 -0
- package/dist/tui/bridge.d.ts.map +1 -0
- package/dist/tui/bridge.js +29 -0
- package/dist/tui/bridge.js.map +1 -0
- package/dist/tui/components/Header.d.ts +14 -0
- package/dist/tui/components/Header.d.ts.map +1 -0
- package/dist/tui/components/Header.js +7 -0
- package/dist/tui/components/Header.js.map +1 -0
- package/dist/tui/components/InputBar.d.ts +10 -0
- package/dist/tui/components/InputBar.d.ts.map +1 -0
- package/dist/tui/components/InputBar.js +121 -0
- package/dist/tui/components/InputBar.js.map +1 -0
- package/dist/tui/components/MessageList.d.ts +18 -0
- package/dist/tui/components/MessageList.d.ts.map +1 -0
- package/dist/tui/components/MessageList.js +34 -0
- package/dist/tui/components/MessageList.js.map +1 -0
- package/dist/tui/components/Spinner.d.ts +9 -0
- package/dist/tui/components/Spinner.d.ts.map +1 -0
- package/dist/tui/components/Spinner.js +18 -0
- package/dist/tui/components/Spinner.js.map +1 -0
- package/dist/tui/components/StatusBar.d.ts +16 -0
- package/dist/tui/components/StatusBar.d.ts.map +1 -0
- package/dist/tui/components/StatusBar.js +15 -0
- package/dist/tui/components/StatusBar.js.map +1 -0
- package/dist/tui/components/ToolCallBox.d.ts +12 -0
- package/dist/tui/components/ToolCallBox.d.ts.map +1 -0
- package/dist/tui/components/ToolCallBox.js +12 -0
- package/dist/tui/components/ToolCallBox.js.map +1 -0
- package/dist/tui/theme.d.ts +58 -0
- package/dist/tui/theme.d.ts.map +1 -0
- package/dist/tui/theme.js +80 -0
- package/dist/tui/theme.js.map +1 -0
- package/dist/utils/logger.d.ts +16 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +70 -0
- package/dist/utils/logger.js.map +1 -0
- package/docs/DEVELOPMENT.md +74 -0
- package/docs/INSTALL.md +161 -0
- package/docs/USAGE.md +94 -0
- package/docs/architecture.md +128 -0
- package/docs/channels.md +140 -0
- package/docs/configuration.md +209 -0
- package/docs/io-system.md +430 -0
- package/docs/providers.md +99 -0
- package/docs/skill-channels.md +113 -0
- package/docs/skills.md +246 -0
- package/package.json +89 -0
- package/skills/acp-router/SKILL.md +41 -0
- package/skills/acp-router/tools/acp-router.mjs +239 -0
- package/skills/find-skills/SKILL.md +133 -0
- package/skills/security-audit/SKILL.md +181 -0
- package/skills/security-audit/audit.sh +67 -0
- package/skills/skill-creator/SKILL.md +479 -0
- package/skills/skill-security-audit/.clawhub/origin.json +7 -0
- package/skills/skill-security-audit/SKILL.md +196 -0
- package/skills/skill-security-audit/_meta.json +6 -0
- package/skills/skill-security-audit/references/prompt-injection-patterns.md +276 -0
- package/skills/skill-security-audit/references/vulnerability-patterns.md +348 -0
- package/skills/symphony/README.md +53 -0
- package/skills/symphony/SKILL.md +75 -0
- package/skills/symphony/tools/symphony-orchestrator.ts +8 -0
- package/tako.example.json +33 -0
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# Contributing to Tako
|
|
2
|
+
|
|
3
|
+
Thanks for contributing.
|
|
4
|
+
|
|
5
|
+
## Before you start
|
|
6
|
+
|
|
7
|
+
- Read `README.md`
|
|
8
|
+
- Read `docs/DEVELOPMENT.md`
|
|
9
|
+
- Run the project locally once
|
|
10
|
+
|
|
11
|
+
## Local setup
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
git clone https://github.com/shuyhere/tako.git
|
|
15
|
+
cd tako
|
|
16
|
+
npm install
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Development workflow
|
|
20
|
+
|
|
21
|
+
1. Create a branch
|
|
22
|
+
2. Make focused changes
|
|
23
|
+
3. Add/update tests when behavior changes
|
|
24
|
+
4. Run checks
|
|
25
|
+
5. Open PR with clear summary
|
|
26
|
+
|
|
27
|
+
## Required checks
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npm run typecheck
|
|
31
|
+
npm test
|
|
32
|
+
npm run build
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Or all-in-one:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npm run check
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Coding standards
|
|
42
|
+
|
|
43
|
+
- TypeScript strict mode
|
|
44
|
+
- ESM modules
|
|
45
|
+
- Keep diffs small and reversible
|
|
46
|
+
- Prefer reuse over duplicate abstractions
|
|
47
|
+
- Update docs for user-visible behavior changes
|
|
48
|
+
|
|
49
|
+
## Docs standards
|
|
50
|
+
|
|
51
|
+
If you change install/run/developer behavior, update:
|
|
52
|
+
|
|
53
|
+
- `README.md`
|
|
54
|
+
- `docs/INSTALL.md`
|
|
55
|
+
- `docs/USAGE.md`
|
|
56
|
+
- `docs/DEVELOPMENT.md`
|
|
57
|
+
|
|
58
|
+
## PR expectations
|
|
59
|
+
|
|
60
|
+
Use descriptive PR titles and include:
|
|
61
|
+
|
|
62
|
+
- problem statement
|
|
63
|
+
- solution summary
|
|
64
|
+
- test evidence
|
|
65
|
+
- risks and rollback notes
|
|
66
|
+
|
|
67
|
+
Use the PR template in `.github/PULL_REQUEST_TEMPLATE.md`.
|
|
68
|
+
|
|
69
|
+
## Security
|
|
70
|
+
|
|
71
|
+
- Do not commit secrets/tokens
|
|
72
|
+
- Do not weaken safety defaults without explicit discussion
|
|
73
|
+
- Call out security-impacting changes clearly in PR
|
|
74
|
+
|
|
75
|
+
## Suggested commit style
|
|
76
|
+
|
|
77
|
+
Conventional prefixes:
|
|
78
|
+
|
|
79
|
+
- `feat:`
|
|
80
|
+
- `fix:`
|
|
81
|
+
- `refactor:`
|
|
82
|
+
- `docs:`
|
|
83
|
+
- `test:`
|
|
84
|
+
- `chore:`
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 shuyhere
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
# Tako 🐙
|
|
2
|
+
|
|
3
|
+
**Agent-as-CPU OS** — minimal core runtime + pluggable skill arms.
|
|
4
|
+
|
|
5
|
+
Tako is a multi-channel AI agent runtime you can run locally or on a server. It supports CLI, Discord, Telegram, tool execution, memory, sessions, and hot-reloadable skills.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## What you get
|
|
10
|
+
|
|
11
|
+
- Minimal kernel with clear interfaces (provider/channel/tools/memory/hooks)
|
|
12
|
+
- Pluggable skills (`SKILL.md` + optional `tools/*`)
|
|
13
|
+
- Multi-channel operation from one runtime (CLI + Discord + Telegram)
|
|
14
|
+
- Session persistence + compaction
|
|
15
|
+
- Tool profiles (`minimal`, `coding`, `full`)
|
|
16
|
+
- Daemon mode with status/restart/tui attach
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Install
|
|
21
|
+
|
|
22
|
+
### Option A — npm
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npm install -g @shuyhere/takotako
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Or with Bun:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
bun add -g @shuyhere/takotako
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Then run:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
tako onboard
|
|
38
|
+
tako start -d ## preferred: run in background after onboard
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Option B — install from GitHub source
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
npm install -g github:shuyhere/tako
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Option C — from source
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
git clone https://github.com/shuyhere/tako.git
|
|
51
|
+
cd tako
|
|
52
|
+
npm install
|
|
53
|
+
npm run build
|
|
54
|
+
npm link
|
|
55
|
+
|
|
56
|
+
tako onboard
|
|
57
|
+
tako start -d ## preferred: run in background after onboard
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
For detailed setup and platform notes, see **[docs/INSTALL.md](docs/INSTALL.md)**.
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## Quick usage
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
tako start # foreground
|
|
68
|
+
tako start -d # daemon
|
|
69
|
+
tako status # health + runtime info
|
|
70
|
+
tako tui # attach TUI to daemon
|
|
71
|
+
tako stop # stop daemon
|
|
72
|
+
tako restart # restart daemon
|
|
73
|
+
|
|
74
|
+
tako doctor # health diagnostics
|
|
75
|
+
tako models list # list models
|
|
76
|
+
tako models auth login --provider anthropic
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Inside chat/CLI, built-in commands include:
|
|
80
|
+
|
|
81
|
+
- `/help`
|
|
82
|
+
- `/status`
|
|
83
|
+
- `/model`
|
|
84
|
+
- `/agents`
|
|
85
|
+
- `/queue`
|
|
86
|
+
- `/usage`
|
|
87
|
+
|
|
88
|
+
See **[docs/USAGE.md](docs/USAGE.md)** for full command and workflow docs.
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## Recommended setup
|
|
93
|
+
|
|
94
|
+
For the best day-to-day control surface, use Discord and invite your bot to a server.
|
|
95
|
+
Then run Tako in daemon mode and manage it with slash commands as your live dashboard (`/status`, `/models`, `/agents`, `/queue`, `/usage`).
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
tako onboard
|
|
99
|
+
tako start -d
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## Configuration
|
|
105
|
+
|
|
106
|
+
Main config path:
|
|
107
|
+
|
|
108
|
+
- `~/.tako/tako.json`
|
|
109
|
+
|
|
110
|
+
You can bootstrap config via:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
tako onboard
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Template example:
|
|
117
|
+
|
|
118
|
+
- `tako.example.json`
|
|
119
|
+
|
|
120
|
+
Reference docs:
|
|
121
|
+
|
|
122
|
+
- **[docs/configuration.md](docs/configuration.md)**
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
## Skills
|
|
127
|
+
|
|
128
|
+
Skill directory structure:
|
|
129
|
+
|
|
130
|
+
```text
|
|
131
|
+
skills/my-skill/
|
|
132
|
+
├── SKILL.md
|
|
133
|
+
└── tools/
|
|
134
|
+
└── my-tool.mjs
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
- `SKILL.md` frontmatter controls metadata, triggers, and command dispatch
|
|
138
|
+
- tools are loaded dynamically
|
|
139
|
+
|
|
140
|
+
See:
|
|
141
|
+
|
|
142
|
+
- **[docs/skills.md](docs/skills.md)**
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## Developer guide
|
|
147
|
+
|
|
148
|
+
If you want to contribute or run Tako in dev mode:
|
|
149
|
+
|
|
150
|
+
- **[docs/DEVELOPMENT.md](docs/DEVELOPMENT.md)**
|
|
151
|
+
- **[CONTRIBUTING.md](CONTRIBUTING.md)**
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
## Security notes
|
|
156
|
+
|
|
157
|
+
- Keep `~/.tako/tako.json` and tokens private
|
|
158
|
+
- Use restrictive tool profile in production (`minimal`/`coding` where possible)
|
|
159
|
+
- Restrict Discord/Telegram bot scopes and allowed users/channels
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
## License
|
|
164
|
+
|
|
165
|
+
MIT — see [LICENSE](LICENSE).
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
## Thanks
|
|
170
|
+
|
|
171
|
+
Tako is informed by the broader agent tooling ecosystem. Special thanks to projects and communities that explored these patterns early, including OpenClaw and ZeroClaw.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent-to-Agent Communication — message passing between agents.
|
|
3
|
+
*
|
|
4
|
+
* Supports:
|
|
5
|
+
* - Direct send: agent A → agent B (message processed as new user message)
|
|
6
|
+
* - Broadcast: agent A → all agents
|
|
7
|
+
* - History: stored in ~/.tako/agents/comms/<from>-<to>.jsonl
|
|
8
|
+
*/
|
|
9
|
+
export interface AgentMessage {
|
|
10
|
+
id: string;
|
|
11
|
+
from: string;
|
|
12
|
+
to: string;
|
|
13
|
+
content: string;
|
|
14
|
+
timestamp: number;
|
|
15
|
+
replyTo?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface CommsConfig {
|
|
18
|
+
/** Enable agent communication (default: true). */
|
|
19
|
+
enabled: boolean;
|
|
20
|
+
/** Which agents can talk to whom. Empty = unrestricted. */
|
|
21
|
+
allowList?: Record<string, string[]>;
|
|
22
|
+
}
|
|
23
|
+
export type MessageHandler = (toAgent: string, message: AgentMessage) => Promise<string>;
|
|
24
|
+
export declare class AgentComms {
|
|
25
|
+
private config;
|
|
26
|
+
private commsDir;
|
|
27
|
+
private handler;
|
|
28
|
+
constructor(config: CommsConfig, commsDir?: string);
|
|
29
|
+
/** Wire the message handler (called when a message needs to be processed by the receiving agent). */
|
|
30
|
+
setHandler(handler: MessageHandler): void;
|
|
31
|
+
/**
|
|
32
|
+
* Send a message from one agent to another.
|
|
33
|
+
* Returns the receiving agent's response.
|
|
34
|
+
*/
|
|
35
|
+
send(fromAgent: string, toAgent: string, content: string, replyTo?: string): Promise<string>;
|
|
36
|
+
/**
|
|
37
|
+
* Broadcast a message from one agent to all agents.
|
|
38
|
+
* Returns a map of agentId → response.
|
|
39
|
+
*/
|
|
40
|
+
broadcast(fromAgent: string, content: string, agentIds: string[]): Promise<Map<string, string>>;
|
|
41
|
+
/**
|
|
42
|
+
* Get message history between two agents.
|
|
43
|
+
*/
|
|
44
|
+
getHistory(agentA: string, agentB: string, limit?: number): Promise<AgentMessage[]>;
|
|
45
|
+
private persistMessage;
|
|
46
|
+
private getHistoryPath;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=communication.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"communication.d.ts","sourceRoot":"","sources":["../../src/agents/communication.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAQH,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,WAAW;IAC1B,kDAAkD;IAClD,OAAO,EAAE,OAAO,CAAC;IACjB,2DAA2D;IAC3D,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;CACtC;AAED,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;AAIzF,qBAAa,UAAU;IACrB,OAAO,CAAC,MAAM,CAAc;IAC5B,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,OAAO,CAA+B;gBAElC,MAAM,EAAE,WAAW,EAAE,QAAQ,CAAC,EAAE,MAAM;IAKlD,qGAAqG;IACrG,UAAU,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI;IAIzC;;;OAGG;IACG,IAAI,CACR,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,MAAM,CAAC;IA8ClB;;;OAGG;IACG,SAAS,CACb,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAAE,GACjB,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAgB/B;;OAEG;IACG,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,SAAK,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;YA2BvE,cAAc;IAM5B,OAAO,CAAC,cAAc;CAGvB"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent-to-Agent Communication — message passing between agents.
|
|
3
|
+
*
|
|
4
|
+
* Supports:
|
|
5
|
+
* - Direct send: agent A → agent B (message processed as new user message)
|
|
6
|
+
* - Broadcast: agent A → all agents
|
|
7
|
+
* - History: stored in ~/.tako/agents/comms/<from>-<to>.jsonl
|
|
8
|
+
*/
|
|
9
|
+
import { appendFile, mkdir, readFile } from 'node:fs/promises';
|
|
10
|
+
import { join } from 'node:path';
|
|
11
|
+
import { homedir } from 'node:os';
|
|
12
|
+
// ─── Agent Communication Hub ────────────────────────────────────────
|
|
13
|
+
export class AgentComms {
|
|
14
|
+
config;
|
|
15
|
+
commsDir;
|
|
16
|
+
handler = null;
|
|
17
|
+
constructor(config, commsDir) {
|
|
18
|
+
this.config = config;
|
|
19
|
+
this.commsDir = commsDir ?? join(homedir(), '.tako', 'agents', 'comms');
|
|
20
|
+
}
|
|
21
|
+
/** Wire the message handler (called when a message needs to be processed by the receiving agent). */
|
|
22
|
+
setHandler(handler) {
|
|
23
|
+
this.handler = handler;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Send a message from one agent to another.
|
|
27
|
+
* Returns the receiving agent's response.
|
|
28
|
+
*/
|
|
29
|
+
async send(fromAgent, toAgent, content, replyTo) {
|
|
30
|
+
if (!this.config.enabled) {
|
|
31
|
+
throw new Error('Agent communication is disabled');
|
|
32
|
+
}
|
|
33
|
+
// Check allow list
|
|
34
|
+
if (this.config.allowList) {
|
|
35
|
+
const allowed = this.config.allowList[fromAgent];
|
|
36
|
+
if (allowed && !allowed.includes(toAgent)) {
|
|
37
|
+
throw new Error(`Agent ${fromAgent} is not allowed to message ${toAgent}`);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
const message = {
|
|
41
|
+
id: crypto.randomUUID(),
|
|
42
|
+
from: fromAgent,
|
|
43
|
+
to: toAgent,
|
|
44
|
+
content,
|
|
45
|
+
timestamp: Date.now(),
|
|
46
|
+
replyTo,
|
|
47
|
+
};
|
|
48
|
+
// Persist to history
|
|
49
|
+
await this.persistMessage(message);
|
|
50
|
+
// Deliver to handler
|
|
51
|
+
if (!this.handler) {
|
|
52
|
+
throw new Error('No message handler configured — agent loop not started');
|
|
53
|
+
}
|
|
54
|
+
const response = await this.handler(toAgent, message);
|
|
55
|
+
// Persist the response as a reply
|
|
56
|
+
const reply = {
|
|
57
|
+
id: crypto.randomUUID(),
|
|
58
|
+
from: toAgent,
|
|
59
|
+
to: fromAgent,
|
|
60
|
+
content: response,
|
|
61
|
+
timestamp: Date.now(),
|
|
62
|
+
replyTo: message.id,
|
|
63
|
+
};
|
|
64
|
+
await this.persistMessage(reply);
|
|
65
|
+
return response;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Broadcast a message from one agent to all agents.
|
|
69
|
+
* Returns a map of agentId → response.
|
|
70
|
+
*/
|
|
71
|
+
async broadcast(fromAgent, content, agentIds) {
|
|
72
|
+
const results = new Map();
|
|
73
|
+
for (const agentId of agentIds) {
|
|
74
|
+
if (agentId === fromAgent)
|
|
75
|
+
continue;
|
|
76
|
+
try {
|
|
77
|
+
const response = await this.send(fromAgent, agentId, content);
|
|
78
|
+
results.set(agentId, response);
|
|
79
|
+
}
|
|
80
|
+
catch (err) {
|
|
81
|
+
results.set(agentId, `[error: ${err instanceof Error ? err.message : String(err)}]`);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return results;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Get message history between two agents.
|
|
88
|
+
*/
|
|
89
|
+
async getHistory(agentA, agentB, limit = 50) {
|
|
90
|
+
const messages = [];
|
|
91
|
+
// Check both directions
|
|
92
|
+
for (const [from, to] of [[agentA, agentB], [agentB, agentA]]) {
|
|
93
|
+
const filePath = this.getHistoryPath(from, to);
|
|
94
|
+
try {
|
|
95
|
+
const raw = await readFile(filePath, 'utf-8');
|
|
96
|
+
for (const line of raw.trim().split('\n').filter(Boolean)) {
|
|
97
|
+
try {
|
|
98
|
+
messages.push(JSON.parse(line));
|
|
99
|
+
}
|
|
100
|
+
catch {
|
|
101
|
+
// skip corrupt lines
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
catch {
|
|
106
|
+
// No history file
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
// Sort by timestamp and return last N
|
|
110
|
+
messages.sort((a, b) => a.timestamp - b.timestamp);
|
|
111
|
+
return messages.slice(-limit);
|
|
112
|
+
}
|
|
113
|
+
// ─── Private ────────────────────────────────────────────────────
|
|
114
|
+
async persistMessage(msg) {
|
|
115
|
+
const filePath = this.getHistoryPath(msg.from, msg.to);
|
|
116
|
+
await mkdir(join(filePath, '..'), { recursive: true });
|
|
117
|
+
await appendFile(filePath, JSON.stringify(msg) + '\n', 'utf-8');
|
|
118
|
+
}
|
|
119
|
+
getHistoryPath(from, to) {
|
|
120
|
+
return join(this.commsDir, `${from}-${to}.jsonl`);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
//# sourceMappingURL=communication.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"communication.js","sourceRoot":"","sources":["../../src/agents/communication.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAsBlC,uEAAuE;AAEvE,MAAM,OAAO,UAAU;IACb,MAAM,CAAc;IACpB,QAAQ,CAAS;IACjB,OAAO,GAA0B,IAAI,CAAC;IAE9C,YAAY,MAAmB,EAAE,QAAiB;QAChD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,QAAQ,GAAG,QAAQ,IAAI,IAAI,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC1E,CAAC;IAED,qGAAqG;IACrG,UAAU,CAAC,OAAuB;QAChC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,IAAI,CACR,SAAiB,EACjB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KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;oBAC1D,IAAI,CAAC;wBACH,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAiB,CAAC,CAAC;oBAClD,CAAC;oBAAC,MAAM,CAAC;wBACP,qBAAqB;oBACvB,CAAC;gBACH,CAAC;YACH,CAAC;YAAC,MAAM,CAAC;gBACP,kBAAkB;YACpB,CAAC;QACH,CAAC;QAED,sCAAsC;QACtC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC;QACnD,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC;IAChC,CAAC;IAED,mEAAmE;IAE3D,KAAK,CAAC,cAAc,CAAC,GAAiB;QAC5C,MAAM,QAAQ,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC;QACvD,MAAM,KAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QACvD,MAAM,UAAU,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,IAAI,EAAE,OAAO,CAAC,CAAC;IAClE,CAAC;IAEO,cAAc,CAAC,IAAY,EAAE,EAAU;QAC7C,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,IAAI,IAAI,EAAE,QAAQ,CAAC,CAAC;IACpD,CAAC;CACF"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent config — per-agent configuration, channel bindings, spawn allowlists.
|
|
3
|
+
*
|
|
4
|
+
* Each agent is an isolated brain with its own workspace, model preferences,
|
|
5
|
+
* and channel routing rules.
|
|
6
|
+
*/
|
|
7
|
+
import type { AgentBindings } from '../config/schema.js';
|
|
8
|
+
/** Runtime agent descriptor (resolved from config + defaults). */
|
|
9
|
+
export interface AgentDescriptor {
|
|
10
|
+
/** Unique agent ID. */
|
|
11
|
+
id: string;
|
|
12
|
+
/** Resolved workspace path (absolute). */
|
|
13
|
+
workspace: string;
|
|
14
|
+
/** State directory for agent-specific data. */
|
|
15
|
+
stateDir: string;
|
|
16
|
+
/** Session persistence directory. */
|
|
17
|
+
sessionDir: string;
|
|
18
|
+
/** Primary model ID (e.g. 'anthropic/claude-sonnet-4-6'). */
|
|
19
|
+
model: string;
|
|
20
|
+
/** Channel bindings. */
|
|
21
|
+
bindings: AgentBindings;
|
|
22
|
+
/** Which agent IDs this agent can spawn as sub-agents. */
|
|
23
|
+
canSpawn: string[];
|
|
24
|
+
/** Agent description. */
|
|
25
|
+
description: string;
|
|
26
|
+
/** Whether this is the default "main" agent. */
|
|
27
|
+
isMain: boolean;
|
|
28
|
+
/** Permission role name (admin, operator, standard, restricted, readonly). */
|
|
29
|
+
role: string;
|
|
30
|
+
/** Per-agent skill directories (appended to global dirs at runtime). */
|
|
31
|
+
skills?: {
|
|
32
|
+
dirs: string[];
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Resolve a channel message to the correct agent ID based on bindings.
|
|
37
|
+
*
|
|
38
|
+
* @param agents - List of agent descriptors
|
|
39
|
+
* @param channelType - Channel type ('discord', 'telegram', 'cli')
|
|
40
|
+
* @param channelTarget - Channel-specific target (channel name, user ID, etc.)
|
|
41
|
+
* @returns The matching agent ID, or 'main' if no binding matches
|
|
42
|
+
*/
|
|
43
|
+
export declare function resolveAgentForChannel(agents: AgentDescriptor[], channelType: string, channelTarget: string, guildId?: string): string;
|
|
44
|
+
/**
|
|
45
|
+
* Check if an agent is allowed to spawn a sub-agent.
|
|
46
|
+
*
|
|
47
|
+
* @param parent - Parent agent descriptor
|
|
48
|
+
* @param targetAgentId - ID of the agent to spawn
|
|
49
|
+
* @returns true if spawning is allowed
|
|
50
|
+
*/
|
|
51
|
+
export declare function canAgentSpawn(parent: AgentDescriptor, targetAgentId: string): boolean;
|
|
52
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/agents/config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAc,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAErE,kEAAkE;AAClE,MAAM,WAAW,eAAe;IAC9B,uBAAuB;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,0CAA0C;IAC1C,SAAS,EAAE,MAAM,CAAC;IAClB,+CAA+C;IAC/C,QAAQ,EAAE,MAAM,CAAC;IACjB,qCAAqC;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,6DAA6D;IAC7D,KAAK,EAAE,MAAM,CAAC;IACd,wBAAwB;IACxB,QAAQ,EAAE,aAAa,CAAC;IACxB,0DAA0D;IAC1D,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,yBAAyB;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,gDAAgD;IAChD,MAAM,EAAE,OAAO,CAAC;IAChB,8EAA8E;IAC9E,IAAI,EAAE,MAAM,CAAC;IACb,wEAAwE;IACxE,MAAM,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;CAC7B;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,eAAe,EAAE,EACzB,WAAW,EAAE,MAAM,EACnB,aAAa,EAAE,MAAM,EACrB,OAAO,CAAC,EAAE,MAAM,GACf,MAAM,CAoCR;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,GAAG,OAAO,CAMrF"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent config — per-agent configuration, channel bindings, spawn allowlists.
|
|
3
|
+
*
|
|
4
|
+
* Each agent is an isolated brain with its own workspace, model preferences,
|
|
5
|
+
* and channel routing rules.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Resolve a channel message to the correct agent ID based on bindings.
|
|
9
|
+
*
|
|
10
|
+
* @param agents - List of agent descriptors
|
|
11
|
+
* @param channelType - Channel type ('discord', 'telegram', 'cli')
|
|
12
|
+
* @param channelTarget - Channel-specific target (channel name, user ID, etc.)
|
|
13
|
+
* @returns The matching agent ID, or 'main' if no binding matches
|
|
14
|
+
*/
|
|
15
|
+
export function resolveAgentForChannel(agents, channelType, channelTarget, guildId) {
|
|
16
|
+
// Pass 1: exact channel/user/group binding
|
|
17
|
+
for (const agent of agents) {
|
|
18
|
+
if (!agent.bindings)
|
|
19
|
+
continue;
|
|
20
|
+
if (channelType === 'discord' && agent.bindings.discord) {
|
|
21
|
+
if (agent.bindings.discord.channels.includes(channelTarget)) {
|
|
22
|
+
return agent.id;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
if (channelType === 'telegram' && agent.bindings.telegram) {
|
|
26
|
+
if (agent.bindings.telegram.users?.includes(channelTarget)) {
|
|
27
|
+
return agent.id;
|
|
28
|
+
}
|
|
29
|
+
if (agent.bindings.telegram.groups?.includes(channelTarget)) {
|
|
30
|
+
return agent.id;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
if (channelType === 'cli' && agent.bindings.cli) {
|
|
34
|
+
return agent.id;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
// Pass 2: guild-level binding (Discord only)
|
|
38
|
+
if (channelType === 'discord' && guildId) {
|
|
39
|
+
for (const agent of agents) {
|
|
40
|
+
if (!agent.bindings?.discord)
|
|
41
|
+
continue;
|
|
42
|
+
if (agent.bindings.discord.channels.includes(guildId)) {
|
|
43
|
+
return agent.id;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return 'main';
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Check if an agent is allowed to spawn a sub-agent.
|
|
51
|
+
*
|
|
52
|
+
* @param parent - Parent agent descriptor
|
|
53
|
+
* @param targetAgentId - ID of the agent to spawn
|
|
54
|
+
* @returns true if spawning is allowed
|
|
55
|
+
*/
|
|
56
|
+
export function canAgentSpawn(parent, targetAgentId) {
|
|
57
|
+
// Main agent can spawn anything
|
|
58
|
+
if (parent.isMain)
|
|
59
|
+
return true;
|
|
60
|
+
// Empty allowlist means can spawn anything
|
|
61
|
+
if (parent.canSpawn.length === 0)
|
|
62
|
+
return true;
|
|
63
|
+
return parent.canSpawn.includes(targetAgentId);
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/agents/config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA8BH;;;;;;;GAOG;AACH,MAAM,UAAU,sBAAsB,CACpC,MAAyB,EACzB,WAAmB,EACnB,aAAqB,EACrB,OAAgB;IAEhB,2CAA2C;IAC3C,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,IAAI,CAAC,KAAK,CAAC,QAAQ;YAAE,SAAS;QAE9B,IAAI,WAAW,KAAK,SAAS,IAAI,KAAK,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;YACxD,IAAI,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC;gBAC5D,OAAO,KAAK,CAAC,EAAE,CAAC;YAClB,CAAC;QACH,CAAC;QAED,IAAI,WAAW,KAAK,UAAU,IAAI,KAAK,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC;YAC1D,IAAI,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,aAAa,CAAC,E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onboard or when the agent first queries models.
|
|
7
|
+
* Used by Model Picker and /models command.
|
|
8
|
+
* Refresh on demand via `tako models --refresh`.
|
|
9
|
+
*/
|
|
10
|
+
export type InputModality = 'text' | 'image' | 'audio' | 'video';
|
|
11
|
+
export interface ModelEntry {
|
|
12
|
+
id: string;
|
|
13
|
+
contextWindow?: number;
|
|
14
|
+
maxTokens?: number;
|
|
15
|
+
reasoning?: boolean;
|
|
16
|
+
input?: InputModality[];
|
|
17
|
+
}
|
|
18
|
+
export interface ProviderModels {
|
|
19
|
+
models: ModelEntry[];
|
|
20
|
+
lastRefreshed?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface ModelCatalog {
|
|
23
|
+
providers: Record<string, ProviderModels>;
|
|
24
|
+
}
|
|
25
|
+
export declare function loadModelCatalog(agentId: string): Promise<ModelCatalog>;
|
|
26
|
+
export declare function saveModelCatalog(agentId: string, catalog: ModelCatalog): Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* Update a single provider's model list in the catalog.
|
|
29
|
+
*/
|
|
30
|
+
export declare function updateProviderModels(agentId: string, provider: string, models: ModelEntry[]): Promise<void>;
|
|
31
|
+
/**
|
|
32
|
+
* Get all models across all providers for an agent.
|
|
33
|
+
*/
|
|
34
|
+
export declare function getAllModels(agentId: string): Promise<{
|
|
35
|
+
provider: string;
|
|
36
|
+
model: ModelEntry;
|
|
37
|
+
}[]>;
|
|
38
|
+
/**
|
|
39
|
+
* Find a specific model by ID across all providers.
|
|
40
|
+
*/
|
|
41
|
+
export declare function findModel(agentId: string, modelId: string): Promise<{
|
|
42
|
+
provider: string;
|
|
43
|
+
model: ModelEntry;
|
|
44
|
+
} | null>;
|
|
45
|
+
/**
|
|
46
|
+
* Seed the catalog with well-known Anthropic models.
|
|
47
|
+
*/
|
|
48
|
+
export declare function getDefaultAnthropicModels(): ModelEntry[];
|
|
49
|
+
//# sourceMappingURL=model-catalog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":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