actoviq-agent-sdk 0.4.6 → 0.4.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/CHANGELOG.md +203 -0
- package/README-zh.md +54 -19
- package/README.md +53 -19
- package/SECURITY.md +26 -0
- package/assets/actoviq-icon.ico +0 -0
- package/bin/actoviq-gui.js +28 -3
- package/dist/src/buddy/actoviqBuddy.d.ts.map +1 -1
- package/dist/src/buddy/actoviqBuddy.js +3 -4
- package/dist/src/buddy/actoviqBuddy.js.map +1 -1
- package/dist/src/cli/actoviq-react.js +495 -60
- package/dist/src/cli/actoviq-react.js.map +1 -1
- package/dist/src/compat/diagnostics.d.ts +18 -0
- package/dist/src/compat/diagnostics.d.ts.map +1 -0
- package/dist/src/compat/diagnostics.js +47 -0
- package/dist/src/compat/diagnostics.js.map +1 -0
- package/dist/src/compat/index.d.ts +8 -0
- package/dist/src/compat/index.d.ts.map +1 -0
- package/dist/src/compat/index.js +6 -0
- package/dist/src/compat/index.js.map +1 -0
- package/dist/src/config/actoviqHome.d.ts +32 -0
- package/dist/src/config/actoviqHome.d.ts.map +1 -0
- package/dist/src/config/actoviqHome.js +228 -0
- package/dist/src/config/actoviqHome.js.map +1 -0
- package/dist/src/config/actoviqSettingsStore.d.ts.map +1 -1
- package/dist/src/config/actoviqSettingsStore.js +6 -6
- package/dist/src/config/actoviqSettingsStore.js.map +1 -1
- package/dist/src/config/agentProfiles.d.ts +77 -0
- package/dist/src/config/agentProfiles.d.ts.map +1 -0
- package/dist/src/config/agentProfiles.js +319 -0
- package/dist/src/config/agentProfiles.js.map +1 -0
- package/dist/src/config/loadDefaultActoviqSettings.d.ts.map +1 -1
- package/dist/src/config/loadDefaultActoviqSettings.js +2 -3
- package/dist/src/config/loadDefaultActoviqSettings.js.map +1 -1
- package/dist/src/config/projectSessionDirectory.d.ts.map +1 -1
- package/dist/src/config/projectSessionDirectory.js +3 -2
- package/dist/src/config/projectSessionDirectory.js.map +1 -1
- package/dist/src/config/resolveRuntimeConfig.d.ts.map +1 -1
- package/dist/src/config/resolveRuntimeConfig.js +13 -2
- package/dist/src/config/resolveRuntimeConfig.js.map +1 -1
- package/dist/src/core/agent-spec.d.ts +74 -0
- package/dist/src/core/agent-spec.d.ts.map +1 -0
- package/dist/src/core/agent-spec.js +2 -0
- package/dist/src/core/agent-spec.js.map +1 -0
- package/dist/src/core/errors.d.ts +42 -0
- package/dist/src/core/errors.d.ts.map +1 -0
- package/dist/src/core/errors.js +53 -0
- package/dist/src/core/errors.js.map +1 -0
- package/dist/src/core/index.d.ts +11 -0
- package/dist/src/core/index.d.ts.map +1 -0
- package/dist/src/core/index.js +4 -0
- package/dist/src/core/index.js.map +1 -0
- package/dist/src/core/items.d.ts +161 -0
- package/dist/src/core/items.d.ts.map +1 -0
- package/dist/src/core/items.js +2 -0
- package/dist/src/core/items.js.map +1 -0
- package/dist/src/core/json.d.ts +20 -0
- package/dist/src/core/json.d.ts.map +1 -0
- package/dist/src/core/json.js +80 -0
- package/dist/src/core/json.js.map +1 -0
- package/dist/src/core/model-ref.d.ts +6 -0
- package/dist/src/core/model-ref.d.ts.map +1 -0
- package/dist/src/core/model-ref.js +2 -0
- package/dist/src/core/model-ref.js.map +1 -0
- package/dist/src/core/run.d.ts +35 -0
- package/dist/src/core/run.d.ts.map +1 -0
- package/dist/src/core/run.js +2 -0
- package/dist/src/core/run.js.map +1 -0
- package/dist/src/core/usage.d.ts +32 -0
- package/dist/src/core/usage.d.ts.map +1 -0
- package/dist/src/core/usage.js +111 -0
- package/dist/src/core/usage.js.map +1 -0
- package/dist/src/errors.d.ts +19 -0
- package/dist/src/errors.d.ts.map +1 -1
- package/dist/src/errors.js +27 -0
- package/dist/src/errors.js.map +1 -1
- package/dist/src/events/index.d.ts +4 -0
- package/dist/src/events/index.d.ts.map +1 -0
- package/dist/src/events/index.js +4 -0
- package/dist/src/events/index.js.map +1 -0
- package/dist/src/events/openTelemetry.d.ts +51 -0
- package/dist/src/events/openTelemetry.d.ts.map +1 -0
- package/dist/src/events/openTelemetry.js +116 -0
- package/dist/src/events/openTelemetry.js.map +1 -0
- package/dist/src/events/processors.d.ts +14 -0
- package/dist/src/events/processors.d.ts.map +1 -0
- package/dist/src/events/processors.js +60 -0
- package/dist/src/events/processors.js.map +1 -0
- package/dist/src/events/runEvents.d.ts +66 -0
- package/dist/src/events/runEvents.d.ts.map +1 -0
- package/dist/src/events/runEvents.js +143 -0
- package/dist/src/events/runEvents.js.map +1 -0
- package/dist/src/gui/actoviqGui.d.ts +15 -0
- package/dist/src/gui/actoviqGui.d.ts.map +1 -1
- package/dist/src/gui/actoviqGui.js +18034 -1919
- package/dist/src/gui/actoviqGui.js.map +1 -1
- package/dist/src/gui/contextRailStore.d.ts +47 -0
- package/dist/src/gui/contextRailStore.d.ts.map +1 -0
- package/dist/src/gui/contextRailStore.js +163 -0
- package/dist/src/gui/contextRailStore.js.map +1 -0
- package/dist/src/gui/electronMain.js +32 -16
- package/dist/src/gui/electronMain.js.map +1 -1
- package/dist/src/gui/guiAssets.d.ts +6 -0
- package/dist/src/gui/guiAssets.d.ts.map +1 -0
- package/dist/src/gui/guiAssets.js +48 -0
- package/dist/src/gui/guiAssets.js.map +1 -0
- package/dist/src/gui/guiSyntaxHighlight.d.ts +11 -0
- package/dist/src/gui/guiSyntaxHighlight.d.ts.map +1 -0
- package/dist/src/gui/guiSyntaxHighlight.js +348 -0
- package/dist/src/gui/guiSyntaxHighlight.js.map +1 -0
- package/dist/src/gui/projectMeta.d.ts +15 -0
- package/dist/src/gui/projectMeta.d.ts.map +1 -0
- package/dist/src/gui/projectMeta.js +61 -0
- package/dist/src/gui/projectMeta.js.map +1 -0
- package/dist/src/gui/projectWorkbench.d.ts +73 -0
- package/dist/src/gui/projectWorkbench.d.ts.map +1 -0
- package/dist/src/gui/projectWorkbench.js +307 -0
- package/dist/src/gui/projectWorkbench.js.map +1 -0
- package/dist/src/gui/terminalManager.d.ts +33 -0
- package/dist/src/gui/terminalManager.d.ts.map +1 -0
- package/dist/src/gui/terminalManager.js +206 -0
- package/dist/src/gui/terminalManager.js.map +1 -0
- package/dist/src/gui/transcript/clientBundle.d.ts +6 -0
- package/dist/src/gui/transcript/clientBundle.d.ts.map +1 -0
- package/dist/src/gui/transcript/clientBundle.js +978 -0
- package/dist/src/gui/transcript/clientBundle.js.map +1 -0
- package/dist/src/gui/transcript/index.d.ts +9 -0
- package/dist/src/gui/transcript/index.d.ts.map +1 -0
- package/dist/src/gui/transcript/index.js +6 -0
- package/dist/src/gui/transcript/index.js.map +1 -0
- package/dist/src/gui/transcript/parts.d.ts +81 -0
- package/dist/src/gui/transcript/parts.d.ts.map +1 -0
- package/dist/src/gui/transcript/parts.js +476 -0
- package/dist/src/gui/transcript/parts.js.map +1 -0
- package/dist/src/gui/transcript/registry.d.ts +8 -0
- package/dist/src/gui/transcript/registry.d.ts.map +1 -0
- package/dist/src/gui/transcript/registry.js +32 -0
- package/dist/src/gui/transcript/registry.js.map +1 -0
- package/dist/src/gui/transcript/scroll.d.ts +9 -0
- package/dist/src/gui/transcript/scroll.d.ts.map +1 -0
- package/dist/src/gui/transcript/scroll.js +13 -0
- package/dist/src/gui/transcript/scroll.js.map +1 -0
- package/dist/src/gui/transcript/styles.d.ts +3 -0
- package/dist/src/gui/transcript/styles.d.ts.map +1 -0
- package/dist/src/gui/transcript/styles.js +172 -0
- package/dist/src/gui/transcript/styles.js.map +1 -0
- package/dist/src/gui/workspaceNote.d.ts +4 -0
- package/dist/src/gui/workspaceNote.d.ts.map +1 -0
- package/dist/src/gui/workspaceNote.js +21 -0
- package/dist/src/gui/workspaceNote.js.map +1 -0
- package/dist/src/gui/workspaceRegistry.d.ts +11 -0
- package/dist/src/gui/workspaceRegistry.d.ts.map +1 -0
- package/dist/src/gui/workspaceRegistry.js +114 -0
- package/dist/src/gui/workspaceRegistry.js.map +1 -0
- package/dist/src/hooks/userHooks.d.ts +29 -8
- package/dist/src/hooks/userHooks.d.ts.map +1 -1
- package/dist/src/hooks/userHooks.js +106 -34
- package/dist/src/hooks/userHooks.js.map +1 -1
- package/dist/src/index.d.ts +24 -6
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +18 -6
- package/dist/src/index.js.map +1 -1
- package/dist/src/issues/durableIssueCoordinator.d.ts +57 -0
- package/dist/src/issues/durableIssueCoordinator.d.ts.map +1 -0
- package/dist/src/issues/durableIssueCoordinator.js +128 -0
- package/dist/src/issues/durableIssueCoordinator.js.map +1 -0
- package/dist/src/issues/issueExecution.d.ts +34 -0
- package/dist/src/issues/issueExecution.d.ts.map +1 -0
- package/dist/src/issues/issueExecution.js +190 -0
- package/dist/src/issues/issueExecution.js.map +1 -0
- package/dist/src/issues/issueStore.d.ts +95 -0
- package/dist/src/issues/issueStore.d.ts.map +1 -0
- package/dist/src/issues/issueStore.js +373 -0
- package/dist/src/issues/issueStore.js.map +1 -0
- package/dist/src/manager/projectManager.d.ts +103 -0
- package/dist/src/manager/projectManager.d.ts.map +1 -0
- package/dist/src/manager/projectManager.js +547 -0
- package/dist/src/manager/projectManager.js.map +1 -0
- package/dist/src/mcp/connectionManager.d.ts +22 -2
- package/dist/src/mcp/connectionManager.d.ts.map +1 -1
- package/dist/src/mcp/connectionManager.js +153 -41
- package/dist/src/mcp/connectionManager.js.map +1 -1
- package/dist/src/mcp/mcpServerConfig.d.ts.map +1 -1
- package/dist/src/mcp/mcpServerConfig.js +7 -7
- package/dist/src/mcp/mcpServerConfig.js.map +1 -1
- package/dist/src/memory/actoviqMemory.js +6 -6
- package/dist/src/memory/actoviqMemory.js.map +1 -1
- package/dist/src/memory/sessionHistory.js +2 -2
- package/dist/src/memory/sessionHistory.js.map +1 -1
- package/dist/src/node/index.d.ts +5 -0
- package/dist/src/node/index.d.ts.map +1 -0
- package/dist/src/node/index.js +5 -0
- package/dist/src/node/index.js.map +1 -0
- package/dist/src/node/sqliteCheckpointAdapter.d.ts +20 -0
- package/dist/src/node/sqliteCheckpointAdapter.d.ts.map +1 -0
- package/dist/src/node/sqliteCheckpointAdapter.js +163 -0
- package/dist/src/node/sqliteCheckpointAdapter.js.map +1 -0
- package/dist/src/node/sqliteDurableChildStore.d.ts +21 -0
- package/dist/src/node/sqliteDurableChildStore.d.ts.map +1 -0
- package/dist/src/node/sqliteDurableChildStore.js +124 -0
- package/dist/src/node/sqliteDurableChildStore.js.map +1 -0
- package/dist/src/node/sqliteSessionAdapter.d.ts +28 -0
- package/dist/src/node/sqliteSessionAdapter.d.ts.map +1 -0
- package/dist/src/node/sqliteSessionAdapter.js +99 -0
- package/dist/src/node/sqliteSessionAdapter.js.map +1 -0
- package/dist/src/orchestration/agentTool.d.ts +50 -0
- package/dist/src/orchestration/agentTool.d.ts.map +1 -0
- package/dist/src/orchestration/agentTool.js +132 -0
- package/dist/src/orchestration/agentTool.js.map +1 -0
- package/dist/src/orchestration/background.d.ts +102 -0
- package/dist/src/orchestration/background.d.ts.map +1 -0
- package/dist/src/orchestration/background.js +310 -0
- package/dist/src/orchestration/background.js.map +1 -0
- package/dist/src/orchestration/childRunner.d.ts +12 -0
- package/dist/src/orchestration/childRunner.d.ts.map +1 -0
- package/dist/src/orchestration/childRunner.js +179 -0
- package/dist/src/orchestration/childRunner.js.map +1 -0
- package/dist/src/orchestration/contracts.d.ts +169 -0
- package/dist/src/orchestration/contracts.d.ts.map +1 -0
- package/dist/src/orchestration/contracts.js +11 -0
- package/dist/src/orchestration/contracts.js.map +1 -0
- package/dist/src/orchestration/handoff.d.ts +32 -0
- package/dist/src/orchestration/handoff.d.ts.map +1 -0
- package/dist/src/orchestration/handoff.js +60 -0
- package/dist/src/orchestration/handoff.js.map +1 -0
- package/dist/src/orchestration/index.d.ts +9 -0
- package/dist/src/orchestration/index.d.ts.map +1 -0
- package/dist/src/orchestration/index.js +9 -0
- package/dist/src/orchestration/index.js.map +1 -0
- package/dist/src/orchestration/presets.d.ts +51 -0
- package/dist/src/orchestration/presets.d.ts.map +1 -0
- package/dist/src/orchestration/presets.js +78 -0
- package/dist/src/orchestration/presets.js.map +1 -0
- package/dist/src/orchestration/scope.d.ts +69 -0
- package/dist/src/orchestration/scope.d.ts.map +1 -0
- package/dist/src/orchestration/scope.js +371 -0
- package/dist/src/orchestration/scope.js.map +1 -0
- package/dist/src/orchestration/workflowGraph.d.ts +73 -0
- package/dist/src/orchestration/workflowGraph.d.ts.map +1 -0
- package/dist/src/orchestration/workflowGraph.js +255 -0
- package/dist/src/orchestration/workflowGraph.js.map +1 -0
- package/dist/src/parity/actoviqCleanBridgeCompatSdk.d.ts.map +1 -1
- package/dist/src/parity/actoviqCleanBridgeCompatSdk.js +101 -48
- package/dist/src/parity/actoviqCleanBridgeCompatSdk.js.map +1 -1
- package/dist/src/parity/bridgeConfigs.d.ts +2 -2
- package/dist/src/parity/bridgeConfigs.d.ts.map +1 -1
- package/dist/src/parity/bridgeConfigs.js +78 -39
- package/dist/src/parity/bridgeConfigs.js.map +1 -1
- package/dist/src/parity/bridgeProviders.d.ts +9 -6
- package/dist/src/parity/bridgeProviders.d.ts.map +1 -1
- package/dist/src/parity/bridgeProviders.js +140 -26
- package/dist/src/parity/bridgeProviders.js.map +1 -1
- package/dist/src/parity/portableSessions.js +2 -2
- package/dist/src/parity/portableSessions.js.map +1 -1
- package/dist/src/profiles/index.d.ts +15 -0
- package/dist/src/profiles/index.d.ts.map +1 -0
- package/dist/src/profiles/index.js +618 -0
- package/dist/src/profiles/index.js.map +1 -0
- package/dist/src/profiles/types.d.ts +102 -0
- package/dist/src/profiles/types.d.ts.map +1 -0
- package/dist/src/profiles/types.js +9 -0
- package/dist/src/profiles/types.js.map +1 -0
- package/dist/src/provider/client.d.ts +1 -1
- package/dist/src/provider/client.d.ts.map +1 -1
- package/dist/src/provider/openai-model-api.js +1 -1
- package/dist/src/provider/openai-model-api.js.map +1 -1
- package/dist/src/providers-v2/adapter-base.d.ts +35 -0
- package/dist/src/providers-v2/adapter-base.d.ts.map +1 -0
- package/dist/src/providers-v2/adapter-base.js +115 -0
- package/dist/src/providers-v2/adapter-base.js.map +1 -0
- package/dist/src/providers-v2/anthropic.d.ts +15 -0
- package/dist/src/providers-v2/anthropic.d.ts.map +1 -0
- package/dist/src/providers-v2/anthropic.js +414 -0
- package/dist/src/providers-v2/anthropic.js.map +1 -0
- package/dist/src/providers-v2/capabilities.d.ts +33 -0
- package/dist/src/providers-v2/capabilities.d.ts.map +1 -0
- package/dist/src/providers-v2/capabilities.js +218 -0
- package/dist/src/providers-v2/capabilities.js.map +1 -0
- package/dist/src/providers-v2/index.d.ts +12 -0
- package/dist/src/providers-v2/index.d.ts.map +1 -0
- package/dist/src/providers-v2/index.js +8 -0
- package/dist/src/providers-v2/index.js.map +1 -0
- package/dist/src/providers-v2/legacy.d.ts +26 -0
- package/dist/src/providers-v2/legacy.d.ts.map +1 -0
- package/dist/src/providers-v2/legacy.js +543 -0
- package/dist/src/providers-v2/legacy.js.map +1 -0
- package/dist/src/providers-v2/mapping.d.ts +34 -0
- package/dist/src/providers-v2/mapping.d.ts.map +1 -0
- package/dist/src/providers-v2/mapping.js +194 -0
- package/dist/src/providers-v2/mapping.js.map +1 -0
- package/dist/src/providers-v2/openai-chat.d.ts +16 -0
- package/dist/src/providers-v2/openai-chat.d.ts.map +1 -0
- package/dist/src/providers-v2/openai-chat.js +318 -0
- package/dist/src/providers-v2/openai-chat.js.map +1 -0
- package/dist/src/providers-v2/openai-responses.d.ts +15 -0
- package/dist/src/providers-v2/openai-responses.d.ts.map +1 -0
- package/dist/src/providers-v2/openai-responses.js +356 -0
- package/dist/src/providers-v2/openai-responses.js.map +1 -0
- package/dist/src/providers-v2/registry.d.ts +39 -0
- package/dist/src/providers-v2/registry.d.ts.map +1 -0
- package/dist/src/providers-v2/registry.js +101 -0
- package/dist/src/providers-v2/registry.js.map +1 -0
- package/dist/src/providers-v2/stream.d.ts +14 -0
- package/dist/src/providers-v2/stream.d.ts.map +1 -0
- package/dist/src/providers-v2/stream.js +115 -0
- package/dist/src/providers-v2/stream.js.map +1 -0
- package/dist/src/providers-v2/transport.d.ts +36 -0
- package/dist/src/providers-v2/transport.d.ts.map +1 -0
- package/dist/src/providers-v2/transport.js +337 -0
- package/dist/src/providers-v2/transport.js.map +1 -0
- package/dist/src/providers-v2/types.d.ts +162 -0
- package/dist/src/providers-v2/types.d.ts.map +1 -0
- package/dist/src/providers-v2/types.js +8 -0
- package/dist/src/providers-v2/types.js.map +1 -0
- package/dist/src/router/modelRouter.d.ts.map +1 -1
- package/dist/src/router/modelRouter.js +2 -3
- package/dist/src/router/modelRouter.js.map +1 -1
- package/dist/src/runtime/actoviqAgents.d.ts +5 -0
- package/dist/src/runtime/actoviqAgents.d.ts.map +1 -1
- package/dist/src/runtime/actoviqAgents.js +22 -4
- package/dist/src/runtime/actoviqAgents.js.map +1 -1
- package/dist/src/runtime/actoviqBackgroundTasks.d.ts +2 -1
- package/dist/src/runtime/actoviqBackgroundTasks.d.ts.map +1 -1
- package/dist/src/runtime/actoviqBackgroundTasks.js +4 -2
- package/dist/src/runtime/actoviqBackgroundTasks.js.map +1 -1
- package/dist/src/runtime/actoviqCompact.d.ts +15 -0
- package/dist/src/runtime/actoviqCompact.d.ts.map +1 -1
- package/dist/src/runtime/actoviqCompact.js +36 -10
- package/dist/src/runtime/actoviqCompact.js.map +1 -1
- package/dist/src/runtime/actoviqModelApi.d.ts.map +1 -1
- package/dist/src/runtime/actoviqModelApi.js +16 -2
- package/dist/src/runtime/actoviqModelApi.js.map +1 -1
- package/dist/src/runtime/actoviqPermissions.js +5 -1
- package/dist/src/runtime/actoviqPermissions.js.map +1 -1
- package/dist/src/runtime/agentClient.d.ts +3 -0
- package/dist/src/runtime/agentClient.d.ts.map +1 -1
- package/dist/src/runtime/agentClient.js +127 -45
- package/dist/src/runtime/agentClient.js.map +1 -1
- package/dist/src/runtime/agentRuntimeDiscovery.d.ts +75 -0
- package/dist/src/runtime/agentRuntimeDiscovery.d.ts.map +1 -0
- package/dist/src/runtime/agentRuntimeDiscovery.js +311 -0
- package/dist/src/runtime/agentRuntimeDiscovery.js.map +1 -0
- package/dist/src/runtime/agentSession.d.ts +18 -0
- package/dist/src/runtime/agentSession.d.ts.map +1 -1
- package/dist/src/runtime/agentSession.js +36 -0
- package/dist/src/runtime/agentSession.js.map +1 -1
- package/dist/src/runtime/asyncQueue.d.ts +99 -8
- package/dist/src/runtime/asyncQueue.d.ts.map +1 -1
- package/dist/src/runtime/asyncQueue.js +437 -37
- package/dist/src/runtime/asyncQueue.js.map +1 -1
- package/dist/src/runtime/conversationEngine.d.ts +7 -0
- package/dist/src/runtime/conversationEngine.d.ts.map +1 -1
- package/dist/src/runtime/conversationEngine.js +278 -18
- package/dist/src/runtime/conversationEngine.js.map +1 -1
- package/dist/src/runtime/deadline.d.ts +13 -0
- package/dist/src/runtime/deadline.d.ts.map +1 -0
- package/dist/src/runtime/deadline.js +67 -0
- package/dist/src/runtime/deadline.js.map +1 -0
- package/dist/src/runtime/messageUtils.d.ts +5 -0
- package/dist/src/runtime/messageUtils.d.ts.map +1 -1
- package/dist/src/runtime/messageUtils.js +17 -0
- package/dist/src/runtime/messageUtils.js.map +1 -1
- package/dist/src/runtime/sessionTurnCoordinator.d.ts +12 -0
- package/dist/src/runtime/sessionTurnCoordinator.d.ts.map +1 -0
- package/dist/src/runtime/sessionTurnCoordinator.js +23 -0
- package/dist/src/runtime/sessionTurnCoordinator.js.map +1 -0
- package/dist/src/runtime/tools.d.ts.map +1 -1
- package/dist/src/runtime/tools.js +1 -0
- package/dist/src/runtime/tools.js.map +1 -1
- package/dist/src/runtime-v2/agentRuntime.d.ts +136 -0
- package/dist/src/runtime-v2/agentRuntime.d.ts.map +1 -0
- package/dist/src/runtime-v2/agentRuntime.js +1341 -0
- package/dist/src/runtime-v2/agentRuntime.js.map +1 -0
- package/dist/src/runtime-v2/index.d.ts +6 -0
- package/dist/src/runtime-v2/index.d.ts.map +1 -0
- package/dist/src/runtime-v2/index.js +6 -0
- package/dist/src/runtime-v2/index.js.map +1 -0
- package/dist/src/runtime-v2/middleware/index.d.ts +5 -0
- package/dist/src/runtime-v2/middleware/index.d.ts.map +1 -0
- package/dist/src/runtime-v2/middleware/index.js +4 -0
- package/dist/src/runtime-v2/middleware/index.js.map +1 -0
- package/dist/src/runtime-v2/middleware/pipeline.d.ts +56 -0
- package/dist/src/runtime-v2/middleware/pipeline.d.ts.map +1 -0
- package/dist/src/runtime-v2/middleware/pipeline.js +242 -0
- package/dist/src/runtime-v2/middleware/pipeline.js.map +1 -0
- package/dist/src/runtime-v2/middleware/registry.d.ts +17 -0
- package/dist/src/runtime-v2/middleware/registry.d.ts.map +1 -0
- package/dist/src/runtime-v2/middleware/registry.js +46 -0
- package/dist/src/runtime-v2/middleware/registry.js.map +1 -0
- package/dist/src/runtime-v2/middleware/stages.d.ts +25 -0
- package/dist/src/runtime-v2/middleware/stages.d.ts.map +1 -0
- package/dist/src/runtime-v2/middleware/stages.js +48 -0
- package/dist/src/runtime-v2/middleware/stages.js.map +1 -0
- package/dist/src/runtime-v2/middleware/types.d.ts +51 -0
- package/dist/src/runtime-v2/middleware/types.d.ts.map +1 -0
- package/dist/src/runtime-v2/middleware/types.js +2 -0
- package/dist/src/runtime-v2/middleware/types.js.map +1 -0
- package/dist/src/runtime-v2/services.d.ts +33 -0
- package/dist/src/runtime-v2/services.d.ts.map +1 -0
- package/dist/src/runtime-v2/services.js +92 -0
- package/dist/src/runtime-v2/services.js.map +1 -0
- package/dist/src/runtime-v2/state.d.ts +71 -0
- package/dist/src/runtime-v2/state.d.ts.map +1 -0
- package/dist/src/runtime-v2/state.js +2 -0
- package/dist/src/runtime-v2/state.js.map +1 -0
- package/dist/src/runtime-v2/tools.d.ts +124 -0
- package/dist/src/runtime-v2/tools.d.ts.map +1 -0
- package/dist/src/runtime-v2/tools.js +185 -0
- package/dist/src/runtime-v2/tools.js.map +1 -0
- package/dist/src/scheduling/durableAgentScheduler.d.ts +46 -0
- package/dist/src/scheduling/durableAgentScheduler.d.ts.map +1 -0
- package/dist/src/scheduling/durableAgentScheduler.js +97 -0
- package/dist/src/scheduling/durableAgentScheduler.js.map +1 -0
- package/dist/src/scheduling/index.d.ts +3 -0
- package/dist/src/scheduling/index.d.ts.map +1 -1
- package/dist/src/scheduling/index.js +2 -0
- package/dist/src/scheduling/index.js.map +1 -1
- package/dist/src/scheduling/taskPersistence.d.ts +9 -0
- package/dist/src/scheduling/taskPersistence.d.ts.map +1 -0
- package/dist/src/scheduling/taskPersistence.js +238 -0
- package/dist/src/scheduling/taskPersistence.js.map +1 -0
- package/dist/src/storage/atomicJsonWrite.d.ts +13 -0
- package/dist/src/storage/atomicJsonWrite.d.ts.map +1 -0
- package/dist/src/storage/atomicJsonWrite.js +40 -0
- package/dist/src/storage/atomicJsonWrite.js.map +1 -0
- package/dist/src/storage/backgroundTaskStore.d.ts.map +1 -1
- package/dist/src/storage/backgroundTaskStore.js +2 -6
- package/dist/src/storage/backgroundTaskStore.js.map +1 -1
- package/dist/src/storage/mailboxStore.d.ts.map +1 -1
- package/dist/src/storage/mailboxStore.js +2 -6
- package/dist/src/storage/mailboxStore.js.map +1 -1
- package/dist/src/storage/sessionStore.d.ts +3 -0
- package/dist/src/storage/sessionStore.d.ts.map +1 -1
- package/dist/src/storage/sessionStore.js +169 -10
- package/dist/src/storage/sessionStore.js.map +1 -1
- package/dist/src/storage/teammateStore.d.ts.map +1 -1
- package/dist/src/storage/teammateStore.js +2 -6
- package/dist/src/storage/teammateStore.js.map +1 -1
- package/dist/src/storage-v2/contracts.d.ts +36 -0
- package/dist/src/storage-v2/contracts.d.ts.map +1 -0
- package/dist/src/storage-v2/contracts.js +2 -0
- package/dist/src/storage-v2/contracts.js.map +1 -0
- package/dist/src/storage-v2/errors.d.ts +21 -0
- package/dist/src/storage-v2/errors.d.ts.map +1 -0
- package/dist/src/storage-v2/errors.js +44 -0
- package/dist/src/storage-v2/errors.js.map +1 -0
- package/dist/src/storage-v2/index.d.ts +8 -0
- package/dist/src/storage-v2/index.d.ts.map +1 -0
- package/dist/src/storage-v2/index.js +8 -0
- package/dist/src/storage-v2/index.js.map +1 -0
- package/dist/src/storage-v2/legacyJsonV1Items.d.ts +10 -0
- package/dist/src/storage-v2/legacyJsonV1Items.d.ts.map +1 -0
- package/dist/src/storage-v2/legacyJsonV1Items.js +153 -0
- package/dist/src/storage-v2/legacyJsonV1Items.js.map +1 -0
- package/dist/src/storage-v2/migration.d.ts +32 -0
- package/dist/src/storage-v2/migration.d.ts.map +1 -0
- package/dist/src/storage-v2/migration.js +242 -0
- package/dist/src/storage-v2/migration.js.map +1 -0
- package/dist/src/storage-v2/sqliteDriver.d.ts +24 -0
- package/dist/src/storage-v2/sqliteDriver.d.ts.map +1 -0
- package/dist/src/storage-v2/sqliteDriver.js +90 -0
- package/dist/src/storage-v2/sqliteDriver.js.map +1 -0
- package/dist/src/storage-v2/sqliteStorage.d.ts +55 -0
- package/dist/src/storage-v2/sqliteStorage.d.ts.map +1 -0
- package/dist/src/storage-v2/sqliteStorage.js +905 -0
- package/dist/src/storage-v2/sqliteStorage.js.map +1 -0
- package/dist/src/storage-v2/types.d.ts +198 -0
- package/dist/src/storage-v2/types.d.ts.map +1 -0
- package/dist/src/storage-v2/types.js +2 -0
- package/dist/src/storage-v2/types.js.map +1 -0
- package/dist/src/surfaces/index.d.ts +8 -0
- package/dist/src/surfaces/index.d.ts.map +1 -0
- package/dist/src/surfaces/index.js +8 -0
- package/dist/src/surfaces/index.js.map +1 -0
- package/dist/src/surfaces/internal.d.ts +17 -0
- package/dist/src/surfaces/internal.d.ts.map +1 -0
- package/dist/src/surfaces/internal.js +116 -0
- package/dist/src/surfaces/internal.js.map +1 -0
- package/dist/src/surfaces/legacyEventAdapter.d.ts +38 -0
- package/dist/src/surfaces/legacyEventAdapter.d.ts.map +1 -0
- package/dist/src/surfaces/legacyEventAdapter.js +373 -0
- package/dist/src/surfaces/legacyEventAdapter.js.map +1 -0
- package/dist/src/surfaces/legacySurfacePipeline.d.ts +18 -0
- package/dist/src/surfaces/legacySurfacePipeline.d.ts.map +1 -0
- package/dist/src/surfaces/legacySurfacePipeline.js +25 -0
- package/dist/src/surfaces/legacySurfacePipeline.js.map +1 -0
- package/dist/src/surfaces/redaction.d.ts +12 -0
- package/dist/src/surfaces/redaction.d.ts.map +1 -0
- package/dist/src/surfaces/redaction.js +111 -0
- package/dist/src/surfaces/redaction.js.map +1 -0
- package/dist/src/surfaces/runEventLegacyCompat.d.ts +26 -0
- package/dist/src/surfaces/runEventLegacyCompat.d.ts.map +1 -0
- package/dist/src/surfaces/runEventLegacyCompat.js +339 -0
- package/dist/src/surfaces/runEventLegacyCompat.js.map +1 -0
- package/dist/src/surfaces/runEventProjector.d.ts +44 -0
- package/dist/src/surfaces/runEventProjector.d.ts.map +1 -0
- package/dist/src/surfaces/runEventProjector.js +404 -0
- package/dist/src/surfaces/runEventProjector.js.map +1 -0
- package/dist/src/surfaces/runtimeBridgeAdapter.d.ts +30 -0
- package/dist/src/surfaces/runtimeBridgeAdapter.d.ts.map +1 -0
- package/dist/src/surfaces/runtimeBridgeAdapter.js +38 -0
- package/dist/src/surfaces/runtimeBridgeAdapter.js.map +1 -0
- package/dist/src/surfaces/types.d.ts +38 -0
- package/dist/src/surfaces/types.d.ts.map +1 -0
- package/dist/src/surfaces/types.js +2 -0
- package/dist/src/surfaces/types.js.map +1 -0
- package/dist/src/team/agentPool.d.ts +2 -0
- package/dist/src/team/agentPool.d.ts.map +1 -1
- package/dist/src/team/agentPool.js +3 -1
- package/dist/src/team/agentPool.js.map +1 -1
- package/dist/src/team/modelTeam.d.ts +25 -19
- package/dist/src/team/modelTeam.d.ts.map +1 -1
- package/dist/src/team/modelTeam.js +293 -294
- package/dist/src/team/modelTeam.js.map +1 -1
- package/dist/src/team/pricing.d.ts.map +1 -1
- package/dist/src/team/pricing.js +2 -1
- package/dist/src/team/pricing.js.map +1 -1
- package/dist/src/team/teamDefinitions.d.ts +28 -1
- package/dist/src/team/teamDefinitions.d.ts.map +1 -1
- package/dist/src/team/teamDefinitions.js +204 -8
- package/dist/src/team/teamDefinitions.js.map +1 -1
- package/dist/src/team/teamGraph.d.ts +191 -0
- package/dist/src/team/teamGraph.d.ts.map +1 -0
- package/dist/src/team/teamGraph.js +616 -0
- package/dist/src/team/teamGraph.js.map +1 -0
- package/dist/src/team/teamGraphLayout.d.ts +44 -0
- package/dist/src/team/teamGraphLayout.d.ts.map +1 -0
- package/dist/src/team/teamGraphLayout.js +120 -0
- package/dist/src/team/teamGraphLayout.js.map +1 -0
- package/dist/src/team/teamGraphScaffold.d.ts +76 -0
- package/dist/src/team/teamGraphScaffold.d.ts.map +1 -0
- package/dist/src/team/teamGraphScaffold.js +409 -0
- package/dist/src/team/teamGraphScaffold.js.map +1 -0
- package/dist/src/team/teamGraphV3.d.ts +28 -0
- package/dist/src/team/teamGraphV3.d.ts.map +1 -0
- package/dist/src/team/teamGraphV3.js +640 -0
- package/dist/src/team/teamGraphV3.js.map +1 -0
- package/dist/src/team/teamPreferences.d.ts +11 -0
- package/dist/src/team/teamPreferences.d.ts.map +1 -0
- package/dist/src/team/teamPreferences.js +48 -0
- package/dist/src/team/teamPreferences.js.map +1 -0
- package/dist/src/team/teamPrompts.d.ts +16 -0
- package/dist/src/team/teamPrompts.d.ts.map +1 -0
- package/dist/src/team/teamPrompts.js +44 -0
- package/dist/src/team/teamPrompts.js.map +1 -0
- package/dist/src/team/teamRunView.d.ts +78 -0
- package/dist/src/team/teamRunView.d.ts.map +1 -0
- package/dist/src/team/teamRunView.js +205 -0
- package/dist/src/team/teamRunView.js.map +1 -0
- package/dist/src/team/teamRuntime.d.ts +19 -2
- package/dist/src/team/teamRuntime.d.ts.map +1 -1
- package/dist/src/team/teamRuntime.js +13 -7
- package/dist/src/team/teamRuntime.js.map +1 -1
- package/dist/src/tools/actoviqCoreTools.d.ts +2 -1
- package/dist/src/tools/actoviqCoreTools.d.ts.map +1 -1
- package/dist/src/tools/actoviqCoreTools.js +4 -1
- package/dist/src/tools/actoviqCoreTools.js.map +1 -1
- package/dist/src/tools/actoviqShellTools.d.ts.map +1 -1
- package/dist/src/tools/actoviqShellTools.js +10 -0
- package/dist/src/tools/actoviqShellTools.js.map +1 -1
- package/dist/src/tools/askUserQuestion/AskUserQuestionTool.d.ts.map +1 -1
- package/dist/src/tools/askUserQuestion/AskUserQuestionTool.js +2 -0
- package/dist/src/tools/askUserQuestion/AskUserQuestionTool.js.map +1 -1
- package/dist/src/tools/bash/BashTool.d.ts +33 -2
- package/dist/src/tools/bash/BashTool.d.ts.map +1 -1
- package/dist/src/tools/bash/BashTool.js +140 -2
- package/dist/src/tools/bash/BashTool.js.map +1 -1
- package/dist/src/tools/bash/prompt.d.ts +1 -1
- package/dist/src/tools/bash/prompt.d.ts.map +1 -1
- package/dist/src/tools/bash/prompt.js +1 -0
- package/dist/src/tools/bash/prompt.js.map +1 -1
- package/dist/src/tools/planMode/PlanModeTools.js +2 -2
- package/dist/src/tools/planMode/PlanModeTools.js.map +1 -1
- package/dist/src/tools/todo/TodoWriteTool.d.ts +1 -1
- package/dist/src/tui/actoviqTui.d.ts.map +1 -1
- package/dist/src/tui/actoviqTui.js +522 -97
- package/dist/src/tui/actoviqTui.js.map +1 -1
- package/dist/src/tui/pluginCatalog.d.ts.map +1 -1
- package/dist/src/tui/pluginCatalog.js +3 -1
- package/dist/src/tui/pluginCatalog.js.map +1 -1
- package/dist/src/types.d.ts +355 -23
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/types.js.map +1 -1
- package/dist/src/ui/commandSurface.d.ts.map +1 -1
- package/dist/src/ui/commandSurface.js +23 -3
- package/dist/src/ui/commandSurface.js.map +1 -1
- package/dist/src/workflow/workflowPersistence.d.ts.map +1 -1
- package/dist/src/workflow/workflowPersistence.js +2 -1
- package/dist/src/workflow/workflowPersistence.js.map +1 -1
- package/dist/src/workflow/workflowScriptRuntime.d.ts +4 -0
- package/dist/src/workflow/workflowScriptRuntime.d.ts.map +1 -1
- package/dist/src/workflow/workflowScriptRuntime.js +69 -18
- package/dist/src/workflow/workflowScriptRuntime.js.map +1 -1
- package/dist/src/workflow-v2/boundary.d.ts +2 -0
- package/dist/src/workflow-v2/boundary.d.ts.map +1 -0
- package/dist/src/workflow-v2/boundary.js +45 -0
- package/dist/src/workflow-v2/boundary.js.map +1 -0
- package/dist/src/workflow-v2/capabilities.d.ts +5 -0
- package/dist/src/workflow-v2/capabilities.d.ts.map +1 -0
- package/dist/src/workflow-v2/capabilities.js +32 -0
- package/dist/src/workflow-v2/capabilities.js.map +1 -0
- package/dist/src/workflow-v2/errors.d.ts +43 -0
- package/dist/src/workflow-v2/errors.d.ts.map +1 -0
- package/dist/src/workflow-v2/errors.js +84 -0
- package/dist/src/workflow-v2/errors.js.map +1 -0
- package/dist/src/workflow-v2/index.d.ts +9 -0
- package/dist/src/workflow-v2/index.d.ts.map +1 -0
- package/dist/src/workflow-v2/index.js +6 -0
- package/dist/src/workflow-v2/index.js.map +1 -0
- package/dist/src/workflow-v2/json.d.ts +5 -0
- package/dist/src/workflow-v2/json.d.ts.map +1 -0
- package/dist/src/workflow-v2/json.js +40 -0
- package/dist/src/workflow-v2/json.js.map +1 -0
- package/dist/src/workflow-v2/limits.d.ts +15 -0
- package/dist/src/workflow-v2/limits.d.ts.map +1 -0
- package/dist/src/workflow-v2/limits.js +37 -0
- package/dist/src/workflow-v2/limits.js.map +1 -0
- package/dist/src/workflow-v2/localIsolatedProcessExecutor.d.ts +25 -0
- package/dist/src/workflow-v2/localIsolatedProcessExecutor.d.ts.map +1 -0
- package/dist/src/workflow-v2/localIsolatedProcessExecutor.js +423 -0
- package/dist/src/workflow-v2/localIsolatedProcessExecutor.js.map +1 -0
- package/dist/src/workflow-v2/localProcessChild.d.ts +2 -0
- package/dist/src/workflow-v2/localProcessChild.d.ts.map +1 -0
- package/dist/src/workflow-v2/localProcessChild.js +305 -0
- package/dist/src/workflow-v2/localProcessChild.js.map +1 -0
- package/dist/src/workflow-v2/router.d.ts +10 -0
- package/dist/src/workflow-v2/router.d.ts.map +1 -0
- package/dist/src/workflow-v2/router.js +28 -0
- package/dist/src/workflow-v2/router.js.map +1 -0
- package/dist/src/workflow-v2/trustedCompatibilityExecutor.d.ts +17 -0
- package/dist/src/workflow-v2/trustedCompatibilityExecutor.d.ts.map +1 -0
- package/dist/src/workflow-v2/trustedCompatibilityExecutor.js +159 -0
- package/dist/src/workflow-v2/trustedCompatibilityExecutor.js.map +1 -0
- package/dist/src/workflow-v2/types.d.ts +67 -0
- package/dist/src/workflow-v2/types.d.ts.map +1 -0
- package/dist/src/workflow-v2/types.js +2 -0
- package/dist/src/workflow-v2/types.js.map +1 -0
- package/package.json +96 -10
|
@@ -0,0 +1,543 @@
|
|
|
1
|
+
import { BaseModelProvider, isRecord } from './adapter-base.js';
|
|
2
|
+
import { createModelRef, mergeModelCapabilities, MINIMAL_MODEL_CAPABILITIES, } from './capabilities.js';
|
|
3
|
+
import { attachStructuredOutput, finishReason, itemRecord, jsonObject, jsonValue, rawOutput, reasoningOutput, refusalOutput, textOutput, toolCallOutput, usageFromProvider, } from './mapping.js';
|
|
4
|
+
import { createModelStream } from './stream.js';
|
|
5
|
+
const LEGACY_CAPABILITIES = mergeModelCapabilities(MINIMAL_MODEL_CAPABILITIES, {
|
|
6
|
+
input: { image: true, document: true },
|
|
7
|
+
tools: { function: true, parallel: true },
|
|
8
|
+
reasoning: { request: true, opaqueRoundTrip: true },
|
|
9
|
+
streaming: true,
|
|
10
|
+
stopSequences: true,
|
|
11
|
+
providerRawRoundTrip: true,
|
|
12
|
+
});
|
|
13
|
+
/** Wraps the existing Anthropic-shaped ModelApi as a Provider v2 implementation. */
|
|
14
|
+
export class LegacyModelApiProvider extends BaseModelProvider {
|
|
15
|
+
modelApi;
|
|
16
|
+
constructor(options) {
|
|
17
|
+
super(options, {
|
|
18
|
+
id: 'legacy',
|
|
19
|
+
baseUrl: 'legacy://model-api',
|
|
20
|
+
capabilities: LEGACY_CAPABILITIES,
|
|
21
|
+
});
|
|
22
|
+
this.modelApi = options.modelApi;
|
|
23
|
+
}
|
|
24
|
+
async generate(request, context = {}) {
|
|
25
|
+
const { model } = await this.prepare(request, context, false);
|
|
26
|
+
const message = await this.modelApi.createMessage(toLegacyRequest(request, model, context));
|
|
27
|
+
return fromLegacyMessage(message, model, request, this.id, this.includeRawResponse);
|
|
28
|
+
}
|
|
29
|
+
stream(request, context = {}) {
|
|
30
|
+
const state = { request };
|
|
31
|
+
const mapper = {
|
|
32
|
+
state,
|
|
33
|
+
map: (event, current) => this.mapLegacyStreamEvent(event, current),
|
|
34
|
+
finalize: current => {
|
|
35
|
+
if (!current.response)
|
|
36
|
+
throw new Error('Legacy ModelApi stream ended without a final message.');
|
|
37
|
+
return current.response;
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
return createModelStream({
|
|
41
|
+
context,
|
|
42
|
+
mapper,
|
|
43
|
+
start: async (streamContext) => {
|
|
44
|
+
const { model } = await this.prepare(request, streamContext, true);
|
|
45
|
+
state.model = model;
|
|
46
|
+
const legacyStream = this.modelApi.streamMessage(toLegacyRequest(request, model, streamContext));
|
|
47
|
+
return withLegacyFinalMessage(legacyStream);
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
mapLegacyStreamEvent(event, state) {
|
|
52
|
+
if (!isRecord(event))
|
|
53
|
+
return [];
|
|
54
|
+
if (event.type === '__legacy_final' && isRecord(event.message)) {
|
|
55
|
+
if (!state.model)
|
|
56
|
+
throw new Error('Legacy stream completed before model resolution.');
|
|
57
|
+
state.response = fromLegacyMessage(event.message, state.model, state.request, this.id, this.includeRawResponse);
|
|
58
|
+
return [{ type: 'response.completed', response: state.response }];
|
|
59
|
+
}
|
|
60
|
+
if (event.type === 'content_block_delta' && isRecord(event.delta)) {
|
|
61
|
+
const outputIndex = typeof event.index === 'number' ? event.index : undefined;
|
|
62
|
+
if (event.delta.type === 'text_delta' && typeof event.delta.text === 'string') {
|
|
63
|
+
return [{ type: 'text.delta', delta: event.delta.text, outputIndex }];
|
|
64
|
+
}
|
|
65
|
+
if (event.delta.type === 'thinking_delta' && typeof event.delta.thinking === 'string') {
|
|
66
|
+
return [{ type: 'reasoning.delta', delta: event.delta.thinking, outputIndex }];
|
|
67
|
+
}
|
|
68
|
+
if (event.delta.type === 'input_json_delta' && typeof event.delta.partial_json === 'string') {
|
|
69
|
+
return [{
|
|
70
|
+
type: 'tool_call.delta',
|
|
71
|
+
callId: `legacy_tool_${outputIndex ?? 0}`,
|
|
72
|
+
argumentsDelta: event.delta.partial_json,
|
|
73
|
+
outputIndex,
|
|
74
|
+
}];
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
if (event.type === 'message_delta' && isRecord(event.usage)) {
|
|
78
|
+
return [{ type: 'usage', usage: legacyUsageToCore(event.usage) }];
|
|
79
|
+
}
|
|
80
|
+
return [{ type: 'provider.event', provider: this.id, event: jsonValue(event) }];
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
async function* withLegacyFinalMessage(stream) {
|
|
84
|
+
for await (const event of stream)
|
|
85
|
+
yield event;
|
|
86
|
+
yield { type: '__legacy_final', message: await stream.finalMessage() };
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Exposes a Provider v2 through the old ModelApi. This is the direction used by
|
|
90
|
+
* createAgentSdk({ modelApi: new ModelProviderLegacyAdapter(provider) }).
|
|
91
|
+
*/
|
|
92
|
+
export class ModelProviderLegacyAdapter {
|
|
93
|
+
provider;
|
|
94
|
+
constructor(provider) {
|
|
95
|
+
this.provider = provider;
|
|
96
|
+
}
|
|
97
|
+
async createMessage(request) {
|
|
98
|
+
const response = await this.provider.generate(fromLegacyRequest(request, this.provider.id), { signal: request.signal });
|
|
99
|
+
return toLegacyMessage(response);
|
|
100
|
+
}
|
|
101
|
+
streamMessage(request) {
|
|
102
|
+
const stream = this.provider.stream(fromLegacyRequest(request, this.provider.id), { signal: request.signal });
|
|
103
|
+
return new ProviderToLegacyStream(stream);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
class ProviderToLegacyStream {
|
|
107
|
+
stream;
|
|
108
|
+
started = false;
|
|
109
|
+
finalPromise;
|
|
110
|
+
resolveFinal;
|
|
111
|
+
rejectFinal;
|
|
112
|
+
constructor(stream) {
|
|
113
|
+
this.stream = stream;
|
|
114
|
+
this.finalPromise = new Promise((resolve, reject) => {
|
|
115
|
+
this.resolveFinal = resolve;
|
|
116
|
+
this.rejectFinal = reject;
|
|
117
|
+
});
|
|
118
|
+
this.finalPromise.catch(() => { });
|
|
119
|
+
}
|
|
120
|
+
async finalMessage() {
|
|
121
|
+
if (!this.started) {
|
|
122
|
+
for await (const _event of this) {
|
|
123
|
+
// Drain.
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return this.finalPromise;
|
|
127
|
+
}
|
|
128
|
+
[Symbol.asyncIterator]() {
|
|
129
|
+
if (this.started)
|
|
130
|
+
throw new Error('Legacy model streams are single-consumer iterables.');
|
|
131
|
+
this.started = true;
|
|
132
|
+
return this.consume()[Symbol.asyncIterator]();
|
|
133
|
+
}
|
|
134
|
+
async *consume() {
|
|
135
|
+
const blockIndexByKey = new Map();
|
|
136
|
+
let nextIndex = 0;
|
|
137
|
+
let messageStarted = false;
|
|
138
|
+
let completed = false;
|
|
139
|
+
try {
|
|
140
|
+
for await (const event of this.stream) {
|
|
141
|
+
if (!messageStarted) {
|
|
142
|
+
messageStarted = true;
|
|
143
|
+
yield {
|
|
144
|
+
type: 'message_start',
|
|
145
|
+
message: {
|
|
146
|
+
id: 'msg_stream',
|
|
147
|
+
type: 'message',
|
|
148
|
+
role: 'assistant',
|
|
149
|
+
model: 'unknown',
|
|
150
|
+
content: [],
|
|
151
|
+
stop_reason: null,
|
|
152
|
+
},
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
if (event.type === 'text.delta') {
|
|
156
|
+
const index = ensureLegacyBlock(blockIndexByKey, 'text', () => nextIndex++);
|
|
157
|
+
if (!blockIndexByKey.has('text.started')) {
|
|
158
|
+
blockIndexByKey.set('text.started', index);
|
|
159
|
+
yield { type: 'content_block_start', index, content_block: { type: 'text', text: '' } };
|
|
160
|
+
}
|
|
161
|
+
yield { type: 'content_block_delta', index, delta: { type: 'text_delta', text: event.delta } };
|
|
162
|
+
}
|
|
163
|
+
else if (event.type === 'reasoning.delta') {
|
|
164
|
+
const index = ensureLegacyBlock(blockIndexByKey, 'reasoning', () => nextIndex++);
|
|
165
|
+
if (!blockIndexByKey.has('reasoning.started')) {
|
|
166
|
+
blockIndexByKey.set('reasoning.started', index);
|
|
167
|
+
yield {
|
|
168
|
+
type: 'content_block_start',
|
|
169
|
+
index,
|
|
170
|
+
content_block: { type: 'thinking', thinking: '' },
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
yield {
|
|
174
|
+
type: 'content_block_delta',
|
|
175
|
+
index,
|
|
176
|
+
delta: { type: 'thinking_delta', thinking: event.delta ?? '' },
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
else if (event.type === 'tool_call.delta') {
|
|
180
|
+
const key = `tool:${event.callId}`;
|
|
181
|
+
const index = ensureLegacyBlock(blockIndexByKey, key, () => nextIndex++);
|
|
182
|
+
if (!blockIndexByKey.has(`${key}.started`)) {
|
|
183
|
+
blockIndexByKey.set(`${key}.started`, index);
|
|
184
|
+
yield {
|
|
185
|
+
type: 'content_block_start',
|
|
186
|
+
index,
|
|
187
|
+
content_block: {
|
|
188
|
+
type: 'tool_use',
|
|
189
|
+
id: event.callId,
|
|
190
|
+
name: event.name ?? '',
|
|
191
|
+
input: {},
|
|
192
|
+
},
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
if (event.argumentsDelta) {
|
|
196
|
+
yield {
|
|
197
|
+
type: 'content_block_delta',
|
|
198
|
+
index,
|
|
199
|
+
delta: { type: 'input_json_delta', partial_json: event.argumentsDelta },
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
else if (event.type === 'usage') {
|
|
204
|
+
yield { type: 'message_delta', delta: {}, usage: coreUsageToLegacy(event.usage) };
|
|
205
|
+
}
|
|
206
|
+
else if (event.type === 'response.completed') {
|
|
207
|
+
for (const [key, index] of blockIndexByKey) {
|
|
208
|
+
if (!key.endsWith('.started'))
|
|
209
|
+
yield { type: 'content_block_stop', index };
|
|
210
|
+
}
|
|
211
|
+
const message = toLegacyMessage(event.response);
|
|
212
|
+
this.resolveFinal(message);
|
|
213
|
+
yield {
|
|
214
|
+
type: 'message_delta',
|
|
215
|
+
delta: { stop_reason: message.stop_reason },
|
|
216
|
+
usage: message.usage,
|
|
217
|
+
};
|
|
218
|
+
yield { type: 'message_stop' };
|
|
219
|
+
completed = true;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
if (!completed) {
|
|
223
|
+
const response = await this.stream.finalResponse();
|
|
224
|
+
const message = toLegacyMessage(response);
|
|
225
|
+
this.resolveFinal(message);
|
|
226
|
+
yield { type: 'message_stop' };
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
catch (error) {
|
|
230
|
+
this.rejectFinal(error);
|
|
231
|
+
throw error;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
function ensureLegacyBlock(blocks, key, create) {
|
|
236
|
+
const existing = blocks.get(key);
|
|
237
|
+
if (existing !== undefined)
|
|
238
|
+
return existing;
|
|
239
|
+
const index = create();
|
|
240
|
+
blocks.set(key, index);
|
|
241
|
+
return index;
|
|
242
|
+
}
|
|
243
|
+
function toLegacyRequest(request, model, context) {
|
|
244
|
+
const system = request.input
|
|
245
|
+
.map(itemRecord)
|
|
246
|
+
.filter(item => item.type === 'text' && item.role === 'system' && typeof item.text === 'string')
|
|
247
|
+
.map(item => item.text)
|
|
248
|
+
.join('\n\n');
|
|
249
|
+
const messages = request.input
|
|
250
|
+
.filter(item => !(itemRecord(item).type === 'text' && itemRecord(item).role === 'system'))
|
|
251
|
+
.map(toLegacyMessageParam);
|
|
252
|
+
return {
|
|
253
|
+
model: model.modelId,
|
|
254
|
+
messages,
|
|
255
|
+
max_tokens: request.maxOutputTokens ?? 4_096,
|
|
256
|
+
system: system || undefined,
|
|
257
|
+
temperature: request.temperature,
|
|
258
|
+
tools: request.tools?.map(tool => ({
|
|
259
|
+
name: tool.name,
|
|
260
|
+
description: tool.description,
|
|
261
|
+
input_schema: tool.inputSchema,
|
|
262
|
+
strict: tool.strict,
|
|
263
|
+
})),
|
|
264
|
+
tool_choice: toLegacyToolChoice(request.toolPolicy, request.parallelToolCalls),
|
|
265
|
+
metadata: request.metadata,
|
|
266
|
+
stop_sequences: request.stopSequences ? [...request.stopSequences] : undefined,
|
|
267
|
+
effort: request.reasoning?.effort === 'none' || request.reasoning?.effort === 'minimal'
|
|
268
|
+
? 'low'
|
|
269
|
+
: request.reasoning?.effort === 'xhigh'
|
|
270
|
+
? 'high'
|
|
271
|
+
: request.reasoning?.effort,
|
|
272
|
+
signal: context.signal,
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
function toLegacyMessageParam(item) {
|
|
276
|
+
const record = itemRecord(item);
|
|
277
|
+
const role = record.role === 'assistant' || record.type === 'tool_call' || record.type === 'reasoning'
|
|
278
|
+
? 'assistant'
|
|
279
|
+
: 'user';
|
|
280
|
+
let block;
|
|
281
|
+
switch (record.type) {
|
|
282
|
+
case 'text':
|
|
283
|
+
block = { type: 'text', text: String(record.text ?? '') };
|
|
284
|
+
break;
|
|
285
|
+
case 'image': {
|
|
286
|
+
const source = isRecord(record.source) ? record.source : {};
|
|
287
|
+
block = {
|
|
288
|
+
type: 'image',
|
|
289
|
+
source: source.kind === 'url'
|
|
290
|
+
? { type: 'url', url: source.url }
|
|
291
|
+
: source.kind === 'file'
|
|
292
|
+
? { type: 'file', file_id: source.fileId }
|
|
293
|
+
: {
|
|
294
|
+
type: 'base64',
|
|
295
|
+
media_type: source.mediaType,
|
|
296
|
+
data: source.data,
|
|
297
|
+
},
|
|
298
|
+
};
|
|
299
|
+
break;
|
|
300
|
+
}
|
|
301
|
+
case 'tool_call':
|
|
302
|
+
block = {
|
|
303
|
+
type: 'tool_use',
|
|
304
|
+
id: String(record.id ?? ''),
|
|
305
|
+
name: String(record.name ?? ''),
|
|
306
|
+
input: (record.input ?? {}),
|
|
307
|
+
};
|
|
308
|
+
break;
|
|
309
|
+
case 'tool_result':
|
|
310
|
+
block = {
|
|
311
|
+
type: 'tool_result',
|
|
312
|
+
tool_use_id: String(record.callId ?? ''),
|
|
313
|
+
content: typeof record.output === 'string' ? record.output : JSON.stringify(record.output ?? null),
|
|
314
|
+
is_error: record.status === 'error',
|
|
315
|
+
};
|
|
316
|
+
break;
|
|
317
|
+
case 'reasoning':
|
|
318
|
+
block = isRecord(record.opaque)
|
|
319
|
+
? record.opaque
|
|
320
|
+
: { type: 'thinking', thinking: String(record.summary ?? record.opaque ?? '') };
|
|
321
|
+
break;
|
|
322
|
+
case 'structured':
|
|
323
|
+
block = { type: 'text', text: JSON.stringify(record.value ?? null) };
|
|
324
|
+
break;
|
|
325
|
+
case 'raw':
|
|
326
|
+
block = isRecord(record.value)
|
|
327
|
+
? record.value
|
|
328
|
+
: { type: 'text', text: String(record.value ?? '') };
|
|
329
|
+
break;
|
|
330
|
+
default:
|
|
331
|
+
block = { type: 'text', text: JSON.stringify(jsonValue(record)) };
|
|
332
|
+
}
|
|
333
|
+
return { role, content: [block] };
|
|
334
|
+
}
|
|
335
|
+
function fromLegacyMessage(message, model, request, providerId, includeRawResponse) {
|
|
336
|
+
const output = [];
|
|
337
|
+
for (const block of message.content) {
|
|
338
|
+
if (block.type === 'text' && typeof block.text === 'string') {
|
|
339
|
+
output.push(textOutput(block.text));
|
|
340
|
+
}
|
|
341
|
+
else if (block.type === 'tool_use') {
|
|
342
|
+
output.push(toolCallOutput(String(block.id ?? ''), String(block.name ?? ''), block.input ?? {}));
|
|
343
|
+
}
|
|
344
|
+
else if (block.type === 'thinking') {
|
|
345
|
+
output.push(reasoningOutput(providerId, block, typeof block.thinking === 'string' ? block.thinking : undefined));
|
|
346
|
+
}
|
|
347
|
+
else if (block.type === 'refusal') {
|
|
348
|
+
output.push(refusalOutput(String(block.explanation ?? 'Refused.'), block));
|
|
349
|
+
}
|
|
350
|
+
else {
|
|
351
|
+
output.push(rawOutput(providerId, block));
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
const parsedStructuredOutput = attachStructuredOutput(request, output);
|
|
355
|
+
return {
|
|
356
|
+
id: message.id,
|
|
357
|
+
model,
|
|
358
|
+
output,
|
|
359
|
+
finishReason: finishReason(message.stop_reason),
|
|
360
|
+
usage: legacyUsageToCore(message.usage),
|
|
361
|
+
structuredOutput: parsedStructuredOutput,
|
|
362
|
+
...(includeRawResponse ? { rawResponse: jsonValue(message) } : {}),
|
|
363
|
+
};
|
|
364
|
+
}
|
|
365
|
+
function fromLegacyRequest(request, providerId) {
|
|
366
|
+
const input = [];
|
|
367
|
+
if (request.system)
|
|
368
|
+
input.push({ type: 'text', role: 'system', text: request.system });
|
|
369
|
+
for (const message of request.messages) {
|
|
370
|
+
if (typeof message.content === 'string') {
|
|
371
|
+
input.push({ type: 'text', role: message.role, text: message.content });
|
|
372
|
+
continue;
|
|
373
|
+
}
|
|
374
|
+
for (const block of message.content) {
|
|
375
|
+
const record = block;
|
|
376
|
+
if (record.type === 'text') {
|
|
377
|
+
input.push({ type: 'text', role: message.role, text: String(record.text ?? '') });
|
|
378
|
+
}
|
|
379
|
+
else if (record.type === 'image' && isRecord(record.source)) {
|
|
380
|
+
const source = record.source;
|
|
381
|
+
const coreSource = source.type === 'url'
|
|
382
|
+
? { kind: 'url', url: String(source.url ?? '') }
|
|
383
|
+
: source.type === 'file'
|
|
384
|
+
? { kind: 'file', fileId: String(source.file_id ?? '') }
|
|
385
|
+
: {
|
|
386
|
+
kind: 'base64',
|
|
387
|
+
mediaType: String(source.media_type ?? 'image/png'),
|
|
388
|
+
data: String(source.data ?? ''),
|
|
389
|
+
};
|
|
390
|
+
input.push({ type: 'image', role: message.role, source: coreSource });
|
|
391
|
+
}
|
|
392
|
+
else if (record.type === 'tool_use') {
|
|
393
|
+
input.push({
|
|
394
|
+
type: 'tool_call',
|
|
395
|
+
id: String(record.id ?? ''),
|
|
396
|
+
name: String(record.name ?? ''),
|
|
397
|
+
input: jsonObject(record.input),
|
|
398
|
+
});
|
|
399
|
+
}
|
|
400
|
+
else if (record.type === 'tool_result') {
|
|
401
|
+
input.push({
|
|
402
|
+
type: 'tool_result',
|
|
403
|
+
callId: String(record.tool_use_id ?? ''),
|
|
404
|
+
status: record.is_error === true ? 'error' : 'success',
|
|
405
|
+
output: jsonValue(record.content ?? ''),
|
|
406
|
+
});
|
|
407
|
+
}
|
|
408
|
+
else if (record.type === 'thinking') {
|
|
409
|
+
input.push({
|
|
410
|
+
type: 'reasoning',
|
|
411
|
+
provider: providerId,
|
|
412
|
+
summary: typeof record.thinking === 'string' ? record.thinking : undefined,
|
|
413
|
+
opaque: jsonValue(record),
|
|
414
|
+
});
|
|
415
|
+
}
|
|
416
|
+
else {
|
|
417
|
+
input.push({ type: 'raw', provider: providerId, value: jsonValue(record) });
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
return {
|
|
422
|
+
model: createModelRef(providerId, request.model),
|
|
423
|
+
input,
|
|
424
|
+
tools: request.tools?.map(fromLegacyTool),
|
|
425
|
+
toolPolicy: fromLegacyToolChoice(request.tool_choice),
|
|
426
|
+
parallelToolCalls: parallelFromLegacyToolChoice(request.tool_choice),
|
|
427
|
+
maxOutputTokens: request.max_tokens,
|
|
428
|
+
temperature: request.temperature,
|
|
429
|
+
stopSequences: request.stop_sequences,
|
|
430
|
+
metadata: request.metadata ? jsonObject(request.metadata) : undefined,
|
|
431
|
+
reasoning: request.effort ? { effort: request.effort } : undefined,
|
|
432
|
+
};
|
|
433
|
+
}
|
|
434
|
+
function fromLegacyTool(tool) {
|
|
435
|
+
return {
|
|
436
|
+
name: tool.name,
|
|
437
|
+
description: tool.description,
|
|
438
|
+
inputSchema: jsonObject(tool.input_schema),
|
|
439
|
+
strict: tool.strict,
|
|
440
|
+
};
|
|
441
|
+
}
|
|
442
|
+
function toLegacyMessage(response) {
|
|
443
|
+
const content = [];
|
|
444
|
+
const hasTextOutput = response.output.some(item => item.type === 'text');
|
|
445
|
+
for (const item of response.output) {
|
|
446
|
+
const record = itemRecord(item);
|
|
447
|
+
if (record.type === 'text') {
|
|
448
|
+
content.push({ type: 'text', text: String(record.text ?? '') });
|
|
449
|
+
}
|
|
450
|
+
else if (record.type === 'tool_call') {
|
|
451
|
+
content.push({
|
|
452
|
+
type: 'tool_use',
|
|
453
|
+
id: String(record.id ?? ''),
|
|
454
|
+
name: String(record.name ?? ''),
|
|
455
|
+
input: (record.input ?? {}),
|
|
456
|
+
});
|
|
457
|
+
}
|
|
458
|
+
else if (record.type === 'reasoning') {
|
|
459
|
+
content.push(isRecord(record.opaque)
|
|
460
|
+
? record.opaque
|
|
461
|
+
: { type: 'thinking', thinking: String(record.summary ?? record.opaque ?? '') });
|
|
462
|
+
}
|
|
463
|
+
else if (record.type === 'structured') {
|
|
464
|
+
if (!hasTextOutput) {
|
|
465
|
+
content.push({ type: 'text', text: JSON.stringify(record.value ?? null) });
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
else if (record.type === 'refusal') {
|
|
469
|
+
content.push({ type: 'text', text: String(record.message ?? 'Refused.') });
|
|
470
|
+
}
|
|
471
|
+
else if (record.type === 'raw' && isRecord(record.value)) {
|
|
472
|
+
content.push(record.value);
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
return {
|
|
476
|
+
id: response.id,
|
|
477
|
+
type: 'message',
|
|
478
|
+
role: 'assistant',
|
|
479
|
+
model: response.model.modelId,
|
|
480
|
+
content,
|
|
481
|
+
stop_reason: toLegacyStopReason(response.finishReason),
|
|
482
|
+
stop_sequence: null,
|
|
483
|
+
usage: coreUsageToLegacy(response.usage),
|
|
484
|
+
};
|
|
485
|
+
}
|
|
486
|
+
function legacyUsageToCore(usage) {
|
|
487
|
+
const base = usageFromProvider(usage, {
|
|
488
|
+
input: ['input_tokens'],
|
|
489
|
+
output: ['output_tokens'],
|
|
490
|
+
cachedInput: ['cache_read_input_tokens'],
|
|
491
|
+
cacheWrite: ['cache_creation_input_tokens'],
|
|
492
|
+
reasoning: ['output_tokens_details.thinking_tokens'],
|
|
493
|
+
});
|
|
494
|
+
const inputTokens = base.inputTokens + base.cacheReadTokens + base.cacheWriteTokens;
|
|
495
|
+
return { ...base, inputTokens, totalTokens: inputTokens + base.outputTokens };
|
|
496
|
+
}
|
|
497
|
+
function coreUsageToLegacy(usage) {
|
|
498
|
+
return {
|
|
499
|
+
input_tokens: usage.inputTokens,
|
|
500
|
+
output_tokens: usage.outputTokens,
|
|
501
|
+
cache_read_input_tokens: usage.cacheReadTokens,
|
|
502
|
+
cache_creation_input_tokens: usage.cacheWriteTokens,
|
|
503
|
+
};
|
|
504
|
+
}
|
|
505
|
+
function toLegacyToolChoice(policy, parallel) {
|
|
506
|
+
if (!policy && parallel === undefined)
|
|
507
|
+
return undefined;
|
|
508
|
+
const disable = parallel === undefined ? undefined : !parallel;
|
|
509
|
+
if (!policy || policy === 'auto')
|
|
510
|
+
return { type: 'auto', disable_parallel_tool_use: disable };
|
|
511
|
+
if (policy === 'required')
|
|
512
|
+
return { type: 'any', disable_parallel_tool_use: disable };
|
|
513
|
+
if (policy === 'none')
|
|
514
|
+
return { type: 'none', disable_parallel_tool_use: disable };
|
|
515
|
+
return { type: 'tool', name: policy.name, disable_parallel_tool_use: disable };
|
|
516
|
+
}
|
|
517
|
+
function fromLegacyToolChoice(choice) {
|
|
518
|
+
if (!choice)
|
|
519
|
+
return undefined;
|
|
520
|
+
if (choice.type === 'any')
|
|
521
|
+
return 'required';
|
|
522
|
+
if (choice.type === 'tool' && typeof choice.name === 'string') {
|
|
523
|
+
return { type: 'tool', name: choice.name };
|
|
524
|
+
}
|
|
525
|
+
if (choice.type === 'none')
|
|
526
|
+
return 'none';
|
|
527
|
+
return 'auto';
|
|
528
|
+
}
|
|
529
|
+
function parallelFromLegacyToolChoice(choice) {
|
|
530
|
+
if (!choice || !('disable_parallel_tool_use' in choice))
|
|
531
|
+
return undefined;
|
|
532
|
+
return choice.disable_parallel_tool_use === undefined
|
|
533
|
+
? undefined
|
|
534
|
+
: !choice.disable_parallel_tool_use;
|
|
535
|
+
}
|
|
536
|
+
function toLegacyStopReason(reason) {
|
|
537
|
+
if (reason === 'tool_calls')
|
|
538
|
+
return 'tool_use';
|
|
539
|
+
if (reason === 'length')
|
|
540
|
+
return 'max_tokens';
|
|
541
|
+
return reason === 'stop' ? 'end_turn' : reason;
|
|
542
|
+
}
|
|
543
|
+
//# sourceMappingURL=legacy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legacy.js","sourceRoot":"","sources":["../../../src/providers-v2/legacy.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAiB,MAAM,mBAAmB,CAAC;AAC/E,OAAO,EACL,cAAc,EACd,sBAAsB,EACtB,0BAA0B,GAC3B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,sBAAsB,EACtB,YAAY,EACZ,UAAU,EACV,UAAU,EACV,SAAS,EACT,SAAS,EACT,eAAe,EACf,aAAa,EACb,UAAU,EACV,cAAc,EACd,iBAAiB,GAElB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,iBAAiB,EAA0B,MAAM,aAAa,CAAC;AAcxE,MAAM,mBAAmB,GAAsB,sBAAsB,CACnE,0BAA0B,EAC1B;IACE,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE;IACtC,KAAK,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE;IACzC,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE;IACnD,SAAS,EAAE,IAAI;IACf,aAAa,EAAE,IAAI;IACnB,o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AM;QAAE,OAAO,MAAM,CAAC;IAC1C,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAS,4BAA4B,CAAC,MAAoC;IACxE,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC,2BAA2B,IAAI,MAAM,CAAC;QAAE,OAAO,SAAS,CAAC;IAC1E,OAAO,MAAM,CAAC,yBAAyB,KAAK,SAAS;QACnD,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,CAAC,MAAM,CAAC,yBAAyB,CAAC;AACxC,CAAC;AAED,SAAS,kBAAkB,CAAC,MAAqC;IAC/D,IAAI,MAAM,KAAK,YAAY;QAAE,OAAO,UAAU,CAAC;IAC/C,IAAI,MAAM,KAAK,QAAQ;QAAE,OAAO,YAAY,CAAC;IAC7C,OAAO,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC;AACjD,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { InputItem, JsonObject, JsonValue, OutputItem, Usage } from '../core/index.js';
|
|
2
|
+
import type { ModelFinishReason, ModelRequest } from './types.js';
|
|
3
|
+
export interface ImageSourceParts {
|
|
4
|
+
readonly kind: 'url' | 'base64' | 'file';
|
|
5
|
+
readonly url?: string;
|
|
6
|
+
readonly data?: string;
|
|
7
|
+
readonly mediaType?: string;
|
|
8
|
+
readonly fileId?: string;
|
|
9
|
+
readonly detail?: 'auto' | 'low' | 'high';
|
|
10
|
+
readonly role: 'user' | 'assistant';
|
|
11
|
+
}
|
|
12
|
+
export declare function itemRecord(item: InputItem | OutputItem): Record<string, unknown>;
|
|
13
|
+
export declare function imageSourceParts(item: InputItem): ImageSourceParts;
|
|
14
|
+
export declare function textOutput(text: string): OutputItem;
|
|
15
|
+
export declare function toolCallOutput(id: string, name: string, input: unknown): OutputItem;
|
|
16
|
+
export declare function reasoningOutput(provider: string, opaque: unknown, summary?: string): OutputItem;
|
|
17
|
+
export declare function rawOutput(provider: string, value: unknown): OutputItem;
|
|
18
|
+
export declare function refusalOutput(message: string, providerData?: unknown): OutputItem;
|
|
19
|
+
export declare function usageFromProvider(providerUsage: unknown, mapping: {
|
|
20
|
+
readonly input: readonly string[];
|
|
21
|
+
readonly output: readonly string[];
|
|
22
|
+
readonly total?: readonly string[];
|
|
23
|
+
readonly cachedInput?: readonly string[];
|
|
24
|
+
readonly cacheWrite?: readonly string[];
|
|
25
|
+
readonly reasoning?: readonly string[];
|
|
26
|
+
}): Usage;
|
|
27
|
+
export declare function zeroUsage(): Usage;
|
|
28
|
+
export declare function structuredOutput(request: ModelRequest, output: readonly OutputItem[]): JsonValue | undefined;
|
|
29
|
+
export declare function attachStructuredOutput(request: ModelRequest, output: OutputItem[]): JsonValue | undefined;
|
|
30
|
+
export declare function finishReason(value: unknown): ModelFinishReason;
|
|
31
|
+
export declare function providerRawInput(item: InputItem): unknown;
|
|
32
|
+
export declare function jsonObject(value: unknown): JsonObject;
|
|
33
|
+
export declare function jsonValue(value: unknown): JsonValue;
|
|
34
|
+
//# sourceMappingURL=mapping.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mapping.d.ts","sourceRoot":"","sources":["../../../src/providers-v2/mapping.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,UAAU,EACV,SAAS,EACT,UAAU,EACV,KAAK,EACN,MAAM,kBAAkB,CAAC;AAG1B,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAElE,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,IAAI,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;IACzC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC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