indusagi 0.13.5 → 0.13.7
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/LICENSE +661 -0
- package/README.md +7 -1
- package/dist/cli.js +114 -23
- package/package.json +56 -45
- package/dist/agent.js +0 -28713
- package/dist/ai.js +0 -19964
- package/dist/capabilities.js +0 -2730
- package/dist/connectors-saas.js +0 -3355
- package/dist/index.js +0 -16644
- package/dist/interop.js +0 -3247
- package/dist/knowledge/guides/authoring-an-agent.md +0 -53
- package/dist/knowledge/guides/choosing-tools.md +0 -49
- package/dist/knowledge/guides/model-selection.md +0 -51
- package/dist/knowledge/guides/writing-system-prompts.md +0 -53
- package/dist/knowledge/index.ts +0 -19
- package/dist/knowledge/loader.ts +0 -200
- package/dist/knowledge/manifest.json +0 -29
- package/dist/llmgateway.js +0 -3243
- package/dist/mcp.js +0 -1639
- package/dist/memory.js +0 -0
- package/dist/react-host/index.js +0 -101
- package/dist/react-host/ink.js +0 -97
- package/dist/react-host/jsx-runtime.js +0 -95
- package/dist/react-ink.js +0 -3834
- package/dist/runtime.js +0 -4421
- package/dist/shell-app.js +0 -12333
- package/dist/smithy.js +0 -8033
- package/dist/swarm.js +0 -8818
- package/dist/tracing.js +0 -724
- package/dist/tui.js +0 -2213
- package/dist/types/capabilities/backends/index.d.ts +0 -10
- package/dist/types/capabilities/backends/node-backends.d.ts +0 -30
- package/dist/types/capabilities/capabilities.test.d.ts +0 -14
- package/dist/types/capabilities/files/diff.d.ts +0 -49
- package/dist/types/capabilities/files/edit.d.ts +0 -21
- package/dist/types/capabilities/files/ls.d.ts +0 -16
- package/dist/types/capabilities/files/read-state-gate.d.ts +0 -69
- package/dist/types/capabilities/files/read-state-gate.test.d.ts +0 -14
- package/dist/types/capabilities/files/read.d.ts +0 -15
- package/dist/types/capabilities/files/write.d.ts +0 -16
- package/dist/types/capabilities/index.d.ts +0 -29
- package/dist/types/capabilities/kernel/backends.d.ts +0 -119
- package/dist/types/capabilities/kernel/context.d.ts +0 -52
- package/dist/types/capabilities/kernel/index.d.ts +0 -24
- package/dist/types/capabilities/kernel/output.d.ts +0 -40
- package/dist/types/capabilities/kernel/registry.d.ts +0 -61
- package/dist/types/capabilities/kernel/spec.d.ts +0 -168
- package/dist/types/capabilities/planning/todo.d.ts +0 -62
- package/dist/types/capabilities/registry.d.ts +0 -44
- package/dist/types/capabilities/search/find.d.ts +0 -33
- package/dist/types/capabilities/search/grep.d.ts +0 -30
- package/dist/types/capabilities/shell/bash.d.ts +0 -18
- package/dist/types/capabilities/shell/process.d.ts +0 -33
- package/dist/types/capabilities/web/webfetch.d.ts +0 -25
- package/dist/types/capabilities/web/websearch.d.ts +0 -23
- package/dist/types/connectors-saas/connectors-saas.test.d.ts +0 -12
- package/dist/types/connectors-saas/index.d.ts +0 -16
- package/dist/types/connectors-saas/saas/adapter/composio-backend.d.ts +0 -60
- package/dist/types/connectors-saas/saas/control/connect.d.ts +0 -114
- package/dist/types/connectors-saas/saas/control/tools.d.ts +0 -67
- package/dist/types/connectors-saas/saas/core/builder.d.ts +0 -86
- package/dist/types/connectors-saas/saas/core/cache.d.ts +0 -53
- package/dist/types/connectors-saas/saas/core/index.d.ts +0 -14
- package/dist/types/connectors-saas/saas/core/port.d.ts +0 -157
- package/dist/types/connectors-saas/saas/core/scope-planner.d.ts +0 -74
- package/dist/types/connectors-saas/saas/gateway.d.ts +0 -133
- package/dist/types/connectors-saas/saas/render/format.d.ts +0 -54
- package/dist/types/connectors-saas/saas/render/index.d.ts +0 -19
- package/dist/types/connectors-saas/saas/render/summarizers.d.ts +0 -58
- package/dist/types/facade/agent.d.ts +0 -1
- package/dist/types/facade/ai.d.ts +0 -1
- package/dist/types/facade/bot/actions/bash.d.ts +0 -71
- package/dist/types/facade/bot/actions/bash.test.d.ts +0 -1
- package/dist/types/facade/bot/actions/checkpoint.d.ts +0 -49
- package/dist/types/facade/bot/actions/checkpoint.test.d.ts +0 -1
- package/dist/types/facade/bot/actions/composio/accounts.d.ts +0 -22
- package/dist/types/facade/bot/actions/composio/client.d.ts +0 -39
- package/dist/types/facade/bot/actions/composio/connect.d.ts +0 -19
- package/dist/types/facade/bot/actions/composio/enable.d.ts +0 -25
- package/dist/types/facade/bot/actions/composio/execute.d.ts +0 -26
- package/dist/types/facade/bot/actions/composio/helpers.d.ts +0 -16
- package/dist/types/facade/bot/actions/composio/index.d.ts +0 -9
- package/dist/types/facade/bot/actions/composio/provider.d.ts +0 -8
- package/dist/types/facade/bot/actions/composio/toolkits.d.ts +0 -22
- package/dist/types/facade/bot/actions/composio/tools.d.ts +0 -28
- package/dist/types/facade/bot/actions/composio/types.d.ts +0 -137
- package/dist/types/facade/bot/actions/crew/activity-tracker.d.ts +0 -65
- package/dist/types/facade/bot/actions/crew/cleanup.d.ts +0 -50
- package/dist/types/facade/bot/actions/crew/fs-lock.d.ts +0 -11
- package/dist/types/facade/bot/actions/crew/index.d.ts +0 -11
- package/dist/types/facade/bot/actions/crew/mailbox.d.ts +0 -20
- package/dist/types/facade/bot/actions/crew/model-policy.d.ts +0 -22
- package/dist/types/facade/bot/actions/crew/names.d.ts +0 -27
- package/dist/types/facade/bot/actions/crew/protocol.d.ts +0 -74
- package/dist/types/facade/bot/actions/crew/task-store.d.ts +0 -88
- package/dist/types/facade/bot/actions/crew/team-attach-claim.d.ts +0 -35
- package/dist/types/facade/bot/actions/crew/team-config.d.ts +0 -54
- package/dist/types/facade/bot/actions/crew/worktree.d.ts +0 -39
- package/dist/types/facade/bot/actions/edit-diff.d.ts +0 -66
- package/dist/types/facade/bot/actions/edit-utils.d.ts +0 -86
- package/dist/types/facade/bot/actions/edit.d.ts +0 -59
- package/dist/types/facade/bot/actions/edit.test.d.ts +0 -1
- package/dist/types/facade/bot/actions/find.d.ts +0 -27
- package/dist/types/facade/bot/actions/find.test.d.ts +0 -1
- package/dist/types/facade/bot/actions/grep.d.ts +0 -53
- package/dist/types/facade/bot/actions/grep.test.d.ts +0 -1
- package/dist/types/facade/bot/actions/index.d.ts +0 -316
- package/dist/types/facade/bot/actions/kit/hook-runner.d.ts +0 -12
- package/dist/types/facade/bot/actions/kit/image-resize.d.ts +0 -19
- package/dist/types/facade/bot/actions/kit/mime.d.ts +0 -1
- package/dist/types/facade/bot/actions/kit/shell.d.ts +0 -12
- package/dist/types/facade/bot/actions/ls.d.ts +0 -41
- package/dist/types/facade/bot/actions/path-utils.d.ts +0 -8
- package/dist/types/facade/bot/actions/process-controller.d.ts +0 -14
- package/dist/types/facade/bot/actions/process-manager.d.ts +0 -59
- package/dist/types/facade/bot/actions/process-types.d.ts +0 -73
- package/dist/types/facade/bot/actions/process.d.ts +0 -37
- package/dist/types/facade/bot/actions/read-state.d.ts +0 -83
- package/dist/types/facade/bot/actions/read-state.test.d.ts +0 -1
- package/dist/types/facade/bot/actions/read.d.ts +0 -43
- package/dist/types/facade/bot/actions/read.test.d.ts +0 -1
- package/dist/types/facade/bot/actions/registry.d.ts +0 -20
- package/dist/types/facade/bot/actions/sandbox-backend.d.ts +0 -99
- package/dist/types/facade/bot/actions/sandbox-backend.test.d.ts +0 -1
- package/dist/types/facade/bot/actions/todo-store.d.ts +0 -76
- package/dist/types/facade/bot/actions/todo-types.d.ts +0 -72
- package/dist/types/facade/bot/actions/todo.d.ts +0 -76
- package/dist/types/facade/bot/actions/truncate.d.ts +0 -78
- package/dist/types/facade/bot/actions/webfetch.d.ts +0 -35
- package/dist/types/facade/bot/actions/websearch.d.ts +0 -37
- package/dist/types/facade/bot/actions/websearch.test.d.ts +0 -1
- package/dist/types/facade/bot/actions/write.d.ts +0 -45
- package/dist/types/facade/bot/agent-loop.d.ts +0 -30
- package/dist/types/facade/bot/agent-loop.test.d.ts +0 -1
- package/dist/types/facade/bot/agent.d.ts +0 -140
- package/dist/types/facade/bot/error-handler.d.ts +0 -7
- package/dist/types/facade/bot/event-bus.d.ts +0 -8
- package/dist/types/facade/bot/index.d.ts +0 -7
- package/dist/types/facade/bot/messages.d.ts +0 -83
- package/dist/types/facade/bot/permission-gate.test.d.ts +0 -1
- package/dist/types/facade/bot/proxy.d.ts +0 -70
- package/dist/types/facade/bot/session-manager.d.ts +0 -409
- package/dist/types/facade/bot/state-manager.d.ts +0 -21
- package/dist/types/facade/bot/telemetry.d.ts +0 -6
- package/dist/types/facade/bot/types.d.ts +0 -267
- package/dist/types/facade/mcp-core/client-pool.d.ts +0 -105
- package/dist/types/facade/mcp-core/client.d.ts +0 -213
- package/dist/types/facade/mcp-core/client.test.d.ts +0 -18
- package/dist/types/facade/mcp-core/config.d.ts +0 -60
- package/dist/types/facade/mcp-core/errors.d.ts +0 -103
- package/dist/types/facade/mcp-core/index.d.ts +0 -55
- package/dist/types/facade/mcp-core/schema-converter.d.ts +0 -67
- package/dist/types/facade/mcp-core/server.d.ts +0 -110
- package/dist/types/facade/mcp-core/tool-factory.d.ts +0 -62
- package/dist/types/facade/mcp-core/types.d.ts +0 -298
- package/dist/types/facade/mcp.d.ts +0 -1
- package/dist/types/facade/memory.d.ts +0 -1
- package/dist/types/facade/ml/adapters/amazon-bedrock.d.ts +0 -32
- package/dist/types/facade/ml/adapters/anthropic-retry.test.d.ts +0 -1
- package/dist/types/facade/ml/adapters/anthropic.d.ts +0 -78
- package/dist/types/facade/ml/adapters/azure-openai-responses.d.ts +0 -14
- package/dist/types/facade/ml/adapters/google-shared.d.ts +0 -99
- package/dist/types/facade/ml/adapters/google-vertex.d.ts +0 -14
- package/dist/types/facade/ml/adapters/google.d.ts +0 -15
- package/dist/types/facade/ml/adapters/kimi.d.ts +0 -21
- package/dist/types/facade/ml/adapters/mock.d.ts +0 -9
- package/dist/types/facade/ml/adapters/nvidia.d.ts +0 -12
- package/dist/types/facade/ml/adapters/openai-codex-responses.d.ts +0 -8
- package/dist/types/facade/ml/adapters/openai-completions.d.ts +0 -24
- package/dist/types/facade/ml/adapters/openai-responses-shared.d.ts +0 -25
- package/dist/types/facade/ml/adapters/openai-responses.d.ts +0 -12
- package/dist/types/facade/ml/adapters/openai-scaffold.d.ts +0 -3
- package/dist/types/facade/ml/adapters/register-builtins.d.ts +0 -2
- package/dist/types/facade/ml/adapters/simple-options.d.ts +0 -39
- package/dist/types/facade/ml/adapters/simple-options.test.d.ts +0 -1
- package/dist/types/facade/ml/adapters/transform-messages.d.ts +0 -23
- package/dist/types/facade/ml/api-registry.d.ts +0 -49
- package/dist/types/facade/ml/cli.d.ts +0 -2
- package/dist/types/facade/ml/env-api-keys.d.ts +0 -19
- package/dist/types/facade/ml/index.d.ts +0 -27
- package/dist/types/facade/ml/kit/auth/anthropic.d.ts +0 -17
- package/dist/types/facade/ml/kit/auth/github-copilot.d.ts +0 -22
- package/dist/types/facade/ml/kit/auth/index.d.ts +0 -50
- package/dist/types/facade/ml/kit/auth/kimi.d.ts +0 -23
- package/dist/types/facade/ml/kit/auth/oauth-page.d.ts +0 -2
- package/dist/types/facade/ml/kit/auth/openai-codex.d.ts +0 -36
- package/dist/types/facade/ml/kit/auth/pkce.d.ts +0 -12
- package/dist/types/facade/ml/kit/auth/types.d.ts +0 -67
- package/dist/types/facade/ml/kit/base-stream-handler.d.ts +0 -30
- package/dist/types/facade/ml/kit/event-stream.d.ts +0 -63
- package/dist/types/facade/ml/kit/index.d.ts +0 -14
- package/dist/types/facade/ml/kit/json-parse.d.ts +0 -23
- package/dist/types/facade/ml/kit/message-transform.d.ts +0 -32
- package/dist/types/facade/ml/kit/output-factory.d.ts +0 -8
- package/dist/types/facade/ml/kit/overflow.d.ts +0 -9
- package/dist/types/facade/ml/kit/provider-adapter.d.ts +0 -56
- package/dist/types/facade/ml/kit/provider-client-builder.d.ts +0 -36
- package/dist/types/facade/ml/kit/provider-consolidation.d.ts +0 -3
- package/dist/types/facade/ml/kit/provider-constants.d.ts +0 -34
- package/dist/types/facade/ml/kit/provider-errors.d.ts +0 -52
- package/dist/types/facade/ml/kit/sanitize-unicode.d.ts +0 -2
- package/dist/types/facade/ml/kit/stream-event-helper.d.ts +0 -38
- package/dist/types/facade/ml/kit/stream-handler-types.d.ts +0 -46
- package/dist/types/facade/ml/kit/streaming-state-manager.d.ts +0 -42
- package/dist/types/facade/ml/kit/tool-converter.d.ts +0 -49
- package/dist/types/facade/ml/kit/typebox-helpers.d.ts +0 -24
- package/dist/types/facade/ml/kit/validation.d.ts +0 -26
- package/dist/types/facade/ml/models.d.ts +0 -41
- package/dist/types/facade/ml/models.generated.d.ts +0 -12405
- package/dist/types/facade/ml/stream.d.ts +0 -27
- package/dist/types/facade/ml/types.d.ts +0 -269
- package/dist/types/index.d.ts +0 -16
- package/dist/types/interop/index.d.ts +0 -12
- package/dist/types/interop/interop.test.d.ts +0 -19
- package/dist/types/interop/protocol-bridge/bridge.d.ts +0 -52
- package/dist/types/interop/protocol-bridge/contract.d.ts +0 -249
- package/dist/types/interop/protocol-bridge/endpoint.d.ts +0 -124
- package/dist/types/interop/protocol-bridge/fleet.d.ts +0 -92
- package/dist/types/interop/protocol-bridge/host.d.ts +0 -61
- package/dist/types/interop/protocol-bridge/index.d.ts +0 -16
- package/dist/types/interop/protocol-bridge/schema.d.ts +0 -29
- package/dist/types/llmgateway/catalog/cards.d.ts +0 -18
- package/dist/types/llmgateway/catalog/cost.d.ts +0 -15
- package/dist/types/llmgateway/catalog/index.d.ts +0 -7
- package/dist/types/llmgateway/catalog/query.d.ts +0 -40
- package/dist/types/llmgateway/connectors/anthropic.d.ts +0 -35
- package/dist/types/llmgateway/connectors/azure-openai.d.ts +0 -33
- package/dist/types/llmgateway/connectors/bedrock.d.ts +0 -113
- package/dist/types/llmgateway/connectors/google-vertex.d.ts +0 -38
- package/dist/types/llmgateway/connectors/google.d.ts +0 -40
- package/dist/types/llmgateway/connectors/index.d.ts +0 -26
- package/dist/types/llmgateway/connectors/kimi.d.ts +0 -28
- package/dist/types/llmgateway/connectors/mock.d.ts +0 -37
- package/dist/types/llmgateway/connectors/nvidia.d.ts +0 -27
- package/dist/types/llmgateway/connectors/ollama.d.ts +0 -45
- package/dist/types/llmgateway/connectors/openai-chat.d.ts +0 -25
- package/dist/types/llmgateway/connectors/openai-responses.d.ts +0 -49
- package/dist/types/llmgateway/contract/connector.d.ts +0 -32
- package/dist/types/llmgateway/contract/conversation.d.ts +0 -86
- package/dist/types/llmgateway/contract/emission.d.ts +0 -55
- package/dist/types/llmgateway/contract/errors.d.ts +0 -27
- package/dist/types/llmgateway/contract/index.d.ts +0 -13
- package/dist/types/llmgateway/contract/model-card.d.ts +0 -42
- package/dist/types/llmgateway/contract/options.d.ts +0 -31
- package/dist/types/llmgateway/contract/reply.d.ts +0 -33
- package/dist/types/llmgateway/conversion/index.d.ts +0 -10
- package/dist/types/llmgateway/conversion/mappers.d.ts +0 -65
- package/dist/types/llmgateway/conversion/openai-compatible.d.ts +0 -46
- package/dist/types/llmgateway/conversion/reduce.d.ts +0 -20
- package/dist/types/llmgateway/credentials/oauth.d.ts +0 -73
- package/dist/types/llmgateway/credentials/pkce.d.ts +0 -52
- package/dist/types/llmgateway/credentials/secrets.d.ts +0 -74
- package/dist/types/llmgateway/gateway.d.ts +0 -34
- package/dist/types/llmgateway/gateway.test.d.ts +0 -14
- package/dist/types/llmgateway/index.d.ts +0 -11
- package/dist/types/llmgateway/streaming/channel.d.ts +0 -24
- package/dist/types/llmgateway/streaming/index.d.ts +0 -10
- package/dist/types/llmgateway/streaming/ndjson.d.ts +0 -17
- package/dist/types/llmgateway/streaming/sse.d.ts +0 -31
- package/dist/types/react-host/index.d.ts +0 -9
- package/dist/types/react-host/ink.d.ts +0 -5
- package/dist/types/react-host/jsx-runtime.d.ts +0 -4
- package/dist/types/react-host/loader.d.ts +0 -3
- package/dist/types/react-ink/components/ChangelogBlock.d.ts +0 -8
- package/dist/types/react-ink/components/DisplayBlockView.d.ts +0 -8
- package/dist/types/react-ink/components/Footer.d.ts +0 -11
- package/dist/types/react-ink/components/MessageList.d.ts +0 -14
- package/dist/types/react-ink/components/MessageRow.d.ts +0 -13
- package/dist/types/react-ink/components/StatusLine.d.ts +0 -18
- package/dist/types/react-ink/components/TaskPanel.d.ts +0 -11
- package/dist/types/react-ink/components/ToolEventBlock.d.ts +0 -48
- package/dist/types/react-ink/components/ToolEventBlock.test.d.ts +0 -1
- package/dist/types/react-ink/components/dialogs/DialogFrame.d.ts +0 -8
- package/dist/types/react-ink/components/dialogs/LoginDialog.d.ts +0 -14
- package/dist/types/react-ink/components/dialogs/ModelDialog.d.ts +0 -9
- package/dist/types/react-ink/components/dialogs/OAuthDialog.d.ts +0 -9
- package/dist/types/react-ink/components/dialogs/ScopedModelsDialog.d.ts +0 -9
- package/dist/types/react-ink/components/dialogs/SelectableDialog.d.ts +0 -22
- package/dist/types/react-ink/components/dialogs/SessionDialog.d.ts +0 -13
- package/dist/types/react-ink/components/dialogs/SettingsDialog.d.ts +0 -14
- package/dist/types/react-ink/components/dialogs/StartupSessionPicker.d.ts +0 -9
- package/dist/types/react-ink/components/dialogs/ThemeDialog.d.ts +0 -26
- package/dist/types/react-ink/components/dialogs/TreeDialog.d.ts +0 -8
- package/dist/types/react-ink/components/dialogs/UserMessageDialog.d.ts +0 -8
- package/dist/types/react-ink/components/messages/AssistantMessage.d.ts +0 -12
- package/dist/types/react-ink/components/messages/BashMessage.d.ts +0 -8
- package/dist/types/react-ink/components/messages/BranchSummaryMessage.d.ts +0 -8
- package/dist/types/react-ink/components/messages/CompactionMessage.d.ts +0 -8
- package/dist/types/react-ink/components/messages/CustomMessage.d.ts +0 -9
- package/dist/types/react-ink/components/messages/SkillInvocationMessage.d.ts +0 -7
- package/dist/types/react-ink/components/messages/ToolCallMessage.d.ts +0 -8
- package/dist/types/react-ink/components/messages/ToolResultBlock.d.ts +0 -12
- package/dist/types/react-ink/components/messages/UserMessage.d.ts +0 -9
- package/dist/types/react-ink/diff/Diff.d.ts +0 -22
- package/dist/types/react-ink/diff/diff.test.d.ts +0 -1
- package/dist/types/react-ink/diff/structured.d.ts +0 -41
- package/dist/types/react-ink/diff/word-diff.d.ts +0 -27
- package/dist/types/react-ink/index.d.ts +0 -42
- package/dist/types/react-ink/markdown/Markdown.d.ts +0 -23
- package/dist/types/react-ink/markdown/MarkdownTable.d.ts +0 -19
- package/dist/types/react-ink/markdown/StreamingMarkdown.d.ts +0 -34
- package/dist/types/react-ink/markdown/format-token.d.ts +0 -39
- package/dist/types/react-ink/markdown/highlight.d.ts +0 -31
- package/dist/types/react-ink/theme-adapter.d.ts +0 -66
- package/dist/types/react-ink/types.d.ts +0 -133
- package/dist/types/react-ink/utils/message-groups.d.ts +0 -25
- package/dist/types/react-ink/utils/selection-dialog.d.ts +0 -2
- package/dist/types/react-ink/utils/session-browser.d.ts +0 -27
- package/dist/types/react-ink/utils/tool-display.d.ts +0 -37
- package/dist/types/runtime/cadence/cadence.test.d.ts +0 -6
- package/dist/types/runtime/cadence/fold.d.ts +0 -48
- package/dist/types/runtime/cadence/index.d.ts +0 -12
- package/dist/types/runtime/cadence/reducer.d.ts +0 -44
- package/dist/types/runtime/conductor/agent.d.ts +0 -71
- package/dist/types/runtime/conductor/index.d.ts +0 -11
- package/dist/types/runtime/contract/config.d.ts +0 -44
- package/dist/types/runtime/contract/effect.d.ts +0 -41
- package/dist/types/runtime/contract/errors.d.ts +0 -22
- package/dist/types/runtime/contract/events.d.ts +0 -63
- package/dist/types/runtime/contract/index.d.ts +0 -18
- package/dist/types/runtime/contract/run-state.d.ts +0 -57
- package/dist/types/runtime/contract/session.d.ts +0 -42
- package/dist/types/runtime/contract/signal.d.ts +0 -49
- package/dist/types/runtime/contract/tools.d.ts +0 -45
- package/dist/types/runtime/dispatch/index.d.ts +0 -9
- package/dist/types/runtime/dispatch/scheduler.d.ts +0 -53
- package/dist/types/runtime/index.d.ts +0 -22
- package/dist/types/runtime/ledger/accumulator.d.ts +0 -44
- package/dist/types/runtime/ledger/bus.d.ts +0 -50
- package/dist/types/runtime/ledger/index.d.ts +0 -11
- package/dist/types/runtime/memory/compactor.d.ts +0 -56
- package/dist/types/runtime/memory/estimate.d.ts +0 -21
- package/dist/types/runtime/memory/index.d.ts +0 -8
- package/dist/types/runtime/runtime.test.d.ts +0 -15
- package/dist/types/runtime/store/dag.d.ts +0 -72
- package/dist/types/runtime/store/hash.d.ts +0 -18
- package/dist/types/runtime/store/index.d.ts +0 -12
- package/dist/types/runtime/store/persist.d.ts +0 -49
- package/dist/types/runtime/turn/driver.d.ts +0 -32
- package/dist/types/runtime/turn/index.d.ts +0 -8
- package/dist/types/runtime/wire/index.d.ts +0 -10
- package/dist/types/runtime/wire/projectors.d.ts +0 -53
- package/dist/types/shell-app/auth-cli/index.d.ts +0 -9
- package/dist/types/shell-app/auth-cli/oauth-cli.d.ts +0 -73
- package/dist/types/shell-app/boot/context.d.ts +0 -108
- package/dist/types/shell-app/boot/index.d.ts +0 -13
- package/dist/types/shell-app/boot/pipeline.d.ts +0 -66
- package/dist/types/shell-app/boot/stages.d.ts +0 -77
- package/dist/types/shell-app/cli.d.ts +0 -75
- package/dist/types/shell-app/config/index.d.ts +0 -11
- package/dist/types/shell-app/config/locator.d.ts +0 -85
- package/dist/types/shell-app/config/settings.d.ts +0 -91
- package/dist/types/shell-app/index.d.ts +0 -26
- package/dist/types/shell-app/invocation/flags.d.ts +0 -89
- package/dist/types/shell-app/invocation/parse.d.ts +0 -89
- package/dist/types/shell-app/locate/brand.d.ts +0 -71
- package/dist/types/shell-app/locate/index.d.ts +0 -12
- package/dist/types/shell-app/locate/locator.d.ts +0 -122
- package/dist/types/shell-app/runners/contract.d.ts +0 -116
- package/dist/types/shell-app/runners/index.d.ts +0 -15
- package/dist/types/shell-app/runners/one-shot.d.ts +0 -21
- package/dist/types/shell-app/runners/registry.d.ts +0 -34
- package/dist/types/shell-app/runners/repl.d.ts +0 -51
- package/dist/types/shell-app/runners/wire.d.ts +0 -34
- package/dist/types/shell-app/shell-app.test.d.ts +0 -14
- package/dist/types/shell-app/upgrade/index.d.ts +0 -9
- package/dist/types/shell-app/upgrade/upgrades.d.ts +0 -62
- package/dist/types/smithy/config/flag-reader.d.ts +0 -128
- package/dist/types/smithy/config/index.d.ts +0 -9
- package/dist/types/smithy/forge.d.ts +0 -135
- package/dist/types/smithy/index.d.ts +0 -36
- package/dist/types/smithy/knowledge/index.d.ts +0 -10
- package/dist/types/smithy/knowledge/loader.d.ts +0 -64
- package/dist/types/smithy/persona/blueprint.d.ts +0 -75
- package/dist/types/smithy/persona/define-agent.d.ts +0 -51
- package/dist/types/smithy/persona/index.d.ts +0 -14
- package/dist/types/smithy/persona/profiles.d.ts +0 -44
- package/dist/types/smithy/runtime/index.d.ts +0 -9
- package/dist/types/smithy/runtime/tool-ledger.d.ts +0 -130
- package/dist/types/smithy/smithy.test.d.ts +0 -20
- package/dist/types/smithy/ui/index.d.ts +0 -11
- package/dist/types/smithy/ui/transcript.d.ts +0 -183
- package/dist/types/swarm/coordinator.d.ts +0 -192
- package/dist/types/swarm/index.d.ts +0 -33
- package/dist/types/swarm/isolation/index.d.ts +0 -14
- package/dist/types/swarm/isolation/runner.d.ts +0 -61
- package/dist/types/swarm/isolation/worktree.d.ts +0 -142
- package/dist/types/swarm/kernel/faults.d.ts +0 -52
- package/dist/types/swarm/kernel/ids.d.ts +0 -25
- package/dist/types/swarm/kernel/index.d.ts +0 -26
- package/dist/types/swarm/kernel/json-cell.d.ts +0 -113
- package/dist/types/swarm/kernel/jsonl-log.d.ts +0 -81
- package/dist/types/swarm/postbox/channel.d.ts +0 -88
- package/dist/types/swarm/postbox/codecs.d.ts +0 -253
- package/dist/types/swarm/postbox/index.d.ts +0 -16
- package/dist/types/swarm/roster/index.d.ts +0 -16
- package/dist/types/swarm/roster/manifest.d.ts +0 -185
- package/dist/types/swarm/swarm.test.d.ts +0 -24
- package/dist/types/swarm/telemetry/activity.d.ts +0 -143
- package/dist/types/swarm/workboard/board.d.ts +0 -174
- package/dist/types/swarm/workboard/dep-graph.d.ts +0 -77
- package/dist/types/swarm/workboard/index.d.ts +0 -12
- package/dist/types/tracing/adapter/index.d.ts +0 -12
- package/dist/types/tracing/adapter/runtime-trace.d.ts +0 -54
- package/dist/types/tracing/channel/index.d.ts +0 -9
- package/dist/types/tracing/channel/signal.d.ts +0 -93
- package/dist/types/tracing/index.d.ts +0 -25
- package/dist/types/tracing/recorder/index.d.ts +0 -12
- package/dist/types/tracing/recorder/recorder.d.ts +0 -75
- package/dist/types/tracing/recorder/sampling.d.ts +0 -55
- package/dist/types/tracing/redaction/index.d.ts +0 -8
- package/dist/types/tracing/redaction/secret-scrubber.d.ts +0 -95
- package/dist/types/tracing/registry/hub.d.ts +0 -57
- package/dist/types/tracing/registry/index.d.ts +0 -7
- package/dist/types/tracing/signal/handle.d.ts +0 -73
- package/dist/types/tracing/signal/index.d.ts +0 -12
- package/dist/types/tracing/signal/segment.d.ts +0 -124
- package/dist/types/tracing/sinks/base.d.ts +0 -51
- package/dist/types/tracing/sinks/console.d.ts +0 -44
- package/dist/types/tracing/sinks/file.d.ts +0 -47
- package/dist/types/tracing/sinks/index.d.ts +0 -16
- package/dist/types/tracing/sinks/stream.d.ts +0 -46
- package/dist/types/tracing/tracing.test.d.ts +0 -7
- package/dist/types/ui/autocomplete.d.ts +0 -59
- package/dist/types/ui/contracts.d.ts +0 -38
- package/dist/types/ui/editor-component.d.ts +0 -100
- package/dist/types/ui/fuzzy.d.ts +0 -29
- package/dist/types/ui/index.d.ts +0 -8
- package/dist/types/ui/keybindings.d.ts +0 -62
- package/dist/types/ui/keys.d.ts +0 -171
- package/dist/types/ui/theme-types.d.ts +0 -36
- package/dist/types/ui/utils.d.ts +0 -101
- package/dist/types/ui-bridge/InteractiveApp.d.ts +0 -38
- package/dist/types/ui-bridge/adapter.d.ts +0 -90
- package/dist/types/ui-bridge/index.d.ts +0 -37
|
@@ -1,267 +0,0 @@
|
|
|
1
|
-
import type { AssistantMessageEvent, ImageContent, Message, Model, SimpleStreamOptions, streamSimple, TextContent, ThinkingContent, Tool, ToolCall, ToolResultMessage, UserMessage } from "../ml/index.js";
|
|
2
|
-
import type { Static, TSchema } from "@sinclair/typebox";
|
|
3
|
-
/** Streaming entry point; may resolve synchronously or via a Promise when config is fetched async. */
|
|
4
|
-
export type StreamFn = (...args: Parameters<typeof streamSimple>) => ReturnType<typeof streamSimple> | Promise<ReturnType<typeof streamSimple>>;
|
|
5
|
-
/**
|
|
6
|
-
* Reasoning effort tier requested from models that expose one.
|
|
7
|
-
* Heads up: the top "xhigh" tier is currently only honored by a few OpenAI
|
|
8
|
-
* frontier models; most providers cap out at "high".
|
|
9
|
-
*/
|
|
10
|
-
export type ThinkingLevel = "off" | "minimal" | "low" | "medium" | "high" | "xhigh";
|
|
11
|
-
/**
|
|
12
|
-
* Open extension point for application-defined message kinds.
|
|
13
|
-
* Downstream code adds its own kinds by merging this module's interface:
|
|
14
|
-
*
|
|
15
|
-
* @example
|
|
16
|
-
* ```typescript
|
|
17
|
-
* declare module "./types.js" {
|
|
18
|
-
* interface CustomAgentMessages {
|
|
19
|
-
* reminder: ReminderMessage;
|
|
20
|
-
* statusBanner: StatusBannerMessage;
|
|
21
|
-
* }
|
|
22
|
-
* }
|
|
23
|
-
* ```
|
|
24
|
-
*/
|
|
25
|
-
export interface CustomAgentMessages {
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* AgentMessage: every base LLM message plus any app-registered custom kinds.
|
|
29
|
-
* The indirection lets applications introduce their own message kinds without
|
|
30
|
-
* giving up type safety against the underlying LLM message shapes.
|
|
31
|
-
*/
|
|
32
|
-
export type AgentMessage = Message | CustomAgentMessages[keyof CustomAgentMessages];
|
|
33
|
-
export type AgentToolUpdateCallback<T = any> = (partialResult: AgentToolResult<T>) => void;
|
|
34
|
-
export interface AgentToolResult<T> {
|
|
35
|
-
content: (TextContent | ImageContent)[];
|
|
36
|
-
details: T;
|
|
37
|
-
isError?: boolean;
|
|
38
|
-
}
|
|
39
|
-
export interface AgentTool<TParameters extends TSchema = TSchema, TDetails = any> extends Tool<TParameters> {
|
|
40
|
-
label: string;
|
|
41
|
-
/**
|
|
42
|
-
* Marks a tool that only inspects state and never mutates it (read/ls/grep/
|
|
43
|
-
* find/websearch/webfetch/todoread). Hosts can lean on this to auto-allow
|
|
44
|
-
* such tools in a permission policy without re-deriving the read-only set by
|
|
45
|
-
* name. Optional and defaults to undefined → treated as "not known read-only".
|
|
46
|
-
*/
|
|
47
|
-
readOnly?: boolean;
|
|
48
|
-
execute: (toolCallId: string, params: Static<TParameters>, signal?: AbortSignal, onUpdate?: AgentToolUpdateCallback<TDetails>) => Promise<AgentToolResult<TDetails>>;
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* The verdict a {@link CanUseToolFn} returns for a single tool call.
|
|
52
|
-
*
|
|
53
|
-
* - `allow` proceeds with execution; an optional `updatedInput` replaces the
|
|
54
|
-
* validated arguments before the tool runs (e.g. a sanitized command).
|
|
55
|
-
* - `deny` short-circuits: the tool never executes and `message` is surfaced as
|
|
56
|
-
* an `isError` tool result so the model sees why it was blocked.
|
|
57
|
-
*/
|
|
58
|
-
export type PermissionDecision = {
|
|
59
|
-
behavior: "allow";
|
|
60
|
-
updatedInput?: unknown;
|
|
61
|
-
} | {
|
|
62
|
-
behavior: "deny";
|
|
63
|
-
message: string;
|
|
64
|
-
};
|
|
65
|
-
/**
|
|
66
|
-
* Hard permission gate consulted immediately before a tool executes. Hosts
|
|
67
|
-
* supply it to enforce an allow/ask/deny policy; the loop awaits it (passing the
|
|
68
|
-
* abort signal so a pending prompt can be cancelled) and acts on the verdict.
|
|
69
|
-
*
|
|
70
|
-
* Entirely optional — when omitted the loop allows every tool, preserving
|
|
71
|
-
* today's behavior.
|
|
72
|
-
*/
|
|
73
|
-
export type CanUseToolFn = (toolName: string, input: unknown, opts: {
|
|
74
|
-
signal?: AbortSignal;
|
|
75
|
-
}) => Promise<PermissionDecision>;
|
|
76
|
-
export interface AgentContext {
|
|
77
|
-
systemPrompt: string;
|
|
78
|
-
messages: AgentMessage[];
|
|
79
|
-
tools?: AgentTool<any>[];
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* The agent's full runtime state: configuration plus live conversation data.
|
|
83
|
-
*/
|
|
84
|
-
export interface AgentState {
|
|
85
|
-
systemPrompt: string;
|
|
86
|
-
model: Model<any>;
|
|
87
|
-
thinkingLevel: ThinkingLevel;
|
|
88
|
-
tools: AgentTool<any>[];
|
|
89
|
-
messages: AgentMessage[];
|
|
90
|
-
isStreaming: boolean;
|
|
91
|
-
streamMessage: AgentMessage | null;
|
|
92
|
-
pendingToolCalls: Set<string>;
|
|
93
|
-
error?: string;
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* Settings that drive a single agent loop run.
|
|
97
|
-
*/
|
|
98
|
-
export interface AgentLoopConfig extends SimpleStreamOptions {
|
|
99
|
-
model: Model<any>;
|
|
100
|
-
/**
|
|
101
|
-
* Maps the AgentMessage[] down to a model-ready Message[] ahead of every model call.
|
|
102
|
-
*
|
|
103
|
-
* Every AgentMessage has to become a UserMessage, AssistantMessage, or
|
|
104
|
-
* ToolResultMessage. Anything the model shouldn't see (UI-only notices,
|
|
105
|
-
* status entries, and so on) is simply dropped here.
|
|
106
|
-
*
|
|
107
|
-
* @example
|
|
108
|
-
* ```typescript
|
|
109
|
-
* const flatten = (history: AgentMessage[]): Message[] =>
|
|
110
|
-
* history.flatMap((entry) => {
|
|
111
|
-
* // A bespoke kind gets restated as ordinary user text.
|
|
112
|
-
* if (entry.role === "todo") {
|
|
113
|
-
* return [{ role: "user", content: entry.content, timestamp: entry.timestamp }];
|
|
114
|
-
* }
|
|
115
|
-
* // Purely visual entries are withheld from the model.
|
|
116
|
-
* if (entry.role === "diagnostic") {
|
|
117
|
-
* return [];
|
|
118
|
-
* }
|
|
119
|
-
* // Everything else is already model-shaped, so pass it straight through.
|
|
120
|
-
* return [entry];
|
|
121
|
-
* });
|
|
122
|
-
* ```
|
|
123
|
-
*/
|
|
124
|
-
convertToLlm: (messages: AgentMessage[]) => Message[] | Promise<Message[]>;
|
|
125
|
-
/**
|
|
126
|
-
* Optional hook that reshapes the context while it is still AgentMessages,
|
|
127
|
-
* i.e. before `convertToLlm` runs.
|
|
128
|
-
*
|
|
129
|
-
* Good fit for work that has to happen at the AgentMessage layer:
|
|
130
|
-
* - keeping the context window in check (trimming older entries)
|
|
131
|
-
* - pulling in extra context from elsewhere
|
|
132
|
-
*
|
|
133
|
-
* @example
|
|
134
|
-
* ```typescript
|
|
135
|
-
* const reshape = async (history: AgentMessage[]): Promise<AgentMessage[]> => {
|
|
136
|
-
* const spent = await tallyTokens(history);
|
|
137
|
-
* if (spent <= windowLimit) {
|
|
138
|
-
* return history;
|
|
139
|
-
* }
|
|
140
|
-
* return trimFromFront(history, windowLimit);
|
|
141
|
-
* };
|
|
142
|
-
* ```
|
|
143
|
-
*/
|
|
144
|
-
transformContext?: (messages: AgentMessage[], signal?: AbortSignal) => Promise<AgentMessage[]>;
|
|
145
|
-
/**
|
|
146
|
-
* Supplies a fresh API key per model call.
|
|
147
|
-
*
|
|
148
|
-
* Handy when the credential is a short-lived OAuth token that can lapse
|
|
149
|
-
* while a slow stretch of tool calls is still running.
|
|
150
|
-
*/
|
|
151
|
-
getApiKey?: (provider: string) => Promise<string | undefined> | string | undefined;
|
|
152
|
-
/**
|
|
153
|
-
* Hard permission gate consulted right before each tool executes. When set,
|
|
154
|
-
* the loop awaits it with the tool name and its VALIDATED arguments; a `deny`
|
|
155
|
-
* verdict short-circuits to an `isError` tool result (the tool never runs),
|
|
156
|
-
* while an `allow` verdict proceeds — substituting `updatedInput` when given.
|
|
157
|
-
*
|
|
158
|
-
* Omit it to allow every tool, i.e. exactly today's behavior.
|
|
159
|
-
*/
|
|
160
|
-
canUseTool?: CanUseToolFn;
|
|
161
|
-
/**
|
|
162
|
-
* Yields steering messages to splice into the run while it is in flight.
|
|
163
|
-
*
|
|
164
|
-
* Consulted after each tool finishes to pick up user interruptions. When it
|
|
165
|
-
* hands back messages, any still-pending tool calls are abandoned and those
|
|
166
|
-
* messages join the context before the next model call.
|
|
167
|
-
*
|
|
168
|
-
* This is the channel for nudging the agent mid-task.
|
|
169
|
-
*/
|
|
170
|
-
getSteeringMessages?: () => Promise<AgentMessage[]>;
|
|
171
|
-
/**
|
|
172
|
-
* Yields follow-up messages to handle once the agent is otherwise done.
|
|
173
|
-
*
|
|
174
|
-
* Consulted when there are no remaining tool calls and no steering input.
|
|
175
|
-
* Returning messages appends them and pushes the agent into another turn.
|
|
176
|
-
*
|
|
177
|
-
* Use it for input that should wait until the current work wraps up.
|
|
178
|
-
*/
|
|
179
|
-
getFollowUpMessages?: () => Promise<AgentMessage[]>;
|
|
180
|
-
/**
|
|
181
|
-
* Names of tools that are safe to run concurrently because they only read
|
|
182
|
-
* (never mutate) state. Consecutive runs of such calls within one assistant
|
|
183
|
-
* turn are dispatched in parallel (bounded by {@link maxToolConcurrency});
|
|
184
|
-
* everything else still runs one-at-a-time in request order.
|
|
185
|
-
*
|
|
186
|
-
* When omitted the loop falls back to a conservative built-in set
|
|
187
|
-
* (`read`/`ls`/`grep`/`find`/`websearch`/`webfetch`/`todoread`). Tools that
|
|
188
|
-
* aren't on the list — including dynamic/MCP/composio tools — always run
|
|
189
|
-
* serially, preserving today's behavior.
|
|
190
|
-
*/
|
|
191
|
-
readOnlyToolNames?: ReadonlySet<string>;
|
|
192
|
-
/**
|
|
193
|
-
* Upper bound on how many read-only tool calls run at once. Defaults to the
|
|
194
|
-
* `CLAUDE_CODE_MAX_TOOL_USE_CONCURRENCY` / `INDUS_MAX_TOOL_CONCURRENCY`
|
|
195
|
-
* environment override, or 10. Set to 1 to force fully-sequential dispatch.
|
|
196
|
-
*/
|
|
197
|
-
maxToolConcurrency?: number;
|
|
198
|
-
}
|
|
199
|
-
type AgentLifecycleEvent = {
|
|
200
|
-
type: "agent_start";
|
|
201
|
-
} | {
|
|
202
|
-
type: "agent_end";
|
|
203
|
-
messages: AgentMessage[];
|
|
204
|
-
};
|
|
205
|
-
type TurnEvent = {
|
|
206
|
-
type: "turn_start";
|
|
207
|
-
} | {
|
|
208
|
-
type: "turn_end";
|
|
209
|
-
message: AgentMessage;
|
|
210
|
-
toolResults: ToolResultMessage[];
|
|
211
|
-
};
|
|
212
|
-
type MessageEvent = {
|
|
213
|
-
type: "message_start";
|
|
214
|
-
message: AgentMessage;
|
|
215
|
-
} | {
|
|
216
|
-
type: "message_update";
|
|
217
|
-
message: AgentMessage;
|
|
218
|
-
assistantMessageEvent: AssistantMessageEvent;
|
|
219
|
-
} | {
|
|
220
|
-
type: "message_end";
|
|
221
|
-
message: AgentMessage;
|
|
222
|
-
};
|
|
223
|
-
type ToolExecutionEvent = {
|
|
224
|
-
type: "tool_execution_start";
|
|
225
|
-
toolCallId: string;
|
|
226
|
-
toolName: string;
|
|
227
|
-
args: any;
|
|
228
|
-
} | {
|
|
229
|
-
type: "tool_execution_update";
|
|
230
|
-
toolCallId: string;
|
|
231
|
-
toolName: string;
|
|
232
|
-
args: any;
|
|
233
|
-
partialResult: any;
|
|
234
|
-
} | {
|
|
235
|
-
type: "tool_execution_end";
|
|
236
|
-
toolCallId: string;
|
|
237
|
-
toolName: string;
|
|
238
|
-
result: any;
|
|
239
|
-
isError: boolean;
|
|
240
|
-
};
|
|
241
|
-
/**
|
|
242
|
-
* The events the Agent streams out so a UI can stay in sync.
|
|
243
|
-
* They report granular lifecycle progress across messages, turns, and tool runs.
|
|
244
|
-
*/
|
|
245
|
-
export type AgentEvent = AgentLifecycleEvent | TurnEvent | MessageEvent | ToolExecutionEvent;
|
|
246
|
-
/** Grouping of the event-type strings, handy for filtering or logging. */
|
|
247
|
-
export declare const AGENT_EVENT_GROUPS: {
|
|
248
|
-
readonly agent: readonly ["agent_start", "agent_end"];
|
|
249
|
-
readonly turn: readonly ["turn_start", "turn_end"];
|
|
250
|
-
readonly message: readonly ["message_start", "message_update", "message_end"];
|
|
251
|
-
readonly toolExecution: readonly ["tool_execution_start", "tool_execution_update", "tool_execution_end"];
|
|
252
|
-
};
|
|
253
|
-
export type AgentEventType = AgentEvent["type"];
|
|
254
|
-
export type ExtractAgentEvent<TType extends AgentEventType> = Extract<AgentEvent, {
|
|
255
|
-
type: TType;
|
|
256
|
-
}>;
|
|
257
|
-
/**
|
|
258
|
-
* Decide at runtime whether a value matches one of the recognized AI message shapes.
|
|
259
|
-
*/
|
|
260
|
-
export declare function validateMessage(value: unknown): value is Message;
|
|
261
|
-
/** Narrows a value to a user message. */
|
|
262
|
-
export declare function isUserMessage(value: AgentMessage | unknown): value is UserMessage;
|
|
263
|
-
/** Narrows a value to a thinking block carried inside an assistant message. */
|
|
264
|
-
export declare function isThinking(value: unknown): value is ThinkingContent;
|
|
265
|
-
/** Narrows a value to a tool-call block carried inside an assistant message. */
|
|
266
|
-
export declare function isToolCall(value: unknown): value is ToolCall;
|
|
267
|
-
export {};
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MCP Client Pool
|
|
3
|
-
*
|
|
4
|
-
* Manages multiple MCP client connections.
|
|
5
|
-
* Provides centralized lifecycle management.
|
|
6
|
-
*
|
|
7
|
-
* Reference: MCP client configuration patterns.
|
|
8
|
-
*/
|
|
9
|
-
import { MCPClient } from "./client.js";
|
|
10
|
-
import type { MCPConnectionOptions, MCPToolDefinition, MCPResource, MCPPrompt } from "./types.js";
|
|
11
|
-
/**
|
|
12
|
-
* Options for creating an MCP client pool.
|
|
13
|
-
*/
|
|
14
|
-
export interface MCPClientPoolOptions {
|
|
15
|
-
/** List of server configurations */
|
|
16
|
-
servers: MCPConnectionOptions[];
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Status of a connected server.
|
|
20
|
-
*/
|
|
21
|
-
export interface MCPServerStatus {
|
|
22
|
-
/** Server name */
|
|
23
|
-
name: string;
|
|
24
|
-
/** Whether connected */
|
|
25
|
-
connected: boolean;
|
|
26
|
-
/** Number of tools available */
|
|
27
|
-
toolCount?: number;
|
|
28
|
-
/** Number of resources available */
|
|
29
|
-
resourceCount?: number;
|
|
30
|
-
/** Number of prompts available */
|
|
31
|
-
promptCount?: number;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* MCP Client Pool - manages multiple MCP server connections.
|
|
35
|
-
*
|
|
36
|
-
* @example
|
|
37
|
-
* ```typescript
|
|
38
|
-
* const pool = new MCPClientPool({
|
|
39
|
-
* servers: [
|
|
40
|
-
* { name: "filesystem", config: { command: "npx", args: ["-y", "@modelcontextprotocol/server-filesystem", "."] } },
|
|
41
|
-
* { name: "github", config: { command: "npx", args: ["-y", "@modelcontextprotocol/server-github"] } },
|
|
42
|
-
* ],
|
|
43
|
-
* });
|
|
44
|
-
*
|
|
45
|
-
* await pool.connectAll();
|
|
46
|
-
* const status = pool.getStatus();
|
|
47
|
-
* await pool.disconnectAll();
|
|
48
|
-
* ```
|
|
49
|
-
*/
|
|
50
|
-
export declare class MCPClientPool {
|
|
51
|
-
private options;
|
|
52
|
-
private clients;
|
|
53
|
-
private isConnecting;
|
|
54
|
-
constructor(options: MCPClientPoolOptions);
|
|
55
|
-
/**
|
|
56
|
-
* Connect to all configured servers.
|
|
57
|
-
*
|
|
58
|
-
* Errors for individual servers are logged but don't fail the entire operation.
|
|
59
|
-
*/
|
|
60
|
-
connectAll(): Promise<void>;
|
|
61
|
-
/**
|
|
62
|
-
* Disconnect from all servers.
|
|
63
|
-
*/
|
|
64
|
-
disconnectAll(): Promise<void>;
|
|
65
|
-
/**
|
|
66
|
-
* Get a specific client by name.
|
|
67
|
-
*/
|
|
68
|
-
getClient(name: string): MCPClient | undefined;
|
|
69
|
-
/**
|
|
70
|
-
* Get all connected clients.
|
|
71
|
-
*/
|
|
72
|
-
getAllClients(): MCPClient[];
|
|
73
|
-
/**
|
|
74
|
-
* Check if a client is connected.
|
|
75
|
-
*/
|
|
76
|
-
isConnected(name: string): boolean;
|
|
77
|
-
/**
|
|
78
|
-
* Get status of all servers.
|
|
79
|
-
*/
|
|
80
|
-
getStatus(): Promise<MCPServerStatus[]>;
|
|
81
|
-
/**
|
|
82
|
-
* Get all tools from all connected servers.
|
|
83
|
-
*/
|
|
84
|
-
listAllTools(): Promise<Record<string, MCPToolDefinition[]>>;
|
|
85
|
-
/**
|
|
86
|
-
* Get all resources from all connected servers.
|
|
87
|
-
*/
|
|
88
|
-
listAllResources(): Promise<Record<string, MCPResource[]>>;
|
|
89
|
-
/**
|
|
90
|
-
* Get all prompts from all connected servers.
|
|
91
|
-
*/
|
|
92
|
-
listAllPrompts(): Promise<Record<string, MCPPrompt[]>>;
|
|
93
|
-
/**
|
|
94
|
-
* Reload all connections.
|
|
95
|
-
*/
|
|
96
|
-
reload(): Promise<void>;
|
|
97
|
-
/**
|
|
98
|
-
* Add a new server connection.
|
|
99
|
-
*/
|
|
100
|
-
addServer(config: MCPConnectionOptions): Promise<boolean>;
|
|
101
|
-
/**
|
|
102
|
-
* Remove a server connection.
|
|
103
|
-
*/
|
|
104
|
-
removeServer(name: string): Promise<boolean>;
|
|
105
|
-
}
|
|
@@ -1,213 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MCP Client - Single Server Connection
|
|
3
|
-
*
|
|
4
|
-
* Manages connection to one MCP server and provides
|
|
5
|
-
* methods to list/call tools, read resources, etc.
|
|
6
|
-
*
|
|
7
|
-
* Transport is provided by the official `@modelcontextprotocol/sdk`:
|
|
8
|
-
* - stdio → subprocess JSON-RPC over stdin/stdout
|
|
9
|
-
* - http → Streamable HTTP (POST for client→server, plus a server→client
|
|
10
|
-
* push channel — the SDK opens the SSE stream and a standalone GET
|
|
11
|
-
* SSE for server-initiated messages, and handles reconnect/
|
|
12
|
-
* session-expiry by re-using the session id)
|
|
13
|
-
* - sse → legacy HTTP+SSE transport (when `transport: "sse"` is requested)
|
|
14
|
-
*
|
|
15
|
-
* The SDK gives us a real persistent connection, a server→client push channel,
|
|
16
|
-
* dispatch of server NOTIFICATIONS, answering of server REQUESTS (elicitation,
|
|
17
|
-
* roots/list, sampling, ping), and bounded reconnect on a dropped stream /
|
|
18
|
-
* expired session — none of which the hand-rolled POST-only transport did.
|
|
19
|
-
*/
|
|
20
|
-
import type { MCPServerConfig, MCPToolDefinition, MCPResource, MCPPrompt, MCPToolCallResult, MCPLogHandler, MCPProgressHandler, MCPElicitationHandler, MCPRoot } from "./types.js";
|
|
21
|
-
/**
|
|
22
|
-
* Options for creating an MCP client.
|
|
23
|
-
*/
|
|
24
|
-
export interface MCPClientOptions {
|
|
25
|
-
/** Unique name for this client */
|
|
26
|
-
name: string;
|
|
27
|
-
/** Server connection configuration */
|
|
28
|
-
config: MCPServerConfig;
|
|
29
|
-
/** Optional timeout in milliseconds */
|
|
30
|
-
timeout?: number;
|
|
31
|
-
/** Optional log handler */
|
|
32
|
-
logger?: MCPLogHandler;
|
|
33
|
-
/** Whether to enable server logs (default: true) */
|
|
34
|
-
enableServerLogs?: boolean;
|
|
35
|
-
/** Whether to enable progress tracking (default: false) */
|
|
36
|
-
enableProgressTracking?: boolean;
|
|
37
|
-
/** Filesystem roots to expose to the server */
|
|
38
|
-
roots?: MCPRoot[];
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* MCP Client - manages connection to a single MCP server.
|
|
42
|
-
*
|
|
43
|
-
* Supports stdio (subprocess) and HTTP (Streamable HTTP / legacy SSE) transports.
|
|
44
|
-
* Provides methods to list tools, call tools, read resources, etc.
|
|
45
|
-
*
|
|
46
|
-
* @example
|
|
47
|
-
* ```typescript
|
|
48
|
-
* const client = new MCPClient({
|
|
49
|
-
* name: "filesystem",
|
|
50
|
-
* config: {
|
|
51
|
-
* command: "npx",
|
|
52
|
-
* args: ["-y", "@modelcontextprotocol/server-filesystem", "."],
|
|
53
|
-
* },
|
|
54
|
-
* });
|
|
55
|
-
*
|
|
56
|
-
* await client.connect();
|
|
57
|
-
* const tools = await client.listTools();
|
|
58
|
-
* const result = await client.callTool("read_file", { path: "./test.txt" });
|
|
59
|
-
* await client.disconnect();
|
|
60
|
-
* ```
|
|
61
|
-
*/
|
|
62
|
-
export declare class MCPClient {
|
|
63
|
-
private options;
|
|
64
|
-
private client?;
|
|
65
|
-
private transport?;
|
|
66
|
-
private isConnected;
|
|
67
|
-
private connectionPromise;
|
|
68
|
-
private serverCapabilities?;
|
|
69
|
-
private logHandler?;
|
|
70
|
-
private enableServerLogs;
|
|
71
|
-
private enableProgressTracking;
|
|
72
|
-
private _roots;
|
|
73
|
-
private elicitationHandler?;
|
|
74
|
-
private samplingHandler?;
|
|
75
|
-
private resourceUpdatedHandler?;
|
|
76
|
-
private resourceListChangedHandler?;
|
|
77
|
-
private toolListChangedHandler?;
|
|
78
|
-
private promptListChangedHandler?;
|
|
79
|
-
private progressHandler?;
|
|
80
|
-
/** Server name */
|
|
81
|
-
readonly serverName: string;
|
|
82
|
-
/** Server config */
|
|
83
|
-
readonly config: MCPServerConfig;
|
|
84
|
-
/** Request timeout */
|
|
85
|
-
readonly timeout: number;
|
|
86
|
-
constructor(options: MCPClientOptions);
|
|
87
|
-
/**
|
|
88
|
-
* Connect to the MCP server.
|
|
89
|
-
* Safe to call multiple times - returns existing connection if already connected.
|
|
90
|
-
*/
|
|
91
|
-
connect(): Promise<void>;
|
|
92
|
-
private doConnect;
|
|
93
|
-
/**
|
|
94
|
-
* Build the SDK transport for the configured server.
|
|
95
|
-
*
|
|
96
|
-
* - stdio: `StdioClientTransport` (inherits the parent env, merges config.env).
|
|
97
|
-
* - http: `StreamableHTTPClientTransport` (POST + server-push SSE channel,
|
|
98
|
-
* reconnect + session-expiry handled by the SDK), unless the config
|
|
99
|
-
* asks for the legacy `SSEClientTransport`.
|
|
100
|
-
*/
|
|
101
|
-
private createTransport;
|
|
102
|
-
/**
|
|
103
|
-
* Register handlers for server-initiated REQUESTS and NOTIFICATIONS.
|
|
104
|
-
*
|
|
105
|
-
* REQUESTS (have both `.method` AND `.id`) must be ANSWERED with a JSON-RPC
|
|
106
|
-
* RESPONSE carrying the matching id — the SDK does this automatically for the
|
|
107
|
-
* value a request handler returns (or rejects). The previous hand-rolled
|
|
108
|
-
* transport routed these into the notification path, so they were never
|
|
109
|
-
* answered (bug #13).
|
|
110
|
-
*
|
|
111
|
-
* Defaults:
|
|
112
|
-
* - ping → {}
|
|
113
|
-
* - roots/list → the configured roots
|
|
114
|
-
* - elicitation/create→ decline ({action:"cancel"}) unless a host handler is set
|
|
115
|
-
* - sampling → reject "Method not found" unless a host handler is set
|
|
116
|
-
*/
|
|
117
|
-
private registerServerHandlers;
|
|
118
|
-
/**
|
|
119
|
-
* Disconnect from the MCP server.
|
|
120
|
-
*
|
|
121
|
-
* The SDK's `client.close()` closes the transport and rejects any pending
|
|
122
|
-
* requests — a clean teardown for both stdio (graceful subprocess shutdown)
|
|
123
|
-
* and HTTP (close the push channel / end the session).
|
|
124
|
-
*/
|
|
125
|
-
disconnect(): Promise<void>;
|
|
126
|
-
/**
|
|
127
|
-
* Whether the client is connected.
|
|
128
|
-
*/
|
|
129
|
-
get connected(): boolean;
|
|
130
|
-
/**
|
|
131
|
-
* List all tools available from the server.
|
|
132
|
-
*/
|
|
133
|
-
listTools(): Promise<MCPToolDefinition[]>;
|
|
134
|
-
/**
|
|
135
|
-
* Call a tool on the server.
|
|
136
|
-
*/
|
|
137
|
-
callTool(name: string, args: Record<string, unknown>): Promise<MCPToolCallResult>;
|
|
138
|
-
/**
|
|
139
|
-
* List all resources available from the server.
|
|
140
|
-
*/
|
|
141
|
-
listResources(): Promise<MCPResource[]>;
|
|
142
|
-
/**
|
|
143
|
-
* Read a resource from the server.
|
|
144
|
-
*/
|
|
145
|
-
readResource(uri: string): Promise<unknown>;
|
|
146
|
-
/**
|
|
147
|
-
* Subscribe to resource updates.
|
|
148
|
-
*/
|
|
149
|
-
subscribeResource(uri: string): Promise<void>;
|
|
150
|
-
/**
|
|
151
|
-
* Unsubscribe from resource updates.
|
|
152
|
-
*/
|
|
153
|
-
unsubscribeResource(uri: string): Promise<void>;
|
|
154
|
-
/**
|
|
155
|
-
* List all prompts available from the server.
|
|
156
|
-
*/
|
|
157
|
-
listPrompts(): Promise<MCPPrompt[]>;
|
|
158
|
-
/**
|
|
159
|
-
* Get a prompt from the server.
|
|
160
|
-
*/
|
|
161
|
-
getPrompt(name: string, args?: Record<string, unknown>): Promise<unknown>;
|
|
162
|
-
/**
|
|
163
|
-
* Get the configured roots.
|
|
164
|
-
*/
|
|
165
|
-
get roots(): MCPRoot[];
|
|
166
|
-
/**
|
|
167
|
-
* Update the roots and notify the server.
|
|
168
|
-
*/
|
|
169
|
-
setRoots(roots: MCPRoot[]): Promise<void>;
|
|
170
|
-
/**
|
|
171
|
-
* Set a handler for resource updated notifications.
|
|
172
|
-
*/
|
|
173
|
-
setResourceUpdatedHandler(handler: (params: {
|
|
174
|
-
uri: string;
|
|
175
|
-
}) => void): void;
|
|
176
|
-
/**
|
|
177
|
-
* Set a handler for resource list changed notifications.
|
|
178
|
-
*/
|
|
179
|
-
setResourceListChangedHandler(handler: () => void): void;
|
|
180
|
-
/**
|
|
181
|
-
* Set a handler for tool list changed notifications.
|
|
182
|
-
*/
|
|
183
|
-
setToolListChangedHandler(handler: () => void): void;
|
|
184
|
-
/**
|
|
185
|
-
* Set a handler for prompt list changed notifications.
|
|
186
|
-
*/
|
|
187
|
-
setPromptListChangedHandler(handler: () => void): void;
|
|
188
|
-
/**
|
|
189
|
-
* Set a handler for elicitation requests. When set, the server's
|
|
190
|
-
* `elicitation/create` REQUEST is answered with the host's decision; when
|
|
191
|
-
* unset the request is declined ({action:"cancel"}).
|
|
192
|
-
*/
|
|
193
|
-
setElicitationHandler(handler: MCPElicitationHandler): void;
|
|
194
|
-
/**
|
|
195
|
-
* Set a handler for sampling (`sampling/createMessage`) requests. When set,
|
|
196
|
-
* the server request is answered with the host's result; when unset the
|
|
197
|
-
* request is rejected with "Method not found".
|
|
198
|
-
*/
|
|
199
|
-
setSamplingHandler(handler: (params: unknown) => Promise<unknown>): void;
|
|
200
|
-
/**
|
|
201
|
-
* Set a handler for progress notifications.
|
|
202
|
-
*/
|
|
203
|
-
setProgressHandler(handler: MCPProgressHandler): void;
|
|
204
|
-
private ensureConnected;
|
|
205
|
-
/**
|
|
206
|
-
* Normalize an SDK/transport error into an MCPError. Session-expiry style
|
|
207
|
-
* failures (404 session / -32001) are surfaced as SESSION_ERROR so callers
|
|
208
|
-
* (the pool) can decide to reconnect; the SDK's StreamableHTTP transport
|
|
209
|
-
* already attempts a bounded reconnect re-using the session id before this.
|
|
210
|
-
*/
|
|
211
|
-
private wrapError;
|
|
212
|
-
private log;
|
|
213
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MCP client transport tests (#23 / bug #13).
|
|
3
|
-
*
|
|
4
|
-
* These verify the server→client directions that the old hand-rolled,
|
|
5
|
-
* POST-only transport never handled:
|
|
6
|
-
* 1. A server-initiated REQUEST (`elicitation/create`) is ANSWERED with a
|
|
7
|
-
* JSON-RPC RESPONSE carrying the matching id (not silently dropped into a
|
|
8
|
-
* notification path).
|
|
9
|
-
* 2. A server-initiated NOTIFICATION (`notifications/tools/list_changed`)
|
|
10
|
-
* fires the host-registered handler.
|
|
11
|
-
* 3. The HTTP path builds a real Streamable-HTTP transport with a server-push
|
|
12
|
-
* channel, and an SSE-framed server message off that channel is parsed and
|
|
13
|
-
* dispatched to the right handler.
|
|
14
|
-
*
|
|
15
|
-
* A `MockTransport` (implementing the SDK `Transport` interface) drives the
|
|
16
|
-
* client without a live MCP server.
|
|
17
|
-
*/
|
|
18
|
-
export {};
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MCP Configuration Loading
|
|
3
|
-
*
|
|
4
|
-
* Loads MCP server configurations from XDG-compliant paths:
|
|
5
|
-
* - Project: ./.indusvx/mcp.json
|
|
6
|
-
* - User: ~/.config/indusvx/mcp.json (XDG)
|
|
7
|
-
* - Legacy: ~/.indusvx/agent/mcp.json
|
|
8
|
-
*
|
|
9
|
-
* Reference: MCP configuration loading patterns.
|
|
10
|
-
*/
|
|
11
|
-
import type { MCPConnectionOptions, MCPConfigFile } from "./types.js";
|
|
12
|
-
/**
|
|
13
|
-
* Load MCP configuration from all sources.
|
|
14
|
-
*
|
|
15
|
-
* If a specific file path is provided, loads from that file directly.
|
|
16
|
-
* Otherwise merges configurations from:
|
|
17
|
-
* 1. Project-level config: ./.indusvx/mcp.json
|
|
18
|
-
* 2. User-level (XDG): ~/.config/indusvx/mcp.json
|
|
19
|
-
* 3. Legacy: ~/.indusvx/agent/mcp.json or ~/.indusvx/agent/mcp-servers.json
|
|
20
|
-
*
|
|
21
|
-
* @param configPathOrCwd - Either a specific config file path, or a working directory
|
|
22
|
-
* @returns Array of MCP connection options
|
|
23
|
-
*/
|
|
24
|
-
export declare function loadMCPConfig(configPathOrCwd?: string): MCPConnectionOptions[];
|
|
25
|
-
/**
|
|
26
|
-
* Get the path where user config should be saved.
|
|
27
|
-
*/
|
|
28
|
-
export declare function getUserConfigPath(): string;
|
|
29
|
-
/**
|
|
30
|
-
* Get the path where project config should be saved.
|
|
31
|
-
*/
|
|
32
|
-
export declare function getProjectConfigPath(cwd?: string): string;
|
|
33
|
-
/**
|
|
34
|
-
* Ensure the user config directory exists.
|
|
35
|
-
*/
|
|
36
|
-
export declare function ensureUserConfigDir(): string;
|
|
37
|
-
/**
|
|
38
|
-
* Ensure the project config directory exists.
|
|
39
|
-
*/
|
|
40
|
-
export declare function ensureProjectConfigDir(cwd?: string): string;
|
|
41
|
-
/**
|
|
42
|
-
* Save configuration to a file.
|
|
43
|
-
*/
|
|
44
|
-
export declare function saveConfig(path: string, config: MCPConfigFile): void;
|
|
45
|
-
/**
|
|
46
|
-
* Save user configuration.
|
|
47
|
-
*/
|
|
48
|
-
export declare function saveUserConfig(config: MCPConfigFile): void;
|
|
49
|
-
/**
|
|
50
|
-
* Save project configuration.
|
|
51
|
-
*/
|
|
52
|
-
export declare function saveProjectConfig(config: MCPConfigFile, cwd?: string): void;
|
|
53
|
-
/**
|
|
54
|
-
* Create a default configuration.
|
|
55
|
-
*/
|
|
56
|
-
export declare function createDefaultConfig(): MCPConfigFile;
|
|
57
|
-
/**
|
|
58
|
-
* Example configuration for documentation.
|
|
59
|
-
*/
|
|
60
|
-
export declare const EXAMPLE_CONFIG: MCPConfigFile;
|