indusagi 0.12.32 → 0.12.34
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/CHANGELOG.md +340 -0
- package/CREDITS.md +22 -0
- package/NOTICE +17 -0
- package/README.md +47 -388
- package/dist/agent.js +27512 -0
- package/dist/ai.js +19758 -0
- package/dist/capabilities.js +2663 -0
- package/dist/cli.js +11653 -0
- package/dist/connectors-saas.js +3289 -0
- package/dist/index.js +16533 -0
- package/dist/interop.js +3181 -0
- package/dist/knowledge/guides/authoring-an-agent.md +53 -0
- package/dist/knowledge/guides/choosing-tools.md +49 -0
- package/dist/knowledge/guides/model-selection.md +51 -0
- package/dist/knowledge/guides/writing-system-prompts.md +53 -0
- package/dist/knowledge/index.ts +19 -0
- package/dist/knowledge/loader.ts +200 -0
- package/dist/knowledge/manifest.json +29 -0
- package/dist/llmgateway.js +3209 -0
- package/dist/mcp.js +1732 -0
- package/dist/memory.js +0 -0
- package/dist/react-host/index.js +101 -0
- package/dist/react-host/ink.js +97 -0
- package/dist/react-host/jsx-runtime.js +95 -0
- package/dist/react-ink.js +3821 -0
- package/dist/runtime.js +4387 -0
- package/dist/shell-app.js +12222 -0
- package/dist/smithy.js +7932 -0
- package/dist/swarm.js +8717 -0
- package/dist/tracing.js +724 -0
- package/dist/tui.js +2213 -0
- package/dist/types/capabilities/backends/index.d.ts +10 -0
- package/dist/types/capabilities/backends/node-backends.d.ts +28 -0
- package/dist/types/capabilities/capabilities.test.d.ts +14 -0
- package/dist/types/capabilities/files/diff.d.ts +49 -0
- package/dist/types/capabilities/files/edit.d.ts +21 -0
- package/dist/types/capabilities/files/ls.d.ts +16 -0
- package/dist/types/capabilities/files/read.d.ts +15 -0
- package/dist/types/capabilities/files/write.d.ts +16 -0
- package/dist/types/capabilities/index.d.ts +29 -0
- package/dist/types/capabilities/kernel/backends.d.ts +119 -0
- package/dist/types/capabilities/kernel/context.d.ts +48 -0
- package/dist/types/capabilities/kernel/index.d.ts +24 -0
- package/dist/types/capabilities/kernel/output.d.ts +40 -0
- package/dist/types/capabilities/kernel/registry.d.ts +61 -0
- package/dist/types/capabilities/kernel/spec.d.ts +113 -0
- package/dist/types/capabilities/planning/todo.d.ts +62 -0
- package/dist/types/capabilities/registry.d.ts +44 -0
- package/dist/types/capabilities/search/find.d.ts +33 -0
- package/dist/types/capabilities/search/grep.d.ts +30 -0
- package/dist/types/capabilities/shell/bash.d.ts +18 -0
- package/dist/types/capabilities/shell/process.d.ts +33 -0
- package/dist/types/capabilities/web/webfetch.d.ts +25 -0
- package/dist/types/capabilities/web/websearch.d.ts +23 -0
- package/dist/types/connectors-saas/connectors-saas.test.d.ts +12 -0
- package/dist/types/connectors-saas/index.d.ts +16 -0
- package/dist/types/connectors-saas/saas/adapter/composio-backend.d.ts +60 -0
- package/dist/types/connectors-saas/saas/control/connect.d.ts +114 -0
- package/dist/types/connectors-saas/saas/control/tools.d.ts +67 -0
- package/dist/types/connectors-saas/saas/core/builder.d.ts +86 -0
- package/dist/types/connectors-saas/saas/core/cache.d.ts +53 -0
- package/dist/types/connectors-saas/saas/core/index.d.ts +14 -0
- package/dist/types/connectors-saas/saas/core/port.d.ts +157 -0
- package/dist/types/connectors-saas/saas/core/scope-planner.d.ts +74 -0
- package/dist/types/connectors-saas/saas/gateway.d.ts +133 -0
- package/dist/types/connectors-saas/saas/render/format.d.ts +54 -0
- package/dist/types/connectors-saas/saas/render/index.d.ts +19 -0
- package/dist/types/connectors-saas/saas/render/summarizers.d.ts +58 -0
- package/dist/types/facade/agent.d.ts +1 -0
- package/dist/types/facade/ai.d.ts +1 -0
- package/dist/types/facade/bot/actions/bash.d.ts +56 -0
- package/dist/types/facade/bot/actions/composio/accounts.d.ts +22 -0
- package/dist/types/facade/bot/actions/composio/client.d.ts +39 -0
- package/dist/types/facade/bot/actions/composio/connect.d.ts +19 -0
- package/dist/types/facade/bot/actions/composio/enable.d.ts +25 -0
- package/dist/types/facade/bot/actions/composio/execute.d.ts +26 -0
- package/dist/types/facade/bot/actions/composio/helpers.d.ts +16 -0
- package/dist/types/facade/bot/actions/composio/index.d.ts +9 -0
- package/dist/types/facade/bot/actions/composio/provider.d.ts +8 -0
- package/dist/types/facade/bot/actions/composio/toolkits.d.ts +22 -0
- package/dist/types/facade/bot/actions/composio/tools.d.ts +28 -0
- package/dist/types/facade/bot/actions/composio/types.d.ts +137 -0
- package/dist/types/facade/bot/actions/crew/activity-tracker.d.ts +65 -0
- package/dist/types/facade/bot/actions/crew/cleanup.d.ts +50 -0
- package/dist/types/facade/bot/actions/crew/fs-lock.d.ts +11 -0
- package/dist/types/facade/bot/actions/crew/index.d.ts +11 -0
- package/dist/types/facade/bot/actions/crew/mailbox.d.ts +20 -0
- package/dist/types/facade/bot/actions/crew/model-policy.d.ts +22 -0
- package/dist/types/facade/bot/actions/crew/names.d.ts +27 -0
- package/dist/types/facade/bot/actions/crew/protocol.d.ts +74 -0
- package/dist/types/facade/bot/actions/crew/task-store.d.ts +88 -0
- package/dist/types/facade/bot/actions/crew/team-attach-claim.d.ts +35 -0
- package/dist/types/facade/bot/actions/crew/team-config.d.ts +54 -0
- package/dist/types/facade/bot/actions/crew/worktree.d.ts +39 -0
- package/dist/types/facade/bot/actions/edit-diff.d.ts +66 -0
- package/dist/types/facade/bot/actions/edit.d.ts +41 -0
- package/dist/types/facade/bot/actions/find.d.ts +25 -0
- package/dist/types/facade/bot/actions/grep.d.ts +43 -0
- package/dist/types/facade/bot/actions/index.d.ts +300 -0
- package/dist/types/facade/bot/actions/kit/hook-runner.d.ts +12 -0
- package/dist/types/facade/bot/actions/kit/image-resize.d.ts +19 -0
- package/dist/types/facade/bot/actions/kit/mime.d.ts +1 -0
- package/dist/types/facade/bot/actions/kit/shell.d.ts +12 -0
- package/dist/types/facade/bot/actions/ls.d.ts +41 -0
- package/dist/types/facade/bot/actions/path-utils.d.ts +8 -0
- package/dist/types/facade/bot/actions/process-controller.d.ts +14 -0
- package/dist/types/facade/bot/actions/process-manager.d.ts +59 -0
- package/dist/types/facade/bot/actions/process-types.d.ts +73 -0
- package/dist/types/facade/bot/actions/process.d.ts +37 -0
- package/dist/types/facade/bot/actions/read.d.ts +36 -0
- package/dist/types/facade/bot/actions/registry.d.ts +20 -0
- package/dist/types/facade/bot/actions/todo-store.d.ts +76 -0
- package/dist/types/facade/bot/actions/todo-types.d.ts +72 -0
- package/dist/types/facade/bot/actions/todo.d.ts +76 -0
- package/dist/types/facade/bot/actions/truncate.d.ts +78 -0
- package/dist/types/facade/bot/actions/webfetch.d.ts +35 -0
- package/dist/types/facade/bot/actions/websearch.d.ts +34 -0
- package/dist/types/facade/bot/actions/write.d.ts +30 -0
- package/dist/types/facade/bot/agent-loop.d.ts +20 -0
- package/dist/types/facade/bot/agent.d.ts +132 -0
- package/dist/types/facade/bot/error-handler.d.ts +7 -0
- package/dist/types/facade/bot/event-bus.d.ts +8 -0
- package/dist/types/facade/bot/index.d.ts +7 -0
- package/dist/types/facade/bot/messages.d.ts +83 -0
- package/dist/types/facade/bot/proxy.d.ts +70 -0
- package/dist/types/facade/bot/session-manager.d.ts +409 -0
- package/dist/types/facade/bot/state-manager.d.ts +21 -0
- package/dist/types/facade/bot/telemetry.d.ts +6 -0
- package/dist/types/facade/bot/types.d.ts +207 -0
- package/dist/types/facade/mcp-core/client-pool.d.ts +105 -0
- package/dist/types/facade/mcp-core/client.d.ts +157 -0
- package/dist/types/facade/mcp-core/config.d.ts +60 -0
- package/dist/types/facade/mcp-core/errors.d.ts +103 -0
- package/dist/types/facade/mcp-core/index.d.ts +55 -0
- package/dist/types/facade/mcp-core/schema-converter.d.ts +67 -0
- package/dist/types/facade/mcp-core/server.d.ts +110 -0
- package/dist/types/facade/mcp-core/tool-factory.d.ts +62 -0
- package/dist/types/facade/mcp-core/types.d.ts +288 -0
- package/dist/types/facade/mcp.d.ts +1 -0
- package/dist/types/facade/memory.d.ts +1 -0
- package/dist/types/facade/ml/adapters/amazon-bedrock.d.ts +32 -0
- package/dist/types/facade/ml/adapters/anthropic.d.ts +61 -0
- package/dist/types/facade/ml/adapters/azure-openai-responses.d.ts +14 -0
- package/dist/types/facade/ml/adapters/google-shared.d.ts +99 -0
- package/dist/types/facade/ml/adapters/google-vertex.d.ts +14 -0
- package/dist/types/facade/ml/adapters/google.d.ts +15 -0
- package/dist/types/facade/ml/adapters/kimi.d.ts +21 -0
- package/dist/types/facade/ml/adapters/mock.d.ts +9 -0
- package/dist/types/facade/ml/adapters/nvidia.d.ts +12 -0
- package/dist/types/facade/ml/adapters/openai-codex-responses.d.ts +8 -0
- package/dist/types/facade/ml/adapters/openai-completions.d.ts +24 -0
- package/dist/types/facade/ml/adapters/openai-responses-shared.d.ts +25 -0
- package/dist/types/facade/ml/adapters/openai-responses.d.ts +12 -0
- package/dist/types/facade/ml/adapters/openai-scaffold.d.ts +3 -0
- package/dist/types/facade/ml/adapters/register-builtins.d.ts +2 -0
- package/dist/types/facade/ml/adapters/simple-options.d.ts +26 -0
- package/dist/types/facade/ml/adapters/transform-messages.d.ts +23 -0
- package/dist/types/facade/ml/api-registry.d.ts +49 -0
- package/dist/types/facade/ml/cli.d.ts +2 -0
- package/dist/types/facade/ml/env-api-keys.d.ts +19 -0
- package/dist/types/facade/ml/index.d.ts +27 -0
- package/dist/types/facade/ml/kit/auth/anthropic.d.ts +17 -0
- package/dist/types/facade/ml/kit/auth/github-copilot.d.ts +22 -0
- package/dist/types/facade/ml/kit/auth/index.d.ts +50 -0
- package/dist/types/facade/ml/kit/auth/kimi.d.ts +23 -0
- package/dist/types/facade/ml/kit/auth/oauth-page.d.ts +2 -0
- package/dist/types/facade/ml/kit/auth/openai-codex.d.ts +36 -0
- package/dist/types/facade/ml/kit/auth/pkce.d.ts +12 -0
- package/dist/types/facade/ml/kit/auth/types.d.ts +67 -0
- package/dist/types/facade/ml/kit/base-stream-handler.d.ts +30 -0
- package/dist/types/facade/ml/kit/event-stream.d.ts +63 -0
- package/dist/types/facade/ml/kit/index.d.ts +14 -0
- package/dist/types/facade/ml/kit/json-parse.d.ts +23 -0
- package/dist/types/facade/ml/kit/message-transform.d.ts +32 -0
- package/dist/types/facade/ml/kit/output-factory.d.ts +8 -0
- package/dist/types/facade/ml/kit/overflow.d.ts +9 -0
- package/dist/types/facade/ml/kit/provider-adapter.d.ts +56 -0
- package/dist/types/facade/ml/kit/provider-client-builder.d.ts +36 -0
- package/dist/types/facade/ml/kit/provider-consolidation.d.ts +3 -0
- package/dist/types/facade/ml/kit/provider-constants.d.ts +34 -0
- package/dist/types/facade/ml/kit/provider-errors.d.ts +52 -0
- package/dist/types/facade/ml/kit/sanitize-unicode.d.ts +2 -0
- package/dist/types/facade/ml/kit/stream-event-helper.d.ts +38 -0
- package/dist/types/facade/ml/kit/stream-handler-types.d.ts +46 -0
- package/dist/types/facade/ml/kit/streaming-state-manager.d.ts +42 -0
- package/dist/types/facade/ml/kit/tool-converter.d.ts +49 -0
- package/dist/types/facade/ml/kit/typebox-helpers.d.ts +24 -0
- package/dist/types/facade/ml/kit/validation.d.ts +26 -0
- package/dist/types/facade/ml/models.d.ts +41 -0
- package/dist/types/facade/ml/models.generated.d.ts +12261 -0
- package/dist/types/facade/ml/stream.d.ts +27 -0
- package/dist/types/facade/ml/types.d.ts +269 -0
- package/dist/types/index.d.ts +16 -0
- package/dist/types/interop/index.d.ts +12 -0
- package/dist/types/interop/interop.test.d.ts +19 -0
- package/dist/types/interop/protocol-bridge/bridge.d.ts +52 -0
- package/dist/types/interop/protocol-bridge/contract.d.ts +249 -0
- package/dist/types/interop/protocol-bridge/endpoint.d.ts +124 -0
- package/dist/types/interop/protocol-bridge/fleet.d.ts +92 -0
- package/dist/types/interop/protocol-bridge/host.d.ts +61 -0
- package/dist/types/interop/protocol-bridge/index.d.ts +16 -0
- package/dist/types/interop/protocol-bridge/schema.d.ts +29 -0
- package/dist/types/llmgateway/catalog/cards.d.ts +18 -0
- package/dist/types/llmgateway/catalog/cost.d.ts +15 -0
- package/dist/types/llmgateway/catalog/index.d.ts +7 -0
- package/dist/types/llmgateway/catalog/query.d.ts +40 -0
- package/dist/types/llmgateway/connectors/anthropic.d.ts +35 -0
- package/dist/types/llmgateway/connectors/azure-openai.d.ts +33 -0
- package/dist/types/llmgateway/connectors/bedrock.d.ts +113 -0
- package/dist/types/llmgateway/connectors/google-vertex.d.ts +38 -0
- package/dist/types/llmgateway/connectors/google.d.ts +40 -0
- package/dist/types/llmgateway/connectors/index.d.ts +26 -0
- package/dist/types/llmgateway/connectors/kimi.d.ts +28 -0
- package/dist/types/llmgateway/connectors/mock.d.ts +37 -0
- package/dist/types/llmgateway/connectors/nvidia.d.ts +27 -0
- package/dist/types/llmgateway/connectors/ollama.d.ts +45 -0
- package/dist/types/llmgateway/connectors/openai-chat.d.ts +25 -0
- package/dist/types/llmgateway/connectors/openai-responses.d.ts +49 -0
- package/dist/types/llmgateway/contract/connector.d.ts +32 -0
- package/dist/types/llmgateway/contract/conversation.d.ts +86 -0
- package/dist/types/llmgateway/contract/emission.d.ts +55 -0
- package/dist/types/llmgateway/contract/errors.d.ts +27 -0
- package/dist/types/llmgateway/contract/index.d.ts +13 -0
- package/dist/types/llmgateway/contract/model-card.d.ts +42 -0
- package/dist/types/llmgateway/contract/options.d.ts +31 -0
- package/dist/types/llmgateway/contract/reply.d.ts +33 -0
- package/dist/types/llmgateway/conversion/index.d.ts +10 -0
- package/dist/types/llmgateway/conversion/mappers.d.ts +65 -0
- package/dist/types/llmgateway/conversion/openai-compatible.d.ts +46 -0
- package/dist/types/llmgateway/conversion/reduce.d.ts +20 -0
- package/dist/types/llmgateway/credentials/oauth.d.ts +73 -0
- package/dist/types/llmgateway/credentials/pkce.d.ts +52 -0
- package/dist/types/llmgateway/credentials/secrets.d.ts +74 -0
- package/dist/types/llmgateway/gateway.d.ts +34 -0
- package/dist/types/llmgateway/gateway.test.d.ts +14 -0
- package/dist/types/llmgateway/index.d.ts +11 -0
- package/dist/types/llmgateway/streaming/channel.d.ts +24 -0
- package/dist/types/llmgateway/streaming/index.d.ts +10 -0
- package/dist/types/llmgateway/streaming/ndjson.d.ts +17 -0
- package/dist/types/llmgateway/streaming/sse.d.ts +31 -0
- package/dist/types/react-host/index.d.ts +9 -0
- package/dist/types/react-host/ink.d.ts +5 -0
- package/dist/types/react-host/jsx-runtime.d.ts +4 -0
- package/dist/types/react-host/loader.d.ts +3 -0
- package/dist/types/react-ink/components/ChangelogBlock.d.ts +8 -0
- package/dist/types/react-ink/components/DisplayBlockView.d.ts +8 -0
- package/dist/types/react-ink/components/Footer.d.ts +11 -0
- package/dist/types/react-ink/components/MessageList.d.ts +14 -0
- package/dist/types/react-ink/components/MessageRow.d.ts +13 -0
- package/dist/types/react-ink/components/StatusLine.d.ts +9 -0
- package/dist/types/react-ink/components/TaskPanel.d.ts +11 -0
- package/dist/types/react-ink/components/ToolEventBlock.d.ts +24 -0
- package/dist/types/react-ink/components/dialogs/DialogFrame.d.ts +8 -0
- package/dist/types/react-ink/components/dialogs/LoginDialog.d.ts +14 -0
- package/dist/types/react-ink/components/dialogs/ModelDialog.d.ts +9 -0
- package/dist/types/react-ink/components/dialogs/OAuthDialog.d.ts +9 -0
- package/dist/types/react-ink/components/dialogs/ScopedModelsDialog.d.ts +9 -0
- package/dist/types/react-ink/components/dialogs/SelectableDialog.d.ts +22 -0
- package/dist/types/react-ink/components/dialogs/SessionDialog.d.ts +13 -0
- package/dist/types/react-ink/components/dialogs/SettingsDialog.d.ts +14 -0
- package/dist/types/react-ink/components/dialogs/StartupSessionPicker.d.ts +9 -0
- package/dist/types/react-ink/components/dialogs/ThemeDialog.d.ts +26 -0
- package/dist/types/react-ink/components/dialogs/TreeDialog.d.ts +8 -0
- package/dist/types/react-ink/components/dialogs/UserMessageDialog.d.ts +8 -0
- package/dist/types/react-ink/components/messages/AssistantMessage.d.ts +12 -0
- package/dist/types/react-ink/components/messages/BashMessage.d.ts +8 -0
- package/dist/types/react-ink/components/messages/BranchSummaryMessage.d.ts +8 -0
- package/dist/types/react-ink/components/messages/CompactionMessage.d.ts +8 -0
- package/dist/types/react-ink/components/messages/CustomMessage.d.ts +9 -0
- package/dist/types/react-ink/components/messages/SkillInvocationMessage.d.ts +7 -0
- package/dist/types/react-ink/components/messages/ToolCallMessage.d.ts +8 -0
- package/dist/types/react-ink/components/messages/ToolResultBlock.d.ts +12 -0
- package/dist/types/react-ink/components/messages/UserMessage.d.ts +9 -0
- package/dist/types/react-ink/diff/Diff.d.ts +22 -0
- package/dist/types/react-ink/diff/diff.test.d.ts +1 -0
- package/dist/types/react-ink/diff/structured.d.ts +41 -0
- package/dist/types/react-ink/diff/word-diff.d.ts +27 -0
- package/dist/types/react-ink/index.d.ts +42 -0
- package/dist/types/react-ink/markdown/Markdown.d.ts +23 -0
- package/dist/types/react-ink/markdown/MarkdownTable.d.ts +19 -0
- package/dist/types/react-ink/markdown/StreamingMarkdown.d.ts +34 -0
- package/dist/types/react-ink/markdown/format-token.d.ts +39 -0
- package/dist/types/react-ink/markdown/highlight.d.ts +31 -0
- package/dist/types/react-ink/theme-adapter.d.ts +66 -0
- package/dist/types/react-ink/types.d.ts +133 -0
- package/dist/types/react-ink/utils/message-groups.d.ts +25 -0
- package/dist/types/react-ink/utils/selection-dialog.d.ts +2 -0
- package/dist/types/react-ink/utils/session-browser.d.ts +27 -0
- package/dist/types/react-ink/utils/tool-display.d.ts +37 -0
- package/dist/types/runtime/cadence/cadence.test.d.ts +6 -0
- package/dist/types/runtime/cadence/fold.d.ts +48 -0
- package/dist/types/runtime/cadence/index.d.ts +12 -0
- package/dist/types/runtime/cadence/reducer.d.ts +44 -0
- package/dist/types/runtime/conductor/agent.d.ts +71 -0
- package/dist/types/runtime/conductor/index.d.ts +11 -0
- package/dist/types/runtime/contract/config.d.ts +44 -0
- package/dist/types/runtime/contract/effect.d.ts +41 -0
- package/dist/types/runtime/contract/errors.d.ts +22 -0
- package/dist/types/runtime/contract/events.d.ts +63 -0
- package/dist/types/runtime/contract/index.d.ts +18 -0
- package/dist/types/runtime/contract/run-state.d.ts +57 -0
- package/dist/types/runtime/contract/session.d.ts +42 -0
- package/dist/types/runtime/contract/signal.d.ts +49 -0
- package/dist/types/runtime/contract/tools.d.ts +45 -0
- package/dist/types/runtime/dispatch/index.d.ts +9 -0
- package/dist/types/runtime/dispatch/scheduler.d.ts +53 -0
- package/dist/types/runtime/index.d.ts +22 -0
- package/dist/types/runtime/ledger/accumulator.d.ts +44 -0
- package/dist/types/runtime/ledger/bus.d.ts +50 -0
- package/dist/types/runtime/ledger/index.d.ts +11 -0
- package/dist/types/runtime/memory/compactor.d.ts +56 -0
- package/dist/types/runtime/memory/estimate.d.ts +21 -0
- package/dist/types/runtime/memory/index.d.ts +8 -0
- package/dist/types/runtime/runtime.test.d.ts +15 -0
- package/dist/types/runtime/store/dag.d.ts +72 -0
- package/dist/types/runtime/store/hash.d.ts +18 -0
- package/dist/types/runtime/store/index.d.ts +12 -0
- package/dist/types/runtime/store/persist.d.ts +49 -0
- package/dist/types/runtime/turn/driver.d.ts +32 -0
- package/dist/types/runtime/turn/index.d.ts +8 -0
- package/dist/types/runtime/wire/index.d.ts +10 -0
- package/dist/types/runtime/wire/projectors.d.ts +53 -0
- package/dist/types/shell-app/auth-cli/index.d.ts +9 -0
- package/dist/types/shell-app/auth-cli/oauth-cli.d.ts +73 -0
- package/dist/types/shell-app/boot/context.d.ts +108 -0
- package/dist/types/shell-app/boot/index.d.ts +13 -0
- package/dist/types/shell-app/boot/pipeline.d.ts +66 -0
- package/dist/types/shell-app/boot/stages.d.ts +77 -0
- package/dist/types/shell-app/cli.d.ts +75 -0
- package/dist/types/shell-app/config/index.d.ts +11 -0
- package/dist/types/shell-app/config/locator.d.ts +85 -0
- package/dist/types/shell-app/config/settings.d.ts +91 -0
- package/dist/types/shell-app/index.d.ts +26 -0
- package/dist/types/shell-app/invocation/flags.d.ts +89 -0
- package/dist/types/shell-app/invocation/parse.d.ts +89 -0
- package/dist/types/shell-app/locate/brand.d.ts +71 -0
- package/dist/types/shell-app/locate/index.d.ts +12 -0
- package/dist/types/shell-app/locate/locator.d.ts +122 -0
- package/dist/types/shell-app/runners/contract.d.ts +116 -0
- package/dist/types/shell-app/runners/index.d.ts +15 -0
- package/dist/types/shell-app/runners/one-shot.d.ts +21 -0
- package/dist/types/shell-app/runners/registry.d.ts +34 -0
- package/dist/types/shell-app/runners/repl.d.ts +51 -0
- package/dist/types/shell-app/runners/wire.d.ts +34 -0
- package/dist/types/shell-app/shell-app.test.d.ts +14 -0
- package/dist/types/shell-app/upgrade/index.d.ts +9 -0
- package/dist/types/shell-app/upgrade/upgrades.d.ts +62 -0
- package/dist/types/smithy/config/flag-reader.d.ts +128 -0
- package/dist/types/smithy/config/index.d.ts +9 -0
- package/dist/types/smithy/forge.d.ts +135 -0
- package/dist/types/smithy/index.d.ts +36 -0
- package/dist/types/smithy/knowledge/index.d.ts +10 -0
- package/dist/types/smithy/knowledge/loader.d.ts +64 -0
- package/dist/types/smithy/persona/blueprint.d.ts +75 -0
- package/dist/types/smithy/persona/define-agent.d.ts +51 -0
- package/dist/types/smithy/persona/index.d.ts +14 -0
- package/dist/types/smithy/persona/profiles.d.ts +44 -0
- package/dist/types/smithy/runtime/index.d.ts +9 -0
- package/dist/types/smithy/runtime/tool-ledger.d.ts +130 -0
- package/dist/types/smithy/smithy.test.d.ts +20 -0
- package/dist/types/smithy/ui/index.d.ts +11 -0
- package/dist/types/smithy/ui/transcript.d.ts +183 -0
- package/dist/types/swarm/coordinator.d.ts +192 -0
- package/dist/types/swarm/index.d.ts +33 -0
- package/dist/types/swarm/isolation/index.d.ts +14 -0
- package/dist/types/swarm/isolation/runner.d.ts +61 -0
- package/dist/types/swarm/isolation/worktree.d.ts +142 -0
- package/dist/types/swarm/kernel/faults.d.ts +52 -0
- package/dist/types/swarm/kernel/ids.d.ts +25 -0
- package/dist/types/swarm/kernel/index.d.ts +26 -0
- package/dist/types/swarm/kernel/json-cell.d.ts +113 -0
- package/dist/types/swarm/kernel/jsonl-log.d.ts +81 -0
- package/dist/types/swarm/postbox/channel.d.ts +88 -0
- package/dist/types/swarm/postbox/codecs.d.ts +253 -0
- package/dist/types/swarm/postbox/index.d.ts +16 -0
- package/dist/types/swarm/roster/index.d.ts +16 -0
- package/dist/types/swarm/roster/manifest.d.ts +185 -0
- package/dist/types/swarm/swarm.test.d.ts +24 -0
- package/dist/types/swarm/telemetry/activity.d.ts +143 -0
- package/dist/types/swarm/workboard/board.d.ts +174 -0
- package/dist/types/swarm/workboard/dep-graph.d.ts +77 -0
- package/dist/types/swarm/workboard/index.d.ts +12 -0
- package/dist/types/tracing/adapter/index.d.ts +12 -0
- package/dist/types/tracing/adapter/runtime-trace.d.ts +54 -0
- package/dist/types/tracing/channel/index.d.ts +9 -0
- package/dist/types/tracing/channel/signal.d.ts +93 -0
- package/dist/types/tracing/index.d.ts +25 -0
- package/dist/types/tracing/recorder/index.d.ts +12 -0
- package/dist/types/tracing/recorder/recorder.d.ts +75 -0
- package/dist/types/tracing/recorder/sampling.d.ts +55 -0
- package/dist/types/tracing/redaction/index.d.ts +8 -0
- package/dist/types/tracing/redaction/secret-scrubber.d.ts +95 -0
- package/dist/types/tracing/registry/hub.d.ts +57 -0
- package/dist/types/tracing/registry/index.d.ts +7 -0
- package/dist/types/tracing/signal/handle.d.ts +73 -0
- package/dist/types/tracing/signal/index.d.ts +12 -0
- package/dist/types/tracing/signal/segment.d.ts +124 -0
- package/dist/types/tracing/sinks/base.d.ts +51 -0
- package/dist/types/tracing/sinks/console.d.ts +44 -0
- package/dist/types/tracing/sinks/file.d.ts +47 -0
- package/dist/types/tracing/sinks/index.d.ts +16 -0
- package/dist/types/tracing/sinks/stream.d.ts +46 -0
- package/dist/types/tracing/tracing.test.d.ts +7 -0
- package/dist/types/ui/autocomplete.d.ts +59 -0
- package/dist/types/ui/contracts.d.ts +38 -0
- package/dist/types/ui/editor-component.d.ts +100 -0
- package/dist/types/ui/fuzzy.d.ts +29 -0
- package/dist/types/ui/index.d.ts +8 -0
- package/dist/types/ui/keybindings.d.ts +62 -0
- package/dist/types/ui/keys.d.ts +171 -0
- package/dist/types/ui/theme-types.d.ts +36 -0
- package/dist/types/ui/utils.d.ts +101 -0
- package/dist/types/ui-bridge/InteractiveApp.d.ts +38 -0
- package/dist/types/ui-bridge/adapter.d.ts +90 -0
- package/dist/types/ui-bridge/index.d.ts +37 -0
- package/package.json +120 -107
- package/LICENSE +0 -8
- package/LICENSE-THIRD-PARTY.txt +0 -30
- package/local-dist-new/IndusForge/examples/research-agent.d.ts +0 -3
- package/local-dist-new/IndusForge/examples/research-agent.d.ts.map +0 -1
- package/local-dist-new/IndusForge/examples/research-agent.js +0 -18
- package/local-dist-new/IndusForge/examples/research-agent.js.map +0 -1
- package/local-dist-new/IndusForge/examples/review-agent.d.ts +0 -3
- package/local-dist-new/IndusForge/examples/review-agent.d.ts.map +0 -1
- package/local-dist-new/IndusForge/examples/review-agent.js +0 -18
- package/local-dist-new/IndusForge/examples/review-agent.js.map +0 -1
- package/local-dist-new/IndusForge/examples/terminal-builder-agent.d.ts +0 -3
- package/local-dist-new/IndusForge/examples/terminal-builder-agent.d.ts.map +0 -1
- package/local-dist-new/IndusForge/examples/terminal-builder-agent.js +0 -18
- package/local-dist-new/IndusForge/examples/terminal-builder-agent.js.map +0 -1
- package/local-dist-new/IndusForge/terminal-chat.d.ts +0 -2
- package/local-dist-new/IndusForge/terminal-chat.d.ts.map +0 -1
- package/local-dist-new/IndusForge/terminal-chat.js +0 -557
- package/local-dist-new/IndusForge/terminal-chat.js.map +0 -1
- package/local-dist-new/agent.d.ts +0 -6
- package/local-dist-new/agent.d.ts.map +0 -1
- package/local-dist-new/agent.js +0 -6
- package/local-dist-new/agent.js.map +0 -1
- package/local-dist-new/ai.d.ts +0 -6
- package/local-dist-new/ai.d.ts.map +0 -1
- package/local-dist-new/ai.js +0 -6
- package/local-dist-new/ai.js.map +0 -1
- package/local-dist-new/bot/actions/bash.d.ts +0 -56
- package/local-dist-new/bot/actions/bash.d.ts.map +0 -1
- package/local-dist-new/bot/actions/bash.js +0 -275
- package/local-dist-new/bot/actions/bash.js.map +0 -1
- package/local-dist-new/bot/actions/composio/accounts.d.ts +0 -23
- package/local-dist-new/bot/actions/composio/accounts.d.ts.map +0 -1
- package/local-dist-new/bot/actions/composio/accounts.js +0 -40
- package/local-dist-new/bot/actions/composio/accounts.js.map +0 -1
- package/local-dist-new/bot/actions/composio/client.d.ts +0 -40
- package/local-dist-new/bot/actions/composio/client.d.ts.map +0 -1
- package/local-dist-new/bot/actions/composio/client.js +0 -361
- package/local-dist-new/bot/actions/composio/client.js.map +0 -1
- package/local-dist-new/bot/actions/composio/connect.d.ts +0 -20
- package/local-dist-new/bot/actions/composio/connect.d.ts.map +0 -1
- package/local-dist-new/bot/actions/composio/connect.js +0 -41
- package/local-dist-new/bot/actions/composio/connect.js.map +0 -1
- package/local-dist-new/bot/actions/composio/enable.d.ts +0 -26
- package/local-dist-new/bot/actions/composio/enable.d.ts.map +0 -1
- package/local-dist-new/bot/actions/composio/enable.js +0 -66
- package/local-dist-new/bot/actions/composio/enable.js.map +0 -1
- package/local-dist-new/bot/actions/composio/execute.d.ts +0 -27
- package/local-dist-new/bot/actions/composio/execute.d.ts.map +0 -1
- package/local-dist-new/bot/actions/composio/execute.js +0 -46
- package/local-dist-new/bot/actions/composio/execute.js.map +0 -1
- package/local-dist-new/bot/actions/composio/helpers.d.ts +0 -17
- package/local-dist-new/bot/actions/composio/helpers.d.ts.map +0 -1
- package/local-dist-new/bot/actions/composio/helpers.js +0 -533
- package/local-dist-new/bot/actions/composio/helpers.js.map +0 -1
- package/local-dist-new/bot/actions/composio/index.d.ts +0 -10
- package/local-dist-new/bot/actions/composio/index.d.ts.map +0 -1
- package/local-dist-new/bot/actions/composio/index.js +0 -9
- package/local-dist-new/bot/actions/composio/index.js.map +0 -1
- package/local-dist-new/bot/actions/composio/provider.d.ts +0 -9
- package/local-dist-new/bot/actions/composio/provider.d.ts.map +0 -1
- package/local-dist-new/bot/actions/composio/provider.js +0 -54
- package/local-dist-new/bot/actions/composio/provider.js.map +0 -1
- package/local-dist-new/bot/actions/composio/toolkits.d.ts +0 -23
- package/local-dist-new/bot/actions/composio/toolkits.d.ts.map +0 -1
- package/local-dist-new/bot/actions/composio/toolkits.js +0 -40
- package/local-dist-new/bot/actions/composio/toolkits.js.map +0 -1
- package/local-dist-new/bot/actions/composio/tools.d.ts +0 -29
- package/local-dist-new/bot/actions/composio/tools.d.ts.map +0 -1
- package/local-dist-new/bot/actions/composio/tools.js +0 -72
- package/local-dist-new/bot/actions/composio/tools.js.map +0 -1
- package/local-dist-new/bot/actions/composio/types.d.ts +0 -138
- package/local-dist-new/bot/actions/composio/types.d.ts.map +0 -1
- package/local-dist-new/bot/actions/composio/types.js +0 -2
- package/local-dist-new/bot/actions/composio/types.js.map +0 -1
- package/local-dist-new/bot/actions/crew/activity-tracker.d.ts +0 -66
- package/local-dist-new/bot/actions/crew/activity-tracker.d.ts.map +0 -1
- package/local-dist-new/bot/actions/crew/activity-tracker.js +0 -480
- package/local-dist-new/bot/actions/crew/activity-tracker.js.map +0 -1
- package/local-dist-new/bot/actions/crew/cleanup.d.ts +0 -51
- package/local-dist-new/bot/actions/crew/cleanup.d.ts.map +0 -1
- package/local-dist-new/bot/actions/crew/cleanup.js +0 -219
- package/local-dist-new/bot/actions/crew/cleanup.js.map +0 -1
- package/local-dist-new/bot/actions/crew/fs-lock.d.ts +0 -12
- package/local-dist-new/bot/actions/crew/fs-lock.d.ts.map +0 -1
- package/local-dist-new/bot/actions/crew/fs-lock.js +0 -74
- package/local-dist-new/bot/actions/crew/fs-lock.js.map +0 -1
- package/local-dist-new/bot/actions/crew/index.d.ts +0 -12
- package/local-dist-new/bot/actions/crew/index.d.ts.map +0 -1
- package/local-dist-new/bot/actions/crew/index.js +0 -12
- package/local-dist-new/bot/actions/crew/index.js.map +0 -1
- package/local-dist-new/bot/actions/crew/mailbox.d.ts +0 -21
- package/local-dist-new/bot/actions/crew/mailbox.d.ts.map +0 -1
- package/local-dist-new/bot/actions/crew/mailbox.js +0 -106
- package/local-dist-new/bot/actions/crew/mailbox.js.map +0 -1
- package/local-dist-new/bot/actions/crew/model-policy.d.ts +0 -23
- package/local-dist-new/bot/actions/crew/model-policy.d.ts.map +0 -1
- package/local-dist-new/bot/actions/crew/model-policy.js +0 -113
- package/local-dist-new/bot/actions/crew/model-policy.js.map +0 -1
- package/local-dist-new/bot/actions/crew/names.d.ts +0 -28
- package/local-dist-new/bot/actions/crew/names.d.ts.map +0 -1
- package/local-dist-new/bot/actions/crew/names.js +0 -109
- package/local-dist-new/bot/actions/crew/names.js.map +0 -1
- package/local-dist-new/bot/actions/crew/protocol.d.ts +0 -75
- package/local-dist-new/bot/actions/crew/protocol.d.ts.map +0 -1
- package/local-dist-new/bot/actions/crew/protocol.js +0 -205
- package/local-dist-new/bot/actions/crew/protocol.js.map +0 -1
- package/local-dist-new/bot/actions/crew/task-store.d.ts +0 -89
- package/local-dist-new/bot/actions/crew/task-store.d.ts.map +0 -1
- package/local-dist-new/bot/actions/crew/task-store.js +0 -445
- package/local-dist-new/bot/actions/crew/task-store.js.map +0 -1
- package/local-dist-new/bot/actions/crew/team-attach-claim.d.ts +0 -36
- package/local-dist-new/bot/actions/crew/team-attach-claim.d.ts.map +0 -1
- package/local-dist-new/bot/actions/crew/team-attach-claim.js +0 -144
- package/local-dist-new/bot/actions/crew/team-attach-claim.js.map +0 -1
- package/local-dist-new/bot/actions/crew/team-config.d.ts +0 -55
- package/local-dist-new/bot/actions/crew/team-config.d.ts.map +0 -1
- package/local-dist-new/bot/actions/crew/team-config.js +0 -252
- package/local-dist-new/bot/actions/crew/team-config.js.map +0 -1
- package/local-dist-new/bot/actions/crew/worktree.d.ts +0 -40
- package/local-dist-new/bot/actions/crew/worktree.d.ts.map +0 -1
- package/local-dist-new/bot/actions/crew/worktree.js +0 -213
- package/local-dist-new/bot/actions/crew/worktree.js.map +0 -1
- package/local-dist-new/bot/actions/edit-diff.d.ts +0 -63
- package/local-dist-new/bot/actions/edit-diff.d.ts.map +0 -1
- package/local-dist-new/bot/actions/edit-diff.js +0 -255
- package/local-dist-new/bot/actions/edit-diff.js.map +0 -1
- package/local-dist-new/bot/actions/edit.d.ts +0 -42
- package/local-dist-new/bot/actions/edit.d.ts.map +0 -1
- package/local-dist-new/bot/actions/edit.js +0 -176
- package/local-dist-new/bot/actions/edit.js.map +0 -1
- package/local-dist-new/bot/actions/find.d.ts +0 -26
- package/local-dist-new/bot/actions/find.d.ts.map +0 -1
- package/local-dist-new/bot/actions/find.js +0 -170
- package/local-dist-new/bot/actions/find.js.map +0 -1
- package/local-dist-new/bot/actions/grep.d.ts +0 -43
- package/local-dist-new/bot/actions/grep.d.ts.map +0 -1
- package/local-dist-new/bot/actions/grep.js +0 -218
- package/local-dist-new/bot/actions/grep.js.map +0 -1
- package/local-dist-new/bot/actions/index.d.ts +0 -301
- package/local-dist-new/bot/actions/index.d.ts.map +0 -1
- package/local-dist-new/bot/actions/index.js +0 -255
- package/local-dist-new/bot/actions/index.js.map +0 -1
- package/local-dist-new/bot/actions/kit/hook-runner.d.ts +0 -13
- package/local-dist-new/bot/actions/kit/hook-runner.d.ts.map +0 -1
- package/local-dist-new/bot/actions/kit/hook-runner.js +0 -33
- package/local-dist-new/bot/actions/kit/hook-runner.js.map +0 -1
- package/local-dist-new/bot/actions/kit/image-resize.d.ts +0 -20
- package/local-dist-new/bot/actions/kit/image-resize.d.ts.map +0 -1
- package/local-dist-new/bot/actions/kit/image-resize.js +0 -93
- package/local-dist-new/bot/actions/kit/image-resize.js.map +0 -1
- package/local-dist-new/bot/actions/kit/mime.d.ts +0 -2
- package/local-dist-new/bot/actions/kit/mime.d.ts.map +0 -1
- package/local-dist-new/bot/actions/kit/mime.js +0 -65
- package/local-dist-new/bot/actions/kit/mime.js.map +0 -1
- package/local-dist-new/bot/actions/kit/shell.d.ts +0 -13
- package/local-dist-new/bot/actions/kit/shell.d.ts.map +0 -1
- package/local-dist-new/bot/actions/kit/shell.js +0 -103
- package/local-dist-new/bot/actions/kit/shell.js.map +0 -1
- package/local-dist-new/bot/actions/ls.d.ts +0 -41
- package/local-dist-new/bot/actions/ls.d.ts.map +0 -1
- package/local-dist-new/bot/actions/ls.js +0 -174
- package/local-dist-new/bot/actions/ls.js.map +0 -1
- package/local-dist-new/bot/actions/path-utils.d.ts +0 -8
- package/local-dist-new/bot/actions/path-utils.d.ts.map +0 -1
- package/local-dist-new/bot/actions/path-utils.js +0 -75
- package/local-dist-new/bot/actions/path-utils.js.map +0 -1
- package/local-dist-new/bot/actions/process-controller.d.ts +0 -15
- package/local-dist-new/bot/actions/process-controller.d.ts.map +0 -1
- package/local-dist-new/bot/actions/process-controller.js +0 -39
- package/local-dist-new/bot/actions/process-controller.js.map +0 -1
- package/local-dist-new/bot/actions/process-manager.d.ts +0 -60
- package/local-dist-new/bot/actions/process-manager.d.ts.map +0 -1
- package/local-dist-new/bot/actions/process-manager.js +0 -485
- package/local-dist-new/bot/actions/process-manager.js.map +0 -1
- package/local-dist-new/bot/actions/process-types.d.ts +0 -74
- package/local-dist-new/bot/actions/process-types.d.ts.map +0 -1
- package/local-dist-new/bot/actions/process-types.js +0 -7
- package/local-dist-new/bot/actions/process-types.js.map +0 -1
- package/local-dist-new/bot/actions/process.d.ts +0 -38
- package/local-dist-new/bot/actions/process.d.ts.map +0 -1
- package/local-dist-new/bot/actions/process.js +0 -360
- package/local-dist-new/bot/actions/process.js.map +0 -1
- package/local-dist-new/bot/actions/read.d.ts +0 -37
- package/local-dist-new/bot/actions/read.d.ts.map +0 -1
- package/local-dist-new/bot/actions/read.js +0 -190
- package/local-dist-new/bot/actions/read.js.map +0 -1
- package/local-dist-new/bot/actions/registry.d.ts +0 -21
- package/local-dist-new/bot/actions/registry.d.ts.map +0 -1
- package/local-dist-new/bot/actions/registry.js +0 -23
- package/local-dist-new/bot/actions/registry.js.map +0 -1
- package/local-dist-new/bot/actions/todo-store.d.ts +0 -77
- package/local-dist-new/bot/actions/todo-store.d.ts.map +0 -1
- package/local-dist-new/bot/actions/todo-store.js +0 -137
- package/local-dist-new/bot/actions/todo-store.js.map +0 -1
- package/local-dist-new/bot/actions/todo-types.d.ts +0 -73
- package/local-dist-new/bot/actions/todo-types.d.ts.map +0 -1
- package/local-dist-new/bot/actions/todo-types.js +0 -8
- package/local-dist-new/bot/actions/todo-types.js.map +0 -1
- package/local-dist-new/bot/actions/todo.d.ts +0 -77
- package/local-dist-new/bot/actions/todo.d.ts.map +0 -1
- package/local-dist-new/bot/actions/todo.js +0 -122
- package/local-dist-new/bot/actions/todo.js.map +0 -1
- package/local-dist-new/bot/actions/truncate.d.ts +0 -73
- package/local-dist-new/bot/actions/truncate.d.ts.map +0 -1
- package/local-dist-new/bot/actions/truncate.js +0 -221
- package/local-dist-new/bot/actions/truncate.js.map +0 -1
- package/local-dist-new/bot/actions/webfetch.d.ts +0 -36
- package/local-dist-new/bot/actions/webfetch.d.ts.map +0 -1
- package/local-dist-new/bot/actions/webfetch.js +0 -247
- package/local-dist-new/bot/actions/webfetch.js.map +0 -1
- package/local-dist-new/bot/actions/websearch.d.ts +0 -35
- package/local-dist-new/bot/actions/websearch.d.ts.map +0 -1
- package/local-dist-new/bot/actions/websearch.js +0 -132
- package/local-dist-new/bot/actions/websearch.js.map +0 -1
- package/local-dist-new/bot/actions/write.d.ts +0 -31
- package/local-dist-new/bot/actions/write.d.ts.map +0 -1
- package/local-dist-new/bot/actions/write.js +0 -139
- package/local-dist-new/bot/actions/write.js.map +0 -1
- package/local-dist-new/bot/agent-loop.d.ts +0 -15
- package/local-dist-new/bot/agent-loop.d.ts.map +0 -1
- package/local-dist-new/bot/agent-loop.js +0 -293
- package/local-dist-new/bot/agent-loop.js.map +0 -1
- package/local-dist-new/bot/agent.d.ts +0 -122
- package/local-dist-new/bot/agent.d.ts.map +0 -1
- package/local-dist-new/bot/agent.js +0 -393
- package/local-dist-new/bot/agent.js.map +0 -1
- package/local-dist-new/bot/error-handler.d.ts +0 -8
- package/local-dist-new/bot/error-handler.d.ts.map +0 -1
- package/local-dist-new/bot/error-handler.js +0 -8
- package/local-dist-new/bot/error-handler.js.map +0 -1
- package/local-dist-new/bot/event-bus.d.ts +0 -9
- package/local-dist-new/bot/event-bus.d.ts.map +0 -1
- package/local-dist-new/bot/event-bus.js +0 -15
- package/local-dist-new/bot/event-bus.js.map +0 -1
- package/local-dist-new/bot/index.d.ts +0 -8
- package/local-dist-new/bot/index.d.ts.map +0 -1
- package/local-dist-new/bot/index.js +0 -8
- package/local-dist-new/bot/index.js.map +0 -1
- package/local-dist-new/bot/messages.d.ts +0 -77
- package/local-dist-new/bot/messages.d.ts.map +0 -1
- package/local-dist-new/bot/messages.js +0 -116
- package/local-dist-new/bot/messages.js.map +0 -1
- package/local-dist-new/bot/proxy.d.ts +0 -66
- package/local-dist-new/bot/proxy.d.ts.map +0 -1
- package/local-dist-new/bot/proxy.js +0 -228
- package/local-dist-new/bot/proxy.js.map +0 -1
- package/local-dist-new/bot/session-manager.d.ts +0 -448
- package/local-dist-new/bot/session-manager.d.ts.map +0 -1
- package/local-dist-new/bot/session-manager.js +0 -1232
- package/local-dist-new/bot/session-manager.js.map +0 -1
- package/local-dist-new/bot/state-manager.d.ts +0 -22
- package/local-dist-new/bot/state-manager.d.ts.map +0 -1
- package/local-dist-new/bot/state-manager.js +0 -60
- package/local-dist-new/bot/state-manager.js.map +0 -1
- package/local-dist-new/bot/telemetry.d.ts +0 -7
- package/local-dist-new/bot/telemetry.d.ts.map +0 -1
- package/local-dist-new/bot/telemetry.js +0 -18
- package/local-dist-new/bot/telemetry.js.map +0 -1
- package/local-dist-new/bot/types.d.ts +0 -205
- package/local-dist-new/bot/types.d.ts.map +0 -1
- package/local-dist-new/bot/types.js +0 -60
- package/local-dist-new/bot/types.js.map +0 -1
- package/local-dist-new/cli.d.ts +0 -3
- package/local-dist-new/cli.d.ts.map +0 -1
- package/local-dist-new/cli.js +0 -3
- package/local-dist-new/cli.js.map +0 -1
- package/local-dist-new/index.d.ts +0 -7
- package/local-dist-new/index.d.ts.map +0 -1
- package/local-dist-new/index.js +0 -7
- package/local-dist-new/index.js.map +0 -1
- package/local-dist-new/mcp/client-pool.d.ts +0 -106
- package/local-dist-new/mcp/client-pool.d.ts.map +0 -1
- package/local-dist-new/mcp/client-pool.js +0 -234
- package/local-dist-new/mcp/client-pool.js.map +0 -1
- package/local-dist-new/mcp/client.d.ts +0 -158
- package/local-dist-new/mcp/client.d.ts.map +0 -1
- package/local-dist-new/mcp/client.js +0 -611
- package/local-dist-new/mcp/client.js.map +0 -1
- package/local-dist-new/mcp/config.d.ts +0 -61
- package/local-dist-new/mcp/config.d.ts.map +0 -1
- package/local-dist-new/mcp/config.js +0 -250
- package/local-dist-new/mcp/config.js.map +0 -1
- package/local-dist-new/mcp/errors.d.ts +0 -104
- package/local-dist-new/mcp/errors.d.ts.map +0 -1
- package/local-dist-new/mcp/errors.js +0 -146
- package/local-dist-new/mcp/errors.js.map +0 -1
- package/local-dist-new/mcp/index.d.ts +0 -56
- package/local-dist-new/mcp/index.d.ts.map +0 -1
- package/local-dist-new/mcp/index.js +0 -83
- package/local-dist-new/mcp/index.js.map +0 -1
- package/local-dist-new/mcp/schema-converter.d.ts +0 -68
- package/local-dist-new/mcp/schema-converter.d.ts.map +0 -1
- package/local-dist-new/mcp/schema-converter.js +0 -230
- package/local-dist-new/mcp/schema-converter.js.map +0 -1
- package/local-dist-new/mcp/server.d.ts +0 -111
- package/local-dist-new/mcp/server.d.ts.map +0 -1
- package/local-dist-new/mcp/server.js +0 -305
- package/local-dist-new/mcp/server.js.map +0 -1
- package/local-dist-new/mcp/tool-factory.d.ts +0 -63
- package/local-dist-new/mcp/tool-factory.d.ts.map +0 -1
- package/local-dist-new/mcp/tool-factory.js +0 -228
- package/local-dist-new/mcp/tool-factory.js.map +0 -1
- package/local-dist-new/mcp/types.d.ts +0 -289
- package/local-dist-new/mcp/types.d.ts.map +0 -1
- package/local-dist-new/mcp/types.js +0 -8
- package/local-dist-new/mcp/types.js.map +0 -1
- package/local-dist-new/mcp.d.ts +0 -2
- package/local-dist-new/mcp.d.ts.map +0 -1
- package/local-dist-new/mcp.js +0 -2
- package/local-dist-new/mcp.js.map +0 -1
- package/local-dist-new/ml/adapters/amazon-bedrock.d.ts +0 -33
- package/local-dist-new/ml/adapters/amazon-bedrock.d.ts.map +0 -1
- package/local-dist-new/ml/adapters/amazon-bedrock.js +0 -610
- package/local-dist-new/ml/adapters/amazon-bedrock.js.map +0 -1
- package/local-dist-new/ml/adapters/anthropic.d.ts +0 -62
- package/local-dist-new/ml/adapters/anthropic.d.ts.map +0 -1
- package/local-dist-new/ml/adapters/anthropic.js +0 -682
- package/local-dist-new/ml/adapters/anthropic.js.map +0 -1
- package/local-dist-new/ml/adapters/azure-openai-responses.d.ts +0 -15
- package/local-dist-new/ml/adapters/azure-openai-responses.d.ts.map +0 -1
- package/local-dist-new/ml/adapters/azure-openai-responses.js +0 -233
- package/local-dist-new/ml/adapters/azure-openai-responses.js.map +0 -1
- package/local-dist-new/ml/adapters/google-shared.d.ts +0 -60
- package/local-dist-new/ml/adapters/google-shared.d.ts.map +0 -1
- package/local-dist-new/ml/adapters/google-shared.js +0 -316
- package/local-dist-new/ml/adapters/google-shared.js.map +0 -1
- package/local-dist-new/ml/adapters/google-vertex.d.ts +0 -15
- package/local-dist-new/ml/adapters/google-vertex.d.ts.map +0 -1
- package/local-dist-new/ml/adapters/google-vertex.js +0 -396
- package/local-dist-new/ml/adapters/google-vertex.js.map +0 -1
- package/local-dist-new/ml/adapters/google.d.ts +0 -16
- package/local-dist-new/ml/adapters/google.d.ts.map +0 -1
- package/local-dist-new/ml/adapters/google.js +0 -381
- package/local-dist-new/ml/adapters/google.js.map +0 -1
- package/local-dist-new/ml/adapters/kimi.d.ts +0 -22
- package/local-dist-new/ml/adapters/kimi.d.ts.map +0 -1
- package/local-dist-new/ml/adapters/kimi.js +0 -249
- package/local-dist-new/ml/adapters/kimi.js.map +0 -1
- package/local-dist-new/ml/adapters/mock.d.ts +0 -10
- package/local-dist-new/ml/adapters/mock.d.ts.map +0 -1
- package/local-dist-new/ml/adapters/mock.js +0 -64
- package/local-dist-new/ml/adapters/mock.js.map +0 -1
- package/local-dist-new/ml/adapters/nvidia.d.ts +0 -14
- package/local-dist-new/ml/adapters/nvidia.d.ts.map +0 -1
- package/local-dist-new/ml/adapters/nvidia.js +0 -377
- package/local-dist-new/ml/adapters/nvidia.js.map +0 -1
- package/local-dist-new/ml/adapters/openai-codex-responses.d.ts +0 -9
- package/local-dist-new/ml/adapters/openai-codex-responses.d.ts.map +0 -1
- package/local-dist-new/ml/adapters/openai-codex-responses.js +0 -397
- package/local-dist-new/ml/adapters/openai-codex-responses.js.map +0 -1
- package/local-dist-new/ml/adapters/openai-completions.d.ts +0 -25
- package/local-dist-new/ml/adapters/openai-completions.d.ts.map +0 -1
- package/local-dist-new/ml/adapters/openai-completions.js +0 -831
- package/local-dist-new/ml/adapters/openai-completions.js.map +0 -1
- package/local-dist-new/ml/adapters/openai-responses-shared.d.ts +0 -26
- package/local-dist-new/ml/adapters/openai-responses-shared.d.ts.map +0 -1
- package/local-dist-new/ml/adapters/openai-responses-shared.js +0 -461
- package/local-dist-new/ml/adapters/openai-responses-shared.js.map +0 -1
- package/local-dist-new/ml/adapters/openai-responses.d.ts +0 -13
- package/local-dist-new/ml/adapters/openai-responses.d.ts.map +0 -1
- package/local-dist-new/ml/adapters/openai-responses.js +0 -209
- package/local-dist-new/ml/adapters/openai-responses.js.map +0 -1
- package/local-dist-new/ml/adapters/openai-scaffold.d.ts +0 -4
- package/local-dist-new/ml/adapters/openai-scaffold.d.ts.map +0 -1
- package/local-dist-new/ml/adapters/openai-scaffold.js +0 -33
- package/local-dist-new/ml/adapters/openai-scaffold.js.map +0 -1
- package/local-dist-new/ml/adapters/register-builtins.d.ts +0 -3
- package/local-dist-new/ml/adapters/register-builtins.d.ts.map +0 -1
- package/local-dist-new/ml/adapters/register-builtins.js +0 -143
- package/local-dist-new/ml/adapters/register-builtins.js.map +0 -1
- package/local-dist-new/ml/adapters/simple-options.d.ts +0 -27
- package/local-dist-new/ml/adapters/simple-options.d.ts.map +0 -1
- package/local-dist-new/ml/adapters/simple-options.js +0 -96
- package/local-dist-new/ml/adapters/simple-options.js.map +0 -1
- package/local-dist-new/ml/adapters/transform-messages.d.ts +0 -22
- package/local-dist-new/ml/adapters/transform-messages.d.ts.map +0 -1
- package/local-dist-new/ml/adapters/transform-messages.js +0 -147
- package/local-dist-new/ml/adapters/transform-messages.js.map +0 -1
- package/local-dist-new/ml/api-registry.d.ts +0 -50
- package/local-dist-new/ml/api-registry.d.ts.map +0 -1
- package/local-dist-new/ml/api-registry.js +0 -121
- package/local-dist-new/ml/api-registry.js.map +0 -1
- package/local-dist-new/ml/cli.d.ts +0 -3
- package/local-dist-new/ml/cli.d.ts.map +0 -1
- package/local-dist-new/ml/cli.js +0 -117
- package/local-dist-new/ml/cli.js.map +0 -1
- package/local-dist-new/ml/env-api-keys.d.ts +0 -18
- package/local-dist-new/ml/env-api-keys.d.ts.map +0 -1
- package/local-dist-new/ml/env-api-keys.js +0 -122
- package/local-dist-new/ml/env-api-keys.js.map +0 -1
- package/local-dist-new/ml/index.d.ts +0 -28
- package/local-dist-new/ml/index.d.ts.map +0 -1
- package/local-dist-new/ml/index.js +0 -28
- package/local-dist-new/ml/index.js.map +0 -1
- package/local-dist-new/ml/kit/auth/anthropic.d.ts +0 -18
- package/local-dist-new/ml/kit/auth/anthropic.d.ts.map +0 -1
- package/local-dist-new/ml/kit/auth/anthropic.js +0 -152
- package/local-dist-new/ml/kit/auth/anthropic.js.map +0 -1
- package/local-dist-new/ml/kit/auth/github-copilot.d.ts +0 -23
- package/local-dist-new/ml/kit/auth/github-copilot.d.ts.map +0 -1
- package/local-dist-new/ml/kit/auth/github-copilot.js +0 -275
- package/local-dist-new/ml/kit/auth/github-copilot.js.map +0 -1
- package/local-dist-new/ml/kit/auth/index.d.ts +0 -50
- package/local-dist-new/ml/kit/auth/index.d.ts.map +0 -1
- package/local-dist-new/ml/kit/auth/index.js +0 -112
- package/local-dist-new/ml/kit/auth/index.js.map +0 -1
- package/local-dist-new/ml/kit/auth/kimi.d.ts +0 -24
- package/local-dist-new/ml/kit/auth/kimi.d.ts.map +0 -1
- package/local-dist-new/ml/kit/auth/kimi.js +0 -30
- package/local-dist-new/ml/kit/auth/kimi.js.map +0 -1
- package/local-dist-new/ml/kit/auth/oauth-page.d.ts +0 -3
- package/local-dist-new/ml/kit/auth/oauth-page.d.ts.map +0 -1
- package/local-dist-new/ml/kit/auth/oauth-page.js +0 -105
- package/local-dist-new/ml/kit/auth/oauth-page.js.map +0 -1
- package/local-dist-new/ml/kit/auth/openai-codex.d.ts +0 -34
- package/local-dist-new/ml/kit/auth/openai-codex.d.ts.map +0 -1
- package/local-dist-new/ml/kit/auth/openai-codex.js +0 -373
- package/local-dist-new/ml/kit/auth/openai-codex.js.map +0 -1
- package/local-dist-new/ml/kit/auth/pkce.d.ts +0 -13
- package/local-dist-new/ml/kit/auth/pkce.d.ts.map +0 -1
- package/local-dist-new/ml/kit/auth/pkce.js +0 -31
- package/local-dist-new/ml/kit/auth/pkce.js.map +0 -1
- package/local-dist-new/ml/kit/auth/types.d.ts +0 -72
- package/local-dist-new/ml/kit/auth/types.d.ts.map +0 -1
- package/local-dist-new/ml/kit/auth/types.js +0 -11
- package/local-dist-new/ml/kit/auth/types.js.map +0 -1
- package/local-dist-new/ml/kit/base-stream-handler.d.ts +0 -16
- package/local-dist-new/ml/kit/base-stream-handler.d.ts.map +0 -1
- package/local-dist-new/ml/kit/base-stream-handler.js +0 -25
- package/local-dist-new/ml/kit/base-stream-handler.js.map +0 -1
- package/local-dist-new/ml/kit/event-stream.d.ts +0 -45
- package/local-dist-new/ml/kit/event-stream.d.ts.map +0 -1
- package/local-dist-new/ml/kit/event-stream.js +0 -178
- package/local-dist-new/ml/kit/event-stream.js.map +0 -1
- package/local-dist-new/ml/kit/index.d.ts +0 -15
- package/local-dist-new/ml/kit/index.d.ts.map +0 -1
- package/local-dist-new/ml/kit/index.js +0 -15
- package/local-dist-new/ml/kit/index.js.map +0 -1
- package/local-dist-new/ml/kit/json-parse.d.ts +0 -21
- package/local-dist-new/ml/kit/json-parse.d.ts.map +0 -1
- package/local-dist-new/ml/kit/json-parse.js +0 -44
- package/local-dist-new/ml/kit/json-parse.js.map +0 -1
- package/local-dist-new/ml/kit/message-transform.d.ts +0 -29
- package/local-dist-new/ml/kit/message-transform.d.ts.map +0 -1
- package/local-dist-new/ml/kit/message-transform.js +0 -55
- package/local-dist-new/ml/kit/message-transform.js.map +0 -1
- package/local-dist-new/ml/kit/output-factory.d.ts +0 -3
- package/local-dist-new/ml/kit/output-factory.d.ts.map +0 -1
- package/local-dist-new/ml/kit/output-factory.js +0 -23
- package/local-dist-new/ml/kit/output-factory.js.map +0 -1
- package/local-dist-new/ml/kit/overflow.d.ts +0 -10
- package/local-dist-new/ml/kit/overflow.d.ts.map +0 -1
- package/local-dist-new/ml/kit/overflow.js +0 -76
- package/local-dist-new/ml/kit/overflow.js.map +0 -1
- package/local-dist-new/ml/kit/provider-adapter.d.ts +0 -57
- package/local-dist-new/ml/kit/provider-adapter.d.ts.map +0 -1
- package/local-dist-new/ml/kit/provider-adapter.js +0 -37
- package/local-dist-new/ml/kit/provider-adapter.js.map +0 -1
- package/local-dist-new/ml/kit/provider-client-builder.d.ts +0 -37
- package/local-dist-new/ml/kit/provider-client-builder.d.ts.map +0 -1
- package/local-dist-new/ml/kit/provider-client-builder.js +0 -50
- package/local-dist-new/ml/kit/provider-client-builder.js.map +0 -1
- package/local-dist-new/ml/kit/provider-consolidation.d.ts +0 -4
- package/local-dist-new/ml/kit/provider-consolidation.d.ts.map +0 -1
- package/local-dist-new/ml/kit/provider-consolidation.js +0 -33
- package/local-dist-new/ml/kit/provider-consolidation.js.map +0 -1
- package/local-dist-new/ml/kit/provider-constants.d.ts +0 -35
- package/local-dist-new/ml/kit/provider-constants.d.ts.map +0 -1
- package/local-dist-new/ml/kit/provider-constants.js +0 -35
- package/local-dist-new/ml/kit/provider-constants.js.map +0 -1
- package/local-dist-new/ml/kit/provider-errors.d.ts +0 -46
- package/local-dist-new/ml/kit/provider-errors.d.ts.map +0 -1
- package/local-dist-new/ml/kit/provider-errors.js +0 -103
- package/local-dist-new/ml/kit/provider-errors.js.map +0 -1
- package/local-dist-new/ml/kit/sanitize-unicode.d.ts +0 -3
- package/local-dist-new/ml/kit/sanitize-unicode.d.ts.map +0 -1
- package/local-dist-new/ml/kit/sanitize-unicode.js +0 -60
- package/local-dist-new/ml/kit/sanitize-unicode.js.map +0 -1
- package/local-dist-new/ml/kit/stream-event-helper.d.ts +0 -28
- package/local-dist-new/ml/kit/stream-event-helper.d.ts.map +0 -1
- package/local-dist-new/ml/kit/stream-event-helper.js +0 -52
- package/local-dist-new/ml/kit/stream-event-helper.js.map +0 -1
- package/local-dist-new/ml/kit/stream-handler-types.d.ts +0 -43
- package/local-dist-new/ml/kit/stream-handler-types.d.ts.map +0 -1
- package/local-dist-new/ml/kit/stream-handler-types.js +0 -23
- package/local-dist-new/ml/kit/stream-handler-types.js.map +0 -1
- package/local-dist-new/ml/kit/streaming-state-manager.d.ts +0 -50
- package/local-dist-new/ml/kit/streaming-state-manager.d.ts.map +0 -1
- package/local-dist-new/ml/kit/streaming-state-manager.js +0 -67
- package/local-dist-new/ml/kit/streaming-state-manager.js.map +0 -1
- package/local-dist-new/ml/kit/tool-converter.d.ts +0 -50
- package/local-dist-new/ml/kit/tool-converter.d.ts.map +0 -1
- package/local-dist-new/ml/kit/tool-converter.js +0 -54
- package/local-dist-new/ml/kit/tool-converter.js.map +0 -1
- package/local-dist-new/ml/kit/typebox-helpers.d.ts +0 -24
- package/local-dist-new/ml/kit/typebox-helpers.d.ts.map +0 -1
- package/local-dist-new/ml/kit/typebox-helpers.js +0 -46
- package/local-dist-new/ml/kit/typebox-helpers.js.map +0 -1
- package/local-dist-new/ml/kit/validation.d.ts +0 -24
- package/local-dist-new/ml/kit/validation.d.ts.map +0 -1
- package/local-dist-new/ml/kit/validation.js +0 -119
- package/local-dist-new/ml/kit/validation.js.map +0 -1
- package/local-dist-new/ml/models.d.ts +0 -41
- package/local-dist-new/ml/models.d.ts.map +0 -1
- package/local-dist-new/ml/models.generated.d.ts +0 -12245
- package/local-dist-new/ml/models.generated.d.ts.map +0 -1
- package/local-dist-new/ml/models.generated.js +0 -12080
- package/local-dist-new/ml/models.generated.js.map +0 -1
- package/local-dist-new/ml/models.js +0 -126
- package/local-dist-new/ml/models.js.map +0 -1
- package/local-dist-new/ml/stream.d.ts +0 -12
- package/local-dist-new/ml/stream.d.ts.map +0 -1
- package/local-dist-new/ml/stream.js +0 -54
- package/local-dist-new/ml/stream.js.map +0 -1
- package/local-dist-new/ml/types.d.ts +0 -270
- package/local-dist-new/ml/types.d.ts.map +0 -1
- package/local-dist-new/ml/types.js +0 -169
- package/local-dist-new/ml/types.js.map +0 -1
- package/local-dist-new/observability.d.ts +0 -2
- package/local-dist-new/observability.d.ts.map +0 -1
- package/local-dist-new/observability.js +0 -2
- package/local-dist-new/observability.js.map +0 -1
- package/local-dist-new/react-host/index.d.ts +0 -10
- package/local-dist-new/react-host/index.d.ts.map +0 -1
- package/local-dist-new/react-host/index.js +0 -9
- package/local-dist-new/react-host/index.js.map +0 -1
- package/local-dist-new/react-host/ink.d.ts +0 -6
- package/local-dist-new/react-host/ink.d.ts.map +0 -1
- package/local-dist-new/react-host/ink.js +0 -7
- package/local-dist-new/react-host/ink.js.map +0 -1
- package/local-dist-new/react-host/jsx-runtime.d.ts +0 -5
- package/local-dist-new/react-host/jsx-runtime.d.ts.map +0 -1
- package/local-dist-new/react-host/jsx-runtime.js +0 -6
- package/local-dist-new/react-host/jsx-runtime.js.map +0 -1
- package/local-dist-new/react-host/loader.d.ts +0 -4
- package/local-dist-new/react-host/loader.d.ts.map +0 -1
- package/local-dist-new/react-host/loader.js +0 -108
- package/local-dist-new/react-host/loader.js.map +0 -1
- package/local-dist-new/react-ink/components/ChangelogBlock.d.ts +0 -9
- package/local-dist-new/react-ink/components/ChangelogBlock.d.ts.map +0 -1
- package/local-dist-new/react-ink/components/ChangelogBlock.js +0 -58
- package/local-dist-new/react-ink/components/ChangelogBlock.js.map +0 -1
- package/local-dist-new/react-ink/components/DisplayBlockView.d.ts +0 -9
- package/local-dist-new/react-ink/components/DisplayBlockView.d.ts.map +0 -1
- package/local-dist-new/react-ink/components/DisplayBlockView.js +0 -11
- package/local-dist-new/react-ink/components/DisplayBlockView.js.map +0 -1
- package/local-dist-new/react-ink/components/Footer.d.ts +0 -12
- package/local-dist-new/react-ink/components/Footer.d.ts.map +0 -1
- package/local-dist-new/react-ink/components/Footer.js +0 -113
- package/local-dist-new/react-ink/components/Footer.js.map +0 -1
- package/local-dist-new/react-ink/components/MessageList.d.ts +0 -15
- package/local-dist-new/react-ink/components/MessageList.d.ts.map +0 -1
- package/local-dist-new/react-ink/components/MessageList.js +0 -43
- package/local-dist-new/react-ink/components/MessageList.js.map +0 -1
- package/local-dist-new/react-ink/components/MessageRow.d.ts +0 -14
- package/local-dist-new/react-ink/components/MessageRow.d.ts.map +0 -1
- package/local-dist-new/react-ink/components/MessageRow.js +0 -35
- package/local-dist-new/react-ink/components/MessageRow.js.map +0 -1
- package/local-dist-new/react-ink/components/StatusLine.d.ts +0 -10
- package/local-dist-new/react-ink/components/StatusLine.d.ts.map +0 -1
- package/local-dist-new/react-ink/components/StatusLine.js +0 -39
- package/local-dist-new/react-ink/components/StatusLine.js.map +0 -1
- package/local-dist-new/react-ink/components/TaskPanel.d.ts +0 -12
- package/local-dist-new/react-ink/components/TaskPanel.d.ts.map +0 -1
- package/local-dist-new/react-ink/components/TaskPanel.js +0 -23
- package/local-dist-new/react-ink/components/TaskPanel.js.map +0 -1
- package/local-dist-new/react-ink/components/ToolEventBlock.d.ts +0 -18
- package/local-dist-new/react-ink/components/ToolEventBlock.d.ts.map +0 -1
- package/local-dist-new/react-ink/components/ToolEventBlock.js +0 -61
- package/local-dist-new/react-ink/components/ToolEventBlock.js.map +0 -1
- package/local-dist-new/react-ink/components/dialogs/DialogFrame.d.ts +0 -9
- package/local-dist-new/react-ink/components/dialogs/DialogFrame.d.ts.map +0 -1
- package/local-dist-new/react-ink/components/dialogs/DialogFrame.js +0 -6
- package/local-dist-new/react-ink/components/dialogs/DialogFrame.js.map +0 -1
- package/local-dist-new/react-ink/components/dialogs/LoginDialog.d.ts +0 -15
- package/local-dist-new/react-ink/components/dialogs/LoginDialog.d.ts.map +0 -1
- package/local-dist-new/react-ink/components/dialogs/LoginDialog.js +0 -10
- package/local-dist-new/react-ink/components/dialogs/LoginDialog.js.map +0 -1
- package/local-dist-new/react-ink/components/dialogs/ModelDialog.d.ts +0 -10
- package/local-dist-new/react-ink/components/dialogs/ModelDialog.d.ts.map +0 -1
- package/local-dist-new/react-ink/components/dialogs/ModelDialog.js +0 -64
- package/local-dist-new/react-ink/components/dialogs/ModelDialog.js.map +0 -1
- package/local-dist-new/react-ink/components/dialogs/OAuthDialog.d.ts +0 -10
- package/local-dist-new/react-ink/components/dialogs/OAuthDialog.d.ts.map +0 -1
- package/local-dist-new/react-ink/components/dialogs/OAuthDialog.js +0 -24
- package/local-dist-new/react-ink/components/dialogs/OAuthDialog.js.map +0 -1
- package/local-dist-new/react-ink/components/dialogs/ScopedModelsDialog.d.ts +0 -10
- package/local-dist-new/react-ink/components/dialogs/ScopedModelsDialog.d.ts.map +0 -1
- package/local-dist-new/react-ink/components/dialogs/ScopedModelsDialog.js +0 -95
- package/local-dist-new/react-ink/components/dialogs/ScopedModelsDialog.js.map +0 -1
- package/local-dist-new/react-ink/components/dialogs/SelectableDialog.d.ts +0 -17
- package/local-dist-new/react-ink/components/dialogs/SelectableDialog.d.ts.map +0 -1
- package/local-dist-new/react-ink/components/dialogs/SelectableDialog.js +0 -66
- package/local-dist-new/react-ink/components/dialogs/SelectableDialog.js.map +0 -1
- package/local-dist-new/react-ink/components/dialogs/SessionDialog.d.ts +0 -14
- package/local-dist-new/react-ink/components/dialogs/SessionDialog.d.ts.map +0 -1
- package/local-dist-new/react-ink/components/dialogs/SessionDialog.js +0 -201
- package/local-dist-new/react-ink/components/dialogs/SessionDialog.js.map +0 -1
- package/local-dist-new/react-ink/components/dialogs/SettingsDialog.d.ts +0 -15
- package/local-dist-new/react-ink/components/dialogs/SettingsDialog.d.ts.map +0 -1
- package/local-dist-new/react-ink/components/dialogs/SettingsDialog.js +0 -79
- package/local-dist-new/react-ink/components/dialogs/SettingsDialog.js.map +0 -1
- package/local-dist-new/react-ink/components/dialogs/StartupSessionPicker.d.ts +0 -10
- package/local-dist-new/react-ink/components/dialogs/StartupSessionPicker.d.ts.map +0 -1
- package/local-dist-new/react-ink/components/dialogs/StartupSessionPicker.js +0 -100
- package/local-dist-new/react-ink/components/dialogs/StartupSessionPicker.js.map +0 -1
- package/local-dist-new/react-ink/components/dialogs/ThemeDialog.d.ts +0 -8
- package/local-dist-new/react-ink/components/dialogs/ThemeDialog.d.ts.map +0 -1
- package/local-dist-new/react-ink/components/dialogs/ThemeDialog.js +0 -7
- package/local-dist-new/react-ink/components/dialogs/ThemeDialog.js.map +0 -1
- package/local-dist-new/react-ink/components/dialogs/TreeDialog.d.ts +0 -9
- package/local-dist-new/react-ink/components/dialogs/TreeDialog.d.ts.map +0 -1
- package/local-dist-new/react-ink/components/dialogs/TreeDialog.js +0 -7
- package/local-dist-new/react-ink/components/dialogs/TreeDialog.js.map +0 -1
- package/local-dist-new/react-ink/components/dialogs/UserMessageDialog.d.ts +0 -9
- package/local-dist-new/react-ink/components/dialogs/UserMessageDialog.d.ts.map +0 -1
- package/local-dist-new/react-ink/components/dialogs/UserMessageDialog.js +0 -7
- package/local-dist-new/react-ink/components/dialogs/UserMessageDialog.js.map +0 -1
- package/local-dist-new/react-ink/components/messages/AssistantMessage.d.ts +0 -13
- package/local-dist-new/react-ink/components/messages/AssistantMessage.d.ts.map +0 -1
- package/local-dist-new/react-ink/components/messages/AssistantMessage.js +0 -20
- package/local-dist-new/react-ink/components/messages/AssistantMessage.js.map +0 -1
- package/local-dist-new/react-ink/components/messages/BashMessage.d.ts +0 -9
- package/local-dist-new/react-ink/components/messages/BashMessage.d.ts.map +0 -1
- package/local-dist-new/react-ink/components/messages/BashMessage.js +0 -11
- package/local-dist-new/react-ink/components/messages/BashMessage.js.map +0 -1
- package/local-dist-new/react-ink/components/messages/BranchSummaryMessage.d.ts +0 -9
- package/local-dist-new/react-ink/components/messages/BranchSummaryMessage.d.ts.map +0 -1
- package/local-dist-new/react-ink/components/messages/BranchSummaryMessage.js +0 -6
- package/local-dist-new/react-ink/components/messages/BranchSummaryMessage.js.map +0 -1
- package/local-dist-new/react-ink/components/messages/CompactionMessage.d.ts +0 -9
- package/local-dist-new/react-ink/components/messages/CompactionMessage.d.ts.map +0 -1
- package/local-dist-new/react-ink/components/messages/CompactionMessage.js +0 -6
- package/local-dist-new/react-ink/components/messages/CompactionMessage.js.map +0 -1
- package/local-dist-new/react-ink/components/messages/CustomMessage.d.ts +0 -10
- package/local-dist-new/react-ink/components/messages/CustomMessage.d.ts.map +0 -1
- package/local-dist-new/react-ink/components/messages/CustomMessage.js +0 -9
- package/local-dist-new/react-ink/components/messages/CustomMessage.js.map +0 -1
- package/local-dist-new/react-ink/components/messages/SkillInvocationMessage.d.ts +0 -8
- package/local-dist-new/react-ink/components/messages/SkillInvocationMessage.d.ts.map +0 -1
- package/local-dist-new/react-ink/components/messages/SkillInvocationMessage.js +0 -10
- package/local-dist-new/react-ink/components/messages/SkillInvocationMessage.js.map +0 -1
- package/local-dist-new/react-ink/components/messages/ToolCallMessage.d.ts +0 -9
- package/local-dist-new/react-ink/components/messages/ToolCallMessage.d.ts.map +0 -1
- package/local-dist-new/react-ink/components/messages/ToolCallMessage.js +0 -8
- package/local-dist-new/react-ink/components/messages/ToolCallMessage.js.map +0 -1
- package/local-dist-new/react-ink/components/messages/ToolResultBlock.d.ts +0 -13
- package/local-dist-new/react-ink/components/messages/ToolResultBlock.d.ts.map +0 -1
- package/local-dist-new/react-ink/components/messages/ToolResultBlock.js +0 -8
- package/local-dist-new/react-ink/components/messages/ToolResultBlock.js.map +0 -1
- package/local-dist-new/react-ink/components/messages/UserMessage.d.ts +0 -10
- package/local-dist-new/react-ink/components/messages/UserMessage.d.ts.map +0 -1
- package/local-dist-new/react-ink/components/messages/UserMessage.js +0 -9
- package/local-dist-new/react-ink/components/messages/UserMessage.js.map +0 -1
- package/local-dist-new/react-ink/index.d.ts +0 -35
- package/local-dist-new/react-ink/index.d.ts.map +0 -1
- package/local-dist-new/react-ink/index.js +0 -35
- package/local-dist-new/react-ink/index.js.map +0 -1
- package/local-dist-new/react-ink/theme-adapter.d.ts +0 -10
- package/local-dist-new/react-ink/theme-adapter.d.ts.map +0 -1
- package/local-dist-new/react-ink/theme-adapter.js +0 -44
- package/local-dist-new/react-ink/theme-adapter.js.map +0 -1
- package/local-dist-new/react-ink/types.d.ts +0 -134
- package/local-dist-new/react-ink/types.d.ts.map +0 -1
- package/local-dist-new/react-ink/types.js +0 -2
- package/local-dist-new/react-ink/types.js.map +0 -1
- package/local-dist-new/react-ink/utils/message-groups.d.ts +0 -26
- package/local-dist-new/react-ink/utils/message-groups.d.ts.map +0 -1
- package/local-dist-new/react-ink/utils/message-groups.js +0 -240
- package/local-dist-new/react-ink/utils/message-groups.js.map +0 -1
- package/local-dist-new/react-ink/utils/selection-dialog.d.ts +0 -3
- package/local-dist-new/react-ink/utils/selection-dialog.d.ts.map +0 -1
- package/local-dist-new/react-ink/utils/selection-dialog.js +0 -18
- package/local-dist-new/react-ink/utils/selection-dialog.js.map +0 -1
- package/local-dist-new/react-ink/utils/session-browser.d.ts +0 -28
- package/local-dist-new/react-ink/utils/session-browser.d.ts.map +0 -1
- package/local-dist-new/react-ink/utils/session-browser.js +0 -191
- package/local-dist-new/react-ink/utils/session-browser.js.map +0 -1
- package/local-dist-new/react-ink/utils/tool-display.d.ts +0 -22
- package/local-dist-new/react-ink/utils/tool-display.d.ts.map +0 -1
- package/local-dist-new/react-ink/utils/tool-display.js +0 -349
- package/local-dist-new/react-ink/utils/tool-display.js.map +0 -1
- package/local-dist-new/react-ink.d.ts +0 -3
- package/local-dist-new/react-ink.d.ts.map +0 -1
- package/local-dist-new/react-ink.js +0 -2
- package/local-dist-new/react-ink.js.map +0 -1
- package/local-dist-new/tui.d.ts +0 -9
- package/local-dist-new/tui.d.ts.map +0 -1
- package/local-dist-new/tui.js +0 -8
- package/local-dist-new/tui.js.map +0 -1
- package/local-dist-new/ui/autocomplete.d.ts +0 -60
- package/local-dist-new/ui/autocomplete.d.ts.map +0 -1
- package/local-dist-new/ui/autocomplete.js +0 -393
- package/local-dist-new/ui/autocomplete.js.map +0 -1
- package/local-dist-new/ui/contracts.d.ts +0 -39
- package/local-dist-new/ui/contracts.d.ts.map +0 -1
- package/local-dist-new/ui/contracts.js +0 -2
- package/local-dist-new/ui/contracts.js.map +0 -1
- package/local-dist-new/ui/editor-component.d.ts +0 -101
- package/local-dist-new/ui/editor-component.d.ts.map +0 -1
- package/local-dist-new/ui/editor-component.js +0 -2
- package/local-dist-new/ui/editor-component.js.map +0 -1
- package/local-dist-new/ui/fuzzy.d.ts +0 -26
- package/local-dist-new/ui/fuzzy.d.ts.map +0 -1
- package/local-dist-new/ui/fuzzy.js +0 -177
- package/local-dist-new/ui/fuzzy.js.map +0 -1
- package/local-dist-new/ui/index.d.ts +0 -9
- package/local-dist-new/ui/index.d.ts.map +0 -1
- package/local-dist-new/ui/index.js +0 -6
- package/local-dist-new/ui/index.js.map +0 -1
- package/local-dist-new/ui/keybindings.d.ts +0 -52
- package/local-dist-new/ui/keybindings.d.ts.map +0 -1
- package/local-dist-new/ui/keybindings.js +0 -193
- package/local-dist-new/ui/keybindings.js.map +0 -1
- package/local-dist-new/ui/keys.d.ts +0 -168
- package/local-dist-new/ui/keys.d.ts.map +0 -1
- package/local-dist-new/ui/keys.js +0 -1093
- package/local-dist-new/ui/keys.js.map +0 -1
- package/local-dist-new/ui/theme-types.d.ts +0 -37
- package/local-dist-new/ui/theme-types.d.ts.map +0 -1
- package/local-dist-new/ui/theme-types.js +0 -2
- package/local-dist-new/ui/theme-types.js.map +0 -1
- package/local-dist-new/ui/utils.d.ts +0 -97
- package/local-dist-new/ui/utils.d.ts.map +0 -1
- package/local-dist-new/ui/utils.js +0 -860
- package/local-dist-new/ui/utils.js.map +0 -1
- package/observe.d.ts +0 -1
- package/observe.js +0 -1
|
@@ -1,831 +0,0 @@
|
|
|
1
|
-
import OpenAI from "openai";
|
|
2
|
-
import { getEnvApiKey } from "../env-api-keys.js";
|
|
3
|
-
import { calculateCost, supportsXhigh } from "../models.js";
|
|
4
|
-
import { BaseStreamHandler } from "../kit/base-stream-handler.js";
|
|
5
|
-
import { AssistantMessageEventStream } from "../kit/event-stream.js";
|
|
6
|
-
import { createAssistantMessageOutput } from "../kit/output-factory.js";
|
|
7
|
-
import { mapStopReason as mapProviderStopReason } from "../kit/provider-consolidation.js";
|
|
8
|
-
import { BlockTracker, StreamEventHelper } from "../kit/stream-event-helper.js";
|
|
9
|
-
import { parseStreamingJson } from "../kit/json-parse.js";
|
|
10
|
-
import { sanitizeSurrogates } from "../kit/sanitize-unicode.js";
|
|
11
|
-
import { buildBaseOptions, executeWithRetry, mapThinkingLevel } from "./simple-options.js";
|
|
12
|
-
import { transformMessages } from "./transform-messages.js";
|
|
13
|
-
/**
|
|
14
|
-
* Normalize tool call ID for Mistral.
|
|
15
|
-
* Mistral requires tool IDs to be exactly 9 alphanumeric characters (a-z, A-Z, 0-9).
|
|
16
|
-
*/
|
|
17
|
-
function normalizeMistralToolId(id) {
|
|
18
|
-
// Remove non-alphanumeric characters
|
|
19
|
-
let normalized = id.replace(/[^a-zA-Z0-9]/g, "");
|
|
20
|
-
// Mistral requires exactly 9 characters
|
|
21
|
-
if (normalized.length < 9) {
|
|
22
|
-
// Pad with deterministic characters based on original ID to ensure matching
|
|
23
|
-
const padding = "ABCDEFGHI";
|
|
24
|
-
normalized = normalized + padding.slice(0, 9 - normalized.length);
|
|
25
|
-
}
|
|
26
|
-
else if (normalized.length > 9) {
|
|
27
|
-
normalized = normalized.slice(0, 9);
|
|
28
|
-
}
|
|
29
|
-
return normalized;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Check if conversation messages contain tool calls or tool results.
|
|
33
|
-
* This is needed because Anthropic (via proxy) requires the tools param
|
|
34
|
-
* to be present when messages include tool_calls or tool role messages.
|
|
35
|
-
*/
|
|
36
|
-
function hasToolHistory(messages) {
|
|
37
|
-
for (const msg of messages) {
|
|
38
|
-
if (msg.role === "toolResult") {
|
|
39
|
-
return true;
|
|
40
|
-
}
|
|
41
|
-
if (msg.role === "assistant") {
|
|
42
|
-
if (msg.content.some((block) => block.type === "toolCall")) {
|
|
43
|
-
return true;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
return false;
|
|
48
|
-
}
|
|
49
|
-
export class OpenAICompatibilityAdapter {
|
|
50
|
-
model;
|
|
51
|
-
constructor(model) {
|
|
52
|
-
this.model = model;
|
|
53
|
-
}
|
|
54
|
-
resolveCompat() {
|
|
55
|
-
return getCompat(this.model);
|
|
56
|
-
}
|
|
57
|
-
normalizeToolCallId(id) {
|
|
58
|
-
const compat = this.resolveCompat();
|
|
59
|
-
return compat.requiresMistralToolIds ? normalizeMistralToolId(id) : id;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* OpenAI Completions stream handler.
|
|
64
|
-
*
|
|
65
|
-
* Processes streaming responses from OpenAI-compatible endpoints and emits
|
|
66
|
-
* standardized assistant events.
|
|
67
|
-
*/
|
|
68
|
-
class OpenAICompletionsStreamHandler extends BaseStreamHandler {
|
|
69
|
-
executeFn;
|
|
70
|
-
constructor(executeFn) {
|
|
71
|
-
super();
|
|
72
|
-
this.executeFn = executeFn;
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Execute the stream by invoking the provided async function.
|
|
76
|
-
*/
|
|
77
|
-
async processStream() {
|
|
78
|
-
await this.executeFn();
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
class CompletionsBlockLifecycle {
|
|
82
|
-
output;
|
|
83
|
-
stream;
|
|
84
|
-
activeBlock = null;
|
|
85
|
-
constructor(output, stream) {
|
|
86
|
-
this.output = output;
|
|
87
|
-
this.stream = stream;
|
|
88
|
-
}
|
|
89
|
-
finalizeCurrent() {
|
|
90
|
-
if (!this.activeBlock)
|
|
91
|
-
return;
|
|
92
|
-
const currentIndex = this.output.content.length - 1;
|
|
93
|
-
if (this.activeBlock.type === "text") {
|
|
94
|
-
this.stream.push({
|
|
95
|
-
type: "text_end",
|
|
96
|
-
contentIndex: currentIndex,
|
|
97
|
-
content: this.activeBlock.text,
|
|
98
|
-
partial: this.output,
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
else if (this.activeBlock.type === "thinking") {
|
|
102
|
-
this.stream.push({
|
|
103
|
-
type: "thinking_end",
|
|
104
|
-
contentIndex: currentIndex,
|
|
105
|
-
content: this.activeBlock.thinking,
|
|
106
|
-
partial: this.output,
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
else {
|
|
110
|
-
this.activeBlock.arguments = JSON.parse(this.activeBlock.partialArgs || "{}");
|
|
111
|
-
delete this.activeBlock.partialArgs;
|
|
112
|
-
this.stream.push({
|
|
113
|
-
type: "toolcall_end",
|
|
114
|
-
contentIndex: currentIndex,
|
|
115
|
-
toolCall: this.activeBlock,
|
|
116
|
-
partial: this.output,
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
applyTextDelta(deltaText) {
|
|
121
|
-
if (!deltaText)
|
|
122
|
-
return;
|
|
123
|
-
if (!this.activeBlock || this.activeBlock.type !== "text") {
|
|
124
|
-
this.finalizeCurrent();
|
|
125
|
-
this.activeBlock = { type: "text", text: "" };
|
|
126
|
-
this.output.content.push(this.activeBlock);
|
|
127
|
-
this.stream.push({ type: "text_start", contentIndex: this.output.content.length - 1, partial: this.output });
|
|
128
|
-
}
|
|
129
|
-
if (this.activeBlock.type === "text") {
|
|
130
|
-
this.activeBlock.text += deltaText;
|
|
131
|
-
this.stream.push({
|
|
132
|
-
type: "text_delta",
|
|
133
|
-
contentIndex: this.output.content.length - 1,
|
|
134
|
-
delta: deltaText,
|
|
135
|
-
partial: this.output,
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
applyThinkingDelta(reasoningField, deltaText) {
|
|
140
|
-
if (!deltaText)
|
|
141
|
-
return;
|
|
142
|
-
if (!this.activeBlock || this.activeBlock.type !== "thinking") {
|
|
143
|
-
this.finalizeCurrent();
|
|
144
|
-
this.activeBlock = {
|
|
145
|
-
type: "thinking",
|
|
146
|
-
thinking: "",
|
|
147
|
-
thinkingSignature: reasoningField,
|
|
148
|
-
};
|
|
149
|
-
this.output.content.push(this.activeBlock);
|
|
150
|
-
this.stream.push({
|
|
151
|
-
type: "thinking_start",
|
|
152
|
-
contentIndex: this.output.content.length - 1,
|
|
153
|
-
partial: this.output,
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
if (this.activeBlock.type === "thinking") {
|
|
157
|
-
this.activeBlock.thinking += deltaText;
|
|
158
|
-
this.stream.push({
|
|
159
|
-
type: "thinking_delta",
|
|
160
|
-
contentIndex: this.output.content.length - 1,
|
|
161
|
-
delta: deltaText,
|
|
162
|
-
partial: this.output,
|
|
163
|
-
});
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
applyToolCallDelta(toolCall) {
|
|
167
|
-
if (!this.activeBlock ||
|
|
168
|
-
this.activeBlock.type !== "toolCall" ||
|
|
169
|
-
(toolCall.id && this.activeBlock.id !== toolCall.id)) {
|
|
170
|
-
this.finalizeCurrent();
|
|
171
|
-
this.activeBlock = {
|
|
172
|
-
type: "toolCall",
|
|
173
|
-
id: toolCall.id || "",
|
|
174
|
-
name: toolCall.function?.name || "",
|
|
175
|
-
arguments: {},
|
|
176
|
-
partialArgs: "",
|
|
177
|
-
};
|
|
178
|
-
this.output.content.push(this.activeBlock);
|
|
179
|
-
this.stream.push({
|
|
180
|
-
type: "toolcall_start",
|
|
181
|
-
contentIndex: this.output.content.length - 1,
|
|
182
|
-
partial: this.output,
|
|
183
|
-
});
|
|
184
|
-
}
|
|
185
|
-
if (this.activeBlock.type === "toolCall") {
|
|
186
|
-
if (toolCall.id)
|
|
187
|
-
this.activeBlock.id = toolCall.id;
|
|
188
|
-
if (toolCall.function?.name)
|
|
189
|
-
this.activeBlock.name = toolCall.function.name;
|
|
190
|
-
let argumentDelta = "";
|
|
191
|
-
if (toolCall.function?.arguments) {
|
|
192
|
-
argumentDelta = toolCall.function.arguments;
|
|
193
|
-
this.activeBlock.partialArgs += toolCall.function.arguments;
|
|
194
|
-
this.activeBlock.arguments = parseStreamingJson(this.activeBlock.partialArgs);
|
|
195
|
-
}
|
|
196
|
-
this.stream.push({
|
|
197
|
-
type: "toolcall_delta",
|
|
198
|
-
contentIndex: this.output.content.length - 1,
|
|
199
|
-
delta: argumentDelta,
|
|
200
|
-
partial: this.output,
|
|
201
|
-
});
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
attachReasoningDetails(reasoningDetails) {
|
|
205
|
-
if (!Array.isArray(reasoningDetails))
|
|
206
|
-
return;
|
|
207
|
-
for (const detail of reasoningDetails) {
|
|
208
|
-
if (detail?.type === "reasoning.encrypted" && detail?.id && detail?.data) {
|
|
209
|
-
const matchingToolCall = this.output.content.find((b) => b.type === "toolCall" && b.id === detail.id);
|
|
210
|
-
if (matchingToolCall) {
|
|
211
|
-
matchingToolCall.thoughtSignature = JSON.stringify(detail);
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
class CompletionsChunkRouter {
|
|
218
|
-
model;
|
|
219
|
-
output;
|
|
220
|
-
lifecycle;
|
|
221
|
-
static REASONING_FIELDS = ["reasoning_content", "reasoning", "reasoning_text"];
|
|
222
|
-
constructor(model, output, lifecycle) {
|
|
223
|
-
this.model = model;
|
|
224
|
-
this.output = output;
|
|
225
|
-
this.lifecycle = lifecycle;
|
|
226
|
-
}
|
|
227
|
-
applyUsage(chunk) {
|
|
228
|
-
if (!chunk.usage)
|
|
229
|
-
return;
|
|
230
|
-
const cachedTokens = chunk.usage.prompt_tokens_details?.cached_tokens || 0;
|
|
231
|
-
const reasoningTokens = chunk.usage.completion_tokens_details?.reasoning_tokens || 0;
|
|
232
|
-
const input = (chunk.usage.prompt_tokens || 0) - cachedTokens;
|
|
233
|
-
const outputTokens = (chunk.usage.completion_tokens || 0) + reasoningTokens;
|
|
234
|
-
this.output.usage = {
|
|
235
|
-
input,
|
|
236
|
-
output: outputTokens,
|
|
237
|
-
cacheRead: cachedTokens,
|
|
238
|
-
cacheWrite: 0,
|
|
239
|
-
totalTokens: input + outputTokens + cachedTokens,
|
|
240
|
-
cost: {
|
|
241
|
-
input: 0,
|
|
242
|
-
output: 0,
|
|
243
|
-
cacheRead: 0,
|
|
244
|
-
cacheWrite: 0,
|
|
245
|
-
total: 0,
|
|
246
|
-
},
|
|
247
|
-
};
|
|
248
|
-
calculateCost(this.model, this.output.usage);
|
|
249
|
-
}
|
|
250
|
-
applyFinishReason(choice) {
|
|
251
|
-
if (choice.finish_reason) {
|
|
252
|
-
this.output.stopReason = mapProviderStopReason(choice.finish_reason, "openai-completions");
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
applyChoiceDelta(choice) {
|
|
256
|
-
const delta = choice.delta;
|
|
257
|
-
if (!delta)
|
|
258
|
-
return;
|
|
259
|
-
if (delta.content) {
|
|
260
|
-
this.lifecycle.applyTextDelta(delta.content);
|
|
261
|
-
}
|
|
262
|
-
const reasoningField = this.resolveReasoningField(delta);
|
|
263
|
-
if (reasoningField) {
|
|
264
|
-
const reasoningDelta = delta[reasoningField];
|
|
265
|
-
this.lifecycle.applyThinkingDelta(reasoningField, reasoningDelta);
|
|
266
|
-
}
|
|
267
|
-
if (delta.tool_calls) {
|
|
268
|
-
for (const toolCall of delta.tool_calls) {
|
|
269
|
-
this.lifecycle.applyToolCallDelta(toolCall);
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
this.lifecycle.attachReasoningDetails(delta.reasoning_details);
|
|
273
|
-
}
|
|
274
|
-
resolveReasoningField(delta) {
|
|
275
|
-
for (const field of CompletionsChunkRouter.REASONING_FIELDS) {
|
|
276
|
-
const value = delta[field];
|
|
277
|
-
if (value !== null && value !== undefined && value.length > 0) {
|
|
278
|
-
return field;
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
return null;
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
export const streamOpenAICompletions = (model, context, options) => {
|
|
285
|
-
const stream = new AssistantMessageEventStream();
|
|
286
|
-
const output = createAssistantMessageOutput(model);
|
|
287
|
-
const events = new StreamEventHelper(stream, output);
|
|
288
|
-
const tracker = new BlockTracker(output);
|
|
289
|
-
void tracker;
|
|
290
|
-
const handler = new OpenAICompletionsStreamHandler(async () => {
|
|
291
|
-
try {
|
|
292
|
-
const apiKey = options?.apiKey || getEnvApiKey(model.provider) || "";
|
|
293
|
-
const client = createClient(model, context, apiKey, options?.headers);
|
|
294
|
-
const params = buildParams(model, context, options);
|
|
295
|
-
options?.onPayload?.(params);
|
|
296
|
-
const openaiStream = await executeWithRetry(() => client.chat.completions.create(params, { signal: options?.signal }), {
|
|
297
|
-
maxAttempts: options?.signal ? 1 : (options?.retryPolicy?.maxAttempts ?? 3),
|
|
298
|
-
baseDelayMs: options?.retryPolicy?.baseDelayMs ?? 250,
|
|
299
|
-
});
|
|
300
|
-
events.start();
|
|
301
|
-
const lifecycle = new CompletionsBlockLifecycle(output, stream);
|
|
302
|
-
const chunkRouter = new CompletionsChunkRouter(model, output, lifecycle);
|
|
303
|
-
for await (const chunk of openaiStream) {
|
|
304
|
-
chunkRouter.applyUsage(chunk);
|
|
305
|
-
const choice = chunk.choices[0];
|
|
306
|
-
if (!choice)
|
|
307
|
-
continue;
|
|
308
|
-
chunkRouter.applyFinishReason(choice);
|
|
309
|
-
chunkRouter.applyChoiceDelta(choice);
|
|
310
|
-
}
|
|
311
|
-
lifecycle.finalizeCurrent();
|
|
312
|
-
if (options?.signal?.aborted) {
|
|
313
|
-
throw new Error("Request was aborted");
|
|
314
|
-
}
|
|
315
|
-
if (output.stopReason === "aborted" || output.stopReason === "error") {
|
|
316
|
-
throw new Error("An unknown error occurred");
|
|
317
|
-
}
|
|
318
|
-
stream.pushDone(output.stopReason, output);
|
|
319
|
-
stream.end();
|
|
320
|
-
}
|
|
321
|
-
catch (error) {
|
|
322
|
-
for (const block of output.content)
|
|
323
|
-
delete block.index;
|
|
324
|
-
output.stopReason = options?.signal?.aborted ? "aborted" : "error";
|
|
325
|
-
output.errorMessage = error instanceof Error ? error.message : JSON.stringify(error);
|
|
326
|
-
// Some providers via OpenRouter give additional information in this field.
|
|
327
|
-
const rawMetadata = error?.error?.metadata?.raw;
|
|
328
|
-
if (rawMetadata)
|
|
329
|
-
output.errorMessage += `\n${rawMetadata}`;
|
|
330
|
-
stream.pushError(output.stopReason, output);
|
|
331
|
-
stream.end();
|
|
332
|
-
}
|
|
333
|
-
});
|
|
334
|
-
void handler.run();
|
|
335
|
-
return stream;
|
|
336
|
-
};
|
|
337
|
-
export const streamSimpleOpenAICompletions = (model, context, options) => {
|
|
338
|
-
const apiKey = options?.apiKey || getEnvApiKey(model.provider);
|
|
339
|
-
if (!apiKey) {
|
|
340
|
-
throw new Error(`No API key for provider: ${model.provider}`);
|
|
341
|
-
}
|
|
342
|
-
const base = buildBaseOptions(model, options, apiKey);
|
|
343
|
-
const reasoningEffort = mapThinkingLevel(options?.reasoning, supportsXhigh(model) ? "supports-xhigh" : "clamp-xhigh");
|
|
344
|
-
return streamOpenAICompletions(model, context, {
|
|
345
|
-
...base,
|
|
346
|
-
reasoningEffort,
|
|
347
|
-
});
|
|
348
|
-
};
|
|
349
|
-
function resolveProviderDefaultHeaders(model) {
|
|
350
|
-
if (model.provider === "sarvam" || model.baseUrl.includes("api.sarvam.ai")) {
|
|
351
|
-
const subscriptionKey = process.env.SARVAM_SUBSCRIPTION_KEY;
|
|
352
|
-
return subscriptionKey ? { "api-subscription-key": subscriptionKey } : {};
|
|
353
|
-
}
|
|
354
|
-
return {};
|
|
355
|
-
}
|
|
356
|
-
function createClient(model, context, apiKey, optionsHeaders) {
|
|
357
|
-
if (!apiKey) {
|
|
358
|
-
if (!process.env.OPENAI_API_KEY) {
|
|
359
|
-
throw new Error("OpenAI API key is required. Set OPENAI_API_KEY environment variable or pass it as an argument.");
|
|
360
|
-
}
|
|
361
|
-
apiKey = process.env.OPENAI_API_KEY;
|
|
362
|
-
}
|
|
363
|
-
const headers = {
|
|
364
|
-
...model.headers,
|
|
365
|
-
...resolveProviderDefaultHeaders(model),
|
|
366
|
-
};
|
|
367
|
-
if (model.provider === "github-copilot") {
|
|
368
|
-
// Copilot expects X-Initiator to indicate whether the request is user-initiated
|
|
369
|
-
// or agent-initiated (e.g. follow-up after assistant/tool messages). If there is
|
|
370
|
-
// no prior message, default to user-initiated.
|
|
371
|
-
const messages = context.messages || [];
|
|
372
|
-
const lastMessage = messages[messages.length - 1];
|
|
373
|
-
const isAgentCall = lastMessage ? lastMessage.role !== "user" : false;
|
|
374
|
-
headers["X-Initiator"] = isAgentCall ? "agent" : "user";
|
|
375
|
-
headers["Openai-Intent"] = "conversation-edits";
|
|
376
|
-
// Copilot requires this header when sending images
|
|
377
|
-
const hasImages = messages.some((msg) => {
|
|
378
|
-
if (msg.role === "user" && Array.isArray(msg.content)) {
|
|
379
|
-
return msg.content.some((c) => c.type === "image");
|
|
380
|
-
}
|
|
381
|
-
if (msg.role === "toolResult" && Array.isArray(msg.content)) {
|
|
382
|
-
return msg.content.some((c) => c.type === "image");
|
|
383
|
-
}
|
|
384
|
-
return false;
|
|
385
|
-
});
|
|
386
|
-
if (hasImages) {
|
|
387
|
-
headers["Copilot-Vision-Request"] = "true";
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
|
-
// Merge options headers last so they can override defaults
|
|
391
|
-
if (optionsHeaders) {
|
|
392
|
-
Object.assign(headers, optionsHeaders);
|
|
393
|
-
}
|
|
394
|
-
return new OpenAI({
|
|
395
|
-
apiKey,
|
|
396
|
-
baseURL: model.baseUrl,
|
|
397
|
-
dangerouslyAllowBrowser: true,
|
|
398
|
-
defaultHeaders: headers,
|
|
399
|
-
});
|
|
400
|
-
}
|
|
401
|
-
function buildParams(model, context, options) {
|
|
402
|
-
const compat = getCompat(model);
|
|
403
|
-
const messages = convertMessages(model, context, compat);
|
|
404
|
-
maybeAddOpenRouterAnthropicCacheControl(model, messages);
|
|
405
|
-
const params = {
|
|
406
|
-
model: model.id,
|
|
407
|
-
messages,
|
|
408
|
-
stream: true,
|
|
409
|
-
};
|
|
410
|
-
if (compat.supportsUsageInStreaming !== false) {
|
|
411
|
-
params.stream_options = { include_usage: true };
|
|
412
|
-
}
|
|
413
|
-
if (compat.supportsStore) {
|
|
414
|
-
params.store = false;
|
|
415
|
-
}
|
|
416
|
-
if (options?.maxTokens) {
|
|
417
|
-
if (compat.maxTokensField === "max_tokens") {
|
|
418
|
-
params.max_tokens = options.maxTokens;
|
|
419
|
-
}
|
|
420
|
-
else {
|
|
421
|
-
params.max_completion_tokens = options.maxTokens;
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
if (options?.temperature !== undefined) {
|
|
425
|
-
params.temperature = options.temperature;
|
|
426
|
-
}
|
|
427
|
-
if (context.tools) {
|
|
428
|
-
params.tools = convertTools(context.tools);
|
|
429
|
-
}
|
|
430
|
-
else if (hasToolHistory(context.messages)) {
|
|
431
|
-
// Anthropic (via LiteLLM/proxy) requires tools param when conversation has tool_calls/tool_results
|
|
432
|
-
params.tools = [];
|
|
433
|
-
}
|
|
434
|
-
if (options?.toolChoice) {
|
|
435
|
-
params.tool_choice = options.toolChoice;
|
|
436
|
-
}
|
|
437
|
-
if (compat.thinkingFormat === "zai" && model.reasoning) {
|
|
438
|
-
// Z.ai uses binary thinking: { type: "enabled" | "disabled" }
|
|
439
|
-
// Must explicitly disable since z.ai defaults to thinking enabled
|
|
440
|
-
params.thinking = { type: options?.reasoningEffort ? "enabled" : "disabled" };
|
|
441
|
-
}
|
|
442
|
-
else if (options?.reasoningEffort && model.reasoning && compat.supportsReasoningEffort) {
|
|
443
|
-
// OpenAI-style reasoning_effort
|
|
444
|
-
params.reasoning_effort = options.reasoningEffort;
|
|
445
|
-
}
|
|
446
|
-
// OpenRouter provider routing preferences
|
|
447
|
-
if (model.baseUrl.includes("openrouter.ai") && model.compat?.openRouterRouting) {
|
|
448
|
-
params.provider = model.compat.openRouterRouting;
|
|
449
|
-
}
|
|
450
|
-
return params;
|
|
451
|
-
}
|
|
452
|
-
function isSarvamLike(model) {
|
|
453
|
-
return model.provider === "sarvam" || model.baseUrl.includes("api.sarvam.ai");
|
|
454
|
-
}
|
|
455
|
-
function maybeAddOpenRouterAnthropicCacheControl(model, messages) {
|
|
456
|
-
if (model.provider !== "openrouter" || !model.id.startsWith("anthropic/"))
|
|
457
|
-
return;
|
|
458
|
-
// Anthropic-style caching requires cache_control on a text part. Add a breakpoint
|
|
459
|
-
// on the last user/assistant message (walking backwards until we find text content).
|
|
460
|
-
for (let i = messages.length - 1; i >= 0; i--) {
|
|
461
|
-
const msg = messages[i];
|
|
462
|
-
if (msg.role !== "user" && msg.role !== "assistant")
|
|
463
|
-
continue;
|
|
464
|
-
const content = msg.content;
|
|
465
|
-
if (typeof content === "string") {
|
|
466
|
-
msg.content = [
|
|
467
|
-
Object.assign({ type: "text", text: content }, { cache_control: { type: "ephemeral" } }),
|
|
468
|
-
];
|
|
469
|
-
return;
|
|
470
|
-
}
|
|
471
|
-
if (!Array.isArray(content))
|
|
472
|
-
continue;
|
|
473
|
-
// Find last text part and add cache_control
|
|
474
|
-
for (let j = content.length - 1; j >= 0; j--) {
|
|
475
|
-
const part = content[j];
|
|
476
|
-
if (part?.type === "text") {
|
|
477
|
-
Object.assign(part, { cache_control: { type: "ephemeral" } });
|
|
478
|
-
return;
|
|
479
|
-
}
|
|
480
|
-
}
|
|
481
|
-
}
|
|
482
|
-
}
|
|
483
|
-
class UserMessageTransformer {
|
|
484
|
-
model;
|
|
485
|
-
constructor(model) {
|
|
486
|
-
this.model = model;
|
|
487
|
-
}
|
|
488
|
-
transform(message) {
|
|
489
|
-
if (typeof message.content === "string") {
|
|
490
|
-
return {
|
|
491
|
-
role: "user",
|
|
492
|
-
content: sanitizeSurrogates(message.content),
|
|
493
|
-
};
|
|
494
|
-
}
|
|
495
|
-
const contentParts = message.content.map((item) => {
|
|
496
|
-
if (item.type === "text") {
|
|
497
|
-
return {
|
|
498
|
-
type: "text",
|
|
499
|
-
text: sanitizeSurrogates(item.text),
|
|
500
|
-
};
|
|
501
|
-
}
|
|
502
|
-
return {
|
|
503
|
-
type: "image_url",
|
|
504
|
-
image_url: {
|
|
505
|
-
url: `data:${item.mimeType};base64,${item.data}`,
|
|
506
|
-
},
|
|
507
|
-
};
|
|
508
|
-
});
|
|
509
|
-
const filteredParts = !this.model.input.includes("image")
|
|
510
|
-
? contentParts.filter((part) => part.type !== "image_url")
|
|
511
|
-
: contentParts;
|
|
512
|
-
if (filteredParts.length === 0) {
|
|
513
|
-
return undefined;
|
|
514
|
-
}
|
|
515
|
-
if (isSarvamLike(this.model) && filteredParts.every((part) => part.type === "text")) {
|
|
516
|
-
return {
|
|
517
|
-
role: "user",
|
|
518
|
-
content: filteredParts.map((part) => part.text).join("\n"),
|
|
519
|
-
};
|
|
520
|
-
}
|
|
521
|
-
return {
|
|
522
|
-
role: "user",
|
|
523
|
-
content: filteredParts,
|
|
524
|
-
};
|
|
525
|
-
}
|
|
526
|
-
}
|
|
527
|
-
class AssistantMessageTransformer {
|
|
528
|
-
model;
|
|
529
|
-
compat;
|
|
530
|
-
constructor(model, compat) {
|
|
531
|
-
this.model = model;
|
|
532
|
-
this.compat = compat;
|
|
533
|
-
}
|
|
534
|
-
transform(message) {
|
|
535
|
-
const assistantMessage = {
|
|
536
|
-
role: "assistant",
|
|
537
|
-
content: this.compat.requiresAssistantAfterToolResult ? "" : null,
|
|
538
|
-
};
|
|
539
|
-
const textBlocks = message.content.filter((block) => block.type === "text");
|
|
540
|
-
const nonEmptyTextBlocks = textBlocks.filter((block) => block.text && block.text.trim().length > 0);
|
|
541
|
-
if (nonEmptyTextBlocks.length > 0) {
|
|
542
|
-
if (this.model.provider === "github-copilot" || isSarvamLike(this.model)) {
|
|
543
|
-
assistantMessage.content = nonEmptyTextBlocks.map((block) => sanitizeSurrogates(block.text)).join("");
|
|
544
|
-
}
|
|
545
|
-
else {
|
|
546
|
-
assistantMessage.content = nonEmptyTextBlocks.map((block) => ({
|
|
547
|
-
type: "text",
|
|
548
|
-
text: sanitizeSurrogates(block.text),
|
|
549
|
-
}));
|
|
550
|
-
}
|
|
551
|
-
}
|
|
552
|
-
const thinkingBlocks = message.content.filter((block) => block.type === "thinking");
|
|
553
|
-
const nonEmptyThinkingBlocks = thinkingBlocks.filter((block) => block.thinking && block.thinking.trim().length > 0);
|
|
554
|
-
if (nonEmptyThinkingBlocks.length > 0) {
|
|
555
|
-
this.applyThinkingBlocks(assistantMessage, nonEmptyThinkingBlocks);
|
|
556
|
-
}
|
|
557
|
-
const toolCalls = message.content.filter((block) => block.type === "toolCall");
|
|
558
|
-
if (toolCalls.length > 0) {
|
|
559
|
-
assistantMessage.tool_calls = toolCalls.map((toolCall) => ({
|
|
560
|
-
id: toolCall.id,
|
|
561
|
-
type: "function",
|
|
562
|
-
function: {
|
|
563
|
-
name: toolCall.name,
|
|
564
|
-
arguments: JSON.stringify(toolCall.arguments),
|
|
565
|
-
},
|
|
566
|
-
}));
|
|
567
|
-
const reasoningDetails = toolCalls
|
|
568
|
-
.filter((toolCall) => toolCall.thoughtSignature)
|
|
569
|
-
.map((toolCall) => {
|
|
570
|
-
try {
|
|
571
|
-
return JSON.parse(toolCall.thoughtSignature);
|
|
572
|
-
}
|
|
573
|
-
catch {
|
|
574
|
-
return null;
|
|
575
|
-
}
|
|
576
|
-
})
|
|
577
|
-
.filter(Boolean);
|
|
578
|
-
if (reasoningDetails.length > 0) {
|
|
579
|
-
assistantMessage.reasoning_details = reasoningDetails;
|
|
580
|
-
}
|
|
581
|
-
}
|
|
582
|
-
const content = assistantMessage.content;
|
|
583
|
-
const hasContent = content !== null &&
|
|
584
|
-
content !== undefined &&
|
|
585
|
-
(typeof content === "string" ? content.length > 0 : content.length > 0);
|
|
586
|
-
if (!hasContent && !assistantMessage.tool_calls) {
|
|
587
|
-
return undefined;
|
|
588
|
-
}
|
|
589
|
-
return assistantMessage;
|
|
590
|
-
}
|
|
591
|
-
applyThinkingBlocks(assistantMessage, nonEmptyThinkingBlocks) {
|
|
592
|
-
if (this.compat.requiresThinkingAsText) {
|
|
593
|
-
const thinkingText = nonEmptyThinkingBlocks.map((block) => block.thinking).join("\n\n");
|
|
594
|
-
const textContent = assistantMessage.content;
|
|
595
|
-
if (textContent) {
|
|
596
|
-
textContent.unshift({ type: "text", text: thinkingText });
|
|
597
|
-
}
|
|
598
|
-
else {
|
|
599
|
-
assistantMessage.content = [{ type: "text", text: thinkingText }];
|
|
600
|
-
}
|
|
601
|
-
return;
|
|
602
|
-
}
|
|
603
|
-
const signature = nonEmptyThinkingBlocks[0].thinkingSignature;
|
|
604
|
-
if (signature && signature.length > 0) {
|
|
605
|
-
assistantMessage[signature] = nonEmptyThinkingBlocks.map((block) => block.thinking).join("\n");
|
|
606
|
-
}
|
|
607
|
-
}
|
|
608
|
-
}
|
|
609
|
-
class ToolResultTransformer {
|
|
610
|
-
model;
|
|
611
|
-
compat;
|
|
612
|
-
constructor(model, compat) {
|
|
613
|
-
this.model = model;
|
|
614
|
-
this.compat = compat;
|
|
615
|
-
}
|
|
616
|
-
transform(messages, startIndex) {
|
|
617
|
-
const params = [];
|
|
618
|
-
const imageBlocks = [];
|
|
619
|
-
let cursor = startIndex;
|
|
620
|
-
for (; cursor < messages.length && messages[cursor].role === "toolResult"; cursor++) {
|
|
621
|
-
const toolMessage = messages[cursor];
|
|
622
|
-
const textResult = toolMessage.content
|
|
623
|
-
.filter((entry) => entry.type === "text")
|
|
624
|
-
.map((entry) => entry.text)
|
|
625
|
-
.join("\n");
|
|
626
|
-
const hasImages = toolMessage.content.some((entry) => entry.type === "image");
|
|
627
|
-
const hasText = textResult.length > 0;
|
|
628
|
-
const toolResultMessage = {
|
|
629
|
-
role: "tool",
|
|
630
|
-
content: sanitizeSurrogates(hasText ? textResult : "(see attached image)"),
|
|
631
|
-
tool_call_id: toolMessage.toolCallId,
|
|
632
|
-
};
|
|
633
|
-
if (this.compat.requiresToolResultName && toolMessage.toolName) {
|
|
634
|
-
toolResultMessage.name = toolMessage.toolName;
|
|
635
|
-
}
|
|
636
|
-
params.push(toolResultMessage);
|
|
637
|
-
if (hasImages && this.model.input.includes("image")) {
|
|
638
|
-
for (const block of toolMessage.content) {
|
|
639
|
-
if (block.type === "image") {
|
|
640
|
-
imageBlocks.push({
|
|
641
|
-
type: "image_url",
|
|
642
|
-
image_url: {
|
|
643
|
-
url: `data:${block.mimeType};base64,${block.data}`,
|
|
644
|
-
},
|
|
645
|
-
});
|
|
646
|
-
}
|
|
647
|
-
}
|
|
648
|
-
}
|
|
649
|
-
}
|
|
650
|
-
if (imageBlocks.length === 0) {
|
|
651
|
-
return { params, nextIndex: cursor - 1, lastRole: "toolResult" };
|
|
652
|
-
}
|
|
653
|
-
if (this.compat.requiresAssistantAfterToolResult) {
|
|
654
|
-
params.push({
|
|
655
|
-
role: "assistant",
|
|
656
|
-
content: "I have processed the tool results.",
|
|
657
|
-
});
|
|
658
|
-
}
|
|
659
|
-
params.push({
|
|
660
|
-
role: "user",
|
|
661
|
-
content: [
|
|
662
|
-
{
|
|
663
|
-
type: "text",
|
|
664
|
-
text: "Attached image(s) from tool result:",
|
|
665
|
-
},
|
|
666
|
-
...imageBlocks,
|
|
667
|
-
],
|
|
668
|
-
});
|
|
669
|
-
return { params, nextIndex: cursor - 1, lastRole: "user" };
|
|
670
|
-
}
|
|
671
|
-
}
|
|
672
|
-
class OpenAIMessageTransformer {
|
|
673
|
-
model;
|
|
674
|
-
context;
|
|
675
|
-
compat;
|
|
676
|
-
userTransformer;
|
|
677
|
-
assistantTransformer;
|
|
678
|
-
toolResultTransformer;
|
|
679
|
-
constructor(model, context, compat) {
|
|
680
|
-
this.model = model;
|
|
681
|
-
this.context = context;
|
|
682
|
-
this.compat = compat;
|
|
683
|
-
this.userTransformer = new UserMessageTransformer(model);
|
|
684
|
-
this.assistantTransformer = new AssistantMessageTransformer(model, compat);
|
|
685
|
-
this.toolResultTransformer = new ToolResultTransformer(model, compat);
|
|
686
|
-
}
|
|
687
|
-
transform() {
|
|
688
|
-
const params = [];
|
|
689
|
-
const transformedMessages = transformMessages(this.context.messages, this.model, (id) => this.normalizeToolCallId(id));
|
|
690
|
-
if (this.context.systemPrompt) {
|
|
691
|
-
const role = this.model.reasoning && this.compat.supportsDeveloperRole ? "developer" : "system";
|
|
692
|
-
params.push({ role, content: sanitizeSurrogates(this.context.systemPrompt) });
|
|
693
|
-
}
|
|
694
|
-
let lastRole = null;
|
|
695
|
-
for (let i = 0; i < transformedMessages.length; i++) {
|
|
696
|
-
const message = transformedMessages[i];
|
|
697
|
-
if (this.compat.requiresAssistantAfterToolResult && lastRole === "toolResult" && message.role === "user") {
|
|
698
|
-
params.push({ role: "assistant", content: "I have processed the tool results." });
|
|
699
|
-
}
|
|
700
|
-
if (message.role === "user") {
|
|
701
|
-
const transformed = this.userTransformer.transform(message);
|
|
702
|
-
if (transformed) {
|
|
703
|
-
params.push(transformed);
|
|
704
|
-
lastRole = "user";
|
|
705
|
-
}
|
|
706
|
-
continue;
|
|
707
|
-
}
|
|
708
|
-
if (message.role === "assistant") {
|
|
709
|
-
const transformed = this.assistantTransformer.transform(message);
|
|
710
|
-
if (transformed) {
|
|
711
|
-
params.push(transformed);
|
|
712
|
-
lastRole = "assistant";
|
|
713
|
-
}
|
|
714
|
-
continue;
|
|
715
|
-
}
|
|
716
|
-
const toolResultBatch = this.toolResultTransformer.transform(transformedMessages, i);
|
|
717
|
-
params.push(...toolResultBatch.params);
|
|
718
|
-
i = toolResultBatch.nextIndex;
|
|
719
|
-
lastRole = toolResultBatch.lastRole;
|
|
720
|
-
}
|
|
721
|
-
return params;
|
|
722
|
-
}
|
|
723
|
-
normalizeToolCallId(id) {
|
|
724
|
-
if (this.compat.requiresMistralToolIds)
|
|
725
|
-
return normalizeMistralToolId(id);
|
|
726
|
-
if (this.model.provider === "openai")
|
|
727
|
-
return id.length > 40 ? id.slice(0, 40) : id;
|
|
728
|
-
if (this.model.provider === "github-copilot" && this.model.id.toLowerCase().includes("claude")) {
|
|
729
|
-
return id.replace(/[^a-zA-Z0-9_-]/g, "_").slice(0, 64);
|
|
730
|
-
}
|
|
731
|
-
return id;
|
|
732
|
-
}
|
|
733
|
-
}
|
|
734
|
-
export function convertMessages(model, context, compat) {
|
|
735
|
-
return new OpenAIMessageTransformer(model, context, compat).transform();
|
|
736
|
-
}
|
|
737
|
-
function convertTools(tools) {
|
|
738
|
-
return tools.map((tool) => ({
|
|
739
|
-
type: "function",
|
|
740
|
-
function: {
|
|
741
|
-
name: tool.name,
|
|
742
|
-
description: tool.description,
|
|
743
|
-
parameters: tool.parameters, // TypeBox already generates JSON Schema
|
|
744
|
-
strict: false, // Disable strict mode to allow optional parameters without null unions
|
|
745
|
-
},
|
|
746
|
-
}));
|
|
747
|
-
}
|
|
748
|
-
function mapStopReason(reason) {
|
|
749
|
-
if (reason === null)
|
|
750
|
-
return "stop";
|
|
751
|
-
switch (reason) {
|
|
752
|
-
case "stop":
|
|
753
|
-
return "stop";
|
|
754
|
-
case "length":
|
|
755
|
-
return "length";
|
|
756
|
-
case "function_call":
|
|
757
|
-
case "tool_calls":
|
|
758
|
-
return "toolUse";
|
|
759
|
-
case "content_filter":
|
|
760
|
-
return "error";
|
|
761
|
-
default: {
|
|
762
|
-
const _exhaustive = reason;
|
|
763
|
-
throw new Error(`Unhandled stop reason: ${_exhaustive}`);
|
|
764
|
-
}
|
|
765
|
-
}
|
|
766
|
-
}
|
|
767
|
-
/**
|
|
768
|
-
* Detect compatibility settings from provider and baseUrl for known providers.
|
|
769
|
-
* Provider takes precedence over URL-based detection since it's explicitly configured.
|
|
770
|
-
*/
|
|
771
|
-
function deriveCompatFromProvider(model) {
|
|
772
|
-
const provider = model.provider;
|
|
773
|
-
const baseUrl = model.baseUrl;
|
|
774
|
-
const isZai = provider === "zai" || baseUrl.includes("api.z.ai");
|
|
775
|
-
const isMistral = provider === "mistral" || baseUrl.includes("mistral.ai");
|
|
776
|
-
const isGrok = provider === "xai" || baseUrl.includes("api.x.ai");
|
|
777
|
-
const isSarvam = provider === "sarvam" || baseUrl.includes("api.sarvam.ai");
|
|
778
|
-
const isKrutrim = provider === "krutrim" || baseUrl.includes("cloud.olakrutrim.com");
|
|
779
|
-
const isNonStandardProvider = provider === "cerebras" ||
|
|
780
|
-
baseUrl.includes("cerebras.ai") ||
|
|
781
|
-
provider === "xai" ||
|
|
782
|
-
baseUrl.includes("api.x.ai") ||
|
|
783
|
-
isMistral ||
|
|
784
|
-
baseUrl.includes("chutes.ai") ||
|
|
785
|
-
isZai ||
|
|
786
|
-
provider === "opencode" ||
|
|
787
|
-
baseUrl.includes("opencode.ai") ||
|
|
788
|
-
isSarvam ||
|
|
789
|
-
isKrutrim;
|
|
790
|
-
const useLegacyMaxTokensField = isMistral || baseUrl.includes("chutes.ai") || isSarvam || isKrutrim;
|
|
791
|
-
return {
|
|
792
|
-
supportsStore: !isNonStandardProvider,
|
|
793
|
-
supportsDeveloperRole: !isNonStandardProvider,
|
|
794
|
-
supportsReasoningEffort: !isGrok && !isZai,
|
|
795
|
-
supportsUsageInStreaming: !isSarvam && !isKrutrim,
|
|
796
|
-
maxTokensField: useLegacyMaxTokensField ? "max_tokens" : "max_completion_tokens",
|
|
797
|
-
requiresToolResultName: isMistral,
|
|
798
|
-
requiresAssistantAfterToolResult: false,
|
|
799
|
-
requiresThinkingAsText: isMistral,
|
|
800
|
-
requiresMistralToolIds: isMistral,
|
|
801
|
-
thinkingFormat: isZai ? "zai" : "openai",
|
|
802
|
-
openRouterRouting: {},
|
|
803
|
-
};
|
|
804
|
-
}
|
|
805
|
-
function overlayCompatOverrides(base, overrides) {
|
|
806
|
-
if (!overrides) {
|
|
807
|
-
return base;
|
|
808
|
-
}
|
|
809
|
-
return {
|
|
810
|
-
supportsStore: overrides.supportsStore ?? base.supportsStore,
|
|
811
|
-
supportsDeveloperRole: overrides.supportsDeveloperRole ?? base.supportsDeveloperRole,
|
|
812
|
-
supportsReasoningEffort: overrides.supportsReasoningEffort ?? base.supportsReasoningEffort,
|
|
813
|
-
supportsUsageInStreaming: overrides.supportsUsageInStreaming ?? base.supportsUsageInStreaming,
|
|
814
|
-
maxTokensField: overrides.maxTokensField ?? base.maxTokensField,
|
|
815
|
-
requiresToolResultName: overrides.requiresToolResultName ?? base.requiresToolResultName,
|
|
816
|
-
requiresAssistantAfterToolResult: overrides.requiresAssistantAfterToolResult ?? base.requiresAssistantAfterToolResult,
|
|
817
|
-
requiresThinkingAsText: overrides.requiresThinkingAsText ?? base.requiresThinkingAsText,
|
|
818
|
-
requiresMistralToolIds: overrides.requiresMistralToolIds ?? base.requiresMistralToolIds,
|
|
819
|
-
thinkingFormat: overrides.thinkingFormat ?? base.thinkingFormat,
|
|
820
|
-
openRouterRouting: overrides.openRouterRouting ?? {},
|
|
821
|
-
};
|
|
822
|
-
}
|
|
823
|
-
/**
|
|
824
|
-
* Get resolved compatibility settings for a model.
|
|
825
|
-
* Uses explicit model.compat if provided, otherwise auto-detects from provider/URL.
|
|
826
|
-
*/
|
|
827
|
-
function getCompat(model) {
|
|
828
|
-
const derived = deriveCompatFromProvider(model);
|
|
829
|
-
return overlayCompatOverrides(derived, model.compat);
|
|
830
|
-
}
|
|
831
|
-
//# sourceMappingURL=openai-completions.js.map
|