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
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { execSync, spawnSync } from 'node:child_process';
|
|
9
9
|
import fs from 'node:fs';
|
|
10
|
-
import os from 'node:os';
|
|
11
10
|
import path from 'node:path';
|
|
12
11
|
import * as readline from 'node:readline';
|
|
13
|
-
import { createActoviqCoreTools, createAgentSdk, detectBridgeProviders, loadDefaultActoviqSettings, loadJsonConfigFile, listWorkflows, loadWorkflow, listTeamDefinitions, loadTeamDefinition, createModelTeam, createTeamTool, listRouterProfiles, loadRouterProfile, resolveRoutedRun, WorktreeService, } from '../index.js';
|
|
12
|
+
import { createActoviqCoreTools, createAgentSdk, detectBridgeProviders, loadDefaultActoviqSettings, loadJsonConfigFile, listWorkflows, loadWorkflow, listTeamDefinitions, loadTeamDefinition, cloneTeamDefinition, instantiateTeamDefinition, listTeamAgentLabels, countTeamAgents, createModelTeam, createTeamTool, readTeamPreferences, createManagerTools, buildManagerSystemPrompt, buildUpdateProgressPrompt, formatManagerUpdatePreview, resolveGitHubDigestForUpdate, readManagerConfig, writeManagerConfig, readProjectPlanFile, readProgressFile, managerProgressPath, createProjectIssue, executeProjectIssue, isIssueStatus, isIssueStorageMode, listProjectIssues, listScheduledAutomationTasks, resolveActoviqHome, listRouterProfiles, loadRouterProfile, resolveRoutedRun, transitionProjectIssue, WorktreeService, } from '../index.js';
|
|
13
|
+
import { readProjectMeta } from '../gui/projectMeta.js';
|
|
14
14
|
import { persistActoviqSettingsStore, resolveActoviqSettingsStore, } from '../config/actoviqSettingsStore.js';
|
|
15
15
|
import { createPreToolUseHookClassifier, readPreToolUseHooks, readPostToolUseHooks, runPostToolUseHooks, readSessionStartHooks, runSessionStartHooks } from '../hooks/userHooks.js';
|
|
16
16
|
import { isRecord } from '../runtime/helpers.js';
|
|
@@ -20,9 +20,11 @@ import { buildRouteModelApi } from '../router/modelRouter.js';
|
|
|
20
20
|
import { addMcpServer, readMcpServerConfig, removeMcpServer } from '../mcp/mcpServerConfig.js';
|
|
21
21
|
import { isReadOnlyBashCommand } from '../runtime/bashClassification.js';
|
|
22
22
|
import { estimateCost } from '../team/pricing.js';
|
|
23
|
+
import { applyTeamRunEvent, createTeamRunViewState, formatTeamRunTreeLines } from '../team/teamRunView.js';
|
|
23
24
|
import { applyOutputStyle, OUTPUT_STYLES } from '../prompts/outputStyles.js';
|
|
24
25
|
import { planFilePath, readPlanFile } from '../tools/planMode/PlanModeTools.js';
|
|
25
26
|
import { loadProjectContext } from '../memory/projectContext.js';
|
|
27
|
+
import { LegacySurfaceEventPipeline, } from '../surfaces/index.js';
|
|
26
28
|
import { pathToFileURL } from 'node:url';
|
|
27
29
|
import { ACTOVIQ_INTERACTIVE_COMMANDS, SUBCOMMAND_DESCRIPTIONS, filterInteractiveCommands, } from '../ui/commandSurface.js';
|
|
28
30
|
import { A, stringWidth, truncateToWidth, wrapToWidth } from './ansi.js';
|
|
@@ -165,7 +167,7 @@ function buildSystemPrompt(workDir) {
|
|
|
165
167
|
`- NEVER create documentation files (*.md) unless explicitly requested.\n` +
|
|
166
168
|
`- When in doubt, use TodoWrite to track progress.`) + projectSection;
|
|
167
169
|
}
|
|
168
|
-
// First-run onboarding: guides the user through creating
|
|
170
|
+
// First-run onboarding: guides the user through creating the Actoviq settings file
|
|
169
171
|
// when no credential is found. Uses plain readline (no TTY required beyond stdin).
|
|
170
172
|
async function onboardCredentials(configPath) {
|
|
171
173
|
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
@@ -179,8 +181,7 @@ async function onboardCredentials(configPath) {
|
|
|
179
181
|
const resolvedProvider = provider.trim() || 'anthropic';
|
|
180
182
|
const resolvedBaseURL = baseURL.trim() || 'https://api.deepseek.com';
|
|
181
183
|
const resolvedModel = model.trim() || 'deepseek-chat';
|
|
182
|
-
const
|
|
183
|
-
const dir = path.join(home, '.actoviq');
|
|
184
|
+
const dir = resolveActoviqHome();
|
|
184
185
|
const file = configPath ?? path.join(dir, 'settings.json');
|
|
185
186
|
fs.mkdirSync(dir, { recursive: true });
|
|
186
187
|
const env = {
|
|
@@ -209,7 +210,14 @@ export async function runActoviqTui(options = {}) {
|
|
|
209
210
|
catch {
|
|
210
211
|
// Missing local config is fine; env vars may carry credentials.
|
|
211
212
|
}
|
|
212
|
-
|
|
213
|
+
let applyPlanPermission = null;
|
|
214
|
+
const tools = createActoviqCoreTools({
|
|
215
|
+
cwd: workDir,
|
|
216
|
+
onPlanModeChange: async (mode) => {
|
|
217
|
+
if (mode === 'plan')
|
|
218
|
+
await applyPlanPermission?.();
|
|
219
|
+
},
|
|
220
|
+
});
|
|
213
221
|
const createCleanSdk = () => createAgentSdk({
|
|
214
222
|
workDir,
|
|
215
223
|
tools,
|
|
@@ -288,8 +296,28 @@ export async function runActoviqTui(options = {}) {
|
|
|
288
296
|
let commandBusy = false;
|
|
289
297
|
let shuttingDown = false;
|
|
290
298
|
// Active team tool the main agent may call (toggled via /team). null = no team.
|
|
299
|
+
// The tool is only injected into runs when preferences.team.autoInvoke is on;
|
|
300
|
+
// otherwise attach is a selection and /team ask stays the manual path.
|
|
301
|
+
const teamPrefs = readTeamPreferences(getLoadedJsonConfig()?.raw);
|
|
291
302
|
let activeTeamTool = null;
|
|
292
303
|
let activeTeamName = null;
|
|
304
|
+
let lastTeamRunSummary = null;
|
|
305
|
+
const attachTeamByName = (name) => {
|
|
306
|
+
const loaded = loadTeamDefinition(name, sdk.config.workDir);
|
|
307
|
+
if (!loaded)
|
|
308
|
+
return null;
|
|
309
|
+
const definition = instantiateTeamDefinition(loaded.definition, session.model);
|
|
310
|
+
activeTeamTool = createTeamTool(definition);
|
|
311
|
+
activeTeamName = definition.name;
|
|
312
|
+
return definition;
|
|
313
|
+
};
|
|
314
|
+
if (teamPrefs.defaultAttached) {
|
|
315
|
+
// Unresolvable default names are ignored; /team status surfaces the hint.
|
|
316
|
+
try {
|
|
317
|
+
attachTeamByName(teamPrefs.defaultAttached);
|
|
318
|
+
}
|
|
319
|
+
catch { /* ignore */ }
|
|
320
|
+
}
|
|
293
321
|
// /model router: when set, each user turn is classified and routed to a model.
|
|
294
322
|
let activeRouter = null;
|
|
295
323
|
let routedModelLabel = null;
|
|
@@ -307,6 +335,33 @@ export async function runActoviqTui(options = {}) {
|
|
|
307
335
|
// Display labels (model is set from the config on activation).
|
|
308
336
|
let bridgeModelLabel = null;
|
|
309
337
|
let abortCtrl = null;
|
|
338
|
+
// Persistent Manager session (kind: 'manager') — reused across /manager
|
|
339
|
+
// update/chat turns so the Manager keeps its own conversation context.
|
|
340
|
+
let managerTuiSession = null;
|
|
341
|
+
async function resolveManagerTuiSession() {
|
|
342
|
+
if (managerTuiSession)
|
|
343
|
+
return managerTuiSession;
|
|
344
|
+
const managers = (await sdk.sessions.list()).filter(item => item.kind === 'manager');
|
|
345
|
+
managers.sort((a, b) => {
|
|
346
|
+
if (b.messageCount !== a.messageCount)
|
|
347
|
+
return b.messageCount - a.messageCount;
|
|
348
|
+
return (b.updatedAt || '').localeCompare(a.updatedAt || '');
|
|
349
|
+
});
|
|
350
|
+
for (const dup of managers.slice(1)) {
|
|
351
|
+
await sdk.sessions.delete(dup.id).catch(() => undefined);
|
|
352
|
+
}
|
|
353
|
+
const existing = managers[0];
|
|
354
|
+
if (existing) {
|
|
355
|
+
managerTuiSession = await sdk.resumeSession(existing.id, { permissionMode: 'bypassPermissions' });
|
|
356
|
+
return managerTuiSession;
|
|
357
|
+
}
|
|
358
|
+
managerTuiSession = await sdk.createSession({
|
|
359
|
+
title: 'Manager',
|
|
360
|
+
metadata: { __actoviqKind: 'manager' },
|
|
361
|
+
permissionMode: 'bypassPermissions',
|
|
362
|
+
});
|
|
363
|
+
return managerTuiSession;
|
|
364
|
+
}
|
|
310
365
|
let dialog = null;
|
|
311
366
|
let selectionDialog = null;
|
|
312
367
|
let textInputDialog = null;
|
|
@@ -356,13 +411,13 @@ export async function runActoviqTui(options = {}) {
|
|
|
356
411
|
let ctrlCCount = 0;
|
|
357
412
|
let ctrlCTimer = null;
|
|
358
413
|
let streamedTextSeen = false;
|
|
414
|
+
let streamedThinkingSeen = false;
|
|
359
415
|
// Track tool names by callId for PostToolUse hook context.
|
|
360
416
|
const toolCallNames = new Map();
|
|
361
417
|
// Live todo list (captured from TodoWrite tool calls). Rendered as a
|
|
362
418
|
// persistent panel in the dynamic region so the user can see what the agent
|
|
363
419
|
// is working on / what remains — Claude Code's main progress affordance.
|
|
364
420
|
let currentTodos = [];
|
|
365
|
-
const queuedInputs = [];
|
|
366
421
|
const currentPermissionMode = () => session.permissionContext.mode ?? permissionMode;
|
|
367
422
|
const currentEffort = () => {
|
|
368
423
|
const stored = session.metadata[SESSION_EFFORT_KEY];
|
|
@@ -454,6 +509,9 @@ export async function runActoviqTui(options = {}) {
|
|
|
454
509
|
? { behavior: 'allow', reason: 'Approved in TUI.' }
|
|
455
510
|
: { behavior: 'deny', reason: 'Denied in TUI permission dialog.' };
|
|
456
511
|
};
|
|
512
|
+
applyPlanPermission = async () => {
|
|
513
|
+
await session.setPermissionContext({ mode: 'plan', permissions: [], approver });
|
|
514
|
+
};
|
|
457
515
|
const canUseTool = permissionMode === 'default'
|
|
458
516
|
? (context) => {
|
|
459
517
|
if (context.publicName === 'Bash') {
|
|
@@ -810,7 +868,10 @@ export async function runActoviqTui(options = {}) {
|
|
|
810
868
|
const bridgeTag = bridgeMode && activeBridgeConfig
|
|
811
869
|
? ` · bridge:${activeBridgeConfig.name}${bridgeModelLabel ? ` · ${bridgeModelLabel}` : ''}`
|
|
812
870
|
: '';
|
|
813
|
-
const
|
|
871
|
+
const teamLabel = activeTeamName
|
|
872
|
+
? `team:${activeTeamName}${teamPrefs.autoInvoke ? '' : ' (manual)'}`
|
|
873
|
+
: 'team:none';
|
|
874
|
+
const left = `${modelLabel} · ${permissionLabel()} · effort:${currentEffort() ?? 'auto'} · ${teamLabel}${bridgeTag}${goalContextLine()} · `;
|
|
814
875
|
return `${A.dim} ${left}${A.reset}${ctxColor}ctx ${pct}% (${usedK})${A.reset}`;
|
|
815
876
|
}
|
|
816
877
|
function buildStatusLine() {
|
|
@@ -820,7 +881,7 @@ export async function runActoviqTui(options = {}) {
|
|
|
820
881
|
const elapsed = Math.max(Math.round((Date.now() - runStartedAt) / 1000), 0);
|
|
821
882
|
const frame = SPINNER_FRAMES[spinnerFrame % SPINNER_FRAMES.length];
|
|
822
883
|
const note = statusNote ? ` · ${statusNote}` : '';
|
|
823
|
-
const queued =
|
|
884
|
+
const queued = session.pendingInputCount > 0 ? ` · ${session.pendingInputCount} queued` : '';
|
|
824
885
|
return [
|
|
825
886
|
`${A.cyan}${frame}${A.reset} ${A.bold}Working…${A.reset}${A.dim} (${elapsed}s · ${runToolCount} tool${runToolCount === 1 ? '' : 's'}${note}${queued} · esc to interrupt)${A.reset}`,
|
|
826
887
|
modeLine,
|
|
@@ -1075,9 +1136,8 @@ export async function runActoviqTui(options = {}) {
|
|
|
1075
1136
|
// Branch the event source. Bridge mode spawns the configured runtime CLI
|
|
1076
1137
|
// and adapts its events into the same AgentEvent stream the rest of this
|
|
1077
1138
|
// loop consumes — so a bridge run reuses the spinner, tool cards, Esc
|
|
1078
|
-
// interrupt, steering
|
|
1079
|
-
//
|
|
1080
|
-
// run queues and becomes the next turn (handled by the tail below).
|
|
1139
|
+
// interrupt, first-class session steering, and history exactly like a
|
|
1140
|
+
// normal run.
|
|
1081
1141
|
let eventStream;
|
|
1082
1142
|
let resultPromise;
|
|
1083
1143
|
if (bridgeMode && activeBridgeModelApi) {
|
|
@@ -1096,12 +1156,8 @@ export async function runActoviqTui(options = {}) {
|
|
|
1096
1156
|
classifier: preToolUseHookClassifier,
|
|
1097
1157
|
model: activeBridgeModelApi.model,
|
|
1098
1158
|
modelApi: activeBridgeModelApi.modelApi,
|
|
1099
|
-
...(activeTeamTool ? { tools: [...tools, activeTeamTool] } : {}),
|
|
1159
|
+
...(activeTeamTool && teamPrefs.autoInvoke ? { tools: [...tools, activeTeamTool] } : {}),
|
|
1100
1160
|
...(canUseTool ? { canUseTool } : {}),
|
|
1101
|
-
drainQueuedInputs: () => {
|
|
1102
|
-
const drained = queuedInputs.splice(0);
|
|
1103
|
-
return drained;
|
|
1104
|
-
},
|
|
1105
1161
|
});
|
|
1106
1162
|
eventStream = stream;
|
|
1107
1163
|
resultPromise = stream.result;
|
|
@@ -1115,18 +1171,17 @@ export async function runActoviqTui(options = {}) {
|
|
|
1115
1171
|
approver,
|
|
1116
1172
|
classifier: preToolUseHookClassifier,
|
|
1117
1173
|
...(routed ? { model: routed.model, modelApi: routed.modelApi } : {}),
|
|
1118
|
-
...(activeTeamTool ? { tools: [...tools, activeTeamTool] } : {}),
|
|
1174
|
+
...(activeTeamTool && teamPrefs.autoInvoke ? { tools: [...tools, activeTeamTool] } : {}),
|
|
1119
1175
|
...(canUseTool ? { canUseTool } : {}),
|
|
1120
|
-
drainQueuedInputs: () => {
|
|
1121
|
-
const drained = queuedInputs.splice(0);
|
|
1122
|
-
return drained;
|
|
1123
|
-
},
|
|
1124
1176
|
});
|
|
1125
1177
|
eventStream = stream;
|
|
1126
1178
|
resultPromise = stream.result;
|
|
1127
1179
|
}
|
|
1180
|
+
const surfaceEvents = new LegacySurfaceEventPipeline();
|
|
1128
1181
|
for await (const event of eventStream) {
|
|
1129
|
-
|
|
1182
|
+
for (const surfaceEvent of surfaceEvents.projectFor(event, 'tui')) {
|
|
1183
|
+
handleSurfaceEvent(surfaceEvent);
|
|
1184
|
+
}
|
|
1130
1185
|
}
|
|
1131
1186
|
const result = await resultPromise;
|
|
1132
1187
|
// Accumulate token + USD usage for /cost and /usage. The model is the
|
|
@@ -1166,26 +1221,25 @@ export async function runActoviqTui(options = {}) {
|
|
|
1166
1221
|
cancelScheduledDynamicRender();
|
|
1167
1222
|
renderDynamic();
|
|
1168
1223
|
}
|
|
1169
|
-
// Steering messages typed too late to drain mid-run become the next turn.
|
|
1170
|
-
if (queuedInputs.length > 0 && !shuttingDown) {
|
|
1171
|
-
const next = queuedInputs.splice(0).join('\n');
|
|
1172
|
-
await startRun(next);
|
|
1173
|
-
}
|
|
1174
1224
|
}
|
|
1175
1225
|
function runHadNoStreamedText() {
|
|
1176
1226
|
return !streamedTextSeen;
|
|
1177
1227
|
}
|
|
1178
|
-
function
|
|
1228
|
+
function handleSurfaceEvent(event) {
|
|
1229
|
+
const data = event.data;
|
|
1179
1230
|
switch (event.type) {
|
|
1180
1231
|
case 'run.started':
|
|
1181
1232
|
streamedTextSeen = false;
|
|
1233
|
+
streamedThinkingSeen = false;
|
|
1182
1234
|
return;
|
|
1183
1235
|
case 'request.started':
|
|
1184
|
-
lastTokenEstimate =
|
|
1236
|
+
lastTokenEstimate = typeof data.requestTokenEstimate === 'number'
|
|
1237
|
+
? data.requestTokenEstimate
|
|
1238
|
+
: undefined;
|
|
1185
1239
|
renderDynamic();
|
|
1186
1240
|
return;
|
|
1187
|
-
case '
|
|
1188
|
-
const delta = typeof
|
|
1241
|
+
case 'text.delta': {
|
|
1242
|
+
const delta = typeof data.delta === 'string' ? data.delta : '';
|
|
1189
1243
|
if (!delta)
|
|
1190
1244
|
return;
|
|
1191
1245
|
streamedTextSeen = true;
|
|
@@ -1195,29 +1249,58 @@ export async function runActoviqTui(options = {}) {
|
|
|
1195
1249
|
scheduleDynamicRender();
|
|
1196
1250
|
return;
|
|
1197
1251
|
}
|
|
1198
|
-
case '
|
|
1199
|
-
|
|
1200
|
-
|
|
1252
|
+
case 'reasoning.delta': {
|
|
1253
|
+
const delta = typeof data.delta === 'string' ? data.delta : '';
|
|
1254
|
+
if (!delta)
|
|
1255
|
+
return;
|
|
1256
|
+
const lines = formatThinking(delta, screen.width);
|
|
1257
|
+
if (lines.length > 0)
|
|
1258
|
+
appendStatic(lines);
|
|
1259
|
+
streamedThinkingSeen = true;
|
|
1260
|
+
scheduleDynamicRender();
|
|
1261
|
+
return;
|
|
1262
|
+
}
|
|
1263
|
+
case 'tool.input.delta': {
|
|
1264
|
+
const name = typeof data.name === 'string' && data.name ? data.name : 'tool';
|
|
1265
|
+
const snapshot = typeof data.snapshot === 'string'
|
|
1266
|
+
? data.snapshot.trim().replace(/\s+/g, ' ')
|
|
1267
|
+
: '';
|
|
1268
|
+
const preview = snapshot.length > 72 ? `${snapshot.slice(0, 69)}...` : snapshot;
|
|
1269
|
+
statusNote = preview ? `preparing ${name}: ${preview}` : `preparing ${name}`;
|
|
1270
|
+
scheduleDynamicRender();
|
|
1271
|
+
return;
|
|
1272
|
+
}
|
|
1273
|
+
case 'model.content': {
|
|
1274
|
+
const content = isRecord(data.content) ? data.content : undefined;
|
|
1275
|
+
if (data.kind === 'content' && content?.type === 'thinking' && !streamedThinkingSeen) {
|
|
1276
|
+
const thinking = typeof content.thinking === 'string' ? content.thinking : '';
|
|
1201
1277
|
const lines = formatThinking(thinking, screen.width);
|
|
1202
1278
|
if (lines.length > 0)
|
|
1203
1279
|
appendStatic(lines);
|
|
1204
1280
|
}
|
|
1205
1281
|
return;
|
|
1206
|
-
|
|
1282
|
+
}
|
|
1283
|
+
case 'tool.started': {
|
|
1284
|
+
const callId = typeof data.callId === 'string' ? data.callId : '';
|
|
1285
|
+
const publicName = typeof data.publicName === 'string'
|
|
1286
|
+
? data.publicName
|
|
1287
|
+
: typeof data.name === 'string' ? data.name : 'tool';
|
|
1288
|
+
const input = data.input;
|
|
1207
1289
|
const pending = flusher.drain();
|
|
1208
1290
|
if (pending.length > 0)
|
|
1209
1291
|
appendStatic(pending);
|
|
1210
1292
|
runToolCount += 1;
|
|
1211
|
-
statusNote =
|
|
1212
|
-
|
|
1293
|
+
statusNote = publicName;
|
|
1294
|
+
if (callId)
|
|
1295
|
+
toolCallNames.set(callId, publicName);
|
|
1213
1296
|
// Render Edit calls as a colored old→new diff instead of a one-liner.
|
|
1214
|
-
appendStatic(
|
|
1215
|
-
? formatEditCall(
|
|
1216
|
-
: formatToolCall(
|
|
1297
|
+
appendStatic(publicName === 'Edit'
|
|
1298
|
+
? formatEditCall(input, screen.width)
|
|
1299
|
+
: formatToolCall(publicName, input, screen.width));
|
|
1217
1300
|
// Capture the live todo list from TodoWrite calls so the persistent
|
|
1218
1301
|
// panel (renderDynamic) reflects the agent's current plan + progress.
|
|
1219
|
-
if (
|
|
1220
|
-
const todos =
|
|
1302
|
+
if (publicName === 'TodoWrite') {
|
|
1303
|
+
const todos = (isRecord(input) ? input.todos : undefined);
|
|
1221
1304
|
if (Array.isArray(todos)) {
|
|
1222
1305
|
currentTodos = todos
|
|
1223
1306
|
.filter((t) => typeof t === 'object' && t !== null)
|
|
@@ -1233,40 +1316,45 @@ export async function runActoviqTui(options = {}) {
|
|
|
1233
1316
|
return;
|
|
1234
1317
|
}
|
|
1235
1318
|
case 'tool.progress': {
|
|
1236
|
-
const
|
|
1237
|
-
|
|
1238
|
-
|
|
1319
|
+
const progress = isRecord(data.progress) ? data.progress : undefined;
|
|
1320
|
+
const message = typeof data.message === 'string'
|
|
1321
|
+
? data.message
|
|
1322
|
+
: typeof progress?.message === 'string' ? progress.message : undefined;
|
|
1323
|
+
if (message) {
|
|
1324
|
+
statusNote = message;
|
|
1239
1325
|
scheduleDynamicRender();
|
|
1240
1326
|
}
|
|
1241
1327
|
return;
|
|
1242
1328
|
}
|
|
1243
|
-
case 'tool.
|
|
1329
|
+
case 'tool.completed':
|
|
1330
|
+
case 'tool.failed':
|
|
1331
|
+
case 'tool.rejected': {
|
|
1332
|
+
const callId = typeof data.callId === 'string' ? data.callId : '';
|
|
1333
|
+
const outputText = typeof data.outputText === 'string' ? data.outputText : '';
|
|
1244
1334
|
statusNote = '';
|
|
1245
1335
|
appendStatic(formatToolResult({
|
|
1246
|
-
isError:
|
|
1247
|
-
durationMs:
|
|
1248
|
-
outputText
|
|
1336
|
+
isError: data.isError === true,
|
|
1337
|
+
durationMs: typeof data.durationMs === 'number' ? data.durationMs : 0,
|
|
1338
|
+
outputText,
|
|
1249
1339
|
}, screen.width));
|
|
1250
1340
|
// Run matching PostToolUse hooks (fire-and-forget, never block).
|
|
1251
|
-
const toolName = toolCallNames.get(
|
|
1341
|
+
const toolName = callId ? toolCallNames.get(callId) : undefined;
|
|
1252
1342
|
if (toolName) {
|
|
1253
|
-
runPostToolUseHooks(() => readPostToolUseHooks(getLoadedJsonConfig()?.raw), toolName, null,
|
|
1343
|
+
runPostToolUseHooks(() => readPostToolUseHooks(getLoadedJsonConfig()?.raw), toolName, null, outputText, sdk.config.workDir);
|
|
1254
1344
|
}
|
|
1255
1345
|
renderDynamic();
|
|
1256
1346
|
return;
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
case 'session.compacted':
|
|
1261
|
-
appendStatic(formatCompactNotice(event.trigger));
|
|
1347
|
+
}
|
|
1348
|
+
case 'compaction.completed':
|
|
1349
|
+
appendStatic(formatCompactNotice(typeof data.trigger === 'string' ? data.trigger : 'auto', typeof data.tokenEstimateBefore === 'number' ? data.tokenEstimateBefore : undefined, typeof data.tokenEstimateAfter === 'number' ? data.tokenEstimateAfter : undefined));
|
|
1262
1350
|
return;
|
|
1263
1351
|
case 'tool.permission':
|
|
1264
|
-
if (
|
|
1265
|
-
appendStatic(formatInfoLine(`permission denied: ${
|
|
1352
|
+
if (isRecord(data.decision) && data.decision.behavior === 'deny') {
|
|
1353
|
+
appendStatic(formatInfoLine(`permission denied: ${String(data.decision.publicName ?? 'tool')} — ${String(data.decision.reason ?? '')}`));
|
|
1266
1354
|
}
|
|
1267
1355
|
return;
|
|
1268
1356
|
case 'error':
|
|
1269
|
-
appendStatic(formatErrorLine(
|
|
1357
|
+
appendStatic(formatErrorLine(typeof data.message === 'string' ? data.message : 'run failed'));
|
|
1270
1358
|
return;
|
|
1271
1359
|
default:
|
|
1272
1360
|
return;
|
|
@@ -1307,11 +1395,18 @@ export async function runActoviqTui(options = {}) {
|
|
|
1307
1395
|
workflows: '/workflows [run <name>|list]',
|
|
1308
1396
|
worktree: '/worktree [enter <name>|exit|list]',
|
|
1309
1397
|
team: '/team [ask <name> <prompt>|list]',
|
|
1398
|
+
issues: '/issues [list|show <id>|create <title>|start <id> [agent-profile]|review <id>|done <id>|block <id>]',
|
|
1310
1399
|
exit: '/exit',
|
|
1311
1400
|
};
|
|
1312
1401
|
return usage[name] ?? `/${name}`;
|
|
1313
1402
|
}
|
|
1314
1403
|
async function resumeSession(sessionId) {
|
|
1404
|
+
const listed = await sdk.sessions.list();
|
|
1405
|
+
const target = listed.find(item => item.id === sessionId);
|
|
1406
|
+
if (target?.kind === 'manager') {
|
|
1407
|
+
appendStatic([...formatErrorLine('Manager sessions live in the Project Manager panel only.'), '']);
|
|
1408
|
+
return;
|
|
1409
|
+
}
|
|
1315
1410
|
session = await sdk.resumeSession(sessionId);
|
|
1316
1411
|
appendStatic([
|
|
1317
1412
|
...formatInfoLine(`resumed: ${session.id} · ${session.title} · ${session.model}`),
|
|
@@ -1319,7 +1414,7 @@ export async function runActoviqTui(options = {}) {
|
|
|
1319
1414
|
]);
|
|
1320
1415
|
}
|
|
1321
1416
|
async function chooseSessionToResume() {
|
|
1322
|
-
const sessions = (await sdk.sessions.list()).filter(item => item.id !== session.id);
|
|
1417
|
+
const sessions = (await sdk.sessions.list()).filter(item => item.id !== session.id && item.kind !== 'manager');
|
|
1323
1418
|
if (sessions.length === 0) {
|
|
1324
1419
|
appendStatic([...formatInfoLine('no other project sessions to resume'), '']);
|
|
1325
1420
|
return;
|
|
@@ -2490,7 +2585,7 @@ export async function runActoviqTui(options = {}) {
|
|
|
2490
2585
|
return;
|
|
2491
2586
|
}
|
|
2492
2587
|
case 'sessions': {
|
|
2493
|
-
const sessions = await sdk.sessions.list();
|
|
2588
|
+
const sessions = (await sdk.sessions.list()).filter(item => item.kind !== 'manager');
|
|
2494
2589
|
appendStatic([
|
|
2495
2590
|
...(sessions.length > 0
|
|
2496
2591
|
? sessions.map(item => `${item.id === session.id ? A.green : A.dim}${item.id}${A.reset} ${item.title} · ${item.model} · ${item.status}`)
|
|
@@ -2844,6 +2939,7 @@ export async function runActoviqTui(options = {}) {
|
|
|
2844
2939
|
const { WorkflowScriptRuntime } = await import('../workflow/workflowScriptRuntime.js');
|
|
2845
2940
|
const runtime = new WorkflowScriptRuntime({
|
|
2846
2941
|
sdk: sdk,
|
|
2942
|
+
trust: 'trusted',
|
|
2847
2943
|
args: wfTask,
|
|
2848
2944
|
onEvent: (e) => {
|
|
2849
2945
|
if (e.type === 'workflow.phase.start') {
|
|
@@ -3008,6 +3104,61 @@ export async function runActoviqTui(options = {}) {
|
|
|
3008
3104
|
}
|
|
3009
3105
|
// ── v0.5.0: Model Team ───────────────────────────────────
|
|
3010
3106
|
case 'team': {
|
|
3107
|
+
if (args === 'status') {
|
|
3108
|
+
appendStatic([
|
|
3109
|
+
`${A.bold}Team status${A.reset}`,
|
|
3110
|
+
`${A.dim}attached: ${activeTeamName ?? 'none'}${A.reset}`,
|
|
3111
|
+
`${A.dim}autoInvoke: ${teamPrefs.autoInvoke ? 'on — the main agent can call the team as a tool' : 'off — manual /team ask only'}${A.reset}`,
|
|
3112
|
+
`${A.dim}defaultAttached: ${teamPrefs.defaultAttached ?? 'none'}${teamPrefs.defaultAttached && !activeTeamName ? ' (not found)' : ''}${A.reset}`,
|
|
3113
|
+
`${A.dim}last run: ${lastTeamRunSummary ?? 'none'}${A.reset}`,
|
|
3114
|
+
'',
|
|
3115
|
+
]);
|
|
3116
|
+
return;
|
|
3117
|
+
}
|
|
3118
|
+
if (args === 'off') {
|
|
3119
|
+
activeTeamTool = null;
|
|
3120
|
+
activeTeamName = null;
|
|
3121
|
+
appendStatic([...formatInfoLine('team: none — the agent works individually'), '']);
|
|
3122
|
+
return;
|
|
3123
|
+
}
|
|
3124
|
+
if (args === 'list') {
|
|
3125
|
+
const teams = listTeamDefinitions(sdk.config.workDir);
|
|
3126
|
+
appendStatic([
|
|
3127
|
+
`${A.bold}Teams${A.reset}`,
|
|
3128
|
+
...teams.map((t) => `${t.name === activeTeamName ? `${A.green}*${A.reset}` : ' '}${A.cyan}${t.name}${A.reset}${A.dim} · ${t.definition.mode} · ${t.source} · ${countTeamAgents(t.definition)} agents${A.reset}`),
|
|
3129
|
+
`${A.dim}/team attach <name> · /team ask <name> <prompt> · /team off · /team status${A.reset}`,
|
|
3130
|
+
'',
|
|
3131
|
+
]);
|
|
3132
|
+
return;
|
|
3133
|
+
}
|
|
3134
|
+
if (args.startsWith('attach ')) {
|
|
3135
|
+
const teamName = args.slice(7).trim();
|
|
3136
|
+
const definition = attachTeamByName(teamName);
|
|
3137
|
+
if (!definition) {
|
|
3138
|
+
appendStatic([...formatErrorLine(`team not found: ${teamName}`), '']);
|
|
3139
|
+
return;
|
|
3140
|
+
}
|
|
3141
|
+
appendStatic([
|
|
3142
|
+
...formatInfoLine(`team attached: ${definition.name} (${definition.mode}) · autoInvoke ${teamPrefs.autoInvoke ? 'on' : 'off — run /team ask <name> <prompt> to use it'}`),
|
|
3143
|
+
'',
|
|
3144
|
+
]);
|
|
3145
|
+
return;
|
|
3146
|
+
}
|
|
3147
|
+
if (args.startsWith('clone ')) {
|
|
3148
|
+
const parts = args.slice(6).trim().split(/\s+/);
|
|
3149
|
+
if (parts.length !== 2) {
|
|
3150
|
+
appendStatic([...formatErrorLine('usage: /team clone <source> <new-name>'), '']);
|
|
3151
|
+
return;
|
|
3152
|
+
}
|
|
3153
|
+
try {
|
|
3154
|
+
const clone = await cloneTeamDefinition(parts[0], parts[1], { projectDir: sdk.config.workDir });
|
|
3155
|
+
appendStatic([...formatInfoLine(`team cloned: ${parts[0]} → ${clone.name} (${clone.filePath})`), '']);
|
|
3156
|
+
}
|
|
3157
|
+
catch (error) {
|
|
3158
|
+
appendStatic([...formatErrorLine(`clone failed: ${error.message}`), '']);
|
|
3159
|
+
}
|
|
3160
|
+
return;
|
|
3161
|
+
}
|
|
3011
3162
|
if (args.startsWith('ask ')) {
|
|
3012
3163
|
const rest = args.slice(4).trim();
|
|
3013
3164
|
const spaceIdx = rest.indexOf(' ');
|
|
@@ -3022,14 +3173,50 @@ export async function runActoviqTui(options = {}) {
|
|
|
3022
3173
|
appendStatic([...formatErrorLine(`team not found: ${teamName}`), '']);
|
|
3023
3174
|
return;
|
|
3024
3175
|
}
|
|
3176
|
+
const definition = instantiateTeamDefinition(loaded.definition, session.model);
|
|
3177
|
+
const memberModels = listTeamAgentLabels(definition);
|
|
3178
|
+
if (teamPrefs.confirmBeforeRun) {
|
|
3179
|
+
const go = await selectItem({
|
|
3180
|
+
title: `Run team "${definition.name}"?`,
|
|
3181
|
+
subtitle: `${definition.mode} · members: ${memberModels.join(', ') || '(none)'}`,
|
|
3182
|
+
items: [
|
|
3183
|
+
{ id: 'run', label: 'Run', description: 'convene the team now' },
|
|
3184
|
+
{ id: 'cancel', label: 'Cancel', description: 'do nothing' },
|
|
3185
|
+
],
|
|
3186
|
+
});
|
|
3187
|
+
if (go !== 'run')
|
|
3188
|
+
return;
|
|
3189
|
+
}
|
|
3025
3190
|
appendStatic([
|
|
3026
|
-
...formatInfoLine(`asking team "${teamName}" (${
|
|
3027
|
-
`${A.dim}convening: ${
|
|
3191
|
+
...formatInfoLine(`asking team "${teamName}" (${definition.mode} mode)`),
|
|
3192
|
+
`${A.dim}convening: ${memberModels.join(', ') || 'configured members'}${A.reset}`,
|
|
3028
3193
|
'',
|
|
3029
3194
|
]);
|
|
3030
3195
|
try {
|
|
3031
|
-
const team = createModelTeam(
|
|
3032
|
-
const
|
|
3196
|
+
const team = createModelTeam(definition);
|
|
3197
|
+
const teamRunView = createTeamRunViewState(definition.name);
|
|
3198
|
+
const printTeamRunTree = () => {
|
|
3199
|
+
const lines = formatTeamRunTreeLines(teamRunView);
|
|
3200
|
+
if (!lines.length)
|
|
3201
|
+
return;
|
|
3202
|
+
appendStatic([...lines.map((line) => `${A.dim}${line}${A.reset}`), '']);
|
|
3203
|
+
};
|
|
3204
|
+
const result = await team.ask(prompt, undefined, {
|
|
3205
|
+
workDir: sdk.config.workDir,
|
|
3206
|
+
onEvent: (e) => {
|
|
3207
|
+
applyTeamRunEvent(teamRunView, e);
|
|
3208
|
+
if (e.type === 'team.synthesis') {
|
|
3209
|
+
appendStatic([`${A.dim} ◈ synthesis round ${e.round}: ${e.decision}${A.reset}`]);
|
|
3210
|
+
}
|
|
3211
|
+
else if (e.type === 'team.started'
|
|
3212
|
+
|| e.type === 'team.member.completed'
|
|
3213
|
+
|| e.type === 'team.edge.triggered'
|
|
3214
|
+
|| e.type === 'team.completed') {
|
|
3215
|
+
printTeamRunTree();
|
|
3216
|
+
}
|
|
3217
|
+
},
|
|
3218
|
+
});
|
|
3219
|
+
lastTeamRunSummary = `${teamName} · ${result.mode} · ${Math.round(result.durationMs / 1000)}s`;
|
|
3033
3220
|
appendStatic([
|
|
3034
3221
|
`${A.green}✓ team response${A.reset}${A.dim} · ${result.mode} · ${Math.round(result.durationMs / 1000)}s${A.reset}`,
|
|
3035
3222
|
`${A.dim}cost: ${result.cost.estimatedCost !== null ? `$${result.cost.estimatedCost.toFixed(4)}` : 'N/A'} · ${result.cost.totalInputTokens + result.cost.totalOutputTokens} tokens${A.reset}`,
|
|
@@ -3044,26 +3231,16 @@ export async function runActoviqTui(options = {}) {
|
|
|
3044
3231
|
return;
|
|
3045
3232
|
}
|
|
3046
3233
|
// No sub-command → picker that toggles which team the agent may call.
|
|
3047
|
-
const
|
|
3048
|
-
const buildDefault = (mode) => {
|
|
3049
|
-
switch (mode) {
|
|
3050
|
-
case 'panel-analysis':
|
|
3051
|
-
return { name: 'panel-analysis', mode: 'panel-analysis', members: [member('Expert researcher. Investigate with read-only tools; cite sources.'), member('Rigorous skeptic. Verify with sources; challenge assumptions.')], primary: member('Synthesizer. Reconcile the panel findings into the best answer and decide when they suffice.'), timeoutMs: 300000, maxIterations: 12 };
|
|
3052
|
-
case 'analysis':
|
|
3053
|
-
return { name: 'analysis-panel', mode: 'analysis', members: [member('Expert researcher. Deep, source-grounded analysis.'), member('Rigorous skeptic. Verify with sources; challenge assumptions.')], timeoutMs: 300000, maxIterations: 12 };
|
|
3054
|
-
case 'reviewer':
|
|
3055
|
-
return { name: 'reviewer', mode: 'reviewer', members: [], reviewer: member('Meticulous reviewer. Surface only genuine, verifiable issues with file:line evidence; never speculate.'), timeoutMs: 300000, maxIterations: 16 };
|
|
3056
|
-
default:
|
|
3057
|
-
return undefined;
|
|
3058
|
-
}
|
|
3059
|
-
};
|
|
3060
|
-
const saved = listTeamDefinitions(sdk.config.workDir);
|
|
3234
|
+
const teams = listTeamDefinitions(sdk.config.workDir);
|
|
3061
3235
|
const items = [
|
|
3062
|
-
{ id: '__none__', label: activeTeamTool ? `No team — remove "${activeTeamName}"` : 'No team (individual) — current', description: 'the agent works solo, no team
|
|
3063
|
-
...
|
|
3064
|
-
|
|
3236
|
+
{ id: '__none__', label: activeTeamTool ? `No team — remove "${activeTeamName}"` : 'No team (individual) — current', description: 'the agent works solo, no team attached' },
|
|
3237
|
+
...teams.map((t) => ({
|
|
3238
|
+
id: `team:${t.name}`,
|
|
3239
|
+
label: `${t.name}${t.name === activeTeamName ? ' — attached' : ''}`,
|
|
3240
|
+
description: `${t.source} · ${t.definition.mode} · ${countTeamAgents(t.definition)} agents`,
|
|
3241
|
+
})),
|
|
3065
3242
|
];
|
|
3066
|
-
const choice = await selectItem({ title: 'Team', subtitle:
|
|
3243
|
+
const choice = await selectItem({ title: 'Team', subtitle: `attach a team (autoInvoke ${teamPrefs.autoInvoke ? 'on' : 'off'} — settings preferences.team)`, items });
|
|
3067
3244
|
if (!choice)
|
|
3068
3245
|
return;
|
|
3069
3246
|
if (choice === '__none__') {
|
|
@@ -3072,25 +3249,273 @@ export async function runActoviqTui(options = {}) {
|
|
|
3072
3249
|
appendStatic([...formatInfoLine('team: none — the agent works individually'), '']);
|
|
3073
3250
|
return;
|
|
3074
3251
|
}
|
|
3075
|
-
let def;
|
|
3076
|
-
if (choice.startsWith('saved:'))
|
|
3077
|
-
def = loadTeamDefinition(choice.slice('saved:'.length), sdk.config.workDir)?.definition;
|
|
3078
|
-
else if (choice.startsWith('mode:'))
|
|
3079
|
-
def = buildDefault(choice.slice('mode:'.length));
|
|
3080
|
-
if (!def) {
|
|
3081
|
-
appendStatic([...formatErrorLine('could not load team definition'), '']);
|
|
3082
|
-
return;
|
|
3083
|
-
}
|
|
3084
3252
|
try {
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3253
|
+
const definition = attachTeamByName(choice.slice('team:'.length));
|
|
3254
|
+
if (!definition) {
|
|
3255
|
+
appendStatic([...formatErrorLine('could not load team definition'), '']);
|
|
3256
|
+
return;
|
|
3257
|
+
}
|
|
3258
|
+
appendStatic([
|
|
3259
|
+
...formatInfoLine(teamPrefs.autoInvoke
|
|
3260
|
+
? `team active: ${definition.name} (${definition.mode}) — the agent can now call "${definition.name}" as a tool when it helps`
|
|
3261
|
+
: `team attached: ${definition.name} (${definition.mode}) — run /team ask ${definition.name} <prompt> (autoInvoke off)`),
|
|
3262
|
+
'',
|
|
3263
|
+
]);
|
|
3088
3264
|
}
|
|
3089
3265
|
catch (error) {
|
|
3090
3266
|
appendStatic([...formatErrorLine(`team error: ${error.message}`), '']);
|
|
3091
3267
|
}
|
|
3092
3268
|
return;
|
|
3093
3269
|
}
|
|
3270
|
+
// ── Project Manager ──────────────────────────────────────
|
|
3271
|
+
case 'issues': {
|
|
3272
|
+
const homeDir = sdk.config.homeDir;
|
|
3273
|
+
const meta = await readProjectMeta(sdk.config.workDir, homeDir);
|
|
3274
|
+
const storage = isIssueStorageMode(meta.issueStorage) ? meta.issueStorage : 'home';
|
|
3275
|
+
if (!args || args === 'list') {
|
|
3276
|
+
const issues = await listProjectIssues(sdk.config.workDir, homeDir, storage);
|
|
3277
|
+
if (issues.length === 0) {
|
|
3278
|
+
appendStatic([...formatInfoLine('no issues yet; use /issues create <title>'), '']);
|
|
3279
|
+
return;
|
|
3280
|
+
}
|
|
3281
|
+
appendStatic([
|
|
3282
|
+
`${A.cyan}Issues (${storage})${A.reset}`,
|
|
3283
|
+
...issues.map(issue => `#${issue.number} ${issue.title} ${A.dim}${issue.status} · ${issue.priority}${A.reset}`),
|
|
3284
|
+
'',
|
|
3285
|
+
]);
|
|
3286
|
+
return;
|
|
3287
|
+
}
|
|
3288
|
+
if (args.startsWith('create ')) {
|
|
3289
|
+
const title = args.slice(7).trim();
|
|
3290
|
+
if (!title) {
|
|
3291
|
+
appendStatic([...formatErrorLine('usage: /issues create <title>'), '']);
|
|
3292
|
+
return;
|
|
3293
|
+
}
|
|
3294
|
+
const issue = await createProjectIssue(sdk.config.workDir, homeDir, { title }, storage);
|
|
3295
|
+
appendStatic([...formatInfoLine(`issue created: #${issue.number} ${issue.title}`), '']);
|
|
3296
|
+
return;
|
|
3297
|
+
}
|
|
3298
|
+
if (args.startsWith('show ')) {
|
|
3299
|
+
const rawId = args.slice(5).trim().replace(/^#/, '');
|
|
3300
|
+
const issues = await listProjectIssues(sdk.config.workDir, homeDir, storage);
|
|
3301
|
+
const issue = issues.find(candidate => candidate.id === rawId ||
|
|
3302
|
+
String(candidate.number) === rawId ||
|
|
3303
|
+
`ISS-${candidate.number}` === rawId.toUpperCase());
|
|
3304
|
+
if (!issue) {
|
|
3305
|
+
appendStatic([...formatErrorLine(`issue not found: ${rawId}`), '']);
|
|
3306
|
+
return;
|
|
3307
|
+
}
|
|
3308
|
+
appendStatic([
|
|
3309
|
+
`${A.bold}ISS-${issue.number} ${issue.title}${A.reset}`,
|
|
3310
|
+
`${A.dim}${issue.status} · ${issue.priority}${A.reset}`,
|
|
3311
|
+
issue.description || '(no description)',
|
|
3312
|
+
...(issue.acceptanceCriteria.length
|
|
3313
|
+
? ['', 'Acceptance criteria:', ...issue.acceptanceCriteria.map(item => `- ${item}`)]
|
|
3314
|
+
: []),
|
|
3315
|
+
...(issue.brief ? ['', 'Manager brief:', issue.brief] : []),
|
|
3316
|
+
'',
|
|
3317
|
+
]);
|
|
3318
|
+
return;
|
|
3319
|
+
}
|
|
3320
|
+
if (args.startsWith('start ')) {
|
|
3321
|
+
const [, rawId, agentProfile] = args.split(/\s+/, 3);
|
|
3322
|
+
const id = rawId?.replace(/^#/, '');
|
|
3323
|
+
const issues = await listProjectIssues(sdk.config.workDir, homeDir, storage);
|
|
3324
|
+
const issue = issues.find(candidate => candidate.id === id ||
|
|
3325
|
+
String(candidate.number) === id ||
|
|
3326
|
+
`ISS-${candidate.number}` === id?.toUpperCase());
|
|
3327
|
+
if (!issue) {
|
|
3328
|
+
appendStatic([...formatErrorLine(`issue not found: ${rawId ?? ''}`), '']);
|
|
3329
|
+
return;
|
|
3330
|
+
}
|
|
3331
|
+
appendStatic([...formatInfoLine(`decomposing and dispatching ISS-${issue.number}...`), '']);
|
|
3332
|
+
const dispatched = await executeProjectIssue({
|
|
3333
|
+
sdk,
|
|
3334
|
+
managerSession: await resolveManagerTuiSession(),
|
|
3335
|
+
workDir: sdk.config.workDir,
|
|
3336
|
+
homeDir,
|
|
3337
|
+
storageMode: storage,
|
|
3338
|
+
issue,
|
|
3339
|
+
agentProfile,
|
|
3340
|
+
defaultModel: session.model,
|
|
3341
|
+
permissionMode: currentPermissionMode(),
|
|
3342
|
+
systemPrompt,
|
|
3343
|
+
});
|
|
3344
|
+
session = dispatched.session;
|
|
3345
|
+
appendStatic([
|
|
3346
|
+
...formatInfoLine(`ISS-${dispatched.issue.number}: ${dispatched.issue.status} · session ${session.id}`),
|
|
3347
|
+
...(dispatched.result.text ? [dispatched.result.text] : []),
|
|
3348
|
+
'',
|
|
3349
|
+
]);
|
|
3350
|
+
return;
|
|
3351
|
+
}
|
|
3352
|
+
const transitions = {
|
|
3353
|
+
review: 'in_review',
|
|
3354
|
+
done: 'done',
|
|
3355
|
+
block: 'blocked',
|
|
3356
|
+
};
|
|
3357
|
+
const [verb, rawId] = args.split(/\s+/, 2);
|
|
3358
|
+
const nextStatus = transitions[verb ?? ''];
|
|
3359
|
+
if (nextStatus && isIssueStatus(nextStatus) && rawId) {
|
|
3360
|
+
const issue = await transitionProjectIssue(sdk.config.workDir, homeDir, rawId.replace(/^#/, ''), nextStatus, 'user', storage);
|
|
3361
|
+
if (!issue)
|
|
3362
|
+
appendStatic([...formatErrorLine(`issue not found: ${rawId}`), '']);
|
|
3363
|
+
else
|
|
3364
|
+
appendStatic([...formatInfoLine(`issue #${issue.number}: ${issue.status}`), '']);
|
|
3365
|
+
return;
|
|
3366
|
+
}
|
|
3367
|
+
appendStatic([...formatErrorLine('usage: /issues [list|show <id>|create <title>|start <id> [agent-profile]|review <id>|done <id>|block <id>]'), '']);
|
|
3368
|
+
return;
|
|
3369
|
+
}
|
|
3370
|
+
case 'manager': {
|
|
3371
|
+
const homeDir = sdk.config.homeDir;
|
|
3372
|
+
if (!args || args === 'status') {
|
|
3373
|
+
const cfg = await readManagerConfig(sdk.config.workDir, homeDir);
|
|
3374
|
+
const plan = await readProjectPlanFile(sdk.config.workDir, homeDir);
|
|
3375
|
+
const progress = await readProgressFile(sdk.config.workDir, homeDir);
|
|
3376
|
+
appendStatic([
|
|
3377
|
+
`${A.bold}Manager${A.reset}`,
|
|
3378
|
+
`${A.dim}model: ${cfg.model ?? `${session.model} (session default)`}${A.reset}`,
|
|
3379
|
+
`${A.dim}readScope: ${cfg.readScope}${A.reset}`,
|
|
3380
|
+
`${A.dim}mirror to workspace: ${cfg.mirrorProgressToWorkspace ? 'on' : 'off'}${A.reset}`,
|
|
3381
|
+
`${A.dim}plan.json: ${plan.milestones.length} milestones · ${plan.today.length} today · ${plan.upcoming.length} upcoming${A.reset}`,
|
|
3382
|
+
`${A.dim}PROGRESS.md: ${progress ? `${progress.length} chars` : '(none yet — /manager update)'}${A.reset}`,
|
|
3383
|
+
'',
|
|
3384
|
+
]);
|
|
3385
|
+
return;
|
|
3386
|
+
}
|
|
3387
|
+
if (args === 'config') {
|
|
3388
|
+
const cfg = await readManagerConfig(sdk.config.workDir, homeDir);
|
|
3389
|
+
appendStatic([
|
|
3390
|
+
...JSON.stringify(cfg, null, 2).split('\n').map((l) => `${A.dim}${l}${A.reset}`),
|
|
3391
|
+
`${A.dim}Set: /manager config set <model|bridgeConfig|readScope|mirror|allow> <value>${A.reset}`,
|
|
3392
|
+
`${A.dim}The Manager always runs read-only regardless of model.${A.reset}`,
|
|
3393
|
+
'',
|
|
3394
|
+
]);
|
|
3395
|
+
return;
|
|
3396
|
+
}
|
|
3397
|
+
if (args.startsWith('config set ')) {
|
|
3398
|
+
const rest = args.slice('config set '.length).trim();
|
|
3399
|
+
const spIdx = rest.indexOf(' ');
|
|
3400
|
+
const key = spIdx === -1 ? rest : rest.slice(0, spIdx);
|
|
3401
|
+
const value = spIdx === -1 ? '' : rest.slice(spIdx + 1).trim();
|
|
3402
|
+
const cfg = await readManagerConfig(sdk.config.workDir, homeDir);
|
|
3403
|
+
if (key === 'model')
|
|
3404
|
+
cfg.model = value || undefined;
|
|
3405
|
+
else if (key === 'bridgeConfig' || key === 'config')
|
|
3406
|
+
cfg.bridgeConfig = value || undefined;
|
|
3407
|
+
else if (key === 'readScope') {
|
|
3408
|
+
if (value !== 'workspace-only' && value !== 'workspace+docs' && value !== 'explicit-allowlist' && value !== 'full-access') {
|
|
3409
|
+
appendStatic([...formatErrorLine('readScope must be workspace-only | workspace+docs | explicit-allowlist | full-access'), '']);
|
|
3410
|
+
return;
|
|
3411
|
+
}
|
|
3412
|
+
cfg.readScope = value;
|
|
3413
|
+
}
|
|
3414
|
+
else if (key === 'mirror')
|
|
3415
|
+
cfg.mirrorProgressToWorkspace = value === 'on' || value === 'true';
|
|
3416
|
+
else if (key === 'allow')
|
|
3417
|
+
cfg.allowedReadPaths = value ? value.split(',').map((p) => p.trim()).filter(Boolean) : [];
|
|
3418
|
+
else {
|
|
3419
|
+
appendStatic([...formatErrorLine('usage: /manager config set <model|bridgeConfig|readScope|mirror|allow> <value>'), '']);
|
|
3420
|
+
return;
|
|
3421
|
+
}
|
|
3422
|
+
await writeManagerConfig(sdk.config.workDir, homeDir, cfg);
|
|
3423
|
+
appendStatic([...formatInfoLine(`Manager config updated: ${key}`), '']);
|
|
3424
|
+
return;
|
|
3425
|
+
}
|
|
3426
|
+
if (args === 'schedule') {
|
|
3427
|
+
const tasks = (await listScheduledAutomationTasks(sdk.config.workDir)).filter((task) => task.kind === 'manager');
|
|
3428
|
+
appendStatic([
|
|
3429
|
+
`${A.bold}Manager schedules${A.reset}`,
|
|
3430
|
+
...(tasks.length === 0
|
|
3431
|
+
? [`${A.dim}none — add kind:"manager" tasks to .actoviq/scheduled-tasks.json${A.reset}`]
|
|
3432
|
+
: tasks.map((task) => `${A.cyan}${task.name}${A.reset}${A.dim} · ${task.cron} · ${task.enabled ? 'enabled' : 'paused'}${A.reset}`)),
|
|
3433
|
+
'',
|
|
3434
|
+
]);
|
|
3435
|
+
return;
|
|
3436
|
+
}
|
|
3437
|
+
const isUpdate = args === 'update' || args.startsWith('update ');
|
|
3438
|
+
const isChat = args === 'chat' || args.startsWith('chat ');
|
|
3439
|
+
if (isUpdate || isChat) {
|
|
3440
|
+
const arg = isUpdate
|
|
3441
|
+
? (args === 'update' ? '' : args.slice('update'.length).trim())
|
|
3442
|
+
: args.slice('chat'.length).trim();
|
|
3443
|
+
if (isChat && !arg) {
|
|
3444
|
+
appendStatic([...formatErrorLine('usage: /manager chat <message>'), '']);
|
|
3445
|
+
return;
|
|
3446
|
+
}
|
|
3447
|
+
if (isUpdate)
|
|
3448
|
+
appendStatic([...formatInfoLine('Manager: updating progress documents…'), '']);
|
|
3449
|
+
try {
|
|
3450
|
+
const cfg = await readManagerConfig(sdk.config.workDir, homeDir);
|
|
3451
|
+
const managerTools = await createManagerTools({ workDir: sdk.config.workDir, homeDir, config: cfg });
|
|
3452
|
+
let prompt;
|
|
3453
|
+
if (isUpdate) {
|
|
3454
|
+
// Host-collected context — the Manager itself has no shell.
|
|
3455
|
+
let gitSummary = '';
|
|
3456
|
+
try {
|
|
3457
|
+
const branch = execSync('git rev-parse --abbrev-ref HEAD', { cwd: sdk.config.workDir, encoding: 'utf8' }).trim();
|
|
3458
|
+
const dirty = execSync('git status --porcelain', { cwd: sdk.config.workDir, encoding: 'utf8' }).trim();
|
|
3459
|
+
const log = execSync('git log --oneline -10', { cwd: sdk.config.workDir, encoding: 'utf8' }).trim();
|
|
3460
|
+
gitSummary = `branch: ${branch}\ndirty files: ${dirty ? dirty.split('\n').length : 0}\nrecent commits:\n${log}`;
|
|
3461
|
+
}
|
|
3462
|
+
catch { /* not a git repo */ }
|
|
3463
|
+
const stored = await sdk.sessions.list();
|
|
3464
|
+
const conversationSummaries = stored
|
|
3465
|
+
.filter((s) => s.kind !== 'manager')
|
|
3466
|
+
.slice(0, 20)
|
|
3467
|
+
.map((s) => `- [${s.updatedAt.slice(0, 10)}] ${s.title} (${s.messageCount} msgs): ${s.preview}`)
|
|
3468
|
+
.join('\n');
|
|
3469
|
+
const plan = await readProjectPlanFile(sdk.config.workDir, homeDir);
|
|
3470
|
+
const progress = await readProgressFile(sdk.config.workDir, homeDir);
|
|
3471
|
+
appendStatic([...formatInfoLine(formatManagerUpdatePreview(plan, progress).split('\n').slice(0, 2).join(' · ')), '']);
|
|
3472
|
+
const githubDigest = await resolveGitHubDigestForUpdate(sdk.config.workDir, arg || undefined);
|
|
3473
|
+
prompt = buildUpdateProgressPrompt({
|
|
3474
|
+
instruction: arg || undefined,
|
|
3475
|
+
gitSummary,
|
|
3476
|
+
conversationSummaries,
|
|
3477
|
+
githubDigest,
|
|
3478
|
+
currentPlanJson: JSON.stringify(plan, null, 2),
|
|
3479
|
+
currentProgress: progress ?? undefined,
|
|
3480
|
+
});
|
|
3481
|
+
}
|
|
3482
|
+
else {
|
|
3483
|
+
prompt = arg;
|
|
3484
|
+
}
|
|
3485
|
+
managerTuiSession = await resolveManagerTuiSession();
|
|
3486
|
+
try {
|
|
3487
|
+
const compactResult = await managerTuiSession.compact({});
|
|
3488
|
+
if (compactResult.compacted) {
|
|
3489
|
+
appendStatic([...formatInfoLine(`manager compacted ${compactResult.messagesRemoved ?? '?'} older messages`), '']);
|
|
3490
|
+
}
|
|
3491
|
+
}
|
|
3492
|
+
catch { /* auto-compact is best-effort */ }
|
|
3493
|
+
const runOptions = {
|
|
3494
|
+
systemPrompt: buildManagerSystemPrompt(sdk.config.workDir, cfg),
|
|
3495
|
+
tools: managerTools,
|
|
3496
|
+
...(cfg.model ? { model: cfg.model } : {}),
|
|
3497
|
+
__actoviqUseDefaultTools: false,
|
|
3498
|
+
__actoviqAllowedTools: managerTools.map((tool) => tool.name),
|
|
3499
|
+
};
|
|
3500
|
+
const stream = managerTuiSession.stream(prompt, runOptions);
|
|
3501
|
+
for await (const event of stream) {
|
|
3502
|
+
if (event.type === 'tool.call')
|
|
3503
|
+
appendStatic([`${A.dim} ⚡ ${event.call.name}${A.reset}`]);
|
|
3504
|
+
}
|
|
3505
|
+
const result = await stream.result;
|
|
3506
|
+
if (result.text)
|
|
3507
|
+
appendStatic([...renderRichText(result.text, screen.width), '']);
|
|
3508
|
+
if (isUpdate)
|
|
3509
|
+
appendStatic([...formatInfoLine(`progress updated · ${managerProgressPath(sdk.config.workDir, homeDir)}`), '']);
|
|
3510
|
+
}
|
|
3511
|
+
catch (error) {
|
|
3512
|
+
appendStatic([...formatErrorLine(`manager error: ${error.message}`), '']);
|
|
3513
|
+
}
|
|
3514
|
+
return;
|
|
3515
|
+
}
|
|
3516
|
+
appendStatic([...formatErrorLine('usage: /manager [status|chat <message>|update [instruction]|config|schedule]'), '']);
|
|
3517
|
+
return;
|
|
3518
|
+
}
|
|
3094
3519
|
default:
|
|
3095
3520
|
appendStatic([...formatErrorLine(`unknown command: /${name} — type /help`), '']);
|
|
3096
3521
|
return;
|
|
@@ -3133,7 +3558,7 @@ export async function runActoviqTui(options = {}) {
|
|
|
3133
3558
|
renderDynamic();
|
|
3134
3559
|
return;
|
|
3135
3560
|
}
|
|
3136
|
-
|
|
3561
|
+
session.steer(text);
|
|
3137
3562
|
appendStatic(formatQueuedPrompt(text));
|
|
3138
3563
|
renderDynamic();
|
|
3139
3564
|
return;
|