@opencorelabs/lucidity 0.9.5 → 0.9.6
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 +46 -5
- package/bin/lucidity.js +9 -1
- package/dist/agentControls.d.ts +3 -3
- package/dist/agentControls.d.ts.map +1 -1
- package/dist/agentControls.js +9 -6
- package/dist/assets/speech/lucidity-speech +0 -0
- package/dist/automations/agent.d.ts.map +1 -1
- package/dist/automations/agent.js +8 -3
- package/dist/automations/githubIssues.d.ts +25 -0
- package/dist/automations/githubIssues.d.ts.map +1 -0
- package/dist/automations/githubIssues.js +48 -0
- package/dist/automations/service.d.ts +4 -0
- package/dist/automations/service.d.ts.map +1 -1
- package/dist/automations/service.js +24 -3
- package/dist/automations/skill.d.ts +1 -1
- package/dist/automations/skill.d.ts.map +1 -1
- package/dist/automations/skill.js +3 -25
- package/dist/automations/workflowCrash.integration.d.ts +2 -0
- package/dist/automations/workflowCrash.integration.d.ts.map +1 -0
- package/dist/automations/workflowCrash.integration.js +78 -0
- package/dist/chat/server.d.ts +18 -0
- package/dist/chat/server.d.ts.map +1 -1
- package/dist/chat/server.js +203 -84
- package/dist/coding/agentMessages.d.ts +37 -0
- package/dist/coding/agentMessages.d.ts.map +1 -0
- package/dist/coding/agentMessages.js +220 -0
- package/dist/coding/agentSettings.d.ts +9 -0
- package/dist/coding/agentSettings.d.ts.map +1 -0
- package/dist/coding/agentSettings.js +22 -0
- package/dist/coding/fileContext.d.ts +4 -0
- package/dist/coding/fileContext.d.ts.map +1 -0
- package/dist/coding/fileContext.js +61 -0
- package/dist/coding/listPrs.d.ts +4 -0
- package/dist/coding/listPrs.d.ts.map +1 -1
- package/dist/coding/listPrs.js +1 -1
- package/dist/coding/lucidRouting.d.ts +67 -0
- package/dist/coding/lucidRouting.d.ts.map +1 -0
- package/dist/coding/lucidRouting.js +216 -0
- package/dist/coding/overviewSources.d.ts +52 -0
- package/dist/coding/overviewSources.d.ts.map +1 -0
- package/dist/coding/overviewSources.js +78 -0
- package/dist/coding/progress.d.ts +27 -0
- package/dist/coding/progress.d.ts.map +1 -0
- package/dist/coding/progress.js +152 -0
- package/dist/coding/repositoryRequests.d.ts +38 -0
- package/dist/coding/repositoryRequests.d.ts.map +1 -0
- package/dist/coding/repositoryRequests.js +137 -0
- package/dist/coding/runCodeTurn.d.ts +25 -8
- package/dist/coding/runCodeTurn.d.ts.map +1 -1
- package/dist/coding/runCodeTurn.js +93 -77
- package/dist/coding/workspaceOverview.d.ts +106 -0
- package/dist/coding/workspaceOverview.d.ts.map +1 -0
- package/dist/coding/workspaceOverview.js +96 -0
- package/dist/coding/workspaceRegistry.d.ts +230 -4
- package/dist/coding/workspaceRegistry.d.ts.map +1 -1
- package/dist/coding/workspaceRegistry.js +827 -37
- package/dist/coding/workspaceTitle.d.ts +14 -0
- package/dist/coding/workspaceTitle.d.ts.map +1 -0
- package/dist/coding/workspaceTitle.js +8 -0
- package/dist/coding/worktree.d.ts +1 -1
- package/dist/coding/worktree.d.ts.map +1 -1
- package/dist/coding/worktree.js +3 -2
- package/dist/coding/worktreeSetup.d.ts +1 -1
- package/dist/coding/worktreeSetup.d.ts.map +1 -1
- package/dist/coding/worktreeSetup.js +43 -10
- package/dist/config.d.ts +5 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +38 -3
- package/dist/editor/existingWorkspace.d.ts +3 -0
- package/dist/editor/existingWorkspace.d.ts.map +1 -0
- package/dist/editor/existingWorkspace.js +19 -0
- package/dist/editor/fileActions.d.ts +26 -0
- package/dist/editor/fileActions.d.ts.map +1 -0
- package/dist/editor/fileActions.js +134 -0
- package/dist/editor/files.d.ts +27 -0
- package/dist/editor/files.d.ts.map +1 -0
- package/dist/editor/files.js +279 -0
- package/dist/editor/gitActions.d.ts +18 -0
- package/dist/editor/gitActions.d.ts.map +1 -0
- package/dist/editor/gitActions.js +140 -0
- package/dist/editor/localEndpoint.d.ts +4 -0
- package/dist/editor/localEndpoint.d.ts.map +1 -0
- package/dist/editor/localEndpoint.js +35 -0
- package/dist/editor/service.d.ts +28 -0
- package/dist/editor/service.d.ts.map +1 -0
- package/dist/editor/service.js +101 -0
- package/dist/editor/shellCommands.d.ts +21 -0
- package/dist/editor/shellCommands.d.ts.map +1 -0
- package/dist/editor/shellCommands.js +165 -0
- package/dist/editor/terminals.d.ts +34 -0
- package/dist/editor/terminals.d.ts.map +1 -0
- package/dist/editor/terminals.js +161 -0
- package/dist/editor/types.d.ts +37 -0
- package/dist/editor/types.d.ts.map +1 -0
- package/dist/editor/types.js +1 -0
- package/dist/files/store.d.ts +13 -0
- package/dist/files/store.d.ts.map +1 -0
- package/dist/files/store.js +150 -0
- package/dist/goals/assessment.d.ts +6 -6
- package/dist/index.js +232 -56
- package/dist/install.d.ts +7 -0
- package/dist/install.d.ts.map +1 -1
- package/dist/install.js +5 -2
- package/dist/jobs/briefing.d.ts +1 -1
- package/dist/jobs/briefing.d.ts.map +1 -1
- package/dist/jobs/briefing.js +16 -33
- package/dist/jobs/extraction.d.ts +2 -1
- package/dist/jobs/extraction.d.ts.map +1 -1
- package/dist/jobs/extraction.js +2 -2
- package/dist/jobs/fastModeReview.d.ts +3 -1
- package/dist/jobs/fastModeReview.d.ts.map +1 -1
- package/dist/jobs/fastModeReview.js +20 -11
- package/dist/jobs/voiceReview.js +4 -4
- package/dist/jobs/weeklyReview.d.ts +1 -1
- package/dist/jobs/weeklyReview.d.ts.map +1 -1
- package/dist/jobs/weeklyReview.js +2 -5
- package/dist/lucidInvocations.d.ts +44 -0
- package/dist/lucidInvocations.d.ts.map +1 -0
- package/dist/lucidInvocations.js +164 -0
- package/dist/mcp/config.d.ts +8 -2
- package/dist/mcp/config.d.ts.map +1 -1
- package/dist/mcp/config.js +52 -10
- package/dist/mcp/paired.js +1 -0
- package/dist/providerFallbackContext.d.ts +5 -0
- package/dist/providerFallbackContext.d.ts.map +1 -0
- package/dist/providerFallbackContext.js +58 -0
- package/dist/providerRecovery.d.ts +18 -1
- package/dist/providerRecovery.d.ts.map +1 -1
- package/dist/providerRecovery.js +3 -1
- package/dist/providerRoles.d.ts +9 -0
- package/dist/providerRoles.d.ts.map +1 -0
- package/dist/providerRoles.js +25 -0
- package/dist/recall/command.d.ts +139 -0
- package/dist/recall/command.d.ts.map +1 -0
- package/dist/recall/command.js +35 -0
- package/dist/recall/context.d.ts +5 -0
- package/dist/recall/context.d.ts.map +1 -0
- package/dist/recall/context.js +66 -0
- package/dist/recall/conversations.d.ts +182 -0
- package/dist/recall/conversations.d.ts.map +1 -0
- package/dist/recall/conversations.js +58 -0
- package/dist/recall/documents.d.ts +76 -0
- package/dist/recall/documents.d.ts.map +1 -0
- package/dist/recall/documents.js +32 -0
- package/dist/recall/evaluation.d.ts +77 -0
- package/dist/recall/evaluation.d.ts.map +1 -0
- package/dist/recall/evaluation.js +88 -0
- package/dist/recall/factory.d.ts +6 -0
- package/dist/recall/factory.d.ts.map +1 -0
- package/dist/recall/factory.js +20 -0
- package/dist/recall/index.d.ts +13 -0
- package/dist/recall/index.d.ts.map +1 -0
- package/dist/recall/index.js +92 -0
- package/dist/recall/memories.d.ts +16 -0
- package/dist/recall/memories.d.ts.map +1 -0
- package/dist/recall/memories.js +136 -0
- package/dist/recall/memorySelection.d.ts +4 -0
- package/dist/recall/memorySelection.d.ts.map +1 -0
- package/dist/recall/memorySelection.js +16 -0
- package/dist/recall/memoryService.d.ts +22 -0
- package/dist/recall/memoryService.d.ts.map +1 -0
- package/dist/recall/memoryService.js +171 -0
- package/dist/recall/personal.d.ts +127 -0
- package/dist/recall/personal.d.ts.map +1 -0
- package/dist/recall/personal.js +125 -0
- package/dist/recall/projects.d.ts +67 -0
- package/dist/recall/projects.d.ts.map +1 -0
- package/dist/recall/projects.js +117 -0
- package/dist/recall/query.d.ts +5 -0
- package/dist/recall/query.d.ts.map +1 -0
- package/dist/recall/query.js +17 -0
- package/dist/recall/semanticEvaluation.d.ts +2 -0
- package/dist/recall/semanticEvaluation.d.ts.map +1 -0
- package/dist/recall/semanticEvaluation.js +123 -0
- package/dist/recall/service.d.ts +62 -0
- package/dist/recall/service.d.ts.map +1 -0
- package/dist/recall/service.js +94 -0
- package/dist/room/client.d.ts +41 -0
- package/dist/room/client.d.ts.map +1 -1
- package/dist/room/client.js +224 -25
- package/dist/room/codingActivity.d.ts +21 -0
- package/dist/room/codingActivity.d.ts.map +1 -0
- package/dist/room/codingActivity.js +86 -0
- package/dist/room/computer.d.ts.map +1 -1
- package/dist/room/computer.js +19 -3
- package/dist/room/context.d.ts +3 -2
- package/dist/room/context.d.ts.map +1 -1
- package/dist/room/context.js +5 -4
- package/dist/room/desktop-live.integration.d.ts +2 -0
- package/dist/room/desktop-live.integration.d.ts.map +1 -0
- package/dist/room/desktop-live.integration.js +219 -0
- package/dist/room/turnQueue.d.ts +24 -2
- package/dist/room/turnQueue.d.ts.map +1 -1
- package/dist/room/turnQueue.js +96 -30
- package/dist/runtimeStore.d.ts +17 -0
- package/dist/runtimeStore.d.ts.map +1 -1
- package/dist/runtimeStore.js +33 -4
- package/dist/setup/page.d.ts +1 -1
- package/dist/setup/page.d.ts.map +1 -1
- package/dist/setup/page.js +15 -2
- package/dist/setup/server.d.ts +5 -1
- package/dist/setup/server.d.ts.map +1 -1
- package/dist/setup/server.js +37 -13
- package/dist/skills/install.d.ts +8 -0
- package/dist/skills/install.d.ts.map +1 -0
- package/dist/skills/install.js +82 -0
- package/dist/skills/lucidity/SKILL.md +65 -0
- package/dist/skills/lucidity-task-handoff/SKILL.md +122 -0
- package/dist/speech/captures.d.ts +4 -0
- package/dist/speech/captures.d.ts.map +1 -1
- package/dist/speech/captures.js +53 -41
- package/dist/updateCli.d.ts +2 -0
- package/dist/updateCli.d.ts.map +1 -0
- package/dist/updateCli.js +40 -0
- package/dist/updateService.d.ts +3 -0
- package/dist/updateService.d.ts.map +1 -0
- package/dist/updateService.js +23 -0
- package/dist/updates/admission.d.ts +23 -0
- package/dist/updates/admission.d.ts.map +1 -0
- package/dist/updates/admission.js +76 -0
- package/dist/updates/bootstrap.d.ts +23 -0
- package/dist/updates/bootstrap.d.ts.map +1 -0
- package/dist/updates/bootstrap.js +95 -0
- package/dist/updates/bootstrapConfig.d.ts +34 -0
- package/dist/updates/bootstrapConfig.d.ts.map +1 -0
- package/dist/updates/bootstrapConfig.js +35 -0
- package/dist/updates/connection.d.ts +20 -0
- package/dist/updates/connection.d.ts.map +1 -0
- package/dist/updates/connection.js +111 -0
- package/dist/updates/developmentAdmission.d.ts +29 -0
- package/dist/updates/developmentAdmission.d.ts.map +1 -0
- package/dist/updates/developmentAdmission.js +73 -0
- package/dist/updates/developmentCli.d.ts +2 -0
- package/dist/updates/developmentCli.d.ts.map +1 -0
- package/dist/updates/developmentCli.js +61 -0
- package/dist/updates/developmentRefresh.d.ts +73 -0
- package/dist/updates/developmentRefresh.d.ts.map +1 -0
- package/dist/updates/developmentRefresh.js +157 -0
- package/dist/updates/developmentService.d.ts +13 -0
- package/dist/updates/developmentService.d.ts.map +1 -0
- package/dist/updates/developmentService.js +217 -0
- package/dist/updates/download.d.ts +7 -0
- package/dist/updates/download.d.ts.map +1 -0
- package/dist/updates/download.js +52 -0
- package/dist/updates/feed.d.ts +7 -0
- package/dist/updates/feed.d.ts.map +1 -0
- package/dist/updates/feed.js +37 -0
- package/dist/updates/installService.d.ts +3 -0
- package/dist/updates/installService.d.ts.map +1 -0
- package/dist/updates/installService.js +78 -0
- package/dist/updates/installationReferences.d.ts +17 -0
- package/dist/updates/installationReferences.d.ts.map +1 -0
- package/dist/updates/installationReferences.js +104 -0
- package/dist/updates/installationStore.d.ts +49 -0
- package/dist/updates/installationStore.d.ts.map +1 -0
- package/dist/updates/installationStore.js +237 -0
- package/dist/updates/installer.d.ts +29 -0
- package/dist/updates/installer.d.ts.map +1 -0
- package/dist/updates/installer.js +205 -0
- package/dist/updates/journal.d.ts +228 -0
- package/dist/updates/journal.d.ts.map +1 -0
- package/dist/updates/journal.js +249 -0
- package/dist/updates/managedLifecycle.d.ts +26 -0
- package/dist/updates/managedLifecycle.d.ts.map +1 -0
- package/dist/updates/managedLifecycle.js +60 -0
- package/dist/updates/migrateService.d.ts +2 -0
- package/dist/updates/migrateService.d.ts.map +1 -0
- package/dist/updates/migrateService.js +44 -0
- package/dist/updates/migration.d.ts +15 -0
- package/dist/updates/migration.d.ts.map +1 -0
- package/dist/updates/migration.js +108 -0
- package/dist/updates/processControl.d.ts +47 -0
- package/dist/updates/processControl.d.ts.map +1 -0
- package/dist/updates/processControl.js +98 -0
- package/dist/updates/processHost.d.ts +52 -0
- package/dist/updates/processHost.d.ts.map +1 -0
- package/dist/updates/processHost.js +165 -0
- package/dist/updates/registerService.d.ts +4 -0
- package/dist/updates/registerService.d.ts.map +1 -0
- package/dist/updates/registerService.js +34 -0
- package/dist/updates/releases.d.ts +84 -0
- package/dist/updates/releases.d.ts.map +1 -0
- package/dist/updates/releases.js +51 -0
- package/dist/updates/retention.d.ts +32 -0
- package/dist/updates/retention.d.ts.map +1 -0
- package/dist/updates/retention.js +188 -0
- package/dist/updates/runner.d.ts +6 -0
- package/dist/updates/runner.d.ts.map +1 -0
- package/dist/updates/runner.js +117 -0
- package/dist/updates/service.d.ts +53 -0
- package/dist/updates/service.d.ts.map +1 -0
- package/dist/updates/service.js +268 -0
- package/dist/updates/servicePlan.d.ts +29 -0
- package/dist/updates/servicePlan.d.ts.map +1 -0
- package/dist/updates/servicePlan.js +58 -0
- package/dist/updates/signCatalog.d.ts +10 -0
- package/dist/updates/signCatalog.d.ts.map +1 -0
- package/dist/updates/signCatalog.js +44 -0
- package/dist/updates/supervisor.d.ts +27 -0
- package/dist/updates/supervisor.d.ts.map +1 -0
- package/dist/updates/supervisor.js +137 -0
- package/dist/updates/windowsService.d.ts +12 -0
- package/dist/updates/windowsService.d.ts.map +1 -0
- package/dist/updates/windowsService.js +51 -0
- package/dist/video/context.d.ts +4 -0
- package/dist/video/context.d.ts.map +1 -0
- package/dist/video/context.js +74 -0
- package/dist/video/store.d.ts +22 -0
- package/dist/video/store.d.ts.map +1 -0
- package/dist/video/store.js +184 -0
- package/npm-shrinkwrap.json +1792 -0
- package/package.json +4 -1
- package/src/agentControls.ts +11 -7
- package/src/automations/agent.ts +11 -2
- package/src/automations/githubIssues.ts +63 -0
- package/src/automations/service.ts +25 -3
- package/src/automations/skill.ts +5 -37
- package/src/automations/workflowCrash.integration.ts +70 -0
- package/src/chat/server.ts +162 -89
- package/src/coding/agentMessages.ts +217 -0
- package/src/coding/agentSettings.ts +22 -0
- package/src/coding/fileContext.ts +72 -0
- package/src/coding/listPrs.ts +1 -1
- package/src/coding/lucidRouting.ts +211 -0
- package/src/coding/overviewSources.ts +86 -0
- package/src/coding/progress.ts +146 -0
- package/src/coding/repositoryRequests.ts +117 -0
- package/src/coding/runCodeTurn.ts +106 -92
- package/src/coding/workspaceOverview.ts +99 -0
- package/src/coding/workspaceRegistry.ts +762 -39
- package/src/coding/workspaceTitle.ts +10 -0
- package/src/coding/worktree.ts +3 -2
- package/src/coding/worktreeSetup.ts +33 -10
- package/src/config.ts +37 -2
- package/src/editor/existingWorkspace.ts +17 -0
- package/src/editor/fileActions.ts +162 -0
- package/src/editor/files.ts +276 -0
- package/src/editor/gitActions.ts +150 -0
- package/src/editor/localEndpoint.ts +28 -0
- package/src/editor/service.ts +93 -0
- package/src/editor/shellCommands.ts +132 -0
- package/src/editor/terminals.ts +129 -0
- package/src/editor/types.ts +32 -0
- package/src/files/store.ts +131 -0
- package/src/index.ts +224 -50
- package/src/install.ts +4 -2
- package/src/jobs/briefing.ts +18 -29
- package/src/jobs/extraction.ts +5 -4
- package/src/jobs/fastModeReview.ts +22 -11
- package/src/jobs/voiceReview.ts +4 -4
- package/src/jobs/weeklyReview.ts +2 -4
- package/src/lucidInvocations.ts +152 -0
- package/src/mcp/config.ts +48 -10
- package/src/mcp/paired.ts +1 -0
- package/src/providerFallbackContext.ts +48 -0
- package/src/providerRecovery.ts +3 -1
- package/src/providerRoles.ts +35 -0
- package/src/recall/command.ts +42 -0
- package/src/recall/context.ts +64 -0
- package/src/recall/conversations.ts +53 -0
- package/src/recall/documents.ts +32 -0
- package/src/recall/evaluation.ts +89 -0
- package/src/recall/factory.ts +21 -0
- package/src/recall/index.ts +87 -0
- package/src/recall/memories.ts +123 -0
- package/src/recall/memorySelection.ts +17 -0
- package/src/recall/memoryService.ts +138 -0
- package/src/recall/personal.ts +97 -0
- package/src/recall/projects.ts +98 -0
- package/src/recall/query.ts +21 -0
- package/src/recall/semanticEvaluation.ts +101 -0
- package/src/recall/service.ts +85 -0
- package/src/room/client.ts +238 -31
- package/src/room/codingActivity.ts +70 -0
- package/src/room/computer.ts +19 -3
- package/src/room/context.ts +7 -2
- package/src/room/desktop-live.integration.ts +203 -0
- package/src/room/turnQueue.ts +91 -34
- package/src/runtimeStore.ts +36 -4
- package/src/setup/page.ts +15 -2
- package/src/setup/server.ts +28 -5
- package/src/skills/install.ts +65 -0
- package/src/speech/captures.ts +56 -44
- package/src/updateCli.ts +37 -0
- package/src/updateService.ts +21 -0
- package/src/updates/admission.ts +70 -0
- package/src/updates/bootstrap.ts +77 -0
- package/src/updates/bootstrapConfig.ts +29 -0
- package/src/updates/connection.ts +84 -0
- package/src/updates/developmentAdmission.ts +56 -0
- package/src/updates/developmentCli.ts +47 -0
- package/src/updates/developmentRefresh.ts +130 -0
- package/src/updates/developmentService.ts +170 -0
- package/src/updates/download.ts +53 -0
- package/src/updates/feed.ts +34 -0
- package/src/updates/installService.ts +67 -0
- package/src/updates/installationReferences.ts +87 -0
- package/src/updates/installationStore.ts +196 -0
- package/src/updates/installer.ts +203 -0
- package/src/updates/journal.ts +250 -0
- package/src/updates/managedLifecycle.ts +64 -0
- package/src/updates/migrateService.ts +33 -0
- package/src/updates/migration.ts +92 -0
- package/src/updates/processControl.ts +96 -0
- package/src/updates/processHost.ts +159 -0
- package/src/updates/registerService.ts +27 -0
- package/src/updates/releases.ts +53 -0
- package/src/updates/retention.ts +154 -0
- package/src/updates/runner.ts +104 -0
- package/src/updates/service.ts +241 -0
- package/src/updates/servicePlan.ts +63 -0
- package/src/updates/signCatalog.ts +40 -0
- package/src/updates/supervisor.ts +114 -0
- package/src/updates/windowsService.ts +54 -0
- package/src/video/context.ts +101 -0
- package/src/video/store.ts +250 -0
- package/vendor/decisions/dist/followup.d.ts +14 -0
- package/vendor/decisions/dist/followup.js +86 -0
- package/vendor/decisions/dist/index.d.ts +3 -0
- package/vendor/decisions/dist/index.js +3 -0
- package/vendor/decisions/dist/repositoryReplay.d.ts +103 -0
- package/vendor/decisions/dist/repositoryReplay.js +177 -0
- package/vendor/decisions/dist/repositoryRouting.d.ts +21 -0
- package/vendor/decisions/dist/repositoryRouting.js +125 -0
- package/vendor/decisions/src/followup.ts +129 -0
- package/vendor/decisions/src/index.ts +3 -0
- package/vendor/decisions/src/repositoryReplay.ts +312 -0
- package/vendor/decisions/src/repositoryRouting.ts +167 -0
- package/vendor/mcp-server/README.md +6 -0
- package/vendor/mcp-server/dist/index.js +21 -7
- package/vendor/mcp-server/dist/localDaemon.d.ts +4 -0
- package/vendor/mcp-server/dist/localDaemon.d.ts.map +1 -0
- package/vendor/mcp-server/dist/localDaemon.js +41 -0
- package/vendor/mcp-server/dist/tools/agents.d.ts +3 -0
- package/vendor/mcp-server/dist/tools/agents.d.ts.map +1 -0
- package/vendor/mcp-server/dist/tools/agents.js +60 -0
- package/vendor/mcp-server/dist/tools/artifacts.d.ts +3 -0
- package/vendor/mcp-server/dist/tools/artifacts.d.ts.map +1 -0
- package/vendor/mcp-server/dist/tools/artifacts.js +22 -0
- package/vendor/mcp-server/dist/tools/automations.d.ts.map +1 -1
- package/vendor/mcp-server/dist/tools/automations.js +7 -32
- package/vendor/mcp-server/dist/tools/commandEventFormat.d.ts +1 -1
- package/vendor/mcp-server/dist/tools/commandEventFormat.js +2 -2
- package/vendor/mcp-server/dist/tools/commandEvents.js +1 -1
- package/vendor/mcp-server/dist/tools/comments.d.ts.map +1 -1
- package/vendor/mcp-server/dist/tools/comments.js +5 -1
- package/vendor/mcp-server/dist/tools/journal.d.ts.map +1 -1
- package/vendor/mcp-server/dist/tools/journal.js +1 -0
- package/vendor/mcp-server/dist/tools/memory.d.ts +0 -10
- package/vendor/mcp-server/dist/tools/memory.d.ts.map +1 -1
- package/vendor/mcp-server/dist/tools/memory.js +28 -102
- package/vendor/mcp-server/dist/tools/notes.d.ts.map +1 -1
- package/vendor/mcp-server/dist/tools/notes.js +38 -4
- package/vendor/mcp-server/dist/tools/recall.d.ts +6 -0
- package/vendor/mcp-server/dist/tools/recall.d.ts.map +1 -0
- package/vendor/mcp-server/dist/tools/recall.js +78 -0
- package/vendor/mcp-server/dist/tools/summary.d.ts +3 -0
- package/vendor/mcp-server/dist/tools/summary.d.ts.map +1 -0
- package/vendor/mcp-server/dist/tools/summary.js +22 -0
- package/vendor/mcp-server/dist/tools/taskSheet.d.ts +3 -0
- package/vendor/mcp-server/dist/tools/taskSheet.d.ts.map +1 -0
- package/vendor/mcp-server/dist/tools/taskSheet.js +32 -0
- package/vendor/mcp-server/dist/tools/tasks.d.ts.map +1 -1
- package/vendor/mcp-server/dist/tools/tasks.js +117 -24
- package/vendor/mcp-server/dist/tools/worktrees.d.ts +3 -0
- package/vendor/mcp-server/dist/tools/worktrees.d.ts.map +1 -0
- package/vendor/mcp-server/dist/tools/worktrees.js +51 -0
- package/vendor/mcp-server/package.json +1 -1
- package/vendor/mcp-server/src/index.ts +17 -7
- package/vendor/mcp-server/src/localDaemon.ts +56 -0
- package/vendor/mcp-server/src/tools/agents.ts +78 -0
- package/vendor/mcp-server/src/tools/artifacts.ts +26 -0
- package/vendor/mcp-server/src/tools/automations.ts +7 -47
- package/vendor/mcp-server/src/tools/commandEventFormat.ts +2 -2
- package/vendor/mcp-server/src/tools/commandEvents.ts +1 -1
- package/vendor/mcp-server/src/tools/comments.ts +4 -1
- package/vendor/mcp-server/src/tools/journal.ts +1 -0
- package/vendor/mcp-server/src/tools/memory.ts +37 -130
- package/vendor/mcp-server/src/tools/notes.ts +35 -5
- package/vendor/mcp-server/src/tools/recall.ts +89 -0
- package/vendor/mcp-server/src/tools/summary.ts +30 -0
- package/vendor/mcp-server/src/tools/taskSheet.ts +60 -0
- package/vendor/mcp-server/src/tools/tasks.ts +125 -24
- package/vendor/mcp-server/src/tools/worktrees.ts +61 -0
- package/vendor/notes/dist/artifacts.d.ts +8 -0
- package/vendor/notes/dist/artifacts.d.ts.map +1 -0
- package/vendor/notes/dist/artifacts.js +105 -0
- package/vendor/notes/dist/index.d.ts +1 -0
- package/vendor/notes/dist/index.d.ts.map +1 -1
- package/vendor/notes/dist/index.js +1 -0
- package/vendor/notes/dist/vault.d.ts.map +1 -1
- package/vendor/notes/dist/vault.js +2 -0
- package/vendor/notes/src/artifacts.ts +100 -0
- package/vendor/notes/src/index.ts +2 -0
- package/vendor/notes/src/vault.ts +1 -0
- package/vendor/runtime/README.md +8 -0
- package/vendor/runtime/dist/executor/claudeAgent.d.ts +18 -1
- package/vendor/runtime/dist/executor/claudeAgent.d.ts.map +1 -1
- package/vendor/runtime/dist/executor/claudeAgent.js +157 -39
- package/vendor/runtime/dist/executor/claudeCode.d.ts.map +1 -1
- package/vendor/runtime/dist/executor/claudeCode.js +19 -2
- package/vendor/runtime/dist/executor/claudeSession.d.ts +32 -0
- package/vendor/runtime/dist/executor/claudeSession.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/claudeSession.js +154 -0
- package/vendor/runtime/dist/executor/codex.d.ts +18 -2
- package/vendor/runtime/dist/executor/codex.d.ts.map +1 -1
- package/vendor/runtime/dist/executor/codex.js +134 -18
- package/vendor/runtime/dist/executor/codexSessions.d.ts +5 -10
- package/vendor/runtime/dist/executor/codexSessions.d.ts.map +1 -1
- package/vendor/runtime/dist/executor/codexSessions.js +12 -78
- package/vendor/runtime/dist/executor/fallback.d.ts +27 -0
- package/vendor/runtime/dist/executor/fallback.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/fallback.js +45 -0
- package/vendor/runtime/dist/executor/health.d.ts +19 -1
- package/vendor/runtime/dist/executor/health.d.ts.map +1 -1
- package/vendor/runtime/dist/executor/health.js +19 -2
- package/vendor/runtime/dist/executor/integrations.d.ts +4 -0
- package/vendor/runtime/dist/executor/integrations.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/integrations.js +5 -0
- package/vendor/runtime/dist/executor/liveTurns.d.ts +2 -2
- package/vendor/runtime/dist/executor/liveTurns.d.ts.map +1 -1
- package/vendor/runtime/dist/executor/liveTurns.js +3 -3
- package/vendor/runtime/dist/executor/ownership.d.ts +18 -1
- package/vendor/runtime/dist/executor/ownership.d.ts.map +1 -1
- package/vendor/runtime/dist/executor/ownership.js +3 -1
- package/vendor/runtime/dist/executor/providerRouter.d.ts +13 -0
- package/vendor/runtime/dist/executor/providerRouter.d.ts.map +1 -1
- package/vendor/runtime/dist/executor/providerRouter.js +91 -5
- package/vendor/runtime/dist/executor/sessionRetention.d.ts +34 -0
- package/vendor/runtime/dist/executor/sessionRetention.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/sessionRetention.js +126 -0
- package/vendor/runtime/dist/executor/types.d.ts +30 -7
- package/vendor/runtime/dist/executor/types.d.ts.map +1 -1
- package/vendor/runtime/dist/executor/usage.d.ts +5 -0
- package/vendor/runtime/dist/executor/usage.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/usage.js +56 -0
- package/vendor/runtime/dist/harness/index.d.ts.map +1 -1
- package/vendor/runtime/dist/harness/index.js +2 -5
- package/vendor/runtime/dist/harness/types.d.ts +3 -1
- package/vendor/runtime/dist/harness/types.d.ts.map +1 -1
- package/vendor/runtime/dist/index.d.ts +6 -1
- package/vendor/runtime/dist/index.d.ts.map +1 -1
- package/vendor/runtime/dist/index.js +3 -0
- package/vendor/runtime/dist/prompts/recall.d.ts +15 -0
- package/vendor/runtime/dist/prompts/recall.d.ts.map +1 -0
- package/vendor/runtime/dist/prompts/recall.js +71 -0
- package/vendor/runtime/src/executor/claudeAgent.ts +149 -37
- package/vendor/runtime/src/executor/claudeCode.ts +17 -3
- package/vendor/runtime/src/executor/claudeSession.ts +180 -0
- package/vendor/runtime/src/executor/codex.ts +136 -21
- package/vendor/runtime/src/executor/codexSessions.ts +18 -82
- package/vendor/runtime/src/executor/fallback.ts +63 -0
- package/vendor/runtime/src/executor/health.ts +16 -2
- package/vendor/runtime/src/executor/integrations.ts +7 -0
- package/vendor/runtime/src/executor/liveTurns.ts +5 -5
- package/vendor/runtime/src/executor/ownership.ts +3 -1
- package/vendor/runtime/src/executor/providerRouter.ts +85 -4
- package/vendor/runtime/src/executor/sessionRetention.ts +166 -0
- package/vendor/runtime/src/executor/types.ts +27 -7
- package/vendor/runtime/src/executor/usage.ts +58 -0
- package/vendor/runtime/src/harness/index.ts +2 -5
- package/vendor/runtime/src/harness/types.ts +3 -1
- package/vendor/runtime/src/index.ts +7 -1
- package/vendor/runtime/src/prompts/recall.ts +72 -0
- package/vendor/shared/dist/accountDevices.d.ts +62 -0
- package/vendor/shared/dist/accountDevices.d.ts.map +1 -0
- package/vendor/shared/dist/accountDevices.js +25 -0
- package/vendor/shared/dist/activityRecovery.d.ts +37 -0
- package/vendor/shared/dist/activityRecovery.d.ts.map +1 -0
- package/vendor/shared/dist/activityRecovery.js +39 -0
- package/vendor/shared/dist/agentMessages.d.ts +187 -0
- package/vendor/shared/dist/agentMessages.d.ts.map +1 -0
- package/vendor/shared/dist/agentMessages.js +70 -0
- package/vendor/shared/dist/aiUsage.d.ts +30 -0
- package/vendor/shared/dist/aiUsage.d.ts.map +1 -0
- package/vendor/shared/dist/aiUsage.js +14 -0
- package/vendor/shared/dist/artifacts.d.ts +28 -0
- package/vendor/shared/dist/artifacts.d.ts.map +1 -0
- package/vendor/shared/dist/artifacts.js +47 -0
- package/vendor/shared/dist/automationTemplates.d.ts.map +1 -1
- package/vendor/shared/dist/automationTemplates.js +1 -0
- package/vendor/shared/dist/automations.d.ts +61 -14
- package/vendor/shared/dist/automations.d.ts.map +1 -1
- package/vendor/shared/dist/automations.js +10 -3
- package/vendor/shared/dist/cardStudio.d.ts +31 -31
- package/vendor/shared/dist/chatActivity.d.ts +17 -0
- package/vendor/shared/dist/chatActivity.d.ts.map +1 -0
- package/vendor/shared/dist/chatActivity.js +47 -0
- package/vendor/shared/dist/codingActivity.d.ts +60 -0
- package/vendor/shared/dist/codingActivity.d.ts.map +1 -0
- package/vendor/shared/dist/codingActivity.js +33 -0
- package/vendor/shared/dist/commandLocal.d.ts +1 -1
- package/vendor/shared/dist/commandLocal.d.ts.map +1 -1
- package/vendor/shared/dist/commands.d.ts +32 -32
- package/vendor/shared/dist/commands.d.ts.map +1 -1
- package/vendor/shared/dist/commands.js +1 -1
- package/vendor/shared/dist/commentMentions.d.ts +20 -0
- package/vendor/shared/dist/commentMentions.d.ts.map +1 -0
- package/vendor/shared/dist/commentMentions.js +14 -0
- package/vendor/shared/dist/computer.d.ts +48 -8
- package/vendor/shared/dist/computer.d.ts.map +1 -1
- package/vendor/shared/dist/computer.js +25 -0
- package/vendor/shared/dist/constants.d.ts +1 -1
- package/vendor/shared/dist/constants.d.ts.map +1 -1
- package/vendor/shared/dist/constants.js +5 -0
- package/vendor/shared/dist/daemonUpdates.d.ts +123 -0
- package/vendor/shared/dist/daemonUpdates.d.ts.map +1 -0
- package/vendor/shared/dist/daemonUpdates.js +106 -0
- package/vendor/shared/dist/deviceInteraction.d.ts +23 -0
- package/vendor/shared/dist/deviceInteraction.d.ts.map +1 -0
- package/vendor/shared/dist/deviceInteraction.js +32 -0
- package/vendor/shared/dist/doctor.d.ts +50 -0
- package/vendor/shared/dist/doctor.d.ts.map +1 -0
- package/vendor/shared/dist/doctor.js +15 -0
- package/vendor/shared/dist/fileUploads.d.ts +39 -0
- package/vendor/shared/dist/fileUploads.d.ts.map +1 -0
- package/vendor/shared/dist/fileUploads.js +24 -0
- package/vendor/shared/dist/files.d.ts +11 -0
- package/vendor/shared/dist/files.d.ts.map +1 -0
- package/vendor/shared/dist/files.js +19 -0
- package/vendor/shared/dist/githubContributions.d.ts +1 -1
- package/vendor/shared/dist/goals.d.ts +7 -7
- package/vendor/shared/dist/index.d.ts +29 -2
- package/vendor/shared/dist/index.d.ts.map +1 -1
- package/vendor/shared/dist/index.js +26 -1
- package/vendor/shared/dist/lucidFollowups.d.ts +95 -0
- package/vendor/shared/dist/lucidFollowups.d.ts.map +1 -0
- package/vendor/shared/dist/lucidFollowups.js +45 -0
- package/vendor/shared/dist/lucidInvocations.d.ts +82 -0
- package/vendor/shared/dist/lucidInvocations.d.ts.map +1 -0
- package/vendor/shared/dist/lucidInvocations.js +47 -0
- package/vendor/shared/dist/memory.d.ts +162 -0
- package/vendor/shared/dist/memory.d.ts.map +1 -0
- package/vendor/shared/dist/memory.js +26 -0
- package/vendor/shared/dist/messagingSafety.d.ts +43 -0
- package/vendor/shared/dist/messagingSafety.d.ts.map +1 -1
- package/vendor/shared/dist/messagingSafety.js +6 -0
- package/vendor/shared/dist/recall.d.ts +803 -0
- package/vendor/shared/dist/recall.d.ts.map +1 -0
- package/vendor/shared/dist/recall.js +56 -0
- package/vendor/shared/dist/releaseCompatibility.d.ts +228 -0
- package/vendor/shared/dist/releaseCompatibility.d.ts.map +1 -0
- package/vendor/shared/dist/releaseCompatibility.js +145 -0
- package/vendor/shared/dist/repositoryRequests.d.ts +173 -0
- package/vendor/shared/dist/repositoryRequests.d.ts.map +1 -0
- package/vendor/shared/dist/repositoryRequests.js +38 -0
- package/vendor/shared/dist/repositoryRouting.d.ts +169 -0
- package/vendor/shared/dist/repositoryRouting.d.ts.map +1 -0
- package/vendor/shared/dist/repositoryRouting.js +102 -0
- package/vendor/shared/dist/roomClient.d.ts +107 -0
- package/vendor/shared/dist/roomClient.d.ts.map +1 -0
- package/vendor/shared/dist/roomClient.js +371 -0
- package/vendor/shared/dist/schemas/comment.d.ts +46 -0
- package/vendor/shared/dist/schemas/comment.d.ts.map +1 -1
- package/vendor/shared/dist/schemas/comment.js +10 -0
- package/vendor/shared/dist/schemas/conversation.d.ts +80 -1
- package/vendor/shared/dist/schemas/conversation.d.ts.map +1 -1
- package/vendor/shared/dist/schemas/conversation.js +12 -1
- package/vendor/shared/dist/schemas/harness.d.ts +1631 -17
- package/vendor/shared/dist/schemas/harness.d.ts.map +1 -1
- package/vendor/shared/dist/schemas/harness.js +106 -3
- package/vendor/shared/dist/schemas/notification.d.ts +3 -1
- package/vendor/shared/dist/schemas/notification.d.ts.map +1 -1
- package/vendor/shared/dist/schemas/notification.js +2 -1
- package/vendor/shared/dist/schemas/organization.d.ts +2 -0
- package/vendor/shared/dist/schemas/organization.d.ts.map +1 -1
- package/vendor/shared/dist/schemas/organization.js +2 -0
- package/vendor/shared/dist/schemas/project.d.ts +2 -2
- package/vendor/shared/dist/schemas/request.d.ts +1 -1
- package/vendor/shared/dist/schemas/task.d.ts +1 -1
- package/vendor/shared/dist/smartCapture.js +1 -1
- package/vendor/shared/dist/spokenNames.d.ts +1 -1
- package/vendor/shared/dist/spokenNames.js +1 -1
- package/vendor/shared/dist/taskActivity.d.ts +5 -5
- package/vendor/shared/dist/taskSharing.d.ts +8 -0
- package/vendor/shared/dist/taskSharing.d.ts.map +1 -0
- package/vendor/shared/dist/taskSharing.js +9 -0
- package/vendor/shared/dist/thinking-orb/engine/core.d.ts +31 -0
- package/vendor/shared/dist/thinking-orb/engine/core.d.ts.map +1 -0
- package/vendor/shared/dist/thinking-orb/engine/core.js +62 -0
- package/vendor/shared/dist/thinking-orb/engine/ctx.d.ts +9 -0
- package/vendor/shared/dist/thinking-orb/engine/ctx.d.ts.map +1 -0
- package/vendor/shared/dist/thinking-orb/engine/ctx.js +1 -0
- package/vendor/shared/dist/thinking-orb/engine/lattice.d.ts +5 -0
- package/vendor/shared/dist/thinking-orb/engine/lattice.d.ts.map +1 -0
- package/vendor/shared/dist/thinking-orb/engine/lattice.js +184 -0
- package/vendor/shared/dist/thinking-orb/engine/morph.d.ts +3 -0
- package/vendor/shared/dist/thinking-orb/engine/morph.d.ts.map +1 -0
- package/vendor/shared/dist/thinking-orb/engine/morph.js +117 -0
- package/vendor/shared/dist/thinking-orb/engine/orbits.d.ts +3 -0
- package/vendor/shared/dist/thinking-orb/engine/orbits.d.ts.map +1 -0
- package/vendor/shared/dist/thinking-orb/engine/orbits.js +66 -0
- package/vendor/shared/dist/thinking-orb/engine/profiles.d.ts +8 -0
- package/vendor/shared/dist/thinking-orb/engine/profiles.d.ts.map +1 -0
- package/vendor/shared/dist/thinking-orb/engine/profiles.js +113 -0
- package/vendor/shared/dist/thinking-orb/engine/registry.d.ts +4 -0
- package/vendor/shared/dist/thinking-orb/engine/registry.d.ts.map +1 -0
- package/vendor/shared/dist/thinking-orb/engine/registry.js +14 -0
- package/vendor/shared/dist/thinking-orb/engine/ribbon.d.ts +3 -0
- package/vendor/shared/dist/thinking-orb/engine/ribbon.d.ts.map +1 -0
- package/vendor/shared/dist/thinking-orb/engine/ribbon.js +64 -0
- package/vendor/shared/dist/thinking-orb/engine/types.d.ts +6 -0
- package/vendor/shared/dist/thinking-orb/engine/types.d.ts.map +1 -0
- package/vendor/shared/dist/thinking-orb/engine/types.js +2 -0
- package/vendor/shared/dist/thinking-orb/index.d.ts +7 -0
- package/vendor/shared/dist/thinking-orb/index.d.ts.map +1 -0
- package/vendor/shared/dist/thinking-orb/index.js +2 -0
- package/vendor/shared/dist/thinking-orb/presets.d.ts +12 -0
- package/vendor/shared/dist/thinking-orb/presets.d.ts.map +1 -0
- package/vendor/shared/dist/thinking-orb/presets.js +67 -0
- package/vendor/shared/dist/thinking-orb/types.d.ts +24 -0
- package/vendor/shared/dist/thinking-orb/types.d.ts.map +1 -0
- package/vendor/shared/dist/thinking-orb/types.js +1 -0
- package/vendor/shared/dist/turnTiming.d.ts +13 -0
- package/vendor/shared/dist/turnTiming.d.ts.map +1 -0
- package/vendor/shared/dist/turnTiming.js +18 -0
- package/vendor/shared/dist/types.d.ts +3 -1
- package/vendor/shared/dist/types.d.ts.map +1 -1
- package/vendor/shared/dist/updateControl.d.ts +168 -0
- package/vendor/shared/dist/updateControl.d.ts.map +1 -0
- package/vendor/shared/dist/updateControl.js +43 -0
- package/vendor/shared/dist/videos.d.ts +31 -0
- package/vendor/shared/dist/videos.d.ts.map +1 -0
- package/vendor/shared/dist/videos.js +34 -0
- package/vendor/shared/dist/workspaceIO.d.ts +188 -0
- package/vendor/shared/dist/workspaceIO.d.ts.map +1 -0
- package/vendor/shared/dist/workspaceIO.js +50 -0
- package/vendor/shared/dist/workspaces.d.ts +740 -2
- package/vendor/shared/dist/workspaces.d.ts.map +1 -1
- package/vendor/shared/dist/workspaces.js +108 -2
- package/vendor/shared/package.json +12 -0
- package/vendor/shared/src/accountDevices.ts +28 -0
- package/vendor/shared/src/activityRecovery.ts +42 -0
- package/vendor/shared/src/agentMessages.ts +82 -0
- package/vendor/shared/src/aiUsage.ts +18 -0
- package/vendor/shared/src/artifacts.ts +48 -0
- package/vendor/shared/src/automationTemplates.ts +1 -0
- package/vendor/shared/src/automations.ts +10 -3
- package/vendor/shared/src/chatActivity.ts +56 -0
- package/vendor/shared/src/codingActivity.ts +40 -0
- package/vendor/shared/src/commandLocal.ts +1 -1
- package/vendor/shared/src/commands.ts +1 -1
- package/vendor/shared/src/commentMentions.ts +20 -0
- package/vendor/shared/src/computer.ts +40 -0
- package/vendor/shared/src/constants.ts +5 -0
- package/vendor/shared/src/daemonUpdates.ts +127 -0
- package/vendor/shared/src/deviceInteraction.ts +35 -0
- package/vendor/shared/src/doctor.ts +19 -0
- package/vendor/shared/src/fileUploads.ts +28 -0
- package/vendor/shared/src/files.ts +21 -0
- package/vendor/shared/src/index.ts +35 -1
- package/vendor/shared/src/lucidFollowups.ts +49 -0
- package/vendor/shared/src/lucidInvocations.ts +62 -0
- package/vendor/shared/src/memory.ts +30 -0
- package/vendor/shared/src/messagingSafety.ts +10 -0
- package/vendor/shared/src/recall.ts +69 -0
- package/vendor/shared/src/releaseCompatibility.ts +162 -0
- package/vendor/shared/src/repositoryRequests.ts +44 -0
- package/vendor/shared/src/repositoryRouting.ts +117 -0
- package/vendor/shared/src/roomClient.ts +351 -0
- package/vendor/shared/src/schemas/comment.ts +10 -0
- package/vendor/shared/src/schemas/conversation.ts +12 -1
- package/vendor/shared/src/schemas/harness.ts +120 -3
- package/vendor/shared/src/schemas/notification.ts +2 -1
- package/vendor/shared/src/schemas/organization.ts +2 -0
- package/vendor/shared/src/smartCapture.ts +1 -1
- package/vendor/shared/src/spokenNames.ts +1 -1
- package/vendor/shared/src/taskSharing.ts +13 -0
- package/vendor/shared/src/thinking-orb/ATTRIBUTION.md +36 -0
- package/vendor/shared/src/thinking-orb/engine/core.ts +81 -0
- package/vendor/shared/src/thinking-orb/engine/ctx.ts +15 -0
- package/vendor/shared/src/thinking-orb/engine/lattice.ts +205 -0
- package/vendor/shared/src/thinking-orb/engine/morph.ts +130 -0
- package/vendor/shared/src/thinking-orb/engine/orbits.ts +80 -0
- package/vendor/shared/src/thinking-orb/engine/profiles.ts +119 -0
- package/vendor/shared/src/thinking-orb/engine/registry.ts +18 -0
- package/vendor/shared/src/thinking-orb/engine/ribbon.ts +71 -0
- package/vendor/shared/src/thinking-orb/engine/types.ts +15 -0
- package/vendor/shared/src/thinking-orb/index.ts +6 -0
- package/vendor/shared/src/thinking-orb/presets.ts +88 -0
- package/vendor/shared/src/thinking-orb/types.ts +25 -0
- package/vendor/shared/src/turnTiming.ts +20 -0
- package/vendor/shared/src/types.ts +1 -1
- package/vendor/shared/src/updateControl.ts +45 -0
- package/vendor/shared/src/videos.ts +37 -0
- package/vendor/shared/src/workspaceIO.ts +61 -0
- package/vendor/shared/src/workspaces.ts +119 -2
package/src/room/client.ts
CHANGED
|
@@ -1,11 +1,21 @@
|
|
|
1
|
+
import type { FileStore } from '../files/store.js';
|
|
2
|
+
import type { CodingProgressChecks } from '../coding/progress.js';
|
|
3
|
+
import type { HarnessFile, WorkspaceIOCommand } from '@lucidity/shared';
|
|
4
|
+
import { recallCommand, type RecallBackend } from '../recall/command.js';
|
|
5
|
+
import type { VideoStore } from '../video/store.js';
|
|
1
6
|
import { publishDurably } from './durablePublish.js';
|
|
7
|
+
import { CodingActivityTracker } from './codingActivity.js';
|
|
2
8
|
import { computerId, computerRuntime } from './computer.js';
|
|
3
9
|
import { DurableTurnQueue } from './turnQueue.js';
|
|
10
|
+
import { WorkPausedError, type WorkAdmission } from '../updates/admission.js';
|
|
4
11
|
import type { AgentControls } from '../agentControls.js';
|
|
5
12
|
import type { AgentProvider, ExecutorModel } from '@lucidity/runtime';
|
|
6
13
|
import { WebSocket } from 'ws';
|
|
7
14
|
import {
|
|
8
15
|
HarnessRequestSchema,
|
|
16
|
+
DaemonUpdateReadySchema,
|
|
17
|
+
DAEMON_UPDATE_PROTOCOL,
|
|
18
|
+
type HarnessRequest,
|
|
9
19
|
type AgentCommandOption,
|
|
10
20
|
type AgentCommandContext,
|
|
11
21
|
computerAvailability,
|
|
@@ -51,7 +61,7 @@ import type { SpeechService } from '../speech/service.js';
|
|
|
51
61
|
import { VoiceCaptureService } from '../speech/captures.js';
|
|
52
62
|
import { CONFIG_DIR } from '../config.js';
|
|
53
63
|
import { handoffPrompt } from '../handoff.js';
|
|
54
|
-
import { createHash } from 'node:crypto';
|
|
64
|
+
import { createHash, randomUUID } from 'node:crypto';
|
|
55
65
|
import { join } from 'node:path';
|
|
56
66
|
import { uuidv7 } from 'uuidv7';
|
|
57
67
|
import type { WorkspaceRegistry } from '../coding/workspaceRegistry.js';
|
|
@@ -68,8 +78,10 @@ const STREAM_EVENT_TYPES = new Set([
|
|
|
68
78
|
'session',
|
|
69
79
|
'approval_request',
|
|
70
80
|
'approval_resolved',
|
|
81
|
+
'coding_progress',
|
|
71
82
|
'delta',
|
|
72
83
|
'tool_call',
|
|
84
|
+
'artifact',
|
|
73
85
|
'done',
|
|
74
86
|
'code_result',
|
|
75
87
|
'clone_result',
|
|
@@ -91,11 +103,18 @@ const STREAM_EVENT_TYPES = new Set([
|
|
|
91
103
|
|
|
92
104
|
export type CodeHandler = (
|
|
93
105
|
req: {
|
|
106
|
+
senderKind?: 'human' | 'agent';
|
|
107
|
+
agentMessage?: import('@lucidity/shared').AgentMessage;
|
|
108
|
+
teamRequest?: import('@lucidity/shared').RepositoryRequest;
|
|
109
|
+
replyTo?: import('@lucidity/shared').ConversationSource;
|
|
94
110
|
recoveryOf?: string;
|
|
95
111
|
id: string;
|
|
96
112
|
repoId: string;
|
|
97
113
|
prompt: string;
|
|
114
|
+
queuedFollowUps?: number;
|
|
98
115
|
images?: HarnessImage[];
|
|
116
|
+
files?: HarnessFile[];
|
|
117
|
+
videos?: string[];
|
|
99
118
|
resume?: string;
|
|
100
119
|
provider?: AgentProvider;
|
|
101
120
|
handoff?: ProviderHandoff;
|
|
@@ -123,15 +142,23 @@ export interface RepoInfo {
|
|
|
123
142
|
}
|
|
124
143
|
|
|
125
144
|
export interface DispatchDeps {
|
|
145
|
+
workspaceIO?: (command: WorkspaceIOCommand) => Promise<unknown>;
|
|
146
|
+
recallService?: RecallBackend;
|
|
147
|
+
admission?: WorkAdmission;
|
|
148
|
+
videos?: VideoStore;
|
|
149
|
+
files?: FileStore;
|
|
126
150
|
workspaces?: WorkspaceRegistry;
|
|
127
151
|
speech?: Pick<SpeechService, 'transcribe'>;
|
|
128
152
|
captures?: Pick<VoiceCaptureService, 'submit' | 'status'>;
|
|
129
153
|
turnQueue?: DurableTurnQueue;
|
|
130
154
|
recordAcceptance?: boolean;
|
|
131
155
|
runtime?: () => ComputerRuntime;
|
|
156
|
+
progressChecks?: CodingProgressChecks;
|
|
132
157
|
controls?: AgentControls;
|
|
133
158
|
models?: (provider: AgentProvider) => Promise<ExecutorModel[]>;
|
|
159
|
+
usage?: (provider: AgentProvider) => Promise<import('@lucidity/shared').AiUsage>;
|
|
134
160
|
commands?: (provider: AgentProvider, context?: AgentCommandContext) => Promise<AgentCommandOption[]>;
|
|
161
|
+
mcpStatus?: (provider: AgentProvider, context?: AgentCommandContext) => Promise<import('@lucidity/shared').AgentMcpServer[]>;
|
|
135
162
|
harness: LucidHarness;
|
|
136
163
|
askContext: (query?: string) => Promise<AskContext>;
|
|
137
164
|
briefingContext: () => Promise<BriefingContext>;
|
|
@@ -201,7 +228,7 @@ function sendStreamEvent(
|
|
|
201
228
|
send({ type: 'session', requestId, sessionId: ev.sessionId });
|
|
202
229
|
else if (ev.type === 'delta')
|
|
203
230
|
send({ type: 'delta', requestId, text: ev.text });
|
|
204
|
-
else if (ev.type === 'tool_call')
|
|
231
|
+
else if (ev.type === 'tool_call' || ev.type === 'artifact' || ev.type === 'compaction')
|
|
205
232
|
send({ ...ev, requestId });
|
|
206
233
|
else
|
|
207
234
|
send({
|
|
@@ -224,17 +251,6 @@ export async function dispatchRequest(
|
|
|
224
251
|
raw: string,
|
|
225
252
|
deps: DispatchDeps,
|
|
226
253
|
): Promise<void> {
|
|
227
|
-
const {
|
|
228
|
-
harness,
|
|
229
|
-
askContext,
|
|
230
|
-
briefingContext,
|
|
231
|
-
send: sendFrame,
|
|
232
|
-
signal: outerSignal,
|
|
233
|
-
inFlight,
|
|
234
|
-
attention,
|
|
235
|
-
} = deps;
|
|
236
|
-
const log = deps.logger ?? ((m: string) => console.error(`[room] ${m}`));
|
|
237
|
-
|
|
238
254
|
let json: unknown;
|
|
239
255
|
try {
|
|
240
256
|
json = JSON.parse(raw);
|
|
@@ -251,7 +267,7 @@ export async function dispatchRequest(
|
|
|
251
267
|
invalid.id,
|
|
252
268
|
)
|
|
253
269
|
) {
|
|
254
|
-
|
|
270
|
+
deps.sendRaw({
|
|
255
271
|
type: 'error',
|
|
256
272
|
requestId: invalid.id,
|
|
257
273
|
message: 'Use a supported audio recording under 10 MB.',
|
|
@@ -260,6 +276,33 @@ export async function dispatchRequest(
|
|
|
260
276
|
return;
|
|
261
277
|
}
|
|
262
278
|
const req = parsed.data;
|
|
279
|
+
const execute = () => dispatchParsedRequest(req, deps);
|
|
280
|
+
if (!deps.admission) return execute();
|
|
281
|
+
try {
|
|
282
|
+
const control = ['pull', 'cancel', 'permission', 'steer', 'queue-control', 'progress-check'].includes(req.kind)
|
|
283
|
+
|| (req.kind === 'workspace-io' && ['terminalRead', 'terminalWrite', 'terminalResize', 'stopRun', 'shellList', 'shellStop'].includes(req.command.operation.action))
|
|
284
|
+
|| (req.kind === 'automation' && req.command.action === 'cancel');
|
|
285
|
+
if (control) await deps.admission.control(execute);
|
|
286
|
+
else await deps.admission.run(execute);
|
|
287
|
+
} catch (error) {
|
|
288
|
+
if (!(error instanceof WorkPausedError)) throw error;
|
|
289
|
+
// Rejection must not write a terminal into an already accepted turn's log.
|
|
290
|
+
deps.sendRaw({ type: 'error', requestId: req.id, code: 'daemon_updating', message: error.message });
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
async function dispatchParsedRequest(req: HarnessRequest, deps: DispatchDeps): Promise<void> {
|
|
295
|
+
const {
|
|
296
|
+
harness,
|
|
297
|
+
askContext,
|
|
298
|
+
briefingContext,
|
|
299
|
+
send: sendFrame,
|
|
300
|
+
signal: outerSignal,
|
|
301
|
+
inFlight,
|
|
302
|
+
attention,
|
|
303
|
+
} = deps;
|
|
304
|
+
const log = deps.logger ?? ((m: string) => console.error(`[room] ${m}`));
|
|
305
|
+
|
|
263
306
|
const structured = req.kind === 'ask' && (req.dayPlan ? 'day-plan' : req.projectPlan ? 'project-plan' : undefined);
|
|
264
307
|
let deferTerminal = false;
|
|
265
308
|
let terminal: Record<string, unknown> | undefined;
|
|
@@ -321,7 +364,14 @@ export async function dispatchRequest(
|
|
|
321
364
|
throw new Error(
|
|
322
365
|
'Update Lucidity on your computer to manage queued messages.',
|
|
323
366
|
);
|
|
367
|
+
if (req.action === 'draft') {
|
|
368
|
+
if (req.senderKind !== 'human') throw new Error('Editing queued messages requires a human client.');
|
|
369
|
+
send({ kind: 'control', requestId: req.id, accepted: true, queuedDraft: deps.turnQueue.draft(req.targetId, req.includeFiles) });
|
|
370
|
+
return;
|
|
371
|
+
}
|
|
324
372
|
await deps.turnQueue.control(req.targetId, req.action, req.activeId);
|
|
373
|
+
if (req.action === 'steer' && req.activeId)
|
|
374
|
+
deps.workspaces?.recordQueuedSteering(req.activeId, req.targetId);
|
|
325
375
|
send({ kind: 'control', requestId: req.id, accepted: true });
|
|
326
376
|
} catch (error) {
|
|
327
377
|
send({
|
|
@@ -413,12 +463,22 @@ export async function dispatchRequest(
|
|
|
413
463
|
return;
|
|
414
464
|
}
|
|
415
465
|
|
|
466
|
+
if (req.kind === 'progress-check') {
|
|
467
|
+
try {
|
|
468
|
+
if (!deps.progressChecks) throw new Error('Update Lucidity on your computer to check progress.');
|
|
469
|
+
await deps.progressChecks.check(req.targetId);
|
|
470
|
+
send({ kind: 'control', requestId: req.id, accepted: true });
|
|
471
|
+
} catch (error) {
|
|
472
|
+
send({ kind: 'control', requestId: req.id, accepted: false, message: (error as Error).message });
|
|
473
|
+
}
|
|
474
|
+
return;
|
|
475
|
+
}
|
|
416
476
|
if (req.kind === 'steer' || req.kind === 'permission') {
|
|
417
477
|
const control = req;
|
|
418
478
|
const result = deps.controls
|
|
419
479
|
? await deps.controls.once(req.id, JSON.stringify(req), async () => {
|
|
420
480
|
if (control.kind === 'steer')
|
|
421
|
-
await deps.controls!.steer(control.targetId, control.prompt);
|
|
481
|
+
await deps.controls!.steer(control.targetId, control.prompt, control.images);
|
|
422
482
|
else
|
|
423
483
|
deps.controls!.approve(
|
|
424
484
|
control.targetId,
|
|
@@ -430,9 +490,39 @@ export async function dispatchRequest(
|
|
|
430
490
|
accepted: false,
|
|
431
491
|
message: 'Live controls are unavailable on this daemon.',
|
|
432
492
|
};
|
|
493
|
+
if (req.kind === 'steer' && result.accepted)
|
|
494
|
+
deps.workspaces?.recordOverviewSteering(req.targetId, req.id, req.prompt, req.images, req.imageOnly);
|
|
433
495
|
send({ kind: 'control', requestId: req.id, ...result });
|
|
434
496
|
return;
|
|
435
497
|
}
|
|
498
|
+
if (req.kind === 'file-upload') {
|
|
499
|
+
try {
|
|
500
|
+
if (!deps.files) throw new Error('Update Lucidity on your computer to upload files.');
|
|
501
|
+
send({ kind: 'file-upload', requestId: req.id, receipt: await deps.files.command(req.command) });
|
|
502
|
+
} catch (error) {
|
|
503
|
+
send({ type: 'error', requestId: req.id, message: error instanceof Error ? error.message : 'File upload failed.' });
|
|
504
|
+
}
|
|
505
|
+
return;
|
|
506
|
+
}
|
|
507
|
+
if (req.kind === 'video-upload') {
|
|
508
|
+
try {
|
|
509
|
+
if (!deps.videos) throw new Error('Update Lucidity on your computer to attach videos.');
|
|
510
|
+
send({ kind: 'video-upload', requestId: req.id, receipt: await deps.videos.command(req.command) });
|
|
511
|
+
} catch (error) {
|
|
512
|
+
send({ type: 'error', requestId: req.id, message: error instanceof Error ? error.message : 'Video upload failed.' });
|
|
513
|
+
}
|
|
514
|
+
return;
|
|
515
|
+
}
|
|
516
|
+
if (req.kind === 'mcp-status') {
|
|
517
|
+
try {
|
|
518
|
+
if (!deps.mcpStatus) throw new Error('MCP status is unavailable.');
|
|
519
|
+
send({ kind: 'mcp-status', requestId: req.id, provider: req.provider, servers: await deps.mcpStatus(req.provider, req.context) });
|
|
520
|
+
} catch {
|
|
521
|
+
// Provider diagnostics can contain server configuration or credentials.
|
|
522
|
+
send({ type: 'error', requestId: req.id, message: 'Could not check MCP connections. Try again.' });
|
|
523
|
+
}
|
|
524
|
+
return;
|
|
525
|
+
}
|
|
436
526
|
if (req.kind === 'commands') {
|
|
437
527
|
try {
|
|
438
528
|
if (!deps.commands)
|
|
@@ -453,6 +543,15 @@ export async function dispatchRequest(
|
|
|
453
543
|
}
|
|
454
544
|
return;
|
|
455
545
|
}
|
|
546
|
+
if (req.kind === 'usage') {
|
|
547
|
+
try {
|
|
548
|
+
if (!deps.usage) throw new Error('Usage is unavailable.');
|
|
549
|
+
send({ kind: 'usage', requestId: req.id, usage: await deps.usage(req.provider) });
|
|
550
|
+
} catch {
|
|
551
|
+
send({ type: 'error', requestId: req.id, message: 'Usage is unavailable. Try again in a moment.' });
|
|
552
|
+
}
|
|
553
|
+
return;
|
|
554
|
+
}
|
|
456
555
|
if (req.kind === 'models') {
|
|
457
556
|
try {
|
|
458
557
|
send({
|
|
@@ -526,6 +625,11 @@ export async function dispatchRequest(
|
|
|
526
625
|
try {
|
|
527
626
|
if (!deps.turnQueue)
|
|
528
627
|
throw new Error('Update Lucidity on your computer to queue messages.');
|
|
628
|
+
if (req.kind === 'code' && req.expectedConversationRevision !== undefined && !deps.turnLogs.runtime.command(req.id)) {
|
|
629
|
+
const workspace = deps.workspaces?.editorWorkspace({ repoId: req.repoId, workerId: req.workerId, checkout: req.mode === 'in-place' }, true);
|
|
630
|
+
if (!workspace || workspace.revision !== req.expectedConversationRevision)
|
|
631
|
+
throw new Error('This conversation changed before your message arrived. Remove the saved message and send it in the current conversation.');
|
|
632
|
+
}
|
|
529
633
|
deps.turnQueue.enqueue(req);
|
|
530
634
|
} catch (error) {
|
|
531
635
|
send({
|
|
@@ -715,6 +819,13 @@ export async function dispatchRequest(
|
|
|
715
819
|
entries: result.entries,
|
|
716
820
|
nextBefore: result.nextBefore,
|
|
717
821
|
});
|
|
822
|
+
} else if (req.kind === 'recall') {
|
|
823
|
+
if (!deps.recallService) throw new Error('Update Lucidity on your computer to read recalled sources.');
|
|
824
|
+
send({ requestId: req.id, kind: 'recall', result: await recallCommand(deps.recallService, req.command) });
|
|
825
|
+
} else if (req.kind === 'workspace-io') {
|
|
826
|
+
if (req.senderKind !== 'human') throw new Error('Desktop workspace controls require a human client.');
|
|
827
|
+
if (!deps.workspaceIO) throw new Error('Update Lucidity on your paired computer to use desktop workspace tools.');
|
|
828
|
+
send({ requestId: req.id, kind: 'workspace-io', result: await deps.workspaceIO(req.command) });
|
|
718
829
|
} else if (req.kind === 'workspaces') {
|
|
719
830
|
if (!deps.workspaces) throw new Error('Update Lucidity on the computer to use persistent workers.');
|
|
720
831
|
if (req.command.action === 'continue-run') {
|
|
@@ -806,9 +917,16 @@ export async function dispatchRequest(
|
|
|
806
917
|
deps.codeHandler!(
|
|
807
918
|
{
|
|
808
919
|
id: req.id,
|
|
920
|
+
...(req.agentMessage ? { agentMessage: req.agentMessage, senderKind: req.senderKind } : {}),
|
|
921
|
+
...(req.teamRequest ? { teamRequest: req.teamRequest, senderKind: req.senderKind } : {}),
|
|
809
922
|
repoId: req.repoId,
|
|
810
923
|
prompt: req.prompt,
|
|
924
|
+
...(req.replyTo ? { replyTo: req.replyTo } : {}),
|
|
925
|
+
...(deps.turnQueue?.pendingAfter(req.id) !== undefined ? { queuedFollowUps: deps.turnQueue.pendingAfter(req.id) } : {}),
|
|
811
926
|
images: req.images,
|
|
927
|
+
...(req.files?.length ? { files: req.files } : {}),
|
|
928
|
+
...(req.uploadedFiles?.length ? { uploadedFiles: req.uploadedFiles } : {}),
|
|
929
|
+
...(req.videos?.length ? { videos: req.videos } : {}),
|
|
812
930
|
resume: req.resume,
|
|
813
931
|
provider: req.provider,
|
|
814
932
|
handoff: req.handoff,
|
|
@@ -843,19 +961,36 @@ export async function dispatchRequest(
|
|
|
843
961
|
deferTerminal = false;
|
|
844
962
|
if (signal?.aborted) send({ type: 'cancelled', requestId: req.id });
|
|
845
963
|
else if (terminal) send(terminal);
|
|
964
|
+
if (req.kind === 'code') deps.workspaces?.refreshOverview(req);
|
|
846
965
|
}
|
|
847
966
|
}
|
|
848
967
|
|
|
849
968
|
export interface RoomClientOptions {
|
|
969
|
+
workspaceIO?: (command: WorkspaceIOCommand) => Promise<unknown>;
|
|
970
|
+
memoryContext?: (query?: string) => Promise<string | undefined>;
|
|
971
|
+
recallService?: RecallBackend;
|
|
972
|
+
recall?: (query: string) => Promise<string | undefined>;
|
|
973
|
+
updateReadiness?: {
|
|
974
|
+
/** Development refreshes probe readiness without managed client admission. */
|
|
975
|
+
managed: boolean;
|
|
976
|
+
version: string;
|
|
977
|
+
changed: (ready: boolean, capabilities?: { computerId: string; features: string[] }) => void;
|
|
978
|
+
};
|
|
979
|
+
admission?: WorkAdmission;
|
|
980
|
+
videos?: VideoStore;
|
|
981
|
+
files?: FileStore;
|
|
850
982
|
workspaces?: WorkspaceRegistry;
|
|
851
983
|
speech?: SpeechService;
|
|
852
984
|
capturesDir?: string;
|
|
853
985
|
computerId?: string;
|
|
854
986
|
providerHealth?: () => { claude: ProviderHealth; codex: ProviderHealth };
|
|
855
987
|
onProviderHealth?: (listener: () => void) => () => void;
|
|
988
|
+
progressChecks?: CodingProgressChecks;
|
|
856
989
|
controls?: AgentControls;
|
|
857
990
|
models?: (provider: AgentProvider) => Promise<ExecutorModel[]>;
|
|
991
|
+
usage?: (provider: AgentProvider) => Promise<import('@lucidity/shared').AiUsage>;
|
|
858
992
|
commands?: (provider: AgentProvider, context?: AgentCommandContext) => Promise<AgentCommandOption[]>;
|
|
993
|
+
mcpStatus?: (provider: AgentProvider, context?: AgentCommandContext) => Promise<import('@lucidity/shared').AgentMcpServer[]>;
|
|
859
994
|
config: DaemonConfig;
|
|
860
995
|
harness: LucidHarness;
|
|
861
996
|
vault: Vault;
|
|
@@ -891,6 +1026,7 @@ export interface RoomClientOptions {
|
|
|
891
1026
|
}
|
|
892
1027
|
|
|
893
1028
|
export interface RoomClientHandle {
|
|
1029
|
+
enqueueCode(request: import('@lucidity/shared').CodeRequest): void;
|
|
894
1030
|
stop(): void;
|
|
895
1031
|
drain(): Promise<void>;
|
|
896
1032
|
/**
|
|
@@ -1023,8 +1159,8 @@ export function startRoomClient(opts: RoomClientOptions): RoomClientHandle {
|
|
|
1023
1159
|
const url =
|
|
1024
1160
|
roomUrl(config.apiUrl, config.machineName) +
|
|
1025
1161
|
`&device=${encodeURIComponent(identity)}`;
|
|
1026
|
-
const askContext = (query?: string) => loadAskContext(config, vault, query);
|
|
1027
|
-
const briefingContext = () => loadBriefingContext(config, vault);
|
|
1162
|
+
const askContext = (query?: string) => loadAskContext(config, vault, query, opts.recall, opts.memoryContext);
|
|
1163
|
+
const briefingContext = () => loadBriefingContext(config, vault, opts.memoryContext);
|
|
1028
1164
|
const turnLogs = opts.turnLogs ?? new TurnLogStore();
|
|
1029
1165
|
const executionLanes = queue ?? new LaneQueue();
|
|
1030
1166
|
// The daemon's side of an incident bundle (#314): a rolling connection timeline the
|
|
@@ -1049,6 +1185,9 @@ export function startRoomClient(opts: RoomClientOptions): RoomClientHandle {
|
|
|
1049
1185
|
if (socket && socket.readyState === WebSocket.OPEN)
|
|
1050
1186
|
socket.send(JSON.stringify(obj));
|
|
1051
1187
|
};
|
|
1188
|
+
const codingActivity = new CodingActivityTracker(identity, sendRaw);
|
|
1189
|
+
const activityTimer = setInterval(() => codingActivity.publish(), 60_000);
|
|
1190
|
+
activityTimer.unref?.();
|
|
1052
1191
|
const publishComputer = () =>
|
|
1053
1192
|
sendRaw({
|
|
1054
1193
|
type: 'computer_hello',
|
|
@@ -1068,7 +1207,10 @@ export function startRoomClient(opts: RoomClientOptions): RoomClientHandle {
|
|
|
1068
1207
|
STREAM_EVENT_TYPES.has(rec.type) &&
|
|
1069
1208
|
typeof rec.requestId === 'string'
|
|
1070
1209
|
) {
|
|
1071
|
-
publishDurably(turnLogs, { ...rec, requestId: rec.requestId }, inFlight,
|
|
1210
|
+
publishDurably(turnLogs, { ...rec, requestId: rec.requestId }, inFlight, (frame) => {
|
|
1211
|
+
sendRaw(frame);
|
|
1212
|
+
codingActivity.receive(frame);
|
|
1213
|
+
});
|
|
1072
1214
|
durableQueue?.wake();
|
|
1073
1215
|
return;
|
|
1074
1216
|
}
|
|
@@ -1114,11 +1256,18 @@ export function startRoomClient(opts: RoomClientOptions): RoomClientHandle {
|
|
|
1114
1256
|
// checkout moves, so the phone's header updates without waiting for its next `repos` poll. A raw
|
|
1115
1257
|
// push — no requestId, like the attention board (#320); a dropped one heals on the next poll.
|
|
1116
1258
|
const pushRepos = async (): Promise<void> => {
|
|
1117
|
-
|
|
1259
|
+
if (opts.admission?.accepting === false) return;
|
|
1260
|
+
const refresh = async () => { sendRaw({ kind: 'repos', repos: await listRepos() }); };
|
|
1261
|
+
if (opts.admission) await opts.admission.run(refresh);
|
|
1262
|
+
else await refresh();
|
|
1118
1263
|
};
|
|
1119
1264
|
|
|
1265
|
+
const unsubscribeWorkspaces = opts.workspaces?.subscribe(() => {
|
|
1266
|
+
sendRaw({ kind: 'workspace-update', computerId: identity, snapshot: opts.workspaces!.snapshot() });
|
|
1267
|
+
});
|
|
1268
|
+
|
|
1120
1269
|
function scheduleReconnect(): void {
|
|
1121
|
-
if (stopped
|
|
1270
|
+
if (!needsRedial({ stopped, readyState: socket?.readyState, reconnectPending: !!reconnectTimer })) return;
|
|
1122
1271
|
const delay =
|
|
1123
1272
|
Math.min(1000 * 2 ** attempt, MAX_BACKOFF_MS) +
|
|
1124
1273
|
Math.floor(Math.random() * 500);
|
|
@@ -1126,6 +1275,7 @@ export function startRoomClient(opts: RoomClientOptions): RoomClientHandle {
|
|
|
1126
1275
|
attempt++;
|
|
1127
1276
|
reconnectTimer = setTimeout(() => {
|
|
1128
1277
|
reconnectTimer = null;
|
|
1278
|
+
if (!needsRedial({ stopped, readyState: socket?.readyState, reconnectPending: false })) return;
|
|
1129
1279
|
// connect() can throw synchronously while the network is mid-switch (DNS/interface in
|
|
1130
1280
|
// flux). Unguarded, that escapes the timer with no timer left to fire and nothing
|
|
1131
1281
|
// rearms — the daemon is out of the room for good. Catch it and back off instead.
|
|
@@ -1145,20 +1295,34 @@ export function startRoomClient(opts: RoomClientOptions): RoomClientHandle {
|
|
|
1145
1295
|
const dispatch = (raw: string, overrides: Partial<DispatchDeps> = {}): Promise<void> => {
|
|
1146
1296
|
if (stopped) return Promise.resolve();
|
|
1147
1297
|
const pending = dispatchRequest(raw, {
|
|
1298
|
+
admission: opts.admission,
|
|
1148
1299
|
harness,
|
|
1149
1300
|
recordAcceptance: true,
|
|
1150
1301
|
runtime: opts.providerHealth ? () => computerRuntime(opts) : undefined,
|
|
1151
1302
|
controls: opts.controls,
|
|
1303
|
+
progressChecks: opts.progressChecks,
|
|
1152
1304
|
models: opts.models,
|
|
1305
|
+
usage: opts.usage,
|
|
1153
1306
|
commands: opts.commands,
|
|
1307
|
+
mcpStatus: opts.mcpStatus,
|
|
1154
1308
|
askContext,
|
|
1155
1309
|
briefingContext,
|
|
1156
1310
|
send: turnSend,
|
|
1157
1311
|
sendRaw,
|
|
1158
1312
|
turnLogs,
|
|
1159
1313
|
workspaces: opts.workspaces,
|
|
1314
|
+
workspaceIO: opts.workspaceIO,
|
|
1315
|
+
recallService: opts.recallService,
|
|
1160
1316
|
signal,
|
|
1161
|
-
codeHandler,
|
|
1317
|
+
codeHandler: codeHandler ? (request, context) => {
|
|
1318
|
+
const worker = opts.workspaces?.list(request.repoId).find(w => w.workerId === request.workerId);
|
|
1319
|
+
codingActivity.begin(request, worker?.title ?? (request.workerId ? `Worktree ${request.workerId.slice(0, 8)}` : 'Main'));
|
|
1320
|
+
// Every connected UI continues the daemon's canonical conversation,
|
|
1321
|
+
// including clients that have no cached provider session handle.
|
|
1322
|
+
return codeHandler(opts.workspaces
|
|
1323
|
+
? { ...request, ...opts.workspaces.continuationFields(request) }
|
|
1324
|
+
: request, context);
|
|
1325
|
+
} : undefined,
|
|
1162
1326
|
cloneHandler,
|
|
1163
1327
|
queue: executionLanes,
|
|
1164
1328
|
inFlight,
|
|
@@ -1169,6 +1333,8 @@ export function startRoomClient(opts: RoomClientOptions): RoomClientHandle {
|
|
|
1169
1333
|
listPrs: (repoId, mode) => resolvePrs(repoId, mode, config),
|
|
1170
1334
|
getConfig,
|
|
1171
1335
|
speech: opts.speech,
|
|
1336
|
+
videos: opts.videos,
|
|
1337
|
+
files: opts.files,
|
|
1172
1338
|
captures,
|
|
1173
1339
|
automations: opts.automations,
|
|
1174
1340
|
setConfig: setConfig
|
|
@@ -1190,6 +1356,7 @@ export function startRoomClient(opts: RoomClientOptions): RoomClientHandle {
|
|
|
1190
1356
|
return pending;
|
|
1191
1357
|
};
|
|
1192
1358
|
durableQueue = new DurableTurnQueue({
|
|
1359
|
+
admission: opts.admission,
|
|
1193
1360
|
dir: turnLogs.queueDirectory(),
|
|
1194
1361
|
logs: turnLogs,
|
|
1195
1362
|
lanes: executionLanes,
|
|
@@ -1200,7 +1367,7 @@ export function startRoomClient(opts: RoomClientOptions): RoomClientHandle {
|
|
|
1200
1367
|
queue: undefined,
|
|
1201
1368
|
}),
|
|
1202
1369
|
steer: opts.controls
|
|
1203
|
-
? (targetId, prompt) => opts.controls!.steer(targetId, prompt)
|
|
1370
|
+
? (targetId, prompt, images) => opts.controls!.steer(targetId, prompt, images)
|
|
1204
1371
|
: undefined,
|
|
1205
1372
|
});
|
|
1206
1373
|
turnLogs.reconcile((id) => durableQueue!.owns(id));
|
|
@@ -1213,6 +1380,7 @@ export function startRoomClient(opts: RoomClientOptions): RoomClientHandle {
|
|
|
1213
1380
|
.digest('hex');
|
|
1214
1381
|
try {
|
|
1215
1382
|
captures = new VoiceCaptureService({
|
|
1383
|
+
admission: opts.admission,
|
|
1216
1384
|
directory:
|
|
1217
1385
|
opts.capturesDir ?? join(CONFIG_DIR, 'voice-captures', account),
|
|
1218
1386
|
logger: log,
|
|
@@ -1263,26 +1431,39 @@ export function startRoomClient(opts: RoomClientOptions): RoomClientHandle {
|
|
|
1263
1431
|
}
|
|
1264
1432
|
}
|
|
1265
1433
|
|
|
1434
|
+
const refreshProviderHealth = () => {
|
|
1435
|
+
if (stopped || opts.admission?.accepting === false) return;
|
|
1436
|
+
for (const provider of ['claude', 'codex'] as const) {
|
|
1437
|
+
const check = async () => { await opts.models?.(provider); };
|
|
1438
|
+
void (opts.admission ? opts.admission.run(check) : check())
|
|
1439
|
+
.catch(() => {}).finally(publishComputer);
|
|
1440
|
+
}
|
|
1441
|
+
};
|
|
1442
|
+
const unsubscribeResume = opts.admission?.onResume(refreshProviderHealth);
|
|
1443
|
+
|
|
1266
1444
|
function connect(): void {
|
|
1267
1445
|
if (stopped) return;
|
|
1268
1446
|
const ws = new WebSocket(url, {
|
|
1269
1447
|
headers: { Authorization: `Bearer ${config.apiKey}` },
|
|
1270
1448
|
});
|
|
1271
1449
|
socket = ws;
|
|
1450
|
+
const readinessNonce = randomUUID();
|
|
1451
|
+
opts.updateReadiness?.changed(false);
|
|
1272
1452
|
const heartbeat = createHeartbeat(ws);
|
|
1273
1453
|
let heartbeatTimer: ReturnType<typeof setInterval> | null = null;
|
|
1274
1454
|
|
|
1275
1455
|
ws.on('open', () => {
|
|
1456
|
+
if (stopped || socket !== ws) { ws.terminate(); return; }
|
|
1276
1457
|
attempt = 0;
|
|
1277
1458
|
telemetry.record('open', url);
|
|
1278
1459
|
log(`connected to ${url}`);
|
|
1279
1460
|
publishComputer();
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1461
|
+
codingActivity.publish();
|
|
1462
|
+
if (opts.updateReadiness) ws.send(JSON.stringify({
|
|
1463
|
+
type: 'daemon_update_probe', protocol: DAEMON_UPDATE_PROTOCOL,
|
|
1464
|
+
nonce: readinessNonce, version: opts.updateReadiness.version,
|
|
1465
|
+
}));
|
|
1466
|
+
refreshProviderHealth();
|
|
1286
1467
|
// Watch our own liveness (#146): a half-open socket never fires 'close', so without
|
|
1287
1468
|
// this ping loop a dropped network leaves the daemon falsely "connected" and offline
|
|
1288
1469
|
// to the phone. A terminate() from the watchdog surfaces as 'close' → reconnect.
|
|
@@ -1294,10 +1475,20 @@ export function startRoomClient(opts: RoomClientOptions): RoomClientHandle {
|
|
|
1294
1475
|
});
|
|
1295
1476
|
ws.on('pong', () => heartbeat.markAlive());
|
|
1296
1477
|
ws.on('message', (data: Buffer | ArrayBuffer | Buffer[]) => {
|
|
1478
|
+
if (stopped || socket !== ws) return;
|
|
1297
1479
|
heartbeat.markAlive();
|
|
1298
1480
|
const raw = Array.isArray(data)
|
|
1299
1481
|
? Buffer.concat(data).toString()
|
|
1300
1482
|
: data.toString();
|
|
1483
|
+
if (opts.updateReadiness && socket === ws && raw.length < 32_768) {
|
|
1484
|
+
try {
|
|
1485
|
+
const ready = DaemonUpdateReadySchema.safeParse(JSON.parse(raw));
|
|
1486
|
+
if (ready.success && ready.data.nonce === readinessNonce && ready.data.version === opts.updateReadiness.version) {
|
|
1487
|
+
opts.updateReadiness.changed(true, { computerId: identity, features: computerRuntime(opts).features });
|
|
1488
|
+
return;
|
|
1489
|
+
}
|
|
1490
|
+
} catch { /* ordinary request */ }
|
|
1491
|
+
}
|
|
1301
1492
|
void dispatch(raw).catch((err) => {
|
|
1302
1493
|
log(
|
|
1303
1494
|
`dispatch error: ${err instanceof Error ? err.message : String(err)}`,
|
|
@@ -1309,21 +1500,27 @@ export function startRoomClient(opts: RoomClientOptions): RoomClientHandle {
|
|
|
1309
1500
|
clearInterval(heartbeatTimer);
|
|
1310
1501
|
heartbeatTimer = null;
|
|
1311
1502
|
}
|
|
1312
|
-
if (socket
|
|
1503
|
+
if (stopped || socket !== ws) return;
|
|
1504
|
+
socket = null;
|
|
1505
|
+
opts.updateReadiness?.changed(false);
|
|
1313
1506
|
const why = reason?.length
|
|
1314
1507
|
? `${code} ${reason.toString()}`
|
|
1315
1508
|
: String(code);
|
|
1316
1509
|
telemetry.record('close', why);
|
|
1510
|
+
log(`socket closed: ${why}`);
|
|
1317
1511
|
scheduleReconnect();
|
|
1318
1512
|
});
|
|
1319
1513
|
ws.on('error', (err: Error) => {
|
|
1514
|
+
if (stopped || socket !== ws) return;
|
|
1320
1515
|
telemetry.record('error', err.message);
|
|
1321
1516
|
log(`socket error: ${err.message}`);
|
|
1322
1517
|
// 'close' USUALLY follows and drives reconnection — but a Wi-Fi switch produced an
|
|
1323
1518
|
// error with an empty message and no close at all, and the daemon never re-dialed.
|
|
1324
1519
|
// Arm it here too; scheduleReconnect is a no-op when an attempt is already pending,
|
|
1325
1520
|
// so the ordinary error-then-close path still dials exactly once.
|
|
1326
|
-
|
|
1521
|
+
socket = null;
|
|
1522
|
+
opts.updateReadiness?.changed(false);
|
|
1523
|
+
ws.terminate();
|
|
1327
1524
|
scheduleReconnect();
|
|
1328
1525
|
});
|
|
1329
1526
|
}
|
|
@@ -1346,11 +1543,15 @@ export function startRoomClient(opts: RoomClientOptions): RoomClientHandle {
|
|
|
1346
1543
|
function stop(): void {
|
|
1347
1544
|
if (stopped) return;
|
|
1348
1545
|
stopped = true;
|
|
1546
|
+
opts.updateReadiness?.changed(false);
|
|
1349
1547
|
captures?.stop();
|
|
1350
1548
|
durableQueue?.stop();
|
|
1351
1549
|
for (const controller of inFlight.values()) controller.abort();
|
|
1352
1550
|
clearInterval(redialWatchdog);
|
|
1551
|
+
clearInterval(activityTimer);
|
|
1353
1552
|
unsubscribeHealth?.();
|
|
1553
|
+
unsubscribeWorkspaces?.();
|
|
1554
|
+
unsubscribeResume?.();
|
|
1354
1555
|
if (reconnectTimer) {
|
|
1355
1556
|
clearTimeout(reconnectTimer);
|
|
1356
1557
|
reconnectTimer = null;
|
|
@@ -1365,7 +1566,13 @@ export function startRoomClient(opts: RoomClientOptions): RoomClientHandle {
|
|
|
1365
1566
|
}
|
|
1366
1567
|
if (!stopped) connect();
|
|
1367
1568
|
|
|
1368
|
-
return { stop, push: sendRaw, pushRepos,
|
|
1569
|
+
return { stop, push: sendRaw, pushRepos, enqueueCode(request) {
|
|
1570
|
+
if (stopped) throw new Error('Lucidity is stopping. Reconnect before sending.');
|
|
1571
|
+
const parsed = HarnessRequestSchema.parse(request);
|
|
1572
|
+
if (parsed.kind !== 'code' || !(parsed.agentMessage || parsed.teamRequest) || parsed.senderKind !== 'agent')
|
|
1573
|
+
throw new Error('Expected an attributed Code agent message.');
|
|
1574
|
+
durableQueue!.enqueue(parsed);
|
|
1575
|
+
}, async drain() {
|
|
1369
1576
|
while (pendingRequests.size) await Promise.allSettled(pendingRequests);
|
|
1370
1577
|
await executionLanes.drain();
|
|
1371
1578
|
} };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { codingActivityIsRunning, codingActivityOrder, type CodingActivitySession, type CodingActivitySnapshot } from '@lucidity/shared';
|
|
2
|
+
|
|
3
|
+
type Request = { id: string; repoId: string; workerId?: string };
|
|
4
|
+
const text = (value: string) => value.replace(/[\u0000-\u001f\u007f]/g, '').replace(/[\uD800-\uDFFF]/gu, '�').slice(0, 160).replace(/[\uD800-\uDBFF]$/, '') || 'Session';
|
|
5
|
+
|
|
6
|
+
/** An explicit, bounded status feed. Prompts, tool inputs and replies never enter it. */
|
|
7
|
+
export class CodingActivityTracker {
|
|
8
|
+
private sessions = new Map<string, CodingActivitySession>();
|
|
9
|
+
private approvals = new Map<string, Set<string>>();
|
|
10
|
+
private revision = 0;
|
|
11
|
+
constructor(private computerId: string, private send: (snapshot: CodingActivitySnapshot) => void,
|
|
12
|
+
private now: () => number = () => Math.floor(Date.now() / 1000)) {}
|
|
13
|
+
|
|
14
|
+
begin(request: Request, title: string) {
|
|
15
|
+
// A new turn supersedes a previous result in this conversation.
|
|
16
|
+
for (const [id, row] of this.sessions) {
|
|
17
|
+
if (row.repoId === request.repoId && row.workerId === (request.workerId ?? null)) {
|
|
18
|
+
this.sessions.delete(id); this.approvals.delete(id);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
this.sessions.set(request.id, { id: request.id, repoId: text(request.repoId),
|
|
22
|
+
workerId: request.workerId ?? null, title: text(title), phase: 'working',
|
|
23
|
+
startedAt: this.now(), updatedAt: this.now() });
|
|
24
|
+
while (this.sessions.size > 32) {
|
|
25
|
+
const oldest = [...this.sessions.values()].sort(codingActivityOrder).at(-1)!;
|
|
26
|
+
this.sessions.delete(oldest.id); this.approvals.delete(oldest.id);
|
|
27
|
+
}
|
|
28
|
+
this.publish();
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
receive(frame: unknown) {
|
|
32
|
+
if (!frame || typeof frame !== 'object') return;
|
|
33
|
+
const event = frame as Record<string, unknown>;
|
|
34
|
+
if (typeof event.requestId !== 'string') return;
|
|
35
|
+
const row = this.sessions.get(event.requestId);
|
|
36
|
+
if (!row || !codingActivityIsRunning(row.phase)) return;
|
|
37
|
+
let phase = row.phase;
|
|
38
|
+
if (event.type === 'approval_request' && typeof event.id === 'string') {
|
|
39
|
+
const pending = this.approvals.get(row.id) ?? new Set<string>();
|
|
40
|
+
pending.add(event.id); this.approvals.set(row.id, pending); phase = 'needs_input';
|
|
41
|
+
} else if (event.type === 'approval_resolved' && typeof event.id === 'string') {
|
|
42
|
+
this.approvals.get(row.id)?.delete(event.id);
|
|
43
|
+
phase = this.approvals.get(row.id)?.size ? 'needs_input' : 'working';
|
|
44
|
+
} else if (event.type === 'done') phase = 'reply_ready';
|
|
45
|
+
else if (event.type === 'error') phase = 'failed';
|
|
46
|
+
else if (event.type === 'cancelled') phase = 'stopped';
|
|
47
|
+
else if (event.type === 'tool_call' && !this.approvals.get(row.id)?.size) {
|
|
48
|
+
const name = String(event.name).toLowerCase();
|
|
49
|
+
phase = event.phase === 'end' ? 'working'
|
|
50
|
+
: /askuserquestion|request_user_input/.test(name) ? 'needs_input'
|
|
51
|
+
: /^(read|glob|grep|search|read_file)$/.test(name) ? 'reading'
|
|
52
|
+
: /^(edit|write|apply_patch|write_file)$/.test(name) ? 'editing'
|
|
53
|
+
: /^(bash|shell|exec_command|terminal)$/.test(name) ? 'command' : 'working';
|
|
54
|
+
}
|
|
55
|
+
if (phase === row.phase) return;
|
|
56
|
+
row.phase = phase; row.updatedAt = this.now();
|
|
57
|
+
if (!codingActivityIsRunning(phase)) this.approvals.delete(row.id);
|
|
58
|
+
this.publish();
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
publish() {
|
|
62
|
+
for (const [id, row] of this.sessions) {
|
|
63
|
+
if (!codingActivityIsRunning(row.phase) && this.now() - row.updatedAt > 120) {
|
|
64
|
+
this.sessions.delete(id); this.approvals.delete(id);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
this.send({ type: 'coding_activity', protocol: 1, computerId: this.computerId,
|
|
68
|
+
revision: ++this.revision, sessions: [...this.sessions.values()].sort(codingActivityOrder) });
|
|
69
|
+
}
|
|
70
|
+
}
|