@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
package/dist/coding/worktree.js
CHANGED
|
@@ -16,36 +16,55 @@ async function git(cwd, args, env) {
|
|
|
16
16
|
function slug(repoId) {
|
|
17
17
|
return repoId.replace(/[^A-Za-z0-9._-]/g, '-');
|
|
18
18
|
}
|
|
19
|
-
/** The stable branch name for a coding session.
|
|
20
|
-
* a
|
|
21
|
-
* subtask's id), so N workers on one repo hold N isolated branches.
|
|
19
|
+
/** The stable branch name for a coding session. The repository's main session is
|
|
20
|
+
* `lucid/<repo>`; a worktree gets `wt/<repo>/<workerId>`.
|
|
22
21
|
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* exclusive (the D/F conflict). Keeping workers under `fleet/` leaves the bare
|
|
27
|
-
* `lucid/<repo>` — the classic single session AND the fleet's integration target,
|
|
28
|
-
* the one branch a fleet PR opens from — untouched. `workerId` absent → the classic
|
|
29
|
-
* branch, byte-for-byte as before. */
|
|
22
|
+
* Worktrees live under their own `wt/` namespace instead of `lucid/<repo>/…` because a git
|
|
23
|
+
* ref can't be both a leaf and a directory, so `lucid/<repo>` and `lucid/<repo>/<workerId>`
|
|
24
|
+
* cannot both exist. */
|
|
30
25
|
export function sessionBranch(repoId, workerId) {
|
|
31
26
|
return workerId
|
|
32
|
-
? `
|
|
27
|
+
? `wt/${slug(repoId)}/${slug(workerId)}`
|
|
33
28
|
: `lucid/${slug(repoId)}`;
|
|
34
29
|
}
|
|
35
|
-
/** The stable
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
* default root (tests point it at a temp dir); `workerId` absent → the classic path. */
|
|
30
|
+
/** The stable folder for a coding session (constant across turns, so `--resume` resolves).
|
|
31
|
+
* The main session lives at `<base>/<repo>`; a worktree at `<base>/wt/<repo>/<workerId>`, a
|
|
32
|
+
* sibling of it and never nested inside it (which would put a checkout within a checkout).
|
|
33
|
+
* `baseDir` overrides the default root (tests point it at a temp dir). */
|
|
40
34
|
export function sessionWorktreePath(repoId, baseDir = WORKTREE_BASE, workerId) {
|
|
41
35
|
return workerId
|
|
42
|
-
? join(baseDir, '
|
|
36
|
+
? join(baseDir, 'wt', slug(repoId), slug(workerId))
|
|
43
37
|
: join(baseDir, slug(repoId));
|
|
44
38
|
}
|
|
45
39
|
/** The branch checked out in `repoRoot`, or `HEAD` when detached. */
|
|
46
40
|
export async function currentBranch(repoRoot) {
|
|
47
41
|
return (await git(repoRoot, ['rev-parse', '--abbrev-ref', 'HEAD'])).trim();
|
|
48
42
|
}
|
|
43
|
+
export async function workspaceBranchExists(repoRoot, repoId, workerId) {
|
|
44
|
+
return git(repoRoot, ['show-ref', '--verify', `refs/heads/${sessionBranch(repoId, workerId)}`]).then(() => true, () => false);
|
|
45
|
+
}
|
|
46
|
+
/** Resolve the fetched remote base without changing the existing checkout. */
|
|
47
|
+
export async function workspaceBase(repoRoot, configured) {
|
|
48
|
+
const remotes = (await git(repoRoot, ['remote'])).trim().split('\n');
|
|
49
|
+
if (!remotes.includes('origin')) {
|
|
50
|
+
if (configured)
|
|
51
|
+
throw new Error('The configured workspace base requires an origin remote.');
|
|
52
|
+
return { ref: 'HEAD', sha: (await git(repoRoot, ['rev-parse', 'HEAD'])).trim() };
|
|
53
|
+
}
|
|
54
|
+
await git(repoRoot, ['fetch', 'origin']);
|
|
55
|
+
let ref = configured;
|
|
56
|
+
if (!ref) {
|
|
57
|
+
const remoteHead = await git(repoRoot, ['ls-remote', '--symref', 'origin', 'HEAD']);
|
|
58
|
+
const branch = /^ref: refs\/heads\/(.+)\s+HEAD$/m.exec(remoteHead)?.[1];
|
|
59
|
+
if (!branch)
|
|
60
|
+
throw new Error('Could not resolve the remote default branch. Set this repository\'s baseRef.');
|
|
61
|
+
ref = `origin/${branch}`;
|
|
62
|
+
}
|
|
63
|
+
if (!ref.startsWith('origin/'))
|
|
64
|
+
ref = `origin/${ref}`;
|
|
65
|
+
const sha = (await git(repoRoot, ['rev-parse', '--verify', '--end-of-options', `${ref}^{commit}`])).trim();
|
|
66
|
+
return { ref, sha };
|
|
67
|
+
}
|
|
49
68
|
/**
|
|
50
69
|
* How many commits this worktree's HEAD carries that `base` doesn't.
|
|
51
70
|
*
|
|
@@ -113,20 +132,7 @@ export async function repoWebUrl(repoRoot) {
|
|
|
113
132
|
const raw = await git(repoRoot, ['remote', 'get-url', 'origin']).catch(() => '');
|
|
114
133
|
return githubWebUrlFromRemote(raw);
|
|
115
134
|
}
|
|
116
|
-
/**
|
|
117
|
-
* Prepare the workspace for a coding turn.
|
|
118
|
-
*
|
|
119
|
-
* `worktree` (default): ensure the persistent worktree for this repo's session exists
|
|
120
|
-
* on its `lucid/<repoId>` branch, at a STABLE path so Claude Code's `--resume` resolves
|
|
121
|
-
* across turns. `fresh: true` (a new session — no resume) resets the branch and worktree
|
|
122
|
-
* to HEAD, discarding any prior session's state. Otherwise the existing worktree is
|
|
123
|
-
* reused as-is so prior turns' commits (files) carry forward; if it's missing (first
|
|
124
|
-
* turn, or pruned), it's created off HEAD.
|
|
125
|
-
*
|
|
126
|
-
* `in-place` (#121): the user's own checkout, on its live branch, uncommitted work and
|
|
127
|
-
* all — the point of the mode is that Lucid continues from where the user left off, so
|
|
128
|
-
* `fresh` resets NOTHING here. It would mean discarding their work.
|
|
129
|
-
*/
|
|
135
|
+
/** Resolve a persistent workspace. Provider session changes never reset its files. */
|
|
130
136
|
export async function ensureWorkspace(repoRoot, repoId, opts = {}) {
|
|
131
137
|
const mode = opts.mode ?? 'worktree';
|
|
132
138
|
if (mode === 'in-place') {
|
|
@@ -136,13 +142,15 @@ export async function ensureWorkspace(repoRoot, repoId, opts = {}) {
|
|
|
136
142
|
const branch = sessionBranch(repoId, opts.workerId);
|
|
137
143
|
const path = sessionWorktreePath(repoId, baseDir, opts.workerId);
|
|
138
144
|
mkdirSync(baseDir, { recursive: true });
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
await git(repoRoot,
|
|
145
|
+
if (existsSync(path)) {
|
|
146
|
+
return { path, branch: await currentBranch(path), mode };
|
|
147
|
+
}
|
|
148
|
+
// Recover branches left behind by the old automatic delivery path.
|
|
149
|
+
const existing = await git(repoRoot, ['show-ref', '--verify', `refs/heads/${branch}`])
|
|
150
|
+
.then(() => true, () => false);
|
|
151
|
+
await git(repoRoot, existing
|
|
152
|
+
? ['worktree', 'add', path, branch]
|
|
153
|
+
: ['worktree', 'add', '-b', branch, path, opts.startPoint ?? 'HEAD']);
|
|
146
154
|
return { path, branch, mode };
|
|
147
155
|
}
|
|
148
156
|
/**
|
|
@@ -262,3 +270,147 @@ export async function removeWorktree(repoRoot, ws, opts = {}) {
|
|
|
262
270
|
}
|
|
263
271
|
}
|
|
264
272
|
}
|
|
273
|
+
/** Where an archived worker's files are parked. Under `refs/lucid/`, so no branch or push sees it. */
|
|
274
|
+
export function archivedWorktreeRef(workerId) {
|
|
275
|
+
return `refs/lucid/archived/${slug(workerId)}`;
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Free an archived worker's folder. Its full working state (tracked, staged and untracked,
|
|
279
|
+
* gitignored files excluded) is parked first as a commit on top of the worktree's HEAD, so
|
|
280
|
+
* uncommitted work survives. The branch stays. Throws before removing anything if the
|
|
281
|
+
* snapshot cannot be written.
|
|
282
|
+
*/
|
|
283
|
+
export async function archiveWorktree(repoRoot, ws, workerId, opts = {}) {
|
|
284
|
+
if (ws.mode === 'in-place' || resolve(ws.path) === resolve(repoRoot)) {
|
|
285
|
+
throw new Error(`refusing to remove the repo checkout itself: ${ws.path}`);
|
|
286
|
+
}
|
|
287
|
+
if (!existsSync(ws.path))
|
|
288
|
+
return;
|
|
289
|
+
const tree = await snapshotTree(ws);
|
|
290
|
+
const head = (await git(ws.path, ['rev-parse', 'HEAD'])).trim();
|
|
291
|
+
const sha = (await git(ws.path, ['commit-tree', tree, '-p', head, '-m', 'Archived worktree'])).trim();
|
|
292
|
+
await git(repoRoot, ['update-ref', archivedWorktreeRef(workerId), sha]);
|
|
293
|
+
await git(repoRoot, ['worktree', 'remove', '--force', ws.path]);
|
|
294
|
+
// The snapshot's parent is the branch tip, so the branch can be re-created from it on restore.
|
|
295
|
+
if (opts.deleteBranch)
|
|
296
|
+
await git(repoRoot, ['branch', '-D', ws.branch]).catch(() => { });
|
|
297
|
+
}
|
|
298
|
+
/** The commit an archived worker's branch pointed at, for re-creating a branch deleted on archive. */
|
|
299
|
+
export async function archivedHead(repoRoot, workerId) {
|
|
300
|
+
return git(repoRoot, ['rev-parse', '--verify', '--quiet', `${archivedWorktreeRef(workerId)}^`]).then((s) => s.trim() || undefined, () => undefined);
|
|
301
|
+
}
|
|
302
|
+
/**
|
|
303
|
+
* What deleting an archived worker would lose: commits on its branch (or, when the branch was
|
|
304
|
+
* deleted on archive, on the commit its snapshot was taken from) that are in none of `baseRefs`,
|
|
305
|
+
* the remote default branch or the branch's own remote copy, plus whether the snapshot holds
|
|
306
|
+
* files that were never committed.
|
|
307
|
+
*
|
|
308
|
+
* A commit whose change is already in the base under another sha does not count, so a branch
|
|
309
|
+
* that was rebase-merged reads as merged. A squash merge cannot be recognised this way and
|
|
310
|
+
* still counts. Remote refs are refreshed first when anything looks unmerged, since a pull
|
|
311
|
+
* request merged on GitHub is only visible after a fetch; offline, the last fetched state is used.
|
|
312
|
+
*/
|
|
313
|
+
export async function unmergedArchivedWork(repoRoot, workerId, branch, baseRefs = []) {
|
|
314
|
+
const sha = (ref) => git(repoRoot, ['rev-parse', '--verify', '--quiet', '--end-of-options', `${ref}^{commit}`]).then((s) => s.trim() || undefined, () => undefined);
|
|
315
|
+
const present = async (refs) => [...new Set((await Promise.all(refs.map((ref) => (ref ? sha(ref) : undefined)))).filter((s) => !!s))];
|
|
316
|
+
const snapshot = archivedWorktreeRef(workerId);
|
|
317
|
+
const trees = await git(repoRoot, ['rev-parse', '--verify', '--quiet', `${snapshot}^{tree}`])
|
|
318
|
+
.then(async (tree) => [tree.trim(), (await git(repoRoot, ['rev-parse', '--verify', '--quiet', `${snapshot}^^{tree}`])).trim()], () => []);
|
|
319
|
+
const uncommitted = trees.length === 2 && trees[0] !== trees[1];
|
|
320
|
+
const tips = await present([`refs/heads/${branch}`, `${snapshot}^`]);
|
|
321
|
+
if (!tips.length)
|
|
322
|
+
return { commits: 0, uncommitted };
|
|
323
|
+
const kept = async () => {
|
|
324
|
+
const remoteDefault = await git(repoRoot, ['symbolic-ref', '--quiet', '--short', 'refs/remotes/origin/HEAD']).then((s) => s.trim(), () => '');
|
|
325
|
+
const refs = await present([
|
|
326
|
+
...baseRefs.flatMap((ref) => (!ref || ref === 'HEAD' || ref.startsWith('origin/') ? [ref] : [`origin/${ref}`, ref])),
|
|
327
|
+
remoteDefault, remoteDefault && `refs/heads/${remoteDefault.replace(/^origin\//, '')}`,
|
|
328
|
+
`refs/remotes/origin/${branch}`, `${branch}@{upstream}`,
|
|
329
|
+
]);
|
|
330
|
+
// A repository with no remote and no configured base has only its own checkout to compare against.
|
|
331
|
+
return refs.length ? refs : present(['HEAD']);
|
|
332
|
+
};
|
|
333
|
+
const ahead = async (bases) => (await git(repoRoot, ['rev-list', '--no-merges', ...tips, '--not', ...bases])).split('\n').filter(Boolean);
|
|
334
|
+
let bases = await kept();
|
|
335
|
+
let commits = await ahead(bases);
|
|
336
|
+
if (commits.length) {
|
|
337
|
+
await exec('git', ['fetch', 'origin'], { cwd: repoRoot, timeout: 20_000 }).catch(() => { });
|
|
338
|
+
bases = await kept();
|
|
339
|
+
commits = await ahead(bases);
|
|
340
|
+
}
|
|
341
|
+
if (commits.length && bases[0]) {
|
|
342
|
+
const applied = new Set(commits);
|
|
343
|
+
for (const tip of tips) {
|
|
344
|
+
const fresh = await git(repoRoot, ['rev-list', '--no-merges', '--cherry-pick', '--right-only', `${bases[0]}...${tip}`]);
|
|
345
|
+
for (const commit of fresh.split('\n'))
|
|
346
|
+
applied.delete(commit);
|
|
347
|
+
}
|
|
348
|
+
commits = commits.filter((commit) => !applied.has(commit));
|
|
349
|
+
}
|
|
350
|
+
return { commits: commits.length, uncommitted };
|
|
351
|
+
}
|
|
352
|
+
/** Remove what an archived worker left in the repository: its local branch, if it still has one,
|
|
353
|
+
* and its snapshot. The remote branch is not touched. */
|
|
354
|
+
export async function deleteArchivedWorktree(repoRoot, workerId, branch) {
|
|
355
|
+
// A folder removed by hand still holds its branch until its worktree entry is pruned.
|
|
356
|
+
await git(repoRoot, ['worktree', 'prune']).catch(() => { });
|
|
357
|
+
const exists = await git(repoRoot, ['show-ref', '--verify', `refs/heads/${branch}`]).then(() => true, () => false);
|
|
358
|
+
if (exists)
|
|
359
|
+
await git(repoRoot, ['branch', '-D', '--end-of-options', branch]);
|
|
360
|
+
await git(repoRoot, ['update-ref', '-d', archivedWorktreeRef(workerId)]);
|
|
361
|
+
}
|
|
362
|
+
/** Per-file added and removed line counts for everything in a folder that differs from `base`,
|
|
363
|
+
* committed or not. Tracked files only; a binary file counts as zero lines. */
|
|
364
|
+
export async function numstatSince(path, base) {
|
|
365
|
+
const out = await git(path, ['diff', '--numstat', '-z', base]);
|
|
366
|
+
const stats = new Map();
|
|
367
|
+
for (const row of out.split('\0')) {
|
|
368
|
+
const [added, removed, file] = row.split('\t');
|
|
369
|
+
if (file)
|
|
370
|
+
stats.set(file, [Number(added) || 0, Number(removed) || 0]);
|
|
371
|
+
}
|
|
372
|
+
return stats;
|
|
373
|
+
}
|
|
374
|
+
/** What changed between two readings of {@link numstatSince} taken against the same base: the
|
|
375
|
+
* turn's own work, with whatever was already uncommitted when it started taken out. */
|
|
376
|
+
export function turnChangeCounts(before, after) {
|
|
377
|
+
let added = 0;
|
|
378
|
+
let removed = 0;
|
|
379
|
+
const files = [];
|
|
380
|
+
for (const file of new Set([...before.keys(), ...after.keys()])) {
|
|
381
|
+
const [a0, r0] = before.get(file) ?? [0, 0];
|
|
382
|
+
const [a1, r1] = after.get(file) ?? [0, 0];
|
|
383
|
+
if (a0 === a1 && r0 === r1)
|
|
384
|
+
continue;
|
|
385
|
+
added += Math.max(0, a1 - a0);
|
|
386
|
+
removed += Math.max(0, r1 - r0);
|
|
387
|
+
if (files.length < 40)
|
|
388
|
+
files.push(file);
|
|
389
|
+
}
|
|
390
|
+
return files.length ? { added, removed, files } : undefined;
|
|
391
|
+
}
|
|
392
|
+
/** The commit checked out in a folder. */
|
|
393
|
+
export async function headSha(path) {
|
|
394
|
+
return (await git(path, ['rev-parse', 'HEAD'])).trim();
|
|
395
|
+
}
|
|
396
|
+
/**
|
|
397
|
+
* Put an archived worker's uncommitted files back into its re-created worktree. They return
|
|
398
|
+
* unstaged. If the branch moved while the worker was archived the snapshot no longer fits, so
|
|
399
|
+
* it is left under its ref for a manual `git restore --source` and nothing is overwritten.
|
|
400
|
+
*/
|
|
401
|
+
export async function restoreArchivedFiles(repoRoot, ws, workerId) {
|
|
402
|
+
const ref = archivedWorktreeRef(workerId);
|
|
403
|
+
const parent = await git(repoRoot, ['rev-parse', '--verify', '--quiet', `${ref}^`]).then((s) => s.trim(), () => '');
|
|
404
|
+
if (!parent)
|
|
405
|
+
return;
|
|
406
|
+
if (parent !== (await git(ws.path, ['rev-parse', 'HEAD'])).trim())
|
|
407
|
+
return;
|
|
408
|
+
await git(ws.path, ['restore', `--source=${ref}`, '--worktree', '--', '.']);
|
|
409
|
+
await git(repoRoot, ['update-ref', '-d', ref]);
|
|
410
|
+
}
|
|
411
|
+
/** A review can inspect tracked changes without staging or reading unrelated untracked files. */
|
|
412
|
+
export async function reviewDiff(ws) {
|
|
413
|
+
const diff = await git(ws.path, ['diff', '--no-ext-diff', '--no-textconv', 'HEAD', '--']);
|
|
414
|
+
const limit = 80_000;
|
|
415
|
+
return diff.length > limit ? diff.slice(0, limit) + '\n[Diff truncated. Read the relevant files for the rest.]' : diff;
|
|
416
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** The files the copy list matches in the repository right now. */
|
|
2
|
+
export declare function matchedFiles(repoRoot: string, include: string[]): string[];
|
|
3
|
+
/** Copy the repository's listed files into the worktree. A file already there is never overwritten. */
|
|
4
|
+
export declare function copyIncludedFiles(repoRoot: string, worktree: string, include: string[]): string[];
|
|
5
|
+
/** Run one of the repository's commands (setup or archive) in the worktree. */
|
|
6
|
+
export declare function runSetupScript(repoRoot: string, worktree: string, name: string, setup: string, port?: number): Promise<void>;
|
|
7
|
+
//# sourceMappingURL=worktreeSetup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worktreeSetup.d.ts","sourceRoot":"","sources":["../../src/coding/worktreeSetup.ts"],"names":[],"mappings":"AAsBA,mEAAmE;AACnE,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAE1E;AAED,uGAAuG;AACvG,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAUjG;AAED,+EAA+E;AAC/E,wBAAsB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAQlI"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { execFile } from 'node:child_process';
|
|
2
|
+
import { promisify } from 'node:util';
|
|
3
|
+
import { copyFileSync, existsSync, mkdirSync, readdirSync, statSync } from 'node:fs';
|
|
4
|
+
import { dirname, join, posix } from 'node:path';
|
|
5
|
+
const exec = promisify(execFile);
|
|
6
|
+
const SETUP_TIMEOUT_MS = 15 * 60 * 1000;
|
|
7
|
+
/** Wildcards are honoured in the file name only: `.env*` and `apps/api/.env.*` work, `**` does not. */
|
|
8
|
+
function matches(repoRoot, pattern) {
|
|
9
|
+
const clean = posix.normalize(pattern);
|
|
10
|
+
if (clean.startsWith('..') || clean.startsWith('/'))
|
|
11
|
+
return [];
|
|
12
|
+
const dir = posix.dirname(clean);
|
|
13
|
+
if (/[*?]/.test(dir))
|
|
14
|
+
return [];
|
|
15
|
+
const name = new RegExp(`^${posix.basename(clean).replace(/[.+^${}()|[\]\\]/g, '\\$&').replace(/\*/g, '.*').replace(/\?/g, '.')}$`);
|
|
16
|
+
const from = join(repoRoot, dir);
|
|
17
|
+
if (!existsSync(from))
|
|
18
|
+
return [];
|
|
19
|
+
return readdirSync(from)
|
|
20
|
+
.filter((entry) => name.test(entry) && statSync(join(from, entry)).isFile())
|
|
21
|
+
.map((entry) => posix.join(dir, entry));
|
|
22
|
+
}
|
|
23
|
+
/** The files the copy list matches in the repository right now. */
|
|
24
|
+
export function matchedFiles(repoRoot, include) {
|
|
25
|
+
return [...new Set(include.flatMap((pattern) => matches(repoRoot, pattern)))];
|
|
26
|
+
}
|
|
27
|
+
/** Copy the repository's listed files into the worktree. A file already there is never overwritten. */
|
|
28
|
+
export function copyIncludedFiles(repoRoot, worktree, include) {
|
|
29
|
+
const copied = [];
|
|
30
|
+
for (const file of matchedFiles(repoRoot, include)) {
|
|
31
|
+
const to = join(worktree, file);
|
|
32
|
+
if (existsSync(to))
|
|
33
|
+
continue;
|
|
34
|
+
mkdirSync(dirname(to), { recursive: true });
|
|
35
|
+
copyFileSync(join(repoRoot, file), to);
|
|
36
|
+
copied.push(file);
|
|
37
|
+
}
|
|
38
|
+
return copied;
|
|
39
|
+
}
|
|
40
|
+
/** Run one of the repository's commands (setup or archive) in the worktree. */
|
|
41
|
+
export async function runSetupScript(repoRoot, worktree, name, setup, port) {
|
|
42
|
+
await exec('/bin/sh', ['-c', setup], {
|
|
43
|
+
cwd: worktree,
|
|
44
|
+
timeout: SETUP_TIMEOUT_MS,
|
|
45
|
+
maxBuffer: 32 * 1024 * 1024,
|
|
46
|
+
env: { ...process.env, LUCIDITY_ROOT_PATH: repoRoot, LUCIDITY_WORKTREE_PATH: worktree, LUCIDITY_WORKTREE_NAME: name,
|
|
47
|
+
...(port ? { LUCIDITY_PORT: String(port) } : {}) },
|
|
48
|
+
});
|
|
49
|
+
}
|
package/dist/config.d.ts
CHANGED
|
@@ -20,6 +20,8 @@ export declare const INCIDENTS_DIR: string;
|
|
|
20
20
|
export declare const VOICE_DIAG_DIR: string;
|
|
21
21
|
/** An allowlisted repo Lucid may code in (M7). The phone sends the `id`, never a path. */
|
|
22
22
|
export interface RepoEntry {
|
|
23
|
+
/** Remote base for new workers, e.g. origin/main; defaults to origin's HEAD. */
|
|
24
|
+
baseRef?: string;
|
|
23
25
|
/** Short name the phone selects, e.g. `"lucidity"`. */
|
|
24
26
|
id: string;
|
|
25
27
|
/** Absolute path to the repo on this machine. `~` expands. */
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AASA,OAAO,EAIL,aAAa,EACb,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACvB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAGL,KAAK,eAAe,EACrB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,aAAa,EAAE,CAAC;AACzB,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzD,eAAO,MAAM,UAAU,QAA+B,CAAC;AACvD,eAAO,MAAM,WAAW,QAAkC,CAAC;AAC3D,eAAO,MAAM,QAAQ,QAA2B,CAAC;AACjD,eAAO,MAAM,QAAQ,QAA2B,CAAC;AACjD;+DAC+D;AAC/D,eAAO,MAAM,SAAS,QAA4B,CAAC;AACnD;;qGAEqG;AACrG,eAAO,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ACpB,UAAU,GAAE,MAAoB,GAC/B,OAAO,CAmCT;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,YAAY,EACpB,KAAK,EAAE,iBAAiB,GACvB,OAAO,CA+CT;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,YAAY,EACpB,KAAK,EAAE,iBAAiB,GACvB,IAAI,CAiCN;AAED;;qFAEqF;AACrF,wBAAgB,WAAW,CACzB,KAAK,EAAE,OAAO,EACd,KAAK,EAAE,MAAM,EACb,UAAU,GAAE,MAAoB,GAC/B,WAAW,GAAG,SAAS,CAWzB;AAED,yEAAyE;AACzE,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,YAAY,EACpB,KAAK,EAAE,iBAAiB,GACvB,iBAAiB,CAWnB;AAkBD;;sEAEsE;AACtE,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,OAAO,EACd,UAAU,GAAE,MAAoB,GAC/B,YAAY,CAed;AAED;mEACmE;AACnE,wBAAgB,cAAc,CAC5B,KAAK,EAAE,OAAO,EACd,UAAU,GAAE,MAAoB,GAC/B,SAAS,CAQX;AAED;;;;oDAIoD;AACpD,MAAM,WAAW,eAAe;IAC9B,cAAc,EAAE,MAAM,GAAG,mBAAmB,CAAC;IAC7C,GAAG,EAAE,MAAM,CAAC;CACb;AACD,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,YAAY,GACnB,eAAe,GAAG,SAAS,CAc7B;AAED,qFAAqF;AACrF,wBAAgB,UAAU,CACxB,KAAK,EAAE,OAAO,EACd,UAAU,GAAE,MAAoB,GAC/B,MAAM,EAAE,CASV;AAED,4FAA4F;AAC5F,wBAAgB,UAAU,CACxB,KAAK,EAAE,OAAO,EACd,UAAU,GAAE,MAAoB,GAC/B,SAAS,EAAE,CAmBb"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** The OS releases this lock on exit, including a crash. Never unlink its database. */
|
|
2
|
+
export declare class DaemonLease {
|
|
3
|
+
readonly owner: {
|
|
4
|
+
epoch: `${string}-${string}-${string}-${string}-${string}`;
|
|
5
|
+
pid: number;
|
|
6
|
+
startedAt: string;
|
|
7
|
+
};
|
|
8
|
+
private db;
|
|
9
|
+
constructor(directory: string);
|
|
10
|
+
close(): void;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=daemonLease.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"daemonLease.d.ts","sourceRoot":"","sources":["../src/daemonLease.ts"],"names":[],"mappings":"AAMA,uFAAuF;AACvF,qBAAa,WAAW;IACtB,QAAQ,CAAC,KAAK;;;;MAAkF;IAChG,OAAO,CAAC,EAAE,CAAM;gBAEJ,SAAS,EAAE,MAAM;IAgB7B,KAAK,IAAI,IAAI;CAKd"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// @ts-expect-error Node 22 runtime API; the repository's Node type baseline is 20.
|
|
2
|
+
import { DatabaseSync } from 'node:sqlite';
|
|
3
|
+
import { chmodSync, mkdirSync } from 'node:fs';
|
|
4
|
+
import { join } from 'node:path';
|
|
5
|
+
import { randomUUID } from 'node:crypto';
|
|
6
|
+
/** The OS releases this lock on exit, including a crash. Never unlink its database. */
|
|
7
|
+
export class DaemonLease {
|
|
8
|
+
owner = { epoch: randomUUID(), pid: process.pid, startedAt: new Date().toISOString() };
|
|
9
|
+
db;
|
|
10
|
+
constructor(directory) {
|
|
11
|
+
mkdirSync(directory, { recursive: true, mode: 0o700 });
|
|
12
|
+
const path = join(directory, 'daemon-owner.sqlite');
|
|
13
|
+
const db = new DatabaseSync(path);
|
|
14
|
+
try {
|
|
15
|
+
chmodSync(path, 0o600);
|
|
16
|
+
db.exec('PRAGMA busy_timeout=0; BEGIN EXCLUSIVE;');
|
|
17
|
+
this.db = db;
|
|
18
|
+
}
|
|
19
|
+
catch (error) {
|
|
20
|
+
db.close();
|
|
21
|
+
if (error.errcode === 5)
|
|
22
|
+
throw new Error('Lucidity is already running for this configuration. Stop that daemon before starting another.');
|
|
23
|
+
throw error;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
close() {
|
|
27
|
+
if (!this.db)
|
|
28
|
+
return;
|
|
29
|
+
this.db.close();
|
|
30
|
+
this.db = undefined;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { type GoalCandidate, type GoalCheck, type GoalDetail, type GoalEvidence } from '@lucidity/shared';
|
|
2
|
+
/** Keep stored evidence intact; send a bounded, explicitly partial view to the model. */
|
|
3
|
+
export declare function goalAssessmentInput(input: {
|
|
4
|
+
detail: GoalDetail;
|
|
5
|
+
period: Pick<GoalCheck, 'cadence' | 'key' | 'start' | 'end'>;
|
|
6
|
+
sources: GoalCandidate[];
|
|
7
|
+
evidence: GoalEvidence[];
|
|
8
|
+
complete: boolean;
|
|
9
|
+
}): {
|
|
10
|
+
goal: {
|
|
11
|
+
title: string;
|
|
12
|
+
timeframe: {
|
|
13
|
+
start: string;
|
|
14
|
+
end: string;
|
|
15
|
+
precision: "custom" | "year" | "month" | "quarter";
|
|
16
|
+
timeZone: string;
|
|
17
|
+
};
|
|
18
|
+
status: "completed" | "archived" | "paused" | "active";
|
|
19
|
+
tracking: boolean;
|
|
20
|
+
reviews: ("weekly" | "monthly" | "yearly")[];
|
|
21
|
+
id: string;
|
|
22
|
+
revision: number;
|
|
23
|
+
createdAt: string;
|
|
24
|
+
updatedAt: string;
|
|
25
|
+
};
|
|
26
|
+
period: Pick<{
|
|
27
|
+
key: string;
|
|
28
|
+
cadence: "daily" | "weekly" | "monthly" | "yearly";
|
|
29
|
+
start: string;
|
|
30
|
+
end: string;
|
|
31
|
+
checkedAt: string;
|
|
32
|
+
signal: "unknown" | "moving" | "quiet";
|
|
33
|
+
summary: string;
|
|
34
|
+
evidence: {
|
|
35
|
+
key: string;
|
|
36
|
+
reference: {
|
|
37
|
+
kind: "project" | "task" | "habit" | "note";
|
|
38
|
+
id: string;
|
|
39
|
+
};
|
|
40
|
+
at: string;
|
|
41
|
+
kind: "task_completed" | "task_started" | "task_reopened" | "task_changed" | "habit_check_in" | "note_changed";
|
|
42
|
+
title: string | null;
|
|
43
|
+
available: boolean;
|
|
44
|
+
}[];
|
|
45
|
+
references: {
|
|
46
|
+
kind: "project" | "task" | "habit" | "note";
|
|
47
|
+
id: string;
|
|
48
|
+
}[];
|
|
49
|
+
timeframe: {
|
|
50
|
+
start: string;
|
|
51
|
+
end: string;
|
|
52
|
+
precision: "custom" | "year" | "month" | "quarter";
|
|
53
|
+
timeZone: string;
|
|
54
|
+
};
|
|
55
|
+
}, "end" | "start" | "key" | "cadence">;
|
|
56
|
+
sources: {
|
|
57
|
+
title: string;
|
|
58
|
+
description: string | null;
|
|
59
|
+
kind: "project" | "task" | "habit" | "note";
|
|
60
|
+
id: string;
|
|
61
|
+
updatedAt: string | null;
|
|
62
|
+
status: string | null;
|
|
63
|
+
projectId: string | null;
|
|
64
|
+
}[];
|
|
65
|
+
notes: {
|
|
66
|
+
kind: "project" | "task" | "habit" | "note";
|
|
67
|
+
id: string;
|
|
68
|
+
}[];
|
|
69
|
+
evidence: {
|
|
70
|
+
title: string | null;
|
|
71
|
+
key: string;
|
|
72
|
+
reference: {
|
|
73
|
+
kind: "project" | "task" | "habit" | "note";
|
|
74
|
+
id: string;
|
|
75
|
+
};
|
|
76
|
+
at: string;
|
|
77
|
+
kind: "task_completed" | "task_started" | "task_reopened" | "task_changed" | "habit_check_in" | "note_changed";
|
|
78
|
+
available: boolean;
|
|
79
|
+
}[];
|
|
80
|
+
priorChecks: {
|
|
81
|
+
key: string;
|
|
82
|
+
cadence: "daily" | "weekly" | "monthly" | "yearly";
|
|
83
|
+
start: string;
|
|
84
|
+
end: string;
|
|
85
|
+
signal: "unknown" | "moving" | "quiet";
|
|
86
|
+
summary: string;
|
|
87
|
+
timeframe: {
|
|
88
|
+
start: string;
|
|
89
|
+
end: string;
|
|
90
|
+
precision: "custom" | "year" | "month" | "quarter";
|
|
91
|
+
timeZone: string;
|
|
92
|
+
};
|
|
93
|
+
}[];
|
|
94
|
+
complete: boolean;
|
|
95
|
+
coverage: {
|
|
96
|
+
sources: {
|
|
97
|
+
provided: number;
|
|
98
|
+
total: number;
|
|
99
|
+
};
|
|
100
|
+
evidence: {
|
|
101
|
+
provided: number;
|
|
102
|
+
total: number;
|
|
103
|
+
};
|
|
104
|
+
priorChecks: {
|
|
105
|
+
provided: number;
|
|
106
|
+
total: number;
|
|
107
|
+
};
|
|
108
|
+
notes: {
|
|
109
|
+
provided: number;
|
|
110
|
+
total: number;
|
|
111
|
+
};
|
|
112
|
+
descriptionsAreExcerpts: boolean;
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
//# sourceMappingURL=assessment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assessment.d.ts","sourceRoot":"","sources":["../../src/goals/assessment.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,YAAY,EAClB,MAAM,kBAAkB,CAAC;AAc1B,yFAAyF;AACzF,wBAAgB,mBAAmB,CAAC,KAAK,EAAE;IACzC,MAAM,EAAE,UAAU,CAAC;IACnB,MAAM,EAAE,IAAI,CAAC,SAAS,EAAE,SAAS,GAAG,KAAK,GAAG,OAAO,GAAG,KAAK,CAAC,CAAC;IAC7D,OAAO,EAAE,aAAa,EAAE,CAAC;IACzB,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,QAAQ,EAAE,OAAO,CAAC;CACnB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8EA"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { goalReferenceKey, } from '@lucidity/shared';
|
|
2
|
+
function bounded(items, characters, count) {
|
|
3
|
+
const result = [];
|
|
4
|
+
let used = 2;
|
|
5
|
+
for (const item of items) {
|
|
6
|
+
const size = JSON.stringify(item).length + 1;
|
|
7
|
+
if (result.length >= count || used + size > characters)
|
|
8
|
+
break;
|
|
9
|
+
result.push(item);
|
|
10
|
+
used += size;
|
|
11
|
+
}
|
|
12
|
+
return result;
|
|
13
|
+
}
|
|
14
|
+
/** Keep stored evidence intact; send a bounded, explicitly partial view to the model. */
|
|
15
|
+
export function goalAssessmentInput(input) {
|
|
16
|
+
const { detail, period, complete } = input;
|
|
17
|
+
const direct = new Set(detail.links
|
|
18
|
+
.filter((link) => link.state === 'active')
|
|
19
|
+
.map(goalReferenceKey));
|
|
20
|
+
const dated = new Set(input.evidence.map((item) => goalReferenceKey(item.reference)));
|
|
21
|
+
const priority = (source) => direct.has(goalReferenceKey(source))
|
|
22
|
+
? 0
|
|
23
|
+
: dated.has(goalReferenceKey(source))
|
|
24
|
+
? 1
|
|
25
|
+
: 2;
|
|
26
|
+
const sources = bounded([...input.sources]
|
|
27
|
+
.sort((a, b) => priority(a) - priority(b) ||
|
|
28
|
+
(b.updatedAt ?? '').localeCompare(a.updatedAt ?? ''))
|
|
29
|
+
.map((source) => ({
|
|
30
|
+
...source,
|
|
31
|
+
title: source.title.slice(0, 240),
|
|
32
|
+
description: source.description?.slice(0, 600) ?? null,
|
|
33
|
+
})), 30_000, 100);
|
|
34
|
+
const evidence = bounded([...input.evidence]
|
|
35
|
+
.sort((a, b) => b.at.localeCompare(a.at))
|
|
36
|
+
.map((item) => ({ ...item, title: item.title?.slice(0, 240) ?? null })), 15_000, 100);
|
|
37
|
+
const priorChecks = bounded(detail.checks.slice(0, 14).map((check) => ({
|
|
38
|
+
key: check.key,
|
|
39
|
+
cadence: check.cadence,
|
|
40
|
+
start: check.start,
|
|
41
|
+
end: check.end,
|
|
42
|
+
signal: check.signal,
|
|
43
|
+
summary: check.summary.slice(0, 400),
|
|
44
|
+
timeframe: check.timeframe,
|
|
45
|
+
})), 6_000, 14);
|
|
46
|
+
const allNotes = detail.links.filter((link) => link.kind === 'note' && link.state === 'active');
|
|
47
|
+
const notes = bounded(allNotes.map(({ kind, id }) => ({ kind, id })), 3_000, 40);
|
|
48
|
+
return {
|
|
49
|
+
goal: detail.goal,
|
|
50
|
+
period,
|
|
51
|
+
sources,
|
|
52
|
+
notes,
|
|
53
|
+
evidence,
|
|
54
|
+
priorChecks,
|
|
55
|
+
complete,
|
|
56
|
+
coverage: {
|
|
57
|
+
sources: { provided: sources.length, total: input.sources.length },
|
|
58
|
+
evidence: { provided: evidence.length, total: input.evidence.length },
|
|
59
|
+
priorChecks: {
|
|
60
|
+
provided: priorChecks.length,
|
|
61
|
+
total: detail.checks.length,
|
|
62
|
+
},
|
|
63
|
+
notes: { provided: notes.length, total: allNotes.length },
|
|
64
|
+
descriptionsAreExcerpts: true,
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type GoalCandidate } from '@lucidity/shared';
|
|
2
|
+
export interface GoalNote extends GoalCandidate {
|
|
3
|
+
kind: 'note';
|
|
4
|
+
path: string;
|
|
5
|
+
content: string;
|
|
6
|
+
}
|
|
7
|
+
export interface GoalNotes {
|
|
8
|
+
list(): {
|
|
9
|
+
notes: GoalNote[];
|
|
10
|
+
complete: boolean;
|
|
11
|
+
};
|
|
12
|
+
link(note: GoalNote): void;
|
|
13
|
+
read(id: string): GoalNote;
|
|
14
|
+
saveDraft(id: string, markdown: string): void;
|
|
15
|
+
}
|
|
16
|
+
/** Paths and note text never leave this computer for the hosted Goals API. */
|
|
17
|
+
export declare function createGoalNotes(root: string | undefined): GoalNotes | undefined;
|
|
18
|
+
//# sourceMappingURL=notes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notes.d.ts","sourceRoot":"","sources":["../../src/goals/notes.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,aAAa,EACnB,MAAM,kBAAkB,CAAC;AAE1B,MAAM,WAAW,QAAS,SAAQ,aAAa;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AACD,MAAM,WAAW,SAAS;IACxB,IAAI,IAAI;QAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAA;KAAE,CAAC;IACjD,IAAI,CAAC,IAAI,EAAE,QAAQ,GAAG,IAAI,CAAC;IAC3B,IAAI,CAAC,EAAE,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC3B,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/C;AAED,8EAA8E;AAC9E,wBAAgB,eAAe,CAC7B,IAAI,EAAE,MAAM,GAAG,SAAS,GACvB,SAAS,GAAG,SAAS,CAgEvB"}
|