@opencorelabs/lucidity 0.7.0 → 0.9.5
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/README.md +9 -2
- package/dist/assets/speech/lucidity-speech +0 -0
- package/dist/automations/agent.d.ts.map +1 -1
- package/dist/automations/agent.js +2 -0
- package/dist/automations/designer.d.ts +1 -1
- package/dist/automations/service.d.ts +4 -0
- package/dist/automations/service.d.ts.map +1 -1
- package/dist/automations/service.js +60 -22
- package/dist/automations/store.d.ts +9 -3
- package/dist/automations/store.d.ts.map +1 -1
- package/dist/automations/store.js +45 -32
- package/dist/automations/workflow.d.ts +14 -0
- package/dist/automations/workflow.d.ts.map +1 -0
- package/dist/automations/workflow.js +57 -0
- package/dist/chat/server.d.ts +1 -0
- package/dist/chat/server.d.ts.map +1 -1
- package/dist/chat/server.js +6 -1
- package/dist/coding/listPrs.d.ts +2 -0
- package/dist/coding/listPrs.d.ts.map +1 -1
- package/dist/coding/listPrs.js +10 -0
- package/dist/coding/runCodeTurn.d.ts +6 -30
- package/dist/coding/runCodeTurn.d.ts.map +1 -1
- package/dist/coding/runCodeTurn.js +145 -218
- package/dist/coding/runReview.d.ts +10 -0
- package/dist/coding/runReview.d.ts.map +1 -0
- package/dist/coding/runReview.js +87 -0
- package/dist/coding/workspaceRegistry.d.ts +72 -0
- package/dist/coding/workspaceRegistry.d.ts.map +1 -0
- package/dist/coding/workspaceRegistry.js +421 -0
- package/dist/coding/worktree.d.ts +72 -32
- package/dist/coding/worktree.d.ts.map +1 -1
- package/dist/coding/worktree.js +190 -38
- package/dist/coding/worktreeSetup.d.ts +7 -0
- package/dist/coding/worktreeSetup.d.ts.map +1 -0
- package/dist/coding/worktreeSetup.js +49 -0
- package/dist/config.d.ts +2 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/daemonLease.d.ts +12 -0
- package/dist/daemonLease.d.ts.map +1 -0
- package/dist/daemonLease.js +32 -0
- package/dist/goals/assessment.d.ts +115 -0
- package/dist/goals/assessment.d.ts.map +1 -0
- package/dist/goals/assessment.js +67 -0
- package/dist/goals/notes.d.ts +18 -0
- package/dist/goals/notes.d.ts.map +1 -0
- package/dist/goals/notes.js +72 -0
- package/dist/index.js +75 -40
- package/dist/jobs/briefing.d.ts +2 -16
- package/dist/jobs/briefing.d.ts.map +1 -1
- package/dist/jobs/briefing.js +65 -93
- package/dist/jobs/goals.d.ts +15 -0
- package/dist/jobs/goals.d.ts.map +1 -0
- package/dist/jobs/goals.js +286 -0
- package/dist/jobs/weeklyReview.d.ts.map +1 -1
- package/dist/jobs/weeklyReview.js +3 -2
- package/dist/logTimestamps.d.ts +10 -0
- package/dist/logTimestamps.d.ts.map +1 -0
- package/dist/logTimestamps.js +12 -0
- package/dist/providerRecovery.d.ts +48 -0
- package/dist/providerRecovery.d.ts.map +1 -0
- package/dist/providerRecovery.js +100 -0
- package/dist/queue.d.ts +1 -0
- package/dist/queue.d.ts.map +1 -1
- package/dist/queue.js +4 -0
- package/dist/room/client.d.ts +6 -19
- package/dist/room/client.d.ts.map +1 -1
- package/dist/room/client.js +127 -123
- package/dist/room/computer.js +1 -1
- package/dist/room/durablePublish.d.ts +6 -0
- package/dist/room/durablePublish.d.ts.map +1 -0
- package/dist/room/durablePublish.js +19 -0
- package/dist/room/incidents.d.ts +4 -1
- package/dist/room/incidents.d.ts.map +1 -1
- package/dist/room/incidents.js +15 -7
- package/dist/room/turnQueue.d.ts.map +1 -1
- package/dist/room/turnQueue.js +55 -46
- package/dist/runtimeStore.d.ts +46 -0
- package/dist/runtimeStore.d.ts.map +1 -0
- package/dist/runtimeStore.js +205 -0
- package/dist/setup/server.js +1 -1
- package/dist/turnLog.d.ts +10 -40
- package/dist/turnLog.d.ts.map +1 -1
- package/dist/turnLog.js +33 -56
- package/dist/vault.d.ts +6 -3
- package/dist/vault.d.ts.map +1 -1
- package/dist/vault.js +18 -4
- package/package.json +4 -4
- package/src/automations/agent.ts +2 -0
- package/src/automations/service.ts +47 -21
- package/src/automations/store.ts +41 -50
- package/src/automations/workflow.ts +49 -0
- package/src/chat/server.ts +7 -1
- package/src/coding/listPrs.ts +14 -0
- package/src/coding/runCodeTurn.ts +51 -139
- package/src/coding/runReview.ts +83 -0
- package/src/coding/workspaceRegistry.ts +380 -0
- package/src/coding/worktree.ts +205 -40
- package/src/coding/worktreeSetup.ts +50 -0
- package/src/config.ts +2 -0
- package/src/daemonLease.ts +33 -0
- package/src/goals/assessment.ts +106 -0
- package/src/goals/notes.ts +88 -0
- package/src/index.ts +76 -46
- package/src/jobs/briefing.ts +62 -109
- package/src/jobs/goals.ts +384 -0
- package/src/jobs/weeklyReview.ts +4 -3
- package/src/logTimestamps.ts +14 -0
- package/src/providerRecovery.ts +99 -0
- package/src/queue.ts +4 -0
- package/src/room/client.ts +84 -116
- package/src/room/computer.ts +1 -1
- package/src/room/durablePublish.ts +25 -0
- package/src/room/incidents.ts +20 -8
- package/src/room/turnQueue.ts +53 -56
- package/src/runtimeStore.ts +207 -0
- package/src/setup/server.ts +1 -1
- package/src/turnLog.ts +32 -75
- package/src/vault.ts +16 -7
- package/vendor/mcp-server/dist/index.js +2 -0
- package/vendor/mcp-server/dist/tools/goals.d.ts +4 -0
- package/vendor/mcp-server/dist/tools/goals.d.ts.map +1 -0
- package/vendor/mcp-server/dist/tools/goals.js +38 -0
- package/vendor/mcp-server/package.json +1 -1
- package/vendor/mcp-server/src/index.ts +2 -0
- package/vendor/mcp-server/src/tools/goals.ts +62 -0
- package/vendor/runtime/README.md +36 -2
- package/vendor/runtime/dist/executor/asyncQueue.d.ts +1 -0
- package/vendor/runtime/dist/executor/asyncQueue.d.ts.map +1 -1
- package/vendor/runtime/dist/executor/asyncQueue.js +3 -0
- package/vendor/runtime/dist/executor/claudeAgent.d.ts +5 -1
- package/vendor/runtime/dist/executor/claudeAgent.d.ts.map +1 -1
- package/vendor/runtime/dist/executor/claudeAgent.js +77 -13
- package/vendor/runtime/dist/executor/codex.d.ts +8 -2
- package/vendor/runtime/dist/executor/codex.d.ts.map +1 -1
- package/vendor/runtime/dist/executor/codex.js +113 -38
- package/vendor/runtime/dist/executor/codexProtocol/AgentPath.d.ts +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/AgentPath.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/AgentPath.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/FunctionCallOutputContentItem.d.ts +4 -1
- package/vendor/runtime/dist/executor/codexProtocol/FunctionCallOutputContentItem.d.ts.map +1 -1
- package/vendor/runtime/dist/executor/codexProtocol/ImageGenerationFailure.d.ts +6 -0
- package/vendor/runtime/dist/executor/codexProtocol/ImageGenerationFailure.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/ImageGenerationFailure.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/ImageGenerationItem.d.ts +12 -0
- package/vendor/runtime/dist/executor/codexProtocol/ImageGenerationItem.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/ImageGenerationItem.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/LegacyAppPathString.d.ts +24 -0
- package/vendor/runtime/dist/executor/codexProtocol/LegacyAppPathString.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/LegacyAppPathString.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/MessagePhase.d.ts +8 -0
- package/vendor/runtime/dist/executor/codexProtocol/MessagePhase.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/MessagePhase.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/Personality.d.ts +3 -0
- package/vendor/runtime/dist/executor/codexProtocol/Personality.d.ts.map +1 -1
- package/vendor/runtime/dist/executor/codexProtocol/PlanType.d.ts +1 -1
- package/vendor/runtime/dist/executor/codexProtocol/PlanType.d.ts.map +1 -1
- package/vendor/runtime/dist/executor/codexProtocol/SleepItem.d.ts +8 -0
- package/vendor/runtime/dist/executor/codexProtocol/SleepItem.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/SleepItem.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/SubAgentSource.d.ts +14 -0
- package/vendor/runtime/dist/executor/codexProtocol/SubAgentSource.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/SubAgentSource.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/ThreadId.d.ts +7 -0
- package/vendor/runtime/dist/executor/codexProtocol/ThreadId.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/ThreadId.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/WebSearchItem.d.ts +15 -0
- package/vendor/runtime/dist/executor/codexProtocol/WebSearchItem.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/WebSearchItem.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/AgentMessageDelivery.d.ts +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/AgentMessageDelivery.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/AgentMessageDelivery.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/AsyncUserInputQuestion.d.ts +5 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/AsyncUserInputQuestion.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/AsyncUserInputQuestion.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/CodexErrorInfo.d.ts +29 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/CodexErrorInfo.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/CodexErrorInfo.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/CollabAgentState.d.ts +6 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/CollabAgentState.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/CollabAgentState.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/CollabAgentStatus.d.ts +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/CollabAgentStatus.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/CollabAgentStatus.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/CollabAgentTool.d.ts +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/CollabAgentTool.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/CollabAgentTool.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/CollabAgentToolCallStatus.d.ts +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/CollabAgentToolCallStatus.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/CollabAgentToolCallStatus.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/CommandAction.d.ts +20 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/CommandAction.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/CommandAction.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/CommandExecutionSource.d.ts +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/CommandExecutionSource.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/CommandExecutionSource.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/CommandExecutionStatus.d.ts +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/CommandExecutionStatus.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/CommandExecutionStatus.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/CyberAccessProgram.d.ts +6 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/CyberAccessProgram.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/CyberAccessProgram.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/DynamicToolCallOutputContentItem.d.ts +11 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/DynamicToolCallOutputContentItem.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/DynamicToolCallOutputContentItem.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/DynamicToolCallStatus.d.ts +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/DynamicToolCallStatus.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/DynamicToolCallStatus.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/FileUpdateChange.d.ts +7 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/FileUpdateChange.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/FileUpdateChange.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/GetAccountRateLimitsResponse.d.ts +5 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/GetAccountRateLimitsResponse.d.ts.map +1 -1
- package/vendor/runtime/dist/executor/codexProtocol/v2/GitInfo.d.ts +6 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/GitInfo.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/GitInfo.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/HookPromptFragment.d.ts +5 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/HookPromptFragment.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/HookPromptFragment.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/McpAppDisplayMode.d.ts +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/McpAppDisplayMode.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/McpAppDisplayMode.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/McpAppUi.d.ts +9 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/McpAppUi.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/McpAppUi.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/McpToolCallAppContext.d.ts +8 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/McpToolCallAppContext.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/McpToolCallAppContext.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/McpToolCallError.d.ts +4 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/McpToolCallError.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/McpToolCallError.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/McpToolCallResult.d.ts +7 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/McpToolCallResult.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/McpToolCallResult.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/McpToolCallStatus.d.ts +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/McpToolCallStatus.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/McpToolCallStatus.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/MemoryCitation.d.ts +6 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/MemoryCitation.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/MemoryCitation.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/MemoryCitationEntry.d.ts +7 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/MemoryCitationEntry.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/MemoryCitationEntry.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/MisalignmentErrorDetails.d.ts +16 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/MisalignmentErrorDetails.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/MisalignmentErrorDetails.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/MisalignmentSteer.d.ts +4 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/MisalignmentSteer.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/MisalignmentSteer.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/Model.d.ts +8 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/Model.d.ts.map +1 -1
- package/vendor/runtime/dist/executor/codexProtocol/v2/ModelAccessPrograms.d.ts +11 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/ModelAccessPrograms.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/ModelAccessPrograms.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/NonSteerableTurnKind.d.ts +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/NonSteerableTurnKind.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/NonSteerableTurnKind.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/PatchApplyStatus.d.ts +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/PatchApplyStatus.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/PatchApplyStatus.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/PatchChangeKind.d.ts +9 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/PatchChangeKind.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/PatchChangeKind.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitSnapshot.d.ts +4 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitSnapshot.d.ts.map +1 -1
- package/vendor/runtime/dist/executor/codexProtocol/v2/ReviewStartParams.d.ts +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/ReviewStartParams.d.ts.map +1 -1
- package/vendor/runtime/dist/executor/codexProtocol/v2/SessionSource.d.ts +7 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/SessionSource.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/SessionSource.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/SubAgentActivityKind.d.ts +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/SubAgentActivityKind.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/SubAgentActivityKind.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/Thread.d.ts +100 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/Thread.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/Thread.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadActiveFlag.d.ts +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadActiveFlag.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadActiveFlag.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadHistoryMode.d.ts +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadHistoryMode.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadHistoryMode.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadItem.d.ts +216 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadItem.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadItem.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadReadParams.d.ts +11 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadReadParams.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadReadParams.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadReadResponse.d.ts +5 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadReadResponse.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadReadResponse.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadResumeParams.d.ts +4 -1
- package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadResumeParams.d.ts.map +1 -1
- package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadSection.d.ts +19 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadSection.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadSection.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadSectionAppearance.d.ts +8 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadSectionAppearance.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadSectionAppearance.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadStartParams.d.ts +3 -1
- package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadStartParams.d.ts.map +1 -1
- package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadStatus.d.ts +12 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadStatus.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadStatus.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/Turn.d.ts +36 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/Turn.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/Turn.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/TurnError.d.ts +12 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/TurnError.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/TurnError.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/TurnItemsView.d.ts +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/TurnItemsView.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/TurnItemsView.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/TurnStartParams.d.ts +7 -2
- package/vendor/runtime/dist/executor/codexProtocol/v2/TurnStartParams.d.ts.map +1 -1
- package/vendor/runtime/dist/executor/codexProtocol/v2/TurnStatus.d.ts +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/TurnStatus.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/TurnStatus.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/UserInput.d.ts +3 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/UserInput.d.ts.map +1 -1
- package/vendor/runtime/dist/executor/codexProtocol/v2/WebSearchAction.d.ts +15 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/WebSearchAction.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/WebSearchAction.js +2 -0
- package/vendor/runtime/dist/executor/codexRpc.d.ts +13 -4
- package/vendor/runtime/dist/executor/codexRpc.d.ts.map +1 -1
- package/vendor/runtime/dist/executor/codexRpc.js +21 -5
- package/vendor/runtime/dist/executor/codexSessions.d.ts +30 -0
- package/vendor/runtime/dist/executor/codexSessions.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexSessions.js +88 -0
- package/vendor/runtime/dist/executor/health.d.ts +8 -2
- package/vendor/runtime/dist/executor/health.d.ts.map +1 -1
- package/vendor/runtime/dist/executor/health.js +21 -5
- package/vendor/runtime/dist/executor/liveTurns.d.ts +2 -1
- package/vendor/runtime/dist/executor/liveTurns.d.ts.map +1 -1
- package/vendor/runtime/dist/executor/liveTurns.js +12 -5
- package/vendor/runtime/dist/executor/ownership.d.ts +40 -0
- package/vendor/runtime/dist/executor/ownership.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/ownership.js +106 -0
- package/vendor/runtime/dist/executor/providerRouter.d.ts +1 -0
- package/vendor/runtime/dist/executor/providerRouter.d.ts.map +1 -1
- package/vendor/runtime/dist/executor/providerRouter.js +5 -0
- package/vendor/runtime/dist/executor/types.d.ts +27 -0
- package/vendor/runtime/dist/executor/types.d.ts.map +1 -1
- package/vendor/runtime/dist/harness/index.d.ts.map +1 -1
- package/vendor/runtime/dist/harness/index.js +1 -0
- package/vendor/runtime/dist/index.d.ts +2 -1
- package/vendor/runtime/dist/index.d.ts.map +1 -1
- package/vendor/runtime/dist/index.js +1 -0
- package/vendor/runtime/src/executor/asyncQueue.ts +3 -0
- package/vendor/runtime/src/executor/claudeAgent.ts +66 -13
- package/vendor/runtime/src/executor/codex.ts +124 -47
- package/vendor/runtime/src/executor/codexProtocol/AgentPath.ts +5 -0
- package/vendor/runtime/src/executor/codexProtocol/FunctionCallOutputContentItem.ts +1 -1
- package/vendor/runtime/src/executor/codexProtocol/ImageGenerationFailure.ts +5 -0
- package/vendor/runtime/src/executor/codexProtocol/ImageGenerationItem.ts +7 -0
- package/vendor/runtime/src/executor/codexProtocol/LegacyAppPathString.ts +27 -0
- package/vendor/runtime/src/executor/codexProtocol/MessagePhase.ts +11 -0
- package/vendor/runtime/src/executor/codexProtocol/Personality.ts +3 -0
- package/vendor/runtime/src/executor/codexProtocol/PlanType.ts +1 -1
- package/vendor/runtime/src/executor/codexProtocol/README.md +2 -2
- package/vendor/runtime/src/executor/codexProtocol/SleepItem.ts +8 -0
- package/vendor/runtime/src/executor/codexProtocol/SubAgentSource.ts +7 -0
- package/vendor/runtime/src/executor/codexProtocol/ThreadId.ts +10 -0
- package/vendor/runtime/src/executor/codexProtocol/WebSearchItem.ts +14 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/AgentMessageDelivery.ts +5 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/AsyncUserInputQuestion.ts +5 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/CodexErrorInfo.ts +12 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/CollabAgentState.ts +6 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/CollabAgentStatus.ts +5 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/CollabAgentTool.ts +5 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/CollabAgentToolCallStatus.ts +5 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/CommandAction.ts +6 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/CommandExecutionSource.ts +5 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/CommandExecutionStatus.ts +5 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/CyberAccessProgram.ts +9 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/DynamicToolCallOutputContentItem.ts +5 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/DynamicToolCallStatus.ts +5 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/FileUpdateChange.ts +6 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/GetAccountRateLimitsResponse.ts +5 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/GitInfo.ts +5 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/HookPromptFragment.ts +5 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/McpAppDisplayMode.ts +5 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/McpAppUi.ts +9 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/McpToolCallAppContext.ts +5 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/McpToolCallError.ts +5 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/McpToolCallResult.ts +6 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/McpToolCallStatus.ts +5 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/MemoryCitation.ts +6 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/MemoryCitationEntry.ts +5 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/MisalignmentErrorDetails.ts +18 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/MisalignmentSteer.ts +5 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/Model.ts +11 -2
- package/vendor/runtime/src/executor/codexProtocol/v2/ModelAccessPrograms.ts +13 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/NonSteerableTurnKind.ts +5 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/PatchApplyStatus.ts +5 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/PatchChangeKind.ts +5 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/RateLimitSnapshot.ts +5 -1
- package/vendor/runtime/src/executor/codexProtocol/v2/ReviewStartParams.ts +2 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/SessionSource.ts +6 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/SubAgentActivityKind.ts +5 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/Thread.ts +104 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/ThreadActiveFlag.ts +5 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/ThreadHistoryMode.ts +5 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/ThreadItem.ts +125 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/ThreadReadParams.ts +12 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/ThreadReadResponse.ts +6 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/ThreadResumeParams.ts +5 -1
- package/vendor/runtime/src/executor/codexProtocol/v2/ThreadSection.ts +21 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/ThreadSectionAppearance.ts +8 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/ThreadStartParams.ts +4 -1
- package/vendor/runtime/src/executor/codexProtocol/v2/ThreadStatus.ts +6 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/Turn.ts +37 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/TurnError.ts +11 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/TurnItemsView.ts +5 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/TurnStartParams.ts +7 -2
- package/vendor/runtime/src/executor/codexProtocol/v2/TurnStatus.ts +5 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/UserInput.ts +1 -1
- package/vendor/runtime/src/executor/codexProtocol/v2/WebSearchAction.ts +5 -0
- package/vendor/runtime/src/executor/codexRpc.ts +26 -6
- package/vendor/runtime/src/executor/codexSessions.ts +108 -0
- package/vendor/runtime/src/executor/health.ts +21 -7
- package/vendor/runtime/src/executor/liveTurns.ts +12 -5
- package/vendor/runtime/src/executor/ownership.ts +83 -0
- package/vendor/runtime/src/executor/providerRouter.ts +6 -0
- package/vendor/runtime/src/executor/types.ts +20 -1
- package/vendor/runtime/src/harness/index.ts +1 -0
- package/vendor/runtime/src/index.ts +2 -1
- package/vendor/shared/dist/agentCommands.d.ts +1 -0
- package/vendor/shared/dist/agentCommands.d.ts.map +1 -1
- package/vendor/shared/dist/automations.d.ts +34 -0
- package/vendor/shared/dist/automations.d.ts.map +1 -1
- package/vendor/shared/dist/automations.js +12 -0
- package/vendor/shared/dist/cardStudio.d.ts +41 -0
- package/vendor/shared/dist/cardStudio.d.ts.map +1 -1
- package/vendor/shared/dist/cardStudio.js +13 -3
- package/vendor/shared/dist/computer.d.ts +7 -1
- package/vendor/shared/dist/computer.d.ts.map +1 -1
- package/vendor/shared/dist/computer.js +13 -4
- package/vendor/shared/dist/constants.d.ts +3 -3
- package/vendor/shared/dist/constants.d.ts.map +1 -1
- package/vendor/shared/dist/constants.js +8 -14
- package/vendor/shared/dist/goalNotes.d.ts +4 -0
- package/vendor/shared/dist/goalNotes.d.ts.map +1 -0
- package/vendor/shared/dist/goalNotes.js +23 -0
- package/vendor/shared/dist/goals.d.ts +835 -0
- package/vendor/shared/dist/goals.d.ts.map +1 -0
- package/vendor/shared/dist/goals.js +198 -0
- package/vendor/shared/dist/index.d.ts +7 -2
- package/vendor/shared/dist/index.d.ts.map +1 -1
- package/vendor/shared/dist/index.js +6 -1
- package/vendor/shared/dist/journal-vault.d.ts +1 -1
- package/vendor/shared/dist/messagingSafety.d.ts +21 -0
- package/vendor/shared/dist/messagingSafety.d.ts.map +1 -0
- package/vendor/shared/dist/messagingSafety.js +8 -0
- package/vendor/shared/dist/schemas/harness.d.ts +199 -169
- package/vendor/shared/dist/schemas/harness.d.ts.map +1 -1
- package/vendor/shared/dist/schemas/harness.js +25 -124
- package/vendor/shared/dist/smartCapture.d.ts +24 -0
- package/vendor/shared/dist/smartCapture.d.ts.map +1 -1
- package/vendor/shared/dist/smartCapture.js +15 -0
- package/vendor/shared/dist/taskSync.d.ts +342 -0
- package/vendor/shared/dist/taskSync.d.ts.map +1 -0
- package/vendor/shared/dist/taskSync.js +111 -0
- package/vendor/shared/dist/types.d.ts +1 -4
- package/vendor/shared/dist/types.d.ts.map +1 -1
- package/vendor/shared/dist/voiceCapture.d.ts +1 -1
- package/vendor/shared/dist/workspaces.d.ts +255 -0
- package/vendor/shared/dist/workspaces.d.ts.map +1 -0
- package/vendor/shared/dist/workspaces.js +89 -0
- package/vendor/shared/src/agentCommands.ts +1 -0
- package/vendor/shared/src/automations.ts +12 -0
- package/vendor/shared/src/cardStudio.ts +13 -3
- package/vendor/shared/src/computer.ts +19 -5
- package/vendor/shared/src/constants.ts +8 -14
- package/vendor/shared/src/goalNotes.ts +23 -0
- package/vendor/shared/src/goals.ts +237 -0
- package/vendor/shared/src/index.ts +7 -6
- package/vendor/shared/src/messagingSafety.ts +11 -0
- package/vendor/shared/src/schemas/harness.ts +24 -130
- package/vendor/shared/src/smartCapture.ts +27 -0
- package/vendor/shared/src/taskSync.ts +81 -0
- package/vendor/shared/src/types.ts +0 -6
- package/vendor/shared/src/workspaces.ts +103 -0
- package/dist/coding/conduct.d.ts +0 -69
- package/dist/coding/conduct.d.ts.map +0 -1
- package/dist/coding/conduct.js +0 -348
- package/dist/coding/fleetIntegrate.d.ts +0 -37
- package/dist/coding/fleetIntegrate.d.ts.map +0 -1
- package/dist/coding/fleetIntegrate.js +0 -64
- package/dist/coding/fleetPlan.d.ts +0 -20
- package/dist/coding/fleetPlan.d.ts.map +0 -1
- package/dist/coding/fleetPlan.js +0 -125
- package/dist/coding/fleetTasks.d.ts +0 -33
- package/dist/coding/fleetTasks.d.ts.map +0 -1
- package/dist/coding/fleetTasks.js +0 -75
- package/dist/coding/openFleetPr.d.ts +0 -41
- package/dist/coding/openFleetPr.d.ts.map +0 -1
- package/dist/coding/openFleetPr.js +0 -121
- package/src/coding/conduct.ts +0 -462
- package/src/coding/fleetIntegrate.ts +0 -95
- package/src/coding/fleetPlan.ts +0 -135
- package/src/coding/fleetTasks.ts +0 -109
- package/src/coding/openFleetPr.ts +0 -148
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { WorkspaceCommandSchema, WorkspaceSnapshotSchema } from '../workspaces.js';
|
|
2
3
|
import {
|
|
3
4
|
VoiceCaptureAudioSchema,
|
|
4
5
|
VoiceCaptureReceiptSchema,
|
|
@@ -21,7 +22,6 @@ import {
|
|
|
21
22
|
HARNESS_REQUEST_KINDS,
|
|
22
23
|
APPROVAL_DECISIONS,
|
|
23
24
|
WORKSPACE_MODES,
|
|
24
|
-
WORKER_STATUSES,
|
|
25
25
|
EFFORT_LEVELS,
|
|
26
26
|
DELIVERY_CHANNELS,
|
|
27
27
|
AGENT_MODES,
|
|
@@ -112,6 +112,8 @@ export const JournalRequestSchema = HarnessRequestBase.extend({
|
|
|
112
112
|
// server-side through the daemon's allowlist to an absolute path — the phone
|
|
113
113
|
// never sends a filesystem path.
|
|
114
114
|
export const CodeRequestSchema = HarnessRequestBase.extend({
|
|
115
|
+
recoveryOf: z.uuidv7().optional(),
|
|
116
|
+
recoveryReviewId: z.uuidv7().optional(),
|
|
115
117
|
kind: z.literal('code'),
|
|
116
118
|
repoId: z.string().min(1),
|
|
117
119
|
prompt: z.string().min(1).max(8000),
|
|
@@ -125,10 +127,8 @@ export const CodeRequestSchema = HarnessRequestBase.extend({
|
|
|
125
127
|
handoff: ProviderHandoffSchema.optional(),
|
|
126
128
|
queue: z.boolean().optional(),
|
|
127
129
|
afterRequestId: z.uuidv7().optional(),
|
|
128
|
-
/**
|
|
129
|
-
*
|
|
130
|
-
* isolated `fleet/<repoId>/<workerId>` worktree, on its own lane. Absent → the bare repo
|
|
131
|
-
* session, exactly as before. */
|
|
130
|
+
/** The worktree this turn belongs to. The daemon runs it in that worktree's own folder and
|
|
131
|
+
* branch, on its own lane. Absent → the repository's main session. */
|
|
132
132
|
workerId: z.uuidv7().optional(),
|
|
133
133
|
/** Where to do the work (#121). Absent → 'worktree', so a daemon on this schema
|
|
134
134
|
* still understands a phone that predates the mode picker. The daemon rejects
|
|
@@ -162,72 +162,6 @@ export const CloneRepoRequestSchema = HarnessRequestBase.extend({
|
|
|
162
162
|
url: z.string().min(1).max(2000),
|
|
163
163
|
});
|
|
164
164
|
|
|
165
|
-
// ---- Conductor (a fleet of coding agents) ---------------------------------
|
|
166
|
-
|
|
167
|
-
// One worker in a fan-out plan — a single coding lane. Its `workerId` is the fleet
|
|
168
|
-
// subtask's uuid AND the stream id its code frames arrive under (both uuidv7), so a
|
|
169
|
-
// worker reuses the whole existing code-turn pipeline: the phone routes any frame whose
|
|
170
|
-
// `requestId` equals a known `workerId` into that worker's lane. `ownedPaths` is the
|
|
171
|
-
// files/globs this worker may touch (the ownership map that prevents two lanes colliding);
|
|
172
|
-
// `mergeOrder` (lower first) mirrors the subtask's priority and decides integration order.
|
|
173
|
-
export const FleetWorkerSchema = z.object({
|
|
174
|
-
workerId: z.uuidv7(),
|
|
175
|
-
title: z.string().min(1).max(200),
|
|
176
|
-
brief: z.string().min(1).max(8000),
|
|
177
|
-
ownedPaths: z.array(z.string().max(400)).max(200),
|
|
178
|
-
mergeOrder: z.number().int(),
|
|
179
|
-
});
|
|
180
|
-
|
|
181
|
-
// The lead's decomposition of a goal — what the phone renders as the Fan-out card, and
|
|
182
|
-
// what it sends back (possibly edited) to execute. `overlaps` are the ⚠ pairs whose owned
|
|
183
|
-
// paths intersect, so the card can warn and the runner can force those two to serialize.
|
|
184
|
-
export const FleetPlanSchema = z.object({
|
|
185
|
-
goal: z.string().min(1).max(500),
|
|
186
|
-
/** The parent Lucidity task (the goal); each worker is a subtask of it. Set once the
|
|
187
|
-
* daemon has created the task graph (dogfood); absent on a freshly-proposed plan. */
|
|
188
|
-
parentTaskId: z.uuidv7().optional(),
|
|
189
|
-
workers: z.array(FleetWorkerSchema).min(1).max(16),
|
|
190
|
-
overlaps: z
|
|
191
|
-
.array(
|
|
192
|
-
z.object({
|
|
193
|
-
a: z.uuidv7(),
|
|
194
|
-
b: z.uuidv7(),
|
|
195
|
-
paths: z.array(z.string().max(400)).max(200),
|
|
196
|
-
}),
|
|
197
|
-
)
|
|
198
|
-
.max(120) // at most C(16,2) pairs for the 16-worker ceiling
|
|
199
|
-
.optional(),
|
|
200
|
-
/** How many workers may run at once (quota guard). Absent → the daemon's default cap. */
|
|
201
|
-
maxParallel: z.number().int().positive().max(16).optional(),
|
|
202
|
-
});
|
|
203
|
-
|
|
204
|
-
// Phone → daemon. Four phases over one request kind:
|
|
205
|
-
// - `plan`: decompose `prompt` (the goal) → one `fleet_plan` event. Nothing runs or is created,
|
|
206
|
-
// so the user edits or discards freely.
|
|
207
|
-
// - `setup`: materialize an approved plan for the DESIGN-FIRST flow — create the task graph and
|
|
208
|
-
// announce the workers (`worker_status: queued`), but write NO code. The user then chats each
|
|
209
|
-
// worker via a `code` turn carrying its `workerId`, and merges with `integrate` when ready.
|
|
210
|
-
// - `run`: the AUTO flow — create the graph, dispatch every worker to code in merge order, then
|
|
211
|
-
// integrate. One-tap "fan out & run".
|
|
212
|
-
// - `integrate`: merge the plan's worker branches onto lucid/<repo> in order → `worker_status`
|
|
213
|
-
// (merged) / `fleet_conflict` / `fleet_done`. Used by the design-first flow's "Merge fleet".
|
|
214
|
-
// Splitting plan from the rest keeps fan-out a one-tap opt-in: no worker spawns until the phone
|
|
215
|
-
// sends `setup`/`run` with a plan the user accepted.
|
|
216
|
-
export const ConductRequestSchema = HarnessRequestBase.extend({
|
|
217
|
-
kind: z.literal('conduct'),
|
|
218
|
-
repoId: z.string().min(1),
|
|
219
|
-
phase: z.enum(['plan', 'run', 'setup', 'integrate']),
|
|
220
|
-
prompt: z.string().min(1).max(8000),
|
|
221
|
-
images: harnessImagesField,
|
|
222
|
-
/** The approved plan to execute — required on `run`, ignored on `plan`. */
|
|
223
|
-
plan: FleetPlanSchema.optional(),
|
|
224
|
-
/** Conductor (lead) session id to continue its planning conversation across turns. */
|
|
225
|
-
resume: z.string().optional(),
|
|
226
|
-
/** Skip the dogfood task graph (no parent/subtask on the board). Set for quick incremental
|
|
227
|
-
* spawns so the board isn't spammed with a parent per task; the fleet UI tracks them anyway. */
|
|
228
|
-
ephemeral: z.boolean().optional(),
|
|
229
|
-
});
|
|
230
|
-
|
|
231
165
|
// Stop an in-flight request (the phone's stop button). `targetId` is the original
|
|
232
166
|
// request's `id`; the daemon aborts its executor run and replies with a
|
|
233
167
|
// `cancelled` stream event correlated to that same id.
|
|
@@ -327,6 +261,8 @@ export const IncidentReportRequestSchema = HarnessRequestBase.extend({
|
|
|
327
261
|
snapshot: IncidentSnapshotSchema.optional(),
|
|
328
262
|
/** The tail of the phone's diag ring — feeds SUSPEND_GAP and enriches the timeline. */
|
|
329
263
|
diag: z.array(IncidentDiagEventSchema).max(400).optional(),
|
|
264
|
+
/** The phone's stutter-meter reading (frame times, redraw counts, time in history work). */
|
|
265
|
+
perf: z.record(z.string(), z.unknown()).optional(),
|
|
330
266
|
});
|
|
331
267
|
|
|
332
268
|
// ---- Voice diagnostics (Kokoro TTS drop/pause capture) --------------------
|
|
@@ -506,6 +442,7 @@ export const AttentionRequestSchema = HarnessRequestBase.extend({
|
|
|
506
442
|
});
|
|
507
443
|
|
|
508
444
|
export const HarnessRequestSchema = z.discriminatedUnion('kind', [
|
|
445
|
+
HarnessRequestBase.extend({ kind: z.literal('workspaces'), command: WorkspaceCommandSchema }),
|
|
509
446
|
HarnessRequestBase.extend({
|
|
510
447
|
kind: z.literal('voice-capture'),
|
|
511
448
|
credentialId: z.uuid(),
|
|
@@ -541,7 +478,6 @@ export const HarnessRequestSchema = z.discriminatedUnion('kind', [
|
|
|
541
478
|
BriefingRequestSchema,
|
|
542
479
|
JournalRequestSchema,
|
|
543
480
|
CodeRequestSchema,
|
|
544
|
-
ConductRequestSchema,
|
|
545
481
|
RepoListRequestSchema,
|
|
546
482
|
ListPrsRequestSchema,
|
|
547
483
|
CloneRepoRequestSchema,
|
|
@@ -789,6 +725,7 @@ export const CommandsResponseSchema = HarnessResponseBase.extend({
|
|
|
789
725
|
description: z.string(),
|
|
790
726
|
argumentHint: z.string(),
|
|
791
727
|
acceptsArguments: z.boolean().optional(),
|
|
728
|
+
startsConversation: z.boolean().optional(),
|
|
792
729
|
aliases: z.array(z.string()).optional(),
|
|
793
730
|
clearsContext: z.boolean().optional(),
|
|
794
731
|
}),
|
|
@@ -796,6 +733,7 @@ export const CommandsResponseSchema = HarnessResponseBase.extend({
|
|
|
796
733
|
});
|
|
797
734
|
|
|
798
735
|
export const HarnessResponseSchema = z.discriminatedUnion('kind', [
|
|
736
|
+
HarnessResponseBase.extend({ kind: z.literal('workspaces'), snapshot: WorkspaceSnapshotSchema }),
|
|
799
737
|
HarnessResponseBase.extend({
|
|
800
738
|
kind: z.literal('voice-capture'),
|
|
801
739
|
receipt: VoiceCaptureReceiptSchema.nullable(),
|
|
@@ -839,6 +777,8 @@ export const HarnessStreamEventSchema = z.discriminatedUnion('type', [
|
|
|
839
777
|
type: z.literal('queue_state'),
|
|
840
778
|
requestId: z.uuidv7(),
|
|
841
779
|
state: z.enum(['queued', 'running']),
|
|
780
|
+
blockedBy: z.uuidv7().optional(),
|
|
781
|
+
message: z.string().optional(),
|
|
842
782
|
}),
|
|
843
783
|
z.object({
|
|
844
784
|
// Durable receipt written before execution; recovery only pulls saved output.
|
|
@@ -866,6 +806,8 @@ export const HarnessStreamEventSchema = z.discriminatedUnion('type', [
|
|
|
866
806
|
requestId: z.uuidv7(),
|
|
867
807
|
name: z.string(),
|
|
868
808
|
phase: z.enum(['start', 'end']),
|
|
809
|
+
itemId: z.string().optional(),
|
|
810
|
+
outcome: z.string().optional(),
|
|
869
811
|
}),
|
|
870
812
|
z.object({
|
|
871
813
|
type: z.literal('done'),
|
|
@@ -878,6 +820,7 @@ export const HarnessStreamEventSchema = z.discriminatedUnion('type', [
|
|
|
878
820
|
// has no memory of earlier turns — the phone surfaces/counts this so a silent
|
|
879
821
|
// conversation reset is never invisible again (the root cause behind the #107 wipe).
|
|
880
822
|
freshStart: z.boolean().optional(),
|
|
823
|
+
recovered: z.boolean().optional(),
|
|
881
824
|
}),
|
|
882
825
|
z.object({
|
|
883
826
|
// The result of a `code` turn (M7): the diff the turn produced, ready for the
|
|
@@ -888,6 +831,13 @@ export const HarnessStreamEventSchema = z.discriminatedUnion('type', [
|
|
|
888
831
|
requestId: z.uuidv7(),
|
|
889
832
|
branch: z.string(),
|
|
890
833
|
diff: z.string(),
|
|
834
|
+
/** What the turn changed in tracked files: line counts and paths. The phone shows this in
|
|
835
|
+
* place of a diff. Absent when nothing changed or the count could not be taken. */
|
|
836
|
+
changes: z.object({
|
|
837
|
+
added: z.number().int().nonnegative(),
|
|
838
|
+
removed: z.number().int().nonnegative(),
|
|
839
|
+
files: z.array(z.string()).max(40),
|
|
840
|
+
}).optional(),
|
|
891
841
|
summary: z.string().optional(),
|
|
892
842
|
mode: z.enum(WORKSPACE_MODES).optional(),
|
|
893
843
|
// In-place only: the branch the phone expected this turn to land on, echoed back ONLY
|
|
@@ -895,6 +845,7 @@ export const HarnessStreamEventSchema = z.discriminatedUnion('type', [
|
|
|
895
845
|
// ran — on `branch` — so the phone shows a quiet "checkout moved" notice on the bubble
|
|
896
846
|
// instead of the old dead-end rejection that made the user re-send.
|
|
897
847
|
movedFrom: z.string().optional(),
|
|
848
|
+
checkpointWarning: z.string().optional(),
|
|
898
849
|
}),
|
|
899
850
|
z.object({
|
|
900
851
|
// The result of a `clone` turn (#78): the new repo's id, once cloned into the
|
|
@@ -903,68 +854,11 @@ export const HarnessStreamEventSchema = z.discriminatedUnion('type', [
|
|
|
903
854
|
requestId: z.uuidv7(),
|
|
904
855
|
repoId: z.string(),
|
|
905
856
|
}),
|
|
906
|
-
// ---- Conductor fleet events (stream under the CONDUCT turn's requestId) ----
|
|
907
|
-
z.object({
|
|
908
|
-
// The lead's decomposition, produced by a `conduct` `plan` turn — the phone renders it
|
|
909
|
-
// as the Fan-out card. Nothing has run or been created yet; the user edits/accepts, then
|
|
910
|
-
// sends `conduct` `run` with this (possibly edited) plan.
|
|
911
|
-
type: z.literal('fleet_plan'),
|
|
912
|
-
requestId: z.uuidv7(),
|
|
913
|
-
plan: FleetPlanSchema,
|
|
914
|
-
}),
|
|
915
|
-
z.object({
|
|
916
|
-
// A worker crossed into a new lifecycle state. The phone updates that lane's card on the
|
|
917
|
-
// Fleet board. The worker's own delta/tool_call/code_result/done frames arrive separately,
|
|
918
|
-
// UNDER `requestId === workerId`, so they flow through the existing code-turn rendering.
|
|
919
|
-
type: z.literal('worker_status'),
|
|
920
|
-
requestId: z.uuidv7(),
|
|
921
|
-
workerId: z.uuidv7(),
|
|
922
|
-
status: z.enum(WORKER_STATUSES),
|
|
923
|
-
/** A short live line for the card ("editing serialTts.ts"). Optional. */
|
|
924
|
-
detail: z.string().optional(),
|
|
925
|
-
/** This worker's diff size once it has one, for the card's "+N −M". Optional. */
|
|
926
|
-
diffStat: z
|
|
927
|
-
.object({
|
|
928
|
-
added: z.number().int(),
|
|
929
|
-
removed: z.number().int(),
|
|
930
|
-
files: z.number().int(),
|
|
931
|
-
})
|
|
932
|
-
.optional(),
|
|
933
|
-
}),
|
|
934
|
-
z.object({
|
|
935
|
-
// Integration hit a conflict merging a worker onto the fleet branch. Surfaced in the
|
|
936
|
-
// conductor feed (never silently) so the user can hand it back to a worker as a fresh turn.
|
|
937
|
-
// (Legacy combined-integrate path; per-feature delivery opens independent PRs and never
|
|
938
|
-
// merges workers together, so this doesn't fire there.)
|
|
939
|
-
type: z.literal('fleet_conflict'),
|
|
940
|
-
requestId: z.uuidv7(),
|
|
941
|
-
workerId: z.uuidv7(),
|
|
942
|
-
paths: z.array(z.string()),
|
|
943
|
-
message: z.string(),
|
|
944
|
-
}),
|
|
945
|
-
z.object({
|
|
946
|
-
// One worker was delivered as its OWN pull request (per-feature delivery): its branch was
|
|
947
|
-
// pushed and a PR opened against the base. `url` is that worker's PR; `error` a short reason
|
|
948
|
-
// it couldn't open (no remote / no gh / no auth) — the worker's commits still exist on its
|
|
949
|
-
// branch. One of these fires per delivered worker.
|
|
950
|
-
type: z.literal('worker_pr'),
|
|
951
|
-
requestId: z.uuidv7(),
|
|
952
|
-
workerId: z.uuidv7(),
|
|
953
|
-
url: z.string().optional(),
|
|
954
|
-
error: z.string().optional(),
|
|
955
|
-
}),
|
|
956
|
-
z.object({
|
|
957
|
-
// The fan-out finished. Per-feature delivery: `delivered`/`total` count how many workers got
|
|
958
|
-
// their own PR (each worker's URL arrives in its `worker_pr`). No single integration branch.
|
|
959
|
-
type: z.literal('fleet_done'),
|
|
960
|
-
requestId: z.uuidv7(),
|
|
961
|
-
delivered: z.number().int(),
|
|
962
|
-
total: z.number().int(),
|
|
963
|
-
}),
|
|
964
857
|
z.object({
|
|
965
858
|
type: z.literal('error'),
|
|
966
859
|
requestId: z.uuidv7(),
|
|
967
860
|
message: z.string(),
|
|
861
|
+
code: z.string().optional(),
|
|
968
862
|
}),
|
|
969
863
|
// A `cancel` request successfully stopped this in-flight turn.
|
|
970
864
|
z.object({
|
|
@@ -65,3 +65,30 @@ export type SmartCaptureReview = {
|
|
|
65
65
|
message?: string;
|
|
66
66
|
pollAfterMs?: number | null;
|
|
67
67
|
};
|
|
68
|
+
|
|
69
|
+
/** Bump when the disclosure below changes in a way people should agree to again. */
|
|
70
|
+
export const AI_CONSENT_VERSION = '2026-10-12';
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* The one wording of what is sent and to whom, shown before anything is transmitted.
|
|
74
|
+
* It names the recipients on purpose: that is the point of asking.
|
|
75
|
+
*/
|
|
76
|
+
export const AI_CONSENT_DISCLOSURE = {
|
|
77
|
+
title: 'Allow AI features?',
|
|
78
|
+
body: 'Lucidity can suggest a project and date for a new task, spot a duplicate, and carry out the quick actions you speak or type. To do that it sends the task or instruction text, your project and milestone names, and the titles, dates and status of related tasks to Vercel’s AI Gateway and TypeSafe’s Jev model. Lucidity keeps what you asked for 14 days to improve quick actions. Notes, journal entries and audio are never sent. You can turn this off at any time in Settings.',
|
|
79
|
+
allow: 'Allow',
|
|
80
|
+
decline: 'Not now',
|
|
81
|
+
} as const;
|
|
82
|
+
|
|
83
|
+
export const AiConsentInputSchema = z.object({ granted: z.boolean() }).strict();
|
|
84
|
+
|
|
85
|
+
export type AiConsent = {
|
|
86
|
+
/** The account has AI features to turn on. Nobody else is asked. */
|
|
87
|
+
available: boolean;
|
|
88
|
+
/** null until the person has answered. */
|
|
89
|
+
granted: boolean | null;
|
|
90
|
+
decidedAt: string | null;
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
/** The `code` on a 403 from an AI route when the only thing missing is consent. */
|
|
94
|
+
export const AI_CONSENT_REQUIRED = 'ai_consent_required';
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { CreateTaskSchema, UpdateTaskSchema } from './schemas/task.js';
|
|
3
|
+
import { CreateProjectSchema } from './schemas/project.js';
|
|
4
|
+
import { CreateMilestoneSchema } from './schemas/milestone.js';
|
|
5
|
+
import { UpdateOccurrenceSchema } from './recurrence.js';
|
|
6
|
+
|
|
7
|
+
export const TASK_SYNC_VERSION = '1';
|
|
8
|
+
export const TASK_SYNC_VERSION_HEADER = 'X-Lucidity-Sync-Version';
|
|
9
|
+
export const TASK_SYNC_OPERATION_HEADER = 'X-Lucidity-Operation-Id';
|
|
10
|
+
|
|
11
|
+
export const OccurrenceIdentitySchema = z.object({ version: z.number().int().min(1), ordinal: z.number().int().min(0).max(100000) }).strict();
|
|
12
|
+
const taskId = z.uuidv7();
|
|
13
|
+
export const TaskSyncActionSchema = z.discriminatedUnion('kind', [
|
|
14
|
+
z.object({ kind: z.literal('create_project'), data: CreateProjectSchema.extend({ id: taskId }).strict() }).strict(),
|
|
15
|
+
z.object({ kind: z.literal('create_milestone'), data: CreateMilestoneSchema.extend({ id: taskId }).strict() }).strict(),
|
|
16
|
+
z.object({ kind: z.literal('reorder'), taskIds: z.array(taskId).min(1).max(1000).refine(ids => new Set(ids).size === ids.length, 'Task IDs must be distinct') }).strict(),
|
|
17
|
+
z.object({ kind: z.literal('create'), data: CreateTaskSchema.extend({ id: taskId }).strict() }).strict(),
|
|
18
|
+
z.object({ kind: z.literal('update'), taskId, data: UpdateTaskSchema.strict() }).strict(),
|
|
19
|
+
z.object({ kind: z.literal('complete'), taskId, state: z.enum(['pending', 'completed']), occurrenceId: z.uuid().optional(), occurrenceIdentity: OccurrenceIdentitySchema.optional() }).strict(),
|
|
20
|
+
z.object({ kind: z.literal('occurrence'), taskId, occurrenceId: z.uuid(), occurrenceIdentity: OccurrenceIdentitySchema.optional(), data: UpdateOccurrenceSchema.strict() }).strict(),
|
|
21
|
+
z.object({ kind: z.literal('trash'), taskId }).strict(),
|
|
22
|
+
z.object({ kind: z.literal('restore'), taskId, deletionBatchId: z.uuid() }).strict(),
|
|
23
|
+
]);
|
|
24
|
+
export type TaskSyncAction = z.infer<typeof TaskSyncActionSchema>;
|
|
25
|
+
|
|
26
|
+
export const TaskSyncCommandSchema = z.object({
|
|
27
|
+
version: z.literal(1),
|
|
28
|
+
operationId: z.uuid(),
|
|
29
|
+
action: TaskSyncActionSchema,
|
|
30
|
+
}).strict();
|
|
31
|
+
export type TaskSyncCommand = z.infer<typeof TaskSyncCommandSchema>;
|
|
32
|
+
|
|
33
|
+
export const TaskSyncAckSchema = z.object({ operationId: z.uuid(), accepted: z.literal(true) });
|
|
34
|
+
|
|
35
|
+
export function taskSyncRequest(command: TaskSyncCommand) {
|
|
36
|
+
const { action } = command;
|
|
37
|
+
const base = '/api/tasks';
|
|
38
|
+
let method: string, path: string, body: unknown;
|
|
39
|
+
switch (action.kind) {
|
|
40
|
+
case 'create_project': method = 'POST'; path = '/api/projects'; body = action.data; break;
|
|
41
|
+
case 'create_milestone': method = 'POST'; path = '/api/milestones'; body = action.data; break;
|
|
42
|
+
case 'reorder': method = 'PATCH'; path = `${base}/reorder`; body = { taskIds: action.taskIds }; break;
|
|
43
|
+
case 'create': method = 'POST'; path = base; body = action.data; break;
|
|
44
|
+
case 'update': method = 'PATCH'; path = `${base}/${action.taskId}`; body = action.data; break;
|
|
45
|
+
case 'complete':
|
|
46
|
+
method = 'PATCH'; path = `${base}/${action.taskId}/complete`;
|
|
47
|
+
body = { state: action.state, occurrenceId: action.occurrenceId, occurrenceIdentity: action.occurrenceIdentity }; break;
|
|
48
|
+
case 'occurrence': method = 'PATCH'; path = `${base}/${action.taskId}/occurrences/${action.occurrenceId}`; body = { ...action.data, occurrenceIdentity: action.occurrenceIdentity }; break;
|
|
49
|
+
case 'trash': method = 'DELETE'; path = `${base}/${action.taskId}`; break;
|
|
50
|
+
case 'restore': method = 'POST'; path = `${base}/${action.taskId}/restore`; body = { deletionBatchId: action.deletionBatchId }; break;
|
|
51
|
+
}
|
|
52
|
+
return { path, method, body: body === undefined ? undefined : JSON.stringify(body), headers: {
|
|
53
|
+
[TASK_SYNC_VERSION_HEADER]: TASK_SYNC_VERSION,
|
|
54
|
+
[TASK_SYNC_OPERATION_HEADER]: command.operationId,
|
|
55
|
+
} };
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** Restrict retryable uploads to the domain actions covered by this protocol. */
|
|
59
|
+
export function parseTaskSyncAction(method: string, path: string, body: unknown): TaskSyncAction {
|
|
60
|
+
const parts = path.split('/').filter(Boolean);
|
|
61
|
+
if (parts.length === 2 && parts[0] === 'api' && method === 'POST' && ['projects', 'milestones'].includes(parts[1]!)) {
|
|
62
|
+
return TaskSyncActionSchema.parse({ kind: parts[1] === 'projects' ? 'create_project' : 'create_milestone', data: body });
|
|
63
|
+
}
|
|
64
|
+
if (parts[0] !== 'api' || parts[1] !== 'tasks') throw new Error('Unsupported sync action');
|
|
65
|
+
let action: unknown;
|
|
66
|
+
if (parts.length === 2 && method === 'POST') action = { kind: 'create', data: body };
|
|
67
|
+
if (parts.length === 3 && method === 'PATCH') action = { kind: 'update', taskId: parts[2], data: body };
|
|
68
|
+
if (parts.length === 3 && parts[2] === 'reorder' && method === 'PATCH') action = { ...body as object, kind: 'reorder' };
|
|
69
|
+
if (parts.length === 3 && method === 'DELETE' && body === undefined) action = { kind: 'trash', taskId: parts[2] };
|
|
70
|
+
if (parts.length === 4 && parts[3] === 'complete' && method === 'PATCH') {
|
|
71
|
+
action = { ...body as object, kind: 'complete', taskId: parts[2] };
|
|
72
|
+
}
|
|
73
|
+
if (parts.length === 4 && parts[3] === 'restore' && method === 'POST') {
|
|
74
|
+
action = { ...body as object, kind: 'restore', taskId: parts[2] };
|
|
75
|
+
}
|
|
76
|
+
if (parts.length === 5 && parts[3] === 'occurrences' && method === 'PATCH') {
|
|
77
|
+
const { occurrenceIdentity, ...data } = (body ?? {}) as Record<string, unknown>;
|
|
78
|
+
action = { kind: 'occurrence', taskId: parts[2], occurrenceId: parts[4], occurrenceIdentity, data };
|
|
79
|
+
}
|
|
80
|
+
return TaskSyncActionSchema.parse(action);
|
|
81
|
+
}
|
|
@@ -130,9 +130,6 @@ import {
|
|
|
130
130
|
BriefingRequestSchema,
|
|
131
131
|
JournalRequestSchema,
|
|
132
132
|
CodeRequestSchema,
|
|
133
|
-
ConductRequestSchema,
|
|
134
|
-
FleetPlanSchema,
|
|
135
|
-
FleetWorkerSchema,
|
|
136
133
|
RepoListRequestSchema,
|
|
137
134
|
ListPrsRequestSchema,
|
|
138
135
|
GetConfigRequestSchema,
|
|
@@ -276,9 +273,6 @@ export type AskRequest = z.input<typeof AskRequestSchema>;
|
|
|
276
273
|
export type BriefingRequest = z.input<typeof BriefingRequestSchema>;
|
|
277
274
|
export type JournalRequest = z.input<typeof JournalRequestSchema>;
|
|
278
275
|
export type CodeRequest = z.input<typeof CodeRequestSchema>;
|
|
279
|
-
export type ConductRequest = z.input<typeof ConductRequestSchema>;
|
|
280
|
-
export type FleetPlan = z.infer<typeof FleetPlanSchema>;
|
|
281
|
-
export type FleetWorker = z.infer<typeof FleetWorkerSchema>;
|
|
282
276
|
export type RepoListRequest = z.input<typeof RepoListRequestSchema>;
|
|
283
277
|
export type RepoListResponse = z.infer<typeof RepoListResponseSchema>;
|
|
284
278
|
export type ListPrsRequest = z.input<typeof ListPrsRequestSchema>;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export const SavedChatMessageSchema = z.object({
|
|
4
|
+
id: z.string().min(1), role: z.enum(['user', 'lucid', 'notice']), text: z.string(),
|
|
5
|
+
}).passthrough();
|
|
6
|
+
|
|
7
|
+
/** How one repository's worktrees are prepared. Stored on the computer and edited from the phone. */
|
|
8
|
+
export const RepoSettingsSchema = z.object({
|
|
9
|
+
/** Gitignored files copied from the main checkout into a new worktree. Wildcards in the file name only. */
|
|
10
|
+
copy: z.array(z.string().trim().min(1).max(300)).max(50).default([]),
|
|
11
|
+
/** Shell command run in a new worktree once those files are in place. */
|
|
12
|
+
setup: z.string().trim().max(2000).optional(),
|
|
13
|
+
/** Remote branch new worktrees start from, e.g. `origin/main`. Unset uses the remote default. */
|
|
14
|
+
baseRef: z.string().trim().max(200).optional(),
|
|
15
|
+
/** Shell command run in a worktree just before it is archived. A failure stops the archive. */
|
|
16
|
+
archiveScript: z.string().trim().max(2000).optional(),
|
|
17
|
+
/** Archive a worktree once the pull request for its branch has merged. */
|
|
18
|
+
archiveOnMerge: z.boolean().optional(),
|
|
19
|
+
/** Delete the local branch when a worktree is archived. Restore brings it back from the snapshot. */
|
|
20
|
+
deleteBranchOnArchive: z.boolean().optional(),
|
|
21
|
+
});
|
|
22
|
+
/** Where a repository lives on the computer, and what its copy list matches there right now. */
|
|
23
|
+
export const RepoPlacesSchema = z.object({
|
|
24
|
+
root: z.string(), worktrees: z.string(), copyMatches: z.array(z.string()),
|
|
25
|
+
});
|
|
26
|
+
export type RepoPlaces = z.infer<typeof RepoPlacesSchema>;
|
|
27
|
+
export type RepoSettings = z.infer<typeof RepoSettingsSchema>;
|
|
28
|
+
|
|
29
|
+
export const WorkerWorkspaceSchema = z.object({
|
|
30
|
+
workerId: z.uuidv7(), repoId: z.string().min(1), title: z.string().min(1).max(200),
|
|
31
|
+
brief: z.string().max(8000).default(''),
|
|
32
|
+
workspaceId: z.string(), conversationId: z.string(),
|
|
33
|
+
state: z.enum(['creating', 'ready', 'setup_failed', 'archived']),
|
|
34
|
+
branch: z.string().optional(), baseRef: z.string().optional(), baseSha: z.string().optional(),
|
|
35
|
+
resume: z.string().optional(), error: z.string().optional(),
|
|
36
|
+
/** The setup command's progress on a ready worktree. A failure's output is in `error`. */
|
|
37
|
+
setup: z.enum(['running', 'failed']).optional(),
|
|
38
|
+
/** First of the ten ports reserved for this worktree's servers. */
|
|
39
|
+
port: z.number().int().min(1024).max(65525).optional(),
|
|
40
|
+
createdAt: z.string(), updatedAt: z.string(),
|
|
41
|
+
});
|
|
42
|
+
export type WorkerWorkspace = z.infer<typeof WorkerWorkspaceSchema>;
|
|
43
|
+
|
|
44
|
+
export const WorkspaceCommandSchema = z.object({
|
|
45
|
+
action: z.enum(['list', 'create', 'history', 'archive', 'restore', 'import', 'clear-history', 'inspect-run', 'continue-run',
|
|
46
|
+
'settings', 'save-settings', 'setup', 'delete']),
|
|
47
|
+
requestId: z.uuidv7().optional(), reviewId: z.uuidv7().optional(),
|
|
48
|
+
instruction: z.string().trim().min(1).max(8000).optional(),
|
|
49
|
+
repoId: z.string().min(1).optional(), workerId: z.uuidv7().optional(),
|
|
50
|
+
checkout: z.boolean().optional(), revision: z.string().optional(),
|
|
51
|
+
title: z.string().trim().min(1).max(200).optional(),
|
|
52
|
+
brief: z.string().max(8000).optional(), before: z.string().optional(),
|
|
53
|
+
settings: RepoSettingsSchema.optional(),
|
|
54
|
+
/** `delete` only: go ahead even though the worktree holds work that is not in the base branch. */
|
|
55
|
+
force: z.boolean().optional(),
|
|
56
|
+
legacy: z.object({
|
|
57
|
+
messages: z.array(SavedChatMessageSchema).max(10_000), resume: z.string().optional(),
|
|
58
|
+
sessionCheckout: z.boolean().optional(),
|
|
59
|
+
}).optional(),
|
|
60
|
+
});
|
|
61
|
+
export type WorkspaceCommand = z.infer<typeof WorkspaceCommandSchema>;
|
|
62
|
+
|
|
63
|
+
/** Work an archived worktree still holds that is neither in the repository's base branch nor pushed. */
|
|
64
|
+
export const UnmergedWorkSchema = z.object({
|
|
65
|
+
commits: z.number().int().min(0),
|
|
66
|
+
/** The archive snapshot holds files that were never committed. */
|
|
67
|
+
uncommitted: z.boolean(),
|
|
68
|
+
});
|
|
69
|
+
export type UnmergedWork = z.infer<typeof UnmergedWorkSchema>;
|
|
70
|
+
|
|
71
|
+
export const WorkspaceRunSchema = z.object({
|
|
72
|
+
requestId: z.string(), prompt: z.string(),
|
|
73
|
+
handoff: z.object({ from: z.enum(['claude', 'codex']), to: z.enum(['claude', 'codex']) }).optional(),
|
|
74
|
+
frames: z.array(z.record(z.string(), z.unknown())),
|
|
75
|
+
terminated: z.boolean(),
|
|
76
|
+
});
|
|
77
|
+
export type WorkspaceRun = z.infer<typeof WorkspaceRunSchema>;
|
|
78
|
+
export const RunReviewSchema = z.object({
|
|
79
|
+
requestId: z.uuidv7(), reviewId: z.uuidv7(), inspectedAt: z.string(),
|
|
80
|
+
prompt: z.string(), workspace: z.string().optional(), branch: z.string().optional(),
|
|
81
|
+
changes: z.string(), diff: z.string(), inspectionError: z.string().optional(),
|
|
82
|
+
progress: z.string(), answer: z.string().optional(), evidence: z.string(),
|
|
83
|
+
tools: z.array(z.object({ name: z.string(), phase: z.string(), itemId: z.string().optional(), outcome: z.string().optional() })),
|
|
84
|
+
unresolved: z.array(z.string()),
|
|
85
|
+
continuationId: z.uuidv7(), continuedAt: z.string().optional(), instruction: z.string().optional(),
|
|
86
|
+
});
|
|
87
|
+
export type RunReview = z.infer<typeof RunReviewSchema>;
|
|
88
|
+
export const WorkspaceSnapshotSchema = z.object({
|
|
89
|
+
workers: z.array(WorkerWorkspaceSchema),
|
|
90
|
+
review: RunReviewSchema.optional(),
|
|
91
|
+
checkout: z.object({
|
|
92
|
+
repoId: z.string(), conversationId: z.string(), revision: z.string(),
|
|
93
|
+
resume: z.string().optional(),
|
|
94
|
+
}).optional(),
|
|
95
|
+
runs: z.array(WorkspaceRunSchema).optional(),
|
|
96
|
+
legacyMessages: z.array(SavedChatMessageSchema).optional(),
|
|
97
|
+
nextBefore: z.string().optional(),
|
|
98
|
+
settings: RepoSettingsSchema.optional(),
|
|
99
|
+
places: RepoPlacesSchema.optional(),
|
|
100
|
+
/** A `delete` that was not carried out: what would be lost. Sending it again with `force` deletes. */
|
|
101
|
+
unmerged: UnmergedWorkSchema.optional(),
|
|
102
|
+
});
|
|
103
|
+
export type WorkspaceSnapshot = z.infer<typeof WorkspaceSnapshotSchema>;
|
package/dist/coding/conduct.d.ts
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import type { AgentExecutor } from '@lucidity/runtime';
|
|
2
|
-
import type { FleetPlan, HarnessImage } from '@lucidity/shared';
|
|
3
|
-
import type { RepoEntry } from '../config.js';
|
|
4
|
-
import { commitSubjects, commitsAhead } from './worktree.js';
|
|
5
|
-
import { openFleetPr } from './openFleetPr.js';
|
|
6
|
-
import { type CodeTurnRequest, type RunCodeTurnDeps } from './runCodeTurn.js';
|
|
7
|
-
/**
|
|
8
|
-
* The conductor: one Lucid "lead" that decomposes a goal, fans it out to isolated worker
|
|
9
|
-
* worktrees, and integrates them back onto lucid/<repo> in order. Daemon-side authority — the
|
|
10
|
-
* daemon owns every worker's resume handle and its lane; the phone is a thin client that sees
|
|
11
|
-
* a plan, approves it, then watches the fleet.
|
|
12
|
-
*
|
|
13
|
-
* Two phases over one turn. `plan` runs a read-only lead turn to produce a FleetPlan (streamed
|
|
14
|
-
* back as a fleet_plan event; nothing is created, so a discarded plan leaves no trace). `run`
|
|
15
|
-
* takes the approved plan and: creates the task graph (worker = subtask), dispatches the workers
|
|
16
|
-
* in parallel up to a cap (isolated worktrees make that safe), then integrates sequentially in
|
|
17
|
-
* merge order — the one place overlap can bite. Each worker's own code frames stream under
|
|
18
|
-
* `requestId === workerId`, so a worker reuses the entire existing code-turn pipeline; this
|
|
19
|
-
* layer only adds the fleet-level events (plan, worker_status, conflict, done).
|
|
20
|
-
*/
|
|
21
|
-
export interface ConductTurnRequest {
|
|
22
|
-
id: string;
|
|
23
|
-
repoId: string;
|
|
24
|
-
phase: 'plan' | 'run' | 'setup' | 'integrate';
|
|
25
|
-
prompt: string;
|
|
26
|
-
images?: HarnessImage[];
|
|
27
|
-
plan?: FleetPlan;
|
|
28
|
-
resume?: string;
|
|
29
|
-
/** Skip the dogfood task graph (quick incremental spawn — the fleet UI tracks it anyway). */
|
|
30
|
-
ephemeral?: boolean;
|
|
31
|
-
}
|
|
32
|
-
type Api = {
|
|
33
|
-
request<T>(endpoint: string, options?: RequestInit): Promise<T>;
|
|
34
|
-
};
|
|
35
|
-
export interface RunConductTurnDeps {
|
|
36
|
-
repos: RepoEntry[];
|
|
37
|
-
executor: AgentExecutor;
|
|
38
|
-
onWorkerApproval?: (requestId: string, approval: import('@lucidity/runtime').ExecutorApproval) => Promise<boolean>;
|
|
39
|
-
onEnd?: (requestId: string) => void;
|
|
40
|
-
send: (obj: unknown) => void;
|
|
41
|
-
signal?: AbortSignal;
|
|
42
|
-
model?: string;
|
|
43
|
-
effort?: string;
|
|
44
|
-
/** Task API for the dogfood (goal + subtasks). Absent → tasks are skipped, fleet still runs. */
|
|
45
|
-
api?: Api;
|
|
46
|
-
/** Project the fleet's tasks land in. Absent → the Inbox (projectId null). */
|
|
47
|
-
projectId?: string | null;
|
|
48
|
-
/** Default parallel-worker cap when the plan doesn't set one (quota guard). */
|
|
49
|
-
maxParallel?: number;
|
|
50
|
-
/** Worktree base override (tests point it at a temp dir). */
|
|
51
|
-
baseDir?: string;
|
|
52
|
-
/** Seam: run one worker's coding turn. Defaults to {@link runCodeTurn}. */
|
|
53
|
-
runWorker?: (req: CodeTurnRequest, deps: RunCodeTurnDeps) => Promise<void>;
|
|
54
|
-
/** Seam: open one worker's PR (push its branch + open/reuse a PR). Defaults to {@link openFleetPr}. */
|
|
55
|
-
openPr?: typeof openFleetPr;
|
|
56
|
-
/** Seam: how many commits a worker's branch carries. Defaults to {@link commitsAhead}. */
|
|
57
|
-
commitsAhead?: typeof commitsAhead;
|
|
58
|
-
/** Seam: the subjects of those commits, for the PR title. Defaults to {@link commitSubjects}. */
|
|
59
|
-
commitSubjects?: typeof commitSubjects;
|
|
60
|
-
}
|
|
61
|
-
/** Count +/- lines and files in a unified diff, for a worker card's "+N −M". */
|
|
62
|
-
export declare function diffStat(diff: string): {
|
|
63
|
-
added: number;
|
|
64
|
-
removed: number;
|
|
65
|
-
files: number;
|
|
66
|
-
};
|
|
67
|
-
export declare function runConductTurn(req: ConductTurnRequest, deps: RunConductTurnDeps): Promise<void>;
|
|
68
|
-
export {};
|
|
69
|
-
//# sourceMappingURL=conduct.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"conduct.d.ts","sourceRoot":"","sources":["../../src/coding/conduct.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAgB,MAAM,kBAAkB,CAAC;AAC9E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAG9C,OAAO,EACL,cAAc,EACd,YAAY,EAKb,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAE,WAAW,EAAuC,MAAM,kBAAkB,CAAC;AACpF,OAAO,EAAe,KAAK,eAAe,EAAE,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAE3F;;;;;;;;;;;;;GAaG;AAEH,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,WAAW,CAAC;IAC9C,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,YAAY,EAAE,CAAC;IACxB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,6FAA6F;IAC7F,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,KAAK,GAAG,GAAG;IAAE,OAAO,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,CAAC,CAAC,CAAA;CAAE,CAAC;AAE/E,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,QAAQ,EAAE,aAAa,CAAC;IACxB,gBAAgB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,mBAAmB,EAAE,gBAAgB,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACnH,KAAK,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,IAAI,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7B,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gGAAgG;IAChG,GAAG,CAAC,EAAE,GAAG,CAAC;IACV,8EAA8E;IAC9E,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,+EAA+E;IAC/E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6DAA6D;IAC7D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,2EAA2E;IAC3E,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,eAAe,EAAE,IAAI,EAAE,eAAe,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3E,uGAAuG;IACvG,MAAM,CAAC,EAAE,OAAO,WAAW,CAAC;IAC5B,0FAA0F;IAC1F,YAAY,CAAC,EAAE,OAAO,YAAY,CAAC;IACnC,iGAAiG;IACjG,cAAc,CAAC,EAAE,OAAO,cAAc,CAAC;CACxC;AAQD,gFAAgF;AAChF,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAWxF;AAoBD,wBAAsB,cAAc,CAClC,GAAG,EAAE,kBAAkB,EACvB,IAAI,EAAE,kBAAkB,GACvB,OAAO,CAAC,IAAI,CAAC,CAuBf"}
|