@opencorelabs/lucidity 0.2.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -34
- package/bin/lucidity.js +2 -0
- package/dist/assets/speech/licenses/FluidAudio/LICENSE +201 -0
- package/dist/assets/speech/licenses/FluidAudio/ThirdPartyLicenses/fastcluster-LICENSE.md +11 -0
- package/dist/assets/speech/licenses/FluidAudio/ThirdPartyLicenses/vbx-LICENSE.md +201 -0
- package/dist/assets/speech/lucidity-speech +0 -0
- package/dist/automations/agent.d.ts +16 -0
- package/dist/automations/agent.d.ts.map +1 -0
- package/dist/automations/agent.js +196 -0
- package/dist/automations/cli.d.ts +4 -0
- package/dist/automations/cli.d.ts.map +1 -0
- package/dist/automations/cli.js +44 -0
- package/dist/automations/connections.d.ts +11 -0
- package/dist/automations/connections.d.ts.map +1 -0
- package/dist/automations/connections.js +74 -0
- package/dist/automations/designer.d.ts +39 -0
- package/dist/automations/designer.d.ts.map +1 -0
- package/dist/automations/designer.js +450 -0
- package/dist/automations/history.d.ts +4 -0
- package/dist/automations/history.d.ts.map +1 -0
- package/dist/automations/history.js +57 -0
- package/dist/automations/learning.d.ts +19 -0
- package/dist/automations/learning.d.ts.map +1 -0
- package/dist/automations/learning.js +121 -0
- package/dist/automations/pinterest.d.ts +21 -0
- package/dist/automations/pinterest.d.ts.map +1 -0
- package/dist/automations/pinterest.js +113 -0
- package/dist/automations/service.d.ts +42 -0
- package/dist/automations/service.d.ts.map +1 -0
- package/dist/automations/service.js +406 -0
- package/dist/automations/setup.d.ts +3 -0
- package/dist/automations/setup.d.ts.map +1 -0
- package/dist/automations/setup.js +48 -0
- package/dist/automations/skill.d.ts +3 -0
- package/dist/automations/skill.d.ts.map +1 -0
- package/dist/automations/skill.js +29 -0
- package/dist/automations/store.d.ts +13 -0
- package/dist/automations/store.d.ts.map +1 -0
- package/dist/automations/store.js +46 -0
- package/dist/chat/server.d.ts +2 -0
- package/dist/chat/server.d.ts.map +1 -1
- package/dist/chat/server.js +46 -2
- package/dist/coding/commandContext.d.ts +6 -0
- package/dist/coding/commandContext.d.ts.map +1 -0
- package/dist/coding/commandContext.js +20 -0
- package/dist/coding/runCodeTurn.d.ts +12 -2
- package/dist/coding/runCodeTurn.d.ts.map +1 -1
- package/dist/coding/runCodeTurn.js +49 -19
- package/dist/coding/worktree.d.ts +3 -4
- package/dist/coding/worktree.d.ts.map +1 -1
- package/dist/coding/worktree.js +3 -4
- package/dist/config.d.ts +6 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +21 -3
- package/dist/decisions/cli.d.ts +2 -0
- package/dist/decisions/cli.d.ts.map +1 -0
- package/dist/decisions/cli.js +106 -0
- package/dist/decisions/client.d.ts +20 -0
- package/dist/decisions/client.d.ts.map +1 -0
- package/dist/decisions/client.js +41 -0
- package/dist/handoff.d.ts +11 -0
- package/dist/handoff.d.ts.map +1 -0
- package/dist/handoff.js +21 -0
- package/dist/index.js +190 -34
- package/dist/jobs/briefing.js +1 -1
- package/dist/jobs/extraction.d.ts.map +1 -1
- package/dist/jobs/extraction.js +112 -22
- package/dist/jobs/fastModeReview.d.ts +39 -0
- package/dist/jobs/fastModeReview.d.ts.map +1 -0
- package/dist/jobs/fastModeReview.js +192 -0
- package/dist/jobs/voiceReview.d.ts +24 -0
- package/dist/jobs/voiceReview.d.ts.map +1 -0
- package/dist/jobs/voiceReview.js +128 -0
- package/dist/mcp/clients.d.ts +26 -0
- package/dist/mcp/clients.d.ts.map +1 -0
- package/dist/mcp/clients.js +193 -0
- package/dist/mcp/config.d.ts +5 -2
- package/dist/mcp/config.d.ts.map +1 -1
- package/dist/mcp/config.js +48 -6
- package/dist/mcp/paired.d.ts +2 -0
- package/dist/mcp/paired.d.ts.map +1 -0
- package/dist/mcp/paired.js +21 -0
- package/dist/mcp/pairedConfig.d.ts +3 -0
- package/dist/mcp/pairedConfig.d.ts.map +1 -0
- package/dist/mcp/pairedConfig.js +33 -0
- package/dist/notesContext.d.ts.map +1 -1
- package/dist/notesContext.js +3 -2
- package/dist/room/client.d.ts +20 -7
- package/dist/room/client.d.ts.map +1 -1
- package/dist/room/client.js +262 -45
- package/dist/room/computer.d.ts.map +1 -1
- package/dist/room/computer.js +8 -0
- package/dist/room/context.d.ts +3 -2
- package/dist/room/context.d.ts.map +1 -1
- package/dist/room/context.js +10 -3
- package/dist/room/turnQueue.d.ts +40 -0
- package/dist/room/turnQueue.d.ts.map +1 -0
- package/dist/room/turnQueue.js +301 -0
- package/dist/setup/page.d.ts +3 -0
- package/dist/setup/page.d.ts.map +1 -0
- package/dist/setup/page.js +120 -0
- package/dist/setup/server.d.ts +26 -0
- package/dist/setup/server.d.ts.map +1 -0
- package/dist/setup/server.js +398 -0
- package/dist/skills/lucidity-automations/SKILL.md +54 -0
- package/dist/speech/captures.d.ts +30 -0
- package/dist/speech/captures.d.ts.map +1 -0
- package/dist/speech/captures.js +209 -0
- package/dist/speech/fluidAudio.d.ts +28 -0
- package/dist/speech/fluidAudio.d.ts.map +1 -0
- package/dist/speech/fluidAudio.js +182 -0
- package/dist/speech/service.d.ts +14 -0
- package/dist/speech/service.d.ts.map +1 -0
- package/dist/speech/service.js +88 -0
- package/dist/speech/types.d.ts +19 -0
- package/dist/speech/types.d.ts.map +1 -0
- package/dist/speech/types.js +1 -0
- package/dist/turnLog.d.ts +1 -0
- package/dist/turnLog.d.ts.map +1 -1
- package/dist/turnLog.js +3 -0
- package/native/speech/Package.resolved +15 -0
- package/native/speech/Package.swift +16 -0
- package/native/speech/Sources/lucidity-speech/Speech.swift +81 -0
- package/package.json +6 -2
- package/src/automations/agent.ts +239 -0
- package/src/automations/cli.ts +52 -0
- package/src/automations/connections.ts +83 -0
- package/src/automations/designer.ts +594 -0
- package/src/automations/history.ts +59 -0
- package/src/automations/learning.ts +180 -0
- package/src/automations/pinterest.ts +146 -0
- package/src/automations/service.ts +505 -0
- package/src/automations/setup.ts +71 -0
- package/src/automations/skill.ts +40 -0
- package/src/automations/store.ts +63 -0
- package/src/chat/server.ts +62 -3
- package/src/coding/commandContext.ts +29 -0
- package/src/coding/runCodeTurn.ts +65 -21
- package/src/coding/worktree.ts +3 -4
- package/src/config.ts +32 -2
- package/src/decisions/cli.ts +136 -0
- package/src/decisions/client.ts +62 -0
- package/src/handoff.ts +28 -0
- package/src/index.ts +204 -58
- package/src/jobs/briefing.ts +1 -1
- package/src/jobs/extraction.ts +157 -32
- package/src/jobs/fastModeReview.ts +221 -0
- package/src/jobs/voiceReview.ts +156 -0
- package/src/mcp/clients.ts +269 -0
- package/src/mcp/config.ts +58 -7
- package/src/mcp/paired.ts +23 -0
- package/src/mcp/pairedConfig.ts +44 -0
- package/src/notesContext.ts +3 -2
- package/src/room/client.ts +316 -52
- package/src/room/computer.ts +8 -0
- package/src/room/context.ts +12 -3
- package/src/room/turnQueue.ts +358 -0
- package/src/setup/page.ts +122 -0
- package/src/setup/server.ts +483 -0
- package/src/speech/captures.ts +265 -0
- package/src/speech/fluidAudio.ts +242 -0
- package/src/speech/service.ts +108 -0
- package/src/speech/types.ts +13 -0
- package/src/turnLog.ts +4 -0
- package/vendor/decisions/LICENSE +662 -0
- package/vendor/decisions/dist/capture.d.ts +79 -0
- package/vendor/decisions/dist/capture.js +183 -0
- package/vendor/decisions/dist/command.d.ts +202 -0
- package/vendor/decisions/dist/command.js +750 -0
- package/vendor/decisions/dist/gate.d.ts +12 -0
- package/vendor/decisions/dist/gate.js +18 -0
- package/vendor/decisions/dist/index.d.ts +5 -0
- package/vendor/decisions/dist/index.js +5 -0
- package/vendor/decisions/dist/jev.d.ts +15 -0
- package/vendor/decisions/dist/jev.js +242 -0
- package/vendor/decisions/dist/types.d.ts +67 -0
- package/vendor/decisions/dist/types.js +1 -0
- package/vendor/decisions/package.json +22 -0
- package/vendor/decisions/src/capture.ts +199 -0
- package/vendor/decisions/src/command.ts +836 -0
- package/vendor/decisions/src/gate.ts +32 -0
- package/vendor/decisions/src/index.ts +5 -0
- package/vendor/decisions/src/jev.ts +293 -0
- package/vendor/decisions/src/types.ts +79 -0
- package/vendor/mcp-server/README.md +130 -48
- package/vendor/mcp-server/dist/client.d.ts +1 -0
- package/vendor/mcp-server/dist/client.d.ts.map +1 -1
- package/vendor/mcp-server/dist/client.js +8 -0
- package/vendor/mcp-server/dist/commentProvider.d.ts +3 -0
- package/vendor/mcp-server/dist/commentProvider.d.ts.map +1 -0
- package/vendor/mcp-server/dist/commentProvider.js +10 -0
- package/vendor/mcp-server/dist/index.js +26 -5
- package/vendor/mcp-server/dist/tools/automations.d.ts +6 -0
- package/vendor/mcp-server/dist/tools/automations.d.ts.map +1 -0
- package/vendor/mcp-server/dist/tools/automations.js +163 -0
- package/vendor/mcp-server/dist/tools/commandEventFormat.d.ts +52 -0
- package/vendor/mcp-server/dist/tools/commandEventFormat.d.ts.map +1 -0
- package/vendor/mcp-server/dist/tools/commandEventFormat.js +83 -0
- package/vendor/mcp-server/dist/tools/commandEvents.d.ts +3 -0
- package/vendor/mcp-server/dist/tools/commandEvents.d.ts.map +1 -0
- package/vendor/mcp-server/dist/tools/commandEvents.js +21 -0
- package/vendor/mcp-server/dist/tools/comments.d.ts.map +1 -1
- package/vendor/mcp-server/dist/tools/comments.js +41 -5
- package/vendor/mcp-server/dist/tools/index.d.ts +2 -0
- package/vendor/mcp-server/dist/tools/index.d.ts.map +1 -1
- package/vendor/mcp-server/dist/tools/index.js +2 -0
- package/vendor/mcp-server/dist/tools/journal.d.ts +3 -0
- package/vendor/mcp-server/dist/tools/journal.d.ts.map +1 -0
- package/vendor/mcp-server/dist/tools/journal.js +131 -0
- package/vendor/mcp-server/dist/tools/memory.d.ts +2 -2
- package/vendor/mcp-server/dist/tools/memory.d.ts.map +1 -1
- package/vendor/mcp-server/dist/tools/memory.js +24 -14
- package/vendor/mcp-server/dist/tools/milestones.d.ts.map +1 -1
- package/vendor/mcp-server/dist/tools/milestones.js +30 -0
- package/vendor/mcp-server/dist/tools/notes.d.ts.map +1 -1
- package/vendor/mcp-server/dist/tools/notes.js +30 -5
- package/vendor/mcp-server/dist/tools/projects.d.ts.map +1 -1
- package/vendor/mcp-server/dist/tools/projects.js +15 -0
- package/vendor/mcp-server/dist/tools/queries.d.ts.map +1 -1
- package/vendor/mcp-server/dist/tools/queries.js +27 -2
- package/vendor/mcp-server/dist/tools/taskActivity.d.ts +3 -0
- package/vendor/mcp-server/dist/tools/taskActivity.d.ts.map +1 -0
- package/vendor/mcp-server/dist/tools/taskActivity.js +32 -0
- package/vendor/mcp-server/dist/tools/taskOccurrences.d.ts +3 -0
- package/vendor/mcp-server/dist/tools/taskOccurrences.d.ts.map +1 -0
- package/vendor/mcp-server/dist/tools/taskOccurrences.js +12 -0
- package/vendor/mcp-server/dist/tools/taskTrash.d.ts +3 -0
- package/vendor/mcp-server/dist/tools/taskTrash.d.ts.map +1 -0
- package/vendor/mcp-server/dist/tools/taskTrash.js +21 -0
- package/vendor/mcp-server/dist/tools/tasks.d.ts.map +1 -1
- package/vendor/mcp-server/dist/tools/tasks.js +99 -22
- package/vendor/mcp-server/package.json +5 -1
- package/vendor/mcp-server/src/client.ts +10 -0
- package/vendor/mcp-server/src/commentProvider.ts +9 -0
- package/vendor/mcp-server/src/index.ts +33 -6
- package/vendor/mcp-server/src/tools/automations.ts +199 -0
- package/vendor/mcp-server/src/tools/commandEventFormat.ts +108 -0
- package/vendor/mcp-server/src/tools/commandEvents.ts +27 -0
- package/vendor/mcp-server/src/tools/comments.ts +43 -4
- package/vendor/mcp-server/src/tools/index.ts +2 -0
- package/vendor/mcp-server/src/tools/journal.ts +168 -0
- package/vendor/mcp-server/src/tools/memory.ts +26 -12
- package/vendor/mcp-server/src/tools/milestones.ts +36 -0
- package/vendor/mcp-server/src/tools/notes.ts +35 -4
- package/vendor/mcp-server/src/tools/projects.ts +18 -0
- package/vendor/mcp-server/src/tools/queries.ts +30 -0
- package/vendor/mcp-server/src/tools/taskActivity.ts +55 -0
- package/vendor/mcp-server/src/tools/taskOccurrences.ts +26 -0
- package/vendor/mcp-server/src/tools/taskTrash.ts +23 -0
- package/vendor/mcp-server/src/tools/tasks.ts +104 -24
- package/vendor/notes/dist/index.d.ts +2 -0
- package/vendor/notes/dist/index.d.ts.map +1 -1
- package/vendor/notes/dist/index.js +2 -0
- package/vendor/notes/dist/journal-backend.d.ts +4 -0
- package/vendor/notes/dist/journal-backend.d.ts.map +1 -0
- package/vendor/notes/dist/journal-backend.js +33 -0
- package/vendor/notes/dist/journal.d.ts +7 -0
- package/vendor/notes/dist/journal.d.ts.map +1 -0
- package/vendor/notes/dist/journal.js +173 -0
- package/vendor/notes/dist/vault.d.ts.map +1 -1
- package/vendor/notes/dist/vault.js +6 -1
- package/vendor/notes/src/index.ts +2 -0
- package/vendor/notes/src/journal-backend.ts +53 -0
- package/vendor/notes/src/journal.ts +194 -0
- package/vendor/notes/src/vault.ts +9 -1
- package/vendor/runtime/README.md +4 -0
- package/vendor/runtime/dist/executor/claudeAgent.d.ts +2 -0
- package/vendor/runtime/dist/executor/claudeAgent.d.ts.map +1 -1
- package/vendor/runtime/dist/executor/claudeAgent.js +113 -8
- package/vendor/runtime/dist/executor/claudeCode.d.ts.map +1 -1
- package/vendor/runtime/dist/executor/claudeCode.js +8 -4
- package/vendor/runtime/dist/executor/codex.d.ts +2 -0
- package/vendor/runtime/dist/executor/codex.d.ts.map +1 -1
- package/vendor/runtime/dist/executor/codex.js +213 -11
- package/vendor/runtime/dist/executor/codexProtocol/PlanType.d.ts +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/PlanType.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/PlanType.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/CreditsSnapshot.d.ts +6 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/CreditsSnapshot.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/CreditsSnapshot.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/GetAccountRateLimitsResponse.d.ts +26 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/GetAccountRateLimitsResponse.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/GetAccountRateLimitsResponse.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitReachedType.d.ts +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitReachedType.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitReachedType.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitResetCredit.d.ts +27 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitResetCredit.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitResetCredit.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitResetCreditStatus.d.ts +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitResetCreditStatus.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitResetCreditStatus.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitResetCreditsSummary.d.ts +13 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitResetCreditsSummary.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitResetCreditsSummary.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitResetType.d.ts +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitResetType.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitResetType.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitSnapshot.d.ts +20 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitSnapshot.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitSnapshot.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitWindow.d.ts +6 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitWindow.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/RateLimitWindow.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/ReviewDelivery.d.ts +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/ReviewDelivery.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/ReviewDelivery.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/ReviewStartParams.d.ts +12 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/ReviewStartParams.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/ReviewStartParams.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/ReviewTarget.d.ts +17 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/ReviewTarget.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/ReviewTarget.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/SkillDependencies.d.ts +5 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/SkillDependencies.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/SkillDependencies.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/SkillErrorInfo.d.ts +5 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/SkillErrorInfo.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/SkillErrorInfo.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/SkillInterface.d.ts +18 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/SkillInterface.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/SkillInterface.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/SkillMetadata.d.ts +22 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/SkillMetadata.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/SkillMetadata.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/SkillScope.d.ts +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/SkillScope.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/SkillScope.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/SkillToolDependency.d.ts +9 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/SkillToolDependency.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/SkillToolDependency.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/SkillsListEntry.d.ts +8 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/SkillsListEntry.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/SkillsListEntry.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/SkillsListResponse.d.ts +5 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/SkillsListResponse.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/SkillsListResponse.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/SpendControlLimitSnapshot.d.ts +7 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/SpendControlLimitSnapshot.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/SpendControlLimitSnapshot.js +2 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadSetNameParams.d.ts +5 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadSetNameParams.d.ts.map +1 -0
- package/vendor/runtime/dist/executor/codexProtocol/v2/ThreadSetNameParams.js +2 -0
- package/vendor/runtime/dist/executor/health.d.ts +1 -0
- package/vendor/runtime/dist/executor/health.d.ts.map +1 -1
- package/vendor/runtime/dist/executor/health.js +3 -0
- package/vendor/runtime/dist/executor/liveTurns.d.ts.map +1 -1
- package/vendor/runtime/dist/executor/liveTurns.js +3 -0
- package/vendor/runtime/dist/executor/providerRouter.d.ts.map +1 -1
- package/vendor/runtime/dist/executor/providerRouter.js +2 -1
- package/vendor/runtime/dist/executor/types.d.ts +8 -0
- package/vendor/runtime/dist/executor/types.d.ts.map +1 -1
- package/vendor/runtime/dist/harness/index.d.ts +1 -0
- package/vendor/runtime/dist/harness/index.d.ts.map +1 -1
- package/vendor/runtime/dist/harness/index.js +35 -1
- package/vendor/runtime/dist/harness/types.d.ts +4 -1
- package/vendor/runtime/dist/harness/types.d.ts.map +1 -1
- package/vendor/runtime/dist/index.d.ts +2 -1
- package/vendor/runtime/dist/index.d.ts.map +1 -1
- package/vendor/runtime/dist/index.js +2 -0
- package/vendor/runtime/dist/journal/context.d.ts +18 -0
- package/vendor/runtime/dist/journal/context.d.ts.map +1 -1
- package/vendor/runtime/dist/journal/context.js +19 -5
- package/vendor/runtime/dist/prompts/briefing.d.ts +4 -7
- package/vendor/runtime/dist/prompts/briefing.d.ts.map +1 -1
- package/vendor/runtime/dist/prompts/briefing.js +61 -12
- package/vendor/runtime/dist/prompts/cardStatement.d.ts +7 -0
- package/vendor/runtime/dist/prompts/cardStatement.d.ts.map +1 -0
- package/vendor/runtime/dist/prompts/cardStatement.js +52 -0
- package/vendor/runtime/dist/prompts/chat.d.ts +1 -0
- package/vendor/runtime/dist/prompts/chat.d.ts.map +1 -1
- package/vendor/runtime/dist/prompts/chat.js +15 -1
- package/vendor/runtime/dist/prompts/projectCapture.d.ts +7 -0
- package/vendor/runtime/dist/prompts/projectCapture.d.ts.map +1 -0
- package/vendor/runtime/dist/prompts/projectCapture.js +31 -0
- package/vendor/runtime/src/executor/claudeAgent.ts +133 -7
- package/vendor/runtime/src/executor/claudeCode.ts +6 -4
- package/vendor/runtime/src/executor/codex.ts +280 -20
- package/vendor/runtime/src/executor/codexProtocol/PlanType.ts +5 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/CreditsSnapshot.ts +5 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/GetAccountRateLimitsResponse.ts +25 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/RateLimitReachedType.ts +5 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/RateLimitResetCredit.ts +27 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/RateLimitResetCreditStatus.ts +5 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/RateLimitResetCreditsSummary.ts +14 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/RateLimitResetType.ts +5 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/RateLimitSnapshot.ts +14 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/RateLimitWindow.ts +5 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/ReviewDelivery.ts +5 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/ReviewStartParams.ts +12 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/ReviewTarget.ts +9 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/SkillDependencies.ts +6 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/SkillErrorInfo.ts +5 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/SkillInterface.ts +14 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/SkillMetadata.ts +17 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/SkillScope.ts +5 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/SkillToolDependency.ts +5 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/SkillsListEntry.ts +7 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/SkillsListResponse.ts +6 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/SpendControlLimitSnapshot.ts +5 -0
- package/vendor/runtime/src/executor/codexProtocol/v2/ThreadSetNameParams.ts +5 -0
- package/vendor/runtime/src/executor/health.ts +3 -0
- package/vendor/runtime/src/executor/liveTurns.ts +3 -0
- package/vendor/runtime/src/executor/providerRouter.ts +2 -1
- package/vendor/runtime/src/executor/types.ts +8 -0
- package/vendor/runtime/src/harness/index.ts +40 -6
- package/vendor/runtime/src/harness/types.ts +4 -1
- package/vendor/runtime/src/index.ts +4 -1
- package/vendor/runtime/src/journal/context.ts +40 -7
- package/vendor/runtime/src/prompts/briefing.ts +62 -17
- package/vendor/runtime/src/prompts/cardStatement.ts +64 -0
- package/vendor/runtime/src/prompts/chat.ts +25 -3
- package/vendor/runtime/src/prompts/projectCapture.ts +51 -0
- package/vendor/shared/dist/agentCommands.d.ts +22 -0
- package/vendor/shared/dist/agentCommands.d.ts.map +1 -0
- package/vendor/shared/dist/agentCommands.js +11 -0
- package/vendor/shared/dist/automationTemplates.d.ts +37 -0
- package/vendor/shared/dist/automationTemplates.d.ts.map +1 -0
- package/vendor/shared/dist/automationTemplates.js +48 -0
- package/vendor/shared/dist/automations.d.ts +1052 -0
- package/vendor/shared/dist/automations.d.ts.map +1 -0
- package/vendor/shared/dist/automations.js +300 -0
- package/vendor/shared/dist/brandArtwork.d.ts +4 -0
- package/vendor/shared/dist/brandArtwork.d.ts.map +1 -0
- package/vendor/shared/dist/brandArtwork.js +7 -0
- package/vendor/shared/dist/cardStatement.d.ts +28 -0
- package/vendor/shared/dist/cardStatement.d.ts.map +1 -0
- package/vendor/shared/dist/cardStatement.js +37 -0
- package/vendor/shared/dist/cardStudio.d.ts +756 -0
- package/vendor/shared/dist/cardStudio.d.ts.map +1 -0
- package/vendor/shared/dist/cardStudio.js +297 -0
- package/vendor/shared/dist/commandLocal.d.ts +218 -0
- package/vendor/shared/dist/commandLocal.d.ts.map +1 -0
- package/vendor/shared/dist/commandLocal.js +662 -0
- package/vendor/shared/dist/commandText.d.ts +12 -0
- package/vendor/shared/dist/commandText.d.ts.map +1 -0
- package/vendor/shared/dist/commandText.js +21 -0
- package/vendor/shared/dist/commands.d.ts +1516 -0
- package/vendor/shared/dist/commands.d.ts.map +1 -0
- package/vendor/shared/dist/commands.js +231 -0
- package/vendor/shared/dist/computer.d.ts +9 -9
- package/vendor/shared/dist/computer.d.ts.map +1 -1
- package/vendor/shared/dist/computer.js +11 -2
- package/vendor/shared/dist/constants.d.ts +3 -3
- package/vendor/shared/dist/constants.d.ts.map +1 -1
- package/vendor/shared/dist/constants.js +9 -2
- package/vendor/shared/dist/githubContributions.d.ts +93 -0
- package/vendor/shared/dist/githubContributions.d.ts.map +1 -0
- package/vendor/shared/dist/githubContributions.js +54 -0
- package/vendor/shared/dist/habitContributions.d.ts +26 -0
- package/vendor/shared/dist/habitContributions.d.ts.map +1 -0
- package/vendor/shared/dist/habitContributions.js +119 -0
- package/vendor/shared/dist/index.d.ts +26 -1
- package/vendor/shared/dist/index.d.ts.map +1 -1
- package/vendor/shared/dist/index.js +23 -1
- package/vendor/shared/dist/journal-migration.d.ts +29 -0
- package/vendor/shared/dist/journal-migration.d.ts.map +1 -0
- package/vendor/shared/dist/journal-migration.js +73 -0
- package/vendor/shared/dist/journal-vault.d.ts +414 -0
- package/vendor/shared/dist/journal-vault.d.ts.map +1 -0
- package/vendor/shared/dist/journal-vault.js +972 -0
- package/vendor/shared/dist/projectCapture.d.ts +73 -0
- package/vendor/shared/dist/projectCapture.d.ts.map +1 -0
- package/vendor/shared/dist/projectCapture.js +66 -0
- package/vendor/shared/dist/quickAdd.d.ts +90 -0
- package/vendor/shared/dist/quickAdd.d.ts.map +1 -0
- package/vendor/shared/dist/quickAdd.js +260 -0
- package/vendor/shared/dist/recurrence.d.ts +44 -0
- package/vendor/shared/dist/recurrence.d.ts.map +1 -0
- package/vendor/shared/dist/recurrence.js +37 -0
- package/vendor/shared/dist/reminderWords.d.ts +11 -0
- package/vendor/shared/dist/reminderWords.d.ts.map +1 -0
- package/vendor/shared/dist/reminderWords.js +63 -0
- package/vendor/shared/dist/schemas/comment.d.ts +13 -1
- package/vendor/shared/dist/schemas/comment.d.ts.map +1 -1
- package/vendor/shared/dist/schemas/comment.js +5 -0
- package/vendor/shared/dist/schemas/conversation.d.ts +3 -3
- package/vendor/shared/dist/schemas/harness.d.ts +922 -59
- package/vendor/shared/dist/schemas/harness.d.ts.map +1 -1
- package/vendor/shared/dist/schemas/harness.js +122 -3
- package/vendor/shared/dist/schemas/journal.d.ts +10 -0
- package/vendor/shared/dist/schemas/journal.d.ts.map +1 -1
- package/vendor/shared/dist/schemas/journal.js +10 -2
- package/vendor/shared/dist/schemas/notification.d.ts +1 -1
- package/vendor/shared/dist/schemas/organization.d.ts +3 -2
- package/vendor/shared/dist/schemas/organization.d.ts.map +1 -1
- package/vendor/shared/dist/schemas/organization.js +3 -2
- package/vendor/shared/dist/schemas/proposal.d.ts +7 -3
- package/vendor/shared/dist/schemas/proposal.d.ts.map +1 -1
- package/vendor/shared/dist/schemas/proposal.js +2 -1
- package/vendor/shared/dist/schemas/request.d.ts +44 -4
- package/vendor/shared/dist/schemas/request.d.ts.map +1 -1
- package/vendor/shared/dist/schemas/task.d.ts +83 -8
- package/vendor/shared/dist/schemas/task.d.ts.map +1 -1
- package/vendor/shared/dist/schemas/task.js +20 -2
- package/vendor/shared/dist/schemas/timeSession.d.ts +2 -2
- package/vendor/shared/dist/setupAppearance.d.ts +6 -0
- package/vendor/shared/dist/setupAppearance.d.ts.map +1 -0
- package/vendor/shared/dist/setupAppearance.js +17 -0
- package/vendor/shared/dist/smartCapture.d.ts +60 -0
- package/vendor/shared/dist/smartCapture.d.ts.map +1 -0
- package/vendor/shared/dist/smartCapture.js +56 -0
- package/vendor/shared/dist/speech.d.ts +39 -0
- package/vendor/shared/dist/speech.d.ts.map +1 -0
- package/vendor/shared/dist/speech.js +36 -0
- package/vendor/shared/dist/spokenNames.d.ts +25 -0
- package/vendor/shared/dist/spokenNames.d.ts.map +1 -0
- package/vendor/shared/dist/spokenNames.js +120 -0
- package/vendor/shared/dist/taskActivity.d.ts +76 -0
- package/vendor/shared/dist/taskActivity.d.ts.map +1 -0
- package/vendor/shared/dist/taskActivity.js +27 -0
- package/vendor/shared/dist/vault-search.d.ts +50 -0
- package/vendor/shared/dist/vault-search.d.ts.map +1 -0
- package/vendor/shared/dist/vault-search.js +177 -0
- package/vendor/shared/dist/voiceCapture.d.ts +32 -0
- package/vendor/shared/dist/voiceCapture.d.ts.map +1 -0
- package/vendor/shared/dist/voiceCapture.js +29 -0
- package/vendor/shared/package.json +4 -0
- package/vendor/shared/src/agentCommands.ts +35 -0
- package/vendor/shared/src/automationTemplates.ts +54 -0
- package/vendor/shared/src/automations.ts +329 -0
- package/vendor/shared/src/brandArtwork.ts +7 -0
- package/vendor/shared/src/cardStatement.ts +49 -0
- package/vendor/shared/src/cardStudio.ts +340 -0
- package/vendor/shared/src/commandLocal.ts +738 -0
- package/vendor/shared/src/commandText.ts +25 -0
- package/vendor/shared/src/commands.ts +253 -0
- package/vendor/shared/src/computer.ts +23 -6
- package/vendor/shared/src/constants.ts +9 -2
- package/vendor/shared/src/githubContributions.ts +70 -0
- package/vendor/shared/src/habitContributions.ts +144 -0
- package/vendor/shared/src/index.ts +42 -0
- package/vendor/shared/src/journal-migration.ts +130 -0
- package/vendor/shared/src/journal-vault.ts +1240 -0
- package/vendor/shared/src/projectCapture.ts +86 -0
- package/vendor/shared/src/quickAdd.ts +310 -0
- package/vendor/shared/src/recurrence.ts +37 -0
- package/vendor/shared/src/reminderWords.ts +54 -0
- package/vendor/shared/src/schemas/comment.ts +5 -0
- package/vendor/shared/src/schemas/harness.ts +144 -7
- package/vendor/shared/src/schemas/journal.ts +15 -6
- package/vendor/shared/src/schemas/organization.ts +3 -2
- package/vendor/shared/src/schemas/proposal.ts +6 -1
- package/vendor/shared/src/schemas/task.ts +20 -2
- package/vendor/shared/src/setupAppearance.ts +32 -0
- package/vendor/shared/src/smartCapture.ts +67 -0
- package/vendor/shared/src/speech.ts +44 -0
- package/vendor/shared/src/spokenNames.ts +128 -0
- package/vendor/shared/src/taskActivity.ts +34 -0
- package/vendor/shared/src/vault-search.ts +243 -0
- package/vendor/shared/src/voiceCapture.ts +34 -0
|
@@ -1,4 +1,20 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import {
|
|
3
|
+
VoiceCaptureAudioSchema,
|
|
4
|
+
VoiceCaptureReceiptSchema,
|
|
5
|
+
} from '../voiceCapture.js';
|
|
6
|
+
import {
|
|
7
|
+
ComputerSpeechSchema,
|
|
8
|
+
SpeechAudioSchema,
|
|
9
|
+
SpeechModelIdSchema,
|
|
10
|
+
SpeechTranscriptSchema,
|
|
11
|
+
} from '../speech.js';
|
|
12
|
+
import {
|
|
13
|
+
AutomationCommandSchema,
|
|
14
|
+
AutomationSnapshotSchema,
|
|
15
|
+
} from '../automations.js';
|
|
16
|
+
import { ProjectPlanningContextSchema } from '../projectCapture.js';
|
|
17
|
+
import { validatedCardSegments } from '../cardStatement.js';
|
|
2
18
|
import {
|
|
3
19
|
SENDER_KINDS,
|
|
4
20
|
HARNESS_REQUEST_KINDS,
|
|
@@ -44,14 +60,36 @@ export const HarnessImageSchema = z.object({
|
|
|
44
60
|
// At most a handful per turn — keeps the worst-case replay-buffer footprint bounded.
|
|
45
61
|
const harnessImagesField = z.array(HarnessImageSchema).max(6).optional();
|
|
46
62
|
|
|
63
|
+
/**
|
|
64
|
+
* Carries a conversation over to the other provider, for when its own provider has run out of
|
|
65
|
+
* allowance or the user switches. The provider sessions can't share memory, so the new one gets
|
|
66
|
+
* the conversation as the phone shows it. Only read on a turn with no `resume`.
|
|
67
|
+
*/
|
|
68
|
+
export const ProviderHandoffSchema = z.object({
|
|
69
|
+
from: z.enum(['claude', 'codex']),
|
|
70
|
+
/** Oldest first, already trimmed by the phone to its most recent part. */
|
|
71
|
+
transcript: z.string().min(1).max(120_000),
|
|
72
|
+
});
|
|
73
|
+
export type ProviderHandoff = z.infer<typeof ProviderHandoffSchema>;
|
|
74
|
+
|
|
75
|
+
/** Start a new session on this provider instead of the configured default. Ignored with `resume`. */
|
|
76
|
+
const providerField = z.enum(['claude', 'codex']).optional();
|
|
77
|
+
|
|
47
78
|
// One-shot question to Lucid ("Ask Lucid"). The only kind that carries free text.
|
|
48
79
|
export const AskRequestSchema = HarnessRequestBase.extend({
|
|
49
80
|
kind: z.literal('ask'),
|
|
50
81
|
prompt: z.string().min(1).max(8000),
|
|
82
|
+
/** Feature-gated, tool-free project interpretation; never resumes a chat session. */
|
|
83
|
+
projectPlan: ProjectPlanningContextSchema.optional(),
|
|
51
84
|
/** Photos attached to the question (vision). Optional; absent on a text-only ask. */
|
|
52
85
|
images: harnessImagesField,
|
|
53
86
|
/** Claude Code session id to continue (conversation continuity via --resume). */
|
|
54
87
|
resume: z.string().optional(),
|
|
88
|
+
provider: providerField,
|
|
89
|
+
handoff: ProviderHandoffSchema.optional(),
|
|
90
|
+
/** Daemon-owned durable queue; feature-gated by turn-queue. */
|
|
91
|
+
queue: z.boolean().optional(),
|
|
92
|
+
afterRequestId: z.uuidv7().optional(),
|
|
55
93
|
});
|
|
56
94
|
|
|
57
95
|
// Today's briefing. The engine derives the content from the user's tasks, so no
|
|
@@ -80,6 +118,11 @@ export const CodeRequestSchema = HarnessRequestBase.extend({
|
|
|
80
118
|
/** Claude Code session id to continue — threads both the conversation (--resume)
|
|
81
119
|
* and the files (re-attach the session's lucid/<repoId> branch) across turns. */
|
|
82
120
|
resume: z.string().optional(),
|
|
121
|
+
provider: providerField,
|
|
122
|
+
/** Also keeps the workspace as it is, where a turn without `resume` would start it fresh. */
|
|
123
|
+
handoff: ProviderHandoffSchema.optional(),
|
|
124
|
+
queue: z.boolean().optional(),
|
|
125
|
+
afterRequestId: z.uuidv7().optional(),
|
|
83
126
|
/** Conductor worker id (a fleet subtask's id). Present when the phone drills into one
|
|
84
127
|
* worker of a fan-out and sends it a follow-up turn: the daemon runs it in that worker's
|
|
85
128
|
* isolated `fleet/<repoId>/<workerId>` worktree, on its own lane. Absent → the bare repo
|
|
@@ -329,13 +372,15 @@ const timeString = z
|
|
|
329
372
|
// The capability dial the phone can flip (GitHub #98). `connected` is reserved and not
|
|
330
373
|
// editable, so it's absent from the patch; the view reports it read-only.
|
|
331
374
|
export const DaemonCapabilitiesPatchSchema = z
|
|
332
|
-
.object({ tasks: z.boolean(), memory: z.boolean() })
|
|
375
|
+
.object({ tasks: z.boolean(), memory: z.boolean(), automations: z.boolean() })
|
|
333
376
|
.partial();
|
|
334
377
|
|
|
335
378
|
// The daemon's config as shown to the phone — every displayable field, with secrets
|
|
336
379
|
// (`apiKey`, `oauthToken`) redacted to a presence boolean. Read-only fields (paths,
|
|
337
380
|
// repo allowlist, apiUrl) are included so the screen can surface the whole config.
|
|
338
381
|
export const DaemonConfigViewSchema = z.object({
|
|
382
|
+
sttModel: SpeechModelIdSchema.optional(),
|
|
383
|
+
speech: ComputerSpeechSchema.optional(),
|
|
339
384
|
// Editable, applied live. Two role-scoped model/effort pairs: `chat*` drives the
|
|
340
385
|
// real-time turns a human waits on (Ask Lucid + voice), tuned for latency; `code*`
|
|
341
386
|
// drives repo coding turns and the batch jobs (briefing/weekly/attention), tuned
|
|
@@ -360,6 +405,7 @@ export const DaemonConfigViewSchema = z.object({
|
|
|
360
405
|
tasks: z.boolean(),
|
|
361
406
|
memory: z.boolean(),
|
|
362
407
|
connected: z.boolean(),
|
|
408
|
+
automations: z.boolean().optional(),
|
|
363
409
|
}),
|
|
364
410
|
// How much of the machine chat may touch (Puny God). Editable; restart-wired.
|
|
365
411
|
agentMode: z.enum(AGENT_MODES),
|
|
@@ -381,6 +427,7 @@ export const DaemonConfigViewSchema = z.object({
|
|
|
381
427
|
// and read-only fields are intentionally excluded, so the daemon rejects anything else.
|
|
382
428
|
export const DaemonConfigPatchSchema = z
|
|
383
429
|
.object({
|
|
430
|
+
sttModel: SpeechModelIdSchema,
|
|
384
431
|
chatProvider: z.enum(['claude', 'codex']),
|
|
385
432
|
codeProvider: z.enum(['claude', 'codex']),
|
|
386
433
|
chatModel: z.string().min(1),
|
|
@@ -407,6 +454,12 @@ export const SteerRequestSchema = HarnessRequestBase.extend({
|
|
|
407
454
|
targetId: z.uuidv7(),
|
|
408
455
|
prompt: z.string().trim().min(1).max(8000),
|
|
409
456
|
});
|
|
457
|
+
export const QueueControlRequestSchema = HarnessRequestBase.extend({
|
|
458
|
+
kind: z.literal('queue-control'),
|
|
459
|
+
targetId: z.uuidv7(),
|
|
460
|
+
action: z.enum(['cancel', 'steer']),
|
|
461
|
+
activeId: z.uuidv7().optional(),
|
|
462
|
+
});
|
|
410
463
|
export const PermissionRequestSchema = HarnessRequestBase.extend({
|
|
411
464
|
kind: z.literal('permission'),
|
|
412
465
|
targetId: z.uuidv7(),
|
|
@@ -418,6 +471,16 @@ export const ModelsRequestSchema = HarnessRequestBase.extend({
|
|
|
418
471
|
provider: AgentProviderSchema,
|
|
419
472
|
});
|
|
420
473
|
|
|
474
|
+
export const CommandsRequestSchema = HarnessRequestBase.extend({
|
|
475
|
+
kind: z.literal('commands'),
|
|
476
|
+
provider: AgentProviderSchema,
|
|
477
|
+
context: z.object({
|
|
478
|
+
repoId: z.string().min(1),
|
|
479
|
+
mode: z.enum(['worktree', 'in-place']).optional(),
|
|
480
|
+
workerId: z.string().min(1).optional(),
|
|
481
|
+
}).optional(),
|
|
482
|
+
});
|
|
483
|
+
|
|
421
484
|
// Read the daemon's current config for the Daemon Settings screen.
|
|
422
485
|
export const GetConfigRequestSchema = HarnessRequestBase.extend({
|
|
423
486
|
kind: z.literal('getConfig'),
|
|
@@ -441,9 +504,37 @@ export const AttentionRequestSchema = HarnessRequestBase.extend({
|
|
|
441
504
|
});
|
|
442
505
|
|
|
443
506
|
export const HarnessRequestSchema = z.discriminatedUnion('kind', [
|
|
507
|
+
HarnessRequestBase.extend({
|
|
508
|
+
kind: z.literal('voice-capture'),
|
|
509
|
+
credentialId: z.uuid(),
|
|
510
|
+
captureId: z.uuid(),
|
|
511
|
+
audio: VoiceCaptureAudioSchema,
|
|
512
|
+
}),
|
|
513
|
+
HarnessRequestBase.extend({
|
|
514
|
+
kind: z.literal('voice-capture-status'),
|
|
515
|
+
credentialId: z.uuid(),
|
|
516
|
+
captureId: z.uuid(),
|
|
517
|
+
}),
|
|
518
|
+
HarnessRequestBase.extend({
|
|
519
|
+
kind: z.literal('transcribe'),
|
|
520
|
+
audio: SpeechAudioSchema,
|
|
521
|
+
}),
|
|
522
|
+
HarnessRequestBase.extend({
|
|
523
|
+
kind: z.literal('getAutomations'),
|
|
524
|
+
jobId: z.string().max(120).optional(),
|
|
525
|
+
runId: z.string().max(120).optional(),
|
|
526
|
+
before: z.string().max(120).optional(),
|
|
527
|
+
limit: z.number().int().min(1).max(30).optional(),
|
|
528
|
+
}),
|
|
529
|
+
HarnessRequestBase.extend({
|
|
530
|
+
kind: z.literal('automation'),
|
|
531
|
+
command: AutomationCommandSchema,
|
|
532
|
+
}),
|
|
533
|
+
QueueControlRequestSchema,
|
|
444
534
|
SteerRequestSchema,
|
|
445
535
|
PermissionRequestSchema,
|
|
446
536
|
ModelsRequestSchema,
|
|
537
|
+
CommandsRequestSchema,
|
|
447
538
|
AskRequestSchema,
|
|
448
539
|
BriefingRequestSchema,
|
|
449
540
|
JournalRequestSchema,
|
|
@@ -513,11 +604,20 @@ export const DeviceConflictSchema = z.object({
|
|
|
513
604
|
// The cost of having no `requestId` is that the relay won't hold it for a phone that's offline,
|
|
514
605
|
// so a push can be missed. The phone caches the last board and the daemon recomposes on its next
|
|
515
606
|
// trigger, so a miss heals rather than persisting.
|
|
516
|
-
export const AttentionBoardEntrySchema = z
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
607
|
+
export const AttentionBoardEntrySchema = z
|
|
608
|
+
.object({
|
|
609
|
+
/** Short all-caps eyebrow for the card ("WORK", "SHIPPING"). Absent → the card says ATTENTION. */
|
|
610
|
+
label: z.string().optional(),
|
|
611
|
+
text: z.string(),
|
|
612
|
+
/** Existing task behind the card's Open task action. Older boards may have no target. */
|
|
613
|
+
taskId: z.string().min(1).optional(),
|
|
614
|
+
/** Optional AI-authored runs. Unknown/invalid styles fall back to the plain text. */
|
|
615
|
+
segments: z.unknown().optional(),
|
|
616
|
+
})
|
|
617
|
+
.transform(({ segments: input, ...board }) => {
|
|
618
|
+
const segments = validatedCardSegments(board.text, input);
|
|
619
|
+
return { ...board, ...(segments ? { segments } : {}) };
|
|
620
|
+
});
|
|
521
621
|
|
|
522
622
|
export const AttentionBoardSchema = z.object({
|
|
523
623
|
type: z.literal('attention_board'),
|
|
@@ -678,9 +778,37 @@ export const ModelsResponseSchema = HarnessResponseBase.extend({
|
|
|
678
778
|
models: z.array(AgentModelOptionSchema),
|
|
679
779
|
});
|
|
680
780
|
|
|
781
|
+
export const CommandsResponseSchema = HarnessResponseBase.extend({
|
|
782
|
+
kind: z.literal('commands'),
|
|
783
|
+
provider: AgentProviderSchema,
|
|
784
|
+
commands: z.array(
|
|
785
|
+
z.object({
|
|
786
|
+
name: z.string(),
|
|
787
|
+
description: z.string(),
|
|
788
|
+
argumentHint: z.string(),
|
|
789
|
+
acceptsArguments: z.boolean().optional(),
|
|
790
|
+
aliases: z.array(z.string()).optional(),
|
|
791
|
+
clearsContext: z.boolean().optional(),
|
|
792
|
+
}),
|
|
793
|
+
),
|
|
794
|
+
});
|
|
795
|
+
|
|
681
796
|
export const HarnessResponseSchema = z.discriminatedUnion('kind', [
|
|
797
|
+
HarnessResponseBase.extend({
|
|
798
|
+
kind: z.literal('voice-capture'),
|
|
799
|
+
receipt: VoiceCaptureReceiptSchema.nullable(),
|
|
800
|
+
}),
|
|
801
|
+
HarnessResponseBase.extend({
|
|
802
|
+
kind: z.literal('transcription'),
|
|
803
|
+
transcript: SpeechTranscriptSchema,
|
|
804
|
+
}),
|
|
805
|
+
HarnessResponseBase.extend({
|
|
806
|
+
kind: z.literal('automations'),
|
|
807
|
+
snapshot: AutomationSnapshotSchema,
|
|
808
|
+
}),
|
|
682
809
|
ControlResponseSchema,
|
|
683
810
|
ModelsResponseSchema,
|
|
811
|
+
CommandsResponseSchema,
|
|
684
812
|
AskResponseSchema,
|
|
685
813
|
BriefingResponseSchema,
|
|
686
814
|
JournalResponseSchema,
|
|
@@ -705,6 +833,11 @@ export const HarnessResponseSchema = z.discriminatedUnion('kind', [
|
|
|
705
833
|
// kept OUT of this schema (the relay forwards frames verbatim and never validates them
|
|
706
834
|
// through here), so it isn't a member below.
|
|
707
835
|
export const HarnessStreamEventSchema = z.discriminatedUnion('type', [
|
|
836
|
+
z.object({
|
|
837
|
+
type: z.literal('queue_state'),
|
|
838
|
+
requestId: z.uuidv7(),
|
|
839
|
+
state: z.enum(['queued', 'running']),
|
|
840
|
+
}),
|
|
708
841
|
z.object({
|
|
709
842
|
// Durable receipt written before execution; recovery only pulls saved output.
|
|
710
843
|
type: z.literal('accepted'),
|
|
@@ -832,7 +965,11 @@ export const HarnessStreamEventSchema = z.discriminatedUnion('type', [
|
|
|
832
965
|
message: z.string(),
|
|
833
966
|
}),
|
|
834
967
|
// A `cancel` request successfully stopped this in-flight turn.
|
|
835
|
-
z.object({
|
|
968
|
+
z.object({
|
|
969
|
+
type: z.literal('cancelled'),
|
|
970
|
+
requestId: z.uuidv7(),
|
|
971
|
+
queueAction: z.enum(['cancel', 'steer']).optional(),
|
|
972
|
+
}),
|
|
836
973
|
]);
|
|
837
974
|
|
|
838
975
|
// ---- Message (forward-compat: chat + M4 agent turns) ----------------------
|
|
@@ -9,7 +9,9 @@ import {
|
|
|
9
9
|
|
|
10
10
|
export const LocalDateSchema = z
|
|
11
11
|
.string()
|
|
12
|
-
.refine(isValidLocalDate, {
|
|
12
|
+
.refine(isValidLocalDate, {
|
|
13
|
+
message: 'Expected a real calendar date as YYYY-MM-DD',
|
|
14
|
+
});
|
|
13
15
|
|
|
14
16
|
/**
|
|
15
17
|
* Trimmed at the ends but otherwise untouched — no whitespace collapsing, unlike a bio.
|
|
@@ -71,7 +73,9 @@ export const CorrectJournalSegmentSchema = z.object({
|
|
|
71
73
|
message: `A correction cannot exceed ${TRANSCRIPT_MAX_LENGTH} characters`,
|
|
72
74
|
})
|
|
73
75
|
.transform((s) => s.trim())
|
|
74
|
-
.refine((s) => s.length > 0, {
|
|
76
|
+
.refine((s) => s.length > 0, {
|
|
77
|
+
message: 'A correction cannot be empty — send null to clear it',
|
|
78
|
+
})
|
|
75
79
|
.nullable(),
|
|
76
80
|
});
|
|
77
81
|
|
|
@@ -109,9 +113,15 @@ export const JournalObservationSchema = z.object({
|
|
|
109
113
|
* said is what makes the review queue trustworthy — otherwise you're accepting proposals on
|
|
110
114
|
* faith.
|
|
111
115
|
*/
|
|
112
|
-
export const JournalSegmentWithObservationsSchema = JournalSegmentSchema.extend(
|
|
113
|
-
|
|
114
|
-
|
|
116
|
+
export const JournalSegmentWithObservationsSchema = JournalSegmentSchema.extend(
|
|
117
|
+
{
|
|
118
|
+
observations: z.array(JournalObservationSchema),
|
|
119
|
+
revisions: z.array(z.string()).optional(),
|
|
120
|
+
conflicts: z
|
|
121
|
+
.array(z.object({ revision: z.string(), text: z.string() }))
|
|
122
|
+
.optional(),
|
|
123
|
+
},
|
|
124
|
+
);
|
|
115
125
|
|
|
116
126
|
export const JournalDayWithSegmentsSchema = JournalDaySchema.extend({
|
|
117
127
|
segments: z.array(JournalSegmentWithObservationsSchema),
|
|
@@ -194,4 +204,3 @@ export const WriteJournalObservationsSchema = z.object({
|
|
|
194
204
|
}),
|
|
195
205
|
),
|
|
196
206
|
});
|
|
197
|
-
|
|
@@ -68,7 +68,7 @@ export const UpdateOrganizationSchema = z.object({
|
|
|
68
68
|
/**
|
|
69
69
|
* An organization's public profile — the GitHub-shaped page. What it contains
|
|
70
70
|
* depends on the viewer: a member sees every project, everyone else sees only
|
|
71
|
-
* the public ones.
|
|
71
|
+
* the public ones. People and their roles are returned only to active members.
|
|
72
72
|
*/
|
|
73
73
|
export const OrganizationProfileSchema = z.object({
|
|
74
74
|
id: z.uuidv7(),
|
|
@@ -101,7 +101,8 @@ export const OrganizationProfileSchema = z.object({
|
|
|
101
101
|
),
|
|
102
102
|
});
|
|
103
103
|
|
|
104
|
-
/**
|
|
104
|
+
/** An active affiliation: own profile, or an organization shared with the viewer.
|
|
105
|
+
* `role` belongs to the person whose profile is being viewed, not the viewer. */
|
|
105
106
|
export const UserOrganizationSchema = z.object({
|
|
106
107
|
id: z.uuidv7(),
|
|
107
108
|
name: z.string(),
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
PROPOSAL_KINDS,
|
|
4
|
+
PROPOSAL_STATUSES,
|
|
5
|
+
PROPOSAL_LINK_TARGETS,
|
|
6
|
+
} from '../constants.js';
|
|
3
7
|
|
|
4
8
|
/**
|
|
5
9
|
* A task Lucid heard you commit to. Accepting creates it.
|
|
@@ -76,6 +80,7 @@ export const ProposalSchema = z.object({
|
|
|
76
80
|
* to prevent, not a UI detail.
|
|
77
81
|
*/
|
|
78
82
|
export const ProposalWithEvidenceSchema = ProposalSchema.extend({
|
|
83
|
+
storage: z.enum(['vault', 'server']).optional(),
|
|
79
84
|
evidence: z
|
|
80
85
|
.object({
|
|
81
86
|
segmentId: z.uuidv7(),
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { CaptureContextSchema } from '../smartCapture.js';
|
|
3
|
+
import { RecurrenceTimeZoneSchema, RecurringReminderSchema } from '../recurrence.js';
|
|
2
4
|
import {
|
|
3
5
|
TASK_STATUS_VALUES,
|
|
4
6
|
PRIORITY_MIN,
|
|
@@ -12,6 +14,7 @@ export const CreateTaskSchema = z.object({
|
|
|
12
14
|
// instead of minting its own, so an optimistic row and its saved row share one stable
|
|
13
15
|
// id (no temp→real swap). Omitted by older/other clients → server generates the id.
|
|
14
16
|
id: z.uuidv7().optional(),
|
|
17
|
+
captureContext: CaptureContextSchema.optional(),
|
|
15
18
|
title: z.string().min(1).max(500),
|
|
16
19
|
projectId: z.uuidv7().nullable().optional(),
|
|
17
20
|
milestoneId: z.uuidv7().nullable().optional(),
|
|
@@ -25,9 +28,14 @@ export const CreateTaskSchema = z.object({
|
|
|
25
28
|
priority: z.number().min(PRIORITY_MIN).max(PRIORITY_MAX).default(500),
|
|
26
29
|
position: z.number().optional(),
|
|
27
30
|
completedAt: z.coerce.date().optional(),
|
|
28
|
-
|
|
31
|
+
// Null is an explicit "no date" (it locks the date for smart capture). Without
|
|
32
|
+
// nullable() the coercion turns it into 1 January 1970.
|
|
33
|
+
dueDate: z.coerce.date().nullable().optional(),
|
|
29
34
|
reminderAt: z.coerce.date().nullable().optional(),
|
|
30
35
|
recurringFrequency: z.enum(RECURRING_FREQUENCY_VALUES).nullable().optional(),
|
|
36
|
+
recurrenceTimeZone: RecurrenceTimeZoneSchema.optional(),
|
|
37
|
+
recurrenceAnchor: z.iso.date().nullable().optional(),
|
|
38
|
+
recurringReminder: RecurringReminderSchema.nullable().optional(),
|
|
31
39
|
});
|
|
32
40
|
|
|
33
41
|
/**
|
|
@@ -69,10 +77,20 @@ export const TaskSchema = CreateTaskSchema.extend({
|
|
|
69
77
|
taskNumber: z.number().nullable(),
|
|
70
78
|
/** Identifiers this task used to answer to, oldest first. Appended on a move. */
|
|
71
79
|
previousIdentifiers: z.array(z.string()).default([]),
|
|
80
|
+
captureContext: CaptureContextSchema.nullable().optional(),
|
|
81
|
+
captureRevision: z.number().int().optional(),
|
|
82
|
+
dueDatePrecision: z.enum(['date', 'time']).nullable().optional(),
|
|
83
|
+
dueTimeZone: z.string().nullable().optional(),
|
|
72
84
|
completedAt: z.coerce.date().nullable(),
|
|
85
|
+
deletedAt: z.coerce.date().nullable().optional(),
|
|
86
|
+
deletedBy: z.uuid().nullable().optional(),
|
|
87
|
+
deletionBatchId: z.uuid().nullable().optional(),
|
|
73
88
|
dueDate: z.coerce.date().nullable(),
|
|
74
89
|
reminderAt: z.coerce.date().nullable(),
|
|
75
90
|
recurringFrequency: z.enum(RECURRING_FREQUENCY_VALUES).nullable(),
|
|
91
|
+
recurrenceAnchor: z.iso.date().nullable().optional(),
|
|
92
|
+
recurrenceVersion: z.number().int().optional(),
|
|
93
|
+
currentOccurrenceId: z.uuid().nullable().optional(),
|
|
76
94
|
reviewedAt: z.coerce.date().nullable(),
|
|
77
95
|
activeTimerStartedAt: z.coerce.date().nullable(),
|
|
78
96
|
totalElapsedSeconds: z.number(),
|
|
@@ -85,7 +103,7 @@ export const TaskSchema = CreateTaskSchema.extend({
|
|
|
85
103
|
// `.partial()` makes fields optional but does NOT strip defaults, so without
|
|
86
104
|
// these overrides an update that omits status/priority would inject
|
|
87
105
|
// status:'pending' and priority:500 and silently clobber the stored values.
|
|
88
|
-
export const UpdateTaskSchema = CreateTaskSchema.omit({ id: true })
|
|
106
|
+
export const UpdateTaskSchema = CreateTaskSchema.omit({ id: true, captureContext: true })
|
|
89
107
|
.partial()
|
|
90
108
|
.extend({
|
|
91
109
|
projectId: z.uuidv7().nullable().optional(),
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { brandLockupSvg, brandMarkSvg, brandFavicon } from './brandArtwork.js';
|
|
2
|
+
|
|
3
|
+
/** Shared visual language for local setup and hosted account approval. No external assets. */
|
|
4
|
+
const setupLightStyles = `
|
|
5
|
+
:root{color-scheme:light;--bg:#f5f3ed;--surface:#fffefa;--ink:#020626;--muted:#606576;--line:#dedfdc;--accent:#325de8;--wash:#e7edff;--soft:#eeede6;--good:#34755a;--danger:#ae3939;font:16px/1.55 -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif}
|
|
6
|
+
*{box-sizing:border-box}h1[tabindex="-1"]:focus{outline:none}body{margin:0;background:var(--bg);color:var(--ink);min-height:100vh}button,input,a{-webkit-tap-highlight-color:transparent}button,input{font:inherit}button,a{touch-action:manipulation}button{cursor:pointer}button:disabled{cursor:wait;opacity:.55}a{color:var(--accent)}:focus-visible{outline:3px solid var(--accent);outline-offset:5px}button{border:0}button.primary,a.primary{background:var(--accent);color:white;padding:14px 24px;border-radius:14px;display:inline-flex;align-items:center;justify-content:center;gap:14px;font-weight:650;text-decoration:none;min-height:52px;box-shadow:0 4px 10px #325de819}button.primary:hover,a.primary:hover{filter:brightness(1.08)}.secondary{color:var(--muted);background:transparent;padding:13px 0;min-height:48px;text-decoration:none}.secondary:hover{color:var(--ink)}.topbar{max-width:1200px;margin:auto;padding:30px 42px;display:flex;align-items:center;justify-content:space-between}.wordmark{display:flex;align-items:center;flex-shrink:0;color:var(--ink)}.brand-lockup{display:block;width:174px;height:60.141px}.mark{display:block;width:36px;height:35.52px;color:var(--ink)}.tiny{font-size:12px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}.frame{display:grid;grid-template-columns:300px 1fr;max-width:1060px;min-height:620px;margin:24px auto 60px;background:var(--surface);border:1px solid var(--line);border-radius:30px;overflow:hidden;box-shadow:0 24px 80px #283c2610}.rail{padding:44px 34px;background:var(--soft);display:flex;flex-direction:column;border-right:1px solid var(--line)}.rail h2{font-size:29px;letter-spacing:-1px;font-weight:550;line-height:1.22;margin:14px 0 35px}.steps{list-style:none;margin:0;padding:0;display:grid;gap:20px}.steps li{display:flex;align-items:center;gap:12px;color:var(--muted);font-size:14px}.steps b{width:26px;height:26px;display:grid;place-items:center;border:1px solid var(--line);border-radius:50%;font-size:11px;font-weight:500}.steps .active{color:var(--ink);font-weight:650}.steps .active b{background:var(--accent);color:#fff;border-color:var(--accent)}.steps .done b{background:var(--good);border-color:var(--good);color:white}.rail-note{margin-top:auto;padding-top:40px;font-size:12px;color:var(--muted);max-width:190px}.content{padding:52px 64px;display:flex;flex-direction:column;min-width:0}.eyebrow{font-size:11px;color:var(--accent);letter-spacing:.14em;font-weight:700;text-transform:uppercase;margin:0 0 14px}h1{font-size:42px;line-height:1.1;font-weight:570;letter-spacing:-1.8px;margin:0 0 19px}p{margin:0 0 22px}.lead{color:var(--muted);font-size:16px;max-width:430px}.actions{display:flex;align-items:center;gap:23px;flex-wrap:wrap;margin-top:28px}.fine{font-size:12px;color:var(--muted)}.card{border:1px solid var(--line);border-radius:18px;padding:19px 22px;margin:12px 0;background:var(--surface)}.card p{margin:4px 0 0;font-size:13px;color:var(--muted)}.card strong{font-size:15px;font-weight:650}.choice{width:100%;text-align:left;color:var(--ink);position:relative;display:block}.choice[aria-pressed=true]{border-color:var(--accent);box-shadow:0 0 0 2px var(--accent);background:var(--wash)}.choice .badge{float:right}.badge{font-size:11px;background:var(--soft);border-radius:30px;padding:4px 10px;color:var(--muted)}.badge.good{color:var(--good)}.checkrow{display:flex;align-items:flex-start;gap:15px;cursor:pointer}.checkrow input{accent-color:var(--accent);width:19px;height:19px;flex-shrink:0;margin-top:4px}.notice{border-radius:12px;padding:13px 16px;font-size:13px;line-height:1.5;background:var(--wash);color:var(--ink);margin-top:20px}.error{background:#b23d3910;color:var(--danger)}[hidden]{display:none!important}.code{letter-spacing:.16em;font-variant-numeric:tabular-nums;font-family:ui-monospace,monospace;word-break:break-word;font-size:16px}.status{display:flex;gap:9px;align-items:center;color:var(--muted);font-size:13px}.dot{width:7px;height:7px;background:var(--accent);border-radius:50%;box-shadow:0 0 0 5px #325de812;animation:breathe 2s infinite}.illustration{height:166px;position:relative;margin:5px 0 35px;display:grid;place-items:center}.halo{position:absolute;width:240px;height:160px;border-radius:50%;background:radial-gradient(ellipse,#d6e1fa88,transparent 70%)}.computer{width:172px;height:110px;background:var(--surface);border:1.5px solid #9aa799;border-radius:12px;position:relative;padding:9px;box-shadow:0 10px 22px #2732250c;transform:rotate(-6deg);margin-left:-35px}.screen{height:82px;border:1px solid var(--line);border-radius:6px;background:var(--wash);display:grid;place-items:center}.computer:after{content:'';position:absolute;bottom:-12px;left:-16px;width:202px;height:8px;background:var(--surface);border:1.5px solid #9aa799;border-radius:2px 2px 12px 12px}.phone{height:101px;width:54px;border:1.5px solid #9aa799;background:var(--surface);border-radius:12px;position:absolute;margin:46px 0 0 133px;transform:rotate(9deg);padding:12px 6px;box-shadow:0 5px 15px #2732250b}.phone:before{content:'';width:15px;height:3px;border-radius:4px;background:var(--line);position:absolute;top:4px;left:18px}.phone i{display:block;height:5px;background:var(--line);margin:8px 0;border-radius:3px}.phone i:first-child{background:var(--accent);width:65%}.seal{display:grid;place-items:center;width:62px;height:62px;border-radius:50%;background:#34755a12;color:var(--good);font-size:30px;margin-bottom:28px}.footer{max-width:1060px;margin:-35px auto 25px;padding:0 8px;display:flex;justify-content:space-between;font-size:12px;color:var(--muted)}.section{animation:enter .3s ease-out}.spacer{flex:1;min-height:24px}ul.details{padding-left:20px;color:var(--muted);font-size:14px}.manage{margin-top:24px}.manage .card{display:flex;align-items:center;justify-content:space-between;gap:15px}.manage button{color:var(--danger)}
|
|
7
|
+
@keyframes enter{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}@keyframes breathe{50%{opacity:.45}}@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;scroll-behavior:auto!important}}@media(max-width:760px){.topbar{padding:22px 24px}.frame{margin:10px 16px 45px;grid-template-columns:1fr;min-height:0;border-radius:23px}.rail{padding:22px 25px;border-right:0;border-bottom:1px solid var(--line)}.rail h2,.rail>.tiny,.rail-note{display:none}.steps{display:flex;justify-content:space-between;gap:5px}.steps li{font-size:0;gap:0}.steps li.active{font-size:12px;gap:8px}.steps b{font-size:11px}.content{padding:32px 27px;min-height:490px}h1{font-size:35px}.footer{margin:-25px 24px 25px}.illustration{height:135px}.brand-lockup{width:145px;height:50.117px}.topbar>.tiny{font-size:9px;max-width:115px;text-align:right}.actions{gap:15px}.code{font-size:13px;letter-spacing:.08em}}
|
|
8
|
+
`;
|
|
9
|
+
|
|
10
|
+
const setupDarkStyles = `@media(prefers-color-scheme:dark){:root{color-scheme:dark;--bg:#0c1022;--surface:#14192d;--ink:#f8f6ef;--muted:#b0b5c6;--line:#343b53;--accent:#91aaff;--wash:#242e4d;--soft:#181f35;--good:#9cd6b9;--danger:#ffb2a8}button.primary,a.primary{color:#162345}.steps .active b{color:#162345}.steps .done b{color:#163929}.halo{opacity:.2}.screen{background:#2a3543}.computer,.phone{border-color:#778475}.computer:after{border-color:#778475}}`;
|
|
11
|
+
export const setupStyles = setupLightStyles + setupDarkStyles;
|
|
12
|
+
|
|
13
|
+
export const setupMark = brandMarkSvg;
|
|
14
|
+
export const setupIllustration = `<div class="illustration" aria-hidden="true"><div class="halo"></div><div class="computer"><div class="screen">${setupMark}</div></div><div class="phone"><i></i><i></i><i></i><i></i></div></div>`;
|
|
15
|
+
export function escapeSetupHtml(value: string) {
|
|
16
|
+
return value.replace(
|
|
17
|
+
/[&<>"']/g,
|
|
18
|
+
(c) =>
|
|
19
|
+
({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[
|
|
20
|
+
c
|
|
21
|
+
]!,
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
export function setupPage(
|
|
25
|
+
body: string,
|
|
26
|
+
script: string,
|
|
27
|
+
nonce: string,
|
|
28
|
+
extraHead = '',
|
|
29
|
+
appearance: 'system' | 'light' = 'system',
|
|
30
|
+
) {
|
|
31
|
+
return `<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta name="referrer" content="no-referrer"><title>Connect your computer · Lucidity</title><link rel="icon" href="${brandFavicon}"><style nonce="${nonce}">${appearance === 'light' ? setupLightStyles : setupStyles}</style>${extraHead}</head><body><header class="topbar"><div class="wordmark" role="img" aria-label="Lucidity">${brandLockupSvg}</div><span class="tiny">A little more possibility.</span></header>${body}<footer class="footer"><span>Your work. Your computer.</span><span>Made for a clearer day.</span></footer><script nonce="${nonce}">${script}</script></body></html>`;
|
|
32
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export const CaptureContextSchema = z.object({
|
|
4
|
+
capturedAt: z.iso.datetime({ offset: true }),
|
|
5
|
+
timeZone: z.string().min(1).max(100).refine(value => {
|
|
6
|
+
try { new Intl.DateTimeFormat('en', { timeZone: value }); return true; } catch { return false; }
|
|
7
|
+
}, 'Use an IANA timezone'),
|
|
8
|
+
source: z.enum(['app', 'web', 'watch', 'shortcut', 'mcp', 'daemon', 'api']),
|
|
9
|
+
// Explicit selection of Inbox/no date can be distinguished from an untouched default.
|
|
10
|
+
lockedFields: z.array(z.enum(['project', 'date'])).max(2).optional(),
|
|
11
|
+
// Automated producers must explicitly request analysis of an unstructured capture.
|
|
12
|
+
analyze: z.boolean().optional(),
|
|
13
|
+
// A task made by voice in Fast mode: the words heard, and whether the phone or Jev read them.
|
|
14
|
+
// Lets a later review compare the title with what was actually said.
|
|
15
|
+
heard: z.string().trim().min(1).max(500).optional(),
|
|
16
|
+
readBy: z.enum(['phone', 'jev']).optional(),
|
|
17
|
+
});
|
|
18
|
+
export type CaptureContext = z.infer<typeof CaptureContextSchema>;
|
|
19
|
+
|
|
20
|
+
/** Omitted fields are untouched defaults; explicit null means Inbox/no date. */
|
|
21
|
+
export function createCaptureContext(source: 'app' | 'web', input: {
|
|
22
|
+
projectId?: string | null;
|
|
23
|
+
dueDate?: unknown;
|
|
24
|
+
captureContext?: CaptureContext;
|
|
25
|
+
}): CaptureContext {
|
|
26
|
+
const existing = input.captureContext;
|
|
27
|
+
return {
|
|
28
|
+
capturedAt: new Date().toISOString(),
|
|
29
|
+
timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
30
|
+
source,
|
|
31
|
+
...existing,
|
|
32
|
+
lockedFields: [...new Set([
|
|
33
|
+
...(existing?.lockedFields ?? []),
|
|
34
|
+
...(input.projectId !== undefined ? ['project' as const] : []),
|
|
35
|
+
...(input.dueDate !== undefined ? ['date' as const] : []),
|
|
36
|
+
])],
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** Preserve the captured calendar date and show timed deadlines in their original zone. */
|
|
41
|
+
export function formatCapturedDueDate(task: {
|
|
42
|
+
dueDate?: Date | string | null;
|
|
43
|
+
dueDatePrecision?: 'date' | 'time' | null;
|
|
44
|
+
dueTimeZone?: string | null;
|
|
45
|
+
}): { label: string; dateInputValue: string } | null {
|
|
46
|
+
if (!task.dueDate || !task.dueDatePrecision || !task.dueTimeZone) return null;
|
|
47
|
+
try {
|
|
48
|
+
const date = new Date(task.dueDate);
|
|
49
|
+
const timeZone = task.dueTimeZone;
|
|
50
|
+
const parts = new Intl.DateTimeFormat('en', { timeZone, year: 'numeric', month: '2-digit', day: '2-digit' }).formatToParts(date);
|
|
51
|
+
const part = (type: string) => parts.find(p => p.type === type)!.value;
|
|
52
|
+
const label = new Intl.DateTimeFormat('en', {
|
|
53
|
+
timeZone, weekday: 'short', month: 'short', day: 'numeric', year: 'numeric',
|
|
54
|
+
...(task.dueDatePrecision === 'time' ? { hour: 'numeric', minute: '2-digit', timeZoneName: 'short' } as const : {}),
|
|
55
|
+
}).format(date);
|
|
56
|
+
return { label, dateInputValue: `${part('year')}-${part('month')}-${part('day')}` };
|
|
57
|
+
} catch { return null; }
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export type SmartCaptureReview = {
|
|
61
|
+
status: 'pending' | 'processing' | 'ready' | 'applied' | 'dismissed' | 'undone' | 'skipped' | 'failed' | 'stale';
|
|
62
|
+
project?: { id: string; name: string };
|
|
63
|
+
date?: { dueDate: string; label: string; precision: 'date' | 'time'; timeZone: string };
|
|
64
|
+
duplicate?: { id: string; title: string };
|
|
65
|
+
message?: string;
|
|
66
|
+
pollAfterMs?: number | null;
|
|
67
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export const DEFAULT_SPEECH_MODEL = 'parakeet-tdt-0.6b-v2';
|
|
4
|
+
export const MAX_SPEECH_BYTES = 10 * 1024 * 1024;
|
|
5
|
+
export const MAX_SPEECH_SECONDS = 300;
|
|
6
|
+
// Allows a cold model download. Clients must preserve their recording on timeout/disconnect.
|
|
7
|
+
export const SPEECH_REQUEST_TIMEOUT_MS = 10 * 60 * 1000;
|
|
8
|
+
export const SpeechModelIdSchema = z
|
|
9
|
+
.string()
|
|
10
|
+
.min(1)
|
|
11
|
+
.max(100)
|
|
12
|
+
.regex(/^[a-zA-Z0-9._-]+$/);
|
|
13
|
+
export const SpeechModelSchema = z.object({
|
|
14
|
+
id: SpeechModelIdSchema,
|
|
15
|
+
label: z.string(),
|
|
16
|
+
description: z.string(),
|
|
17
|
+
});
|
|
18
|
+
export type SpeechModel = z.infer<typeof SpeechModelSchema>;
|
|
19
|
+
|
|
20
|
+
export const ComputerSpeechSchema = z.object({
|
|
21
|
+
models: z.array(SpeechModelSchema),
|
|
22
|
+
available: z.boolean(),
|
|
23
|
+
reason: z.string().optional(),
|
|
24
|
+
});
|
|
25
|
+
export type ComputerSpeech = z.infer<typeof ComputerSpeechSchema>;
|
|
26
|
+
|
|
27
|
+
// Complete files only. No user-supplied computer paths, URLs, or executable names.
|
|
28
|
+
export const SpeechAudioSchema = z.object({
|
|
29
|
+
format: z.enum(['wav', 'm4a', 'mp3', 'caf']),
|
|
30
|
+
base64: z
|
|
31
|
+
.string()
|
|
32
|
+
.min(4)
|
|
33
|
+
.max(4 * Math.ceil(MAX_SPEECH_BYTES / 3))
|
|
34
|
+
.regex(/^[A-Za-z0-9+/]*={0,2}$/)
|
|
35
|
+
.refine((value) => value.length % 4 === 0),
|
|
36
|
+
});
|
|
37
|
+
export type SpeechAudio = z.infer<typeof SpeechAudioSchema>;
|
|
38
|
+
|
|
39
|
+
export const SpeechTranscriptSchema = z.object({
|
|
40
|
+
text: z.string().max(100_000),
|
|
41
|
+
modelId: SpeechModelIdSchema,
|
|
42
|
+
durationSeconds: z.number().positive().max(MAX_SPEECH_SECONDS),
|
|
43
|
+
});
|
|
44
|
+
export type SpeechTranscript = z.infer<typeof SpeechTranscriptSchema>;
|