@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/computer.ts
CHANGED
|
@@ -37,8 +37,12 @@ const unknown: ProviderHealth = { auth: 'unknown', allowance: 'unknown' };
|
|
|
37
37
|
export function computerRuntime(opts: RoomClientOptions): ComputerRuntime {
|
|
38
38
|
return {
|
|
39
39
|
protocol: COMPUTER_PROTOCOL,
|
|
40
|
+
...(opts.updateReadiness?.version ? { appVersion: opts.updateReadiness.version } : {}),
|
|
41
|
+
...(opts.updateReadiness?.managed ? { managedUpdates: 1 as const } : {}),
|
|
40
42
|
features: [
|
|
41
43
|
'ask',
|
|
44
|
+
...(opts.codeHandler && opts.files ? ['file-upload'] : []),
|
|
45
|
+
...(opts.codeHandler && opts.videos?.available ? ['video-upload'] : []),
|
|
42
46
|
'project-plan',
|
|
43
47
|
'day-plan',
|
|
44
48
|
'briefing',
|
|
@@ -49,16 +53,28 @@ export function computerRuntime(opts: RoomClientOptions): ComputerRuntime {
|
|
|
49
53
|
'cancel',
|
|
50
54
|
'turn-queue',
|
|
51
55
|
'queue-control',
|
|
56
|
+
'queue-draft',
|
|
57
|
+
'queue-status',
|
|
58
|
+
'queue-pause',
|
|
59
|
+
'repository-requests',
|
|
60
|
+
'durable-delivery',
|
|
52
61
|
'provider-handoff',
|
|
62
|
+
'provider-fallback',
|
|
53
63
|
'incident',
|
|
54
64
|
'voice-diag',
|
|
55
65
|
...(opts.speech?.view().available ? ['transcribe'] : []),
|
|
56
66
|
...(opts.speech ? ['voice-capture', 'voice-capture-status'] : []),
|
|
57
67
|
...(opts.models ? ['models'] : []),
|
|
68
|
+
...(opts.usage ? ['usage'] : []),
|
|
58
69
|
...(opts.commands ? ['commands'] : []),
|
|
59
|
-
...(opts.
|
|
60
|
-
...(opts.
|
|
61
|
-
...(opts.
|
|
70
|
+
...(opts.mcpStatus ? ['mcp-status'] : []),
|
|
71
|
+
...(opts.controls ? ['permission', 'steer', 'steer-images'] : []),
|
|
72
|
+
...(opts.codeHandler ? ['code', 'file-attachments', 'pasted-text-previews', 'coding-activity'] : []),
|
|
73
|
+
...(opts.progressChecks ? ['progress-check'] : []),
|
|
74
|
+
...(opts.workspaces && opts.codeHandler ? ['message-replies'] : []),
|
|
75
|
+
...(opts.workspaces ? ['workspaces', 'checkout-history', 'repo-settings', 'worktree-delete', 'workspace-models'] : []),
|
|
76
|
+
...(opts.workspaceIO ? ['workspace-io', 'workspace-folders', 'image-preview', 'shell-commands', 'shell-receipts'] : []),
|
|
77
|
+
...(opts.recallService ? ['recall'] : []),
|
|
62
78
|
...(opts.cloneHandler ? ['clone'] : []),
|
|
63
79
|
...(opts.attention ? ['attention'] : []),
|
|
64
80
|
...(opts.getConfig ? ['getConfig'] : []),
|
package/src/room/context.ts
CHANGED
|
@@ -15,6 +15,7 @@ import { loadFlaggedTasks } from '../importantTasks.js';
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
export interface AskContext {
|
|
18
|
+
recall?: string;
|
|
18
19
|
user: Pick<User, 'name'>;
|
|
19
20
|
memory?: string;
|
|
20
21
|
notes?: string;
|
|
@@ -44,8 +45,10 @@ export async function loadAskContext(
|
|
|
44
45
|
config: DaemonConfig,
|
|
45
46
|
vault: Vault,
|
|
46
47
|
query?: string,
|
|
48
|
+
recall?: (query: string) => Promise<string | undefined>,
|
|
49
|
+
memoryContext?: (query?: string) => Promise<string | undefined>,
|
|
47
50
|
): Promise<AskContext> {
|
|
48
|
-
const memory = memoryFrom(vault);
|
|
51
|
+
const memory = config.capabilities?.memory ? (memoryContext ? await memoryContext(query).catch(() => undefined) : memoryFrom(vault)) : undefined;
|
|
49
52
|
const notes = loadNotesContext(config);
|
|
50
53
|
let name = '';
|
|
51
54
|
let context: string | undefined;
|
|
@@ -75,6 +78,7 @@ export async function loadAskContext(
|
|
|
75
78
|
notes,
|
|
76
79
|
journal,
|
|
77
80
|
context,
|
|
81
|
+
recall: query && config.capabilities?.memory ? await recall?.(query) : undefined,
|
|
78
82
|
model: config.chatModel,
|
|
79
83
|
effort: config.chatEffort,
|
|
80
84
|
};
|
|
@@ -83,8 +87,9 @@ export async function loadAskContext(
|
|
|
83
87
|
export async function loadBriefingContext(
|
|
84
88
|
config: DaemonConfig,
|
|
85
89
|
vault: Vault,
|
|
90
|
+
memoryContext?: () => Promise<string | undefined>,
|
|
86
91
|
): Promise<BriefingContext> {
|
|
87
|
-
const memory = memoryFrom(vault);
|
|
92
|
+
const memory = config.capabilities?.memory ? (memoryContext ? await memoryContext().catch(() => undefined) : memoryFrom(vault)) : undefined;
|
|
88
93
|
const notes = loadNotesContext(config);
|
|
89
94
|
let user: Pick<User, 'name' | 'email'> = { name: '', email: '' };
|
|
90
95
|
let tasks: Task[] = [];
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import test from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { createServer, type Server } from 'node:http';
|
|
4
|
+
import { mkdtempSync, mkdirSync, rmSync, writeFileSync } from 'node:fs';
|
|
5
|
+
import { execFileSync } from 'node:child_process';
|
|
6
|
+
import { tmpdir } from 'node:os';
|
|
7
|
+
import { join } from 'node:path';
|
|
8
|
+
import { WebSocketServer, WebSocket } from 'ws';
|
|
9
|
+
import { RoomClient } from '@lucidity/shared/room-client';
|
|
10
|
+
import { WorkspaceRegistry } from '../coding/workspaceRegistry.js';
|
|
11
|
+
import { uuidv7 } from 'uuidv7';
|
|
12
|
+
import { CodexExecutor, ClaudeAgentExecutor, encodeSession, decodeSession, type LucidHarness } from '@lucidity/runtime';
|
|
13
|
+
import type { DaemonConfig } from '../config.js';
|
|
14
|
+
import type { Vault } from '../vault.js';
|
|
15
|
+
import { startRoomClient } from './client.js';
|
|
16
|
+
import { TurnLogStore } from '../turnLog.js';
|
|
17
|
+
import { randomUUID } from 'node:crypto';
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
if (process.env.LUCIDITY_LIVE_DESKTOP !== '1') throw new Error('Opt in with LUCIDITY_LIVE_DESKTOP=1; this uses your provider account on a disposable repository.');
|
|
21
|
+
|
|
22
|
+
test('real provider conversation resumes across clients and a daemon restart', { timeout: 180000 }, async () => {
|
|
23
|
+
const { server, wss, port } = await startTestServer();
|
|
24
|
+
const root = mkdtempSync(join(tmpdir(), 'lucid-desktop-continuity-'));
|
|
25
|
+
const repo = join(root, 'repo');
|
|
26
|
+
mkdirSync(repo);
|
|
27
|
+
const git = (...args: string[]) => execFileSync('git', args, { cwd: repo, stdio: 'pipe' });
|
|
28
|
+
git('init', '-q', '-b', 'main');
|
|
29
|
+
git('config', 'user.name', 'Fixture'); git('config', 'user.email', 'fixture@example.com');
|
|
30
|
+
writeFileSync(join(repo, 'README'), 'fixture\n');
|
|
31
|
+
git('add', '.'); git('commit', '-qm', 'fixture');
|
|
32
|
+
let logs = new TurnLogStore({ dir: join(root, 'turns') });
|
|
33
|
+
let workspaces = new WorkspaceRegistry(logs.runtime, () => [{ id: 'repo', path: repo }], join(root, 'workers'));
|
|
34
|
+
const calls: { id: string; resume?: string }[] = [];
|
|
35
|
+
let release!: () => void;
|
|
36
|
+
const gate = new Promise<void>((resolve) => { release = resolve; });
|
|
37
|
+
let host: WebSocket | undefined;
|
|
38
|
+
const views = new Set<WebSocket>();
|
|
39
|
+
// This fixture isolates the daemon's queue/history. Controller authorization
|
|
40
|
+
// is separately exercised against the actual API relay in its socket suite.
|
|
41
|
+
wss.on('connection', (socket, req) => {
|
|
42
|
+
if (new URL(req.url!, 'http://fixture').searchParams.get('role') === 'daemon') {
|
|
43
|
+
host = socket;
|
|
44
|
+
socket.on('message', (raw) => { for (const view of views) if (view.readyState === WebSocket.OPEN) view.send(raw.toString()); });
|
|
45
|
+
} else {
|
|
46
|
+
views.add(socket);
|
|
47
|
+
socket.on('close', () => views.delete(socket));
|
|
48
|
+
socket.on('message', (raw) => host?.send(raw.toString()));
|
|
49
|
+
socket.send(JSON.stringify({ type: 'presence', daemonConnected: true, readOnly: false }));
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
const provider = process.env.LUCIDITY_LIVE_PROVIDER ?? 'codex';
|
|
53
|
+
if (!['codex', 'claude'].includes(provider)) throw new Error('Choose codex or claude');
|
|
54
|
+
let executor = provider === 'codex' ? new CodexExecutor() : new ClaudeAgentExecutor();
|
|
55
|
+
const marker = 'fixture-' + randomUUID();
|
|
56
|
+
let providerSession: string | undefined;
|
|
57
|
+
const start = () => startRoomClient({
|
|
58
|
+
computerId: 'continuity-fixture', config: { ...baseConfig(port), repos: [{ id: 'repo', path: repo }] },
|
|
59
|
+
harness: fakeHarness, vault: fakeVault, turnLogs: logs, workspaces, logger: () => {},
|
|
60
|
+
async codeHandler(req, { send }) {
|
|
61
|
+
calls.push({ id: req.id, resume: req.resume });
|
|
62
|
+
if (calls.length === 1) await gate;
|
|
63
|
+
for await (const event of executor.runStream({ requestId: req.id, userPrompt: req.prompt,
|
|
64
|
+
resume: req.resume ? decodeSession(req.resume).id : undefined,
|
|
65
|
+
cwd: repo, noTools: true, timeoutMs: 60000 })) {
|
|
66
|
+
if (event.type === 'session' || event.type === 'done' && event.sessionId) {
|
|
67
|
+
providerSession ??= event.sessionId;
|
|
68
|
+
assert.equal(event.sessionId, providerSession, 'The provider session must remain identical');
|
|
69
|
+
send({ ...event, requestId: req.id, sessionId: encodeSession({ provider: provider as 'claude' | 'codex', id: event.sessionId! }) });
|
|
70
|
+
} else send({ ...event, requestId: req.id });
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
let daemon = start();
|
|
75
|
+
const view = (deviceId: string) => new RoomClient({
|
|
76
|
+
url: `ws://127.0.0.1:${port}/api/room`, deviceId, requestId: uuidv7, retryMs: 10,
|
|
77
|
+
socket: (url) => new WebSocket(url),
|
|
78
|
+
});
|
|
79
|
+
const mobile = view('mobile'), desktop = view('desktop');
|
|
80
|
+
const until = async (condition: () => boolean) => {
|
|
81
|
+
for (let i = 0; i < 18000; i++) {
|
|
82
|
+
if (condition()) return;
|
|
83
|
+
await new Promise((resolve) => setTimeout(resolve, 10));
|
|
84
|
+
}
|
|
85
|
+
assert.fail('Timed out waiting for continuity');
|
|
86
|
+
};
|
|
87
|
+
try {
|
|
88
|
+
await until(() => Boolean(host));
|
|
89
|
+
mobile.start(); desktop.start();
|
|
90
|
+
await until(() => Boolean(mobile.presence && desktop.presence));
|
|
91
|
+
const first = uuidv7();
|
|
92
|
+
mobile.send({ id: first, kind: 'code', repoId: 'repo', mode: 'in-place', prompt: `Remember this marker for this test conversation: ${marker}. Reply only with that exact marker. Do not use tools.`, stream: true });
|
|
93
|
+
await until(() => calls.length === 1);
|
|
94
|
+
const history = await desktop.request({ id: uuidv7(), kind: 'workspaces', command: { action: 'history', repoId: 'repo', checkout: true } });
|
|
95
|
+
assert.equal(history.kind, 'workspaces');
|
|
96
|
+
if (history.kind !== 'workspaces') assert.fail('Expected workspace history');
|
|
97
|
+
assert.ok(history.snapshot.runs?.[0]?.prompt.includes(marker));
|
|
98
|
+
assert.equal(history.snapshot.runs?.[0]?.terminated, false);
|
|
99
|
+
desktop.watchTurn(first, logs.read(first).maxSeq);
|
|
100
|
+
mobile.close(); desktop.close();
|
|
101
|
+
release();
|
|
102
|
+
await until(() => logs.read(first).terminated);
|
|
103
|
+
assert.equal(calls.length, 1, 'closing both UI clients does not cancel or restart inference');
|
|
104
|
+
desktop.start();
|
|
105
|
+
await until(() => Boolean(desktop.presence));
|
|
106
|
+
const recovered = await desktop.request({ id: uuidv7(), kind: 'workspaces', command: { action: 'history', repoId: 'repo', checkout: true } });
|
|
107
|
+
assert.equal(recovered.kind, 'workspaces');
|
|
108
|
+
if (recovered.kind !== 'workspaces') assert.fail('Expected recovered history');
|
|
109
|
+
assert.ok(String(recovered.snapshot.runs?.[0]?.frames.at(-1)?.text).includes(marker), JSON.stringify(recovered.snapshot.runs?.[0]?.frames.at(-1)));
|
|
110
|
+
const savedSession = encodeSession({ provider: provider as 'claude' | 'codex', id: providerSession! });
|
|
111
|
+
assert.equal(recovered.snapshot.checkout?.resume, savedSession);
|
|
112
|
+
daemon.stop(); await daemon.drain(); await executor.dispose(); logs.runtime.close();
|
|
113
|
+
logs = new TurnLogStore({ dir: join(root, 'turns') });
|
|
114
|
+
workspaces = new WorkspaceRegistry(logs.runtime, () => [{ id: 'repo', path: repo }], join(root, 'workers'));
|
|
115
|
+
executor = provider === 'codex' ? new CodexExecutor() : new ClaudeAgentExecutor();
|
|
116
|
+
const oldHost = host; daemon = start(); await until(() => host !== oldHost);
|
|
117
|
+
const second = uuidv7();
|
|
118
|
+
desktop.send({ id: second, kind: 'code', repoId: 'repo', mode: 'in-place', prompt: 'What exact marker did I ask you to remember? Reply only with that marker, without using tools.', stream: true });
|
|
119
|
+
await until(() => logs.read(second).terminated);
|
|
120
|
+
assert.deepEqual(calls, [{ id: first, resume: undefined }, { id: second, resume: savedSession }]);
|
|
121
|
+
assert.ok(String(logs.read(second).frames.at(-1)?.text).includes(marker), JSON.stringify(logs.read(second).frames.at(-1)));
|
|
122
|
+
desktop.close(); mobile.start(); await until(() => Boolean(mobile.presence));
|
|
123
|
+
const third = uuidv7();
|
|
124
|
+
mobile.send({ id: third, kind: 'code', repoId: 'repo', mode: 'in-place', prompt: 'Repeat the same marker once more, using only conversation memory.', stream: true });
|
|
125
|
+
await until(() => logs.read(third).terminated);
|
|
126
|
+
assert.equal(calls.length, 3); assert.equal(calls[2]!.resume, savedSession);
|
|
127
|
+
assert.ok(String(logs.read(third).frames.at(-1)?.text).includes(marker), JSON.stringify(logs.read(third).frames.at(-1)));
|
|
128
|
+
console.log(`PASS: ${provider} real session; three requests, three executions, mobile → desktop → mobile, daemon/provider restart, identical session.`);
|
|
129
|
+
} finally {
|
|
130
|
+
release(); mobile.close(); desktop.close(); daemon.stop();
|
|
131
|
+
await daemon.drain(); await executor.dispose();
|
|
132
|
+
for (const socket of wss.clients) socket.terminate();
|
|
133
|
+
wss.close();
|
|
134
|
+
await new Promise<void>((resolve) => server.close(() => resolve()));
|
|
135
|
+
logs.runtime.close();
|
|
136
|
+
rmSync(root, { recursive: true, force: true });
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
const baseConfig = (port: number): DaemonConfig => ({
|
|
141
|
+
apiKey: 'luc_test',
|
|
142
|
+
apiUrl: `http://127.0.0.1:${port}`,
|
|
143
|
+
machineName: 'Test Machine',
|
|
144
|
+
briefingTime: '08:00',
|
|
145
|
+
chatModel: 'haiku',
|
|
146
|
+
chatEffort: 'low',
|
|
147
|
+
codeModel: 'opus',
|
|
148
|
+
codeEffort: 'high',
|
|
149
|
+
delivery: 'stdout',
|
|
150
|
+
vaultPath: '/tmp/lucid-nonexistent-vault',
|
|
151
|
+
reflect: false,
|
|
152
|
+
chatPort: 4849,
|
|
153
|
+
weeklyReview: false,
|
|
154
|
+
weeklyReviewDay: 0,
|
|
155
|
+
weeklyReviewTime: '18:00',
|
|
156
|
+
repos: [],
|
|
157
|
+
repoRoots: [],
|
|
158
|
+
allowInPlace: true,
|
|
159
|
+
capabilities: { tasks: false, memory: false, connected: false },
|
|
160
|
+
agentMode: 'off',
|
|
161
|
+
shellCwd: '/tmp/lucid-nonexistent-projects',
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
const fakeVault: Vault = {
|
|
165
|
+
path: '',
|
|
166
|
+
readPersona: () => 'persona',
|
|
167
|
+
readMemoryFacts: () => [],
|
|
168
|
+
writeMemoryFacts: () => {},
|
|
169
|
+
writeSessionLog: () => {},
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
const fakeHarness: LucidHarness = {
|
|
173
|
+
ask: async () => ({ text: 'PONG', sessionId: 'sess-1' }),
|
|
174
|
+
askStream: async function* () {},
|
|
175
|
+
briefing: async () => ({ text: 'brief' }),
|
|
176
|
+
attentionBoard: async () => ({ boards: [{ text: 'board' }] }),
|
|
177
|
+
briefingStream: async function* () {},
|
|
178
|
+
journal: async () => ({ entries: [] }),
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
function startTestServer(): Promise<{
|
|
182
|
+
server: Server;
|
|
183
|
+
wss: WebSocketServer;
|
|
184
|
+
port: number;
|
|
185
|
+
}> {
|
|
186
|
+
return new Promise((resolve) => {
|
|
187
|
+
// 404 non-upgrade requests fast so the client's best-effort context fetch
|
|
188
|
+
// (GET /api/users/me) fails immediately instead of hanging.
|
|
189
|
+
const server = createServer((_req, res) => {
|
|
190
|
+
res.writeHead(404);
|
|
191
|
+
res.end();
|
|
192
|
+
});
|
|
193
|
+
const wss = new WebSocketServer({ server });
|
|
194
|
+
server.listen(0, '127.0.0.1', () => {
|
|
195
|
+
const addr = server.address();
|
|
196
|
+
resolve({
|
|
197
|
+
server,
|
|
198
|
+
wss,
|
|
199
|
+
port: typeof addr === 'object' && addr ? addr.port : 0,
|
|
200
|
+
});
|
|
201
|
+
});
|
|
202
|
+
});
|
|
203
|
+
}
|
package/src/room/turnQueue.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { join } from 'node:path';
|
|
|
9
9
|
import { HarnessRequestSchema, type HarnessRequest } from '@lucidity/shared';
|
|
10
10
|
import type { TurnLogStore } from '../turnLog.js';
|
|
11
11
|
import { LaneQueue } from '../queue.js';
|
|
12
|
+
import type { WorkAdmission } from '../updates/admission.js';
|
|
12
13
|
|
|
13
14
|
type Request = Extract<HarnessRequest, { kind: 'ask' | 'code' }>;
|
|
14
15
|
type Entry = {
|
|
@@ -32,16 +33,19 @@ export class DurableTurnQueue {
|
|
|
32
33
|
private scheduled = new Set<string>();
|
|
33
34
|
private stopped = false;
|
|
34
35
|
private pumping = false;
|
|
36
|
+
private readonly unsubscribeResume?: () => void;
|
|
35
37
|
constructor(
|
|
36
38
|
private readonly deps: {
|
|
37
39
|
dir: string;
|
|
38
40
|
logs: TurnLogStore;
|
|
39
41
|
lanes: LaneQueue;
|
|
42
|
+
admission?: WorkAdmission;
|
|
40
43
|
sendRaw: (frame: unknown) => void;
|
|
41
44
|
execute: (request: Request) => Promise<void>;
|
|
42
|
-
steer?: (targetId: string, prompt: string) => Promise<void>;
|
|
45
|
+
steer?: (targetId: string, prompt: string, images?: Request['images']) => Promise<void>;
|
|
43
46
|
},
|
|
44
47
|
) {
|
|
48
|
+
this.unsubscribeResume = deps.admission?.onResume(() => this.wake());
|
|
45
49
|
mkdirSync(deps.dir, { recursive: true, mode: 0o700 });
|
|
46
50
|
for (const entry of deps.logs.runtime.list<Entry>('queue'))
|
|
47
51
|
this.entries.set(entry.request.id, entry);
|
|
@@ -109,8 +113,14 @@ export class DurableTurnQueue {
|
|
|
109
113
|
'Lucid restarted before the preceding turn finished. Review it before resending this message.',
|
|
110
114
|
);
|
|
111
115
|
}
|
|
116
|
+
for (const entry of this.entries.values()) {
|
|
117
|
+
if (entry.state === 'queued' || entry.state === 'held') this.confirm(entry.request.id);
|
|
118
|
+
}
|
|
112
119
|
}
|
|
113
120
|
|
|
121
|
+
private paused(request: Request): boolean {
|
|
122
|
+
return this.deps.logs.runtime.get<boolean>('queue-pauses', turnLane(request)) === true;
|
|
123
|
+
}
|
|
114
124
|
private save(entry: Entry): void {
|
|
115
125
|
this.deps.logs.runtime.set('queue', entry.request.id, entry);
|
|
116
126
|
this.entries.set(entry.request.id, entry);
|
|
@@ -157,6 +167,7 @@ export class DurableTurnQueue {
|
|
|
157
167
|
this.publish(id, {
|
|
158
168
|
type: 'queue_state',
|
|
159
169
|
state: entry.state === 'running' ? 'running' : 'queued',
|
|
170
|
+
paused: this.paused(entry.request),
|
|
160
171
|
...(entry.blockedBy ? { blockedBy: entry.blockedBy, message: 'Held for review of the interrupted turn.' } : {}),
|
|
161
172
|
});
|
|
162
173
|
}
|
|
@@ -171,8 +182,12 @@ export class DurableTurnQueue {
|
|
|
171
182
|
this.deps.sendRaw(frame);
|
|
172
183
|
return;
|
|
173
184
|
}
|
|
174
|
-
if (this.deps.logs.read(request.id).exists)
|
|
175
|
-
throw new Error('This request was already submitted.');
|
|
185
|
+
if (this.deps.logs.read(request.id).exists) {
|
|
186
|
+
if (!this.deps.logs.runtime.command(request.id)) throw new Error('This request was already submitted.');
|
|
187
|
+
const receipt = this.deps.logs.runtime.accept(request);
|
|
188
|
+
for (const frame of receipt.frames) this.deps.sendRaw(frame);
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
176
191
|
if (
|
|
177
192
|
[...this.entries.values()].filter((e) => this.owns(e.request.id))
|
|
178
193
|
.length >= 100
|
|
@@ -204,6 +219,7 @@ export class DurableTurnQueue {
|
|
|
204
219
|
const accepted = this.deps.logs.runtime.accept(request, entry);
|
|
205
220
|
this.entries.set(request.id, entry);
|
|
206
221
|
for (const frame of accepted.frames) this.deps.sendRaw(frame);
|
|
222
|
+
if (this.paused(request)) this.confirm(request.id);
|
|
207
223
|
this.wake();
|
|
208
224
|
}
|
|
209
225
|
|
|
@@ -243,16 +259,16 @@ export class DurableTurnQueue {
|
|
|
243
259
|
return { ready: true, resume };
|
|
244
260
|
}
|
|
245
261
|
wake(): void {
|
|
246
|
-
if (this.stopped || this.pumping || !this.deps.logs.runtime.writable) return;
|
|
262
|
+
if (this.stopped || this.pumping || this.deps.admission?.accepting === false || !this.deps.logs.runtime.writable) return;
|
|
247
263
|
this.pumping = true;
|
|
248
264
|
queueMicrotask(() => {
|
|
249
265
|
this.pumping = false;
|
|
250
|
-
if (this.stopped || !this.deps.logs.runtime.writable) return;
|
|
266
|
+
if (this.stopped || this.deps.admission?.accepting === false || !this.deps.logs.runtime.writable) return;
|
|
251
267
|
const occupied = new Set<string>();
|
|
252
268
|
for (const [id, entry] of this.entries) {
|
|
253
269
|
const lane = turnLane(entry.request);
|
|
254
270
|
if (!this.owns(id)) continue;
|
|
255
|
-
if (entry.state === 'held') continue;
|
|
271
|
+
if (entry.state === 'held' || this.paused(entry.request)) continue;
|
|
256
272
|
if (occupied.has(lane)) continue;
|
|
257
273
|
if (entry.state !== 'queued' || this.scheduled.has(id)) { occupied.add(lane); continue; }
|
|
258
274
|
try {
|
|
@@ -273,31 +289,37 @@ export class DurableTurnQueue {
|
|
|
273
289
|
void this.deps.lanes
|
|
274
290
|
.run(turnLane(entry.request), async () => {
|
|
275
291
|
const current = this.entries.get(id)!;
|
|
276
|
-
if (this.stopped || !this.deps.logs.runtime.writable || current.state !== 'queued') return;
|
|
277
|
-
const
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
292
|
+
if (this.stopped || this.deps.admission?.accepting === false || !this.deps.logs.runtime.writable || current.state !== 'queued') return;
|
|
293
|
+
const execute = async () => {
|
|
294
|
+
if (this.paused(current.request)) return;
|
|
295
|
+
try {
|
|
296
|
+
const previous = this.predecessor(current);
|
|
297
|
+
if (!previous.ready) return;
|
|
298
|
+
this.save({ ...current, state: 'running' });
|
|
299
|
+
this.publish(id, { type: 'queue_state', state: 'running' });
|
|
300
|
+
await this.deps.execute({
|
|
301
|
+
...current.request,
|
|
302
|
+
resume: previous.resume,
|
|
303
|
+
queue: false,
|
|
304
|
+
afterRequestId: undefined,
|
|
305
|
+
});
|
|
306
|
+
if (this.terminal(id)?.type === 'done')
|
|
307
|
+
this.save({
|
|
308
|
+
...current,
|
|
309
|
+
state: 'done',
|
|
310
|
+
resume: this.session(id),
|
|
311
|
+
});
|
|
312
|
+
else
|
|
313
|
+
this.fail(
|
|
314
|
+
current,
|
|
315
|
+
'The turn ended before completion. Review it before resending.',
|
|
316
|
+
);
|
|
317
|
+
} catch (error) {
|
|
318
|
+
if (this.deps.logs.runtime.writable) this.fail(this.entries.get(id)!, String((error as Error).message));
|
|
319
|
+
}
|
|
320
|
+
};
|
|
321
|
+
if (this.deps.admission) await this.deps.admission.run(execute);
|
|
322
|
+
else await execute();
|
|
301
323
|
})
|
|
302
324
|
.finally(() => {
|
|
303
325
|
this.scheduled.delete(id);
|
|
@@ -306,13 +328,42 @@ export class DurableTurnQueue {
|
|
|
306
328
|
}
|
|
307
329
|
});
|
|
308
330
|
}
|
|
331
|
+
pendingAfter(id: string): number | undefined {
|
|
332
|
+
const current = this.entries.get(id);
|
|
333
|
+
if (!current) return undefined;
|
|
334
|
+
return [...this.entries.values()].filter(entry => entry.request.id !== id &&
|
|
335
|
+
entry.state === 'queued' && turnLane(entry.request) === turnLane(current.request)).length;
|
|
336
|
+
}
|
|
337
|
+
draft(id: string, includeFiles = false) {
|
|
338
|
+
const entry = this.entries.get(id);
|
|
339
|
+
if (entry?.request.kind === 'code' && entry.request.teamRequest)
|
|
340
|
+
throw new Error('Approved teammate requests cannot be edited. Cancel it and ask for a new request.');
|
|
341
|
+
if (!entry || (entry.state !== 'queued' && entry.state !== 'held'))
|
|
342
|
+
throw new Error('This message has already started or left the queue.');
|
|
343
|
+
if (entry.request.kind === 'code' && entry.request.replyTo)
|
|
344
|
+
throw new Error('This reply keeps a reference to an earlier message. Cancel it and reply again to edit it.');
|
|
345
|
+
if (entry.request.kind === 'code' && (entry.request.videos?.length || (!includeFiles && entry.request.files?.length) || entry.request.uploadedFiles?.length))
|
|
346
|
+
throw new Error('Edit this message on mobile to keep its video or document attachments.');
|
|
347
|
+
return { text: entry.request.kind === 'code' && entry.request.imageOnly ? '' : entry.request.prompt, images: entry.request.images,
|
|
348
|
+
...(entry.request.kind === 'code' && entry.request.files?.length ? { files: entry.request.files } : {}) };
|
|
349
|
+
}
|
|
309
350
|
async control(
|
|
310
351
|
id: string,
|
|
311
|
-
action: 'cancel' | 'steer',
|
|
352
|
+
action: 'cancel' | 'steer' | 'pause' | 'resume',
|
|
312
353
|
activeId?: string,
|
|
313
354
|
): Promise<void> {
|
|
314
355
|
const entry = this.entries.get(id);
|
|
315
356
|
if (!entry) throw new Error('This message is not in the computer queue.');
|
|
357
|
+
if (action === 'pause' || action === 'resume') {
|
|
358
|
+
// The target identifies the lane even if it started while the click was in flight.
|
|
359
|
+
const lane = turnLane(entry.request);
|
|
360
|
+
this.deps.logs.runtime.set('queue-pauses', lane, action === 'pause');
|
|
361
|
+
for (const item of this.entries.values()) {
|
|
362
|
+
if (turnLane(item.request) === lane && this.owns(item.request.id)) this.confirm(item.request.id);
|
|
363
|
+
}
|
|
364
|
+
this.wake();
|
|
365
|
+
return;
|
|
366
|
+
}
|
|
316
367
|
if (entry.state === 'skipped' && entry.action === action) {
|
|
317
368
|
const frame = this.terminal(id);
|
|
318
369
|
if (frame) this.deps.sendRaw(frame);
|
|
@@ -321,8 +372,13 @@ export class DurableTurnQueue {
|
|
|
321
372
|
if (entry.state !== 'queued' && entry.state !== 'held')
|
|
322
373
|
throw new Error('This message has already started or left the queue.');
|
|
323
374
|
if (action === 'steer') {
|
|
375
|
+
if (entry.request.kind === 'code' && entry.request.teamRequest)
|
|
376
|
+
throw new Error('Approved teammate requests must run as a separate turn.');
|
|
377
|
+
if (this.paused(entry.request)) throw new Error('Resume the queue before sending this message to the current turn.');
|
|
378
|
+
if (entry.request.kind === 'code' && entry.request.replyTo)
|
|
379
|
+
throw new Error('Replies to earlier messages must run as a separate turn.');
|
|
324
380
|
if (entry.state === 'held') throw new Error('Review the interrupted turn before using this follow-up.');
|
|
325
|
-
if (entry.request.
|
|
381
|
+
if (entry.request.kind === 'code' && (entry.request.videos?.length || entry.request.files?.length || entry.request.uploadedFiles?.length))
|
|
326
382
|
throw new Error('Attachments must run as a separate turn.');
|
|
327
383
|
if (!activeId || !this.deps.steer)
|
|
328
384
|
throw new Error('There is no active turn to influence.');
|
|
@@ -338,7 +394,7 @@ export class DurableTurnQueue {
|
|
|
338
394
|
);
|
|
339
395
|
this.save({ ...entry, state: 'steering' });
|
|
340
396
|
try {
|
|
341
|
-
await this.deps.steer(activeId, entry.request.prompt);
|
|
397
|
+
await this.deps.steer(activeId, entry.request.prompt, entry.request.images);
|
|
342
398
|
} catch (error) {
|
|
343
399
|
this.save(entry);
|
|
344
400
|
this.wake();
|
|
@@ -351,5 +407,6 @@ export class DurableTurnQueue {
|
|
|
351
407
|
}
|
|
352
408
|
stop(): void {
|
|
353
409
|
this.stopped = true;
|
|
410
|
+
this.unsubscribeResume?.();
|
|
354
411
|
}
|
|
355
412
|
}
|
package/src/runtimeStore.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
// @ts-expect-error Node 22 runtime API; the repository's Node type baseline is 20.
|
|
2
2
|
import { DatabaseSync } from 'node:sqlite';
|
|
3
3
|
import { chmodSync, mkdirSync } from 'node:fs';
|
|
4
|
+
import { EventEmitter } from 'node:events';
|
|
4
5
|
import { dirname } from 'node:path';
|
|
5
6
|
import type { HarnessRequest, RunReview } from '@lucidity/shared';
|
|
6
7
|
import type { TurnFrame, TurnState } from './turnLog.js';
|
|
8
|
+
import { RecallIndex } from './recall/index.js';
|
|
7
9
|
|
|
8
10
|
const terminalTypes = new Set(['done', 'error', 'cancelled']);
|
|
9
11
|
|
|
@@ -22,6 +24,13 @@ export function conversationKey(request: { kind: string; repoId?: string; worker
|
|
|
22
24
|
|
|
23
25
|
/** Local execution authority. Transactions commit before their receipts reach the transport. */
|
|
24
26
|
export class RuntimeStore {
|
|
27
|
+
readonly recall: RecallIndex;
|
|
28
|
+
private readonly changes = new EventEmitter().setMaxListeners(0);
|
|
29
|
+
|
|
30
|
+
subscribe(id: string, listener: () => void): () => void {
|
|
31
|
+
this.changes.on(id, listener);
|
|
32
|
+
return () => { this.changes.off(id, listener); };
|
|
33
|
+
}
|
|
25
34
|
private db: any;
|
|
26
35
|
private storageError?: Error;
|
|
27
36
|
get writable(): boolean { return !this.storageError; }
|
|
@@ -58,6 +67,7 @@ export class RuntimeStore {
|
|
|
58
67
|
PRIMARY KEY(bucket, id)
|
|
59
68
|
);
|
|
60
69
|
`);
|
|
70
|
+
this.recall = new RecallIndex(this.db);
|
|
61
71
|
}
|
|
62
72
|
|
|
63
73
|
transaction<T>(action: () => T): T {
|
|
@@ -104,7 +114,7 @@ export class RuntimeStore {
|
|
|
104
114
|
if (!review || review.reviewId !== request.recoveryReviewId || review.continuationId !== request.id ||
|
|
105
115
|
source?.kind !== 'code' || conversationKey(source) !== conversationKey(request) ||
|
|
106
116
|
this.read(source.id).frames.at(-1)?.code !== 'interrupted_unknown' ||
|
|
107
|
-
review.continuedAt || !request.prompt.trim() || request.prompt.trim().startsWith('/')
|
|
117
|
+
review.continuedAt || !request.prompt.trim() || request.prompt.trim().startsWith('/'))
|
|
108
118
|
throw new Error('A current review is required before continuing this interrupted turn.');
|
|
109
119
|
this.set('run-reviews', source.id, { ...review, continuedAt: new Date().toISOString(), instruction: request.prompt });
|
|
110
120
|
}
|
|
@@ -133,7 +143,7 @@ export class RuntimeStore {
|
|
|
133
143
|
this.set('protocol-fault', id, { type: event.type, at: new Date().toISOString() });
|
|
134
144
|
return JSON.parse(run.terminal);
|
|
135
145
|
}
|
|
136
|
-
const frame = { ...event, seq: run.cursor + 1 };
|
|
146
|
+
const frame = { ...event, at: Date.now(), seq: run.cursor + 1 };
|
|
137
147
|
const serialized = JSON.stringify(frame);
|
|
138
148
|
const terminal = terminalTypes.has(String(event.type));
|
|
139
149
|
const state = terminal ? String(event.type) : event.type === 'accepted' ? 'accepted' : event.type === 'queue_state' ? String(event.state) : 'running';
|
|
@@ -143,7 +153,9 @@ export class RuntimeStore {
|
|
|
143
153
|
return frame;
|
|
144
154
|
}
|
|
145
155
|
append(id: string, event: Record<string, unknown>): TurnFrame {
|
|
146
|
-
|
|
156
|
+
const frame = this.transaction(() => this.appendInside(id, event));
|
|
157
|
+
this.changes.emit(id); // Notify only after the durable transaction commits.
|
|
158
|
+
return frame;
|
|
147
159
|
}
|
|
148
160
|
|
|
149
161
|
status(id: string): Omit<TurnState, 'frames'> {
|
|
@@ -185,6 +197,26 @@ export class RuntimeStore {
|
|
|
185
197
|
AND runs.rowid > COALESCE((SELECT rowid FROM runs WHERE id=?), 0)
|
|
186
198
|
ORDER BY runs.rowid DESC, events.seq DESC LIMIT 1`).get(conversation, after ?? '')?.session;
|
|
187
199
|
}
|
|
200
|
+
/** Current work remains visible even when follow-ups fill a history page.
|
|
201
|
+
* Keep SQLite admission order: device clocks and UUID timestamps can differ. */
|
|
202
|
+
withActiveCommands(conversation: string, page: ReturnType<RuntimeStore['commands']>): ReturnType<RuntimeStore['commands']> {
|
|
203
|
+
const ids = page.map((run) => run.request.id);
|
|
204
|
+
const placeholders = ids.map(() => '?').join(',');
|
|
205
|
+
const rows: { id: string; command: string }[] = this.db.prepare(
|
|
206
|
+
`SELECT id,command FROM runs WHERE conversation=? AND command IS NOT NULL
|
|
207
|
+
AND (terminal IS NULL${ids.length ? ` OR id IN (${placeholders})` : ''}) ORDER BY rowid LIMIT 110`,
|
|
208
|
+
).all(conversation, ...ids);
|
|
209
|
+
return rows.map((row) => ({ request: JSON.parse(row.command), state: this.read(row.id) }));
|
|
210
|
+
}
|
|
211
|
+
/** Summary refreshes need prompts and final replies, without decoding tool logs or attachments. */
|
|
212
|
+
completedText(conversation: string, after?: string): Array<{ id: string; prompt: string; senderKind: string | null; text: string; outcome: string; queueAction: string | null; completedAt: number }> {
|
|
213
|
+
return this.db.prepare(`SELECT id, json_extract(command, '$.prompt') AS prompt,
|
|
214
|
+
json_extract(command, '$.senderKind') AS senderKind,
|
|
215
|
+
COALESCE(json_extract(terminal, '$.text'), json_extract(terminal, '$.message'), '') AS text,
|
|
216
|
+
json_extract(terminal, '$.type') AS outcome, json_extract(terminal, '$.queueAction') AS queueAction, updated AS completedAt
|
|
217
|
+
FROM runs WHERE conversation=? AND terminal IS NOT NULL AND json_extract(command, '$.kind')='code'
|
|
218
|
+
AND rowid > COALESCE((SELECT rowid FROM runs WHERE id=?), 0) ORDER BY rowid`).all(conversation, after ?? '');
|
|
219
|
+
}
|
|
188
220
|
lastCommand(conversation: string): string | undefined {
|
|
189
221
|
return this.db.prepare('SELECT id FROM runs WHERE conversation=? AND command IS NOT NULL ORDER BY rowid DESC LIMIT 1').get(conversation)?.id;
|
|
190
222
|
}
|
|
@@ -203,5 +235,5 @@ export class RuntimeStore {
|
|
|
203
235
|
message: 'Lucid restarted before this turn settled. It was not run again. Review its work before continuing.' });
|
|
204
236
|
}
|
|
205
237
|
}
|
|
206
|
-
close(): void { this.db.close(); }
|
|
238
|
+
close(): void { this.changes.removeAllListeners(); this.db.close(); }
|
|
207
239
|
}
|