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
|
@@ -6,9 +6,11 @@
|
|
|
6
6
|
* and real-time streaming output. Uses the main terminal buffer for
|
|
7
7
|
* native scrollback.
|
|
8
8
|
*/
|
|
9
|
-
import { createAgentSdk, loadJsonConfigFile, loadDefaultActoviqSettings, createActoviqCoreTools, listWorkflows, loadWorkflow, listTeamDefinitions, loadTeamDefinition, createModelTeam, WorktreeService, } from 'actoviq-agent-sdk';
|
|
9
|
+
import { createAgentSdk, loadJsonConfigFile, loadDefaultActoviqSettings, getLoadedJsonConfig, createActoviqCoreTools, 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, transitionProjectIssue, WorktreeService, } from 'actoviq-agent-sdk';
|
|
10
|
+
import { readProjectMeta } from '../gui/projectMeta.js';
|
|
11
|
+
import { LegacySurfaceEventPipeline, } from '../surfaces/index.js';
|
|
12
|
+
import { applyTeamRunEvent, createTeamRunViewState, formatTeamRunTreeLines } from '../team/teamRunView.js';
|
|
10
13
|
import { execSync } from 'node:child_process';
|
|
11
|
-
import os from 'node:os';
|
|
12
14
|
import path from 'node:path';
|
|
13
15
|
import * as readline from 'node:readline';
|
|
14
16
|
import { hasVersionFlag, readPackageVersion } from './version.js';
|
|
@@ -17,7 +19,7 @@ if (hasVersionFlag(process.argv.slice(2))) {
|
|
|
17
19
|
process.exit(0);
|
|
18
20
|
}
|
|
19
21
|
const WORK_DIR = path.resolve(process.argv[2] ?? process.cwd());
|
|
20
|
-
const CONFIG_PATH = process.argv[3] ?? path.join(
|
|
22
|
+
const CONFIG_PATH = process.argv[3] ?? path.join(resolveActoviqHome(), 'settings.json');
|
|
21
23
|
const DEFAULT_PERMISSION_MODE = 'bypassPermissions';
|
|
22
24
|
const PERMISSION_MODES = new Set([
|
|
23
25
|
'default',
|
|
@@ -40,6 +42,17 @@ const C = {
|
|
|
40
42
|
function stripAnsi(s) {
|
|
41
43
|
return s.replace(/\x1b\[[0-9;]*m/g, '').length;
|
|
42
44
|
}
|
|
45
|
+
function surfaceRecord(value) {
|
|
46
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value)
|
|
47
|
+
? value
|
|
48
|
+
: undefined;
|
|
49
|
+
}
|
|
50
|
+
function surfaceString(value) {
|
|
51
|
+
return typeof value === 'string' ? value : undefined;
|
|
52
|
+
}
|
|
53
|
+
function surfaceInteger(value) {
|
|
54
|
+
return Number.isSafeInteger(value) && value >= 0 ? value : undefined;
|
|
55
|
+
}
|
|
43
56
|
// ── System prompt ────────────────────────────────────────────────────
|
|
44
57
|
const SYSTEM_PROMPT = `You are Actoviq, an interactive CLI agent. Working directory: ${WORK_DIR}\n\n` +
|
|
45
58
|
`<env>\nWorking directory: ${WORK_DIR}\nIs git repo: ${isGit ? 'Yes' : 'No'}\nPlatform: ${process.platform}\nDate: ${new Date().toISOString().slice(0, 10)}\n</env>\n\n` +
|
|
@@ -74,7 +87,9 @@ const CMDS = {
|
|
|
74
87
|
dream: 'Trigger memory consolidation',
|
|
75
88
|
workflows: 'List or run dynamic workflows',
|
|
76
89
|
worktree: 'Enter, exit, or list git worktrees',
|
|
77
|
-
team: 'List or
|
|
90
|
+
team: 'List, attach, or run Model Teams',
|
|
91
|
+
issues: 'List or update project issues',
|
|
92
|
+
manager: 'Project Manager: progress docs + status',
|
|
78
93
|
};
|
|
79
94
|
function completer(line) {
|
|
80
95
|
if (!line.startsWith('/'))
|
|
@@ -145,6 +160,54 @@ async function main() {
|
|
|
145
160
|
process.stdout.write(`${C.c}├${'─'.repeat(Math.min(w - 2, 60))}┤${C.r}\n\n`);
|
|
146
161
|
let abortCtrl = null;
|
|
147
162
|
let msgCount = 0;
|
|
163
|
+
// Persistent Manager session (kind: 'manager') — reused across /manager
|
|
164
|
+
// update/chat turns so the Manager keeps its own conversation context.
|
|
165
|
+
let managerSession = null;
|
|
166
|
+
// ── Team state (Phase 0: attach / autoInvoke / status) ─────────
|
|
167
|
+
const teamPrefs = readTeamPreferences(getLoadedJsonConfig()?.raw);
|
|
168
|
+
let activeTeamTool = null;
|
|
169
|
+
let activeTeamName = null;
|
|
170
|
+
let lastTeamRunSummary = null;
|
|
171
|
+
const attachTeam = (name) => {
|
|
172
|
+
const loaded = loadTeamDefinition(name, sdk.config.workDir);
|
|
173
|
+
if (!loaded)
|
|
174
|
+
return null;
|
|
175
|
+
const definition = instantiateTeamDefinition(loaded.definition, session.model);
|
|
176
|
+
activeTeamTool = createTeamTool(definition);
|
|
177
|
+
activeTeamName = definition.name;
|
|
178
|
+
return definition;
|
|
179
|
+
};
|
|
180
|
+
if (teamPrefs.defaultAttached) {
|
|
181
|
+
// Silently ignore unresolvable names; /team status surfaces the hint.
|
|
182
|
+
try {
|
|
183
|
+
attachTeam(teamPrefs.defaultAttached);
|
|
184
|
+
}
|
|
185
|
+
catch { /* ignore */ }
|
|
186
|
+
}
|
|
187
|
+
async function resolveManagerSession() {
|
|
188
|
+
if (managerSession)
|
|
189
|
+
return managerSession;
|
|
190
|
+
const managers = (await sdk.sessions.list()).filter(item => item.kind === 'manager');
|
|
191
|
+
managers.sort((a, b) => {
|
|
192
|
+
if (b.messageCount !== a.messageCount)
|
|
193
|
+
return b.messageCount - a.messageCount;
|
|
194
|
+
return (b.updatedAt || '').localeCompare(a.updatedAt || '');
|
|
195
|
+
});
|
|
196
|
+
for (const dup of managers.slice(1)) {
|
|
197
|
+
await sdk.sessions.delete(dup.id).catch(() => undefined);
|
|
198
|
+
}
|
|
199
|
+
const existing = managers[0];
|
|
200
|
+
if (existing) {
|
|
201
|
+
managerSession = await sdk.resumeSession(existing.id, { permissionMode: DEFAULT_PERMISSION_MODE });
|
|
202
|
+
return managerSession;
|
|
203
|
+
}
|
|
204
|
+
managerSession = await sdk.createSession({
|
|
205
|
+
title: 'Manager',
|
|
206
|
+
metadata: { __actoviqKind: 'manager' },
|
|
207
|
+
permissionMode: DEFAULT_PERMISSION_MODE,
|
|
208
|
+
});
|
|
209
|
+
return managerSession;
|
|
210
|
+
}
|
|
148
211
|
// ── Process message ────────────────────────────────────────────
|
|
149
212
|
async function processMsg(text) {
|
|
150
213
|
const t = text.trim();
|
|
@@ -202,7 +265,7 @@ async function main() {
|
|
|
202
265
|
process.stdout.write(`${C.d}No stored sessions.${C.r}\n\n`);
|
|
203
266
|
return;
|
|
204
267
|
}
|
|
205
|
-
for (const stored of sessions) {
|
|
268
|
+
for (const stored of sessions.filter(item => item.kind !== 'manager')) {
|
|
206
269
|
const current = stored.id === session.id ? '*' : ' ';
|
|
207
270
|
process.stdout.write(`${C.d}${current} ${stored.id} ${stored.title} ${stored.model}${C.r}\n`);
|
|
208
271
|
}
|
|
@@ -215,6 +278,12 @@ async function main() {
|
|
|
215
278
|
process.stdout.write(`${C.R}Usage: /resume <session-id>${C.r}\n\n`);
|
|
216
279
|
return;
|
|
217
280
|
}
|
|
281
|
+
const listed = await sdk.sessions.list();
|
|
282
|
+
const target = listed.find(item => item.id === sessionId);
|
|
283
|
+
if (target?.kind === 'manager') {
|
|
284
|
+
process.stdout.write(`${C.R}Manager sessions live in the Project Manager panel only.${C.r}\n\n`);
|
|
285
|
+
return;
|
|
286
|
+
}
|
|
218
287
|
session = await sdk.resumeSession(sessionId);
|
|
219
288
|
process.stdout.write(`${C.g}Resumed ${session.id}: ${session.title} (${session.model})${C.r}\n\n`);
|
|
220
289
|
return;
|
|
@@ -286,6 +355,7 @@ async function main() {
|
|
|
286
355
|
const { WorkflowScriptRuntime } = await import('../workflow/workflowScriptRuntime.js');
|
|
287
356
|
const runtime = new WorkflowScriptRuntime({
|
|
288
357
|
sdk: sdk,
|
|
358
|
+
trust: 'trusted',
|
|
289
359
|
args: wfTask,
|
|
290
360
|
onEvent: (e) => {
|
|
291
361
|
if (e.type === 'workflow.log')
|
|
@@ -364,17 +434,55 @@ async function main() {
|
|
|
364
434
|
}
|
|
365
435
|
// ── v0.5.0: Model Team ─────────────────────────────────────
|
|
366
436
|
case 'team': {
|
|
367
|
-
const sub = t.slice(sp + 1).trim();
|
|
437
|
+
const sub = sp === -1 ? '' : t.slice(sp + 1).trim();
|
|
368
438
|
if (!sub || sub === 'list') {
|
|
369
439
|
const teams = listTeamDefinitions(sdk.config.workDir);
|
|
370
|
-
|
|
371
|
-
|
|
440
|
+
for (const item of teams) {
|
|
441
|
+
const active = item.name === activeTeamName ? `${C.g}*${C.r}` : ' ';
|
|
442
|
+
process.stdout.write(`${active}${C.c}${item.name}${C.r}${C.d} · ${item.definition.mode} · ${item.source} · ${countTeamAgents(item.definition)} agents${C.r}\n`);
|
|
372
443
|
}
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
444
|
+
process.stdout.write(`${C.d}\n/team attach <name> · /team ask <name> <prompt> · /team off · /team status${C.r}\n\n`);
|
|
445
|
+
return;
|
|
446
|
+
}
|
|
447
|
+
if (sub === 'status') {
|
|
448
|
+
const lines = [
|
|
449
|
+
`attached: ${activeTeamName ?? 'none'}`,
|
|
450
|
+
`autoInvoke: ${teamPrefs.autoInvoke ? 'on (main agent can call the team as a tool)' : 'off (manual /team ask only)'}`,
|
|
451
|
+
`defaultAttached: ${teamPrefs.defaultAttached ?? 'none'}` +
|
|
452
|
+
(teamPrefs.defaultAttached && !activeTeamName ? ` ${C.y}(not found)${C.r}` : ''),
|
|
453
|
+
`last run: ${lastTeamRunSummary ?? 'none'}`,
|
|
454
|
+
];
|
|
455
|
+
process.stdout.write(`${C.d}${lines.join('\n')}${C.r}\n\n`);
|
|
456
|
+
return;
|
|
457
|
+
}
|
|
458
|
+
if (sub === 'off') {
|
|
459
|
+
activeTeamTool = null;
|
|
460
|
+
activeTeamName = null;
|
|
461
|
+
process.stdout.write(`${C.d}team: none${C.r}\n\n`);
|
|
462
|
+
return;
|
|
463
|
+
}
|
|
464
|
+
if (sub.startsWith('attach ')) {
|
|
465
|
+
const teamName = sub.slice(7).trim();
|
|
466
|
+
const definition = attachTeam(teamName);
|
|
467
|
+
if (!definition) {
|
|
468
|
+
process.stdout.write(`${C.R}Team not found: ${teamName}${C.r}\n\n`);
|
|
469
|
+
return;
|
|
470
|
+
}
|
|
471
|
+
process.stdout.write(`${C.g}team attached: ${definition.name}${C.r}${C.d} (${definition.mode}) · autoInvoke ${teamPrefs.autoInvoke ? 'on' : 'off — run /team ask to use it'}${C.r}\n\n`);
|
|
472
|
+
return;
|
|
473
|
+
}
|
|
474
|
+
if (sub.startsWith('clone ')) {
|
|
475
|
+
const parts = sub.slice(6).trim().split(/\s+/);
|
|
476
|
+
if (parts.length !== 2) {
|
|
477
|
+
process.stdout.write(`${C.R}Usage: /team clone <source> <new-name>${C.r}\n\n`);
|
|
478
|
+
return;
|
|
479
|
+
}
|
|
480
|
+
try {
|
|
481
|
+
const clone = await cloneTeamDefinition(parts[0], parts[1], { projectDir: sdk.config.workDir });
|
|
482
|
+
process.stdout.write(`${C.g}team cloned: ${parts[0]} → ${clone.name}${C.r}${C.d} (${clone.filePath})${C.r}\n\n`);
|
|
483
|
+
}
|
|
484
|
+
catch (e) {
|
|
485
|
+
process.stdout.write(`${C.R}✕ Clone failed: ${e.message}${C.r}\n\n`);
|
|
378
486
|
}
|
|
379
487
|
return;
|
|
380
488
|
}
|
|
@@ -392,10 +500,33 @@ async function main() {
|
|
|
392
500
|
process.stdout.write(`${C.R}Team not found: ${teamName}${C.r}\n\n`);
|
|
393
501
|
return;
|
|
394
502
|
}
|
|
395
|
-
|
|
503
|
+
const definition = instantiateTeamDefinition(loaded.definition, session.model);
|
|
504
|
+
const memberModels = listTeamAgentLabels(definition);
|
|
505
|
+
process.stdout.write(`${C.d}Asking team "${teamName}" (${definition.mode})...${C.r}\n`);
|
|
396
506
|
try {
|
|
397
|
-
const team = createModelTeam(
|
|
398
|
-
const
|
|
507
|
+
const team = createModelTeam(definition);
|
|
508
|
+
const teamRunView = createTeamRunViewState(definition.name);
|
|
509
|
+
const printTeamRunTree = () => {
|
|
510
|
+
for (const line of formatTeamRunTreeLines(teamRunView)) {
|
|
511
|
+
process.stdout.write(`${C.d}${line}${C.r}\n`);
|
|
512
|
+
}
|
|
513
|
+
};
|
|
514
|
+
const result = await team.ask(prompt, undefined, {
|
|
515
|
+
workDir: sdk.config.workDir,
|
|
516
|
+
onEvent: (e) => {
|
|
517
|
+
applyTeamRunEvent(teamRunView, e);
|
|
518
|
+
if (e.type === 'team.synthesis') {
|
|
519
|
+
process.stdout.write(`${C.d} ◈ synthesis round ${e.round}: ${e.decision}${C.r}\n`);
|
|
520
|
+
}
|
|
521
|
+
else if (e.type === 'team.started'
|
|
522
|
+
|| e.type === 'team.member.completed'
|
|
523
|
+
|| e.type === 'team.edge.triggered'
|
|
524
|
+
|| e.type === 'team.completed') {
|
|
525
|
+
printTeamRunTree();
|
|
526
|
+
}
|
|
527
|
+
},
|
|
528
|
+
});
|
|
529
|
+
lastTeamRunSummary = `${teamName} · ${result.mode} · ${Math.round(result.durationMs / 1000)}s`;
|
|
399
530
|
process.stdout.write(`${C.g}✓ Response${C.r}${C.d} · ${result.mode} · ${Math.round(result.durationMs / 1000)}s${C.r}\n`);
|
|
400
531
|
if (result.cost.estimatedCost !== null) {
|
|
401
532
|
process.stdout.write(`${C.d} cost: $${result.cost.estimatedCost.toFixed(4)} · ${result.cost.totalInputTokens + result.cost.totalOutputTokens} tokens${C.r}\n`);
|
|
@@ -407,7 +538,272 @@ async function main() {
|
|
|
407
538
|
}
|
|
408
539
|
return;
|
|
409
540
|
}
|
|
410
|
-
process.stdout.write(`${C.d}Usage: /team [list|ask <name> <prompt>]${C.r}\n\n`);
|
|
541
|
+
process.stdout.write(`${C.d}Usage: /team [list|attach <name>|off|ask <name> <prompt>|clone <source> <new>|status]${C.r}\n\n`);
|
|
542
|
+
return;
|
|
543
|
+
}
|
|
544
|
+
// Project issues
|
|
545
|
+
case 'issues': {
|
|
546
|
+
const sub = sp === -1 ? '' : t.slice(sp + 1).trim();
|
|
547
|
+
const homeDir = sdk.config.homeDir;
|
|
548
|
+
const meta = await readProjectMeta(WORK_DIR, homeDir);
|
|
549
|
+
const storage = isIssueStorageMode(meta.issueStorage) ? meta.issueStorage : 'home';
|
|
550
|
+
if (!sub || sub === 'list') {
|
|
551
|
+
const issues = await listProjectIssues(WORK_DIR, homeDir, storage);
|
|
552
|
+
if (issues.length === 0) {
|
|
553
|
+
process.stdout.write(`${C.d}No issues yet. Use /issues create <title>${C.r}\n\n`);
|
|
554
|
+
return;
|
|
555
|
+
}
|
|
556
|
+
process.stdout.write(`${C.b}Issues (${storage})${C.r}\n`);
|
|
557
|
+
for (const issue of issues) {
|
|
558
|
+
process.stdout.write(`#${issue.number} ${issue.title} ${C.d}${issue.status} · ${issue.priority}${C.r}\n`);
|
|
559
|
+
}
|
|
560
|
+
process.stdout.write('\n');
|
|
561
|
+
return;
|
|
562
|
+
}
|
|
563
|
+
if (sub.startsWith('create ')) {
|
|
564
|
+
const title = sub.slice(7).trim();
|
|
565
|
+
if (!title) {
|
|
566
|
+
process.stdout.write(`${C.R}Usage: /issues create <title>${C.r}\n\n`);
|
|
567
|
+
return;
|
|
568
|
+
}
|
|
569
|
+
const issue = await createProjectIssue(WORK_DIR, homeDir, { title }, storage);
|
|
570
|
+
process.stdout.write(`${C.g}issue created: #${issue.number} ${issue.title}${C.r}\n\n`);
|
|
571
|
+
return;
|
|
572
|
+
}
|
|
573
|
+
if (sub.startsWith('show ')) {
|
|
574
|
+
const rawId = sub.slice(5).trim().replace(/^#/, '');
|
|
575
|
+
const issues = await listProjectIssues(WORK_DIR, homeDir, storage);
|
|
576
|
+
const issue = issues.find(candidate => candidate.id === rawId ||
|
|
577
|
+
String(candidate.number) === rawId ||
|
|
578
|
+
`ISS-${candidate.number}` === rawId.toUpperCase());
|
|
579
|
+
if (!issue) {
|
|
580
|
+
process.stdout.write(`${C.R}Issue not found: ${rawId}${C.r}\n\n`);
|
|
581
|
+
return;
|
|
582
|
+
}
|
|
583
|
+
process.stdout.write(`${C.b}ISS-${issue.number} ${issue.title}${C.r}\n` +
|
|
584
|
+
`${C.d}${issue.status} · ${issue.priority}${C.r}\n` +
|
|
585
|
+
`${issue.description || '(no description)'}\n` +
|
|
586
|
+
`${issue.acceptanceCriteria.length ? `\nAcceptance criteria:\n${issue.acceptanceCriteria.map(item => `- ${item}`).join('\n')}` : ''}` +
|
|
587
|
+
`${issue.brief ? `\n\nManager brief:\n${issue.brief}` : ''}\n\n`);
|
|
588
|
+
return;
|
|
589
|
+
}
|
|
590
|
+
if (sub.startsWith('start ')) {
|
|
591
|
+
const [, rawId, agentProfile] = sub.split(/\s+/, 3);
|
|
592
|
+
const id = rawId?.replace(/^#/, '');
|
|
593
|
+
const issues = await listProjectIssues(WORK_DIR, homeDir, storage);
|
|
594
|
+
const issue = issues.find(candidate => candidate.id === id ||
|
|
595
|
+
String(candidate.number) === id ||
|
|
596
|
+
`ISS-${candidate.number}` === id?.toUpperCase());
|
|
597
|
+
if (!issue) {
|
|
598
|
+
process.stdout.write(`${C.R}Issue not found: ${rawId ?? ''}${C.r}\n\n`);
|
|
599
|
+
return;
|
|
600
|
+
}
|
|
601
|
+
process.stdout.write(`${C.d}Decomposing and dispatching ISS-${issue.number}...${C.r}\n`);
|
|
602
|
+
const dispatched = await executeProjectIssue({
|
|
603
|
+
sdk,
|
|
604
|
+
managerSession: await resolveManagerSession(),
|
|
605
|
+
workDir: WORK_DIR,
|
|
606
|
+
homeDir,
|
|
607
|
+
storageMode: storage,
|
|
608
|
+
issue,
|
|
609
|
+
agentProfile,
|
|
610
|
+
defaultModel: session.model,
|
|
611
|
+
permissionMode: session.permissionContext.mode ?? DEFAULT_PERMISSION_MODE,
|
|
612
|
+
systemPrompt: SYSTEM_PROMPT,
|
|
613
|
+
onEvent: event => {
|
|
614
|
+
if (event.type === 'response.text.delta')
|
|
615
|
+
process.stdout.write(event.delta);
|
|
616
|
+
else if (event.type === 'tool.call')
|
|
617
|
+
toolLine(event.call.name, event.call.input);
|
|
618
|
+
else if (event.type === 'tool.result')
|
|
619
|
+
resultLine(event.result.isError, event.result.durationMs, event.result.output);
|
|
620
|
+
},
|
|
621
|
+
});
|
|
622
|
+
session = dispatched.session;
|
|
623
|
+
process.stdout.write(`\n${C.g}ISS-${dispatched.issue.number}: ${dispatched.issue.status} · session ${session.id}${C.r}\n\n`);
|
|
624
|
+
return;
|
|
625
|
+
}
|
|
626
|
+
const transitions = {
|
|
627
|
+
review: 'in_review',
|
|
628
|
+
done: 'done',
|
|
629
|
+
block: 'blocked',
|
|
630
|
+
};
|
|
631
|
+
const [verb, rawId] = sub.split(/\s+/, 2);
|
|
632
|
+
const nextStatus = transitions[verb ?? ''];
|
|
633
|
+
if (nextStatus && isIssueStatus(nextStatus) && rawId) {
|
|
634
|
+
const issue = await transitionProjectIssue(WORK_DIR, homeDir, rawId.replace(/^#/, ''), nextStatus, 'user', storage);
|
|
635
|
+
if (!issue)
|
|
636
|
+
process.stdout.write(`${C.R}Issue not found: ${rawId}${C.r}\n\n`);
|
|
637
|
+
else
|
|
638
|
+
process.stdout.write(`${C.g}issue #${issue.number}: ${issue.status}${C.r}\n\n`);
|
|
639
|
+
return;
|
|
640
|
+
}
|
|
641
|
+
process.stdout.write(`${C.d}Usage: /issues [list|show <id>|create <title>|start <id> [agent-profile]|review <id>|done <id>|block <id>]${C.r}\n\n`);
|
|
642
|
+
return;
|
|
643
|
+
}
|
|
644
|
+
// ── Project Manager ────────────────────────────────────────
|
|
645
|
+
case 'manager': {
|
|
646
|
+
const sub = sp === -1 ? '' : t.slice(sp + 1).trim();
|
|
647
|
+
const homeDir = sdk.config.homeDir;
|
|
648
|
+
if (!sub || sub === 'status') {
|
|
649
|
+
const cfg = await readManagerConfig(WORK_DIR, homeDir);
|
|
650
|
+
const plan = await readProjectPlanFile(WORK_DIR, homeDir);
|
|
651
|
+
const progress = await readProgressFile(WORK_DIR, homeDir);
|
|
652
|
+
const lines = [
|
|
653
|
+
`model: ${cfg.model ?? session.model + ' (session default)'}`,
|
|
654
|
+
`readScope: ${cfg.readScope}`,
|
|
655
|
+
`mirror to workspace: ${cfg.mirrorProgressToWorkspace ? 'on' : 'off'}`,
|
|
656
|
+
`plan.json: ${plan.milestones.length} milestones · ${plan.today.length} today · ${plan.upcoming.length} upcoming`,
|
|
657
|
+
`PROGRESS.md: ${progress ? `${progress.length} chars · ${managerProgressPath(WORK_DIR, homeDir)}` : '(none yet — /manager update)'}`,
|
|
658
|
+
];
|
|
659
|
+
process.stdout.write(`${C.b}Manager${C.r}\n${C.d}${lines.join('\n')}${C.r}\n\n`);
|
|
660
|
+
return;
|
|
661
|
+
}
|
|
662
|
+
if (sub === 'config') {
|
|
663
|
+
const cfg = await readManagerConfig(WORK_DIR, homeDir);
|
|
664
|
+
process.stdout.write(`${C.d}${JSON.stringify(cfg, null, 2)}\nSet: /manager config set <model|bridgeConfig|readScope|mirror|allow> <value>\nThe Manager always runs read-only regardless of model.${C.r}\n\n`);
|
|
665
|
+
return;
|
|
666
|
+
}
|
|
667
|
+
if (sub.startsWith('config set ')) {
|
|
668
|
+
const rest = sub.slice('config set '.length).trim();
|
|
669
|
+
const spIdx = rest.indexOf(' ');
|
|
670
|
+
const key = spIdx === -1 ? rest : rest.slice(0, spIdx);
|
|
671
|
+
const value = spIdx === -1 ? '' : rest.slice(spIdx + 1).trim();
|
|
672
|
+
const cfg = await readManagerConfig(WORK_DIR, homeDir);
|
|
673
|
+
if (key === 'model')
|
|
674
|
+
cfg.model = value || undefined;
|
|
675
|
+
else if (key === 'bridgeConfig' || key === 'config')
|
|
676
|
+
cfg.bridgeConfig = value || undefined;
|
|
677
|
+
else if (key === 'readScope') {
|
|
678
|
+
if (value !== 'workspace-only' && value !== 'workspace+docs' && value !== 'explicit-allowlist' && value !== 'full-access') {
|
|
679
|
+
process.stdout.write(`${C.R}readScope must be workspace-only | workspace+docs | explicit-allowlist | full-access${C.r}\n\n`);
|
|
680
|
+
return;
|
|
681
|
+
}
|
|
682
|
+
cfg.readScope = value;
|
|
683
|
+
}
|
|
684
|
+
else if (key === 'mirror')
|
|
685
|
+
cfg.mirrorProgressToWorkspace = value === 'on' || value === 'true';
|
|
686
|
+
else if (key === 'allow')
|
|
687
|
+
cfg.allowedReadPaths = value ? value.split(',').map(p => p.trim()).filter(Boolean) : [];
|
|
688
|
+
else {
|
|
689
|
+
process.stdout.write(`${C.R}usage: /manager config set <model|bridgeConfig|readScope|mirror|allow> <value>${C.r}\n\n`);
|
|
690
|
+
return;
|
|
691
|
+
}
|
|
692
|
+
await writeManagerConfig(WORK_DIR, homeDir, cfg);
|
|
693
|
+
process.stdout.write(`${C.g}✓ Manager config updated: ${key}${C.r}\n\n`);
|
|
694
|
+
return;
|
|
695
|
+
}
|
|
696
|
+
if (sub === 'schedule') {
|
|
697
|
+
const tasks = (await listScheduledAutomationTasks(WORK_DIR)).filter(task => task.kind === 'manager');
|
|
698
|
+
if (tasks.length === 0) {
|
|
699
|
+
process.stdout.write(`${C.d}No manager schedules. Add kind:"manager" tasks to .actoviq/scheduled-tasks.json${C.r}\n\n`);
|
|
700
|
+
return;
|
|
701
|
+
}
|
|
702
|
+
for (const task of tasks) {
|
|
703
|
+
process.stdout.write(`${C.c}${task.name}${C.r}${C.d} · ${task.cron} · ${task.enabled ? 'enabled' : 'paused'}${C.r}\n`);
|
|
704
|
+
}
|
|
705
|
+
process.stdout.write('\n');
|
|
706
|
+
return;
|
|
707
|
+
}
|
|
708
|
+
const isUpdate = sub === 'update' || sub.startsWith('update ');
|
|
709
|
+
const isChat = sub === 'chat' || sub.startsWith('chat ');
|
|
710
|
+
if (isUpdate || isChat) {
|
|
711
|
+
const arg = isUpdate
|
|
712
|
+
? (sub === 'update' ? '' : sub.slice('update'.length).trim())
|
|
713
|
+
: sub.slice('chat'.length).trim();
|
|
714
|
+
if (isChat && !arg) {
|
|
715
|
+
process.stdout.write(`${C.d}Usage: /manager chat <message>${C.r}\n\n`);
|
|
716
|
+
return;
|
|
717
|
+
}
|
|
718
|
+
if (isUpdate)
|
|
719
|
+
process.stdout.write(`${C.d}Manager: updating progress documents...${C.r}\n`);
|
|
720
|
+
try {
|
|
721
|
+
const cfg = await readManagerConfig(WORK_DIR, homeDir);
|
|
722
|
+
const managerTools = await createManagerTools({ workDir: WORK_DIR, homeDir, config: cfg });
|
|
723
|
+
let prompt;
|
|
724
|
+
if (isUpdate) {
|
|
725
|
+
// Host-collected context (the Manager itself has no shell).
|
|
726
|
+
let gitSummary = '';
|
|
727
|
+
try {
|
|
728
|
+
const branch = execSync('git rev-parse --abbrev-ref HEAD', { cwd: WORK_DIR, encoding: 'utf8' }).trim();
|
|
729
|
+
const dirty = execSync('git status --porcelain', { cwd: WORK_DIR, encoding: 'utf8' }).trim();
|
|
730
|
+
const log = execSync('git log --oneline -10', { cwd: WORK_DIR, encoding: 'utf8' }).trim();
|
|
731
|
+
gitSummary = `branch: ${branch}\ndirty files: ${dirty ? dirty.split('\n').length : 0}\nrecent commits:\n${log}`;
|
|
732
|
+
}
|
|
733
|
+
catch { /* not a git repo */ }
|
|
734
|
+
const stored = await sdk.sessions.list();
|
|
735
|
+
const conversationSummaries = stored
|
|
736
|
+
.filter(s => s.kind !== 'manager')
|
|
737
|
+
.slice(0, 20)
|
|
738
|
+
.map(s => `- [${s.updatedAt.slice(0, 10)}] ${s.title} (${s.messageCount} msgs): ${s.preview}`)
|
|
739
|
+
.join('\n');
|
|
740
|
+
const plan = await readProjectPlanFile(WORK_DIR, homeDir);
|
|
741
|
+
const progress = await readProgressFile(WORK_DIR, homeDir);
|
|
742
|
+
process.stdout.write(`${C.d}${formatManagerUpdatePreview(plan, progress).split('\n').slice(0, 2).join('\n')}${C.r}\n`);
|
|
743
|
+
const githubDigest = await resolveGitHubDigestForUpdate(WORK_DIR, arg || undefined);
|
|
744
|
+
prompt = buildUpdateProgressPrompt({
|
|
745
|
+
instruction: arg || undefined,
|
|
746
|
+
gitSummary,
|
|
747
|
+
conversationSummaries,
|
|
748
|
+
githubDigest,
|
|
749
|
+
currentPlanJson: JSON.stringify(plan, null, 2),
|
|
750
|
+
currentProgress: progress ?? undefined,
|
|
751
|
+
});
|
|
752
|
+
}
|
|
753
|
+
else {
|
|
754
|
+
prompt = arg;
|
|
755
|
+
}
|
|
756
|
+
managerSession = await resolveManagerSession();
|
|
757
|
+
try {
|
|
758
|
+
const compactResult = await managerSession.compact({});
|
|
759
|
+
if (compactResult.compacted) {
|
|
760
|
+
process.stdout.write(`${C.d}Manager: compacted ${compactResult.messagesRemoved ?? '?'} older messages${C.r}\n`);
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
catch { /* auto-compact is best-effort */ }
|
|
764
|
+
abortCtrl = new AbortController();
|
|
765
|
+
const runOptions = {
|
|
766
|
+
systemPrompt: buildManagerSystemPrompt(WORK_DIR, cfg),
|
|
767
|
+
tools: managerTools,
|
|
768
|
+
signal: abortCtrl.signal,
|
|
769
|
+
...(cfg.model ? { model: cfg.model } : {}),
|
|
770
|
+
__actoviqUseDefaultTools: false,
|
|
771
|
+
__actoviqAllowedTools: managerTools.map(tool => tool.name),
|
|
772
|
+
};
|
|
773
|
+
const stream = managerSession.stream(prompt, runOptions);
|
|
774
|
+
const managerSurfaceEvents = new LegacySurfaceEventPipeline();
|
|
775
|
+
for await (const event of stream) {
|
|
776
|
+
for (const surfaceEvent of managerSurfaceEvents.projectFor(event, 'cli')) {
|
|
777
|
+
const data = surfaceEvent.data;
|
|
778
|
+
if (surfaceEvent.type === 'tool.started') {
|
|
779
|
+
toolLine(surfaceString(data.name) ?? surfaceString(data.publicName) ?? 'tool', surfaceRecord(data.input) ?? {});
|
|
780
|
+
}
|
|
781
|
+
else if (surfaceEvent.type === 'tool.completed'
|
|
782
|
+
|| surfaceEvent.type === 'tool.failed'
|
|
783
|
+
|| surfaceEvent.type === 'tool.rejected') {
|
|
784
|
+
resultLine(data.isError === true, undefined, data.output);
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
const result = await stream.result;
|
|
789
|
+
if (result.text)
|
|
790
|
+
process.stdout.write(`${result.text}\n`);
|
|
791
|
+
if (isUpdate) {
|
|
792
|
+
process.stdout.write(`${C.g}✓ Progress updated${C.r}${C.d} · ${managerProgressPath(WORK_DIR, homeDir)}${C.r}\n\n`);
|
|
793
|
+
}
|
|
794
|
+
else {
|
|
795
|
+
process.stdout.write('\n');
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
catch (e) {
|
|
799
|
+
process.stdout.write(`${C.R}✕ Manager error: ${e.message}${C.r}\n\n`);
|
|
800
|
+
}
|
|
801
|
+
finally {
|
|
802
|
+
abortCtrl = null;
|
|
803
|
+
}
|
|
804
|
+
return;
|
|
805
|
+
}
|
|
806
|
+
process.stdout.write(`${C.d}Usage: /manager [status|chat <message>|update [instruction]|config|schedule]${C.r}\n\n`);
|
|
411
807
|
return;
|
|
412
808
|
}
|
|
413
809
|
default:
|
|
@@ -421,52 +817,71 @@ async function main() {
|
|
|
421
817
|
signal: abortCtrl.signal,
|
|
422
818
|
model: session.model,
|
|
423
819
|
permissionMode: session.permissionContext.mode ?? DEFAULT_PERMISSION_MODE,
|
|
820
|
+
// Attached team is only exposed to the main agent when autoInvoke is on;
|
|
821
|
+
// otherwise attach is a selection and /team ask stays the manual path.
|
|
822
|
+
...(activeTeamTool && teamPrefs.autoInvoke ? { tools: [activeTeamTool] } : {}),
|
|
424
823
|
});
|
|
425
824
|
let iteration = 0;
|
|
426
825
|
let hasText = false;
|
|
427
826
|
const activeTools = new Map();
|
|
827
|
+
const surfaceEvents = new LegacySurfaceEventPipeline();
|
|
428
828
|
for await (const event of stream) {
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
829
|
+
for (const surfaceEvent of surfaceEvents.projectFor(event, 'cli')) {
|
|
830
|
+
const data = surfaceEvent.data;
|
|
831
|
+
switch (surfaceEvent.type) {
|
|
832
|
+
case 'request.started':
|
|
833
|
+
iteration = surfaceInteger(data.iteration) ?? iteration;
|
|
834
|
+
if (iteration > 1)
|
|
835
|
+
process.stdout.write(`\n${C.d}── iteration ${iteration} ──${C.r}\n`);
|
|
836
|
+
break;
|
|
837
|
+
case 'text.delta': {
|
|
838
|
+
const txt = surfaceString(data.delta) ?? '';
|
|
839
|
+
process.stdout.write(txt);
|
|
840
|
+
hasText = true;
|
|
841
|
+
break;
|
|
842
|
+
}
|
|
843
|
+
case 'model.content': {
|
|
844
|
+
const content = surfaceRecord(data.content);
|
|
845
|
+
if (data.kind === 'content' && content?.type === 'thinking') {
|
|
846
|
+
const th = (surfaceString(content.thinking) ?? '').slice(0, 250);
|
|
847
|
+
process.stdout.write(`\n${C.d}💭 ${th}${C.r}\n`);
|
|
848
|
+
}
|
|
849
|
+
break;
|
|
850
|
+
}
|
|
851
|
+
case 'tool.started': {
|
|
852
|
+
const callId = surfaceString(data.callId);
|
|
853
|
+
const name = surfaceString(data.name) ?? surfaceString(data.publicName) ?? 'tool';
|
|
854
|
+
if (callId)
|
|
855
|
+
activeTools.set(callId, { name, start: Date.now() });
|
|
856
|
+
toolLine(name, surfaceRecord(data.input) ?? {});
|
|
857
|
+
break;
|
|
858
|
+
}
|
|
859
|
+
case 'tool.progress': {
|
|
860
|
+
const message = surfaceString(data.message)
|
|
861
|
+
?? surfaceString(surfaceRecord(data.progress)?.message);
|
|
862
|
+
if (message)
|
|
863
|
+
process.stdout.write(`\r\x1b[K${C.d} ${message}${C.r}`);
|
|
864
|
+
break;
|
|
865
|
+
}
|
|
866
|
+
case 'tool.completed':
|
|
867
|
+
case 'tool.failed':
|
|
868
|
+
case 'tool.rejected': {
|
|
869
|
+
const callId = surfaceString(data.callId);
|
|
870
|
+
const info = callId ? activeTools.get(callId) : undefined;
|
|
871
|
+
if (callId)
|
|
872
|
+
activeTools.delete(callId);
|
|
873
|
+
resultLine(data.isError === true, info ? Date.now() - info.start : undefined, data.output);
|
|
874
|
+
break;
|
|
875
|
+
}
|
|
876
|
+
case 'compaction.completed':
|
|
877
|
+
process.stdout.write(`\n${C.d}── context compacted ──${C.r}\n`);
|
|
878
|
+
break;
|
|
879
|
+
case 'error':
|
|
880
|
+
process.stdout.write(`\n${C.R} ✕ ${surfaceString(data.message) ?? 'run failed'}${C.r}\n`);
|
|
881
|
+
break;
|
|
882
|
+
default:
|
|
883
|
+
break;
|
|
463
884
|
}
|
|
464
|
-
case 'session.compacted':
|
|
465
|
-
process.stdout.write(`\n${C.d}── context compacted ──${C.r}\n`);
|
|
466
|
-
break;
|
|
467
|
-
case 'error':
|
|
468
|
-
process.stdout.write(`\n${C.R} ✕ ${event.error.message}${C.r}\n`);
|
|
469
|
-
break;
|
|
470
885
|
}
|
|
471
886
|
}
|
|
472
887
|
if (!hasText) {
|
|
@@ -529,15 +944,35 @@ async function main() {
|
|
|
529
944
|
});
|
|
530
945
|
rl.prompt();
|
|
531
946
|
rl.on('line', async (line) => {
|
|
532
|
-
|
|
947
|
+
const queued = line.trim();
|
|
948
|
+
if (abortCtrl) {
|
|
949
|
+
if (!queued) {
|
|
950
|
+
rl.prompt();
|
|
951
|
+
return;
|
|
952
|
+
}
|
|
953
|
+
if (queued.startsWith('/')) {
|
|
954
|
+
process.stdout.write(`${C.d}Slash commands are unavailable while the agent is working.${C.r}\n`);
|
|
955
|
+
rl.prompt();
|
|
956
|
+
return;
|
|
957
|
+
}
|
|
958
|
+
session.steer(queued);
|
|
959
|
+
process.stdout.write(`${C.d} ⧗ queued steering message${C.r}\n`);
|
|
960
|
+
rl.prompt();
|
|
961
|
+
return;
|
|
962
|
+
}
|
|
533
963
|
try {
|
|
534
964
|
await processMsg(line);
|
|
535
965
|
}
|
|
536
966
|
catch (e) {
|
|
537
|
-
if (e.name === 'AbortError')
|
|
967
|
+
if (e.name === 'AbortError' || e.name === 'RunAbortedError') {
|
|
538
968
|
process.stdout.write(`\n${C.y} ⏹ aborted${C.r}\n`);
|
|
539
|
-
|
|
969
|
+
}
|
|
970
|
+
else {
|
|
540
971
|
process.stdout.write(`\n${C.R} ✕ ${e.message}${C.r}\n`);
|
|
972
|
+
}
|
|
973
|
+
}
|
|
974
|
+
finally {
|
|
975
|
+
abortCtrl = null;
|
|
541
976
|
}
|
|
542
977
|
rl.prompt();
|
|
543
978
|
});
|