@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/room/client.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { computerId, computerRuntime } from './computer.js';
|
|
2
|
+
import { DurableTurnQueue } from './turnQueue.js';
|
|
2
3
|
import { WebSocket } from 'ws';
|
|
3
4
|
import { HarnessRequestSchema, computerAvailability, } from '@lucidity/shared';
|
|
4
5
|
import { decodeSession } from '@lucidity/runtime';
|
|
@@ -9,9 +10,16 @@ import { currentBranch, repoWebUrl } from '../coding/worktree.js';
|
|
|
9
10
|
import { listPrs as resolvePrs } from '../coding/listPrs.js';
|
|
10
11
|
import { combineSignals, consumeResumed, isAbortError, RESUME_FIRST_OUTPUT_MS, } from '../streamDeadline.js';
|
|
11
12
|
import { TurnLogStore } from '../turnLog.js';
|
|
13
|
+
import { LaneQueue } from '../queue.js';
|
|
12
14
|
import { RoomTelemetry } from './telemetry.js';
|
|
13
15
|
import { buildIncidentBundle, writeIncidentBundle } from './incidents.js';
|
|
14
16
|
import { writeVoiceDiagBundle } from './voiceDiag.js';
|
|
17
|
+
import { VoiceCaptureService } from '../speech/captures.js';
|
|
18
|
+
import { CONFIG_DIR } from '../config.js';
|
|
19
|
+
import { handoffPrompt } from '../handoff.js';
|
|
20
|
+
import { createHash } from 'node:crypto';
|
|
21
|
+
import { join } from 'node:path';
|
|
22
|
+
import { uuidv7 } from 'uuidv7';
|
|
15
23
|
/** Frame `type`s that carry recoverable turn output — the ones written to the durable
|
|
16
24
|
* turn log and stamped with a `seq`. Buffered responses (`kind` replies) and any other
|
|
17
25
|
* control frame are forwarded verbatim, unlogged and unstamped. */
|
|
@@ -62,7 +70,7 @@ function sendStreamEvent(send, requestId, ev, freshStart = false) {
|
|
|
62
70
|
* a mid-run failure becomes a correlated `error` stream event.
|
|
63
71
|
*/
|
|
64
72
|
export async function dispatchRequest(raw, deps) {
|
|
65
|
-
const { harness, askContext, briefingContext, send, signal: outerSignal, inFlight, attention, } = deps;
|
|
73
|
+
const { harness, askContext, briefingContext, send: sendFrame, signal: outerSignal, inFlight, attention, } = deps;
|
|
66
74
|
const log = deps.logger ?? ((m) => console.error(`[room] ${m}`));
|
|
67
75
|
let json;
|
|
68
76
|
try {
|
|
@@ -72,18 +80,87 @@ export async function dispatchRequest(raw, deps) {
|
|
|
72
80
|
return;
|
|
73
81
|
}
|
|
74
82
|
const parsed = HarnessRequestSchema.safeParse(json);
|
|
75
|
-
if (!parsed.success)
|
|
83
|
+
if (!parsed.success) {
|
|
84
|
+
const invalid = json;
|
|
85
|
+
if (invalid?.kind === 'transcribe' &&
|
|
86
|
+
typeof invalid.id === 'string' &&
|
|
87
|
+
/^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(invalid.id)) {
|
|
88
|
+
sendFrame({
|
|
89
|
+
type: 'error',
|
|
90
|
+
requestId: invalid.id,
|
|
91
|
+
message: 'Use a supported audio recording under 10 MB.',
|
|
92
|
+
});
|
|
93
|
+
}
|
|
76
94
|
return;
|
|
95
|
+
}
|
|
77
96
|
const req = parsed.data;
|
|
97
|
+
const structured = req.kind === 'ask' && (req.dayPlan ? 'day-plan' : req.projectPlan ? 'project-plan' : undefined);
|
|
98
|
+
const send = (frame) => sendFrame(structured
|
|
99
|
+
? { ...frame, purpose: structured } : frame);
|
|
100
|
+
if (req.kind === 'voice-capture' || req.kind === 'voice-capture-status') {
|
|
101
|
+
try {
|
|
102
|
+
if (!deps.captures)
|
|
103
|
+
throw new Error('Update Lucidity on your computer to receive Watch recordings.');
|
|
104
|
+
// Existing receipts remain readable even if the provider later signs out.
|
|
105
|
+
const previous = deps.captures.status(req.credentialId, req.captureId);
|
|
106
|
+
if (req.kind === 'voice-capture' && !previous && deps.runtime) {
|
|
107
|
+
for (const feature of ['transcribe', 'ask']) {
|
|
108
|
+
const availability = computerAvailability({
|
|
109
|
+
type: 'presence',
|
|
110
|
+
daemonConnected: true,
|
|
111
|
+
runtime: deps.runtime(),
|
|
112
|
+
}, 'online', feature);
|
|
113
|
+
if (!availability.canSend)
|
|
114
|
+
throw new Error(`${availability.title}. ${availability.detail}`);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
const receipt = req.kind === 'voice-capture'
|
|
118
|
+
? deps.captures.submit(req.credentialId, {
|
|
119
|
+
captureId: req.captureId,
|
|
120
|
+
audio: req.audio,
|
|
121
|
+
})
|
|
122
|
+
: previous;
|
|
123
|
+
send({ requestId: req.id, kind: 'voice-capture', receipt });
|
|
124
|
+
}
|
|
125
|
+
catch (error) {
|
|
126
|
+
send({
|
|
127
|
+
type: 'error',
|
|
128
|
+
requestId: req.id,
|
|
129
|
+
message: error instanceof Error
|
|
130
|
+
? error.message
|
|
131
|
+
: 'Voice capture is unavailable.',
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
78
136
|
deps.telemetry?.record('request', req.kind, req.id);
|
|
137
|
+
if (req.kind === 'queue-control') {
|
|
138
|
+
try {
|
|
139
|
+
if (!deps.turnQueue)
|
|
140
|
+
throw new Error('Update Lucidity on your computer to manage queued messages.');
|
|
141
|
+
await deps.turnQueue.control(req.targetId, req.action, req.activeId);
|
|
142
|
+
send({ kind: 'control', requestId: req.id, accepted: true });
|
|
143
|
+
}
|
|
144
|
+
catch (error) {
|
|
145
|
+
send({
|
|
146
|
+
kind: 'control',
|
|
147
|
+
requestId: req.id,
|
|
148
|
+
accepted: false,
|
|
149
|
+
message: error.message,
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
79
154
|
if (deps.runtime &&
|
|
80
155
|
!['pull', 'cancel', 'permission', 'steer'].includes(req.kind)) {
|
|
81
156
|
let provider;
|
|
82
157
|
try {
|
|
83
|
-
provider =
|
|
158
|
+
provider = req.kind === 'ask' && req.dayPlan ? deps.runtime().defaults.code :
|
|
84
159
|
'resume' in req && req.resume
|
|
85
160
|
? decodeSession(req.resume).provider
|
|
86
|
-
:
|
|
161
|
+
: 'provider' in req
|
|
162
|
+
? req.provider
|
|
163
|
+
: undefined;
|
|
87
164
|
}
|
|
88
165
|
catch {
|
|
89
166
|
send({
|
|
@@ -93,7 +170,7 @@ export async function dispatchRequest(raw, deps) {
|
|
|
93
170
|
});
|
|
94
171
|
return;
|
|
95
172
|
}
|
|
96
|
-
const availability = computerAvailability({ type: 'presence', daemonConnected: true, runtime: deps.runtime() }, 'online', req.kind, provider);
|
|
173
|
+
const availability = computerAvailability({ type: 'presence', daemonConnected: true, runtime: deps.runtime() }, 'online', req.kind === 'ask' && req.dayPlan ? 'day-plan' : req.kind, provider);
|
|
97
174
|
if (!availability.canSend) {
|
|
98
175
|
send({
|
|
99
176
|
type: 'error',
|
|
@@ -155,6 +232,26 @@ export async function dispatchRequest(raw, deps) {
|
|
|
155
232
|
send({ kind: 'control', requestId: req.id, ...result });
|
|
156
233
|
return;
|
|
157
234
|
}
|
|
235
|
+
if (req.kind === 'commands') {
|
|
236
|
+
try {
|
|
237
|
+
if (!deps.commands)
|
|
238
|
+
throw new Error('Update Lucidity on your computer to use commands.');
|
|
239
|
+
send({
|
|
240
|
+
kind: 'commands',
|
|
241
|
+
requestId: req.id,
|
|
242
|
+
provider: req.provider,
|
|
243
|
+
commands: await deps.commands(req.provider, req.context),
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
catch (error) {
|
|
247
|
+
send({
|
|
248
|
+
type: 'error',
|
|
249
|
+
requestId: req.id,
|
|
250
|
+
message: error instanceof Error ? error.message : 'Command discovery failed.',
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
158
255
|
if (req.kind === 'models') {
|
|
159
256
|
try {
|
|
160
257
|
send({
|
|
@@ -207,6 +304,8 @@ export async function dispatchRequest(raw, deps) {
|
|
|
207
304
|
if (frame.seq > req.sinceSeq)
|
|
208
305
|
sendRaw(frame);
|
|
209
306
|
}
|
|
307
|
+
if (!state.terminated)
|
|
308
|
+
deps.turnQueue?.confirm(req.targetId);
|
|
210
309
|
// A phone may already have every logged frame while the turn waits for its
|
|
211
310
|
// decision. Reconfirm that live approval with a new sequence so reconnect
|
|
212
311
|
// restores its controls instead of waiting forever for another model token.
|
|
@@ -216,7 +315,9 @@ export async function dispatchRequest(raw, deps) {
|
|
|
216
315
|
// restarted mid-turn). Settle it with a synthesized, persisted terminal so the phone
|
|
217
316
|
// stops waiting and a repeat pull is idempotent. If it's still in `inFlight`, live
|
|
218
317
|
// frames past maxSeq keep flowing on the current socket (deduped by seq) — leave it.
|
|
219
|
-
if (!state.terminated &&
|
|
318
|
+
if (!state.terminated &&
|
|
319
|
+
!inFlight?.has(req.targetId) &&
|
|
320
|
+
!deps.turnQueue?.owns(req.targetId)) {
|
|
220
321
|
sendRaw(turnLogs.append(req.targetId, {
|
|
221
322
|
type: 'error',
|
|
222
323
|
requestId: req.targetId,
|
|
@@ -225,6 +326,21 @@ export async function dispatchRequest(raw, deps) {
|
|
|
225
326
|
}
|
|
226
327
|
return;
|
|
227
328
|
}
|
|
329
|
+
if ((req.kind === 'ask' || req.kind === 'code') && req.queue) {
|
|
330
|
+
try {
|
|
331
|
+
if (!deps.turnQueue)
|
|
332
|
+
throw new Error('Update Lucidity on your computer to queue messages.');
|
|
333
|
+
deps.turnQueue.enqueue(req);
|
|
334
|
+
}
|
|
335
|
+
catch (error) {
|
|
336
|
+
send({
|
|
337
|
+
type: 'error',
|
|
338
|
+
requestId: req.id,
|
|
339
|
+
message: error.message,
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
return;
|
|
343
|
+
}
|
|
228
344
|
if (deps.recordAcceptance &&
|
|
229
345
|
['ask', 'code', 'conduct', 'briefing', 'attention', 'clone'].includes(req.kind)) {
|
|
230
346
|
const previous = deps.turnLogs.read(req.id);
|
|
@@ -238,6 +354,12 @@ export async function dispatchRequest(raw, deps) {
|
|
|
238
354
|
const accepted = deps.turnLogs.append(req.id, {
|
|
239
355
|
type: 'accepted',
|
|
240
356
|
requestId: req.id,
|
|
357
|
+
scope: {
|
|
358
|
+
kind: req.kind,
|
|
359
|
+
...('repoId' in req ? { repoId: req.repoId } : {}),
|
|
360
|
+
...('workerId' in req ? { workerId: req.workerId } : {}),
|
|
361
|
+
...('mode' in req ? { mode: req.mode } : {}),
|
|
362
|
+
},
|
|
241
363
|
});
|
|
242
364
|
if (!deps.turnLogs.read(req.id).exists) {
|
|
243
365
|
send({
|
|
@@ -257,13 +379,22 @@ export async function dispatchRequest(raw, deps) {
|
|
|
257
379
|
// Wait for the lane INSIDE the try, and after `inFlight.set` above — a turn waiting its turn
|
|
258
380
|
// must still be cancellable, and the `signal?.aborted` checks below mean a cancel that lands
|
|
259
381
|
// while queued drops the run instead of starting it late.
|
|
260
|
-
const onLane = (lane, fn) => deps.queue
|
|
382
|
+
const onLane = (lane, fn) => deps.queue
|
|
383
|
+
? deps.queue.run(lane, () => signal?.aborted ? Promise.resolve(undefined) : fn())
|
|
384
|
+
: signal?.aborted
|
|
385
|
+
? Promise.resolve(undefined)
|
|
386
|
+
: fn();
|
|
261
387
|
try {
|
|
262
388
|
if (req.kind === 'ask') {
|
|
263
389
|
await onLane('room:ask', async () => {
|
|
264
390
|
const base = {
|
|
265
|
-
...(await askContext()),
|
|
266
|
-
prompt: req.
|
|
391
|
+
...(structured ? { user: { name: '' } } : await askContext(req.prompt)),
|
|
392
|
+
prompt: req.handoff && !req.resume && !structured
|
|
393
|
+
? handoffPrompt(req.prompt, req.handoff, { coding: false })
|
|
394
|
+
: req.prompt,
|
|
395
|
+
provider: req.resume ? undefined : req.provider,
|
|
396
|
+
projectPlan: req.projectPlan,
|
|
397
|
+
dayPlan: req.dayPlan,
|
|
267
398
|
images: req.images,
|
|
268
399
|
requestId: req.id,
|
|
269
400
|
onApproval: deps.controls
|
|
@@ -282,7 +413,7 @@ export async function dispatchRequest(raw, deps) {
|
|
|
282
413
|
// attempt with a first-output deadline. Yields nothing in time → retry once
|
|
283
414
|
// fresh so the turn still lands and a new session id is captured. A user
|
|
284
415
|
// cancel (`signal.aborted`) must not retry. Mirrors runCodeTurn.
|
|
285
|
-
const resumed = req.resume
|
|
416
|
+
const resumed = req.resume && !structured
|
|
286
417
|
? await consumeResumed((sig) => harness.askStream({
|
|
287
418
|
...base,
|
|
288
419
|
resume: req.resume,
|
|
@@ -306,7 +437,7 @@ export async function dispatchRequest(raw, deps) {
|
|
|
306
437
|
}
|
|
307
438
|
}
|
|
308
439
|
else {
|
|
309
|
-
const reply = await harness.ask({ ...base, resume: req.resume });
|
|
440
|
+
const reply = await harness.ask({ ...base, resume: structured ? undefined : req.resume });
|
|
310
441
|
send({
|
|
311
442
|
requestId: req.id,
|
|
312
443
|
kind: 'ask',
|
|
@@ -415,6 +546,20 @@ export async function dispatchRequest(raw, deps) {
|
|
|
415
546
|
message: 'Cloning is not enabled on this daemon yet.',
|
|
416
547
|
});
|
|
417
548
|
}
|
|
549
|
+
else if (req.kind === 'transcribe') {
|
|
550
|
+
if (!deps.speech)
|
|
551
|
+
throw new Error('Speech recognition is not installed on this computer.');
|
|
552
|
+
const transcript = await onLane('speech', () => deps.speech.transcribe(req.audio, signal));
|
|
553
|
+
send({ requestId: req.id, kind: 'transcription', transcript });
|
|
554
|
+
}
|
|
555
|
+
else if (req.kind === 'getAutomations' || req.kind === 'automation') {
|
|
556
|
+
if (!deps.automations)
|
|
557
|
+
throw new Error('Update Lucidity on your computer to use automations.');
|
|
558
|
+
const snapshot = req.kind === 'getAutomations'
|
|
559
|
+
? deps.automations.snapshot(req)
|
|
560
|
+
: await deps.automations.command(req.command);
|
|
561
|
+
send({ requestId: req.id, kind: 'automations', snapshot });
|
|
562
|
+
}
|
|
418
563
|
else if (req.kind === 'getConfig') {
|
|
419
564
|
// Daemon Settings read: reply with the redacted config (secrets stripped).
|
|
420
565
|
if (deps.getConfig)
|
|
@@ -490,6 +635,8 @@ export async function dispatchRequest(raw, deps) {
|
|
|
490
635
|
prompt: req.prompt,
|
|
491
636
|
images: req.images,
|
|
492
637
|
resume: req.resume,
|
|
638
|
+
provider: req.provider,
|
|
639
|
+
handoff: req.handoff,
|
|
493
640
|
mode: req.mode,
|
|
494
641
|
expectedBranch: req.expectedBranch,
|
|
495
642
|
workerId: req.workerId,
|
|
@@ -589,9 +736,10 @@ export function startRoomClient(opts) {
|
|
|
589
736
|
const identity = opts.computerId ?? computerId();
|
|
590
737
|
const url = roomUrl(config.apiUrl, config.machineName) +
|
|
591
738
|
`&device=${encodeURIComponent(identity)}`;
|
|
592
|
-
const askContext = () => loadAskContext(config, vault);
|
|
739
|
+
const askContext = (query) => loadAskContext(config, vault, query);
|
|
593
740
|
const briefingContext = () => loadBriefingContext(config, vault);
|
|
594
741
|
const turnLogs = opts.turnLogs ?? new TurnLogStore();
|
|
742
|
+
const executionLanes = queue ?? new LaneQueue();
|
|
595
743
|
// The daemon's side of an incident bundle (#314): a rolling connection timeline the
|
|
596
744
|
// `incident` handler joins to the turn log. In-memory — the durable evidence is the turn log.
|
|
597
745
|
const telemetry = new RoomTelemetry();
|
|
@@ -602,6 +750,8 @@ export function startRoomClient(opts) {
|
|
|
602
750
|
// Survives reconnects — an in-flight run outlives a dropped socket, so a `cancel`
|
|
603
751
|
// sent after re-dialing must still be able to find and abort it.
|
|
604
752
|
const inFlight = new Map();
|
|
753
|
+
let durableQueue;
|
|
754
|
+
let captures;
|
|
605
755
|
// Send to whatever socket is CURRENT, read fresh each call — an in-flight turn started
|
|
606
756
|
// on a socket that later dropped must deliver its remaining frames to the reconnected
|
|
607
757
|
// socket, not the dead closure it began with (the frames are also in the turn log, so a
|
|
@@ -627,6 +777,7 @@ export function startRoomClient(opts) {
|
|
|
627
777
|
STREAM_EVENT_TYPES.has(rec.type) &&
|
|
628
778
|
typeof rec.requestId === 'string') {
|
|
629
779
|
sendRaw(turnLogs.append(rec.requestId, rec));
|
|
780
|
+
durableQueue?.wake();
|
|
630
781
|
return;
|
|
631
782
|
}
|
|
632
783
|
}
|
|
@@ -680,6 +831,106 @@ export function startRoomClient(opts) {
|
|
|
680
831
|
}, delay);
|
|
681
832
|
reconnectTimer.unref?.();
|
|
682
833
|
}
|
|
834
|
+
const dispatch = (raw, overrides = {}) => dispatchRequest(raw, {
|
|
835
|
+
harness,
|
|
836
|
+
recordAcceptance: true,
|
|
837
|
+
runtime: opts.providerHealth ? () => computerRuntime(opts) : undefined,
|
|
838
|
+
controls: opts.controls,
|
|
839
|
+
models: opts.models,
|
|
840
|
+
commands: opts.commands,
|
|
841
|
+
askContext,
|
|
842
|
+
briefingContext,
|
|
843
|
+
send: turnSend,
|
|
844
|
+
sendRaw,
|
|
845
|
+
turnLogs,
|
|
846
|
+
signal,
|
|
847
|
+
codeHandler,
|
|
848
|
+
conductHandler,
|
|
849
|
+
cloneHandler,
|
|
850
|
+
queue: executionLanes,
|
|
851
|
+
inFlight,
|
|
852
|
+
attention: opts.attention,
|
|
853
|
+
logger: log,
|
|
854
|
+
// Live allowlist (#78) + each row's live branch (#121); shared with pushRepos above.
|
|
855
|
+
listRepos,
|
|
856
|
+
listPrs: (repoId, mode) => resolvePrs(repoId, mode, config),
|
|
857
|
+
getConfig,
|
|
858
|
+
speech: opts.speech,
|
|
859
|
+
captures,
|
|
860
|
+
automations: opts.automations,
|
|
861
|
+
setConfig: setConfig
|
|
862
|
+
? (patch, restart) => {
|
|
863
|
+
const result = setConfig(patch, restart);
|
|
864
|
+
publishComputer();
|
|
865
|
+
return result;
|
|
866
|
+
}
|
|
867
|
+
: undefined,
|
|
868
|
+
requestRestart,
|
|
869
|
+
telemetry,
|
|
870
|
+
machine: config.machineName,
|
|
871
|
+
incidentsDir: opts.incidentsDir,
|
|
872
|
+
turnQueue: durableQueue,
|
|
873
|
+
...overrides,
|
|
874
|
+
});
|
|
875
|
+
durableQueue = new DurableTurnQueue({
|
|
876
|
+
dir: turnLogs.queueDirectory(),
|
|
877
|
+
logs: turnLogs,
|
|
878
|
+
lanes: executionLanes,
|
|
879
|
+
sendRaw,
|
|
880
|
+
execute: (request) => dispatch(JSON.stringify(request), {
|
|
881
|
+
recordAcceptance: false,
|
|
882
|
+
queue: undefined,
|
|
883
|
+
}),
|
|
884
|
+
steer: opts.controls
|
|
885
|
+
? (targetId, prompt) => opts.controls.steer(targetId, prompt)
|
|
886
|
+
: undefined,
|
|
887
|
+
});
|
|
888
|
+
durableQueue.wake();
|
|
889
|
+
if (opts.speech) {
|
|
890
|
+
// Never resume another account's queued commands after replacing credentials.
|
|
891
|
+
const account = createHash('sha256')
|
|
892
|
+
.update(`${config.apiUrl}\n${config.apiKey}`)
|
|
893
|
+
.digest('hex');
|
|
894
|
+
try {
|
|
895
|
+
captures = new VoiceCaptureService({
|
|
896
|
+
directory: opts.capturesDir ?? join(CONFIG_DIR, 'voice-captures', account),
|
|
897
|
+
logger: log,
|
|
898
|
+
transcribe: (audio, signal) => executionLanes.run('speech', () => opts.speech.transcribe(audio, signal)),
|
|
899
|
+
act: async (transcript, signal) => {
|
|
900
|
+
let answer;
|
|
901
|
+
let failure;
|
|
902
|
+
await dispatch(JSON.stringify({
|
|
903
|
+
id: uuidv7(),
|
|
904
|
+
kind: 'ask',
|
|
905
|
+
prompt: transcript,
|
|
906
|
+
stream: false,
|
|
907
|
+
}), {
|
|
908
|
+
signal,
|
|
909
|
+
recordAcceptance: false,
|
|
910
|
+
// The Watch has no approval UI. Provider defaults deny requests that
|
|
911
|
+
// require an interactive decision; the user's existing tool scope applies.
|
|
912
|
+
controls: undefined,
|
|
913
|
+
send: (frame) => {
|
|
914
|
+
const result = frame;
|
|
915
|
+
if (result.kind === 'ask')
|
|
916
|
+
answer = result.text;
|
|
917
|
+
if (result.type === 'error')
|
|
918
|
+
failure = result.message;
|
|
919
|
+
},
|
|
920
|
+
});
|
|
921
|
+
if (failure || answer === undefined)
|
|
922
|
+
throw new Error('Voice action did not finish.');
|
|
923
|
+
return answer;
|
|
924
|
+
},
|
|
925
|
+
});
|
|
926
|
+
captures.wake();
|
|
927
|
+
}
|
|
928
|
+
catch {
|
|
929
|
+
// Preserve the receipt ledger: disabling capture prevents replay while
|
|
930
|
+
// leaving the computer's other features available.
|
|
931
|
+
log('Voice capture is disabled because its saved receipts could not be opened.');
|
|
932
|
+
}
|
|
933
|
+
}
|
|
683
934
|
function connect() {
|
|
684
935
|
if (stopped)
|
|
685
936
|
return;
|
|
@@ -716,41 +967,7 @@ export function startRoomClient(opts) {
|
|
|
716
967
|
const raw = Array.isArray(data)
|
|
717
968
|
? Buffer.concat(data).toString()
|
|
718
969
|
: data.toString();
|
|
719
|
-
void
|
|
720
|
-
harness,
|
|
721
|
-
recordAcceptance: true,
|
|
722
|
-
runtime: opts.providerHealth ? () => computerRuntime(opts) : undefined,
|
|
723
|
-
controls: opts.controls,
|
|
724
|
-
models: opts.models,
|
|
725
|
-
askContext,
|
|
726
|
-
briefingContext,
|
|
727
|
-
send: turnSend,
|
|
728
|
-
sendRaw,
|
|
729
|
-
turnLogs,
|
|
730
|
-
signal,
|
|
731
|
-
codeHandler,
|
|
732
|
-
conductHandler,
|
|
733
|
-
cloneHandler,
|
|
734
|
-
queue,
|
|
735
|
-
inFlight,
|
|
736
|
-
attention: opts.attention,
|
|
737
|
-
logger: log,
|
|
738
|
-
// Live allowlist (#78) + each row's live branch (#121); shared with pushRepos above.
|
|
739
|
-
listRepos,
|
|
740
|
-
listPrs: (repoId, mode) => resolvePrs(repoId, mode, config),
|
|
741
|
-
getConfig,
|
|
742
|
-
setConfig: setConfig
|
|
743
|
-
? (patch, restart) => {
|
|
744
|
-
const result = setConfig(patch, restart);
|
|
745
|
-
publishComputer();
|
|
746
|
-
return result;
|
|
747
|
-
}
|
|
748
|
-
: undefined,
|
|
749
|
-
requestRestart,
|
|
750
|
-
telemetry,
|
|
751
|
-
machine: config.machineName,
|
|
752
|
-
incidentsDir: opts.incidentsDir,
|
|
753
|
-
}).catch((err) => {
|
|
970
|
+
void dispatch(raw).catch((err) => {
|
|
754
971
|
log(`dispatch error: ${err instanceof Error ? err.message : String(err)}`);
|
|
755
972
|
});
|
|
756
973
|
});
|
|
@@ -795,6 +1012,8 @@ export function startRoomClient(opts) {
|
|
|
795
1012
|
if (stopped)
|
|
796
1013
|
return;
|
|
797
1014
|
stopped = true;
|
|
1015
|
+
captures?.stop();
|
|
1016
|
+
durableQueue?.stop();
|
|
798
1017
|
clearInterval(redialWatchdog);
|
|
799
1018
|
unsubscribeHealth?.();
|
|
800
1019
|
if (reconnectTimer) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"computer.d.ts","sourceRoot":"","sources":["../../src/room/computer.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,KAAK,eAAe,EAErB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGrD,gGAAgG;AAChG,wBAAgB,UAAU,CACxB,IAAI,SAA8C,GACjD,MAAM,CAmBR;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,iBAAiB,GAAG,eAAe,
|
|
1
|
+
{"version":3,"file":"computer.d.ts","sourceRoot":"","sources":["../../src/room/computer.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,KAAK,eAAe,EAErB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGrD,gGAAgG;AAChG,wBAAgB,UAAU,CACxB,IAAI,SAA8C,GACjD,MAAM,CAmBR;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,iBAAiB,GAAG,eAAe,CA2CxE"}
|
package/dist/room/computer.js
CHANGED
|
@@ -35,21 +35,30 @@ export function computerRuntime(opts) {
|
|
|
35
35
|
protocol: COMPUTER_PROTOCOL,
|
|
36
36
|
features: [
|
|
37
37
|
'ask',
|
|
38
|
+
'project-plan',
|
|
39
|
+
'day-plan',
|
|
38
40
|
'briefing',
|
|
39
41
|
'journal',
|
|
40
42
|
'repos',
|
|
41
43
|
'prs',
|
|
42
44
|
'pull',
|
|
43
45
|
'cancel',
|
|
46
|
+
'turn-queue',
|
|
47
|
+
'queue-control',
|
|
48
|
+
'provider-handoff',
|
|
44
49
|
'incident',
|
|
45
50
|
'voice-diag',
|
|
51
|
+
...(opts.speech?.view().available ? ['transcribe'] : []),
|
|
52
|
+
...(opts.speech ? ['voice-capture', 'voice-capture-status'] : []),
|
|
46
53
|
...(opts.models ? ['models'] : []),
|
|
54
|
+
...(opts.commands ? ['commands'] : []),
|
|
47
55
|
...(opts.controls ? ['permission', 'steer'] : []),
|
|
48
56
|
...(opts.codeHandler ? ['code'] : []),
|
|
49
57
|
...(opts.conductHandler ? ['conduct'] : []),
|
|
50
58
|
...(opts.cloneHandler ? ['clone'] : []),
|
|
51
59
|
...(opts.attention ? ['attention'] : []),
|
|
52
60
|
...(opts.getConfig ? ['getConfig'] : []),
|
|
61
|
+
...(opts.automations ? ['getAutomations', 'automation'] : []),
|
|
53
62
|
...(opts.setConfig ? ['setConfig'] : []),
|
|
54
63
|
],
|
|
55
64
|
permissions: [
|
package/dist/room/context.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import type { Vault } from '../vault.js';
|
|
|
4
4
|
/**
|
|
5
5
|
* Per-request context gatherers for the room client. The harness bakes in the
|
|
6
6
|
* persona at construction; everything else (who the user is, durable memory, a
|
|
7
|
-
* recent-notes
|
|
7
|
+
* recent-notes and journal digests, a task snapshot) is assembled here per turn, mirroring
|
|
8
8
|
* the chat server's turn-1 build and the briefing job. All API reads are
|
|
9
9
|
* best-effort: offline → Lucid still answers, just with less context.
|
|
10
10
|
*/
|
|
@@ -12,6 +12,7 @@ export interface AskContext {
|
|
|
12
12
|
user: Pick<User, 'name'>;
|
|
13
13
|
memory?: string;
|
|
14
14
|
notes?: string;
|
|
15
|
+
journal?: string;
|
|
15
16
|
context?: string;
|
|
16
17
|
/** The Chat pair — Ask Lucid + voice run on the latency-tuned model, not the daemon's
|
|
17
18
|
* batch default. Spread straight onto the harness AskInput by the room ask handler. */
|
|
@@ -26,6 +27,6 @@ export interface BriefingContext {
|
|
|
26
27
|
memory?: string;
|
|
27
28
|
notes?: string;
|
|
28
29
|
}
|
|
29
|
-
export declare function loadAskContext(config: DaemonConfig, vault: Vault): Promise<AskContext>;
|
|
30
|
+
export declare function loadAskContext(config: DaemonConfig, vault: Vault, query?: string): Promise<AskContext>;
|
|
30
31
|
export declare function loadBriefingContext(config: DaemonConfig, vault: Vault): Promise<BriefingContext>;
|
|
31
32
|
//# sourceMappingURL=context.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/room/context.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/room/context.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAIzC;;;;;;GAMG;AAEH,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;4FACwF;IACxF,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,WAAW,CAAC;CACrB;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC;IACnC,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,mFAAmF;IACnF,OAAO,EAAE,IAAI,EAAE,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAOD,wBAAsB,cAAc,CAClC,MAAM,EAAE,YAAY,EACpB,KAAK,EAAE,KAAK,EACZ,KAAK,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,UAAU,CAAC,CAkCrB;AAED,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,YAAY,EACpB,KAAK,EAAE,KAAK,GACX,OAAO,CAAC,eAAe,CAAC,CAuB1B"}
|
package/dist/room/context.js
CHANGED
|
@@ -1,25 +1,31 @@
|
|
|
1
|
-
import { createApiClient } from '@lucidity/runtime';
|
|
1
|
+
import { createApiClient, loadJournalContext } from '@lucidity/runtime';
|
|
2
|
+
import { privateJournalBackend } from '@lucidity/notes';
|
|
2
3
|
import { loadNotesContext } from '../notesContext.js';
|
|
3
4
|
import { loadFlaggedTasks } from '../importantTasks.js';
|
|
4
5
|
function memoryFrom(vault) {
|
|
5
6
|
const facts = vault.readMemoryFacts();
|
|
6
7
|
return facts.length ? facts.map((f) => `- ${f}`).join('\n') : undefined;
|
|
7
8
|
}
|
|
8
|
-
export async function loadAskContext(config, vault) {
|
|
9
|
+
export async function loadAskContext(config, vault, query) {
|
|
9
10
|
const memory = memoryFrom(vault);
|
|
10
11
|
const notes = loadNotesContext(config);
|
|
11
12
|
let name = '';
|
|
12
13
|
let context;
|
|
14
|
+
let journal;
|
|
13
15
|
try {
|
|
14
16
|
const api = createApiClient({
|
|
15
17
|
apiUrl: config.apiUrl,
|
|
16
18
|
apiKey: config.apiKey,
|
|
17
19
|
});
|
|
18
|
-
const [tasks, user] = await Promise.all([
|
|
20
|
+
const [tasks, user, journalDigest] = await Promise.all([
|
|
19
21
|
api.request('/api/tasks/today').catch(() => []),
|
|
20
22
|
api.request('/api/users/me'),
|
|
23
|
+
privateJournalBackend((path) => api.request(path), config.notesPath)
|
|
24
|
+
.then((backend) => loadJournalContext(api, { query, backend }))
|
|
25
|
+
.catch(() => undefined),
|
|
21
26
|
]);
|
|
22
27
|
name = user.name ?? '';
|
|
28
|
+
journal = journalDigest?.text;
|
|
23
29
|
const titles = tasks.map((t) => t.title).filter(Boolean);
|
|
24
30
|
if (titles.length)
|
|
25
31
|
context = `Today/overdue tasks: ${titles.join('; ')}`;
|
|
@@ -31,6 +37,7 @@ export async function loadAskContext(config, vault) {
|
|
|
31
37
|
user: { name },
|
|
32
38
|
memory,
|
|
33
39
|
notes,
|
|
40
|
+
journal,
|
|
34
41
|
context,
|
|
35
42
|
model: config.chatModel,
|
|
36
43
|
effort: config.chatEffort,
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type HarnessRequest } from '@lucidity/shared';
|
|
2
|
+
import type { TurnLogStore } from '../turnLog.js';
|
|
3
|
+
import { LaneQueue } from '../queue.js';
|
|
4
|
+
type Request = Extract<HarnessRequest, {
|
|
5
|
+
kind: 'ask' | 'code';
|
|
6
|
+
}>;
|
|
7
|
+
export declare function turnLane(req: Request): string;
|
|
8
|
+
/** Persist before acknowledgement, resolve continuity on the computer, and never replay
|
|
9
|
+
* an execution whose outcome became uncertain. The socket only observes this queue. */
|
|
10
|
+
export declare class DurableTurnQueue {
|
|
11
|
+
private readonly deps;
|
|
12
|
+
private entries;
|
|
13
|
+
private scheduled;
|
|
14
|
+
private stopped;
|
|
15
|
+
private pumping;
|
|
16
|
+
constructor(deps: {
|
|
17
|
+
dir: string;
|
|
18
|
+
logs: TurnLogStore;
|
|
19
|
+
lanes: LaneQueue;
|
|
20
|
+
sendRaw: (frame: unknown) => void;
|
|
21
|
+
execute: (request: Request) => Promise<void>;
|
|
22
|
+
steer?: (targetId: string, prompt: string) => Promise<void>;
|
|
23
|
+
});
|
|
24
|
+
private save;
|
|
25
|
+
private publish;
|
|
26
|
+
private terminal;
|
|
27
|
+
private session;
|
|
28
|
+
private fail;
|
|
29
|
+
owns(id: string): boolean;
|
|
30
|
+
confirm(id: string): void;
|
|
31
|
+
enqueue(request: Request): void;
|
|
32
|
+
/** Skipped queue entries inherit their predecessor, so removing B from A→B→C
|
|
33
|
+
* never starts a new conversation or strands C. Failed executions stop dependants. */
|
|
34
|
+
private predecessor;
|
|
35
|
+
wake(): void;
|
|
36
|
+
control(id: string, action: 'cancel' | 'steer', activeId?: string): Promise<void>;
|
|
37
|
+
stop(): void;
|
|
38
|
+
}
|
|
39
|
+
export {};
|
|
40
|
+
//# sourceMappingURL=turnQueue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"turnQueue.d.ts","sourceRoot":"","sources":["../../src/room/turnQueue.ts"],"names":[],"mappings":"AAUA,OAAO,EAAwB,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,KAAK,OAAO,GAAG,OAAO,CAAC,cAAc,EAAE;IAAE,IAAI,EAAE,KAAK,GAAG,MAAM,CAAA;CAAE,CAAC,CAAC;AAOjE,wBAAgB,QAAQ,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAI7C;AAED;uFACuF;AACvF,qBAAa,gBAAgB;IAMzB,OAAO,CAAC,QAAQ,CAAC,IAAI;IALvB,OAAO,CAAC,OAAO,CAA4B;IAC3C,OAAO,CAAC,SAAS,CAAqB;IACtC,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,OAAO,CAAS;gBAEL,IAAI,EAAE;QACrB,GAAG,EAAE,MAAM,CAAC;QACZ,IAAI,EAAE,YAAY,CAAC;QACnB,KAAK,EAAE,SAAS,CAAC;QACjB,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;QAClC,OAAO,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;QAC7C,KAAK,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;KAC7D;IA+DH,OAAO,CAAC,IAAI;IASZ,OAAO,CAAC,OAAO;IAQf,OAAO,CAAC,QAAQ;IAShB,OAAO,CAAC,OAAO;IAQf,OAAO,CAAC,IAAI;IAMZ,IAAI,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAIzB,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAQzB,OAAO,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAsD/B;0FACsF;IACtF,OAAO,CAAC,WAAW;IA0CnB,IAAI,IAAI,IAAI;IAwDN,OAAO,CACX,EAAE,EAAE,MAAM,EACV,MAAM,EAAE,QAAQ,GAAG,OAAO,EAC1B,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,IAAI,CAAC;IAuChB,IAAI,IAAI,IAAI;CAGb"}
|