@opencorelabs/lucidity 0.3.0 → 0.7.0
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 +18 -3
- package/dist/assets/speech/licenses/FluidAudio/LICENSE +201 -0
- package/dist/assets/speech/licenses/FluidAudio/ThirdPartyLicenses/fastcluster-LICENSE.md +11 -0
- package/dist/assets/speech/licenses/FluidAudio/ThirdPartyLicenses/vbx-LICENSE.md +201 -0
- package/dist/assets/speech/lucidity-speech +0 -0
- package/dist/automations/agent.d.ts +16 -0
- package/dist/automations/agent.d.ts.map +1 -0
- package/dist/automations/agent.js +196 -0
- package/dist/automations/cli.d.ts +4 -0
- package/dist/automations/cli.d.ts.map +1 -0
- package/dist/automations/cli.js +44 -0
- package/dist/automations/connections.d.ts +11 -0
- package/dist/automations/connections.d.ts.map +1 -0
- package/dist/automations/connections.js +74 -0
- package/dist/automations/designer.d.ts +39 -0
- package/dist/automations/designer.d.ts.map +1 -0
- package/dist/automations/designer.js +450 -0
- package/dist/automations/history.d.ts +4 -0
- package/dist/automations/history.d.ts.map +1 -0
- package/dist/automations/history.js +57 -0
- package/dist/automations/learning.d.ts +19 -0
- package/dist/automations/learning.d.ts.map +1 -0
- package/dist/automations/learning.js +121 -0
- package/dist/automations/pinterest.d.ts +21 -0
- package/dist/automations/pinterest.d.ts.map +1 -0
- package/dist/automations/pinterest.js +113 -0
- package/dist/automations/service.d.ts +42 -0
- package/dist/automations/service.d.ts.map +1 -0
- package/dist/automations/service.js +406 -0
- package/dist/automations/setup.d.ts +3 -0
- package/dist/automations/setup.d.ts.map +1 -0
- package/dist/automations/setup.js +48 -0
- package/dist/automations/skill.d.ts +3 -0
- package/dist/automations/skill.d.ts.map +1 -0
- package/dist/automations/skill.js +29 -0
- package/dist/automations/store.d.ts +13 -0
- package/dist/automations/store.d.ts.map +1 -0
- package/dist/automations/store.js +46 -0
- package/dist/chat/server.d.ts +2 -0
- package/dist/chat/server.d.ts.map +1 -1
- package/dist/chat/server.js +46 -2
- package/dist/coding/commandContext.d.ts +6 -0
- package/dist/coding/commandContext.d.ts.map +1 -0
- package/dist/coding/commandContext.js +20 -0
- package/dist/coding/runCodeTurn.d.ts +12 -2
- package/dist/coding/runCodeTurn.d.ts.map +1 -1
- package/dist/coding/runCodeTurn.js +49 -19
- package/dist/coding/worktree.d.ts +3 -4
- package/dist/coding/worktree.d.ts.map +1 -1
- package/dist/coding/worktree.js +3 -4
- package/dist/config.d.ts +4 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +20 -3
- package/dist/decisions/cli.d.ts +2 -0
- package/dist/decisions/cli.d.ts.map +1 -0
- package/dist/decisions/cli.js +106 -0
- package/dist/decisions/client.d.ts +20 -0
- package/dist/decisions/client.d.ts.map +1 -0
- package/dist/decisions/client.js +41 -0
- package/dist/handoff.d.ts +11 -0
- package/dist/handoff.d.ts.map +1 -0
- package/dist/handoff.js +21 -0
- package/dist/index.js +185 -40
- package/dist/jobs/briefing.js +1 -1
- package/dist/jobs/extraction.d.ts.map +1 -1
- package/dist/jobs/extraction.js +112 -22
- package/dist/jobs/fastModeReview.d.ts +39 -0
- package/dist/jobs/fastModeReview.d.ts.map +1 -0
- package/dist/jobs/fastModeReview.js +192 -0
- package/dist/jobs/voiceReview.d.ts +24 -0
- package/dist/jobs/voiceReview.d.ts.map +1 -0
- package/dist/jobs/voiceReview.js +128 -0
- package/dist/mcp/clients.d.ts +5 -0
- package/dist/mcp/clients.d.ts.map +1 -1
- package/dist/mcp/clients.js +1 -1
- package/dist/mcp/config.d.ts +3 -1
- package/dist/mcp/config.d.ts.map +1 -1
- package/dist/mcp/config.js +48 -6
- package/dist/mcp/paired.js +1 -0
- package/dist/notesContext.d.ts.map +1 -1
- package/dist/notesContext.js +3 -2
- package/dist/room/client.d.ts +20 -7
- package/dist/room/client.d.ts.map +1 -1
- package/dist/room/client.js +266 -47
- package/dist/room/computer.d.ts.map +1 -1
- package/dist/room/computer.js +9 -0
- package/dist/room/context.d.ts +3 -2
- package/dist/room/context.d.ts.map +1 -1
- package/dist/room/context.js +10 -3
- package/dist/room/turnQueue.d.ts +40 -0
- package/dist/room/turnQueue.d.ts.map +1 -0
- package/dist/room/turnQueue.js +301 -0
- package/dist/skills/lucidity-automations/SKILL.md +54 -0
- package/dist/speech/captures.d.ts +30 -0
- package/dist/speech/captures.d.ts.map +1 -0
- package/dist/speech/captures.js +209 -0
- package/dist/speech/fluidAudio.d.ts +28 -0
- package/dist/speech/fluidAudio.d.ts.map +1 -0
- package/dist/speech/fluidAudio.js +182 -0
- package/dist/speech/service.d.ts +14 -0
- package/dist/speech/service.d.ts.map +1 -0
- package/dist/speech/service.js +88 -0
- package/dist/speech/types.d.ts +19 -0
- package/dist/speech/types.d.ts.map +1 -0
- package/dist/speech/types.js +1 -0
- package/dist/turnLog.d.ts +1 -0
- package/dist/turnLog.d.ts.map +1 -1
- package/dist/turnLog.js +3 -0
- package/native/speech/Package.resolved +15 -0
- package/native/speech/Package.swift +16 -0
- package/native/speech/Sources/lucidity-speech/Speech.swift +81 -0
- package/package.json +6 -2
- package/src/automations/agent.ts +239 -0
- package/src/automations/cli.ts +52 -0
- package/src/automations/connections.ts +83 -0
- package/src/automations/designer.ts +594 -0
- package/src/automations/history.ts +59 -0
- package/src/automations/learning.ts +180 -0
- package/src/automations/pinterest.ts +146 -0
- package/src/automations/service.ts +505 -0
- package/src/automations/setup.ts +71 -0
- package/src/automations/skill.ts +40 -0
- package/src/automations/store.ts +63 -0
- package/src/chat/server.ts +62 -3
- package/src/coding/commandContext.ts +29 -0
- package/src/coding/runCodeTurn.ts +65 -21
- package/src/coding/worktree.ts +3 -4
- package/src/config.ts +29 -2
- package/src/decisions/cli.ts +136 -0
- package/src/decisions/client.ts +62 -0
- package/src/handoff.ts +28 -0
- package/src/index.ts +202 -67
- package/src/jobs/briefing.ts +1 -1
- package/src/jobs/extraction.ts +157 -32
- package/src/jobs/fastModeReview.ts +221 -0
- package/src/jobs/voiceReview.ts +156 -0
- package/src/mcp/clients.ts +1 -1
- package/src/mcp/config.ts +56 -6
- package/src/mcp/paired.ts +1 -0
- package/src/notesContext.ts +3 -2
- package/src/room/client.ts +320 -54
- package/src/room/computer.ts +9 -0
- package/src/room/context.ts +12 -3
- package/src/room/turnQueue.ts +358 -0
- package/src/speech/captures.ts +265 -0
- package/src/speech/fluidAudio.ts +242 -0
- package/src/speech/service.ts +108 -0
- package/src/speech/types.ts +13 -0
- package/src/turnLog.ts +4 -0
- package/vendor/decisions/LICENSE +662 -0
- package/vendor/decisions/dist/capture.d.ts +79 -0
- package/vendor/decisions/dist/capture.js +183 -0
- package/vendor/decisions/dist/command.d.ts +202 -0
- package/vendor/decisions/dist/command.js +750 -0
- package/vendor/decisions/dist/dayPlan.d.ts +9 -0
- package/vendor/decisions/dist/dayPlan.js +82 -0
- package/vendor/decisions/dist/gate.d.ts +12 -0
- package/vendor/decisions/dist/gate.js +18 -0
- package/vendor/decisions/dist/index.d.ts +6 -0
- package/vendor/decisions/dist/index.js +6 -0
- package/vendor/decisions/dist/jev.d.ts +15 -0
- package/vendor/decisions/dist/jev.js +244 -0
- package/vendor/decisions/dist/types.d.ts +67 -0
- package/vendor/decisions/dist/types.js +1 -0
- package/vendor/decisions/package.json +22 -0
- package/vendor/decisions/src/capture.ts +199 -0
- package/vendor/decisions/src/command.ts +836 -0
- package/vendor/decisions/src/dayPlan.ts +80 -0
- package/vendor/decisions/src/gate.ts +32 -0
- package/vendor/decisions/src/index.ts +6 -0
- package/vendor/decisions/src/jev.ts +295 -0
- package/vendor/decisions/src/types.ts +79 -0
- package/vendor/mcp-server/README.md +6 -1
- package/vendor/mcp-server/dist/client.d.ts +1 -0
- package/vendor/mcp-server/dist/client.d.ts.map +1 -1
- package/vendor/mcp-server/dist/client.js +8 -0
- package/vendor/mcp-server/dist/commentProvider.d.ts +3 -0
- package/vendor/mcp-server/dist/commentProvider.d.ts.map +1 -0
- package/vendor/mcp-server/dist/commentProvider.js +10 -0
- package/vendor/mcp-server/dist/index.js +21 -6
- package/vendor/mcp-server/dist/tools/automations.d.ts +6 -0
- package/vendor/mcp-server/dist/tools/automations.d.ts.map +1 -0
- package/vendor/mcp-server/dist/tools/automations.js +163 -0
- package/vendor/mcp-server/dist/tools/commandEventFormat.d.ts +52 -0
- package/vendor/mcp-server/dist/tools/commandEventFormat.d.ts.map +1 -0
- package/vendor/mcp-server/dist/tools/commandEventFormat.js +83 -0
- package/vendor/mcp-server/dist/tools/commandEvents.d.ts +3 -0
- package/vendor/mcp-server/dist/tools/commandEvents.d.ts.map +1 -0
- package/vendor/mcp-server/dist/tools/commandEvents.js +21 -0
- package/vendor/mcp-server/dist/tools/comments.d.ts.map +1 -1
- package/vendor/mcp-server/dist/tools/comments.js +25 -4
- package/vendor/mcp-server/dist/tools/index.d.ts +2 -0
- package/vendor/mcp-server/dist/tools/index.d.ts.map +1 -1
- package/vendor/mcp-server/dist/tools/index.js +2 -0
- package/vendor/mcp-server/dist/tools/journal.d.ts +3 -0
- package/vendor/mcp-server/dist/tools/journal.d.ts.map +1 -0
- package/vendor/mcp-server/dist/tools/journal.js +131 -0
- package/vendor/mcp-server/dist/tools/taskActivity.d.ts +3 -0
- package/vendor/mcp-server/dist/tools/taskActivity.d.ts.map +1 -0
- package/vendor/mcp-server/dist/tools/taskActivity.js +32 -0
- package/vendor/mcp-server/dist/tools/taskOccurrences.d.ts +3 -0
- package/vendor/mcp-server/dist/tools/taskOccurrences.d.ts.map +1 -0
- package/vendor/mcp-server/dist/tools/taskOccurrences.js +12 -0
- package/vendor/mcp-server/dist/tools/taskTrash.d.ts +3 -0
- package/vendor/mcp-server/dist/tools/taskTrash.d.ts.map +1 -0
- package/vendor/mcp-server/dist/tools/taskTrash.js +21 -0
- package/vendor/mcp-server/dist/tools/tasks.d.ts.map +1 -1
- package/vendor/mcp-server/dist/tools/tasks.js +67 -27
- package/vendor/mcp-server/package.json +5 -1
- package/vendor/mcp-server/src/client.ts +10 -0
- package/vendor/mcp-server/src/commentProvider.ts +9 -0
- package/vendor/mcp-server/src/index.ts +20 -6
- package/vendor/mcp-server/src/tools/automations.ts +199 -0
- package/vendor/mcp-server/src/tools/commandEventFormat.ts +108 -0
- package/vendor/mcp-server/src/tools/commandEvents.ts +27 -0
- package/vendor/mcp-server/src/tools/comments.ts +24 -3
- package/vendor/mcp-server/src/tools/index.ts +2 -0
- package/vendor/mcp-server/src/tools/journal.ts +168 -0
- package/vendor/mcp-server/src/tools/taskActivity.ts +55 -0
- package/vendor/mcp-server/src/tools/taskOccurrences.ts +26 -0
- package/vendor/mcp-server/src/tools/taskTrash.ts +23 -0
- package/vendor/mcp-server/src/tools/tasks.ts +66 -30
- package/vendor/notes/dist/index.d.ts +2 -0
- package/vendor/notes/dist/index.d.ts.map +1 -1
- package/vendor/notes/dist/index.js +2 -0
- package/vendor/notes/dist/journal-backend.d.ts +4 -0
- package/vendor/notes/dist/journal-backend.d.ts.map +1 -0
- package/vendor/notes/dist/journal-backend.js +33 -0
- package/vendor/notes/dist/journal.d.ts +7 -0
- package/vendor/notes/dist/journal.d.ts.map +1 -0
- package/vendor/notes/dist/journal.js +173 -0
- package/vendor/notes/dist/vault.d.ts.map +1 -1
- package/vendor/notes/dist/vault.js +6 -1
- package/vendor/notes/src/index.ts +2 -0
- package/vendor/notes/src/journal-backend.ts +53 -0
- package/vendor/notes/src/journal.ts +194 -0
- package/vendor/notes/src/vault.ts +9 -1
- package/vendor/runtime/README.md +4 -0
- package/vendor/runtime/dist/executor/claudeAgent.d.ts +2 -0
- package/vendor/runtime/dist/executor/claudeAgent.d.ts.map +1 -1
- package/vendor/runtime/dist/executor/claudeAgent.js +117 -8
- package/vendor/runtime/dist/executor/claudeCode.d.ts.map +1 -1
- package/vendor/runtime/dist/executor/claudeCode.js +8 -4
- package/vendor/runtime/dist/executor/codex.d.ts +2 -0
- package/vendor/runtime/dist/executor/codex.d.ts.map +1 -1
- package/vendor/runtime/dist/executor/codex.js +214 -11
- package/vendor/runtime/dist/executor/codexProtocol/PlanType.d.ts +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/PlanType.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/PlanType.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/CreditsSnapshot.d.ts +6 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/CreditsSnapshot.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/CreditsSnapshot.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/GetAccountRateLimitsResponse.d.ts +26 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/GetAccountRateLimitsResponse.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/GetAccountRateLimitsResponse.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitReachedType.d.ts +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitReachedType.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitReachedType.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitResetCredit.d.ts +27 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitResetCredit.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitResetCredit.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitResetCreditStatus.d.ts +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitResetCreditStatus.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitResetCreditStatus.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitResetCreditsSummary.d.ts +13 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitResetCreditsSummary.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitResetCreditsSummary.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitResetType.d.ts +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitResetType.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitResetType.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitSnapshot.d.ts +20 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitSnapshot.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitSnapshot.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitWindow.d.ts +6 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitWindow.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitWindow.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/ReviewDelivery.d.ts +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/ReviewDelivery.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/ReviewDelivery.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/ReviewStartParams.d.ts +12 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/ReviewStartParams.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/ReviewStartParams.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/ReviewTarget.d.ts +17 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/ReviewTarget.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/ReviewTarget.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/SkillDependencies.d.ts +5 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/SkillDependencies.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/SkillDependencies.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/SkillErrorInfo.d.ts +5 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/SkillErrorInfo.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/SkillErrorInfo.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/SkillInterface.d.ts +18 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/SkillInterface.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/SkillInterface.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/SkillMetadata.d.ts +22 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/SkillMetadata.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/SkillMetadata.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/SkillScope.d.ts +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/SkillScope.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/SkillScope.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/SkillToolDependency.d.ts +9 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/SkillToolDependency.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/SkillToolDependency.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/SkillsListEntry.d.ts +8 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/SkillsListEntry.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/SkillsListEntry.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/SkillsListResponse.d.ts +5 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/SkillsListResponse.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/SkillsListResponse.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/SpendControlLimitSnapshot.d.ts +7 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/SpendControlLimitSnapshot.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/SpendControlLimitSnapshot.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadSetNameParams.d.ts +5 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadSetNameParams.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadSetNameParams.js +2 -0
- package/vendor/runtime/dist/executor/health.d.ts +1 -0
- package/vendor/runtime/dist/executor/health.d.ts.map +1 -1
- package/vendor/runtime/dist/executor/health.js +3 -0
- package/vendor/runtime/dist/executor/liveTurns.d.ts.map +1 -1
- package/vendor/runtime/dist/executor/liveTurns.js +3 -0
- package/vendor/runtime/dist/executor/providerRouter.d.ts.map +1 -1
- package/vendor/runtime/dist/executor/providerRouter.js +2 -1
- package/vendor/runtime/dist/executor/types.d.ts +10 -0
- package/vendor/runtime/dist/executor/types.d.ts.map +1 -1
- package/vendor/runtime/dist/harness/index.d.ts +2 -0
- package/vendor/runtime/dist/harness/index.d.ts.map +1 -1
- package/vendor/runtime/dist/harness/index.js +46 -1
- package/vendor/runtime/dist/harness/types.d.ts +5 -1
- package/vendor/runtime/dist/harness/types.d.ts.map +1 -1
- 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 +2 -0
- package/vendor/runtime/dist/journal/context.d.ts +18 -0
- package/vendor/runtime/dist/journal/context.d.ts.map +1 -1
- package/vendor/runtime/dist/journal/context.js +19 -5
- package/vendor/runtime/dist/prompts/briefing.d.ts +4 -7
- package/vendor/runtime/dist/prompts/briefing.d.ts.map +1 -1
- package/vendor/runtime/dist/prompts/briefing.js +61 -12
- package/vendor/runtime/dist/prompts/cardStatement.d.ts +7 -0
- package/vendor/runtime/dist/prompts/cardStatement.d.ts.map +1 -0
- package/vendor/runtime/dist/prompts/cardStatement.js +52 -0
- package/vendor/runtime/dist/prompts/chat.d.ts +1 -0
- package/vendor/runtime/dist/prompts/chat.d.ts.map +1 -1
- package/vendor/runtime/dist/prompts/chat.js +15 -1
- package/vendor/runtime/dist/prompts/dayPlanning.d.ts +44 -0
- package/vendor/runtime/dist/prompts/dayPlanning.d.ts.map +1 -0
- package/vendor/runtime/dist/prompts/dayPlanning.js +42 -0
- package/vendor/runtime/dist/prompts/projectCapture.d.ts +7 -0
- package/vendor/runtime/dist/prompts/projectCapture.d.ts.map +1 -0
- package/vendor/runtime/dist/prompts/projectCapture.js +31 -0
- package/vendor/runtime/src/executor/claudeAgent.ts +137 -7
- package/vendor/runtime/src/executor/claudeCode.ts +6 -4
- package/vendor/runtime/src/executor/codex.ts +281 -20
- package/vendor/runtime/src/executor/codexProtocol/PlanType.ts +5 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/CreditsSnapshot.ts +5 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/GetAccountRateLimitsResponse.ts +25 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/RateLimitReachedType.ts +5 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/RateLimitResetCredit.ts +27 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/RateLimitResetCreditStatus.ts +5 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/RateLimitResetCreditsSummary.ts +14 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/RateLimitResetType.ts +5 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/RateLimitSnapshot.ts +14 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/RateLimitWindow.ts +5 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/ReviewDelivery.ts +5 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/ReviewStartParams.ts +12 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/ReviewTarget.ts +9 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/SkillDependencies.ts +6 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/SkillErrorInfo.ts +5 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/SkillInterface.ts +14 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/SkillMetadata.ts +17 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/SkillScope.ts +5 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/SkillToolDependency.ts +5 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/SkillsListEntry.ts +7 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/SkillsListResponse.ts +6 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/SpendControlLimitSnapshot.ts +5 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/ThreadSetNameParams.ts +5 -0
- package/vendor/runtime/src/executor/health.ts +3 -0
- package/vendor/runtime/src/executor/liveTurns.ts +3 -0
- package/vendor/runtime/src/executor/providerRouter.ts +2 -1
- package/vendor/runtime/src/executor/types.ts +10 -0
- package/vendor/runtime/src/harness/index.ts +51 -6
- package/vendor/runtime/src/harness/types.ts +5 -1
- package/vendor/runtime/src/index.ts +4 -1
- package/vendor/runtime/src/journal/context.ts +40 -7
- package/vendor/runtime/src/prompts/briefing.ts +62 -17
- package/vendor/runtime/src/prompts/cardStatement.ts +64 -0
- package/vendor/runtime/src/prompts/chat.ts +25 -3
- package/vendor/runtime/src/prompts/dayPlanning.ts +46 -0
- package/vendor/runtime/src/prompts/projectCapture.ts +51 -0
- package/vendor/shared/dist/agentCommands.d.ts +22 -0
- package/vendor/shared/dist/agentCommands.d.ts.map +1 -0
- package/vendor/shared/dist/agentCommands.js +11 -0
- package/vendor/shared/dist/automationTemplates.d.ts +37 -0
- package/vendor/shared/dist/automationTemplates.d.ts.map +1 -0
- package/vendor/shared/dist/automationTemplates.js +48 -0
- package/vendor/shared/dist/automations.d.ts +1052 -0
- package/vendor/shared/dist/automations.d.ts.map +1 -0
- package/vendor/shared/dist/automations.js +300 -0
- package/vendor/shared/dist/cardStatement.d.ts +28 -0
- package/vendor/shared/dist/cardStatement.d.ts.map +1 -0
- package/vendor/shared/dist/cardStatement.js +37 -0
- package/vendor/shared/dist/cardStudio.d.ts +756 -0
- package/vendor/shared/dist/cardStudio.d.ts.map +1 -0
- package/vendor/shared/dist/cardStudio.js +297 -0
- package/vendor/shared/dist/commandLocal.d.ts +218 -0
- package/vendor/shared/dist/commandLocal.d.ts.map +1 -0
- package/vendor/shared/dist/commandLocal.js +664 -0
- package/vendor/shared/dist/commandText.d.ts +12 -0
- package/vendor/shared/dist/commandText.d.ts.map +1 -0
- package/vendor/shared/dist/commandText.js +21 -0
- package/vendor/shared/dist/commands.d.ts +1534 -0
- package/vendor/shared/dist/commands.d.ts.map +1 -0
- package/vendor/shared/dist/commands.js +233 -0
- package/vendor/shared/dist/computer.d.ts +9 -9
- package/vendor/shared/dist/computer.d.ts.map +1 -1
- package/vendor/shared/dist/computer.js +12 -2
- 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 +9 -2
- package/vendor/shared/dist/dayPlan.d.ts +86 -0
- package/vendor/shared/dist/dayPlan.d.ts.map +1 -0
- package/vendor/shared/dist/dayPlan.js +46 -0
- package/vendor/shared/dist/dayPlanning.d.ts +139 -0
- package/vendor/shared/dist/dayPlanning.d.ts.map +1 -0
- package/vendor/shared/dist/dayPlanning.js +67 -0
- package/vendor/shared/dist/githubContributions.d.ts +93 -0
- package/vendor/shared/dist/githubContributions.d.ts.map +1 -0
- package/vendor/shared/dist/githubContributions.js +54 -0
- package/vendor/shared/dist/habitContributions.d.ts +26 -0
- package/vendor/shared/dist/habitContributions.d.ts.map +1 -0
- package/vendor/shared/dist/habitContributions.js +119 -0
- package/vendor/shared/dist/index.d.ts +28 -2
- package/vendor/shared/dist/index.d.ts.map +1 -1
- package/vendor/shared/dist/index.js +25 -2
- package/vendor/shared/dist/journal-migration.d.ts +29 -0
- package/vendor/shared/dist/journal-migration.d.ts.map +1 -0
- package/vendor/shared/dist/journal-migration.js +73 -0
- package/vendor/shared/dist/journal-vault.d.ts +414 -0
- package/vendor/shared/dist/journal-vault.d.ts.map +1 -0
- package/vendor/shared/dist/journal-vault.js +972 -0
- package/vendor/shared/dist/projectCapture.d.ts +73 -0
- package/vendor/shared/dist/projectCapture.d.ts.map +1 -0
- package/vendor/shared/dist/projectCapture.js +66 -0
- package/vendor/shared/dist/quickAdd.d.ts +90 -0
- package/vendor/shared/dist/quickAdd.d.ts.map +1 -0
- package/vendor/shared/dist/quickAdd.js +260 -0
- package/vendor/shared/dist/recurrence.d.ts +44 -0
- package/vendor/shared/dist/recurrence.d.ts.map +1 -0
- package/vendor/shared/dist/recurrence.js +37 -0
- package/vendor/shared/dist/reminderWords.d.ts +11 -0
- package/vendor/shared/dist/reminderWords.d.ts.map +1 -0
- package/vendor/shared/dist/reminderWords.js +63 -0
- package/vendor/shared/dist/schemas/comment.d.ts +13 -1
- package/vendor/shared/dist/schemas/comment.d.ts.map +1 -1
- package/vendor/shared/dist/schemas/comment.js +5 -0
- package/vendor/shared/dist/schemas/conversation.d.ts +3 -3
- package/vendor/shared/dist/schemas/harness.d.ts +976 -59
- package/vendor/shared/dist/schemas/harness.d.ts.map +1 -1
- package/vendor/shared/dist/schemas/harness.js +124 -3
- package/vendor/shared/dist/schemas/journal.d.ts +10 -0
- package/vendor/shared/dist/schemas/journal.d.ts.map +1 -1
- package/vendor/shared/dist/schemas/journal.js +10 -2
- package/vendor/shared/dist/schemas/notification.d.ts +1 -1
- package/vendor/shared/dist/schemas/organization.d.ts +3 -2
- package/vendor/shared/dist/schemas/organization.d.ts.map +1 -1
- package/vendor/shared/dist/schemas/organization.js +3 -2
- package/vendor/shared/dist/schemas/proposal.d.ts +7 -3
- package/vendor/shared/dist/schemas/proposal.d.ts.map +1 -1
- package/vendor/shared/dist/schemas/proposal.js +2 -1
- package/vendor/shared/dist/schemas/request.d.ts +44 -4
- package/vendor/shared/dist/schemas/request.d.ts.map +1 -1
- package/vendor/shared/dist/schemas/task.d.ts +83 -8
- package/vendor/shared/dist/schemas/task.d.ts.map +1 -1
- package/vendor/shared/dist/schemas/task.js +20 -2
- package/vendor/shared/dist/schemas/timeSession.d.ts +2 -2
- package/vendor/shared/dist/smartCapture.d.ts +60 -0
- package/vendor/shared/dist/smartCapture.d.ts.map +1 -0
- package/vendor/shared/dist/smartCapture.js +56 -0
- package/vendor/shared/dist/speech.d.ts +39 -0
- package/vendor/shared/dist/speech.d.ts.map +1 -0
- package/vendor/shared/dist/speech.js +36 -0
- package/vendor/shared/dist/spokenNames.d.ts +25 -0
- package/vendor/shared/dist/spokenNames.d.ts.map +1 -0
- package/vendor/shared/dist/spokenNames.js +120 -0
- package/vendor/shared/dist/taskActivity.d.ts +76 -0
- package/vendor/shared/dist/taskActivity.d.ts.map +1 -0
- package/vendor/shared/dist/taskActivity.js +27 -0
- package/vendor/shared/dist/vault-search.d.ts +50 -0
- package/vendor/shared/dist/vault-search.d.ts.map +1 -0
- package/vendor/shared/dist/vault-search.js +177 -0
- package/vendor/shared/dist/voiceCapture.d.ts +32 -0
- package/vendor/shared/dist/voiceCapture.d.ts.map +1 -0
- package/vendor/shared/dist/voiceCapture.js +29 -0
- package/vendor/shared/package.json +4 -0
- package/vendor/shared/src/agentCommands.ts +35 -0
- package/vendor/shared/src/automationTemplates.ts +54 -0
- package/vendor/shared/src/automations.ts +329 -0
- package/vendor/shared/src/cardStatement.ts +49 -0
- package/vendor/shared/src/cardStudio.ts +340 -0
- package/vendor/shared/src/commandLocal.ts +740 -0
- package/vendor/shared/src/commandText.ts +25 -0
- package/vendor/shared/src/commands.ts +255 -0
- package/vendor/shared/src/computer.ts +25 -6
- package/vendor/shared/src/constants.ts +9 -2
- package/vendor/shared/src/dayPlan.ts +81 -0
- package/vendor/shared/src/dayPlanning.ts +77 -0
- package/vendor/shared/src/githubContributions.ts +70 -0
- package/vendor/shared/src/habitContributions.ts +144 -0
- package/vendor/shared/src/index.ts +44 -1
- package/vendor/shared/src/journal-migration.ts +130 -0
- package/vendor/shared/src/journal-vault.ts +1240 -0
- package/vendor/shared/src/projectCapture.ts +86 -0
- package/vendor/shared/src/quickAdd.ts +310 -0
- package/vendor/shared/src/recurrence.ts +37 -0
- package/vendor/shared/src/reminderWords.ts +54 -0
- package/vendor/shared/src/schemas/comment.ts +5 -0
- package/vendor/shared/src/schemas/harness.ts +146 -7
- package/vendor/shared/src/schemas/journal.ts +15 -6
- package/vendor/shared/src/schemas/organization.ts +3 -2
- package/vendor/shared/src/schemas/proposal.ts +6 -1
- package/vendor/shared/src/schemas/task.ts +20 -2
- package/vendor/shared/src/smartCapture.ts +67 -0
- package/vendor/shared/src/speech.ts +44 -0
- package/vendor/shared/src/spokenNames.ts +128 -0
- package/vendor/shared/src/taskActivity.ts +34 -0
- package/vendor/shared/src/vault-search.ts +243 -0
- package/vendor/shared/src/voiceCapture.ts +34 -0
package/dist/index.js
CHANGED
|
@@ -3,13 +3,21 @@ import { HealthAwareExecutor } from '@lucidity/runtime';
|
|
|
3
3
|
import { AgentControls } from './agentControls.js';
|
|
4
4
|
import { join } from 'node:path';
|
|
5
5
|
import { ClaudeAgentExecutor, CodexExecutor, ProviderRouter, CLAUDE_AGENT_SDK_VERSION, CODEX_RUNTIME_VERSION, createLucidHarness, createApiClient, } from '@lucidity/runtime';
|
|
6
|
-
import { loadConfig, normalizeProviderPatch, configView, writeConfigPatch, persistNormalizedConfig, patchNeedsRestart, applyPatchInMemory, chatAgentFromConfig, CONFIG_PATH, } from './config.js';
|
|
6
|
+
import { loadConfig, normalizeProviderPatch, configView, writeConfigPatch, persistNormalizedConfig, patchNeedsRestart, applyPatchInMemory, chatAgentFromConfig, CONFIG_PATH, CONFIG_DIR, } from './config.js';
|
|
7
7
|
import { LaneQueue } from './queue.js';
|
|
8
|
-
import {
|
|
8
|
+
import { AutomationStore } from './automations/store.js';
|
|
9
|
+
import { AutomationService } from './automations/service.js';
|
|
10
|
+
import { createDeckDesigner } from './automations/designer.js';
|
|
11
|
+
import { createAgentAutomation } from './automations/agent.js';
|
|
12
|
+
import { runAutomationsCli } from './automations/cli.js';
|
|
13
|
+
import { importJobHistory } from './automations/history.js';
|
|
14
|
+
import { setupDesign } from './automations/setup.js';
|
|
9
15
|
import { runJob } from './jobs/runner.js';
|
|
10
16
|
import { runBriefing } from './jobs/briefing.js';
|
|
11
17
|
import { runWeeklyReview } from './jobs/weeklyReview.js';
|
|
12
18
|
import { runExtraction } from './jobs/extraction.js';
|
|
19
|
+
import { fileState, runVoiceReview } from './jobs/voiceReview.js';
|
|
20
|
+
import { fileState as fastModeReviewState, runFastModeReview } from './jobs/fastModeReview.js';
|
|
13
21
|
import { createDeliverer, isDeliveryChannel } from './delivery/index.js';
|
|
14
22
|
import { createAttentionPublisher } from './attention.js';
|
|
15
23
|
import { installAgent, uninstallAgent, agentStatus } from './install.js';
|
|
@@ -17,10 +25,13 @@ import { createChatServer } from './chat/server.js';
|
|
|
17
25
|
import { ensureChatToken } from './chat/token.js';
|
|
18
26
|
import { runChatCli } from './chat/client.js';
|
|
19
27
|
import { createVault } from './vault.js';
|
|
20
|
-
import { buildLucidityMcpConfig } from './mcp/config.js';
|
|
28
|
+
import { buildLucidityMcpConfig, buildCodingMcpConfig } from './mcp/config.js';
|
|
21
29
|
import { startRoomClient } from './room/client.js';
|
|
30
|
+
import { SpeechService } from './speech/service.js';
|
|
31
|
+
import { FluidAudioEngine } from './speech/fluidAudio.js';
|
|
22
32
|
import { createSessionJournalSource } from './room/journalSource.js';
|
|
23
33
|
import { TurnLogStore } from './turnLog.js';
|
|
34
|
+
import { commandContext } from './coding/commandContext.js';
|
|
24
35
|
import { runCodeTurn } from './coding/runCodeTurn.js';
|
|
25
36
|
import { runConductTurn } from './coding/conduct.js';
|
|
26
37
|
import { cloneRepo } from './coding/cloneRepo.js';
|
|
@@ -30,10 +41,13 @@ import { watchBranches } from './coding/branchWatch.js';
|
|
|
30
41
|
import { sweepStaleRequests } from './sweepStale.js';
|
|
31
42
|
import { runSetup } from './setup/server.js';
|
|
32
43
|
import { runClientSetup } from './mcp/clients.js';
|
|
44
|
+
import { runDecisionsCli } from './decisions/cli.js';
|
|
33
45
|
const KNOWN_JOBS = ['briefing', 'weekly-review', 'extraction'];
|
|
34
46
|
/** How often the journal sweep runs. Four hours keeps a morning capture from waiting for
|
|
35
47
|
* tomorrow while staying well inside a day's worth of model calls. */
|
|
36
48
|
const EXTRACTION_INTERVAL_HOURS = 4;
|
|
49
|
+
/** The checkout the Fast mode review reads to make its proposals exact. */
|
|
50
|
+
const LUCIDITY_REPO = 'opencore/lucidity';
|
|
37
51
|
/** Delay between acking a restart-inducing `setConfig` and exiting, so the reply flushes
|
|
38
52
|
* to the phone before the socket drops (launchd then relaunches with the new config). */
|
|
39
53
|
const RESTART_ACK_FLUSH_MS = 250;
|
|
@@ -61,6 +75,14 @@ function parseArgs(argv) {
|
|
|
61
75
|
}
|
|
62
76
|
async function main() {
|
|
63
77
|
const args = parseArgs(process.argv.slice(2));
|
|
78
|
+
if (args.command === 'decisions') {
|
|
79
|
+
process.exitCode = await runDecisionsCli(process.argv.slice(3));
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
if (args.command === 'setup-design') {
|
|
83
|
+
await setupDesign(process.argv.slice(3));
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
64
86
|
if (args.command === 'setup-mcp') {
|
|
65
87
|
await runClientSetup(process.argv.slice(3));
|
|
66
88
|
return;
|
|
@@ -84,13 +106,17 @@ async function main() {
|
|
|
84
106
|
return;
|
|
85
107
|
}
|
|
86
108
|
const config = loadConfig();
|
|
109
|
+
if (args.command === 'automations') {
|
|
110
|
+
await runAutomationsCli(config, process.argv.slice(3));
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
87
113
|
// Interactive chat: a thin CLI client of the running daemon's chat server.
|
|
88
114
|
if (args.command === 'chat') {
|
|
89
115
|
await runChatCli(config);
|
|
90
116
|
return;
|
|
91
117
|
}
|
|
92
118
|
if (args.command !== undefined) {
|
|
93
|
-
console.error(`Unknown command "${args.command}". Known: install, uninstall, status, chat. ` +
|
|
119
|
+
console.error(`Unknown command "${args.command}". Known: install, uninstall, status, chat, automations, decisions. ` +
|
|
94
120
|
`(Use --run-now <job> to run a job once.)`);
|
|
95
121
|
process.exit(1);
|
|
96
122
|
}
|
|
@@ -113,10 +139,16 @@ async function main() {
|
|
|
113
139
|
model: config.chatModel,
|
|
114
140
|
effort: config.chatEffort,
|
|
115
141
|
}));
|
|
142
|
+
const planningExecutor = new ProviderRouter(providers, () => ({
|
|
143
|
+
provider: config.codeProvider ?? 'claude',
|
|
144
|
+
model: /haiku/i.test(config.codeModel ?? '') ? 'default' : config.codeModel,
|
|
145
|
+
effort: 'high',
|
|
146
|
+
}));
|
|
116
147
|
const queue = new LaneQueue();
|
|
117
148
|
// Chat/ask tool dial (GitHub #98): when the user opts a capability in, wire the
|
|
118
149
|
// scoped Lucidity MCP server into both chat surfaces. Undefined = read-only.
|
|
119
150
|
const mcp = buildLucidityMcpConfig(config);
|
|
151
|
+
const codingMcp = buildCodingMcpConfig(config);
|
|
120
152
|
// Puny God (task #330): when agentMode is on, the interactive chat gets real Bash +
|
|
121
153
|
// file edits under `shellCwd`. Undefined = the caged, tool-less default. Baked once
|
|
122
154
|
// here like `mcp` (restart-wired); the cron jobs never see it, so they stay tool-less.
|
|
@@ -157,21 +189,126 @@ async function main() {
|
|
|
157
189
|
if (persistNormalizedConfig(config)) {
|
|
158
190
|
console.error('[config] migrated to the two-model schema (chatModel/codeModel).');
|
|
159
191
|
}
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
const
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
}
|
|
192
|
+
const turnLogs = new TurnLogStore();
|
|
193
|
+
turnLogs.prune();
|
|
194
|
+
const automationStore = new AutomationStore(join(CONFIG_DIR, 'automations'));
|
|
195
|
+
const designer = createDeckDesigner({
|
|
196
|
+
config,
|
|
197
|
+
directory: CONFIG_DIR,
|
|
198
|
+
store: automationStore,
|
|
199
|
+
providers,
|
|
200
|
+
});
|
|
201
|
+
const agentAutomation = createAgentAutomation({
|
|
202
|
+
config,
|
|
203
|
+
directory: CONFIG_DIR,
|
|
204
|
+
store: automationStore,
|
|
205
|
+
providers,
|
|
206
|
+
});
|
|
207
|
+
const automations = new AutomationService({
|
|
208
|
+
computerName: config.machineName,
|
|
209
|
+
supportedSources: agentAutomation.supportedSources,
|
|
210
|
+
validateInput: (input) => {
|
|
211
|
+
if (input.workflow === 'agent')
|
|
212
|
+
agentAutomation.validateInput(input);
|
|
213
|
+
else {
|
|
214
|
+
if (input.repoId)
|
|
215
|
+
designer.validateRepo(input.repoId);
|
|
216
|
+
if (!designer.connections().figma)
|
|
217
|
+
throw new Error('Connect Figma on this computer before enabling scheduled design runs.');
|
|
218
|
+
}
|
|
219
|
+
},
|
|
220
|
+
store: automationStore,
|
|
221
|
+
validateRepo: designer.validateRepo,
|
|
222
|
+
saveGuidance: designer.saveGuidance,
|
|
223
|
+
connections: designer.connections,
|
|
224
|
+
scheduledWork: () => config.scheduledWork !== false,
|
|
225
|
+
logger: (message) => console.error(message),
|
|
226
|
+
execute: async (job, run, signal) => {
|
|
227
|
+
if (job.kind === 'agent')
|
|
228
|
+
return agentAutomation.execute(run, signal);
|
|
229
|
+
if (job.kind === 'deck-designer')
|
|
230
|
+
return designer.execute(job, run, signal);
|
|
231
|
+
// Built-ins retain their existing delivery and JSONL history alongside the reviewable run.
|
|
232
|
+
const bounded = Object.create(executor);
|
|
233
|
+
bounded.run = (input) => executor.run({ ...input, signal });
|
|
234
|
+
let result;
|
|
235
|
+
await runJob(job.id.replace('builtin:', ''), queue, async () => {
|
|
236
|
+
if (job.id === 'builtin:briefing')
|
|
237
|
+
result = await runBriefing(config, bounded, deliverer, attention);
|
|
238
|
+
else if (job.id === 'builtin:weekly-review')
|
|
239
|
+
result = await runWeeklyReview(config, bounded, deliverer);
|
|
240
|
+
else if (job.id === 'builtin:extraction')
|
|
241
|
+
result = await runExtraction(config, bounded);
|
|
242
|
+
else if (job.id === 'builtin:voice-review')
|
|
243
|
+
result = await runVoiceReview({
|
|
244
|
+
api: createApiClient({ apiUrl: config.apiUrl, apiKey: config.apiKey }),
|
|
245
|
+
executor: bounded,
|
|
246
|
+
state: fileState(join(CONFIG_DIR, 'voice-review.json')),
|
|
247
|
+
});
|
|
248
|
+
else if (job.id === 'builtin:fastmode-review')
|
|
249
|
+
result = await runFastModeReview({
|
|
250
|
+
api: createApiClient({ apiUrl: config.apiUrl, apiKey: config.apiKey }),
|
|
251
|
+
executor: bounded,
|
|
252
|
+
// Read to make each proposal exact; the review never writes to it.
|
|
253
|
+
repoRoot: resolveRepo(LUCIDITY_REPO, listAllowlist(config))?.root ?? null,
|
|
254
|
+
state: fastModeReviewState(join(CONFIG_DIR, 'fastmode-review.json')),
|
|
255
|
+
});
|
|
256
|
+
else if (job.id === 'builtin:prune') {
|
|
257
|
+
turnLogs.prune();
|
|
258
|
+
result = { text: 'Expired conversation recovery logs removed.' };
|
|
259
|
+
}
|
|
260
|
+
else if (job.id === 'builtin:procurement') {
|
|
261
|
+
await sweepStaleRequests(config.apiKey);
|
|
262
|
+
result = { text: 'Checked procurement requests for stale activity.' };
|
|
263
|
+
}
|
|
264
|
+
else
|
|
265
|
+
throw new Error('Unknown built-in automation');
|
|
266
|
+
return result;
|
|
267
|
+
});
|
|
268
|
+
return {
|
|
269
|
+
status: 'completed',
|
|
270
|
+
summary: result.text,
|
|
271
|
+
costUsd: result.costUsd,
|
|
272
|
+
sessionId: result.sessionId,
|
|
273
|
+
};
|
|
274
|
+
},
|
|
275
|
+
});
|
|
276
|
+
const timezone = config.timezone ?? Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
277
|
+
const daily = (time) => ({
|
|
278
|
+
frequency: 'daily',
|
|
279
|
+
time: time.padStart(5, '0'),
|
|
280
|
+
timezone,
|
|
281
|
+
dayOfWeek: 0,
|
|
282
|
+
everyHours: 4,
|
|
283
|
+
});
|
|
284
|
+
automations.registerBuiltin('builtin:briefing', 'Daily briefing', daily(config.briefingTime));
|
|
285
|
+
automations.registerBuiltin('builtin:weekly-review', 'Weekly review', {
|
|
286
|
+
...daily(config.weeklyReviewTime),
|
|
287
|
+
frequency: 'weekly',
|
|
288
|
+
dayOfWeek: config.weeklyReviewDay,
|
|
289
|
+
}, config.weeklyReview);
|
|
290
|
+
automations.registerBuiltin('builtin:extraction', 'Journal extraction', {
|
|
291
|
+
...daily('00:00'),
|
|
292
|
+
frequency: 'interval',
|
|
293
|
+
everyHours: EXTRACTION_INTERVAL_HOURS,
|
|
294
|
+
});
|
|
295
|
+
// Rewords tasks made by voice in Fast mode against what was actually said.
|
|
296
|
+
automations.registerBuiltin('builtin:voice-review', 'Voice task review', {
|
|
297
|
+
...daily('00:00'),
|
|
298
|
+
frequency: 'interval',
|
|
299
|
+
everyHours: 4,
|
|
300
|
+
});
|
|
301
|
+
// Files what Fast mode should read better as Lucidity tasks. Checks every two hours; a check with
|
|
302
|
+
// too little new to learn from costs one API call and no model run.
|
|
303
|
+
automations.registerBuiltin('builtin:fastmode-review', 'Fast mode review', {
|
|
304
|
+
...daily('00:00'),
|
|
305
|
+
frequency: 'interval',
|
|
306
|
+
everyHours: 2,
|
|
307
|
+
});
|
|
308
|
+
automations.registerBuiltin('builtin:prune', 'Recovery log cleanup', daily('03:30'));
|
|
309
|
+
automations.registerBuiltin('builtin:procurement', 'Procurement reminders', daily('09:30'));
|
|
310
|
+
importJobHistory(automationStore, join(CONFIG_DIR, 'runs'));
|
|
311
|
+
automations.start();
|
|
175
312
|
// Interactive chat server (lite local gateway): loopback + token auth.
|
|
176
313
|
const chatServer = createChatServer({
|
|
177
314
|
config,
|
|
@@ -180,23 +317,9 @@ async function main() {
|
|
|
180
317
|
queue,
|
|
181
318
|
mcp,
|
|
182
319
|
chatAgent,
|
|
320
|
+
automations,
|
|
183
321
|
});
|
|
184
322
|
chatServer.listen(config.chatPort, '127.0.0.1');
|
|
185
|
-
// Durable per-turn write-ahead logs so a dropped reply can be pulled back by the phone.
|
|
186
|
-
// Prune stale logs on boot (reclaims a crashed run's leftovers) and daily thereafter.
|
|
187
|
-
const turnLogs = new TurnLogStore();
|
|
188
|
-
turnLogs.prune();
|
|
189
|
-
scheduler.scheduleDaily('03:30', () => turnLogs.prune(), {
|
|
190
|
-
timezone: config.timezone,
|
|
191
|
-
});
|
|
192
|
-
// Nag about procurement requests that have stopped moving. Just after the
|
|
193
|
-
// briefing rather than overnight, so the nudge lands when someone is at a desk
|
|
194
|
-
// and can act on it — a 3am notification is one you scroll past at 9.
|
|
195
|
-
if (config.scheduledWork !== false) {
|
|
196
|
-
scheduler.scheduleDaily('09:30', () => void sweepStaleRequests(config.apiKey), {
|
|
197
|
-
timezone: config.timezone,
|
|
198
|
-
});
|
|
199
|
-
}
|
|
200
323
|
// Room client (free path): dial the hosted relay so the phone can reach Lucid,
|
|
201
324
|
// serving ask/briefing/journal through the shared harness. Best-effort — it
|
|
202
325
|
// reconnects on its own and never takes the daemon down.
|
|
@@ -205,20 +328,33 @@ async function main() {
|
|
|
205
328
|
const harness = createLucidHarness({
|
|
206
329
|
executor,
|
|
207
330
|
chatExecutor,
|
|
331
|
+
planningExecutor,
|
|
208
332
|
persona: vault.readPersona(),
|
|
209
333
|
journalSource: createSessionJournalSource(join(config.vaultPath, 'sessions')),
|
|
210
334
|
mcp,
|
|
211
335
|
capabilities: {
|
|
212
336
|
tasks: config.capabilities.tasks,
|
|
213
337
|
memory: config.capabilities.memory,
|
|
338
|
+
automations: config.capabilities.automations,
|
|
214
339
|
},
|
|
215
340
|
agent: chatAgent,
|
|
216
341
|
});
|
|
342
|
+
const speech = new SpeechService([new FluidAudioEngine()], () => config.sttModel);
|
|
343
|
+
const speechConfigView = () => ({
|
|
344
|
+
...configView(config),
|
|
345
|
+
speech: speech.view(),
|
|
346
|
+
});
|
|
217
347
|
const roomClient = startRoomClient({
|
|
348
|
+
speech,
|
|
218
349
|
config,
|
|
350
|
+
automations,
|
|
219
351
|
harness,
|
|
220
352
|
controls,
|
|
221
353
|
models: (provider) => providers[provider].models(),
|
|
354
|
+
commands: (provider, context) => providers[provider].commands({
|
|
355
|
+
...commandContext(context, config),
|
|
356
|
+
mcp: context ? codingMcp : mcp,
|
|
357
|
+
}),
|
|
222
358
|
providerHealth: () => ({
|
|
223
359
|
claude: providers.claude.health(),
|
|
224
360
|
codex: providers.codex.health(),
|
|
@@ -241,6 +377,7 @@ async function main() {
|
|
|
241
377
|
? (req, ctx) => runCodeTurn(req, {
|
|
242
378
|
repos: listAllowlist(config),
|
|
243
379
|
executor,
|
|
380
|
+
mcp: codingMcp,
|
|
244
381
|
onApproval: (approval) => controls.request(req.id, approval, ctx.signal, ctx.send),
|
|
245
382
|
send: ctx.send,
|
|
246
383
|
signal: ctx.signal,
|
|
@@ -282,14 +419,16 @@ async function main() {
|
|
|
282
419
|
// setConfig persists to disk, applies the live half in-process (mutate `config` — the
|
|
283
420
|
// job closures read it per run — and swap the executor's model/effort defaults), and
|
|
284
421
|
// reports whether boot-wired fields changed so the phone can offer a restart.
|
|
285
|
-
getConfig:
|
|
422
|
+
getConfig: speechConfigView,
|
|
286
423
|
setConfig: (patch, restart) => {
|
|
424
|
+
if (patch.sttModel !== undefined)
|
|
425
|
+
speech.validateModel(patch.sttModel);
|
|
287
426
|
patch = normalizeProviderPatch(config, patch);
|
|
288
427
|
const needsRestart = patchNeedsRestart(config, patch);
|
|
289
428
|
writeConfigPatch(CONFIG_PATH, patch);
|
|
290
429
|
applyPatchInMemory(config, patch);
|
|
291
430
|
return {
|
|
292
|
-
config:
|
|
431
|
+
config: speechConfigView(),
|
|
293
432
|
needsRestart,
|
|
294
433
|
restarting: needsRestart && restart,
|
|
295
434
|
};
|
|
@@ -299,7 +438,10 @@ async function main() {
|
|
|
299
438
|
// socket dies. A foreground/dev daemon (no launchd) just exits — the dev restarts it.
|
|
300
439
|
requestRestart: () => {
|
|
301
440
|
console.error('[daemon] restarting to apply a config change.');
|
|
302
|
-
setTimeout(() =>
|
|
441
|
+
setTimeout(() => {
|
|
442
|
+
speech.dispose();
|
|
443
|
+
process.exit(0);
|
|
444
|
+
}, RESTART_ACK_FLUSH_MS);
|
|
303
445
|
},
|
|
304
446
|
});
|
|
305
447
|
// Now that the socket exists, the publisher wired into the jobs above can actually reach the
|
|
@@ -319,7 +461,9 @@ async function main() {
|
|
|
319
461
|
})
|
|
320
462
|
: null;
|
|
321
463
|
const tz = config.timezone ? ` ${config.timezone}` : '';
|
|
322
|
-
const next =
|
|
464
|
+
const next = automationStore
|
|
465
|
+
.jobs()
|
|
466
|
+
.find((job) => job.id === 'builtin:briefing' && job.enabled)?.nextRunAt;
|
|
323
467
|
const weekly = config.weeklyReview
|
|
324
468
|
? `; weekly review ${config.weeklyReviewTime} (day ${config.weeklyReviewDay})`
|
|
325
469
|
: '';
|
|
@@ -335,11 +479,12 @@ async function main() {
|
|
|
335
479
|
// Package pins keep the SDK, native runtime, and protocol contract aligned.
|
|
336
480
|
const runtimeVersions = `Claude Agent SDK ${CLAUDE_AGENT_SDK_VERSION}; Codex ${CODEX_RUNTIME_VERSION}`;
|
|
337
481
|
console.error(`[daemon] Lucid daemon started. Briefing ${config.briefingTime}${tz} → ${deliverer.name}${weekly}. ` +
|
|
338
|
-
`Scheduled work: ${config.scheduledWork !== false ? 'on' : 'off'}. Next briefing: ${next
|
|
482
|
+
`Scheduled work: ${config.scheduledWork !== false ? 'on' : 'off'}. Next briefing: ${next ?? 'none'}. Chat on 127.0.0.1:${config.chatPort}. ` +
|
|
339
483
|
`Room dialing ${config.apiUrl}. ${tools}.${shell} ${runtimeVersions}.`);
|
|
340
484
|
const shutdown = () => {
|
|
341
485
|
console.error('[daemon] shutting down.');
|
|
342
|
-
|
|
486
|
+
speech.dispose();
|
|
487
|
+
void automations.stop();
|
|
343
488
|
chatServer.close();
|
|
344
489
|
branchWatcher?.stop();
|
|
345
490
|
roomClient.stop();
|
package/dist/jobs/briefing.js
CHANGED
|
@@ -50,7 +50,7 @@ export async function runBriefing(config, executor, deliverer, attention) {
|
|
|
50
50
|
// Everything downstream — delivery, reflection, the session log — uses the briefing half only.
|
|
51
51
|
// A board that failed to parse costs us the board, never the briefing.
|
|
52
52
|
const split = attention
|
|
53
|
-
? splitBriefingOutput(briefing.text)
|
|
53
|
+
? splitBriefingOutput(briefing.text, [...tasks, ...flagged])
|
|
54
54
|
: { briefing: briefing.text, boards: [] };
|
|
55
55
|
const text = split.briefing;
|
|
56
56
|
let costUsd = briefing.costUsd;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extraction.d.ts","sourceRoot":"","sources":["../../src/jobs/extraction.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,aAAa,EAEnB,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"extraction.d.ts","sourceRoot":"","sources":["../../src/jobs/extraction.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,aAAa,EAEnB,MAAM,mBAAmB,CAAC;AAe3B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAsD7C,MAAM,WAAW,iBAAiB;IAChC,qCAAqC;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yFAAyF;IACzF,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,yEAAyE;IACzE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qCAAqC;IACrC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAsB,aAAa,CACjC,MAAM,EAAE,YAAY,EACpB,QAAQ,EAAE,aAAa,EACvB,OAAO,GAAE,iBAAsB,GAC9B,OAAO,CAAC,SAAS,CAAC,CAoNpB"}
|
package/dist/jobs/extraction.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { buildExtractionPrompt, parseExtractionOutput, resolveObservations, createApiClient, } from '@lucidity/runtime';
|
|
2
|
-
import { EXTRACTOR_VERSION, LINK_AUTO_ACCEPT_CONFIDENCE } from '@lucidity/shared';
|
|
2
|
+
import { EXTRACTOR_VERSION, LINK_AUTO_ACCEPT_CONFIDENCE, } from '@lucidity/shared';
|
|
3
|
+
import { privateJournalBackend } from '@lucidity/notes';
|
|
4
|
+
import { uuidv7 } from 'uuidv7';
|
|
3
5
|
/**
|
|
4
6
|
* The extraction sweep: read the journal segments nobody has read yet, and turn each one
|
|
5
7
|
* into observations linked to things that already exist.
|
|
@@ -46,7 +48,16 @@ export async function runExtraction(config, executor, options = {}) {
|
|
|
46
48
|
const limit = options.limit ?? DEFAULT_BATCH;
|
|
47
49
|
const model = options.model ?? EXTRACTION_MODEL;
|
|
48
50
|
const effort = options.effort ?? EXTRACTION_EFFORT;
|
|
49
|
-
const
|
|
51
|
+
const privateVault = await privateJournalBackend((path) => api.request(path), config.notesPath, uuidv7);
|
|
52
|
+
const segments = privateVault
|
|
53
|
+
? (await privateVault.unextracted(version, limit)).map((segment) => ({
|
|
54
|
+
id: segment.id,
|
|
55
|
+
transcript: segment.correctedTranscript ?? segment.transcript,
|
|
56
|
+
capturedAt: segment.capturedAt.toISOString(),
|
|
57
|
+
localDate: segment.localDate,
|
|
58
|
+
revision: segment.revisions[0],
|
|
59
|
+
}))
|
|
60
|
+
: await api.request(`/api/journal/segments/unextracted?limit=${limit}&extractorVersion=${encodeURIComponent(version)}`);
|
|
50
61
|
if (segments.length === 0) {
|
|
51
62
|
return { text: 'Nothing new to read in the journal.' };
|
|
52
63
|
}
|
|
@@ -59,6 +70,20 @@ export async function runExtraction(config, executor, options = {}) {
|
|
|
59
70
|
let costUsd = 0;
|
|
60
71
|
const notes = [];
|
|
61
72
|
for (const segment of segments) {
|
|
73
|
+
const failure = async () => {
|
|
74
|
+
if (privateVault)
|
|
75
|
+
await privateVault.writeExtraction({
|
|
76
|
+
segmentId: segment.id,
|
|
77
|
+
revision: segment.revision,
|
|
78
|
+
extractorVersion: version,
|
|
79
|
+
model,
|
|
80
|
+
error: 'Extraction failed. Retry with a newer extractor version.',
|
|
81
|
+
observations: [],
|
|
82
|
+
proposals: [],
|
|
83
|
+
});
|
|
84
|
+
else
|
|
85
|
+
await recordFailure(api, segment.id, version, model, 'Extraction failed.');
|
|
86
|
+
};
|
|
62
87
|
const { systemPrompt, userPrompt } = buildExtractionPrompt({
|
|
63
88
|
transcript: segment.transcript,
|
|
64
89
|
localDate: segment.localDate,
|
|
@@ -77,18 +102,18 @@ export async function runExtraction(config, executor, options = {}) {
|
|
|
77
102
|
if (parsed.error) {
|
|
78
103
|
// A reply we can't read is a failure, not an empty day. Recording it as "nothing
|
|
79
104
|
// found" would quietly lose the segment forever — it would never come back round.
|
|
80
|
-
await
|
|
105
|
+
await failure();
|
|
81
106
|
failed += 1;
|
|
82
|
-
notes.push(
|
|
107
|
+
notes.push('One capture returned an unreadable extraction.');
|
|
83
108
|
continue;
|
|
84
109
|
}
|
|
85
110
|
const { observations, dropped } = resolveObservations(segment.transcript, parsed.observations, catalogue);
|
|
86
111
|
droppedCount += dropped.length;
|
|
87
|
-
for (const
|
|
112
|
+
for (const _d of dropped) {
|
|
88
113
|
// Logged rather than swallowed: a model that paraphrases instead of quoting shows
|
|
89
114
|
// up here first, and silently dropping half its output would look like a model
|
|
90
115
|
// that simply found less.
|
|
91
|
-
console.warn(
|
|
116
|
+
console.warn('[extraction] dropped an unquotable or duplicate observation');
|
|
92
117
|
}
|
|
93
118
|
// A link the extractor isn't sure about must not be written as fact. Above the
|
|
94
119
|
// threshold it's the boring obviously-right case (a mention resolving to a project you
|
|
@@ -98,21 +123,74 @@ export async function runExtraction(config, executor, options = {}) {
|
|
|
98
123
|
const asserted = observations.map((o) => o.confidence >= LINK_AUTO_ACCEPT_CONFIDENCE
|
|
99
124
|
? o
|
|
100
125
|
: { ...o, projectId: null, taskId: null, personUserId: null });
|
|
101
|
-
const
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
126
|
+
const now = new Date();
|
|
127
|
+
const written = privateVault
|
|
128
|
+
? {
|
|
129
|
+
observations: asserted.map((o) => ({
|
|
130
|
+
...o,
|
|
131
|
+
id: uuidv7(),
|
|
132
|
+
segmentId: segment.id,
|
|
133
|
+
userId: privateVault.owner,
|
|
134
|
+
value: o.value ?? null,
|
|
135
|
+
unit: o.unit ?? null,
|
|
136
|
+
occurredAt: o.occurredAt ? new Date(o.occurredAt) : null,
|
|
137
|
+
projectId: o.projectId ?? null,
|
|
138
|
+
taskId: o.taskId ?? null,
|
|
139
|
+
personUserId: o.personUserId ?? null,
|
|
140
|
+
createdAt: now,
|
|
141
|
+
updatedAt: now,
|
|
142
|
+
})),
|
|
143
|
+
}
|
|
144
|
+
: await api.request(`/api/journal/segments/${segment.id}/observations`, {
|
|
145
|
+
method: 'PUT',
|
|
146
|
+
body: JSON.stringify({
|
|
147
|
+
extractorVersion: version,
|
|
148
|
+
model,
|
|
149
|
+
observations: asserted,
|
|
150
|
+
}),
|
|
151
|
+
});
|
|
152
|
+
const privateProposals = [];
|
|
153
|
+
proposed += await offerProposals(api, observations, written.observations ?? [], catalogue, version, privateVault
|
|
154
|
+
? async (proposal) => {
|
|
155
|
+
const observation = written.observations.find((o) => o.id === proposal.observationId);
|
|
156
|
+
privateProposals.push({
|
|
157
|
+
...proposal,
|
|
158
|
+
id: uuidv7(),
|
|
159
|
+
userId: privateVault.owner,
|
|
160
|
+
status: 'pending',
|
|
161
|
+
observationId: observation.id,
|
|
162
|
+
resultId: null,
|
|
163
|
+
rejectionReason: null,
|
|
164
|
+
decidedAt: null,
|
|
165
|
+
createdAt: now,
|
|
166
|
+
updatedAt: now,
|
|
167
|
+
evidence: {
|
|
168
|
+
segmentId: segment.id,
|
|
169
|
+
localDate: segment.localDate,
|
|
170
|
+
capturedAt: new Date(segment.capturedAt),
|
|
171
|
+
quote: segment.transcript.slice(observation.startOffset, observation.endOffset),
|
|
172
|
+
},
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
: undefined);
|
|
176
|
+
if (privateVault)
|
|
177
|
+
await privateVault.writeExtraction({
|
|
178
|
+
segmentId: segment.id,
|
|
179
|
+
revision: segment.revision,
|
|
180
|
+
extractorVersion: version,
|
|
181
|
+
model,
|
|
182
|
+
observations: written.observations,
|
|
183
|
+
proposals: privateProposals,
|
|
184
|
+
});
|
|
106
185
|
extracted += 1;
|
|
107
186
|
observationCount += observations.length;
|
|
108
187
|
}
|
|
109
188
|
catch (err) {
|
|
110
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
111
189
|
failed += 1;
|
|
112
|
-
notes.push(
|
|
190
|
+
notes.push('One capture could not be processed; its source record is unchanged.');
|
|
113
191
|
// Best-effort — if the API is what's broken, this write fails too and the segment
|
|
114
192
|
// stays in the queue, which is the right outcome for an outage.
|
|
115
|
-
await
|
|
193
|
+
await failure().catch(() => { });
|
|
116
194
|
}
|
|
117
195
|
}
|
|
118
196
|
const lines = [
|
|
@@ -171,7 +249,9 @@ async function loadCatalogue(api) {
|
|
|
171
249
|
name: p.name,
|
|
172
250
|
...(p.description ? { hint: p.description.slice(0, 80) } : {}),
|
|
173
251
|
})),
|
|
174
|
-
tasks: (taskPage.tasks ?? [])
|
|
252
|
+
tasks: (taskPage.tasks ?? [])
|
|
253
|
+
.slice(0, MAX_TASKS)
|
|
254
|
+
.map((t) => ({ id: t.id, name: t.title })),
|
|
175
255
|
people: connections.slice(0, MAX_PEOPLE).map((c) => ({
|
|
176
256
|
id: c.user.id,
|
|
177
257
|
name: c.user.name ?? c.user.handle ?? 'someone',
|
|
@@ -191,10 +271,11 @@ async function loadCatalogue(api) {
|
|
|
191
271
|
* the real risk in #370: a talkative day could throw off thirty proposals, and thirty
|
|
192
272
|
* notifications is a feature people switch off in a week.
|
|
193
273
|
*/
|
|
194
|
-
async function offerProposals(api, resolved, written, catalogue, version) {
|
|
274
|
+
async function offerProposals(api, resolved, written, catalogue, version, save) {
|
|
195
275
|
// The API mints ids, so the two lists are matched on the span they quote. `startOffset` is
|
|
196
276
|
// unique per (kind, span) after deduping, which is what makes this safe.
|
|
197
|
-
const idFor = (o) => written.find((w) => w.kind === o.kind && w.startOffset === o.startOffset)
|
|
277
|
+
const idFor = (o) => written.find((w) => w.kind === o.kind && w.startOffset === o.startOffset)
|
|
278
|
+
?.id;
|
|
198
279
|
const wanted = [];
|
|
199
280
|
for (const o of resolved) {
|
|
200
281
|
const observationId = idFor(o);
|
|
@@ -205,7 +286,10 @@ async function offerProposals(api, resolved, written, catalogue, version) {
|
|
|
205
286
|
kind: 'task',
|
|
206
287
|
summary: o.label,
|
|
207
288
|
confidence: o.confidence,
|
|
208
|
-
payload: {
|
|
289
|
+
payload: {
|
|
290
|
+
title: o.label,
|
|
291
|
+
...(o.projectId ? { projectId: o.projectId } : {}),
|
|
292
|
+
},
|
|
209
293
|
observationId,
|
|
210
294
|
source: `extractor-${version}`,
|
|
211
295
|
});
|
|
@@ -214,9 +298,9 @@ async function offerProposals(api, resolved, written, catalogue, version) {
|
|
|
214
298
|
if (o.confidence >= LINK_AUTO_ACCEPT_CONFIDENCE)
|
|
215
299
|
continue;
|
|
216
300
|
const target = o.projectId
|
|
217
|
-
?
|
|
301
|
+
? { target: 'project', id: o.projectId }
|
|
218
302
|
: o.taskId
|
|
219
|
-
?
|
|
303
|
+
? { target: 'task', id: o.taskId }
|
|
220
304
|
: null;
|
|
221
305
|
if (!target)
|
|
222
306
|
continue;
|
|
@@ -233,13 +317,19 @@ async function offerProposals(api, resolved, written, catalogue, version) {
|
|
|
233
317
|
let created = 0;
|
|
234
318
|
for (const proposal of wanted) {
|
|
235
319
|
try {
|
|
236
|
-
|
|
320
|
+
if (save)
|
|
321
|
+
await save(proposal);
|
|
322
|
+
else
|
|
323
|
+
await api.request('/api/proposals', {
|
|
324
|
+
method: 'POST',
|
|
325
|
+
body: JSON.stringify(proposal),
|
|
326
|
+
});
|
|
237
327
|
created += 1;
|
|
238
328
|
}
|
|
239
329
|
catch (err) {
|
|
240
330
|
// A proposal that fails to save is not worth failing the segment over — the observation
|
|
241
331
|
// is stored either way, and the sweep re-offers on the next version bump.
|
|
242
|
-
console.warn(
|
|
332
|
+
console.warn('[extraction] could not persist a suggestion');
|
|
243
333
|
}
|
|
244
334
|
}
|
|
245
335
|
return created;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { AgentExecutor, ApiClient } from '@lucidity/runtime';
|
|
2
|
+
import type { JobResult } from './runner.js';
|
|
3
|
+
/** Every task this files starts with this, which is how open ones are found again. */
|
|
4
|
+
export declare const TASK_PREFIX = "Fast mode: ";
|
|
5
|
+
export interface FastModeReviewState {
|
|
6
|
+
load(): {
|
|
7
|
+
since: string | null;
|
|
8
|
+
keys: Record<string, string>;
|
|
9
|
+
};
|
|
10
|
+
save(state: {
|
|
11
|
+
since: string;
|
|
12
|
+
keys: Record<string, string>;
|
|
13
|
+
}): void;
|
|
14
|
+
}
|
|
15
|
+
export type Proposal = {
|
|
16
|
+
key: string;
|
|
17
|
+
title: string;
|
|
18
|
+
evidence: string[];
|
|
19
|
+
change: string;
|
|
20
|
+
risk: string;
|
|
21
|
+
};
|
|
22
|
+
export declare function runFastModeReview(deps: {
|
|
23
|
+
api: ApiClient;
|
|
24
|
+
executor: Pick<AgentExecutor, 'run'>;
|
|
25
|
+
/** The Lucidity checkout to read, when this computer has one. */
|
|
26
|
+
repoRoot: string | null;
|
|
27
|
+
state: FastModeReviewState;
|
|
28
|
+
now?: () => Date;
|
|
29
|
+
}): Promise<JobResult>;
|
|
30
|
+
/** The key written into a filed task's description. */
|
|
31
|
+
export declare function keyOf(description: string | null | undefined): string | null;
|
|
32
|
+
/** The model's JSON, with each proposal checked. Null when unreadable. */
|
|
33
|
+
export declare function parseReview(text: string): {
|
|
34
|
+
summary: string;
|
|
35
|
+
proposals: Proposal[];
|
|
36
|
+
} | null;
|
|
37
|
+
/** Where the review got to, and which task each issue key was filed as, beside the daemon's config. */
|
|
38
|
+
export declare function fileState(path: string): FastModeReviewState;
|
|
39
|
+
//# sourceMappingURL=fastModeReview.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fastModeReview.d.ts","sourceRoot":"","sources":["../../src/jobs/fastModeReview.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAoB,MAAM,mBAAmB,CAAC;AAEpF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAoB7C,sFAAsF;AACtF,eAAO,MAAM,WAAW,gBAAgB,CAAC;AAKzC,MAAM,WAAW,mBAAmB;IAClC,IAAI,IAAI;QAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,CAAC;IAC/D,IAAI,CAAC,KAAK,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,GAAG,IAAI,CAAC;CACpE;AAID,MAAM,MAAM,QAAQ,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAsBxG,wBAAsB,iBAAiB,CAAC,IAAI,EAAE;IAC5C,GAAG,EAAE,SAAS,CAAC;IACf,QAAQ,EAAE,IAAI,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC;IACrC,iEAAiE;IACjE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,KAAK,EAAE,mBAAmB,CAAC;IAC3B,GAAG,CAAC,EAAE,MAAM,IAAI,CAAC;CAClB,GAAG,OAAO,CAAC,SAAS,CAAC,CAsFrB;AAkBD,uDAAuD;AACvD,wBAAgB,KAAK,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAE3E;AAQD,0EAA0E;AAC1E,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,QAAQ,EAAE,CAAA;CAAE,GAAG,IAAI,CAqB3F;AAED,uGAAuG;AACvG,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,mBAAmB,CAe3D"}
|