aec-agent 1.0.0
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/README.md +1 -0
- package/dist/agent-core.d.ts +81 -0
- package/dist/agent-core.d.ts.map +1 -0
- package/dist/agent-core.js +168 -0
- package/dist/agent-core.js.map +1 -0
- package/dist/components/artifact-hub/agent-artifact-view.d.ts +31 -0
- package/dist/components/artifact-hub/agent-artifact-view.d.ts.map +1 -0
- package/dist/components/artifact-hub/agent-artifact-view.js +264 -0
- package/dist/components/artifact-hub/agent-artifact-view.js.map +1 -0
- package/dist/components/artifact-hub/artifact-hub.d.ts +25 -0
- package/dist/components/artifact-hub/artifact-hub.d.ts.map +1 -0
- package/dist/components/artifact-hub/artifact-hub.js +39 -0
- package/dist/components/artifact-hub/artifact-hub.js.map +1 -0
- package/dist/components/artifact-hub/types/artifact.d.ts +158 -0
- package/dist/components/artifact-hub/types/artifact.d.ts.map +1 -0
- package/dist/components/artifact-hub/types/artifact.js +14 -0
- package/dist/components/artifact-hub/types/artifact.js.map +1 -0
- package/dist/components/event-handler/event-dispatcher.d.ts +17 -0
- package/dist/components/event-handler/event-dispatcher.d.ts.map +1 -0
- package/dist/components/event-handler/event-dispatcher.js +47 -0
- package/dist/components/event-handler/event-dispatcher.js.map +1 -0
- package/dist/components/event-handler/events.d.ts +154 -0
- package/dist/components/event-handler/events.d.ts.map +1 -0
- package/dist/components/event-handler/events.js +28 -0
- package/dist/components/event-handler/events.js.map +1 -0
- package/dist/components/event-handler/types.d.ts +10 -0
- package/dist/components/event-handler/types.d.ts.map +1 -0
- package/dist/components/event-handler/types.js +2 -0
- package/dist/components/event-handler/types.js.map +1 -0
- package/dist/components/llm-provider-hub/llm-provider-hub.d.ts +14 -0
- package/dist/components/llm-provider-hub/llm-provider-hub.d.ts.map +1 -0
- package/dist/components/llm-provider-hub/llm-provider-hub.js +34 -0
- package/dist/components/llm-provider-hub/llm-provider-hub.js.map +1 -0
- package/dist/components/llm-provider-hub/providers/anthropic-provider.d.ts +22 -0
- package/dist/components/llm-provider-hub/providers/anthropic-provider.d.ts.map +1 -0
- package/dist/components/llm-provider-hub/providers/anthropic-provider.js +249 -0
- package/dist/components/llm-provider-hub/providers/anthropic-provider.js.map +1 -0
- package/dist/components/llm-provider-hub/providers/bedrock-provider.d.ts +28 -0
- package/dist/components/llm-provider-hub/providers/bedrock-provider.d.ts.map +1 -0
- package/dist/components/llm-provider-hub/providers/bedrock-provider.js +345 -0
- package/dist/components/llm-provider-hub/providers/bedrock-provider.js.map +1 -0
- package/dist/components/llm-provider-hub/providers/model-info-mappers.d.ts +6 -0
- package/dist/components/llm-provider-hub/providers/model-info-mappers.d.ts.map +1 -0
- package/dist/components/llm-provider-hub/providers/model-info-mappers.js +267 -0
- package/dist/components/llm-provider-hub/providers/model-info-mappers.js.map +1 -0
- package/dist/components/llm-provider-hub/providers/openai-compatible-provider.d.ts +24 -0
- package/dist/components/llm-provider-hub/providers/openai-compatible-provider.d.ts.map +1 -0
- package/dist/components/llm-provider-hub/providers/openai-compatible-provider.js +243 -0
- package/dist/components/llm-provider-hub/providers/openai-compatible-provider.js.map +1 -0
- package/dist/components/llm-provider-hub/providers/openai-subscription-provider.d.ts +29 -0
- package/dist/components/llm-provider-hub/providers/openai-subscription-provider.d.ts.map +1 -0
- package/dist/components/llm-provider-hub/providers/openai-subscription-provider.js +299 -0
- package/dist/components/llm-provider-hub/providers/openai-subscription-provider.js.map +1 -0
- package/dist/components/llm-provider-hub/providers/registry.d.ts +6 -0
- package/dist/components/llm-provider-hub/providers/registry.d.ts.map +1 -0
- package/dist/components/llm-provider-hub/providers/registry.js +33 -0
- package/dist/components/llm-provider-hub/providers/registry.js.map +1 -0
- package/dist/components/llm-provider-hub/providers/types.d.ts +29 -0
- package/dist/components/llm-provider-hub/providers/types.d.ts.map +1 -0
- package/dist/components/llm-provider-hub/providers/types.js +2 -0
- package/dist/components/llm-provider-hub/providers/types.js.map +1 -0
- package/dist/components/llm-provider-hub/types.d.ts +84 -0
- package/dist/components/llm-provider-hub/types.d.ts.map +1 -0
- package/dist/components/llm-provider-hub/types.js +6 -0
- package/dist/components/llm-provider-hub/types.js.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/agent-loop/agent-loop.d.ts +85 -0
- package/dist/components/multi-agent-orchestration/agent/agent-loop/agent-loop.d.ts.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/agent-loop/agent-loop.js +500 -0
- package/dist/components/multi-agent-orchestration/agent/agent-loop/agent-loop.js.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/agent-loop/components/abort.d.ts +29 -0
- package/dist/components/multi-agent-orchestration/agent/agent-loop/components/abort.d.ts.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/agent-loop/components/abort.js +98 -0
- package/dist/components/multi-agent-orchestration/agent/agent-loop/components/abort.js.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/agent-loop/components/compactor.d.ts +16 -0
- package/dist/components/multi-agent-orchestration/agent/agent-loop/components/compactor.d.ts.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/agent-loop/components/compactor.js +116 -0
- package/dist/components/multi-agent-orchestration/agent/agent-loop/components/compactor.js.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/agent-loop/components/compactor.types.d.ts +41 -0
- package/dist/components/multi-agent-orchestration/agent/agent-loop/components/compactor.types.d.ts.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/agent-loop/components/compactor.types.js +2 -0
- package/dist/components/multi-agent-orchestration/agent/agent-loop/components/compactor.types.js.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/agent-loop/components/counter.d.ts +69 -0
- package/dist/components/multi-agent-orchestration/agent/agent-loop/components/counter.d.ts.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/agent-loop/components/counter.js +147 -0
- package/dist/components/multi-agent-orchestration/agent/agent-loop/components/counter.js.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/agent-loop/components/harness-executor.d.ts +55 -0
- package/dist/components/multi-agent-orchestration/agent/agent-loop/components/harness-executor.d.ts.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/agent-loop/components/harness-executor.js +406 -0
- package/dist/components/multi-agent-orchestration/agent/agent-loop/components/harness-executor.js.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/agent-loop/components/run-trace.d.ts +19 -0
- package/dist/components/multi-agent-orchestration/agent/agent-loop/components/run-trace.d.ts.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/agent-loop/components/run-trace.js +28 -0
- package/dist/components/multi-agent-orchestration/agent/agent-loop/components/run-trace.js.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/agent-loop/components/summarizer.d.ts +17 -0
- package/dist/components/multi-agent-orchestration/agent/agent-loop/components/summarizer.d.ts.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/agent-loop/components/summarizer.js +55 -0
- package/dist/components/multi-agent-orchestration/agent/agent-loop/components/summarizer.js.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/agent-loop/components/summarizer.types.d.ts +3 -0
- package/dist/components/multi-agent-orchestration/agent/agent-loop/components/summarizer.types.d.ts.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/agent-loop/components/summarizer.types.js +2 -0
- package/dist/components/multi-agent-orchestration/agent/agent-loop/components/summarizer.types.js.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/agent-loop/components/tool-pairing.d.ts +20 -0
- package/dist/components/multi-agent-orchestration/agent/agent-loop/components/tool-pairing.d.ts.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/agent-loop/components/tool-pairing.js +56 -0
- package/dist/components/multi-agent-orchestration/agent/agent-loop/components/tool-pairing.js.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/agent-loop/functions/llm-input.d.ts +23 -0
- package/dist/components/multi-agent-orchestration/agent/agent-loop/functions/llm-input.d.ts.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/agent-loop/functions/llm-input.js +127 -0
- package/dist/components/multi-agent-orchestration/agent/agent-loop/functions/llm-input.js.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/agent-loop/functions/memory-recall.d.ts +9 -0
- package/dist/components/multi-agent-orchestration/agent/agent-loop/functions/memory-recall.d.ts.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/agent-loop/functions/memory-recall.js +40 -0
- package/dist/components/multi-agent-orchestration/agent/agent-loop/functions/memory-recall.js.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/agent-loop/types.d.ts +135 -0
- package/dist/components/multi-agent-orchestration/agent/agent-loop/types.d.ts.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/agent-loop/types.js +31 -0
- package/dist/components/multi-agent-orchestration/agent/agent-loop/types.js.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/agent.d.ts +93 -0
- package/dist/components/multi-agent-orchestration/agent/agent.d.ts.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/agent.js +223 -0
- package/dist/components/multi-agent-orchestration/agent/agent.js.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/artifact-manager/artifact-manager.d.ts +18 -0
- package/dist/components/multi-agent-orchestration/agent/artifact-manager/artifact-manager.d.ts.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/artifact-manager/artifact-manager.js +20 -0
- package/dist/components/multi-agent-orchestration/agent/artifact-manager/artifact-manager.js.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/channel-manager/channel-manager.d.ts +6 -0
- package/dist/components/multi-agent-orchestration/agent/channel-manager/channel-manager.d.ts.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/channel-manager/channel-manager.js +6 -0
- package/dist/components/multi-agent-orchestration/agent/channel-manager/channel-manager.js.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/context-manager/context-manager.d.ts +22 -0
- package/dist/components/multi-agent-orchestration/agent/context-manager/context-manager.d.ts.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/context-manager/context-manager.js +52 -0
- package/dist/components/multi-agent-orchestration/agent/context-manager/context-manager.js.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/context-manager/types.d.ts +13 -0
- package/dist/components/multi-agent-orchestration/agent/context-manager/types.d.ts.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/context-manager/types.js +2 -0
- package/dist/components/multi-agent-orchestration/agent/context-manager/types.js.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/conversation-manager/conversation-manager.d.ts +25 -0
- package/dist/components/multi-agent-orchestration/agent/conversation-manager/conversation-manager.d.ts.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/conversation-manager/conversation-manager.js +74 -0
- package/dist/components/multi-agent-orchestration/agent/conversation-manager/conversation-manager.js.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/memory-system/components/consolidation-scheduler.d.ts +57 -0
- package/dist/components/multi-agent-orchestration/agent/memory-system/components/consolidation-scheduler.d.ts.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/memory-system/components/consolidation-scheduler.js +185 -0
- package/dist/components/multi-agent-orchestration/agent/memory-system/components/consolidation-scheduler.js.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/memory-system/components/dreaming.d.ts +38 -0
- package/dist/components/multi-agent-orchestration/agent/memory-system/components/dreaming.d.ts.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/memory-system/components/dreaming.js +89 -0
- package/dist/components/multi-agent-orchestration/agent/memory-system/components/dreaming.js.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/memory-system/components/indexing.d.ts +30 -0
- package/dist/components/multi-agent-orchestration/agent/memory-system/components/indexing.d.ts.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/memory-system/components/indexing.js +91 -0
- package/dist/components/multi-agent-orchestration/agent/memory-system/components/indexing.js.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/memory-system/components/learning.d.ts +3 -0
- package/dist/components/multi-agent-orchestration/agent/memory-system/components/learning.d.ts.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/memory-system/components/learning.js +3 -0
- package/dist/components/multi-agent-orchestration/agent/memory-system/components/learning.js.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/memory-system/components/memory.d.ts +22 -0
- package/dist/components/multi-agent-orchestration/agent/memory-system/components/memory.d.ts.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/memory-system/components/memory.js +196 -0
- package/dist/components/multi-agent-orchestration/agent/memory-system/components/memory.js.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/memory-system/components/retrieval.d.ts +17 -0
- package/dist/components/multi-agent-orchestration/agent/memory-system/components/retrieval.d.ts.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/memory-system/components/retrieval.js +114 -0
- package/dist/components/multi-agent-orchestration/agent/memory-system/components/retrieval.js.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/memory-system/memory-system.d.ts +89 -0
- package/dist/components/multi-agent-orchestration/agent/memory-system/memory-system.d.ts.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/memory-system/memory-system.js +178 -0
- package/dist/components/multi-agent-orchestration/agent/memory-system/memory-system.js.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/memory-system/types/config.d.ts +29 -0
- package/dist/components/multi-agent-orchestration/agent/memory-system/types/config.d.ts.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/memory-system/types/config.js +2 -0
- package/dist/components/multi-agent-orchestration/agent/memory-system/types/config.js.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/memory-system/types/pipeline.d.ts +33 -0
- package/dist/components/multi-agent-orchestration/agent/memory-system/types/pipeline.d.ts.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/memory-system/types/pipeline.js +2 -0
- package/dist/components/multi-agent-orchestration/agent/memory-system/types/pipeline.js.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/memory-system/types/record.d.ts +27 -0
- package/dist/components/multi-agent-orchestration/agent/memory-system/types/record.d.ts.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/memory-system/types/record.js +5 -0
- package/dist/components/multi-agent-orchestration/agent/memory-system/types/record.js.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/model-manager/model-manager.d.ts +39 -0
- package/dist/components/multi-agent-orchestration/agent/model-manager/model-manager.d.ts.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/model-manager/model-manager.js +70 -0
- package/dist/components/multi-agent-orchestration/agent/model-manager/model-manager.js.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/sandbox-manager/sandbox-manager.d.ts +43 -0
- package/dist/components/multi-agent-orchestration/agent/sandbox-manager/sandbox-manager.d.ts.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/sandbox-manager/sandbox-manager.js +126 -0
- package/dist/components/multi-agent-orchestration/agent/sandbox-manager/sandbox-manager.js.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/scheduled-job-manager/scheduled-job-manager.d.ts +38 -0
- package/dist/components/multi-agent-orchestration/agent/scheduled-job-manager/scheduled-job-manager.d.ts.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/scheduled-job-manager/scheduled-job-manager.js +155 -0
- package/dist/components/multi-agent-orchestration/agent/scheduled-job-manager/scheduled-job-manager.js.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/scheduled-job-manager/types.d.ts +27 -0
- package/dist/components/multi-agent-orchestration/agent/scheduled-job-manager/types.d.ts.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/scheduled-job-manager/types.js +2 -0
- package/dist/components/multi-agent-orchestration/agent/scheduled-job-manager/types.js.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/skill-manager/skill-index.d.ts +6 -0
- package/dist/components/multi-agent-orchestration/agent/skill-manager/skill-index.d.ts.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/skill-manager/skill-index.js +43 -0
- package/dist/components/multi-agent-orchestration/agent/skill-manager/skill-index.js.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/skill-manager/skill-manager.d.ts +56 -0
- package/dist/components/multi-agent-orchestration/agent/skill-manager/skill-manager.d.ts.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/skill-manager/skill-manager.js +107 -0
- package/dist/components/multi-agent-orchestration/agent/skill-manager/skill-manager.js.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/tool-manager/tool-manager.d.ts +20 -0
- package/dist/components/multi-agent-orchestration/agent/tool-manager/tool-manager.d.ts.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/tool-manager/tool-manager.js +28 -0
- package/dist/components/multi-agent-orchestration/agent/tool-manager/tool-manager.js.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/types.d.ts +44 -0
- package/dist/components/multi-agent-orchestration/agent/types.d.ts.map +1 -0
- package/dist/components/multi-agent-orchestration/agent/types.js +2 -0
- package/dist/components/multi-agent-orchestration/agent/types.js.map +1 -0
- package/dist/components/multi-agent-orchestration/multi-agent-orchestration.d.ts +23 -0
- package/dist/components/multi-agent-orchestration/multi-agent-orchestration.d.ts.map +1 -0
- package/dist/components/multi-agent-orchestration/multi-agent-orchestration.js +42 -0
- package/dist/components/multi-agent-orchestration/multi-agent-orchestration.js.map +1 -0
- package/dist/components/persistence-hub/default-stores/memory-agent-store.d.ts +10 -0
- package/dist/components/persistence-hub/default-stores/memory-agent-store.d.ts.map +1 -0
- package/dist/components/persistence-hub/default-stores/memory-agent-store.js +16 -0
- package/dist/components/persistence-hub/default-stores/memory-agent-store.js.map +1 -0
- package/dist/components/persistence-hub/default-stores/memory-artifact-store.d.ts +16 -0
- package/dist/components/persistence-hub/default-stores/memory-artifact-store.d.ts.map +1 -0
- package/dist/components/persistence-hub/default-stores/memory-artifact-store.js +70 -0
- package/dist/components/persistence-hub/default-stores/memory-artifact-store.js.map +1 -0
- package/dist/components/persistence-hub/default-stores/memory-memory-store.d.ts +12 -0
- package/dist/components/persistence-hub/default-stores/memory-memory-store.d.ts.map +1 -0
- package/dist/components/persistence-hub/default-stores/memory-memory-store.js +51 -0
- package/dist/components/persistence-hub/default-stores/memory-memory-store.js.map +1 -0
- package/dist/components/persistence-hub/default-stores/memory-message-store.d.ts +12 -0
- package/dist/components/persistence-hub/default-stores/memory-message-store.d.ts.map +1 -0
- package/dist/components/persistence-hub/default-stores/memory-message-store.js +33 -0
- package/dist/components/persistence-hub/default-stores/memory-message-store.js.map +1 -0
- package/dist/components/persistence-hub/default-stores/memory-provider-store.d.ts +9 -0
- package/dist/components/persistence-hub/default-stores/memory-provider-store.d.ts.map +1 -0
- package/dist/components/persistence-hub/default-stores/memory-provider-store.js +16 -0
- package/dist/components/persistence-hub/default-stores/memory-provider-store.js.map +1 -0
- package/dist/components/persistence-hub/default-stores/memory-session-store.d.ts +12 -0
- package/dist/components/persistence-hub/default-stores/memory-session-store.d.ts.map +1 -0
- package/dist/components/persistence-hub/default-stores/memory-session-store.js +42 -0
- package/dist/components/persistence-hub/default-stores/memory-session-store.js.map +1 -0
- package/dist/components/persistence-hub/default-stores/memory-skill-store.d.ts +9 -0
- package/dist/components/persistence-hub/default-stores/memory-skill-store.d.ts.map +1 -0
- package/dist/components/persistence-hub/default-stores/memory-skill-store.js +20 -0
- package/dist/components/persistence-hub/default-stores/memory-skill-store.js.map +1 -0
- package/dist/components/persistence-hub/persistence-hub.d.ts +34 -0
- package/dist/components/persistence-hub/persistence-hub.d.ts.map +1 -0
- package/dist/components/persistence-hub/persistence-hub.js +37 -0
- package/dist/components/persistence-hub/persistence-hub.js.map +1 -0
- package/dist/components/persistence-hub/types/agent-store.d.ts +8 -0
- package/dist/components/persistence-hub/types/agent-store.d.ts.map +1 -0
- package/dist/components/persistence-hub/types/agent-store.js +2 -0
- package/dist/components/persistence-hub/types/agent-store.js.map +1 -0
- package/dist/components/persistence-hub/types/artifact-store.d.ts +33 -0
- package/dist/components/persistence-hub/types/artifact-store.d.ts.map +1 -0
- package/dist/components/persistence-hub/types/artifact-store.js +2 -0
- package/dist/components/persistence-hub/types/artifact-store.js.map +1 -0
- package/dist/components/persistence-hub/types/memory-store.d.ts +23 -0
- package/dist/components/persistence-hub/types/memory-store.d.ts.map +1 -0
- package/dist/components/persistence-hub/types/memory-store.js +2 -0
- package/dist/components/persistence-hub/types/memory-store.js.map +1 -0
- package/dist/components/persistence-hub/types/message-store.d.ts +27 -0
- package/dist/components/persistence-hub/types/message-store.d.ts.map +1 -0
- package/dist/components/persistence-hub/types/message-store.js +2 -0
- package/dist/components/persistence-hub/types/message-store.js.map +1 -0
- package/dist/components/persistence-hub/types/provider-store.d.ts +28 -0
- package/dist/components/persistence-hub/types/provider-store.d.ts.map +1 -0
- package/dist/components/persistence-hub/types/provider-store.js +5 -0
- package/dist/components/persistence-hub/types/provider-store.js.map +1 -0
- package/dist/components/persistence-hub/types/session-store.d.ts +15 -0
- package/dist/components/persistence-hub/types/session-store.d.ts.map +1 -0
- package/dist/components/persistence-hub/types/session-store.js +2 -0
- package/dist/components/persistence-hub/types/session-store.js.map +1 -0
- package/dist/components/persistence-hub/types/skill-store.d.ts +22 -0
- package/dist/components/persistence-hub/types/skill-store.d.ts.map +1 -0
- package/dist/components/persistence-hub/types/skill-store.js +2 -0
- package/dist/components/persistence-hub/types/skill-store.js.map +1 -0
- package/dist/components/sandbox-hub/approval-policy.d.ts +12 -0
- package/dist/components/sandbox-hub/approval-policy.d.ts.map +1 -0
- package/dist/components/sandbox-hub/approval-policy.js +11 -0
- package/dist/components/sandbox-hub/approval-policy.js.map +1 -0
- package/dist/components/sandbox-hub/docker/aec-sandbox-image.d.ts +3 -0
- package/dist/components/sandbox-hub/docker/aec-sandbox-image.d.ts.map +1 -0
- package/dist/components/sandbox-hub/docker/aec-sandbox-image.js +31 -0
- package/dist/components/sandbox-hub/docker/aec-sandbox-image.js.map +1 -0
- package/dist/components/sandbox-hub/docker/docker-cli.d.ts +32 -0
- package/dist/components/sandbox-hub/docker/docker-cli.d.ts.map +1 -0
- package/dist/components/sandbox-hub/docker/docker-cli.js +83 -0
- package/dist/components/sandbox-hub/docker/docker-cli.js.map +1 -0
- package/dist/components/sandbox-hub/docker/docker-sandbox-provider.d.ts +70 -0
- package/dist/components/sandbox-hub/docker/docker-sandbox-provider.d.ts.map +1 -0
- package/dist/components/sandbox-hub/docker/docker-sandbox-provider.js +166 -0
- package/dist/components/sandbox-hub/docker/docker-sandbox-provider.js.map +1 -0
- package/dist/components/sandbox-hub/docker/docker-sandbox.d.ts +51 -0
- package/dist/components/sandbox-hub/docker/docker-sandbox.d.ts.map +1 -0
- package/dist/components/sandbox-hub/docker/docker-sandbox.js +584 -0
- package/dist/components/sandbox-hub/docker/docker-sandbox.js.map +1 -0
- package/dist/components/sandbox-hub/docker/sandbox-helper.d.ts +4 -0
- package/dist/components/sandbox-hub/docker/sandbox-helper.d.ts.map +1 -0
- package/dist/components/sandbox-hub/docker/sandbox-helper.js +442 -0
- package/dist/components/sandbox-hub/docker/sandbox-helper.js.map +1 -0
- package/dist/components/sandbox-hub/docker/types.d.ts +26 -0
- package/dist/components/sandbox-hub/docker/types.d.ts.map +1 -0
- package/dist/components/sandbox-hub/docker/types.js +2 -0
- package/dist/components/sandbox-hub/docker/types.js.map +1 -0
- package/dist/components/sandbox-hub/host/host-sandbox-provider.d.ts +34 -0
- package/dist/components/sandbox-hub/host/host-sandbox-provider.d.ts.map +1 -0
- package/dist/components/sandbox-hub/host/host-sandbox-provider.js +81 -0
- package/dist/components/sandbox-hub/host/host-sandbox-provider.js.map +1 -0
- package/dist/components/sandbox-hub/host/host-sandbox.d.ts +22 -0
- package/dist/components/sandbox-hub/host/host-sandbox.d.ts.map +1 -0
- package/dist/components/sandbox-hub/host/host-sandbox.js +508 -0
- package/dist/components/sandbox-hub/host/host-sandbox.js.map +1 -0
- package/dist/components/sandbox-hub/logical-path.d.ts +28 -0
- package/dist/components/sandbox-hub/logical-path.d.ts.map +1 -0
- package/dist/components/sandbox-hub/logical-path.js +73 -0
- package/dist/components/sandbox-hub/logical-path.js.map +1 -0
- package/dist/components/sandbox-hub/sandbox-hub.d.ts +69 -0
- package/dist/components/sandbox-hub/sandbox-hub.d.ts.map +1 -0
- package/dist/components/sandbox-hub/sandbox-hub.js +216 -0
- package/dist/components/sandbox-hub/sandbox-hub.js.map +1 -0
- package/dist/components/sandbox-hub/traced-sandbox.d.ts +15 -0
- package/dist/components/sandbox-hub/traced-sandbox.d.ts.map +1 -0
- package/dist/components/sandbox-hub/traced-sandbox.js +69 -0
- package/dist/components/sandbox-hub/traced-sandbox.js.map +1 -0
- package/dist/components/sandbox-hub/types/policy.d.ts +40 -0
- package/dist/components/sandbox-hub/types/policy.d.ts.map +1 -0
- package/dist/components/sandbox-hub/types/policy.js +2 -0
- package/dist/components/sandbox-hub/types/policy.js.map +1 -0
- package/dist/components/sandbox-hub/types/provider.d.ts +40 -0
- package/dist/components/sandbox-hub/types/provider.d.ts.map +1 -0
- package/dist/components/sandbox-hub/types/provider.js +2 -0
- package/dist/components/sandbox-hub/types/provider.js.map +1 -0
- package/dist/components/sandbox-hub/types/sandbox.d.ts +185 -0
- package/dist/components/sandbox-hub/types/sandbox.d.ts.map +1 -0
- package/dist/components/sandbox-hub/types/sandbox.js +15 -0
- package/dist/components/sandbox-hub/types/sandbox.js.map +1 -0
- package/dist/components/skill-hub/built-in-skills/essential-skills.d.ts +5 -0
- package/dist/components/skill-hub/built-in-skills/essential-skills.d.ts.map +1 -0
- package/dist/components/skill-hub/built-in-skills/essential-skills.js +10 -0
- package/dist/components/skill-hub/built-in-skills/essential-skills.js.map +1 -0
- package/dist/components/skill-hub/built-in-skills/plan.d.ts +3 -0
- package/dist/components/skill-hub/built-in-skills/plan.d.ts.map +1 -0
- package/dist/components/skill-hub/built-in-skills/plan.js +33 -0
- package/dist/components/skill-hub/built-in-skills/plan.js.map +1 -0
- package/dist/components/skill-hub/built-in-skills/skill-creator.d.ts +3 -0
- package/dist/components/skill-hub/built-in-skills/skill-creator.d.ts.map +1 -0
- package/dist/components/skill-hub/built-in-skills/skill-creator.js +186 -0
- package/dist/components/skill-hub/built-in-skills/skill-creator.js.map +1 -0
- package/dist/components/skill-hub/built-in-skills/web-research.d.ts +3 -0
- package/dist/components/skill-hub/built-in-skills/web-research.d.ts.map +1 -0
- package/dist/components/skill-hub/built-in-skills/web-research.js +35 -0
- package/dist/components/skill-hub/built-in-skills/web-research.js.map +1 -0
- package/dist/components/skill-hub/skill-format.d.ts +40 -0
- package/dist/components/skill-hub/skill-format.d.ts.map +1 -0
- package/dist/components/skill-hub/skill-format.js +378 -0
- package/dist/components/skill-hub/skill-format.js.map +1 -0
- package/dist/components/skill-hub/skill-hub.d.ts +45 -0
- package/dist/components/skill-hub/skill-hub.d.ts.map +1 -0
- package/dist/components/skill-hub/skill-hub.js +173 -0
- package/dist/components/skill-hub/skill-hub.js.map +1 -0
- package/dist/components/skill-hub/types/agent-skills.d.ts +20 -0
- package/dist/components/skill-hub/types/agent-skills.d.ts.map +1 -0
- package/dist/components/skill-hub/types/agent-skills.js +2 -0
- package/dist/components/skill-hub/types/agent-skills.js.map +1 -0
- package/dist/components/skill-hub/types/skill.d.ts +55 -0
- package/dist/components/skill-hub/types/skill.d.ts.map +1 -0
- package/dist/components/skill-hub/types/skill.js +11 -0
- package/dist/components/skill-hub/types/skill.js.map +1 -0
- package/dist/components/tool-hub/built-in-tools/artifacts/artifact-helpers.d.ts +52 -0
- package/dist/components/tool-hub/built-in-tools/artifacts/artifact-helpers.d.ts.map +1 -0
- package/dist/components/tool-hub/built-in-tools/artifacts/artifact-helpers.js +143 -0
- package/dist/components/tool-hub/built-in-tools/artifacts/artifact-helpers.js.map +1 -0
- package/dist/components/tool-hub/built-in-tools/artifacts/create-artifact-tools.d.ts +7 -0
- package/dist/components/tool-hub/built-in-tools/artifacts/create-artifact-tools.d.ts.map +1 -0
- package/dist/components/tool-hub/built-in-tools/artifacts/create-artifact-tools.js +18 -0
- package/dist/components/tool-hub/built-in-tools/artifacts/create-artifact-tools.js.map +1 -0
- package/dist/components/tool-hub/built-in-tools/artifacts/list-artifacts-tool.d.ts +16 -0
- package/dist/components/tool-hub/built-in-tools/artifacts/list-artifacts-tool.d.ts.map +1 -0
- package/dist/components/tool-hub/built-in-tools/artifacts/list-artifacts-tool.js +69 -0
- package/dist/components/tool-hub/built-in-tools/artifacts/list-artifacts-tool.js.map +1 -0
- package/dist/components/tool-hub/built-in-tools/artifacts/read-artifact-tool.d.ts +16 -0
- package/dist/components/tool-hub/built-in-tools/artifacts/read-artifact-tool.d.ts.map +1 -0
- package/dist/components/tool-hub/built-in-tools/artifacts/read-artifact-tool.js +79 -0
- package/dist/components/tool-hub/built-in-tools/artifacts/read-artifact-tool.js.map +1 -0
- package/dist/components/tool-hub/built-in-tools/artifacts/save-artifact-tool.d.ts +16 -0
- package/dist/components/tool-hub/built-in-tools/artifacts/save-artifact-tool.d.ts.map +1 -0
- package/dist/components/tool-hub/built-in-tools/artifacts/save-artifact-tool.js +105 -0
- package/dist/components/tool-hub/built-in-tools/artifacts/save-artifact-tool.js.map +1 -0
- package/dist/components/tool-hub/built-in-tools/artifacts/types.d.ts +11 -0
- package/dist/components/tool-hub/built-in-tools/artifacts/types.d.ts.map +1 -0
- package/dist/components/tool-hub/built-in-tools/artifacts/types.js +8 -0
- package/dist/components/tool-hub/built-in-tools/artifacts/types.js.map +1 -0
- package/dist/components/tool-hub/built-in-tools/artifacts/update-artifact-tool.d.ts +17 -0
- package/dist/components/tool-hub/built-in-tools/artifacts/update-artifact-tool.d.ts.map +1 -0
- package/dist/components/tool-hub/built-in-tools/artifacts/update-artifact-tool.js +100 -0
- package/dist/components/tool-hub/built-in-tools/artifacts/update-artifact-tool.js.map +1 -0
- package/dist/components/tool-hub/built-in-tools/interaction/clarify-tool.d.ts +16 -0
- package/dist/components/tool-hub/built-in-tools/interaction/clarify-tool.d.ts.map +1 -0
- package/dist/components/tool-hub/built-in-tools/interaction/clarify-tool.js +94 -0
- package/dist/components/tool-hub/built-in-tools/interaction/clarify-tool.js.map +1 -0
- package/dist/components/tool-hub/built-in-tools/skills/skill-manage-tool.d.ts +22 -0
- package/dist/components/tool-hub/built-in-tools/skills/skill-manage-tool.d.ts.map +1 -0
- package/dist/components/tool-hub/built-in-tools/skills/skill-manage-tool.js +226 -0
- package/dist/components/tool-hub/built-in-tools/skills/skill-manage-tool.js.map +1 -0
- package/dist/components/tool-hub/built-in-tools/skills/skill-view-tool.d.ts +18 -0
- package/dist/components/tool-hub/built-in-tools/skills/skill-view-tool.d.ts.map +1 -0
- package/dist/components/tool-hub/built-in-tools/skills/skill-view-tool.js +86 -0
- package/dist/components/tool-hub/built-in-tools/skills/skill-view-tool.js.map +1 -0
- package/dist/components/tool-hub/built-in-tools/skills/skill-workspace.d.ts +26 -0
- package/dist/components/tool-hub/built-in-tools/skills/skill-workspace.d.ts.map +1 -0
- package/dist/components/tool-hub/built-in-tools/skills/skill-workspace.js +93 -0
- package/dist/components/tool-hub/built-in-tools/skills/skill-workspace.js.map +1 -0
- package/dist/components/tool-hub/built-in-tools/web/duckduckgo-search-provider.d.ts +28 -0
- package/dist/components/tool-hub/built-in-tools/web/duckduckgo-search-provider.d.ts.map +1 -0
- package/dist/components/tool-hub/built-in-tools/web/duckduckgo-search-provider.js +116 -0
- package/dist/components/tool-hub/built-in-tools/web/duckduckgo-search-provider.js.map +1 -0
- package/dist/components/tool-hub/built-in-tools/web/html-to-text.d.ts +14 -0
- package/dist/components/tool-hub/built-in-tools/web/html-to-text.d.ts.map +1 -0
- package/dist/components/tool-hub/built-in-tools/web/html-to-text.js +158 -0
- package/dist/components/tool-hub/built-in-tools/web/html-to-text.js.map +1 -0
- package/dist/components/tool-hub/built-in-tools/web/network-guard.d.ts +21 -0
- package/dist/components/tool-hub/built-in-tools/web/network-guard.d.ts.map +1 -0
- package/dist/components/tool-hub/built-in-tools/web/network-guard.js +106 -0
- package/dist/components/tool-hub/built-in-tools/web/network-guard.js.map +1 -0
- package/dist/components/tool-hub/built-in-tools/web/types.d.ts +23 -0
- package/dist/components/tool-hub/built-in-tools/web/types.d.ts.map +1 -0
- package/dist/components/tool-hub/built-in-tools/web/types.js +5 -0
- package/dist/components/tool-hub/built-in-tools/web/types.js.map +1 -0
- package/dist/components/tool-hub/built-in-tools/web/web-extract-tool.d.ts +37 -0
- package/dist/components/tool-hub/built-in-tools/web/web-extract-tool.d.ts.map +1 -0
- package/dist/components/tool-hub/built-in-tools/web/web-extract-tool.js +206 -0
- package/dist/components/tool-hub/built-in-tools/web/web-extract-tool.js.map +1 -0
- package/dist/components/tool-hub/built-in-tools/web/web-search-tool.d.ts +25 -0
- package/dist/components/tool-hub/built-in-tools/web/web-search-tool.d.ts.map +1 -0
- package/dist/components/tool-hub/built-in-tools/web/web-search-tool.js +82 -0
- package/dist/components/tool-hub/built-in-tools/web/web-search-tool.js.map +1 -0
- package/dist/components/tool-hub/built-in-tools/workspace/create-workspace-tools.d.ts +7 -0
- package/dist/components/tool-hub/built-in-tools/workspace/create-workspace-tools.d.ts.map +1 -0
- package/dist/components/tool-hub/built-in-tools/workspace/create-workspace-tools.js +24 -0
- package/dist/components/tool-hub/built-in-tools/workspace/create-workspace-tools.js.map +1 -0
- package/dist/components/tool-hub/built-in-tools/workspace/edit-file-tool.d.ts +15 -0
- package/dist/components/tool-hub/built-in-tools/workspace/edit-file-tool.d.ts.map +1 -0
- package/dist/components/tool-hub/built-in-tools/workspace/edit-file-tool.js +103 -0
- package/dist/components/tool-hub/built-in-tools/workspace/edit-file-tool.js.map +1 -0
- package/dist/components/tool-hub/built-in-tools/workspace/list-files-tool.d.ts +12 -0
- package/dist/components/tool-hub/built-in-tools/workspace/list-files-tool.d.ts.map +1 -0
- package/dist/components/tool-hub/built-in-tools/workspace/list-files-tool.js +53 -0
- package/dist/components/tool-hub/built-in-tools/workspace/list-files-tool.js.map +1 -0
- package/dist/components/tool-hub/built-in-tools/workspace/read-file-tool.d.ts +15 -0
- package/dist/components/tool-hub/built-in-tools/workspace/read-file-tool.d.ts.map +1 -0
- package/dist/components/tool-hub/built-in-tools/workspace/read-file-tool.js +71 -0
- package/dist/components/tool-hub/built-in-tools/workspace/read-file-tool.js.map +1 -0
- package/dist/components/tool-hub/built-in-tools/workspace/run-code-tool.d.ts +16 -0
- package/dist/components/tool-hub/built-in-tools/workspace/run-code-tool.d.ts.map +1 -0
- package/dist/components/tool-hub/built-in-tools/workspace/run-code-tool.js +72 -0
- package/dist/components/tool-hub/built-in-tools/workspace/run-code-tool.js.map +1 -0
- package/dist/components/tool-hub/built-in-tools/workspace/search-files-tool.d.ts +12 -0
- package/dist/components/tool-hub/built-in-tools/workspace/search-files-tool.d.ts.map +1 -0
- package/dist/components/tool-hub/built-in-tools/workspace/search-files-tool.js +64 -0
- package/dist/components/tool-hub/built-in-tools/workspace/search-files-tool.js.map +1 -0
- package/dist/components/tool-hub/built-in-tools/workspace/terminal-tool.d.ts +19 -0
- package/dist/components/tool-hub/built-in-tools/workspace/terminal-tool.d.ts.map +1 -0
- package/dist/components/tool-hub/built-in-tools/workspace/terminal-tool.js +111 -0
- package/dist/components/tool-hub/built-in-tools/workspace/terminal-tool.js.map +1 -0
- package/dist/components/tool-hub/built-in-tools/workspace/types.d.ts +16 -0
- package/dist/components/tool-hub/built-in-tools/workspace/types.d.ts.map +1 -0
- package/dist/components/tool-hub/built-in-tools/workspace/types.js +8 -0
- package/dist/components/tool-hub/built-in-tools/workspace/types.js.map +1 -0
- package/dist/components/tool-hub/built-in-tools/workspace/workspace-helpers.d.ts +29 -0
- package/dist/components/tool-hub/built-in-tools/workspace/workspace-helpers.d.ts.map +1 -0
- package/dist/components/tool-hub/built-in-tools/workspace/workspace-helpers.js +128 -0
- package/dist/components/tool-hub/built-in-tools/workspace/workspace-helpers.js.map +1 -0
- package/dist/components/tool-hub/built-in-tools/workspace/write-file-tool.d.ts +17 -0
- package/dist/components/tool-hub/built-in-tools/workspace/write-file-tool.d.ts.map +1 -0
- package/dist/components/tool-hub/built-in-tools/workspace/write-file-tool.js +61 -0
- package/dist/components/tool-hub/built-in-tools/workspace/write-file-tool.js.map +1 -0
- package/dist/components/tool-hub/policies/default-tool-policy.d.ts +17 -0
- package/dist/components/tool-hub/policies/default-tool-policy.d.ts.map +1 -0
- package/dist/components/tool-hub/policies/default-tool-policy.js +99 -0
- package/dist/components/tool-hub/policies/default-tool-policy.js.map +1 -0
- package/dist/components/tool-hub/tool-hub.d.ts +28 -0
- package/dist/components/tool-hub/tool-hub.d.ts.map +1 -0
- package/dist/components/tool-hub/tool-hub.js +49 -0
- package/dist/components/tool-hub/tool-hub.js.map +1 -0
- package/dist/components/tool-hub/types.d.ts +138 -0
- package/dist/components/tool-hub/types.d.ts.map +1 -0
- package/dist/components/tool-hub/types.js +2 -0
- package/dist/components/tool-hub/types.js.map +1 -0
- package/dist/components/trace-service/console-trace-sink.d.ts +9 -0
- package/dist/components/trace-service/console-trace-sink.d.ts.map +1 -0
- package/dist/components/trace-service/console-trace-sink.js +35 -0
- package/dist/components/trace-service/console-trace-sink.js.map +1 -0
- package/dist/components/trace-service/trace-service.d.ts +25 -0
- package/dist/components/trace-service/trace-service.d.ts.map +1 -0
- package/dist/components/trace-service/trace-service.js +288 -0
- package/dist/components/trace-service/trace-service.js.map +1 -0
- package/dist/components/trace-service/types/sink.d.ts +7 -0
- package/dist/components/trace-service/types/sink.d.ts.map +1 -0
- package/dist/components/trace-service/types/sink.js +5 -0
- package/dist/components/trace-service/types/sink.js.map +1 -0
- package/dist/components/trace-service/types/span.d.ts +31 -0
- package/dist/components/trace-service/types/span.d.ts.map +1 -0
- package/dist/components/trace-service/types/span.js +5 -0
- package/dist/components/trace-service/types/span.js.map +1 -0
- package/dist/create-agent.d.ts +5 -0
- package/dist/create-agent.d.ts.map +1 -0
- package/dist/create-agent.js +57 -0
- package/dist/create-agent.js.map +1 -0
- package/dist/index.d.ts +110 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +73 -0
- package/dist/index.js.map +1 -0
- package/dist/kernel/errors/artifact-error.d.ts +23 -0
- package/dist/kernel/errors/artifact-error.d.ts.map +1 -0
- package/dist/kernel/errors/artifact-error.js +22 -0
- package/dist/kernel/errors/artifact-error.js.map +1 -0
- package/dist/kernel/errors/model-error.d.ts +7 -0
- package/dist/kernel/errors/model-error.d.ts.map +1 -0
- package/dist/kernel/errors/model-error.js +10 -0
- package/dist/kernel/errors/model-error.js.map +1 -0
- package/dist/kernel/errors/policy-error.d.ts +8 -0
- package/dist/kernel/errors/policy-error.d.ts.map +1 -0
- package/dist/kernel/errors/policy-error.js +12 -0
- package/dist/kernel/errors/policy-error.js.map +1 -0
- package/dist/kernel/errors/sandbox-error.d.ts +35 -0
- package/dist/kernel/errors/sandbox-error.d.ts.map +1 -0
- package/dist/kernel/errors/sandbox-error.js +26 -0
- package/dist/kernel/errors/sandbox-error.js.map +1 -0
- package/dist/kernel/errors/sdk-error.d.ts +9 -0
- package/dist/kernel/errors/sdk-error.d.ts.map +1 -0
- package/dist/kernel/errors/sdk-error.js +13 -0
- package/dist/kernel/errors/sdk-error.js.map +1 -0
- package/dist/kernel/errors/session-error.d.ts +7 -0
- package/dist/kernel/errors/session-error.d.ts.map +1 -0
- package/dist/kernel/errors/session-error.js +10 -0
- package/dist/kernel/errors/session-error.js.map +1 -0
- package/dist/kernel/errors/skill-error.d.ts +14 -0
- package/dist/kernel/errors/skill-error.d.ts.map +1 -0
- package/dist/kernel/errors/skill-error.js +12 -0
- package/dist/kernel/errors/skill-error.js.map +1 -0
- package/dist/kernel/errors/tool-error.d.ts +8 -0
- package/dist/kernel/errors/tool-error.d.ts.map +1 -0
- package/dist/kernel/errors/tool-error.js +12 -0
- package/dist/kernel/errors/tool-error.js.map +1 -0
- package/dist/kernel/interfaces/kernel.d.ts +23 -0
- package/dist/kernel/interfaces/kernel.d.ts.map +1 -0
- package/dist/kernel/interfaces/kernel.js +2 -0
- package/dist/kernel/interfaces/kernel.js.map +1 -0
- package/dist/kernel/interfaces/plugin.d.ts +7 -0
- package/dist/kernel/interfaces/plugin.d.ts.map +1 -0
- package/dist/kernel/interfaces/plugin.js +5 -0
- package/dist/kernel/interfaces/plugin.js.map +1 -0
- package/dist/kernel/types.d.ts +103 -0
- package/dist/kernel/types.d.ts.map +1 -0
- package/dist/kernel/types.js +2 -0
- package/dist/kernel/types.js.map +1 -0
- package/dist/testing/in-memory-sandbox.d.ts +66 -0
- package/dist/testing/in-memory-sandbox.d.ts.map +1 -0
- package/dist/testing/in-memory-sandbox.js +507 -0
- package/dist/testing/in-memory-sandbox.js.map +1 -0
- package/dist/testing/mock-llm-model-provider.d.ts +14 -0
- package/dist/testing/mock-llm-model-provider.d.ts.map +1 -0
- package/dist/testing/mock-llm-model-provider.js +30 -0
- package/dist/testing/mock-llm-model-provider.js.map +1 -0
- package/dist/testing/mock-session-store.d.ts +17 -0
- package/dist/testing/mock-session-store.d.ts.map +1 -0
- package/dist/testing/mock-session-store.js +49 -0
- package/dist/testing/mock-session-store.js.map +1 -0
- package/dist/testing/mock-tools.d.ts +38 -0
- package/dist/testing/mock-tools.d.ts.map +1 -0
- package/dist/testing/mock-tools.js +130 -0
- package/dist/testing/mock-tools.js.map +1 -0
- package/package.json +55 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { argError, formatBytes, numberArg, resolveOptions, stringArg, withSandbox } from "./workspace-helpers.js";
|
|
2
|
+
/**
|
|
3
|
+
* read_file — read-only. Returns a text file from the agent's workspace with line numbers,
|
|
4
|
+
* bounded to maxReadBytes; large files are read in line ranges.
|
|
5
|
+
*/
|
|
6
|
+
export class ReadFileTool {
|
|
7
|
+
name = "tool:read-file";
|
|
8
|
+
version = "1.0.0";
|
|
9
|
+
definition;
|
|
10
|
+
options;
|
|
11
|
+
constructor(options = {}) {
|
|
12
|
+
this.options = resolveOptions(options);
|
|
13
|
+
this.definition = {
|
|
14
|
+
name: "read_file",
|
|
15
|
+
description: "Read a text file from your workspace. Lines are prefixed with their line number and a tab " +
|
|
16
|
+
"(not part of the file — never copy that prefix into edit_file). " +
|
|
17
|
+
`Returns at most ${formatBytes(this.options.maxReadBytes)}; for bigger files read a range with start_line/end_line.`,
|
|
18
|
+
parameters: {
|
|
19
|
+
type: "object",
|
|
20
|
+
properties: {
|
|
21
|
+
path: { type: "string", description: 'File path, relative to your working directory (e.g. "src/app.ts") or under /workspace/shared' },
|
|
22
|
+
start_line: { type: "number", description: "First line to read (1-based, optional)" },
|
|
23
|
+
end_line: { type: "number", description: "Last line to read (inclusive, optional)" },
|
|
24
|
+
},
|
|
25
|
+
required: ["path"],
|
|
26
|
+
},
|
|
27
|
+
risk: "read-only",
|
|
28
|
+
sandboxOperation: "fs.read",
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
async execute(args, context) {
|
|
32
|
+
const path = stringArg(args, "path")?.trim();
|
|
33
|
+
if (!path)
|
|
34
|
+
return argError("read_file", '"path" must be a non-empty string');
|
|
35
|
+
const startLine = numberArg(args, "start_line");
|
|
36
|
+
const endLine = numberArg(args, "end_line");
|
|
37
|
+
if ((startLine !== undefined && startLine < 1) || (endLine !== undefined && endLine < 1)) {
|
|
38
|
+
return argError("read_file", "start_line and end_line are 1-based");
|
|
39
|
+
}
|
|
40
|
+
if (startLine !== undefined && endLine !== undefined && endLine < startLine) {
|
|
41
|
+
return argError("read_file", "end_line must not be before start_line");
|
|
42
|
+
}
|
|
43
|
+
return withSandbox("read_file", context, async (env) => {
|
|
44
|
+
const file = await env.readFile(path, {
|
|
45
|
+
maxBytes: this.options.maxReadBytes,
|
|
46
|
+
...(startLine !== undefined ? { startLine: Math.floor(startLine) } : {}),
|
|
47
|
+
...(endLine !== undefined ? { endLine: Math.floor(endLine) } : {}),
|
|
48
|
+
});
|
|
49
|
+
const metadata = { path: file.path, size: file.size, sha256: file.sha256, truncated: file.truncated };
|
|
50
|
+
if (file.content.includes("\u0000")) {
|
|
51
|
+
return { content: `${file.path} is a binary file (${formatBytes(file.size)}) — it cannot be shown as text.`, metadata };
|
|
52
|
+
}
|
|
53
|
+
const first = startLine !== undefined ? Math.floor(startLine) : 1;
|
|
54
|
+
const lines = file.content === "" ? [] : file.content.split("\n");
|
|
55
|
+
// A trailing newline is the end of the last line, not an extra empty line.
|
|
56
|
+
if (lines.length > 1 && lines[lines.length - 1] === "")
|
|
57
|
+
lines.pop();
|
|
58
|
+
const width = String(first + lines.length).length;
|
|
59
|
+
const numbered = lines.map((line, i) => `${String(first + i).padStart(width)}\t${line}`).join("\n");
|
|
60
|
+
const range = startLine !== undefined || endLine !== undefined
|
|
61
|
+
? `, lines ${first}-${first + Math.max(lines.length - 1, 0)}`
|
|
62
|
+
: "";
|
|
63
|
+
const header = `${file.path} (${formatBytes(file.size)}${range})`;
|
|
64
|
+
const footer = file.truncated
|
|
65
|
+
? `\n[truncated — the file continues; read more with start_line/end_line]`
|
|
66
|
+
: "";
|
|
67
|
+
return { content: `${header}\n${numbered || "(empty file)"}${footer}`, metadata };
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=read-file-tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read-file-tool.js","sourceRoot":"","sources":["../../../../../src/components/tool-hub/built-in-tools/workspace/read-file-tool.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,cAAc,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAElH;;;GAGG;AACH,MAAM,OAAO,YAAY;IACd,IAAI,GAAG,gBAAgB,CAAC;IACxB,OAAO,GAAG,OAAO,CAAC;IAClB,UAAU,CAAiB;IAC5B,OAAO,CAA+B;IAE9C,YAAY,OAAO,GAAyB,EAAE;QAC5C,IAAI,CAAC,OAAO,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;QACvC,IAAI,CAAC,UAAU,GAAG;YAChB,IAAI,EAAE,WAAW;YACjB,WAAW,EACT,4FAA4F;gBAC5F,kEAAkE;gBAClE,mBAAmB,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,2DAA2D;YACtH,UAAU,EAAE;gBACV,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,8FAA8F,EAAE;oBACrI,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,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAEpG,MAAM,KAAK,GAAG,SAAS,KAAK,SAAS,IAAI,OAAO,KAAK,SAAS;gBAC5D,CAAC,CAAC,WAAW,KAAK,IAAI,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,CAAC,EAAE;gBAC7D,CAAC,CAAC,EAAE,CAAC;YACP,MAAM,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,KAAK,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,KAAK,GAAG,CAAC;YAClE,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS;gBAC3B,CAAC,CAAC,wEAAwE;gBAC1E,CAAC,CAAC,EAAE,CAAC;YACP,OAAO,EAAE,OAAO,EAAE,GAAG,MAAM,KAAK,QAAQ,IAAI,cAAc,GAAG,MAAM,EAAE,EAAE,QAAQ,EAAE,CAAC;QACpF,CAAC,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ToolContext, ToolDefinition, ToolHandler, ToolOutput } from "../../types.js";
|
|
2
|
+
import type { WorkspaceToolOptions } from "./types.js";
|
|
3
|
+
/**
|
|
4
|
+
* run_code — runs a snippet (python / javascript / shell) in the agent's sandbox with the
|
|
5
|
+
* same bounds as terminal. Useful for calculations, data wrangling and quick checks
|
|
6
|
+
* without writing a file first.
|
|
7
|
+
*/
|
|
8
|
+
export declare class RunCodeTool implements ToolHandler {
|
|
9
|
+
readonly name = "tool:run-code";
|
|
10
|
+
readonly version = "1.0.0";
|
|
11
|
+
readonly definition: ToolDefinition;
|
|
12
|
+
private options;
|
|
13
|
+
constructor(options?: WorkspaceToolOptions);
|
|
14
|
+
execute(args: Record<string, unknown>, context: ToolContext): Promise<ToolOutput>;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=run-code-tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-code-tool.d.ts","sourceRoot":"","sources":["../../../../../src/components/tool-hub/built-in-tools/workspace/run-code-tool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC3F,OAAO,KAAK,EAAgC,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAYrF;;;;GAIG;AACH,qBAAa,WAAY,YAAW,WAAW;IAC7C,QAAQ,CAAC,IAAI,mBAAmB;IAChC,QAAQ,CAAC,OAAO,WAAW;IAC3B,QAAQ,CAAC,UAAU,EAAE,cAAc,CAAC;IACpC,OAAO,CAAC,OAAO,CAA+B;IAE9C,YAAY,OAAO,GAAE,oBAAyB,EAwB7C;IAEK,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,CA6BtF;CACF"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { argError, formatExecResult, resolveOptions, stringArg, timeoutFrom, withSandbox } from "./workspace-helpers.js";
|
|
2
|
+
const MAX_CODE_BYTES = 200_000;
|
|
3
|
+
/** Interpreter per language — the code is passed on stdin, never interpolated into a command line. */
|
|
4
|
+
const INTERPRETERS = {
|
|
5
|
+
python: ["python3", "-"],
|
|
6
|
+
javascript: ["node", "-"],
|
|
7
|
+
shell: ["sh", "-s"],
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* run_code — runs a snippet (python / javascript / shell) in the agent's sandbox with the
|
|
11
|
+
* same bounds as terminal. Useful for calculations, data wrangling and quick checks
|
|
12
|
+
* without writing a file first.
|
|
13
|
+
*/
|
|
14
|
+
export class RunCodeTool {
|
|
15
|
+
name = "tool:run-code";
|
|
16
|
+
version = "1.0.0";
|
|
17
|
+
definition;
|
|
18
|
+
options;
|
|
19
|
+
constructor(options = {}) {
|
|
20
|
+
this.options = resolveOptions(options);
|
|
21
|
+
this.definition = {
|
|
22
|
+
name: "run_code",
|
|
23
|
+
description: "Run a short program in your sandbox and get its output — python (python3), javascript (node) or shell (sh). " +
|
|
24
|
+
"Runs in your working directory, so it can read and write your workspace files. Print what you need to see. " +
|
|
25
|
+
`Default timeout ${Math.round(this.options.defaultTimeoutMs / 1000)} s.`,
|
|
26
|
+
parameters: {
|
|
27
|
+
type: "object",
|
|
28
|
+
properties: {
|
|
29
|
+
language: { type: "string", enum: Object.keys(INTERPRETERS), description: "Programming language" },
|
|
30
|
+
code: { type: "string", description: "The program source" },
|
|
31
|
+
cwd: { type: "string", description: "Directory to run in (default: your working directory)" },
|
|
32
|
+
timeout_seconds: {
|
|
33
|
+
type: "number",
|
|
34
|
+
description: `Kill the program after this many seconds (max ${Math.round(this.options.maxTimeoutMs / 1000)})`,
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
required: ["language", "code"],
|
|
38
|
+
},
|
|
39
|
+
risk: "draft",
|
|
40
|
+
sandboxOperation: "exec",
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
async execute(args, context) {
|
|
44
|
+
const language = stringArg(args, "language") ?? "";
|
|
45
|
+
const interpreter = INTERPRETERS[language];
|
|
46
|
+
if (!interpreter)
|
|
47
|
+
return argError("run_code", `"language" must be one of ${Object.keys(INTERPRETERS).join(", ")}`);
|
|
48
|
+
const code = stringArg(args, "code");
|
|
49
|
+
if (!code?.trim())
|
|
50
|
+
return argError("run_code", '"code" must be a non-empty string');
|
|
51
|
+
if (Buffer.byteLength(code, "utf8") > MAX_CODE_BYTES) {
|
|
52
|
+
return argError("run_code", `code is too long (max ${MAX_CODE_BYTES} bytes) — write it to a file and run it with terminal`);
|
|
53
|
+
}
|
|
54
|
+
const cwd = stringArg(args, "cwd")?.trim() || undefined;
|
|
55
|
+
return withSandbox("run_code", context, async (env) => {
|
|
56
|
+
const timeoutMs = timeoutFrom(args, this.options, env);
|
|
57
|
+
const result = await env.exec({
|
|
58
|
+
command: interpreter,
|
|
59
|
+
stdin: code,
|
|
60
|
+
...(cwd ? { cwd } : {}),
|
|
61
|
+
timeoutMs,
|
|
62
|
+
maxOutputBytes: env.limits.maxExecOutputBytes,
|
|
63
|
+
}, context.signal ? { signal: context.signal } : undefined);
|
|
64
|
+
const output = formatExecResult(`${language} program`, result, timeoutMs, this.options.maxDisplayOutputBytes);
|
|
65
|
+
if (result.exitCode === 127) {
|
|
66
|
+
output.content += `\n${interpreter[0]} is not installed in this sandbox.`;
|
|
67
|
+
}
|
|
68
|
+
return output;
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=run-code-tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-code-tool.js","sourceRoot":"","sources":["../../../../../src/components/tool-hub/built-in-tools/workspace/run-code-tool.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,cAAc,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAEzH,MAAM,cAAc,GAAG,OAAO,CAAC;AAE/B,sGAAsG;AACtG,MAAM,YAAY,GAA6B;IAC7C,MAAM,EAAE,CAAC,SAAS,EAAE,GAAG,CAAC;IACxB,UAAU,EAAE,CAAC,MAAM,EAAE,GAAG,CAAC;IACzB,KAAK,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC;CACpB,CAAC;AAEF;;;;GAIG;AACH,MAAM,OAAO,WAAW;IACb,IAAI,GAAG,eAAe,CAAC;IACvB,OAAO,GAAG,OAAO,CAAC;IAClB,UAAU,CAAiB;IAC5B,OAAO,CAA+B;IAE9C,YAAY,OAAO,GA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,CAAC,CAAC,CAAC,oCAAoC,CAAC;YAC5E,CAAC;YACD,OAAO,MAAM,CAAC;QAChB,CAAC,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ToolContext, ToolDefinition, ToolHandler, ToolOutput } from "../../types.js";
|
|
2
|
+
import type { WorkspaceToolOptions } from "./types.js";
|
|
3
|
+
/** search_files — read-only content search that runs where the files are, bounded. */
|
|
4
|
+
export declare class SearchFilesTool implements ToolHandler {
|
|
5
|
+
readonly name = "tool:search-files";
|
|
6
|
+
readonly version = "1.0.0";
|
|
7
|
+
readonly definition: ToolDefinition;
|
|
8
|
+
private options;
|
|
9
|
+
constructor(options?: WorkspaceToolOptions);
|
|
10
|
+
execute(args: Record<string, unknown>, context: ToolContext): Promise<ToolOutput>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=search-files-tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-files-tool.d.ts","sourceRoot":"","sources":["../../../../../src/components/tool-hub/built-in-tools/workspace/search-files-tool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC3F,OAAO,KAAK,EAAgC,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAKrF,sFAAsF;AACtF,qBAAa,eAAgB,YAAW,WAAW;IACjD,QAAQ,CAAC,IAAI,uBAAuB;IACpC,QAAQ,CAAC,OAAO,WAAW;IAC3B,QAAQ,CAAC,UAAU,EAAE,cAAc,CAAC;IACpC,OAAO,CAAC,OAAO,CAA+B;IAE9C,YAAY,OAAO,GAAE,oBAAyB,EAsB7C;IAEK,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,CA+BtF;CACF"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { argError, boolArg, numberArg, resolveOptions, stringArg, withSandbox } from "./workspace-helpers.js";
|
|
2
|
+
const MAX_LINE_CHARS = 300;
|
|
3
|
+
/** search_files — read-only content search that runs where the files are, bounded. */
|
|
4
|
+
export class SearchFilesTool {
|
|
5
|
+
name = "tool:search-files";
|
|
6
|
+
version = "1.0.0";
|
|
7
|
+
definition;
|
|
8
|
+
options;
|
|
9
|
+
constructor(options = {}) {
|
|
10
|
+
this.options = resolveOptions(options);
|
|
11
|
+
this.definition = {
|
|
12
|
+
name: "search_files",
|
|
13
|
+
description: "Search the contents of files in your workspace. Returns matching lines as path:line: text. " +
|
|
14
|
+
"Plain text by default; set regex for a regular expression. Narrow with path and glob (e.g. \"*.md\").",
|
|
15
|
+
parameters: {
|
|
16
|
+
type: "object",
|
|
17
|
+
properties: {
|
|
18
|
+
pattern: { type: "string", description: "Text (or regular expression when regex is true) to look for" },
|
|
19
|
+
path: { type: "string", description: "Folder or file to search (default: your working directory)" },
|
|
20
|
+
regex: { type: "boolean", description: "Treat pattern as a JavaScript regular expression (default false)" },
|
|
21
|
+
case_sensitive: { type: "boolean", description: "Match case exactly (default true)" },
|
|
22
|
+
glob: { type: "string", description: 'File name filter, e.g. "*.ts" (optional)' },
|
|
23
|
+
max_matches: { type: "number", description: `Most matches to return (default and max ${this.options.maxSearchMatches})` },
|
|
24
|
+
},
|
|
25
|
+
required: ["pattern"],
|
|
26
|
+
},
|
|
27
|
+
risk: "read-only",
|
|
28
|
+
sandboxOperation: "fs.search",
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
async execute(args, context) {
|
|
32
|
+
const pattern = stringArg(args, "pattern");
|
|
33
|
+
if (!pattern)
|
|
34
|
+
return argError("search_files", '"pattern" must be a non-empty string');
|
|
35
|
+
const path = stringArg(args, "path")?.trim() || undefined;
|
|
36
|
+
const glob = stringArg(args, "glob")?.trim() || undefined;
|
|
37
|
+
const requested = numberArg(args, "max_matches");
|
|
38
|
+
const maxMatches = Math.min(this.options.maxSearchMatches, requested && requested > 0 ? Math.floor(requested) : this.options.maxSearchMatches);
|
|
39
|
+
return withSandbox("search_files", context, async (env) => {
|
|
40
|
+
const result = await env.search({
|
|
41
|
+
pattern,
|
|
42
|
+
...(path ? { path } : {}),
|
|
43
|
+
literal: boolArg(args, "regex") !== true,
|
|
44
|
+
caseSensitive: boolArg(args, "case_sensitive") !== false,
|
|
45
|
+
...(glob ? { glob } : {}),
|
|
46
|
+
maxMatches,
|
|
47
|
+
});
|
|
48
|
+
const where = path ?? env.workingDir;
|
|
49
|
+
if (result.matches.length === 0) {
|
|
50
|
+
return { content: `No matches for "${pattern}" in ${where}.`, metadata: { count: 0, truncated: result.truncated } };
|
|
51
|
+
}
|
|
52
|
+
const lines = result.matches.map((m) => {
|
|
53
|
+
const text = m.text.length > MAX_LINE_CHARS ? `${m.text.slice(0, MAX_LINE_CHARS)}…` : m.text;
|
|
54
|
+
return `${m.path}:${m.line}: ${text}`;
|
|
55
|
+
});
|
|
56
|
+
const footer = result.truncated ? `\n[more matches not shown — narrow the search with path or glob]` : "";
|
|
57
|
+
return {
|
|
58
|
+
content: `${result.matches.length} match${result.matches.length === 1 ? "" : "es"} for "${pattern}" in ${where}:\n${lines.join("\n")}${footer}`,
|
|
59
|
+
metadata: { count: result.matches.length, truncated: result.truncated },
|
|
60
|
+
};
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=search-files-tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-files-tool.js","sourceRoot":"","sources":["../../../../../src/components/tool-hub/built-in-tools/workspace/search-files-tool.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAE9G,MAAM,cAAc,GAAG,GAAG,CAAC;AAE3B,sFA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AAS,EAAE,EAAE,CAAC;YACtH,CAAC;YACD,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;gBACrC,MAAM,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,MAAM,GAAG,cAAc,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;gBAC7F,OAAO,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,KAAK,IAAI,EAAE,CAAC;YACxC,CAAC,CAAC,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,kEAAkE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC1G,OAAO;gBACL,OAAO,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,SAAS,MAAM,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,SAAS,OAAO,QAAQ,KAAK,MAAM,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,MAAM,EAAE;gBAC/I,QAAQ,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE;aACxE,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ToolContext, ToolDefinition, ToolHandler, ToolOutput } from "../../types.js";
|
|
2
|
+
import type { WorkspaceToolOptions } from "./types.js";
|
|
3
|
+
/**
|
|
4
|
+
* terminal — runs one command in the agent's sandbox: bounded time and output, no
|
|
5
|
+
* server environment variables, working directory inside the workspace. Uses the
|
|
6
|
+
* sandbox's shell when it offers one ("exec.shell"); otherwise runs simple
|
|
7
|
+
* commands as argv and refuses shell syntax.
|
|
8
|
+
*/
|
|
9
|
+
export declare class TerminalTool implements ToolHandler {
|
|
10
|
+
readonly name = "tool:terminal";
|
|
11
|
+
readonly version = "1.0.0";
|
|
12
|
+
readonly definition: ToolDefinition;
|
|
13
|
+
private options;
|
|
14
|
+
constructor(options?: WorkspaceToolOptions);
|
|
15
|
+
execute(args: Record<string, unknown>, context: ToolContext): Promise<ToolOutput>;
|
|
16
|
+
}
|
|
17
|
+
/** Split a simple command line into argv (quotes supported). null = needs a shell. */
|
|
18
|
+
export declare function splitArgv(command: string): string[] | null;
|
|
19
|
+
//# sourceMappingURL=terminal-tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terminal-tool.d.ts","sourceRoot":"","sources":["../../../../../src/components/tool-hub/built-in-tools/workspace/terminal-tool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC3F,OAAO,KAAK,EAAgC,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAKrF;;;;;GAKG;AACH,qBAAa,YAAa,YAAW,WAAW;IAC9C,QAAQ,CAAC,IAAI,mBAAmB;IAChC,QAAQ,CAAC,OAAO,WAAW;IAC3B,QAAQ,CAAC,UAAU,EAAE,cAAc,CAAC;IACpC,OAAO,CAAC,OAAO,CAA+B;IAE9C,YAAY,OAAO,GAAE,oBAAyB,EAwB7C;IAEK,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,CA8BtF;CACF;AAED,sFAAsF;AACtF,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,CAiC1D"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { argError, formatExecResult, resolveOptions, stringArg, timeoutFrom, withSandbox } from "./workspace-helpers.js";
|
|
2
|
+
const MAX_COMMAND_CHARS = 10_000;
|
|
3
|
+
/**
|
|
4
|
+
* terminal — runs one command in the agent's sandbox: bounded time and output, no
|
|
5
|
+
* server environment variables, working directory inside the workspace. Uses the
|
|
6
|
+
* sandbox's shell when it offers one ("exec.shell"); otherwise runs simple
|
|
7
|
+
* commands as argv and refuses shell syntax.
|
|
8
|
+
*/
|
|
9
|
+
export class TerminalTool {
|
|
10
|
+
name = "tool:terminal";
|
|
11
|
+
version = "1.0.0";
|
|
12
|
+
definition;
|
|
13
|
+
options;
|
|
14
|
+
constructor(options = {}) {
|
|
15
|
+
this.options = resolveOptions(options);
|
|
16
|
+
this.definition = {
|
|
17
|
+
name: "terminal",
|
|
18
|
+
description: "Run a shell command in your sandbox (Linux) and get its exit code and output — e.g. build, test, git, " +
|
|
19
|
+
"file conversions. Starts in your working directory. No network unless the sandbox allows it. " +
|
|
20
|
+
`Default timeout ${Math.round(this.options.defaultTimeoutMs / 1000)} s; long output is shortened to its start and end. ` +
|
|
21
|
+
"Do not start interactive programs or servers that never exit.",
|
|
22
|
+
parameters: {
|
|
23
|
+
type: "object",
|
|
24
|
+
properties: {
|
|
25
|
+
command: { type: "string", description: 'The command line, e.g. "npm test" or "ls -la src | head"' },
|
|
26
|
+
cwd: { type: "string", description: "Directory to run in (default: your working directory)" },
|
|
27
|
+
timeout_seconds: {
|
|
28
|
+
type: "number",
|
|
29
|
+
description: `Kill the command after this many seconds (max ${Math.round(this.options.maxTimeoutMs / 1000)})`,
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
required: ["command"],
|
|
33
|
+
},
|
|
34
|
+
risk: "draft",
|
|
35
|
+
sandboxOperation: "exec",
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
async execute(args, context) {
|
|
39
|
+
const command = stringArg(args, "command")?.trim();
|
|
40
|
+
if (!command)
|
|
41
|
+
return argError("terminal", '"command" must be a non-empty string');
|
|
42
|
+
if (command.length > MAX_COMMAND_CHARS)
|
|
43
|
+
return argError("terminal", `command is too long (max ${MAX_COMMAND_CHARS} characters)`);
|
|
44
|
+
const cwd = stringArg(args, "cwd")?.trim() || undefined;
|
|
45
|
+
return withSandbox("terminal", context, async (env) => {
|
|
46
|
+
let argv;
|
|
47
|
+
let shell = false;
|
|
48
|
+
if (env.capabilities.has("exec.shell")) {
|
|
49
|
+
argv = [command];
|
|
50
|
+
shell = true;
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
const parsed = splitArgv(command);
|
|
54
|
+
if (!parsed) {
|
|
55
|
+
return argError("terminal", "this sandbox runs commands without a shell — pipes, redirects, variables and command chaining are not available. Run one program with its arguments.");
|
|
56
|
+
}
|
|
57
|
+
argv = parsed;
|
|
58
|
+
}
|
|
59
|
+
const timeoutMs = timeoutFrom(args, this.options, env);
|
|
60
|
+
// The sandbox's own output ceiling stops runaway commands; the model sees a head/tail excerpt.
|
|
61
|
+
const result = await env.exec({ command: argv, shell, ...(cwd ? { cwd } : {}), timeoutMs, maxOutputBytes: env.limits.maxExecOutputBytes }, context.signal ? { signal: context.signal } : undefined);
|
|
62
|
+
return formatExecResult(command, result, timeoutMs, this.options.maxDisplayOutputBytes);
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
/** Split a simple command line into argv (quotes supported). null = needs a shell. */
|
|
67
|
+
export function splitArgv(command) {
|
|
68
|
+
const argv = [];
|
|
69
|
+
let current = "";
|
|
70
|
+
let quote = null;
|
|
71
|
+
let hasToken = false;
|
|
72
|
+
for (let i = 0; i < command.length; i++) {
|
|
73
|
+
const ch = command[i];
|
|
74
|
+
if (quote) {
|
|
75
|
+
if (ch === quote)
|
|
76
|
+
quote = null;
|
|
77
|
+
else if (ch === "\\" && quote === '"' && i + 1 < command.length)
|
|
78
|
+
current += command[++i];
|
|
79
|
+
else
|
|
80
|
+
current += ch;
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
if (ch === '"' || ch === "'") {
|
|
84
|
+
quote = ch;
|
|
85
|
+
hasToken = true;
|
|
86
|
+
}
|
|
87
|
+
else if (/\s/.test(ch)) {
|
|
88
|
+
if (hasToken)
|
|
89
|
+
argv.push(current);
|
|
90
|
+
current = "";
|
|
91
|
+
hasToken = false;
|
|
92
|
+
}
|
|
93
|
+
else if ("|&;<>()$`*?{}~".includes(ch)) {
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
96
|
+
else if (ch === "\\" && i + 1 < command.length) {
|
|
97
|
+
current += command[++i];
|
|
98
|
+
hasToken = true;
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
current += ch;
|
|
102
|
+
hasToken = true;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
if (quote)
|
|
106
|
+
return null;
|
|
107
|
+
if (hasToken)
|
|
108
|
+
argv.push(current);
|
|
109
|
+
return argv.length ? argv : null;
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=terminal-tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terminal-tool.js","sourceRoot":"","sources":["../../../../../src/components/tool-hub/built-in-tools/workspace/terminal-tool.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,cAAc,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAEzH,MAAM,iBAAiB,GAAG,MAAM,CAAC;AAEjC;;;;;GAKG;AACH,MAAM,OAAO,YAAY;IACd,IAAI,GAAG,eAAe,CAAC;IACvB,OAAO,GAAG,OAAO,CAAC;IAClB,UAAU,CAAiB;IAC5B,OAAO,CAA+B;IAE9C,YAAY,OAAO,GAAyB,EAAE;QAC5C,IAAI,CAAC,OAAO,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;QACvC,IAAI,CAAC,UAAU,GAAG;YAChB,IAAI,EAAE,UAAU;YAChB,WAAW,EACT,wGAAwG;gBACxG,+FAA+F;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AAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;AACnC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface WorkspaceToolOptions {
|
|
2
|
+
/** Most bytes of a file read_file returns to the model. Default 100 000. */
|
|
3
|
+
maxReadBytes?: number;
|
|
4
|
+
/** Most bytes of command output shown to the model (head + tail kept). Default 30 000. */
|
|
5
|
+
maxDisplayOutputBytes?: number;
|
|
6
|
+
/** Command timeout when the model gives none. Default 120 s. */
|
|
7
|
+
defaultTimeoutMs?: number;
|
|
8
|
+
/** Ceiling for timeout_seconds (the sandbox clamps further). Default 10 min. */
|
|
9
|
+
maxTimeoutMs?: number;
|
|
10
|
+
/** Most entries list_files returns. Default 500. */
|
|
11
|
+
maxListEntries?: number;
|
|
12
|
+
/** Most matches search_files returns. Default 100. */
|
|
13
|
+
maxSearchMatches?: number;
|
|
14
|
+
}
|
|
15
|
+
export type ResolvedWorkspaceToolOptions = Required<WorkspaceToolOptions>;
|
|
16
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/components/tool-hub/built-in-tools/workspace/types.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,oBAAoB;IACnC,4EAA4E;IAC5E,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,0FAA0F;IAC1F,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,gEAAgE;IAChE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,gFAAgF;IAChF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oDAAoD;IACpD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,sDAAsD;IACtD,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,MAAM,4BAA4B,GAAG,QAAQ,CAAC,oBAAoB,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// ---------------------------------------------------------------------------
|
|
2
|
+
// Workspace tools (A-61) — file and terminal tools that run ONLY through the
|
|
3
|
+
// agent's SandboxView (ToolContext.getSandbox()), never node:fs or
|
|
4
|
+
// child_process. The sandbox enforces paths, limits and isolation; these
|
|
5
|
+
// options only bound what is shown to the model.
|
|
6
|
+
// ---------------------------------------------------------------------------
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/components/tool-hub/built-in-tools/workspace/types.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,6EAA6E;AAC7E,mEAAmE;AACnE,yEAAyE;AACzE,iDAAiD;AACjD,8EAA8E"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ExecResult, SandboxView } from "../../../sandbox-hub/types/sandbox.js";
|
|
2
|
+
import type { ToolContext, ToolOutput } from "../../types.js";
|
|
3
|
+
import type { ResolvedWorkspaceToolOptions, WorkspaceToolOptions } from "./types.js";
|
|
4
|
+
export declare function resolveOptions(options?: WorkspaceToolOptions): ResolvedWorkspaceToolOptions;
|
|
5
|
+
/**
|
|
6
|
+
* Run `fn` against the agent's sandbox. Every SandboxError becomes an error result
|
|
7
|
+
* the model can act on; deterministic failures (path escape, not found, …) are marked
|
|
8
|
+
* non-retryable so the harness does not repeat them.
|
|
9
|
+
*/
|
|
10
|
+
export declare function withSandbox(toolName: string, context: ToolContext, fn: (env: SandboxView) => Promise<ToolOutput>): Promise<ToolOutput>;
|
|
11
|
+
export declare function argError(toolName: string, message: string): ToolOutput;
|
|
12
|
+
export declare function stringArg(args: Record<string, unknown>, key: string): string | undefined;
|
|
13
|
+
export declare function numberArg(args: Record<string, unknown>, key: string): number | undefined;
|
|
14
|
+
export declare function boolArg(args: Record<string, unknown>, key: string): boolean | undefined;
|
|
15
|
+
/** timeout_seconds → ms, bounded by the tool options and the sandbox. */
|
|
16
|
+
export declare function timeoutFrom(args: Record<string, unknown>, options: ResolvedWorkspaceToolOptions, env: SandboxView): number;
|
|
17
|
+
export declare function formatBytes(bytes: number): string;
|
|
18
|
+
/** Keep the head and the tail of a long text (the end of a build log is what matters). */
|
|
19
|
+
export declare function headTail(text: string, maxBytes: number): {
|
|
20
|
+
text: string;
|
|
21
|
+
cut: boolean;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* A command result for the model: status line, then bounded stdout/stderr. Non-zero exit,
|
|
25
|
+
* timeout and cancel are error results that are NEVER retried by the harness — re-running
|
|
26
|
+
* a command automatically could repeat its side effects.
|
|
27
|
+
*/
|
|
28
|
+
export declare function formatExecResult(label: string, result: ExecResult, timeoutMs: number, maxDisplayBytes: number): ToolOutput;
|
|
29
|
+
//# sourceMappingURL=workspace-helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-helpers.d.ts","sourceRoot":"","sources":["../../../../../src/components/tool-hub/built-in-tools/workspace/workspace-helpers.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACrF,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,KAAK,EAAE,4BAA4B,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAKrF,wBAAgB,cAAc,CAAC,OAAO,GAAE,oBAAyB,GAAG,4BAA4B,CAW/F;AAYD;;;;GAIG;AACH,wBAAsB,WAAW,CAC/B,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,WAAW,EACpB,EAAE,EAAE,CAAC,GAAG,EAAE,WAAW,KAAK,OAAO,CAAC,UAAU,CAAC,GAC5C,OAAO,CAAC,UAAU,CAAC,CAkBrB;AAED,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,UAAU,CAEtE;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAGxF;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAGxF;AAED,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAGvF;AAED,yEAAyE;AACzE,wBAAgB,WAAW,CACzB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,OAAO,EAAE,4BAA4B,EACrC,GAAG,EAAE,WAAW,GACf,MAAM,CAIR;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAIjD;AAED,0FAA0F;AAC1F,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,OAAO,CAAA;CAAE,CAYvF;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,UAAU,EAClB,SAAS,EAAE,MAAM,EACjB,eAAe,EAAE,MAAM,GACtB,UAAU,CA8BZ"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { SandboxError } from "../../../../kernel/errors/sandbox-error.js";
|
|
2
|
+
// Shared plumbing for the workspace tools: sandbox access, argument parsing,
|
|
3
|
+
// SandboxError → ToolOutput mapping, and bounded output formatting.
|
|
4
|
+
export function resolveOptions(options = {}) {
|
|
5
|
+
const positive = (value, fallback) => typeof value === "number" && Number.isFinite(value) && value > 0 ? Math.floor(value) : fallback;
|
|
6
|
+
return {
|
|
7
|
+
maxReadBytes: positive(options.maxReadBytes, 100_000),
|
|
8
|
+
maxDisplayOutputBytes: positive(options.maxDisplayOutputBytes, 30_000),
|
|
9
|
+
defaultTimeoutMs: positive(options.defaultTimeoutMs, 120_000),
|
|
10
|
+
maxTimeoutMs: positive(options.maxTimeoutMs, 10 * 60_000),
|
|
11
|
+
maxListEntries: positive(options.maxListEntries, 500),
|
|
12
|
+
maxSearchMatches: positive(options.maxSearchMatches, 100),
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
const HINTS = {
|
|
16
|
+
path_escape: 'Only paths inside your workspace are allowed — relative paths like "src/app.ts", or "/workspace/shared/…" for files shared with other agents.',
|
|
17
|
+
disabled: "This agent has no sandbox. Ask the user to enable one in the agent's Sandbox settings.",
|
|
18
|
+
not_configured: "No sandbox is configured on this server.",
|
|
19
|
+
environment_unavailable: "The sandbox is not available right now (e.g. Docker is not running).",
|
|
20
|
+
not_found: "Check the path with list_files.",
|
|
21
|
+
conflict: "The file changed since you read it — read it again before editing.",
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Run `fn` against the agent's sandbox. Every SandboxError becomes an error result
|
|
25
|
+
* the model can act on; deterministic failures (path escape, not found, …) are marked
|
|
26
|
+
* non-retryable so the harness does not repeat them.
|
|
27
|
+
*/
|
|
28
|
+
export async function withSandbox(toolName, context, fn) {
|
|
29
|
+
if (!context.getSandbox) {
|
|
30
|
+
return { content: `${toolName}: this agent has no workspace — no sandbox is available`, isError: true, retryable: false };
|
|
31
|
+
}
|
|
32
|
+
try {
|
|
33
|
+
return await fn(await context.getSandbox());
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
if (error instanceof SandboxError) {
|
|
37
|
+
const hint = HINTS[error.code];
|
|
38
|
+
return {
|
|
39
|
+
content: `${toolName} failed (${error.code}): ${error.message}${hint ? `\n${hint}` : ""}`,
|
|
40
|
+
isError: true,
|
|
41
|
+
retryable: error.retryable,
|
|
42
|
+
metadata: { code: error.code },
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
return { content: `${toolName} failed: ${error instanceof Error ? error.message : String(error)}`, isError: true };
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
export function argError(toolName, message) {
|
|
49
|
+
return { content: `${toolName}: ${message}`, isError: true, retryable: false };
|
|
50
|
+
}
|
|
51
|
+
export function stringArg(args, key) {
|
|
52
|
+
const value = args[key];
|
|
53
|
+
return typeof value === "string" ? value : undefined;
|
|
54
|
+
}
|
|
55
|
+
export function numberArg(args, key) {
|
|
56
|
+
const value = args[key];
|
|
57
|
+
return typeof value === "number" && Number.isFinite(value) ? value : undefined;
|
|
58
|
+
}
|
|
59
|
+
export function boolArg(args, key) {
|
|
60
|
+
const value = args[key];
|
|
61
|
+
return typeof value === "boolean" ? value : undefined;
|
|
62
|
+
}
|
|
63
|
+
/** timeout_seconds → ms, bounded by the tool options and the sandbox. */
|
|
64
|
+
export function timeoutFrom(args, options, env) {
|
|
65
|
+
const seconds = numberArg(args, "timeout_seconds");
|
|
66
|
+
const requested = seconds !== undefined && seconds > 0 ? seconds * 1000 : options.defaultTimeoutMs;
|
|
67
|
+
return Math.max(1, Math.floor(Math.min(requested, options.maxTimeoutMs, env.limits.maxExecTimeoutMs)));
|
|
68
|
+
}
|
|
69
|
+
export function formatBytes(bytes) {
|
|
70
|
+
if (bytes < 1024)
|
|
71
|
+
return `${bytes} B`;
|
|
72
|
+
if (bytes < 1024 * 1024)
|
|
73
|
+
return `${(bytes / 1024).toFixed(1)} KB`;
|
|
74
|
+
return `${(bytes / 1024 / 1024).toFixed(1)} MB`;
|
|
75
|
+
}
|
|
76
|
+
/** Keep the head and the tail of a long text (the end of a build log is what matters). */
|
|
77
|
+
export function headTail(text, maxBytes) {
|
|
78
|
+
const buf = Buffer.from(text, "utf8");
|
|
79
|
+
if (buf.length <= maxBytes)
|
|
80
|
+
return { text, cut: false };
|
|
81
|
+
const head = Math.floor(maxBytes / 3);
|
|
82
|
+
const tail = maxBytes - head;
|
|
83
|
+
const omitted = buf.length - head - tail;
|
|
84
|
+
return {
|
|
85
|
+
text: `${buf.subarray(0, head).toString("utf8")}\n… [${formatBytes(omitted)} omitted] …\n` +
|
|
86
|
+
buf.subarray(buf.length - tail).toString("utf8"),
|
|
87
|
+
cut: true,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* A command result for the model: status line, then bounded stdout/stderr. Non-zero exit,
|
|
92
|
+
* timeout and cancel are error results that are NEVER retried by the harness — re-running
|
|
93
|
+
* a command automatically could repeat its side effects.
|
|
94
|
+
*/
|
|
95
|
+
export function formatExecResult(label, result, timeoutMs, maxDisplayBytes) {
|
|
96
|
+
const status = [
|
|
97
|
+
result.timedOut
|
|
98
|
+
? `timed out after ${Math.round(timeoutMs / 1000)} s (killed)`
|
|
99
|
+
: result.cancelled
|
|
100
|
+
? "cancelled"
|
|
101
|
+
: `exit code ${result.exitCode}`,
|
|
102
|
+
`${(result.durationMs / 1000).toFixed(1)} s`,
|
|
103
|
+
...(result.truncated ? ["output limit reached — the command was stopped"] : []),
|
|
104
|
+
];
|
|
105
|
+
const stdout = headTail(result.stdout, Math.ceil(maxDisplayBytes * 0.7));
|
|
106
|
+
const stderr = headTail(result.stderr, Math.floor(maxDisplayBytes * 0.3));
|
|
107
|
+
const sections = [`$ ${label}`, status.join(" · ")];
|
|
108
|
+
if (result.stdout)
|
|
109
|
+
sections.push(`stdout:\n${stdout.text}`);
|
|
110
|
+
if (result.stderr)
|
|
111
|
+
sections.push(`stderr:\n${stderr.text}`);
|
|
112
|
+
if (!result.stdout && !result.stderr)
|
|
113
|
+
sections.push("(no output)");
|
|
114
|
+
const ok = result.exitCode === 0 && !result.timedOut && !result.cancelled;
|
|
115
|
+
return {
|
|
116
|
+
content: sections.join("\n"),
|
|
117
|
+
...(ok ? {} : { isError: true, retryable: false }),
|
|
118
|
+
metadata: {
|
|
119
|
+
exitCode: result.exitCode,
|
|
120
|
+
timedOut: result.timedOut,
|
|
121
|
+
cancelled: result.cancelled,
|
|
122
|
+
truncated: result.truncated,
|
|
123
|
+
durationMs: result.durationMs,
|
|
124
|
+
displayTruncated: stdout.cut || stderr.cut,
|
|
125
|
+
},
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
//# sourceMappingURL=workspace-helpers.js.map
|