@opencorelabs/lucidity 0.2.0 → 0.6.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 +36 -34
- package/bin/lucidity.js +2 -0
- 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 +6 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +21 -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 +190 -34
- 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 +26 -0
- package/dist/mcp/clients.d.ts.map +1 -0
- package/dist/mcp/clients.js +193 -0
- package/dist/mcp/config.d.ts +5 -2
- package/dist/mcp/config.d.ts.map +1 -1
- package/dist/mcp/config.js +48 -6
- package/dist/mcp/paired.d.ts +2 -0
- package/dist/mcp/paired.d.ts.map +1 -0
- package/dist/mcp/paired.js +21 -0
- package/dist/mcp/pairedConfig.d.ts +3 -0
- package/dist/mcp/pairedConfig.d.ts.map +1 -0
- package/dist/mcp/pairedConfig.js +33 -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 +262 -45
- package/dist/room/computer.d.ts.map +1 -1
- package/dist/room/computer.js +8 -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/setup/page.d.ts +3 -0
- package/dist/setup/page.d.ts.map +1 -0
- package/dist/setup/page.js +120 -0
- package/dist/setup/server.d.ts +26 -0
- package/dist/setup/server.d.ts.map +1 -0
- package/dist/setup/server.js +398 -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 +32 -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 +204 -58
- 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 +269 -0
- package/src/mcp/config.ts +58 -7
- package/src/mcp/paired.ts +23 -0
- package/src/mcp/pairedConfig.ts +44 -0
- package/src/notesContext.ts +3 -2
- package/src/room/client.ts +316 -52
- package/src/room/computer.ts +8 -0
- package/src/room/context.ts +12 -3
- package/src/room/turnQueue.ts +358 -0
- package/src/setup/page.ts +122 -0
- package/src/setup/server.ts +483 -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/gate.d.ts +12 -0
- package/vendor/decisions/dist/gate.js +18 -0
- package/vendor/decisions/dist/index.d.ts +5 -0
- package/vendor/decisions/dist/index.js +5 -0
- package/vendor/decisions/dist/jev.d.ts +15 -0
- package/vendor/decisions/dist/jev.js +242 -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/gate.ts +32 -0
- package/vendor/decisions/src/index.ts +5 -0
- package/vendor/decisions/src/jev.ts +293 -0
- package/vendor/decisions/src/types.ts +79 -0
- package/vendor/mcp-server/README.md +130 -48
- 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 +26 -5
- 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 +41 -5
- 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/memory.d.ts +2 -2
- package/vendor/mcp-server/dist/tools/memory.d.ts.map +1 -1
- package/vendor/mcp-server/dist/tools/memory.js +24 -14
- package/vendor/mcp-server/dist/tools/milestones.d.ts.map +1 -1
- package/vendor/mcp-server/dist/tools/milestones.js +30 -0
- package/vendor/mcp-server/dist/tools/notes.d.ts.map +1 -1
- package/vendor/mcp-server/dist/tools/notes.js +30 -5
- package/vendor/mcp-server/dist/tools/projects.d.ts.map +1 -1
- package/vendor/mcp-server/dist/tools/projects.js +15 -0
- package/vendor/mcp-server/dist/tools/queries.d.ts.map +1 -1
- package/vendor/mcp-server/dist/tools/queries.js +27 -2
- 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 +99 -22
- 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 +33 -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 +43 -4
- 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/memory.ts +26 -12
- package/vendor/mcp-server/src/tools/milestones.ts +36 -0
- package/vendor/mcp-server/src/tools/notes.ts +35 -4
- package/vendor/mcp-server/src/tools/projects.ts +18 -0
- package/vendor/mcp-server/src/tools/queries.ts +30 -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 +104 -24
- 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 +113 -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 +213 -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 +8 -0
- package/vendor/runtime/dist/executor/types.d.ts.map +1 -1
- package/vendor/runtime/dist/harness/index.d.ts +1 -0
- package/vendor/runtime/dist/harness/index.d.ts.map +1 -1
- package/vendor/runtime/dist/harness/index.js +35 -1
- package/vendor/runtime/dist/harness/types.d.ts +4 -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/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 +133 -7
- package/vendor/runtime/src/executor/claudeCode.ts +6 -4
- package/vendor/runtime/src/executor/codex.ts +280 -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 +8 -0
- package/vendor/runtime/src/harness/index.ts +40 -6
- package/vendor/runtime/src/harness/types.ts +4 -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/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/brandArtwork.d.ts +4 -0
- package/vendor/shared/dist/brandArtwork.d.ts.map +1 -0
- package/vendor/shared/dist/brandArtwork.js +7 -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 +662 -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 +1516 -0
- package/vendor/shared/dist/commands.d.ts.map +1 -0
- package/vendor/shared/dist/commands.js +231 -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 +11 -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/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 +26 -1
- package/vendor/shared/dist/index.d.ts.map +1 -1
- package/vendor/shared/dist/index.js +23 -1
- 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 +922 -59
- package/vendor/shared/dist/schemas/harness.d.ts.map +1 -1
- package/vendor/shared/dist/schemas/harness.js +122 -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/setupAppearance.d.ts +6 -0
- package/vendor/shared/dist/setupAppearance.d.ts.map +1 -0
- package/vendor/shared/dist/setupAppearance.js +17 -0
- 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/brandArtwork.ts +7 -0
- package/vendor/shared/src/cardStatement.ts +49 -0
- package/vendor/shared/src/cardStudio.ts +340 -0
- package/vendor/shared/src/commandLocal.ts +738 -0
- package/vendor/shared/src/commandText.ts +25 -0
- package/vendor/shared/src/commands.ts +253 -0
- package/vendor/shared/src/computer.ts +23 -6
- package/vendor/shared/src/constants.ts +9 -2
- package/vendor/shared/src/githubContributions.ts +70 -0
- package/vendor/shared/src/habitContributions.ts +144 -0
- package/vendor/shared/src/index.ts +42 -0
- 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 +144 -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/setupAppearance.ts +32 -0
- 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';
|
|
@@ -28,10 +39,15 @@ import { listAllowlist } from './coding/discover.js';
|
|
|
28
39
|
import { resolveRepo } from './coding/repos.js';
|
|
29
40
|
import { watchBranches } from './coding/branchWatch.js';
|
|
30
41
|
import { sweepStaleRequests } from './sweepStale.js';
|
|
42
|
+
import { runSetup } from './setup/server.js';
|
|
43
|
+
import { runClientSetup } from './mcp/clients.js';
|
|
44
|
+
import { runDecisionsCli } from './decisions/cli.js';
|
|
31
45
|
const KNOWN_JOBS = ['briefing', 'weekly-review', 'extraction'];
|
|
32
46
|
/** How often the journal sweep runs. Four hours keeps a morning capture from waiting for
|
|
33
47
|
* tomorrow while staying well inside a day's worth of model calls. */
|
|
34
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';
|
|
35
51
|
/** Delay between acking a restart-inducing `setConfig` and exiting, so the reply flushes
|
|
36
52
|
* to the phone before the socket drops (launchd then relaunches with the new config). */
|
|
37
53
|
const RESTART_ACK_FLUSH_MS = 250;
|
|
@@ -59,6 +75,23 @@ function parseArgs(argv) {
|
|
|
59
75
|
}
|
|
60
76
|
async function main() {
|
|
61
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
|
+
}
|
|
86
|
+
if (args.command === 'setup-mcp') {
|
|
87
|
+
await runClientSetup(process.argv.slice(3));
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
if (args.command === 'setup') {
|
|
91
|
+
if (!(await runSetup()))
|
|
92
|
+
return;
|
|
93
|
+
args.command = undefined;
|
|
94
|
+
}
|
|
62
95
|
// Service-management commands (manage the launchd agent; handled before config
|
|
63
96
|
// so `status`/`uninstall` work even without a valid config).
|
|
64
97
|
switch (args.command) {
|
|
@@ -73,13 +106,17 @@ async function main() {
|
|
|
73
106
|
return;
|
|
74
107
|
}
|
|
75
108
|
const config = loadConfig();
|
|
109
|
+
if (args.command === 'automations') {
|
|
110
|
+
await runAutomationsCli(config, process.argv.slice(3));
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
76
113
|
// Interactive chat: a thin CLI client of the running daemon's chat server.
|
|
77
114
|
if (args.command === 'chat') {
|
|
78
115
|
await runChatCli(config);
|
|
79
116
|
return;
|
|
80
117
|
}
|
|
81
118
|
if (args.command !== undefined) {
|
|
82
|
-
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. ` +
|
|
83
120
|
`(Use --run-now <job> to run a job once.)`);
|
|
84
121
|
process.exit(1);
|
|
85
122
|
}
|
|
@@ -106,6 +143,7 @@ async function main() {
|
|
|
106
143
|
// Chat/ask tool dial (GitHub #98): when the user opts a capability in, wire the
|
|
107
144
|
// scoped Lucidity MCP server into both chat surfaces. Undefined = read-only.
|
|
108
145
|
const mcp = buildLucidityMcpConfig(config);
|
|
146
|
+
const codingMcp = buildCodingMcpConfig(config);
|
|
109
147
|
// Puny God (task #330): when agentMode is on, the interactive chat gets real Bash +
|
|
110
148
|
// file edits under `shellCwd`. Undefined = the caged, tool-less default. Baked once
|
|
111
149
|
// here like `mcp` (restart-wired); the cron jobs never see it, so they stay tool-less.
|
|
@@ -146,17 +184,126 @@ async function main() {
|
|
|
146
184
|
if (persistNormalizedConfig(config)) {
|
|
147
185
|
console.error('[config] migrated to the two-model schema (chatModel/codeModel).');
|
|
148
186
|
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
const
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
187
|
+
const turnLogs = new TurnLogStore();
|
|
188
|
+
turnLogs.prune();
|
|
189
|
+
const automationStore = new AutomationStore(join(CONFIG_DIR, 'automations'));
|
|
190
|
+
const designer = createDeckDesigner({
|
|
191
|
+
config,
|
|
192
|
+
directory: CONFIG_DIR,
|
|
193
|
+
store: automationStore,
|
|
194
|
+
providers,
|
|
195
|
+
});
|
|
196
|
+
const agentAutomation = createAgentAutomation({
|
|
197
|
+
config,
|
|
198
|
+
directory: CONFIG_DIR,
|
|
199
|
+
store: automationStore,
|
|
200
|
+
providers,
|
|
201
|
+
});
|
|
202
|
+
const automations = new AutomationService({
|
|
203
|
+
computerName: config.machineName,
|
|
204
|
+
supportedSources: agentAutomation.supportedSources,
|
|
205
|
+
validateInput: (input) => {
|
|
206
|
+
if (input.workflow === 'agent')
|
|
207
|
+
agentAutomation.validateInput(input);
|
|
208
|
+
else {
|
|
209
|
+
if (input.repoId)
|
|
210
|
+
designer.validateRepo(input.repoId);
|
|
211
|
+
if (!designer.connections().figma)
|
|
212
|
+
throw new Error('Connect Figma on this computer before enabling scheduled design runs.');
|
|
213
|
+
}
|
|
214
|
+
},
|
|
215
|
+
store: automationStore,
|
|
216
|
+
validateRepo: designer.validateRepo,
|
|
217
|
+
saveGuidance: designer.saveGuidance,
|
|
218
|
+
connections: designer.connections,
|
|
219
|
+
scheduledWork: () => config.scheduledWork !== false,
|
|
220
|
+
logger: (message) => console.error(message),
|
|
221
|
+
execute: async (job, run, signal) => {
|
|
222
|
+
if (job.kind === 'agent')
|
|
223
|
+
return agentAutomation.execute(run, signal);
|
|
224
|
+
if (job.kind === 'deck-designer')
|
|
225
|
+
return designer.execute(job, run, signal);
|
|
226
|
+
// Built-ins retain their existing delivery and JSONL history alongside the reviewable run.
|
|
227
|
+
const bounded = Object.create(executor);
|
|
228
|
+
bounded.run = (input) => executor.run({ ...input, signal });
|
|
229
|
+
let result;
|
|
230
|
+
await runJob(job.id.replace('builtin:', ''), queue, async () => {
|
|
231
|
+
if (job.id === 'builtin:briefing')
|
|
232
|
+
result = await runBriefing(config, bounded, deliverer, attention);
|
|
233
|
+
else if (job.id === 'builtin:weekly-review')
|
|
234
|
+
result = await runWeeklyReview(config, bounded, deliverer);
|
|
235
|
+
else if (job.id === 'builtin:extraction')
|
|
236
|
+
result = await runExtraction(config, bounded);
|
|
237
|
+
else if (job.id === 'builtin:voice-review')
|
|
238
|
+
result = await runVoiceReview({
|
|
239
|
+
api: createApiClient({ apiUrl: config.apiUrl, apiKey: config.apiKey }),
|
|
240
|
+
executor: bounded,
|
|
241
|
+
state: fileState(join(CONFIG_DIR, 'voice-review.json')),
|
|
242
|
+
});
|
|
243
|
+
else if (job.id === 'builtin:fastmode-review')
|
|
244
|
+
result = await runFastModeReview({
|
|
245
|
+
api: createApiClient({ apiUrl: config.apiUrl, apiKey: config.apiKey }),
|
|
246
|
+
executor: bounded,
|
|
247
|
+
// Read to make each proposal exact; the review never writes to it.
|
|
248
|
+
repoRoot: resolveRepo(LUCIDITY_REPO, listAllowlist(config))?.root ?? null,
|
|
249
|
+
state: fastModeReviewState(join(CONFIG_DIR, 'fastmode-review.json')),
|
|
250
|
+
});
|
|
251
|
+
else if (job.id === 'builtin:prune') {
|
|
252
|
+
turnLogs.prune();
|
|
253
|
+
result = { text: 'Expired conversation recovery logs removed.' };
|
|
254
|
+
}
|
|
255
|
+
else if (job.id === 'builtin:procurement') {
|
|
256
|
+
await sweepStaleRequests(config.apiKey);
|
|
257
|
+
result = { text: 'Checked procurement requests for stale activity.' };
|
|
258
|
+
}
|
|
259
|
+
else
|
|
260
|
+
throw new Error('Unknown built-in automation');
|
|
261
|
+
return result;
|
|
262
|
+
});
|
|
263
|
+
return {
|
|
264
|
+
status: 'completed',
|
|
265
|
+
summary: result.text,
|
|
266
|
+
costUsd: result.costUsd,
|
|
267
|
+
sessionId: result.sessionId,
|
|
268
|
+
};
|
|
269
|
+
},
|
|
270
|
+
});
|
|
271
|
+
const timezone = config.timezone ?? Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
272
|
+
const daily = (time) => ({
|
|
273
|
+
frequency: 'daily',
|
|
274
|
+
time: time.padStart(5, '0'),
|
|
275
|
+
timezone,
|
|
276
|
+
dayOfWeek: 0,
|
|
277
|
+
everyHours: 4,
|
|
278
|
+
});
|
|
279
|
+
automations.registerBuiltin('builtin:briefing', 'Daily briefing', daily(config.briefingTime));
|
|
280
|
+
automations.registerBuiltin('builtin:weekly-review', 'Weekly review', {
|
|
281
|
+
...daily(config.weeklyReviewTime),
|
|
282
|
+
frequency: 'weekly',
|
|
283
|
+
dayOfWeek: config.weeklyReviewDay,
|
|
284
|
+
}, config.weeklyReview);
|
|
285
|
+
automations.registerBuiltin('builtin:extraction', 'Journal extraction', {
|
|
286
|
+
...daily('00:00'),
|
|
287
|
+
frequency: 'interval',
|
|
288
|
+
everyHours: EXTRACTION_INTERVAL_HOURS,
|
|
289
|
+
});
|
|
290
|
+
// Rewords tasks made by voice in Fast mode against what was actually said.
|
|
291
|
+
automations.registerBuiltin('builtin:voice-review', 'Voice task review', {
|
|
292
|
+
...daily('00:00'),
|
|
293
|
+
frequency: 'interval',
|
|
294
|
+
everyHours: 4,
|
|
295
|
+
});
|
|
296
|
+
// Files what Fast mode should read better as Lucidity tasks. Checks every two hours; a check with
|
|
297
|
+
// too little new to learn from costs one API call and no model run.
|
|
298
|
+
automations.registerBuiltin('builtin:fastmode-review', 'Fast mode review', {
|
|
299
|
+
...daily('00:00'),
|
|
300
|
+
frequency: 'interval',
|
|
301
|
+
everyHours: 2,
|
|
302
|
+
});
|
|
303
|
+
automations.registerBuiltin('builtin:prune', 'Recovery log cleanup', daily('03:30'));
|
|
304
|
+
automations.registerBuiltin('builtin:procurement', 'Procurement reminders', daily('09:30'));
|
|
305
|
+
importJobHistory(automationStore, join(CONFIG_DIR, 'runs'));
|
|
306
|
+
automations.start();
|
|
160
307
|
// Interactive chat server (lite local gateway): loopback + token auth.
|
|
161
308
|
const chatServer = createChatServer({
|
|
162
309
|
config,
|
|
@@ -165,21 +312,9 @@ async function main() {
|
|
|
165
312
|
queue,
|
|
166
313
|
mcp,
|
|
167
314
|
chatAgent,
|
|
315
|
+
automations,
|
|
168
316
|
});
|
|
169
317
|
chatServer.listen(config.chatPort, '127.0.0.1');
|
|
170
|
-
// Durable per-turn write-ahead logs so a dropped reply can be pulled back by the phone.
|
|
171
|
-
// Prune stale logs on boot (reclaims a crashed run's leftovers) and daily thereafter.
|
|
172
|
-
const turnLogs = new TurnLogStore();
|
|
173
|
-
turnLogs.prune();
|
|
174
|
-
scheduler.scheduleDaily('03:30', () => turnLogs.prune(), {
|
|
175
|
-
timezone: config.timezone,
|
|
176
|
-
});
|
|
177
|
-
// Nag about procurement requests that have stopped moving. Just after the
|
|
178
|
-
// briefing rather than overnight, so the nudge lands when someone is at a desk
|
|
179
|
-
// and can act on it — a 3am notification is one you scroll past at 9.
|
|
180
|
-
scheduler.scheduleDaily('09:30', () => void sweepStaleRequests(config.apiKey), {
|
|
181
|
-
timezone: config.timezone,
|
|
182
|
-
});
|
|
183
318
|
// Room client (free path): dial the hosted relay so the phone can reach Lucid,
|
|
184
319
|
// serving ask/briefing/journal through the shared harness. Best-effort — it
|
|
185
320
|
// reconnects on its own and never takes the daemon down.
|
|
@@ -194,14 +329,26 @@ async function main() {
|
|
|
194
329
|
capabilities: {
|
|
195
330
|
tasks: config.capabilities.tasks,
|
|
196
331
|
memory: config.capabilities.memory,
|
|
332
|
+
automations: config.capabilities.automations,
|
|
197
333
|
},
|
|
198
334
|
agent: chatAgent,
|
|
199
335
|
});
|
|
336
|
+
const speech = new SpeechService([new FluidAudioEngine()], () => config.sttModel);
|
|
337
|
+
const speechConfigView = () => ({
|
|
338
|
+
...configView(config),
|
|
339
|
+
speech: speech.view(),
|
|
340
|
+
});
|
|
200
341
|
const roomClient = startRoomClient({
|
|
342
|
+
speech,
|
|
201
343
|
config,
|
|
344
|
+
automations,
|
|
202
345
|
harness,
|
|
203
346
|
controls,
|
|
204
347
|
models: (provider) => providers[provider].models(),
|
|
348
|
+
commands: (provider, context) => providers[provider].commands({
|
|
349
|
+
...commandContext(context, config),
|
|
350
|
+
mcp: context ? codingMcp : mcp,
|
|
351
|
+
}),
|
|
205
352
|
providerHealth: () => ({
|
|
206
353
|
claude: providers.claude.health(),
|
|
207
354
|
codex: providers.codex.health(),
|
|
@@ -224,6 +371,7 @@ async function main() {
|
|
|
224
371
|
? (req, ctx) => runCodeTurn(req, {
|
|
225
372
|
repos: listAllowlist(config),
|
|
226
373
|
executor,
|
|
374
|
+
mcp: codingMcp,
|
|
227
375
|
onApproval: (approval) => controls.request(req.id, approval, ctx.signal, ctx.send),
|
|
228
376
|
send: ctx.send,
|
|
229
377
|
signal: ctx.signal,
|
|
@@ -265,14 +413,16 @@ async function main() {
|
|
|
265
413
|
// setConfig persists to disk, applies the live half in-process (mutate `config` — the
|
|
266
414
|
// job closures read it per run — and swap the executor's model/effort defaults), and
|
|
267
415
|
// reports whether boot-wired fields changed so the phone can offer a restart.
|
|
268
|
-
getConfig:
|
|
416
|
+
getConfig: speechConfigView,
|
|
269
417
|
setConfig: (patch, restart) => {
|
|
418
|
+
if (patch.sttModel !== undefined)
|
|
419
|
+
speech.validateModel(patch.sttModel);
|
|
270
420
|
patch = normalizeProviderPatch(config, patch);
|
|
271
421
|
const needsRestart = patchNeedsRestart(config, patch);
|
|
272
422
|
writeConfigPatch(CONFIG_PATH, patch);
|
|
273
423
|
applyPatchInMemory(config, patch);
|
|
274
424
|
return {
|
|
275
|
-
config:
|
|
425
|
+
config: speechConfigView(),
|
|
276
426
|
needsRestart,
|
|
277
427
|
restarting: needsRestart && restart,
|
|
278
428
|
};
|
|
@@ -282,7 +432,10 @@ async function main() {
|
|
|
282
432
|
// socket dies. A foreground/dev daemon (no launchd) just exits — the dev restarts it.
|
|
283
433
|
requestRestart: () => {
|
|
284
434
|
console.error('[daemon] restarting to apply a config change.');
|
|
285
|
-
setTimeout(() =>
|
|
435
|
+
setTimeout(() => {
|
|
436
|
+
speech.dispose();
|
|
437
|
+
process.exit(0);
|
|
438
|
+
}, RESTART_ACK_FLUSH_MS);
|
|
286
439
|
},
|
|
287
440
|
});
|
|
288
441
|
// Now that the socket exists, the publisher wired into the jobs above can actually reach the
|
|
@@ -302,7 +455,9 @@ async function main() {
|
|
|
302
455
|
})
|
|
303
456
|
: null;
|
|
304
457
|
const tz = config.timezone ? ` ${config.timezone}` : '';
|
|
305
|
-
const next =
|
|
458
|
+
const next = automationStore
|
|
459
|
+
.jobs()
|
|
460
|
+
.find((job) => job.id === 'builtin:briefing' && job.enabled)?.nextRunAt;
|
|
306
461
|
const weekly = config.weeklyReview
|
|
307
462
|
? `; weekly review ${config.weeklyReviewTime} (day ${config.weeklyReviewDay})`
|
|
308
463
|
: '';
|
|
@@ -318,11 +473,12 @@ async function main() {
|
|
|
318
473
|
// Package pins keep the SDK, native runtime, and protocol contract aligned.
|
|
319
474
|
const runtimeVersions = `Claude Agent SDK ${CLAUDE_AGENT_SDK_VERSION}; Codex ${CODEX_RUNTIME_VERSION}`;
|
|
320
475
|
console.error(`[daemon] Lucid daemon started. Briefing ${config.briefingTime}${tz} → ${deliverer.name}${weekly}. ` +
|
|
321
|
-
`
|
|
476
|
+
`Scheduled work: ${config.scheduledWork !== false ? 'on' : 'off'}. Next briefing: ${next ?? 'none'}. Chat on 127.0.0.1:${config.chatPort}. ` +
|
|
322
477
|
`Room dialing ${config.apiUrl}. ${tools}.${shell} ${runtimeVersions}.`);
|
|
323
478
|
const shutdown = () => {
|
|
324
479
|
console.error('[daemon] shutting down.');
|
|
325
|
-
|
|
480
|
+
speech.dispose();
|
|
481
|
+
void automations.stop();
|
|
326
482
|
chatServer.close();
|
|
327
483
|
branchWatcher?.stop();
|
|
328
484
|
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"}
|