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,6 @@
|
|
|
1
|
+
import type { LLMModelInfo } from "../types.js";
|
|
2
|
+
export declare function mapAnthropicModel(raw: Record<string, unknown>, provider: string): LLMModelInfo;
|
|
3
|
+
export declare function mapOpenAICompatibleModel(raw: Record<string, unknown>, provider: string): LLMModelInfo;
|
|
4
|
+
export declare function mapBedrockFoundationModel(raw: Record<string, unknown>, provider: string): LLMModelInfo | undefined;
|
|
5
|
+
export declare function mapCodexModel(raw: Record<string, unknown>, provider: string): LLMModelInfo;
|
|
6
|
+
//# sourceMappingURL=model-info-mappers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-info-mappers.d.ts","sourceRoot":"","sources":["../../../../src/components/llm-provider-hub/providers/model-info-mappers.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAwB,YAAY,EAAE,MAAM,aAAa,CAAC;AAwFtE,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,QAAQ,EAAE,MAAM,GAAG,YAAY,CAoC9F;AAMD,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,QAAQ,EAAE,MAAM,GAAG,YAAY,CAgGrG;AAMD,wBAAgB,yBAAyB,CACvC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC5B,QAAQ,EAAE,MAAM,GACf,YAAY,GAAG,SAAS,CAyB1B;AAMD,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,QAAQ,EAAE,MAAM,GAAG,YAAY,CAsB1F"}
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
// Pure, side-effect-free mappers from provider-specific raw list-models
|
|
2
|
+
// payloads to the SDK's provider-agnostic LLMModelInfo contract (A-54).
|
|
3
|
+
// Every field is read with typeof guards rather than trusting the static
|
|
4
|
+
// type, because vendor payloads vary and this file must never throw on a
|
|
5
|
+
// malformed or unexpected shape — unknown fields simply map to undefined.
|
|
6
|
+
// ---------------------------------------------------------------------------
|
|
7
|
+
// Internal helpers
|
|
8
|
+
// ---------------------------------------------------------------------------
|
|
9
|
+
/** Returns a finite integer > 0, otherwise undefined. */
|
|
10
|
+
function positiveInt(value) {
|
|
11
|
+
if (typeof value !== "number" || !Number.isFinite(value))
|
|
12
|
+
return undefined;
|
|
13
|
+
const n = Math.trunc(value);
|
|
14
|
+
return n > 0 ? n : undefined;
|
|
15
|
+
}
|
|
16
|
+
/** Reads a dotted path (e.g. "top_provider.context_length") off an object. */
|
|
17
|
+
function getPath(obj, path) {
|
|
18
|
+
const parts = path.split(".");
|
|
19
|
+
let cur = obj;
|
|
20
|
+
for (const part of parts) {
|
|
21
|
+
if (cur === null || typeof cur !== "object")
|
|
22
|
+
return undefined;
|
|
23
|
+
cur = cur[part];
|
|
24
|
+
}
|
|
25
|
+
return cur;
|
|
26
|
+
}
|
|
27
|
+
/** Returns the first path (dotted paths allowed) that yields a positive int. */
|
|
28
|
+
function firstPositiveInt(obj, paths) {
|
|
29
|
+
for (const path of paths) {
|
|
30
|
+
const value = positiveInt(getPath(obj, path));
|
|
31
|
+
if (value !== undefined)
|
|
32
|
+
return value;
|
|
33
|
+
}
|
|
34
|
+
return undefined;
|
|
35
|
+
}
|
|
36
|
+
/** Unix seconds -> ISO 8601, undefined when n is not > 0. */
|
|
37
|
+
function unixSecondsToIso(n) {
|
|
38
|
+
if (typeof n !== "number" || !Number.isFinite(n) || n <= 0)
|
|
39
|
+
return undefined;
|
|
40
|
+
return new Date(n * 1000).toISOString();
|
|
41
|
+
}
|
|
42
|
+
/** Date.parse must be > 0, otherwise undefined — drops the epoch placeholder. */
|
|
43
|
+
function isoOrUndefined(str) {
|
|
44
|
+
if (typeof str !== "string")
|
|
45
|
+
return undefined;
|
|
46
|
+
const parsed = Date.parse(str);
|
|
47
|
+
if (!Number.isFinite(parsed) || parsed <= 0)
|
|
48
|
+
return undefined;
|
|
49
|
+
return new Date(parsed).toISOString();
|
|
50
|
+
}
|
|
51
|
+
/** Undefined unless the value is a non-empty array of strings, lowercased. */
|
|
52
|
+
function lowerStringArray(value) {
|
|
53
|
+
if (!Array.isArray(value) || value.length === 0)
|
|
54
|
+
return undefined;
|
|
55
|
+
if (!value.every((v) => typeof v === "string"))
|
|
56
|
+
return undefined;
|
|
57
|
+
return value.map((v) => v.toLowerCase());
|
|
58
|
+
}
|
|
59
|
+
/** Drops undefined keys, returns undefined when nothing is left. */
|
|
60
|
+
function compactCapabilities(obj) {
|
|
61
|
+
const entries = Object.entries(obj).filter(([, v]) => v !== undefined);
|
|
62
|
+
return entries.length > 0 ? Object.fromEntries(entries) : undefined;
|
|
63
|
+
}
|
|
64
|
+
/** Reads obj[key].supported when it is a boolean. */
|
|
65
|
+
function supported(obj, key) {
|
|
66
|
+
if (!obj || typeof obj !== "object")
|
|
67
|
+
return undefined;
|
|
68
|
+
const entry = obj[key];
|
|
69
|
+
if (!entry || typeof entry !== "object")
|
|
70
|
+
return undefined;
|
|
71
|
+
const value = entry["supported"];
|
|
72
|
+
return typeof value === "boolean" ? value : undefined;
|
|
73
|
+
}
|
|
74
|
+
/** First non-empty string among the given values. */
|
|
75
|
+
function firstNonEmptyString(...values) {
|
|
76
|
+
for (const v of values) {
|
|
77
|
+
if (typeof v === "string" && v.length > 0)
|
|
78
|
+
return v;
|
|
79
|
+
}
|
|
80
|
+
return undefined;
|
|
81
|
+
}
|
|
82
|
+
/** Finite number >= 0, otherwise undefined. Accepts numeric strings. */
|
|
83
|
+
function nonNegativeNumber(value) {
|
|
84
|
+
const n = typeof value === "string" ? Number(value) : value;
|
|
85
|
+
if (typeof n !== "number" || !Number.isFinite(n) || n < 0)
|
|
86
|
+
return undefined;
|
|
87
|
+
return n;
|
|
88
|
+
}
|
|
89
|
+
// ---------------------------------------------------------------------------
|
|
90
|
+
// Anthropic
|
|
91
|
+
// ---------------------------------------------------------------------------
|
|
92
|
+
export function mapAnthropicModel(raw, provider) {
|
|
93
|
+
const id = typeof raw["id"] === "string" ? raw["id"] : "";
|
|
94
|
+
const capabilitiesRaw = raw["capabilities"];
|
|
95
|
+
const hasCapabilities = capabilitiesRaw !== null && typeof capabilitiesRaw === "object";
|
|
96
|
+
const capabilitiesObj = hasCapabilities ? capabilitiesRaw : undefined;
|
|
97
|
+
let inputModalities;
|
|
98
|
+
if (hasCapabilities) {
|
|
99
|
+
inputModalities = ["text"];
|
|
100
|
+
if (supported(capabilitiesObj, "image_input"))
|
|
101
|
+
inputModalities.push("image");
|
|
102
|
+
if (supported(capabilitiesObj, "pdf_input"))
|
|
103
|
+
inputModalities.push("pdf");
|
|
104
|
+
}
|
|
105
|
+
const capabilities = hasCapabilities
|
|
106
|
+
? compactCapabilities({
|
|
107
|
+
vision: supported(capabilitiesObj, "image_input"),
|
|
108
|
+
pdfInput: supported(capabilitiesObj, "pdf_input"),
|
|
109
|
+
// Anthropic does not report tool-calling support in this payload.
|
|
110
|
+
toolCalling: undefined,
|
|
111
|
+
reasoning: supported(capabilitiesObj, "thinking"),
|
|
112
|
+
structuredOutputs: supported(capabilitiesObj, "structured_outputs"),
|
|
113
|
+
})
|
|
114
|
+
: undefined;
|
|
115
|
+
return {
|
|
116
|
+
id,
|
|
117
|
+
provider,
|
|
118
|
+
displayName: typeof raw["display_name"] === "string" ? raw["display_name"] : undefined,
|
|
119
|
+
ownedBy: "anthropic",
|
|
120
|
+
createdAt: isoOrUndefined(raw["created_at"]),
|
|
121
|
+
contextWindowTokens: positiveInt(raw["max_input_tokens"]),
|
|
122
|
+
maxOutputTokens: positiveInt(raw["max_tokens"]),
|
|
123
|
+
inputModalities,
|
|
124
|
+
capabilities,
|
|
125
|
+
raw,
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
// ---------------------------------------------------------------------------
|
|
129
|
+
// OpenAI-compatible (OpenAI, Novita, OpenRouter, Groq, vLLM, ...)
|
|
130
|
+
// ---------------------------------------------------------------------------
|
|
131
|
+
export function mapOpenAICompatibleModel(raw, provider) {
|
|
132
|
+
const id = typeof raw["id"] === "string" ? raw["id"] : "";
|
|
133
|
+
const ownedBy = typeof raw["owned_by"] === "string" ? raw["owned_by"] : undefined;
|
|
134
|
+
const createdAt = unixSecondsToIso(raw["created"]);
|
|
135
|
+
const displayName = firstNonEmptyString(raw["display_name"], raw["name"], raw["title"]);
|
|
136
|
+
const description = typeof raw["description"] === "string" ? raw["description"] : undefined;
|
|
137
|
+
const contextWindowTokens = firstPositiveInt(raw, [
|
|
138
|
+
"context_window",
|
|
139
|
+
"context_length",
|
|
140
|
+
"context_size",
|
|
141
|
+
"max_context_length",
|
|
142
|
+
"max_model_len",
|
|
143
|
+
"top_provider.context_length",
|
|
144
|
+
"max_input_tokens",
|
|
145
|
+
]);
|
|
146
|
+
const maxOutputTokens = firstPositiveInt(raw, [
|
|
147
|
+
"max_output_tokens",
|
|
148
|
+
"max_completion_tokens",
|
|
149
|
+
"top_provider.max_completion_tokens",
|
|
150
|
+
"max_tokens",
|
|
151
|
+
]);
|
|
152
|
+
const inputModalities = lowerStringArray(raw["input_modalities"]) ?? lowerStringArray(getPath(raw, "architecture.input_modalities"));
|
|
153
|
+
const outputModalities = lowerStringArray(raw["output_modalities"]) ?? lowerStringArray(getPath(raw, "architecture.output_modalities"));
|
|
154
|
+
const supportedParameters = Array.isArray(raw["supported_parameters"])
|
|
155
|
+
? raw["supported_parameters"].filter((v) => typeof v === "string")
|
|
156
|
+
: undefined;
|
|
157
|
+
const features = Array.isArray(raw["features"])
|
|
158
|
+
? raw["features"].filter((v) => typeof v === "string")
|
|
159
|
+
: undefined;
|
|
160
|
+
// vision is derived whenever inputModalities is known (true or false).
|
|
161
|
+
// toolCalling/reasoning/structuredOutputs are inclusion tests against the
|
|
162
|
+
// vendor's supported_parameters/features arrays: true when matched,
|
|
163
|
+
// undefined otherwise (never guessed false) — the arrays are an open set
|
|
164
|
+
// and a vendor's silence about a feature is not evidence of its absence.
|
|
165
|
+
let capabilities;
|
|
166
|
+
if (inputModalities || supportedParameters || features) {
|
|
167
|
+
capabilities = compactCapabilities({
|
|
168
|
+
vision: inputModalities ? inputModalities.includes("image") : undefined,
|
|
169
|
+
toolCalling: supportedParameters?.includes("tools") ||
|
|
170
|
+
features?.includes("function-calling") ||
|
|
171
|
+
features?.includes("tools")
|
|
172
|
+
? true
|
|
173
|
+
: undefined,
|
|
174
|
+
reasoning: supportedParameters?.includes("reasoning") || features?.includes("reasoning")
|
|
175
|
+
? true
|
|
176
|
+
: undefined,
|
|
177
|
+
structuredOutputs: supportedParameters?.includes("structured_outputs") ||
|
|
178
|
+
supportedParameters?.includes("response_format") ||
|
|
179
|
+
features?.includes("structured-outputs")
|
|
180
|
+
? true
|
|
181
|
+
: undefined,
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
// Pricing is only normalized for the OpenRouter shape (pricing.prompt /
|
|
185
|
+
// pricing.completion, USD per token, as numeric strings). Other vendors'
|
|
186
|
+
// price fields have undocumented units (e.g. Novita's integer
|
|
187
|
+
// input_token_price_per_m) and so are left in raw rather than guessed.
|
|
188
|
+
let pricing;
|
|
189
|
+
const pricingObj = raw["pricing"];
|
|
190
|
+
if (pricingObj && typeof pricingObj === "object") {
|
|
191
|
+
const promptPrice = nonNegativeNumber(pricingObj["prompt"]);
|
|
192
|
+
const completionPrice = nonNegativeNumber(pricingObj["completion"]);
|
|
193
|
+
if (promptPrice !== undefined || completionPrice !== undefined) {
|
|
194
|
+
pricing = {
|
|
195
|
+
inputUsdPerMillionTokens: promptPrice !== undefined ? promptPrice * 1_000_000 : undefined,
|
|
196
|
+
outputUsdPerMillionTokens: completionPrice !== undefined ? completionPrice * 1_000_000 : undefined,
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
return {
|
|
201
|
+
id,
|
|
202
|
+
provider,
|
|
203
|
+
displayName,
|
|
204
|
+
description,
|
|
205
|
+
ownedBy,
|
|
206
|
+
createdAt,
|
|
207
|
+
contextWindowTokens,
|
|
208
|
+
maxOutputTokens,
|
|
209
|
+
inputModalities,
|
|
210
|
+
outputModalities,
|
|
211
|
+
capabilities,
|
|
212
|
+
pricing,
|
|
213
|
+
raw,
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
// ---------------------------------------------------------------------------
|
|
217
|
+
// Bedrock (ListFoundationModels)
|
|
218
|
+
// ---------------------------------------------------------------------------
|
|
219
|
+
export function mapBedrockFoundationModel(raw, provider) {
|
|
220
|
+
const id = typeof raw["modelId"] === "string" ? raw["modelId"] : undefined;
|
|
221
|
+
if (!id)
|
|
222
|
+
return undefined;
|
|
223
|
+
const inputModalities = lowerStringArray(raw["inputModalities"]);
|
|
224
|
+
const outputModalities = lowerStringArray(raw["outputModalities"]);
|
|
225
|
+
const streamingSupported = typeof raw["responseStreamingSupported"] === "boolean"
|
|
226
|
+
? raw["responseStreamingSupported"]
|
|
227
|
+
: undefined;
|
|
228
|
+
const capabilities = compactCapabilities({
|
|
229
|
+
vision: inputModalities ? inputModalities.includes("image") : undefined,
|
|
230
|
+
streaming: streamingSupported,
|
|
231
|
+
});
|
|
232
|
+
return {
|
|
233
|
+
id,
|
|
234
|
+
provider,
|
|
235
|
+
displayName: typeof raw["modelName"] === "string" ? raw["modelName"] : undefined,
|
|
236
|
+
ownedBy: typeof raw["providerName"] === "string" ? raw["providerName"] : undefined,
|
|
237
|
+
inputModalities,
|
|
238
|
+
outputModalities,
|
|
239
|
+
capabilities,
|
|
240
|
+
raw,
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
// ---------------------------------------------------------------------------
|
|
244
|
+
// ChatGPT subscription (Codex models endpoint)
|
|
245
|
+
// ---------------------------------------------------------------------------
|
|
246
|
+
export function mapCodexModel(raw, provider) {
|
|
247
|
+
const id = typeof raw["slug"] === "string" ? raw["slug"] : "";
|
|
248
|
+
const inputModalities = lowerStringArray(raw["input_modalities"]);
|
|
249
|
+
const reasoningLevels = raw["supported_reasoning_levels"];
|
|
250
|
+
const hasReasoningLevels = Array.isArray(reasoningLevels);
|
|
251
|
+
const capabilities = compactCapabilities({
|
|
252
|
+
vision: inputModalities ? inputModalities.includes("image") : undefined,
|
|
253
|
+
reasoning: hasReasoningLevels ? reasoningLevels.length > 0 : undefined,
|
|
254
|
+
});
|
|
255
|
+
return {
|
|
256
|
+
id,
|
|
257
|
+
provider,
|
|
258
|
+
displayName: typeof raw["display_name"] === "string" ? raw["display_name"] : undefined,
|
|
259
|
+
description: typeof raw["description"] === "string" ? raw["description"] : undefined,
|
|
260
|
+
ownedBy: "openai",
|
|
261
|
+
contextWindowTokens: firstPositiveInt(raw, ["context_window", "max_context_window"]),
|
|
262
|
+
inputModalities,
|
|
263
|
+
capabilities,
|
|
264
|
+
raw,
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
//# sourceMappingURL=model-info-mappers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-info-mappers.js","sourceRoot":"","sources":["../../../../src/components/llm-provider-hub/providers/model-info-mappers.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACx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,MAAM,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAE,GAAG,CAAC,MAAM,CAAY,CAAC,CAAC,CAAC,EAAE,CAAC;IAC1E,MAAM,eAAe,GAAG,gBAAgB,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC,CAAC;IAClE,MAAM,eAAe,GAAG,GAAG,CAAC,4BAA4B,CAAC,CAAC;IAC1D,MAAM,kBAAkB,GAAG,KAAK,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;IAE1D,MAAM,YAAY,GAAG,mBAAmB,CAAC;QACvC,MAAM,EAAE,eAAe,CAAC,CAAC,CAAC,eAAe,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS;QACvE,SAAS,EAAE,kBAAkB,CAAC,CAAC,CAAE,eAA6B,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS;KACtF,CAAC,CAAC;IAEH,OAAO;QACL,EAAE;QACF,QAAQ;QACR,WAAW,EAAE,OAAO,GAAG,CAAC,cAAc,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAE,GAAG,CAAC,cAAc,CAAY,CAAC,CAAC,CAAC,SAAS;QAClG,WAAW,EAAE,OAAO,GAAG,CAAC,aAAa,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAE,GAAG,CAAC,aAAa,CAAY,CAAC,CAAC,CAAC,SAAS;QAChG,OAAO,EAAE,QAAQ;QACjB,mBAAmB,EAAE,gBAAgB,CAAC,GAAG,EAAE,CAAC,gBAAgB,EAAE,oBAAoB,CAAC,CAAC;QACpF,eAAe;QACf,YAAY;QACZ,GAAG;KACJ,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Message, ModelResponse, StreamChunk } from "../../../kernel/types.js";
|
|
2
|
+
import type { LLMModelInfo, LLMModelProvider, ModelOptions } from "../types.js";
|
|
3
|
+
import type { ProviderConfig } from "./types.js";
|
|
4
|
+
export declare class OpenAICompatibleLLMModelProvider implements LLMModelProvider {
|
|
5
|
+
readonly name: string;
|
|
6
|
+
readonly version = "1.0.0";
|
|
7
|
+
private client;
|
|
8
|
+
private defaultModel;
|
|
9
|
+
constructor(config: ProviderConfig & {
|
|
10
|
+
name?: string;
|
|
11
|
+
});
|
|
12
|
+
initialize(): Promise<void>;
|
|
13
|
+
dispose(): Promise<void>;
|
|
14
|
+
chat(messages: Message[], options?: ModelOptions): Promise<ModelResponse>;
|
|
15
|
+
stream(messages: Message[], options?: ModelOptions): AsyncIterable<StreamChunk>;
|
|
16
|
+
countTokens(messages: Message[]): Promise<number>;
|
|
17
|
+
listModels(): Promise<LLMModelInfo[]>;
|
|
18
|
+
private mapMessages;
|
|
19
|
+
private mapChoiceMessage;
|
|
20
|
+
private mapFinishReason;
|
|
21
|
+
private mapTools;
|
|
22
|
+
private mapError;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=openai-compatible-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openai-compatible-provider.d.ts","sourceRoot":"","sources":["../../../../src/components/llm-provider-hub/providers/openai-compatible-provider.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,OAAO,EACP,aAAa,EACb,WAAW,EAGZ,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAGjD,qBAAa,gCAAiC,YAAW,gBAAgB;IACvE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,WAAW;IAE3B,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,YAAY,CAAS;IAE7B,YAAY,MAAM,EAAE,cAAc,GAAG;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,EAIrD;IAEK,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAAG;IAC9B,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAG;IAE3B,IAAI,CAAC,QAAQ,EAAE,OAAO,EAAE,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,aAAa,CAAC,CA4B9E;IAEM,MAAM,CAAC,QAAQ,EAAE,OAAO,EAAE,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,aAAa,CAAC,WAAW,CAAC,CAgGrF;IAEK,WAAW,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAQtD;IAEK,UAAU,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC,CAU1C;IAED,OAAO,CAAC,WAAW;IAmDnB,OAAO,CAAC,gBAAgB;IAkBxB,OAAO,CAAC,eAAe;IAWvB,OAAO,CAAC,QAAQ;IAchB,OAAO,CAAC,QAAQ;CAWjB"}
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
import OpenAI from "openai";
|
|
2
|
+
import { ModelError } from "../../../kernel/errors/model-error.js";
|
|
3
|
+
import { mapOpenAICompatibleModel } from "./model-info-mappers.js";
|
|
4
|
+
export class OpenAICompatibleLLMModelProvider {
|
|
5
|
+
name;
|
|
6
|
+
version = "1.0.0";
|
|
7
|
+
client;
|
|
8
|
+
defaultModel;
|
|
9
|
+
constructor(config) {
|
|
10
|
+
this.name = config.name ?? "openai";
|
|
11
|
+
this.defaultModel = config.model ?? "gpt-4o-mini";
|
|
12
|
+
this.client = new OpenAI({ apiKey: config.apiKey, baseURL: config.baseUrl });
|
|
13
|
+
}
|
|
14
|
+
async initialize() { }
|
|
15
|
+
async dispose() { }
|
|
16
|
+
async chat(messages, options) {
|
|
17
|
+
const mapped = this.mapMessages(messages, options);
|
|
18
|
+
try {
|
|
19
|
+
const response = await this.client.chat.completions.create({
|
|
20
|
+
model: options?.model ?? this.defaultModel,
|
|
21
|
+
max_tokens: options?.maxTokens ?? 4096,
|
|
22
|
+
messages: mapped,
|
|
23
|
+
temperature: options?.temperature,
|
|
24
|
+
top_p: options?.topP,
|
|
25
|
+
stop: options?.stopSequences,
|
|
26
|
+
tools: this.mapTools(options?.tools),
|
|
27
|
+
}, { signal: options?.signal });
|
|
28
|
+
const choice = response.choices[0];
|
|
29
|
+
return {
|
|
30
|
+
message: this.mapChoiceMessage(choice.message),
|
|
31
|
+
usage: {
|
|
32
|
+
inputTokens: response.usage?.prompt_tokens ?? 0,
|
|
33
|
+
outputTokens: response.usage?.completion_tokens ?? 0,
|
|
34
|
+
},
|
|
35
|
+
stopReason: this.mapFinishReason(choice.finish_reason),
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
39
|
+
throw this.mapError(error);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
async *stream(messages, options) {
|
|
43
|
+
const mapped = this.mapMessages(messages, options);
|
|
44
|
+
// `started` / `emittedLen` track what has already been streamed as
|
|
45
|
+
// tool_call_start / tool_call_delta progress for each call.
|
|
46
|
+
const toolCallBuffers = new Map();
|
|
47
|
+
let streamUsage;
|
|
48
|
+
try {
|
|
49
|
+
const stream = await this.client.chat.completions.create({
|
|
50
|
+
model: options?.model ?? this.defaultModel,
|
|
51
|
+
max_tokens: options?.maxTokens ?? 4096,
|
|
52
|
+
messages: mapped,
|
|
53
|
+
temperature: options?.temperature,
|
|
54
|
+
top_p: options?.topP,
|
|
55
|
+
stop: options?.stopSequences,
|
|
56
|
+
tools: this.mapTools(options?.tools),
|
|
57
|
+
stream: true,
|
|
58
|
+
stream_options: { include_usage: true },
|
|
59
|
+
}, { signal: options?.signal });
|
|
60
|
+
for await (const chunk of stream) {
|
|
61
|
+
if (chunk.usage) {
|
|
62
|
+
streamUsage = {
|
|
63
|
+
inputTokens: chunk.usage.prompt_tokens ?? 0,
|
|
64
|
+
outputTokens: chunk.usage.completion_tokens ?? 0,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
const delta = chunk.choices[0]?.delta;
|
|
68
|
+
if (!delta)
|
|
69
|
+
continue;
|
|
70
|
+
if (delta.content) {
|
|
71
|
+
yield { type: "text", content: delta.content };
|
|
72
|
+
}
|
|
73
|
+
if (delta.tool_calls) {
|
|
74
|
+
for (const tc of delta.tool_calls) {
|
|
75
|
+
if (!toolCallBuffers.has(tc.index)) {
|
|
76
|
+
toolCallBuffers.set(tc.index, {
|
|
77
|
+
id: tc.id ?? "",
|
|
78
|
+
name: tc.function?.name ?? "",
|
|
79
|
+
argsBuf: "",
|
|
80
|
+
started: false,
|
|
81
|
+
emittedLen: 0,
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
const buf = toolCallBuffers.get(tc.index);
|
|
85
|
+
if (tc.id)
|
|
86
|
+
buf.id = tc.id;
|
|
87
|
+
if (tc.function?.name)
|
|
88
|
+
buf.name = tc.function.name;
|
|
89
|
+
if (tc.function?.arguments)
|
|
90
|
+
buf.argsBuf += tc.function.arguments;
|
|
91
|
+
// Stream progress while the arguments are still being generated —
|
|
92
|
+
// the complete "tool_call" only follows at finish_reason. The call
|
|
93
|
+
// is announced once its id and name are known; any argument text
|
|
94
|
+
// that arrived before that is sent right after the start.
|
|
95
|
+
if (!buf.started && buf.id && buf.name) {
|
|
96
|
+
buf.started = true;
|
|
97
|
+
yield {
|
|
98
|
+
type: "tool_call_start",
|
|
99
|
+
toolCallProgress: { id: buf.id, name: buf.name },
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
if (buf.started && buf.argsBuf.length > buf.emittedLen) {
|
|
103
|
+
const argumentsDelta = buf.argsBuf.slice(buf.emittedLen);
|
|
104
|
+
buf.emittedLen = buf.argsBuf.length;
|
|
105
|
+
yield {
|
|
106
|
+
type: "tool_call_delta",
|
|
107
|
+
toolCallProgress: { id: buf.id, name: buf.name, argumentsDelta },
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
const finishReason = chunk.choices[0]?.finish_reason;
|
|
113
|
+
if (finishReason) {
|
|
114
|
+
for (const buf of toolCallBuffers.values()) {
|
|
115
|
+
const toolCall = {
|
|
116
|
+
id: buf.id,
|
|
117
|
+
name: buf.name,
|
|
118
|
+
arguments: buf.argsBuf ? JSON.parse(buf.argsBuf) : {},
|
|
119
|
+
};
|
|
120
|
+
yield { type: "tool_call", toolCall };
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
yield { type: "done", usage: streamUsage };
|
|
125
|
+
}
|
|
126
|
+
catch (error) {
|
|
127
|
+
yield { type: "error", error: this.mapError(error).message };
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
async countTokens(messages) {
|
|
131
|
+
const total = messages.reduce((sum, m) => {
|
|
132
|
+
let len = m.content.length;
|
|
133
|
+
if (m.toolCalls)
|
|
134
|
+
len += JSON.stringify(m.toolCalls).length;
|
|
135
|
+
if (m.toolResults)
|
|
136
|
+
len += JSON.stringify(m.toolResults).length;
|
|
137
|
+
return sum + len;
|
|
138
|
+
}, 0);
|
|
139
|
+
return Math.ceil(total / 4);
|
|
140
|
+
}
|
|
141
|
+
async listModels() {
|
|
142
|
+
try {
|
|
143
|
+
const models = [];
|
|
144
|
+
for await (const m of this.client.models.list()) {
|
|
145
|
+
models.push(mapOpenAICompatibleModel(m, this.name));
|
|
146
|
+
}
|
|
147
|
+
return models;
|
|
148
|
+
}
|
|
149
|
+
catch (error) {
|
|
150
|
+
throw this.mapError(error);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
mapMessages(messages, options) {
|
|
154
|
+
const mapped = [];
|
|
155
|
+
if (options?.systemPrompt) {
|
|
156
|
+
mapped.push({ role: "system", content: options.systemPrompt });
|
|
157
|
+
}
|
|
158
|
+
for (const msg of messages) {
|
|
159
|
+
if (msg.role === "system") {
|
|
160
|
+
mapped.push({ role: "system", content: msg.content });
|
|
161
|
+
continue;
|
|
162
|
+
}
|
|
163
|
+
if (msg.role === "assistant") {
|
|
164
|
+
if (msg.toolResults) {
|
|
165
|
+
for (const tr of msg.toolResults) {
|
|
166
|
+
mapped.push({
|
|
167
|
+
role: "tool",
|
|
168
|
+
tool_call_id: tr.toolCallId,
|
|
169
|
+
content: tr.content,
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
continue;
|
|
173
|
+
}
|
|
174
|
+
const toolCalls = msg.toolCalls?.map((tc) => ({
|
|
175
|
+
id: tc.id,
|
|
176
|
+
type: "function",
|
|
177
|
+
function: {
|
|
178
|
+
name: tc.name,
|
|
179
|
+
arguments: JSON.stringify(tc.arguments),
|
|
180
|
+
},
|
|
181
|
+
}));
|
|
182
|
+
mapped.push({
|
|
183
|
+
role: "assistant",
|
|
184
|
+
content: msg.content || null,
|
|
185
|
+
tool_calls: toolCalls?.length ? toolCalls : undefined,
|
|
186
|
+
});
|
|
187
|
+
continue;
|
|
188
|
+
}
|
|
189
|
+
mapped.push({ role: "user", content: msg.content });
|
|
190
|
+
}
|
|
191
|
+
return mapped;
|
|
192
|
+
}
|
|
193
|
+
mapChoiceMessage(message) {
|
|
194
|
+
const toolCalls = message.tool_calls
|
|
195
|
+
?.filter((tc) => tc.type === "function")
|
|
196
|
+
.map((tc) => ({
|
|
197
|
+
id: tc.id,
|
|
198
|
+
name: tc.function.name,
|
|
199
|
+
arguments: JSON.parse(tc.function.arguments || "{}"),
|
|
200
|
+
}));
|
|
201
|
+
return {
|
|
202
|
+
role: "assistant",
|
|
203
|
+
content: message.content ?? "",
|
|
204
|
+
toolCalls: toolCalls?.length ? toolCalls : undefined,
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
mapFinishReason(reason) {
|
|
208
|
+
switch (reason) {
|
|
209
|
+
case "stop": return "end_turn";
|
|
210
|
+
case "tool_calls": return "tool_use";
|
|
211
|
+
case "length": return "max_tokens";
|
|
212
|
+
default: return "error";
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
mapTools(tools) {
|
|
216
|
+
if (!tools?.length)
|
|
217
|
+
return undefined;
|
|
218
|
+
return tools.map((t) => ({
|
|
219
|
+
type: "function",
|
|
220
|
+
function: {
|
|
221
|
+
name: t.name,
|
|
222
|
+
description: t.description,
|
|
223
|
+
parameters: t.parameters,
|
|
224
|
+
},
|
|
225
|
+
}));
|
|
226
|
+
}
|
|
227
|
+
mapError(error) {
|
|
228
|
+
if (error instanceof OpenAI.APIError) {
|
|
229
|
+
if (error.status === 401)
|
|
230
|
+
return new ModelError("Invalid API key", "auth", false);
|
|
231
|
+
if (error.status === 429)
|
|
232
|
+
return new ModelError("Rate limited", "rate_limit", true);
|
|
233
|
+
if (error.status === 408)
|
|
234
|
+
return new ModelError("Request timeout", "timeout", true);
|
|
235
|
+
if (error.status === 400)
|
|
236
|
+
return new ModelError(error.message, "invalid_request", false);
|
|
237
|
+
return new ModelError(error.message, "provider", error.status >= 500);
|
|
238
|
+
}
|
|
239
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
240
|
+
return new ModelError(msg, "provider", false);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
//# sourceMappingURL=openai-compatible-provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openai-compatible-provider.js","sourceRoot":"","sources":["../../../../src/components/llm-provider-hub/providers/openai-compatible-provider.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAS5B,OAAO,EAAE,UAAU,EAAE,MAAM,uCAAuC,CAAC;AAEnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAEnE,MAAM,OAAO,gCAAgC;IAClC,IAAI,CAAS;IACb,OAAO,GAAG,OAAO,CAAC;IAEnB,MAAM,CAAS;IACf,YAAY,CAAS;IAE7B,YAAY,MAA0C;QACpD,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,IAAI,QAAQ,CAAC;QACpC,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC,KAAK,IAAI,aAAa,CAAC;QAClD,IAAI,CAAC,MAAM,GA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o, LLMModelProvider, ModelOptions } from "../types.js";
|
|
3
|
+
import type { ProviderConfig } from "./types.js";
|
|
4
|
+
export declare class OpenAISubscriptionProvider implements LLMModelProvider {
|
|
5
|
+
readonly name = "openai-subscription";
|
|
6
|
+
readonly version = "1.0.0";
|
|
7
|
+
private oauthAccessToken;
|
|
8
|
+
private chatgptAccountId?;
|
|
9
|
+
private defaultModel;
|
|
10
|
+
constructor(config: ProviderConfig);
|
|
11
|
+
initialize(): Promise<void>;
|
|
12
|
+
dispose(): Promise<void>;
|
|
13
|
+
/**
|
|
14
|
+
* Hot-swap OAuth tokens without reconstructing the provider — used by the
|
|
15
|
+
* server's token refresh middleware once a stale token has been refreshed.
|
|
16
|
+
*/
|
|
17
|
+
updateTokens(accessToken: string, accountId: string): void;
|
|
18
|
+
chat(messages: Message[], options?: ModelOptions): Promise<ModelResponse>;
|
|
19
|
+
stream(messages: Message[], options?: ModelOptions): AsyncIterable<StreamChunk>;
|
|
20
|
+
countTokens(messages: Message[]): Promise<number>;
|
|
21
|
+
listModels(): Promise<LLMModelInfo[]>;
|
|
22
|
+
private buildModelsHeaders;
|
|
23
|
+
private buildHeaders;
|
|
24
|
+
private buildRequestBody;
|
|
25
|
+
private mapTools;
|
|
26
|
+
private mapHttpError;
|
|
27
|
+
private mapNetworkError;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=openai-subscription-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openai-subscription-provider.d.ts","sourceRoot":"","sources":["../../../../src/components/llm-provider-hub/providers/openai-subscription-provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EACP,aAAa,EACb,WAAW,EAGZ,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AA6GjD,qBAA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