@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/src/vault.ts
CHANGED
|
@@ -24,9 +24,9 @@ export interface Vault {
|
|
|
24
24
|
/** SOUL.md if present (and non-empty), else the packaged default — seeding SOUL.md so it's editable. */
|
|
25
25
|
readPersona(): string;
|
|
26
26
|
/** Durable facts from MEMORY.md (empty if absent/malformed). */
|
|
27
|
-
readMemoryFacts(): string[];
|
|
28
|
-
writeMemoryFacts(facts: string[]): void;
|
|
29
|
-
writeSessionLog(entry: SessionEntry): void;
|
|
27
|
+
readMemoryFacts(strict?: boolean): string[];
|
|
28
|
+
writeMemoryFacts(facts: string[], strict?: boolean): void;
|
|
29
|
+
writeSessionLog(entry: SessionEntry, receipt?: { id: string; strict: boolean }): void;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
function msg(err: unknown): string {
|
|
@@ -56,26 +56,28 @@ export function createVault(vaultPath: string): Vault {
|
|
|
56
56
|
return def;
|
|
57
57
|
},
|
|
58
58
|
|
|
59
|
-
readMemoryFacts(): string[] {
|
|
59
|
+
readMemoryFacts(strict = false): string[] {
|
|
60
60
|
if (!existsSync(memoryPath)) return [];
|
|
61
61
|
try {
|
|
62
62
|
return parseFacts(readFileSync(memoryPath, 'utf8'));
|
|
63
63
|
} catch (err) {
|
|
64
|
+
if (strict) throw err;
|
|
64
65
|
console.error(`[vault] could not read MEMORY.md: ${msg(err)}`);
|
|
65
66
|
return [];
|
|
66
67
|
}
|
|
67
68
|
},
|
|
68
69
|
|
|
69
|
-
writeMemoryFacts(facts: string[]): void {
|
|
70
|
+
writeMemoryFacts(facts: string[], strict = false): void {
|
|
70
71
|
try {
|
|
71
72
|
mkdirSync(vaultPath, { recursive: true });
|
|
72
73
|
writeFileSync(memoryPath, renderMemoryFile(facts), 'utf8');
|
|
73
74
|
} catch (err) {
|
|
75
|
+
if (strict) throw err;
|
|
74
76
|
console.error(`[vault] could not write MEMORY.md: ${msg(err)}`);
|
|
75
77
|
}
|
|
76
78
|
},
|
|
77
79
|
|
|
78
|
-
writeSessionLog(entry: SessionEntry): void {
|
|
80
|
+
writeSessionLog(entry: SessionEntry, receipt?: { id: string; strict: boolean }): void {
|
|
79
81
|
try {
|
|
80
82
|
mkdirSync(sessionsDir, { recursive: true });
|
|
81
83
|
const kind = entry.kind ?? 'briefing';
|
|
@@ -88,8 +90,15 @@ export function createVault(vaultPath: string): Vault {
|
|
|
88
90
|
`Delivered via: ${entry.deliveredVia}\n\n` +
|
|
89
91
|
`## Message\n\n${entry.body.trim()}\n\n` +
|
|
90
92
|
`## Facts learned\n\n${facts}\n`;
|
|
91
|
-
|
|
93
|
+
if (receipt && !/^[a-zA-Z0-9-]+$/.test(receipt.id)) throw new Error('Invalid session receipt ID');
|
|
94
|
+
const path = join(sessionsDir, `${receipt?.id ?? stamp}-${kind}.md`);
|
|
95
|
+
if (receipt && existsSync(path)) {
|
|
96
|
+
if (readFileSync(path, 'utf8') !== content) throw new Error('The saved briefing was changed outside this run.');
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
writeFileSync(path, content, { encoding: 'utf8', flag: receipt ? 'wx' : 'w' });
|
|
92
100
|
} catch (err) {
|
|
101
|
+
if (receipt?.strict) throw err;
|
|
93
102
|
console.error(`[vault] could not write session log: ${msg(err)}`);
|
|
94
103
|
}
|
|
95
104
|
},
|
|
@@ -8,6 +8,7 @@ import { registerTaskTrashTools } from './tools/taskTrash.js';
|
|
|
8
8
|
import { registerTaskOccurrenceTools } from './tools/taskOccurrences.js';
|
|
9
9
|
import { setClientNameReader } from './client.js';
|
|
10
10
|
import { registerProjectTools } from './tools/projects.js';
|
|
11
|
+
import { registerGoalTools } from './tools/goals.js';
|
|
11
12
|
import { registerQueryTools } from './tools/queries.js';
|
|
12
13
|
import { registerMilestoneTools } from './tools/milestones.js';
|
|
13
14
|
import { registerCommentTools } from './tools/comments.js';
|
|
@@ -31,6 +32,7 @@ registerTaskActivityTools(server);
|
|
|
31
32
|
registerTaskTrashTools(server);
|
|
32
33
|
registerTaskOccurrenceTools(server);
|
|
33
34
|
registerProjectTools(server);
|
|
35
|
+
registerGoalTools(server);
|
|
34
36
|
registerQueryTools(server);
|
|
35
37
|
registerMilestoneTools(server);
|
|
36
38
|
registerCommentTools(server);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"goals.d.ts","sourceRoot":"","sources":["../../src/tools/goals.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAWzE,6EAA6E;AAC7E,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,QAiDlD"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { z } from '#lucidity-zod';
|
|
2
|
+
import { apiRequest } from '../client.js';
|
|
3
|
+
/** Discussion can inspect goals; it cannot approve its own proposed work. */
|
|
4
|
+
export function registerGoalTools(server) {
|
|
5
|
+
const annotations = {
|
|
6
|
+
readOnlyHint: true,
|
|
7
|
+
destructiveHint: false,
|
|
8
|
+
idempotentHint: true,
|
|
9
|
+
openWorldHint: false,
|
|
10
|
+
};
|
|
11
|
+
server.tool('list_goals', 'List personal goals, their timeframes and latest dated observations. Missing checks do not mean inactivity.', {}, annotations, async () => {
|
|
12
|
+
const result = await apiRequest('/api/goals');
|
|
13
|
+
return {
|
|
14
|
+
content: [
|
|
15
|
+
{
|
|
16
|
+
type: 'text',
|
|
17
|
+
text: JSON.stringify(result.goals.map(({ goal, checks }) => ({
|
|
18
|
+
goal,
|
|
19
|
+
latestCheck: checks.find((check) => check.cadence === 'daily') ?? null,
|
|
20
|
+
}))),
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
};
|
|
24
|
+
});
|
|
25
|
+
server.tool('get_goal', 'Read one personal goal with linked sources, evidence, reviews and draft proposals. Work must be approved in the app; a context link is not permission to act.', { id: z.string().uuid() }, annotations, async ({ id }) => {
|
|
26
|
+
const result = await apiRequest('/api/goals');
|
|
27
|
+
const goal = result.goals.find((detail) => detail.goal.id === id);
|
|
28
|
+
return {
|
|
29
|
+
content: [
|
|
30
|
+
{
|
|
31
|
+
type: 'text',
|
|
32
|
+
text: goal ? JSON.stringify(goal) : 'Goal not found.',
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
isError: !goal,
|
|
36
|
+
};
|
|
37
|
+
});
|
|
38
|
+
}
|
|
@@ -9,6 +9,7 @@ import { registerTaskTrashTools } from './tools/taskTrash.js';
|
|
|
9
9
|
import { registerTaskOccurrenceTools } from './tools/taskOccurrences.js';
|
|
10
10
|
import { setClientNameReader } from './client.js';
|
|
11
11
|
import { registerProjectTools } from './tools/projects.js';
|
|
12
|
+
import { registerGoalTools } from './tools/goals.js';
|
|
12
13
|
import { registerQueryTools } from './tools/queries.js';
|
|
13
14
|
import { registerMilestoneTools } from './tools/milestones.js';
|
|
14
15
|
import { registerCommentTools } from './tools/comments.js';
|
|
@@ -41,6 +42,7 @@ registerTaskActivityTools(server);
|
|
|
41
42
|
registerTaskTrashTools(server);
|
|
42
43
|
registerTaskOccurrenceTools(server);
|
|
43
44
|
registerProjectTools(server);
|
|
45
|
+
registerGoalTools(server);
|
|
44
46
|
registerQueryTools(server);
|
|
45
47
|
registerMilestoneTools(server);
|
|
46
48
|
registerCommentTools(server);
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
+
import { z } from '#lucidity-zod';
|
|
3
|
+
import { apiRequest } from '../client.js';
|
|
4
|
+
// This independently published package keeps its small API projection local.
|
|
5
|
+
interface GoalsSnapshot {
|
|
6
|
+
goals: {
|
|
7
|
+
goal: { id: string; [key: string]: unknown };
|
|
8
|
+
checks: { cadence: string; [key: string]: unknown }[];
|
|
9
|
+
}[];
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/** Discussion can inspect goals; it cannot approve its own proposed work. */
|
|
13
|
+
export function registerGoalTools(server: McpServer) {
|
|
14
|
+
const annotations = {
|
|
15
|
+
readOnlyHint: true,
|
|
16
|
+
destructiveHint: false,
|
|
17
|
+
idempotentHint: true,
|
|
18
|
+
openWorldHint: false,
|
|
19
|
+
};
|
|
20
|
+
server.tool(
|
|
21
|
+
'list_goals',
|
|
22
|
+
'List personal goals, their timeframes and latest dated observations. Missing checks do not mean inactivity.',
|
|
23
|
+
{},
|
|
24
|
+
annotations,
|
|
25
|
+
async () => {
|
|
26
|
+
const result = await apiRequest<GoalsSnapshot>('/api/goals');
|
|
27
|
+
return {
|
|
28
|
+
content: [
|
|
29
|
+
{
|
|
30
|
+
type: 'text' as const,
|
|
31
|
+
text: JSON.stringify(
|
|
32
|
+
result.goals.map(({ goal, checks }) => ({
|
|
33
|
+
goal,
|
|
34
|
+
latestCheck:
|
|
35
|
+
checks.find((check) => check.cadence === 'daily') ?? null,
|
|
36
|
+
})),
|
|
37
|
+
),
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
};
|
|
41
|
+
},
|
|
42
|
+
);
|
|
43
|
+
server.tool(
|
|
44
|
+
'get_goal',
|
|
45
|
+
'Read one personal goal with linked sources, evidence, reviews and draft proposals. Work must be approved in the app; a context link is not permission to act.',
|
|
46
|
+
{ id: z.string().uuid() },
|
|
47
|
+
annotations,
|
|
48
|
+
async ({ id }) => {
|
|
49
|
+
const result = await apiRequest<GoalsSnapshot>('/api/goals');
|
|
50
|
+
const goal = result.goals.find((detail) => detail.goal.id === id);
|
|
51
|
+
return {
|
|
52
|
+
content: [
|
|
53
|
+
{
|
|
54
|
+
type: 'text' as const,
|
|
55
|
+
text: goal ? JSON.stringify(goal) : 'Goal not found.',
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
isError: !goal,
|
|
59
|
+
};
|
|
60
|
+
},
|
|
61
|
+
);
|
|
62
|
+
}
|
package/vendor/runtime/README.md
CHANGED
|
@@ -17,9 +17,9 @@ The runtime just turns data into prompts and runs them through an executor.
|
|
|
17
17
|
|
|
18
18
|
**Executor seam** — the boundary between prompt assembly and the model engine:
|
|
19
19
|
- `AgentExecutor`: buffered/streamed runs, active-turn correction, model discovery, and disposal.
|
|
20
|
-
- `ClaudeAgentExecutor`: pinned Agent SDK 0.3.
|
|
20
|
+
- `ClaudeAgentExecutor`: pinned Agent SDK 0.3.287 and its bundled runtime, with subscription
|
|
21
21
|
authentication, streaming input, cancellation, and tool permissions.
|
|
22
|
-
- `CodexExecutor`: pinned Codex 0.
|
|
22
|
+
- `CodexExecutor`: pinned Codex 0.160.0 App Server over local stdio, with ChatGPT login,
|
|
23
23
|
generated protocol types, thread resume, steering, interruption, and scoped MCP tools.
|
|
24
24
|
- `HealthAwareExecutor`: observes authentication and inference failures on the same adapters
|
|
25
25
|
used for interactive and scheduled work. Catalog success leaves allowance unknown;
|
|
@@ -71,3 +71,37 @@ regenerate with `node scripts/generate-codex-protocol.mjs`, and run the pin chec
|
|
|
71
71
|
and authenticated provider smoke checks. Keep changes reviewable in one PR. Never regenerate
|
|
72
72
|
against a PATH-selected Codex. Model availability, shared login state, and provider-side behavior
|
|
73
73
|
can still change independently of the local package pin.
|
|
74
|
+
|
|
75
|
+
## Restart inspection
|
|
76
|
+
|
|
77
|
+
Adapters expose `recoveryCapability`, `inspect(ref, { cwd, timeoutMs })`, and a
|
|
78
|
+
synchronous `onRecovery` callback on executions. The callback persists native
|
|
79
|
+
session/thread, turn and process identifiers before execution continues. Tool
|
|
80
|
+
events retain native item IDs and outcomes when the provider supplies them.
|
|
81
|
+
`inspect` never starts inference or runs a tool.
|
|
82
|
+
|
|
83
|
+
- Codex 0.160.0 supports `native-turn`: a fresh App Server connection uses
|
|
84
|
+
`thread/read`, matches the exact saved thread and turn, requires a completed
|
|
85
|
+
turn with full items, and recovers its final answer. An active thread, partial
|
|
86
|
+
items, missing turn, timeout, authentication problem or unreadable history stays
|
|
87
|
+
unknown. Native command turns are excluded from this recovery path.
|
|
88
|
+
- Claude Agent SDK 0.3.287 supports `completion-receipt`: Lucidity persists the
|
|
89
|
+
successful native result before publishing it. The pinned SDK's session-message
|
|
90
|
+
history does not expose a durable terminal run result, so native history alone
|
|
91
|
+
cannot recover the gap before this receipt. Its inspector explicitly reports
|
|
92
|
+
that limitation. A session ID or partial assistant message is never completion
|
|
93
|
+
evidence.
|
|
94
|
+
|
|
95
|
+
The daemon wraps ordinary streaming Ask and Code turns in `RecoveryExecutor`.
|
|
96
|
+
Structured planning results still require their normal consumer validation, and
|
|
97
|
+
host-controlled briefing steps use `SavedWorkflow`. Startup reconciliation happens
|
|
98
|
+
under the daemon lease before queue admission. A surviving prior owner/native
|
|
99
|
+
process prevents a replacement from starting work. Proven answers flow through the
|
|
100
|
+
ordered event log once. Already-terminal uncertain runs retain their original
|
|
101
|
+
terminal and receive a linked reconciliation record for review.
|
|
102
|
+
|
|
103
|
+
Verification on 6 October 2026: runtime regressions and process-kill fixtures cover
|
|
104
|
+
both capabilities; live Codex inspection recovered a native answer without a new
|
|
105
|
+
inference. Live Claude validation was blocked because `claude auth status` reported
|
|
106
|
+
`loggedIn: false` and no configured OAuth token authenticated the SDK. Rerun that
|
|
107
|
+
live check after subscription sign-in; this does not authorize API-key billing.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asyncQueue.d.ts","sourceRoot":"","sources":["../../src/executor/asyncQueue.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,qBAAa,UAAU,CAAC,CAAC,CAAE,YAAW,aAAa,CAAC,CAAC,CAAC;IACpD,OAAO,CAAC,KAAK,CAAW;IACxB,OAAO,CAAC,IAAI,CAAC,CAAa;IAC1B,OAAO,CAAC,KAAK,CAAS;IACtB,OAAO,CAAC,KAAK,CAAC,CAAQ;IAEtB,IAAI,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI;IAKnB,GAAG,CAAC,KAAK,CAAC,EAAE,KAAK,GAAG,IAAI;
|
|
1
|
+
{"version":3,"file":"asyncQueue.d.ts","sourceRoot":"","sources":["../../src/executor/asyncQueue.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,qBAAa,UAAU,CAAC,CAAC,CAAE,YAAW,aAAa,CAAC,CAAC,CAAC;IACpD,OAAO,CAAC,KAAK,CAAW;IACxB,OAAO,CAAC,IAAI,CAAC,CAAa;IAC1B,OAAO,CAAC,KAAK,CAAS;IACtB,OAAO,CAAC,KAAK,CAAC,CAAQ;IAEtB,IAAI,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI;IAKnB,GAAG,CAAC,KAAK,CAAC,EAAE,KAAK,GAAG,IAAI;IAKxB,cAAc,IAAI,IAAI;IAGf,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,cAAc,CAAC,CAAC,CAAC;CAenD"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type AgentCommandOption } from '@lucidity/shared';
|
|
2
2
|
import { query, type Options, type AccountInfo } from '@anthropic-ai/claude-agent-sdk';
|
|
3
3
|
import type { AgentExecutor, ExecutorRunInput, ExecutorStreamEvent, ExecutorResult, ExecutorModel } from './types.js';
|
|
4
|
-
export declare const CLAUDE_AGENT_SDK_VERSION = "0.3.
|
|
4
|
+
export declare const CLAUDE_AGENT_SDK_VERSION = "0.3.287";
|
|
5
5
|
export declare function claudeSubscriptionEnv(oauthToken?: string): NodeJS.ProcessEnv;
|
|
6
6
|
export declare function claudeAgentOptions(input: ExecutorRunInput, oauthToken?: string): Options;
|
|
7
7
|
/** Check resolved authentication after settings load, before sending any prompt. */
|
|
@@ -11,10 +11,14 @@ export declare class ClaudeAgentExecutor implements AgentExecutor {
|
|
|
11
11
|
private readonly options;
|
|
12
12
|
readonly name = "claude-agent-sdk";
|
|
13
13
|
readonly strictResume = true;
|
|
14
|
+
readonly recoveryCapability = "completion-receipt";
|
|
15
|
+
inspect(): Promise<import('./types.js').ProviderInspection>;
|
|
14
16
|
private readonly turns;
|
|
15
17
|
constructor(options?: {
|
|
16
18
|
oauthToken?: string;
|
|
17
19
|
query?: typeof query;
|
|
20
|
+
/** How long to wait for a closing loop after the last background task ends. */
|
|
21
|
+
backgroundGraceMs?: number;
|
|
18
22
|
});
|
|
19
23
|
steer(requestId: string, text: string): Promise<void>;
|
|
20
24
|
interrupt(requestId: string): Promise<boolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claudeAgent.d.ts","sourceRoot":"","sources":["../../src/executor/claudeAgent.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,kBAAkB,EACxB,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"claudeAgent.d.ts","sourceRoot":"","sources":["../../src/executor/claudeAgent.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,kBAAkB,EACxB,MAAM,kBAAkB,CAAC;AAI1B,OAAO,EACL,KAAK,EACL,KAAK,OAAO,EAGZ,KAAK,WAAW,EACjB,MAAM,gCAAgC,CAAC;AAIxC,OAAO,KAAK,EACV,aAAa,EACb,gBAAgB,EAChB,mBAAmB,EACnB,cAAc,EACd,aAAa,EACd,MAAM,YAAY,CAAC;AAEpB,eAAO,MAAM,wBAAwB,YAAY,CAAC;AAIlD,wBAAgB,qBAAqB,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,UAAU,CAa5E;AA4BD,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,gBAAgB,EACvB,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CA8ET;AAED,oFAAoF;AACpF,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,CAuBpE;AAmBD,mFAAmF;AACnF,qBAAa,mBAAoB,YAAW,aAAa;IASrD,OAAO,CAAC,QAAQ,CAAC,OAAO;IAR1B,QAAQ,CAAC,IAAI,sBAAsB;IACnC,QAAQ,CAAC,YAAY,QAAQ;IAC7B,QAAQ,CAAC,kBAAkB,wBAAwB;IAC7C,OAAO,IAAI,OAAO,CAAC,OAAO,YAAY,EAAE,kBAAkB,CAAC;IAGjE,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAmB;gBAEtB,OAAO,GAAE;QACxB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;QACrB,+EAA+E;QAC/E,iBAAiB,CAAC,EAAE,MAAM,CAAC;KACvB;IAGR,KAAK,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;IAG/B,SAAS,CAAC,SAAS,EAAE,MAAM;IAG3B,OAAO;IAIb,gFAAgF;IAC1E,MAAM,IAAI,OAAO,CAAC,aAAa,EAAE,CAAC;IA2ClC,QAAQ,CAAC,KAAK,GAAE,IAAI,CAAC,gBAAgB,EAAE,KAAK,GAAG,gBAAgB,GAAG,KAAK,CAAM,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC;IAiC7G,GAAG,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,cAAc,CAAC;IAMpD,SAAS,CACd,KAAK,EAAE,gBAAgB,GACtB,aAAa,CAAC,mBAAmB,CAAC;CAmMtC"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { findAgentCommand, parseAgentCommand, } from '@lucidity/shared';
|
|
2
2
|
import { randomUUID } from 'node:crypto';
|
|
3
|
+
import { spawn } from 'node:child_process';
|
|
3
4
|
import { readFileSync } from 'node:fs';
|
|
4
5
|
import { query, } from '@anthropic-ai/claude-agent-sdk';
|
|
5
6
|
import { stripUnsafeEnv } from './claudeCode.js';
|
|
6
7
|
import { AsyncQueue } from './asyncQueue.js';
|
|
7
8
|
import { LiveTurns } from './liveTurns.js';
|
|
8
|
-
export const CLAUDE_AGENT_SDK_VERSION = '0.3.
|
|
9
|
+
export const CLAUDE_AGENT_SDK_VERSION = '0.3.287';
|
|
9
10
|
const INTERACTIVE_TOOLS = ['AskUserQuestion', 'EnterPlanMode', 'ExitPlanMode'];
|
|
10
11
|
const WRITE_TOOLS = ['Bash', 'Write', 'Edit', 'NotebookEdit'];
|
|
11
12
|
export function claudeSubscriptionEnv(oauthToken) {
|
|
@@ -54,7 +55,7 @@ export function claudeAgentOptions(input, oauthToken) {
|
|
|
54
55
|
: {};
|
|
55
56
|
return {
|
|
56
57
|
cwd: input.cwd,
|
|
57
|
-
env: claudeSubscriptionEnv(oauthToken),
|
|
58
|
+
env: { ...claudeSubscriptionEnv(oauthToken), ...input.env },
|
|
58
59
|
model: input.model,
|
|
59
60
|
effort: input.effort,
|
|
60
61
|
outputFormat: input.outputSchema ? { type: 'json_schema', schema: input.outputSchema } : undefined,
|
|
@@ -152,6 +153,10 @@ export class ClaudeAgentExecutor {
|
|
|
152
153
|
options;
|
|
153
154
|
name = 'claude-agent-sdk';
|
|
154
155
|
strictResume = true;
|
|
156
|
+
recoveryCapability = 'completion-receipt';
|
|
157
|
+
async inspect() {
|
|
158
|
+
return { status: 'unsupported', reason: 'Claude SDK 0.3.287 history contains messages, not a durable run-completion receipt. Partial text cannot establish completion.' };
|
|
159
|
+
}
|
|
155
160
|
turns = new LiveTurns();
|
|
156
161
|
constructor(options = {}) {
|
|
157
162
|
this.options = options;
|
|
@@ -163,7 +168,7 @@ export class ClaudeAgentExecutor {
|
|
|
163
168
|
return this.turns.interrupt(requestId);
|
|
164
169
|
}
|
|
165
170
|
async dispose() {
|
|
166
|
-
this.turns.dispose();
|
|
171
|
+
await this.turns.dispose();
|
|
167
172
|
}
|
|
168
173
|
/** Start the SDK control channel without ever supplying an inference prompt. */
|
|
169
174
|
async models() {
|
|
@@ -202,6 +207,7 @@ export class ClaudeAgentExecutor {
|
|
|
202
207
|
incoming.end();
|
|
203
208
|
abortController.abort();
|
|
204
209
|
active.close();
|
|
210
|
+
await active.return();
|
|
205
211
|
}
|
|
206
212
|
}
|
|
207
213
|
async commands(input = {}) {
|
|
@@ -231,6 +237,7 @@ export class ClaudeAgentExecutor {
|
|
|
231
237
|
incoming.end();
|
|
232
238
|
abortController.abort();
|
|
233
239
|
active.close();
|
|
240
|
+
await active.return();
|
|
234
241
|
}
|
|
235
242
|
}
|
|
236
243
|
async run(input) {
|
|
@@ -254,6 +261,12 @@ export class ClaudeAgentExecutor {
|
|
|
254
261
|
let ended = false;
|
|
255
262
|
let ready = false;
|
|
256
263
|
const pending = new Set();
|
|
264
|
+
// Sub-agents and background commands outlive the loop that started them. The turn stays
|
|
265
|
+
// open while any are live, and `carried` holds what Claude said before they reported back.
|
|
266
|
+
let background = 0;
|
|
267
|
+
const carried = [];
|
|
268
|
+
let carriedSession = '';
|
|
269
|
+
let grace;
|
|
257
270
|
const owner = this.turns.open(input, async (text) => {
|
|
258
271
|
if (command)
|
|
259
272
|
throw new Error('Wait for the command to finish before sending a message.');
|
|
@@ -272,6 +285,18 @@ export class ClaudeAgentExecutor {
|
|
|
272
285
|
options: {
|
|
273
286
|
...claudeAgentOptions(input, this.options.oauthToken),
|
|
274
287
|
abortController: owner.controller,
|
|
288
|
+
...(input.onRecovery ? { spawnClaudeCodeProcess: (options) => {
|
|
289
|
+
const child = spawn(options.command, options.args, { cwd: options.cwd, env: options.env, signal: options.signal, stdio: ['pipe', 'pipe', 'pipe'] });
|
|
290
|
+
child.stderr.on('data', () => { });
|
|
291
|
+
try {
|
|
292
|
+
input.onRecovery({ pid: child.pid });
|
|
293
|
+
}
|
|
294
|
+
catch (error) {
|
|
295
|
+
child.kill('SIGKILL');
|
|
296
|
+
throw error;
|
|
297
|
+
}
|
|
298
|
+
return child;
|
|
299
|
+
} } : {}),
|
|
275
300
|
},
|
|
276
301
|
});
|
|
277
302
|
requireClaudeSubscription(await active.accountInfo());
|
|
@@ -287,12 +312,27 @@ export class ClaudeAgentExecutor {
|
|
|
287
312
|
});
|
|
288
313
|
yield { type: 'tool_call', name: `/${commandName}`, phase: 'start' };
|
|
289
314
|
}
|
|
315
|
+
input.onRecovery?.({ turnId: initial.uuid, inspectionDisabled: !!command });
|
|
290
316
|
incoming.push(initial);
|
|
291
317
|
ready = true;
|
|
292
318
|
for await (const event of active) {
|
|
293
319
|
owner.check();
|
|
294
|
-
if (event.type === 'system' && event.subtype === '
|
|
320
|
+
if (event.type === 'system' && event.subtype === 'background_tasks_changed') {
|
|
321
|
+
background = event.tasks.filter((task) => !task.ambient).length;
|
|
322
|
+
// Finished work normally starts another loop. If none follows (a task was stopped,
|
|
323
|
+
// say), close the input so the query ends and the turn settles with what it has.
|
|
324
|
+
if (!background && carried.length && !grace)
|
|
325
|
+
grace = setTimeout(() => incoming.end(), this.options.backgroundGraceMs ?? 90_000);
|
|
326
|
+
continue;
|
|
327
|
+
}
|
|
328
|
+
if (grace) {
|
|
329
|
+
clearTimeout(grace);
|
|
330
|
+
grace = undefined;
|
|
331
|
+
}
|
|
332
|
+
if (event.type === 'system' && event.subtype === 'init') {
|
|
333
|
+
input.onRecovery?.({ sessionId: event.session_id });
|
|
295
334
|
yield { type: 'session', sessionId: event.session_id };
|
|
335
|
+
}
|
|
296
336
|
if (event.type === 'system' &&
|
|
297
337
|
event.subtype === 'local_command_output' &&
|
|
298
338
|
command) {
|
|
@@ -316,6 +356,7 @@ export class ClaudeAgentExecutor {
|
|
|
316
356
|
type: 'tool_call',
|
|
317
357
|
name: e.content_block.name,
|
|
318
358
|
phase: 'start',
|
|
359
|
+
itemId: e.content_block.id,
|
|
319
360
|
};
|
|
320
361
|
}
|
|
321
362
|
}
|
|
@@ -325,23 +366,35 @@ export class ClaudeAgentExecutor {
|
|
|
325
366
|
if (block.type === 'tool_result') {
|
|
326
367
|
const name = toolNames.get(block.tool_use_id);
|
|
327
368
|
if (name) {
|
|
328
|
-
yield { type: 'tool_call', name, phase: 'end' };
|
|
369
|
+
yield { type: 'tool_call', name, phase: 'end', itemId: block.tool_use_id, outcome: block.is_error ? 'failed' : 'completed' };
|
|
329
370
|
toolNames.delete(block.tool_use_id);
|
|
330
371
|
}
|
|
331
372
|
}
|
|
332
373
|
}
|
|
333
374
|
else if (event.type === 'result') {
|
|
375
|
+
// A priority correction interrupts the old native loop before its own loop
|
|
376
|
+
// starts. The pinned SDK reports this intermediate result before echoing
|
|
377
|
+
// the queued correction. Drain it without turning it into a Lucidity terminal.
|
|
378
|
+
if (pending.size && event.subtype === 'error_during_execution' &&
|
|
379
|
+
event.errors.length === 1 &&
|
|
380
|
+
event.errors[0] === '[ede_diagnostic] result_type=user last_content_type=n/a stop_reason=null')
|
|
381
|
+
continue;
|
|
334
382
|
if (event.subtype !== 'success' || event.is_error) {
|
|
335
|
-
throw new Error((
|
|
336
|
-
|
|
337
|
-
? event.result
|
|
338
|
-
: event.errors.join('\n'))) ||
|
|
339
|
-
`Claude could not complete the turn (${event.subtype}). Check subscription access and usage limits.`);
|
|
383
|
+
throw new Error((event.subtype === 'success' ? event.result : event.errors.join('\n')) ||
|
|
384
|
+
`Claude turn ended with ${event.subtype}.`);
|
|
340
385
|
}
|
|
341
386
|
// A late priority message may become a subsequent loop in this same SDK
|
|
342
387
|
// query. Keep consuming until its echoed user message and result arrive.
|
|
343
388
|
if (pending.size)
|
|
344
389
|
continue;
|
|
390
|
+
// Closing the query now would kill the work still running, and its report would
|
|
391
|
+
// never reach the phone. Claude continues in a later loop of this same query.
|
|
392
|
+
if (background > 0 && !input.outputSchema && !command) {
|
|
393
|
+
if (event.result.trim())
|
|
394
|
+
carried.push(event.result.trim());
|
|
395
|
+
carriedSession = event.session_id;
|
|
396
|
+
continue;
|
|
397
|
+
}
|
|
345
398
|
if (input.outputSchema && event.structured_output === undefined)
|
|
346
399
|
throw new Error('Claude did not return the requested structured result.');
|
|
347
400
|
ended = true;
|
|
@@ -350,7 +403,7 @@ export class ClaudeAgentExecutor {
|
|
|
350
403
|
yield {
|
|
351
404
|
type: 'done',
|
|
352
405
|
text: (input.outputSchema ? JSON.stringify(event.structured_output) : '') ||
|
|
353
|
-
event.result.trim() ||
|
|
406
|
+
[...carried, event.result.trim()].filter(Boolean).join('\n\n') ||
|
|
354
407
|
commandOutput.trim() ||
|
|
355
408
|
(compacted
|
|
356
409
|
? 'Conversation compacted. You can continue here.'
|
|
@@ -366,6 +419,11 @@ export class ClaudeAgentExecutor {
|
|
|
366
419
|
}
|
|
367
420
|
}
|
|
368
421
|
owner.check();
|
|
422
|
+
if (carried.length) {
|
|
423
|
+
ended = true;
|
|
424
|
+
yield { type: 'done', text: carried.join('\n\n'), sessionId: carriedSession };
|
|
425
|
+
return;
|
|
426
|
+
}
|
|
369
427
|
throw new Error('Claude disconnected before completing the turn.');
|
|
370
428
|
}
|
|
371
429
|
catch (error) {
|
|
@@ -376,9 +434,15 @@ export class ClaudeAgentExecutor {
|
|
|
376
434
|
}
|
|
377
435
|
finally {
|
|
378
436
|
ended = true;
|
|
437
|
+
clearTimeout(grace);
|
|
379
438
|
incoming.end();
|
|
380
|
-
|
|
381
|
-
|
|
439
|
+
try {
|
|
440
|
+
active?.close();
|
|
441
|
+
await active?.return();
|
|
442
|
+
}
|
|
443
|
+
finally {
|
|
444
|
+
owner.close();
|
|
445
|
+
}
|
|
382
446
|
}
|
|
383
447
|
}
|
|
384
448
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type AgentCommandOption } from '@lucidity/shared';
|
|
2
2
|
import { type CodexConnection } from './codexRpc.js';
|
|
3
|
-
import type { AgentExecutor, ExecutorRunInput, ExecutorStreamEvent, ExecutorModel, ExecutorResult } from './types.js';
|
|
3
|
+
import type { AgentExecutor, ExecutorRunInput, ExecutorStreamEvent, ExecutorModel, ExecutorResult, ProviderRunRef, ProviderInspection } from './types.js';
|
|
4
4
|
import type { ThreadStartParams } from './codexProtocol/v2/ThreadStartParams.js';
|
|
5
5
|
/** Override inherited tool integrations before starting any thread. */
|
|
6
6
|
export declare function codexRunConfig(input: ExecutorRunInput, inherited: Record<string, unknown>): NonNullable<ThreadStartParams['config']>;
|
|
@@ -8,12 +8,18 @@ export declare class CodexExecutor implements AgentExecutor {
|
|
|
8
8
|
private readonly options;
|
|
9
9
|
readonly name = "codex-app-server";
|
|
10
10
|
readonly strictResume = true;
|
|
11
|
+
readonly recoveryCapability = "native-turn";
|
|
11
12
|
private readonly turns;
|
|
13
|
+
private readonly sessions;
|
|
12
14
|
constructor(options?: {
|
|
13
15
|
command?: string;
|
|
14
|
-
connect?: (cwd?: string) => CodexConnection;
|
|
16
|
+
connect?: (cwd?: string, env?: Record<string, string>) => CodexConnection;
|
|
15
17
|
});
|
|
16
18
|
private connect;
|
|
19
|
+
inspect(ref: ProviderRunRef, options?: {
|
|
20
|
+
cwd?: string;
|
|
21
|
+
timeoutMs?: number;
|
|
22
|
+
}): Promise<ProviderInspection>;
|
|
17
23
|
steer(requestId: string, text: string): Promise<void>;
|
|
18
24
|
interrupt(requestId: string): Promise<boolean>;
|
|
19
25
|
dispose(): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codex.d.ts","sourceRoot":"","sources":["../../src/executor/codex.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,kBAAkB,EACxB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAGL,KAAK,eAAe,EAErB,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"codex.d.ts","sourceRoot":"","sources":["../../src/executor/codex.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,kBAAkB,EACxB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAGL,KAAK,eAAe,EAErB,MAAM,eAAe,CAAC;AAOvB,OAAO,KAAK,EACV,aAAa,EACb,gBAAgB,EAChB,mBAAmB,EACnB,aAAa,EACb,cAAc,EACd,cAAc,EACd,kBAAkB,EACnB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AA+BjF,uEAAuE;AACvE,wBAAgB,cAAc,CAC5B,KAAK,EAAE,gBAAgB,EACvB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACjC,WAAW,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC,CAmG1C;AAED,qBAAa,aAAc,YAAW,aAAa;IAO/C,OAAO,CAAC,QAAQ,CAAC,OAAO;IAN1B,QAAQ,CAAC,IAAI,sBAAsB;IACnC,QAAQ,CAAC,YAAY,QAAQ;IAC7B,QAAQ,CAAC,kBAAkB,iBAAiB;IAC5C,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAmB;IACzC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAuB;gBAE7B,OAAO,GAAE;QACxB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,eAAe,CAAC;KACtE;IAER,OAAO,CAAC,OAAO;IAKT,OAAO,CAAC,GAAG,EAAE,cAAc,EAAE,OAAO,GAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAO,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAiCnH,KAAK,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;IAG/B,SAAS,CAAC,SAAS,EAAE,MAAM;IAG3B,OAAO;IAIP,MAAM,IAAI,OAAO,CAAC,aAAa,EAAE,CAAC;IAgClC,QAAQ,CACZ,KAAK,GAAE,IAAI,CAAC,gBAAgB,EAAE,KAAK,GAAG,gBAAgB,CAAM,GAC3D,OAAO,CAAC,kBAAkB,EAAE,CAAC;IA2C1B,GAAG,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,cAAc,CAAC;IAMpD,SAAS,CACd,KAAK,EAAE,gBAAgB,GACtB,aAAa,CAAC,mBAAmB,CAAC;CAqZtC"}
|