@opencorelabs/lucidity 0.3.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 +9 -2
- package/dist/assets/speech/licenses/FluidAudio/LICENSE +201 -0
- package/dist/assets/speech/licenses/FluidAudio/ThirdPartyLicenses/fastcluster-LICENSE.md +11 -0
- package/dist/assets/speech/licenses/FluidAudio/ThirdPartyLicenses/vbx-LICENSE.md +201 -0
- package/dist/assets/speech/lucidity-speech +0 -0
- package/dist/automations/agent.d.ts +16 -0
- package/dist/automations/agent.d.ts.map +1 -0
- package/dist/automations/agent.js +196 -0
- package/dist/automations/cli.d.ts +4 -0
- package/dist/automations/cli.d.ts.map +1 -0
- package/dist/automations/cli.js +44 -0
- package/dist/automations/connections.d.ts +11 -0
- package/dist/automations/connections.d.ts.map +1 -0
- package/dist/automations/connections.js +74 -0
- package/dist/automations/designer.d.ts +39 -0
- package/dist/automations/designer.d.ts.map +1 -0
- package/dist/automations/designer.js +450 -0
- package/dist/automations/history.d.ts +4 -0
- package/dist/automations/history.d.ts.map +1 -0
- package/dist/automations/history.js +57 -0
- package/dist/automations/learning.d.ts +19 -0
- package/dist/automations/learning.d.ts.map +1 -0
- package/dist/automations/learning.js +121 -0
- package/dist/automations/pinterest.d.ts +21 -0
- package/dist/automations/pinterest.d.ts.map +1 -0
- package/dist/automations/pinterest.js +113 -0
- package/dist/automations/service.d.ts +42 -0
- package/dist/automations/service.d.ts.map +1 -0
- package/dist/automations/service.js +406 -0
- package/dist/automations/setup.d.ts +3 -0
- package/dist/automations/setup.d.ts.map +1 -0
- package/dist/automations/setup.js +48 -0
- package/dist/automations/skill.d.ts +3 -0
- package/dist/automations/skill.d.ts.map +1 -0
- package/dist/automations/skill.js +29 -0
- package/dist/automations/store.d.ts +13 -0
- package/dist/automations/store.d.ts.map +1 -0
- package/dist/automations/store.js +46 -0
- package/dist/chat/server.d.ts +2 -0
- package/dist/chat/server.d.ts.map +1 -1
- package/dist/chat/server.js +46 -2
- package/dist/coding/commandContext.d.ts +6 -0
- package/dist/coding/commandContext.d.ts.map +1 -0
- package/dist/coding/commandContext.js +20 -0
- package/dist/coding/runCodeTurn.d.ts +12 -2
- package/dist/coding/runCodeTurn.d.ts.map +1 -1
- package/dist/coding/runCodeTurn.js +49 -19
- package/dist/coding/worktree.d.ts +3 -4
- package/dist/coding/worktree.d.ts.map +1 -1
- package/dist/coding/worktree.js +3 -4
- package/dist/config.d.ts +4 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +20 -3
- package/dist/decisions/cli.d.ts +2 -0
- package/dist/decisions/cli.d.ts.map +1 -0
- package/dist/decisions/cli.js +106 -0
- package/dist/decisions/client.d.ts +20 -0
- package/dist/decisions/client.d.ts.map +1 -0
- package/dist/decisions/client.js +41 -0
- package/dist/handoff.d.ts +11 -0
- package/dist/handoff.d.ts.map +1 -0
- package/dist/handoff.js +21 -0
- package/dist/index.js +179 -40
- package/dist/jobs/briefing.js +1 -1
- package/dist/jobs/extraction.d.ts.map +1 -1
- package/dist/jobs/extraction.js +112 -22
- package/dist/jobs/fastModeReview.d.ts +39 -0
- package/dist/jobs/fastModeReview.d.ts.map +1 -0
- package/dist/jobs/fastModeReview.js +192 -0
- package/dist/jobs/voiceReview.d.ts +24 -0
- package/dist/jobs/voiceReview.d.ts.map +1 -0
- package/dist/jobs/voiceReview.js +128 -0
- package/dist/mcp/clients.d.ts +5 -0
- package/dist/mcp/clients.d.ts.map +1 -1
- package/dist/mcp/clients.js +1 -1
- package/dist/mcp/config.d.ts +3 -1
- package/dist/mcp/config.d.ts.map +1 -1
- package/dist/mcp/config.js +48 -6
- package/dist/mcp/paired.js +1 -0
- package/dist/notesContext.d.ts.map +1 -1
- package/dist/notesContext.js +3 -2
- package/dist/room/client.d.ts +20 -7
- package/dist/room/client.d.ts.map +1 -1
- package/dist/room/client.js +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/skills/lucidity-automations/SKILL.md +54 -0
- package/dist/speech/captures.d.ts +30 -0
- package/dist/speech/captures.d.ts.map +1 -0
- package/dist/speech/captures.js +209 -0
- package/dist/speech/fluidAudio.d.ts +28 -0
- package/dist/speech/fluidAudio.d.ts.map +1 -0
- package/dist/speech/fluidAudio.js +182 -0
- package/dist/speech/service.d.ts +14 -0
- package/dist/speech/service.d.ts.map +1 -0
- package/dist/speech/service.js +88 -0
- package/dist/speech/types.d.ts +19 -0
- package/dist/speech/types.d.ts.map +1 -0
- package/dist/speech/types.js +1 -0
- package/dist/turnLog.d.ts +1 -0
- package/dist/turnLog.d.ts.map +1 -1
- package/dist/turnLog.js +3 -0
- package/native/speech/Package.resolved +15 -0
- package/native/speech/Package.swift +16 -0
- package/native/speech/Sources/lucidity-speech/Speech.swift +81 -0
- package/package.json +6 -2
- package/src/automations/agent.ts +239 -0
- package/src/automations/cli.ts +52 -0
- package/src/automations/connections.ts +83 -0
- package/src/automations/designer.ts +594 -0
- package/src/automations/history.ts +59 -0
- package/src/automations/learning.ts +180 -0
- package/src/automations/pinterest.ts +146 -0
- package/src/automations/service.ts +505 -0
- package/src/automations/setup.ts +71 -0
- package/src/automations/skill.ts +40 -0
- package/src/automations/store.ts +63 -0
- package/src/chat/server.ts +62 -3
- package/src/coding/commandContext.ts +29 -0
- package/src/coding/runCodeTurn.ts +65 -21
- package/src/coding/worktree.ts +3 -4
- package/src/config.ts +29 -2
- package/src/decisions/cli.ts +136 -0
- package/src/decisions/client.ts +62 -0
- package/src/handoff.ts +28 -0
- package/src/index.ts +196 -67
- package/src/jobs/briefing.ts +1 -1
- package/src/jobs/extraction.ts +157 -32
- package/src/jobs/fastModeReview.ts +221 -0
- package/src/jobs/voiceReview.ts +156 -0
- package/src/mcp/clients.ts +1 -1
- package/src/mcp/config.ts +56 -6
- package/src/mcp/paired.ts +1 -0
- package/src/notesContext.ts +3 -2
- package/src/room/client.ts +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/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 +6 -1
- package/vendor/mcp-server/dist/client.d.ts +1 -0
- package/vendor/mcp-server/dist/client.d.ts.map +1 -1
- package/vendor/mcp-server/dist/client.js +8 -0
- package/vendor/mcp-server/dist/commentProvider.d.ts +3 -0
- package/vendor/mcp-server/dist/commentProvider.d.ts.map +1 -0
- package/vendor/mcp-server/dist/commentProvider.js +10 -0
- package/vendor/mcp-server/dist/index.js +21 -6
- package/vendor/mcp-server/dist/tools/automations.d.ts +6 -0
- package/vendor/mcp-server/dist/tools/automations.d.ts.map +1 -0
- package/vendor/mcp-server/dist/tools/automations.js +163 -0
- package/vendor/mcp-server/dist/tools/commandEventFormat.d.ts +52 -0
- package/vendor/mcp-server/dist/tools/commandEventFormat.d.ts.map +1 -0
- package/vendor/mcp-server/dist/tools/commandEventFormat.js +83 -0
- package/vendor/mcp-server/dist/tools/commandEvents.d.ts +3 -0
- package/vendor/mcp-server/dist/tools/commandEvents.d.ts.map +1 -0
- package/vendor/mcp-server/dist/tools/commandEvents.js +21 -0
- package/vendor/mcp-server/dist/tools/comments.d.ts.map +1 -1
- package/vendor/mcp-server/dist/tools/comments.js +25 -4
- package/vendor/mcp-server/dist/tools/index.d.ts +2 -0
- package/vendor/mcp-server/dist/tools/index.d.ts.map +1 -1
- package/vendor/mcp-server/dist/tools/index.js +2 -0
- package/vendor/mcp-server/dist/tools/journal.d.ts +3 -0
- package/vendor/mcp-server/dist/tools/journal.d.ts.map +1 -0
- package/vendor/mcp-server/dist/tools/journal.js +131 -0
- package/vendor/mcp-server/dist/tools/taskActivity.d.ts +3 -0
- package/vendor/mcp-server/dist/tools/taskActivity.d.ts.map +1 -0
- package/vendor/mcp-server/dist/tools/taskActivity.js +32 -0
- package/vendor/mcp-server/dist/tools/taskOccurrences.d.ts +3 -0
- package/vendor/mcp-server/dist/tools/taskOccurrences.d.ts.map +1 -0
- package/vendor/mcp-server/dist/tools/taskOccurrences.js +12 -0
- package/vendor/mcp-server/dist/tools/taskTrash.d.ts +3 -0
- package/vendor/mcp-server/dist/tools/taskTrash.d.ts.map +1 -0
- package/vendor/mcp-server/dist/tools/taskTrash.js +21 -0
- package/vendor/mcp-server/dist/tools/tasks.d.ts.map +1 -1
- package/vendor/mcp-server/dist/tools/tasks.js +67 -27
- package/vendor/mcp-server/package.json +5 -1
- package/vendor/mcp-server/src/client.ts +10 -0
- package/vendor/mcp-server/src/commentProvider.ts +9 -0
- package/vendor/mcp-server/src/index.ts +20 -6
- package/vendor/mcp-server/src/tools/automations.ts +199 -0
- package/vendor/mcp-server/src/tools/commandEventFormat.ts +108 -0
- package/vendor/mcp-server/src/tools/commandEvents.ts +27 -0
- package/vendor/mcp-server/src/tools/comments.ts +24 -3
- package/vendor/mcp-server/src/tools/index.ts +2 -0
- package/vendor/mcp-server/src/tools/journal.ts +168 -0
- package/vendor/mcp-server/src/tools/taskActivity.ts +55 -0
- package/vendor/mcp-server/src/tools/taskOccurrences.ts +26 -0
- package/vendor/mcp-server/src/tools/taskTrash.ts +23 -0
- package/vendor/mcp-server/src/tools/tasks.ts +66 -30
- package/vendor/notes/dist/index.d.ts +2 -0
- package/vendor/notes/dist/index.d.ts.map +1 -1
- package/vendor/notes/dist/index.js +2 -0
- package/vendor/notes/dist/journal-backend.d.ts +4 -0
- package/vendor/notes/dist/journal-backend.d.ts.map +1 -0
- package/vendor/notes/dist/journal-backend.js +33 -0
- package/vendor/notes/dist/journal.d.ts +7 -0
- package/vendor/notes/dist/journal.d.ts.map +1 -0
- package/vendor/notes/dist/journal.js +173 -0
- package/vendor/notes/dist/vault.d.ts.map +1 -1
- package/vendor/notes/dist/vault.js +6 -1
- package/vendor/notes/src/index.ts +2 -0
- package/vendor/notes/src/journal-backend.ts +53 -0
- package/vendor/notes/src/journal.ts +194 -0
- package/vendor/notes/src/vault.ts +9 -1
- package/vendor/runtime/README.md +4 -0
- package/vendor/runtime/dist/executor/claudeAgent.d.ts +2 -0
- package/vendor/runtime/dist/executor/claudeAgent.d.ts.map +1 -1
- package/vendor/runtime/dist/executor/claudeAgent.js +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/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 -2
- package/vendor/shared/dist/index.d.ts.map +1 -1
- package/vendor/shared/dist/index.js +23 -2
- package/vendor/shared/dist/journal-migration.d.ts +29 -0
- package/vendor/shared/dist/journal-migration.d.ts.map +1 -0
- package/vendor/shared/dist/journal-migration.js +73 -0
- package/vendor/shared/dist/journal-vault.d.ts +414 -0
- package/vendor/shared/dist/journal-vault.d.ts.map +1 -0
- package/vendor/shared/dist/journal-vault.js +972 -0
- package/vendor/shared/dist/projectCapture.d.ts +73 -0
- package/vendor/shared/dist/projectCapture.d.ts.map +1 -0
- package/vendor/shared/dist/projectCapture.js +66 -0
- package/vendor/shared/dist/quickAdd.d.ts +90 -0
- package/vendor/shared/dist/quickAdd.d.ts.map +1 -0
- package/vendor/shared/dist/quickAdd.js +260 -0
- package/vendor/shared/dist/recurrence.d.ts +44 -0
- package/vendor/shared/dist/recurrence.d.ts.map +1 -0
- package/vendor/shared/dist/recurrence.js +37 -0
- package/vendor/shared/dist/reminderWords.d.ts +11 -0
- package/vendor/shared/dist/reminderWords.d.ts.map +1 -0
- package/vendor/shared/dist/reminderWords.js +63 -0
- package/vendor/shared/dist/schemas/comment.d.ts +13 -1
- package/vendor/shared/dist/schemas/comment.d.ts.map +1 -1
- package/vendor/shared/dist/schemas/comment.js +5 -0
- package/vendor/shared/dist/schemas/conversation.d.ts +3 -3
- package/vendor/shared/dist/schemas/harness.d.ts +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/smartCapture.d.ts +60 -0
- package/vendor/shared/dist/smartCapture.d.ts.map +1 -0
- package/vendor/shared/dist/smartCapture.js +56 -0
- package/vendor/shared/dist/speech.d.ts +39 -0
- package/vendor/shared/dist/speech.d.ts.map +1 -0
- package/vendor/shared/dist/speech.js +36 -0
- package/vendor/shared/dist/spokenNames.d.ts +25 -0
- package/vendor/shared/dist/spokenNames.d.ts.map +1 -0
- package/vendor/shared/dist/spokenNames.js +120 -0
- package/vendor/shared/dist/taskActivity.d.ts +76 -0
- package/vendor/shared/dist/taskActivity.d.ts.map +1 -0
- package/vendor/shared/dist/taskActivity.js +27 -0
- package/vendor/shared/dist/vault-search.d.ts +50 -0
- package/vendor/shared/dist/vault-search.d.ts.map +1 -0
- package/vendor/shared/dist/vault-search.js +177 -0
- package/vendor/shared/dist/voiceCapture.d.ts +32 -0
- package/vendor/shared/dist/voiceCapture.d.ts.map +1 -0
- package/vendor/shared/dist/voiceCapture.js +29 -0
- package/vendor/shared/package.json +4 -0
- package/vendor/shared/src/agentCommands.ts +35 -0
- package/vendor/shared/src/automationTemplates.ts +54 -0
- package/vendor/shared/src/automations.ts +329 -0
- package/vendor/shared/src/cardStatement.ts +49 -0
- package/vendor/shared/src/cardStudio.ts +340 -0
- package/vendor/shared/src/commandLocal.ts +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 -1
- package/vendor/shared/src/journal-migration.ts +130 -0
- package/vendor/shared/src/journal-vault.ts +1240 -0
- package/vendor/shared/src/projectCapture.ts +86 -0
- package/vendor/shared/src/quickAdd.ts +310 -0
- package/vendor/shared/src/recurrence.ts +37 -0
- package/vendor/shared/src/reminderWords.ts +54 -0
- package/vendor/shared/src/schemas/comment.ts +5 -0
- package/vendor/shared/src/schemas/harness.ts +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/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
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Instruction text handling shared by the phone and the API, so both split an instruction into the
|
|
3
|
+
* same clauses: the phone carries out the ones it can by itself and sends the rest.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
const clean = (s: string) => s.replace(/\s+/g, ' ').trim();
|
|
7
|
+
|
|
8
|
+
const COURTESY = /^(?:(?:hey|ok(?:ay)?|so|um+|uh+|jev|please)\b[\s,]*)*(?:(?:can|could|would|will)\s+you\s+)?(?:please\s+)?/i;
|
|
9
|
+
const CLAUSE_VERBS = 'go|open|show|take|navigate|add|create|make|complete|finish|mark|move|put|reschedule|push|postpone|set|start|reopen|find|list|what|which|tick|check|file|delete|repeat|recur|remind';
|
|
10
|
+
const CLAUSE_BREAK = new RegExp(`\\s*(?:[,;]\\s*(?:and\\s+)?(?:then\\s+)?|\\s+(?:and\\s+then|then|after\\s+that|and\\s+also|and)\\s+)(?=(?:${CLAUSE_VERBS})\\b)`, 'i');
|
|
11
|
+
|
|
12
|
+
/** Courtesy words removed, trailing punctuation dropped. Speech transcripts arrive punctuated. */
|
|
13
|
+
export function normalizeInstruction(text: string): string {
|
|
14
|
+
return clean(text).replace(COURTESY, '').replace(/[.!?]+$/, '').trim() || clean(text);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Where an instruction could be several. Only proposes: a clause must start with a command verb,
|
|
19
|
+
* so "buy bread and milk" stays whole, and Jev decides whether the proposal is right.
|
|
20
|
+
*/
|
|
21
|
+
export function proposeClauses(text: string): string[] {
|
|
22
|
+
const sentences = text.split(/(?<=[.!?])\s+/);
|
|
23
|
+
const clauses = sentences.flatMap((s) => s.split(CLAUSE_BREAK)).map((s) => normalizeInstruction(s)).filter(Boolean);
|
|
24
|
+
return clauses.length > 1 ? clauses.slice(0, 6) : [];
|
|
25
|
+
}
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { PRIORITY_MAX, PRIORITY_MIN, RECURRING_FREQUENCY_VALUES } from './constants.js';
|
|
3
|
+
import { RecurringReminderSchema } from './recurrence.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Jev commands: one spoken or typed instruction, interpreted by the API and carried out by the
|
|
7
|
+
* phone. Jev never writes anything itself. The API lists what could be meant (screens, tasks,
|
|
8
|
+
* projects, dates, cleaned-up titles), Jev picks from those lists, and the client executes the
|
|
9
|
+
* resulting step with the same mutations its own buttons use.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Places a command can take you. Keys match the tab catalog in `hooks/useTabSlots` where one
|
|
14
|
+
* exists, so the phone can reuse the tab bar's own navigation for them.
|
|
15
|
+
*/
|
|
16
|
+
export const COMMAND_DESTINATIONS = [
|
|
17
|
+
{ key: 'dash', label: 'Dashboard', description: 'The Dashboard or home screen' },
|
|
18
|
+
{ key: 'search', label: 'Tasks', description: 'The Tasks tab: recent tasks, search and quick capture' },
|
|
19
|
+
{ key: 'today', label: 'Today', description: 'Today: tasks due today and overdue' },
|
|
20
|
+
{ key: 'inbox', label: 'Inbox', description: 'The Inbox: tasks not filed in any project' },
|
|
21
|
+
{ key: 'projects', label: 'Projects', description: 'The list of all projects' },
|
|
22
|
+
{ key: 'milestones', label: 'Milestones', description: 'The list of milestones' },
|
|
23
|
+
{ key: 'notes', label: 'Notes', description: 'Notes' },
|
|
24
|
+
{ key: 'journal', label: 'Journal', description: 'The voice journal' },
|
|
25
|
+
{ key: 'habits', label: 'Habits', description: 'Habits' },
|
|
26
|
+
{ key: 'chat', label: 'Messages', description: 'Messages: direct messages and chats with people' },
|
|
27
|
+
{ key: 'code', label: 'Code', description: 'The Code tab for coding with Lucid' },
|
|
28
|
+
{ key: 'team', label: 'Teams', description: 'Teams: organizations, standups and procurement' },
|
|
29
|
+
{ key: 'standups', label: 'Standups', description: 'Standups in an organization' },
|
|
30
|
+
{ key: 'procurement', label: 'Procurement', description: 'Procurement requests in an organization' },
|
|
31
|
+
{ key: 'notifications', label: 'Notifications', description: 'Notifications' },
|
|
32
|
+
{ key: 'settings', label: 'Settings', description: 'Settings' },
|
|
33
|
+
{ key: 'voice', label: 'Voice', description: 'Settings › Voice: dictation, speech recognition and spoken replies' },
|
|
34
|
+
{ key: 'computer', label: 'Computer', description: 'Settings › Computer: connecting your computer to Lucid' },
|
|
35
|
+
{ key: 'computer_settings', label: 'Computer settings', description: 'Settings for Lucid on your computer' },
|
|
36
|
+
{ key: 'automations', label: 'Automations', description: 'Settings › Automations: what Lucid runs on a schedule' },
|
|
37
|
+
{ key: 'trash', label: 'Trash', description: 'Settings › Trash: restore deleted tasks within 30 days' },
|
|
38
|
+
{ key: 'apple_watch', label: 'Apple Watch', description: 'Settings › Apple Watch' },
|
|
39
|
+
{ key: 'tab_bar', label: 'Tab bar', description: 'Settings › Tab bar: which places sit on the bar' },
|
|
40
|
+
{ key: 'organizations', label: 'Organizations', description: 'Settings › Organizations: create, join and manage them' },
|
|
41
|
+
{ key: 'api_key', label: 'API key', description: 'Settings › API key' },
|
|
42
|
+
{ key: 'profile', label: 'Profile', description: 'Your profile' },
|
|
43
|
+
{ key: 'edit_profile', label: 'Edit profile', description: 'Editing your name, handle and bio' },
|
|
44
|
+
{ key: 'connections', label: 'Connections', description: 'People you are connected with, and adding someone' },
|
|
45
|
+
{ key: 'review', label: 'Review', description: 'What Lucid inferred from the journal and habits, waiting for a yes or no' },
|
|
46
|
+
{ key: 'weekly_review', label: 'Week in view', description: 'A look back at the week' },
|
|
47
|
+
{ key: 'focus', label: 'Focus', description: 'The focus timer' },
|
|
48
|
+
{ key: 'card_studio', label: 'Card Studio', description: 'Choosing the cards on the Dashboard' },
|
|
49
|
+
{ key: 'ask_lucid', label: 'Lucid', description: 'A conversation with Lucid on your computer' },
|
|
50
|
+
] as const;
|
|
51
|
+
export type CommandDestination = (typeof COMMAND_DESTINATIONS)[number]['key'];
|
|
52
|
+
/**
|
|
53
|
+
* The place each one sits under, so "voice settings" and "settings voice" find Voice without an
|
|
54
|
+
* alias for every pair.
|
|
55
|
+
*/
|
|
56
|
+
export const DESTINATION_PARENTS: Partial<Record<CommandDestination, CommandDestination>> = {
|
|
57
|
+
voice: 'settings',
|
|
58
|
+
computer: 'settings',
|
|
59
|
+
automations: 'settings',
|
|
60
|
+
trash: 'settings',
|
|
61
|
+
apple_watch: 'settings',
|
|
62
|
+
tab_bar: 'settings',
|
|
63
|
+
organizations: 'settings',
|
|
64
|
+
api_key: 'settings',
|
|
65
|
+
edit_profile: 'profile',
|
|
66
|
+
connections: 'chat',
|
|
67
|
+
};
|
|
68
|
+
/** Places every organization has its own of. Going to one needs to know which organization. */
|
|
69
|
+
export const ORGANIZATION_DESTINATIONS: readonly CommandDestination[] = ['standups', 'procurement'];
|
|
70
|
+
const DESTINATION_KEYS = COMMAND_DESTINATIONS.map((d) => d.key) as [CommandDestination, ...CommandDestination[]];
|
|
71
|
+
|
|
72
|
+
const ItemKind = z.enum(['task', 'project', 'milestone']);
|
|
73
|
+
export type CommandItemKind = z.infer<typeof ItemKind>;
|
|
74
|
+
|
|
75
|
+
/** What the screen you're looking at shows, top to bottom. What "here" and "the first one" mean. */
|
|
76
|
+
export const CommandScreenSchema = z.object({
|
|
77
|
+
/** A destination key, or a detail screen such as `project` or `milestone`. */
|
|
78
|
+
name: z.string().trim().min(1).max(40),
|
|
79
|
+
title: z.string().trim().max(200).optional(),
|
|
80
|
+
/** The project or milestone this screen is, so a new task said here lands here. */
|
|
81
|
+
projectId: z.uuid().optional(),
|
|
82
|
+
milestoneId: z.uuid().optional(),
|
|
83
|
+
items: z
|
|
84
|
+
.array(z.object({ kind: ItemKind, id: z.uuid(), title: z.string().max(500) }))
|
|
85
|
+
.max(50),
|
|
86
|
+
});
|
|
87
|
+
export type CommandScreen = z.infer<typeof CommandScreenSchema>;
|
|
88
|
+
|
|
89
|
+
export const CommandRequestSchema = z.object({
|
|
90
|
+
text: z.string().trim().min(1).max(500),
|
|
91
|
+
capturedAt: z.iso.datetime({ offset: true }),
|
|
92
|
+
timeZone: z
|
|
93
|
+
.string()
|
|
94
|
+
.min(1)
|
|
95
|
+
.max(100)
|
|
96
|
+
.refine((zone) => {
|
|
97
|
+
try {
|
|
98
|
+
new Intl.DateTimeFormat('en', { timeZone: zone });
|
|
99
|
+
return true;
|
|
100
|
+
} catch {
|
|
101
|
+
return false;
|
|
102
|
+
}
|
|
103
|
+
}, 'Use an IANA timezone'),
|
|
104
|
+
screen: CommandScreenSchema.optional(),
|
|
105
|
+
/** Tasks earlier steps in this conversation acted on, newest first: what "it" and "that" mean. */
|
|
106
|
+
recentTaskIds: z.array(z.uuid()).max(10).optional(),
|
|
107
|
+
/** Already one clause of a split instruction, so the API must not split it again. */
|
|
108
|
+
single: z.boolean().optional(),
|
|
109
|
+
/** Older phones cannot execute a recurring-reminder step. */
|
|
110
|
+
supportsRecurringReminders: z.boolean().optional(),
|
|
111
|
+
});
|
|
112
|
+
export type CommandRequest = z.infer<typeof CommandRequestSchema>;
|
|
113
|
+
|
|
114
|
+
const Ref = z.object({ id: z.uuid(), title: z.string() });
|
|
115
|
+
export type CommandRef = z.infer<typeof Ref>;
|
|
116
|
+
const Due = {
|
|
117
|
+
dueDate: z.string().nullable(),
|
|
118
|
+
dueDatePrecision: z.enum(['date', 'time']).nullable(),
|
|
119
|
+
dueTimeZone: z.string().nullable(),
|
|
120
|
+
/** How the date reads in a reply, "Sat, Sep 26, 2026". Null when clearing a date. */
|
|
121
|
+
dueLabel: z.string().nullable(),
|
|
122
|
+
};
|
|
123
|
+
const Placement = { projectId: z.uuid().nullable(), projectName: z.string().nullable() };
|
|
124
|
+
|
|
125
|
+
/** Everything a step can be. Every step except `clarify`, `lucid` and `unclear` is directly executable. */
|
|
126
|
+
const ExecutableStep = z.discriminatedUnion('kind', [
|
|
127
|
+
z.object({ kind: z.literal('navigate'), destination: z.enum(DESTINATION_KEYS), organizationId: z.uuid().optional() }),
|
|
128
|
+
z.object({ kind: z.literal('open'), item: Ref.extend({ kind: ItemKind }) }),
|
|
129
|
+
/** The previous screen, or out of the task sheet. Only the phone reads this one. */
|
|
130
|
+
z.object({ kind: z.literal('back') }),
|
|
131
|
+
z.object({
|
|
132
|
+
kind: z.literal('create_task'),
|
|
133
|
+
title: z.string().min(1).max(500),
|
|
134
|
+
...Placement,
|
|
135
|
+
...Due,
|
|
136
|
+
/** Set when the task was said on a milestone's screen. */
|
|
137
|
+
milestoneId: z.uuid().nullable().optional(),
|
|
138
|
+
}),
|
|
139
|
+
z.object({ kind: z.literal('create_project'), name: z.string().min(1).max(255) }),
|
|
140
|
+
z.object({ kind: z.literal('complete'), task: Ref }),
|
|
141
|
+
z.object({ kind: z.literal('reopen'), task: Ref }),
|
|
142
|
+
z.object({ kind: z.literal('start'), task: Ref }),
|
|
143
|
+
/** Undoable: the phone holds the delete back while Undo is on screen. */
|
|
144
|
+
z.object({ kind: z.literal('delete'), task: Ref }),
|
|
145
|
+
z.object({ kind: z.literal('reschedule'), task: Ref, ...Due }),
|
|
146
|
+
z.object({ kind: z.literal('move'), task: Ref, ...Placement }),
|
|
147
|
+
/** A comment on an existing task, as the task sheet's Add Comment writes one. */
|
|
148
|
+
z.object({ kind: z.literal('comment'), task: Ref, text: z.string().min(1).max(5000) }),
|
|
149
|
+
/** One or more subtasks under an existing task: "add subtasks pack, book flights and call the hotel". */
|
|
150
|
+
z.object({ kind: z.literal('add_subtasks'), task: Ref, titles: z.array(z.string().min(1).max(500)).min(1).max(10) }),
|
|
151
|
+
z.object({ kind: z.literal('rename'), task: Ref, title: z.string().min(1).max(500) }),
|
|
152
|
+
/** The statuses besides done and in progress, which have steps of their own. */
|
|
153
|
+
z.object({ kind: z.literal('set_status'), task: Ref, status: z.enum(['pending', 'blocked', 'deferred']) }),
|
|
154
|
+
z.object({ kind: z.literal('priority'), task: Ref, priority: z.number().int().min(PRIORITY_MIN).max(PRIORITY_MAX) }),
|
|
155
|
+
/** Null stops it repeating. Repeating needs a due date, as in the task sheet. */
|
|
156
|
+
z.object({ kind: z.literal('repeat'), task: Ref, frequency: z.enum(RECURRING_FREQUENCY_VALUES).nullable() }),
|
|
157
|
+
/** Null removes the reminder. `reminderLabel` is how the time reads in a reply. */
|
|
158
|
+
z.object({ kind: z.literal('remind'), task: Ref, reminderAt: z.string().nullable(), reminderLabel: z.string().nullable() }),
|
|
159
|
+
z.object({ kind: z.literal('remind_recurring'), task: Ref, rule: RecurringReminderSchema }),
|
|
160
|
+
/** Deletes every task in it too, so the phone asks first and offers archiving instead. */
|
|
161
|
+
z.object({ kind: z.literal('delete_project'), project: Ref }),
|
|
162
|
+
z.object({ kind: z.literal('archive_project'), project: Ref }),
|
|
163
|
+
z.object({ kind: z.literal('rename_project'), project: Ref, name: z.string().min(1).max(255) }),
|
|
164
|
+
/** Read out, with nothing changed: the reply is the words. */
|
|
165
|
+
z.object({ kind: z.literal('read'), task: Ref, what: z.enum(['description', 'comments', 'all']) }),
|
|
166
|
+
z.object({ kind: z.literal('set_milestone'), task: Ref, milestoneId: z.uuid().nullable(), milestoneName: z.string().nullable() }),
|
|
167
|
+
/** A new description, added to the end of the one there when `append`; null clears it. */
|
|
168
|
+
z.object({ kind: z.literal('describe'), task: Ref, description: z.string().min(1).max(10_000).nullable(), append: z.boolean() }),
|
|
169
|
+
z.object({ kind: z.literal('list'), title: z.string(), tasks: z.array(Ref.extend({ due: z.string().nullable() })) }),
|
|
170
|
+
]);
|
|
171
|
+
export type CommandExecutableStep = z.infer<typeof ExecutableStep>;
|
|
172
|
+
|
|
173
|
+
export const CommandStepSchema = z.union([
|
|
174
|
+
ExecutableStep,
|
|
175
|
+
/** Jev was unsure which of a few things you meant. Each option is a ready step to run on tap. */
|
|
176
|
+
z.object({
|
|
177
|
+
kind: z.literal('clarify'),
|
|
178
|
+
question: z.string(),
|
|
179
|
+
options: z.array(z.object({ label: z.string(), step: ExecutableStep })).min(1).max(4),
|
|
180
|
+
}),
|
|
181
|
+
/** Needs thinking or conversation rather than an action: offer to hand it to Lucid. */
|
|
182
|
+
z.object({ kind: z.literal('lucid') }),
|
|
183
|
+
z.object({ kind: z.literal('unclear') }),
|
|
184
|
+
]);
|
|
185
|
+
export type CommandStep = z.infer<typeof CommandStepSchema>;
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* What Jev made of one instruction, returned with the step so the phone can record it: each
|
|
189
|
+
* call's answers as "choice@confidence" per question ("edit@0.80"), or the reason a call failed.
|
|
190
|
+
*/
|
|
191
|
+
export const CommandTraceSchema = z.object({
|
|
192
|
+
calls: z.array(z.union([z.record(z.string(), z.string()), z.string()])).max(6),
|
|
193
|
+
attempts: z.number().int().min(0),
|
|
194
|
+
gatherMs: z.number().int().min(0),
|
|
195
|
+
jevMs: z.number().int().min(0),
|
|
196
|
+
});
|
|
197
|
+
export type CommandTrace = z.infer<typeof CommandTraceSchema>;
|
|
198
|
+
|
|
199
|
+
export const CommandResponseSchema = z.object({
|
|
200
|
+
step: CommandStepSchema,
|
|
201
|
+
/** One short sentence describing the step, written by code rather than Jev. */
|
|
202
|
+
reply: z.string(),
|
|
203
|
+
/** The remaining clauses of a split instruction, to send one at a time after this step runs. */
|
|
204
|
+
rest: z.array(z.string()),
|
|
205
|
+
elapsedMs: z.number(),
|
|
206
|
+
trace: CommandTraceSchema.optional(),
|
|
207
|
+
});
|
|
208
|
+
export type CommandResponse = z.infer<typeof CommandResponseSchema>;
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* What happened to an instruction: carried out, a question back ("What should the task say?"), a
|
|
212
|
+
* choice offered, not understood, handed to Chat, failed; later undone, or a choice picked.
|
|
213
|
+
*/
|
|
214
|
+
export const COMMAND_EVENT_OUTCOMES = [
|
|
215
|
+
'done', 'asked', 'clarify', 'unclear', 'lucid', 'failed', 'undone', 'chose', 'handed_to_chat', 'sent', 'answered',
|
|
216
|
+
'cancelled', 'blocked', 'incomplete',
|
|
217
|
+
] as const;
|
|
218
|
+
const Outcome = z.enum(COMMAND_EVENT_OUTCOMES);
|
|
219
|
+
|
|
220
|
+
/** One instruction said to Fast mode or Chat, recorded for the Fast mode review. */
|
|
221
|
+
export const CommandEventSchema = z.object({
|
|
222
|
+
id: z.uuid(),
|
|
223
|
+
mode: z.enum(['fast', 'chat']),
|
|
224
|
+
heard: z.string().trim().min(1).max(500),
|
|
225
|
+
handledBy: z.enum(['phone', 'jev', 'lucid']),
|
|
226
|
+
did: z.string().max(32).optional(),
|
|
227
|
+
reply: z.string().max(500).optional(),
|
|
228
|
+
ms: z.number().int().min(0).max(86_400_000).optional(),
|
|
229
|
+
screen: z.string().max(40).optional(),
|
|
230
|
+
outcome: Outcome,
|
|
231
|
+
detail: z.string().max(2000).optional(),
|
|
232
|
+
/** Shared by every row one sentence led to; see command_events in @lucidity/db. */
|
|
233
|
+
turnId: z.uuid().optional(),
|
|
234
|
+
step: z.number().int().min(0).max(20).optional(),
|
|
235
|
+
replyTo: z.uuid().optional(),
|
|
236
|
+
rule: z.string().max(64).optional(),
|
|
237
|
+
target: z.object({ kind: z.string().max(24), id: z.string().max(64).optional(), title: z.string().max(200).optional() }).optional(),
|
|
238
|
+
context: z.object({
|
|
239
|
+
sheetTaskId: z.uuid().optional(),
|
|
240
|
+
sheetTaskTitle: z.string().max(200).optional(),
|
|
241
|
+
projectId: z.uuid().optional(),
|
|
242
|
+
milestoneId: z.uuid().optional(),
|
|
243
|
+
screenTitle: z.string().max(200).optional(),
|
|
244
|
+
}).optional(),
|
|
245
|
+
jev: CommandTraceSchema.optional(),
|
|
246
|
+
});
|
|
247
|
+
export type CommandEvent = z.infer<typeof CommandEventSchema>;
|
|
248
|
+
export const UpdateCommandEventSchema = z.object({
|
|
249
|
+
outcome: Outcome,
|
|
250
|
+
detail: z.string().max(2000).optional(),
|
|
251
|
+
ms: z.number().int().min(0).max(86_400_000).optional(),
|
|
252
|
+
});
|
|
253
|
+
export type UpdateCommandEvent = z.infer<typeof UpdateCommandEventSchema>;
|
|
@@ -49,12 +49,16 @@ export const ComputerPresenceSchema = z.object({
|
|
|
49
49
|
});
|
|
50
50
|
export type ComputerPresence = z.infer<typeof ComputerPresenceSchema>;
|
|
51
51
|
export type ComputerFeature =
|
|
52
|
+
| 'turn-queue'
|
|
53
|
+
| 'provider-handoff'
|
|
54
|
+
| 'queue-control'
|
|
52
55
|
| 'ask'
|
|
53
56
|
| 'code'
|
|
54
57
|
| 'conduct'
|
|
55
58
|
| 'briefing'
|
|
56
59
|
| 'attention'
|
|
57
60
|
| 'models'
|
|
61
|
+
| 'commands'
|
|
58
62
|
| 'steer'
|
|
59
63
|
| 'permission'
|
|
60
64
|
| 'pull'
|
|
@@ -62,10 +66,15 @@ export type ComputerFeature =
|
|
|
62
66
|
| 'prs'
|
|
63
67
|
| 'clone'
|
|
64
68
|
| 'getConfig'
|
|
69
|
+
| 'getAutomations'
|
|
70
|
+
| 'automation'
|
|
65
71
|
| 'setConfig'
|
|
66
72
|
| 'journal'
|
|
67
73
|
| 'incident'
|
|
68
74
|
| 'voice-diag'
|
|
75
|
+
| 'transcribe'
|
|
76
|
+
| 'voice-capture'
|
|
77
|
+
| 'voice-capture-status'
|
|
69
78
|
| 'cancel';
|
|
70
79
|
export type Availability = {
|
|
71
80
|
state:
|
|
@@ -75,6 +84,7 @@ export type Availability = {
|
|
|
75
84
|
| 'offline'
|
|
76
85
|
| 'update'
|
|
77
86
|
| 'permission'
|
|
87
|
+
| 'other_device'
|
|
78
88
|
| 'provider'
|
|
79
89
|
| 'ready';
|
|
80
90
|
title: string;
|
|
@@ -132,14 +142,21 @@ export function computerAvailability(
|
|
|
132
142
|
}
|
|
133
143
|
if (
|
|
134
144
|
presence.readOnly &&
|
|
135
|
-
![
|
|
136
|
-
|
|
137
|
-
|
|
145
|
+
![
|
|
146
|
+
'pull',
|
|
147
|
+
'getConfig',
|
|
148
|
+
'getAutomations',
|
|
149
|
+
'models',
|
|
150
|
+
'commands',
|
|
151
|
+
'repos',
|
|
152
|
+
'prs',
|
|
153
|
+
'journal',
|
|
154
|
+
].includes(feature)
|
|
138
155
|
)
|
|
139
156
|
return blocked(
|
|
140
|
-
'
|
|
141
|
-
'
|
|
142
|
-
'
|
|
157
|
+
'other_device',
|
|
158
|
+
'Another device is in control',
|
|
159
|
+
'Only one device can send messages or approve actions at a time. Choose “Use on this device” to switch control here.',
|
|
143
160
|
);
|
|
144
161
|
const runtime = presence.runtime;
|
|
145
162
|
if (
|
|
@@ -379,6 +379,9 @@ export function normalizeBio(input: string): string | null {
|
|
|
379
379
|
// re-fetches an interrupted turn's frames from the daemon's durable turn log
|
|
380
380
|
// (`sinceSeq` onward) so a dropped reply is recovered, never re-run.
|
|
381
381
|
export const HARNESS_REQUEST_KINDS = [
|
|
382
|
+
'getAutomations',
|
|
383
|
+
'automation',
|
|
384
|
+
'queue-control',
|
|
382
385
|
'ask',
|
|
383
386
|
'briefing',
|
|
384
387
|
'journal',
|
|
@@ -401,9 +404,13 @@ export const HARNESS_REQUEST_KINDS = [
|
|
|
401
404
|
// Phone ships a per-utterance capture of the Kokoro TTS pipeline so a Claude session can
|
|
402
405
|
// localize where it drops words / collapses pauses (voice diagnostics).
|
|
403
406
|
'voice-diag',
|
|
407
|
+
'transcribe',
|
|
408
|
+
'voice-capture',
|
|
409
|
+
'voice-capture-status',
|
|
404
410
|
'steer',
|
|
405
411
|
'permission',
|
|
406
412
|
'models',
|
|
413
|
+
'commands',
|
|
407
414
|
] as const;
|
|
408
415
|
|
|
409
416
|
// Union of provider effort levels. Model pickers filter this list by provider capabilities.
|
|
@@ -418,7 +425,7 @@ export const EFFORT_LEVELS = [
|
|
|
418
425
|
] as const;
|
|
419
426
|
|
|
420
427
|
// Reasoning-effort levels with display labels/blurbs for the phone's picker (values are
|
|
421
|
-
// `EFFORT_LEVELS`). `auto` leaves the choice to the provider
|
|
428
|
+
// `EFFORT_LEVELS`). `auto` leaves the choice to the provider; keep XHigh recognizable in the UI.
|
|
422
429
|
export const EFFORT_OPTIONS = [
|
|
423
430
|
{
|
|
424
431
|
value: 'auto',
|
|
@@ -428,7 +435,7 @@ export const EFFORT_OPTIONS = [
|
|
|
428
435
|
{ value: 'low', label: 'Low', blurb: 'Fastest, least thorough' },
|
|
429
436
|
{ value: 'medium', label: 'Medium', blurb: 'Quick, some reasoning' },
|
|
430
437
|
{ value: 'high', label: 'High', blurb: 'Thorough reasoning' },
|
|
431
|
-
{ value: 'xhigh', label: '
|
|
438
|
+
{ value: 'xhigh', label: 'XHigh', blurb: 'Extra-high reasoning' },
|
|
432
439
|
{ value: 'max', label: 'Max', blurb: 'Very thorough reasoning' },
|
|
433
440
|
{
|
|
434
441
|
value: 'ultra',
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export const GITHUB_REFRESH_MS = 12 * 60 * 60 * 1000;
|
|
4
|
+
export const GITHUB_RETRY_MS = 15 * 60 * 1000;
|
|
5
|
+
|
|
6
|
+
export const GITHUB_CONNECT_REDIRECT = 'lucidity://github-connect';
|
|
7
|
+
export const GitHubConnectionSchema = z.object({
|
|
8
|
+
id: z.string().min(1),
|
|
9
|
+
login: z.string().nullable(),
|
|
10
|
+
source: z.enum(['github', 'clerk']),
|
|
11
|
+
});
|
|
12
|
+
export const GitHubConnectionStatusSchema = z.object({
|
|
13
|
+
available: z.boolean(),
|
|
14
|
+
connection: GitHubConnectionSchema.nullable(),
|
|
15
|
+
});
|
|
16
|
+
export const GitHubConnectStartSchema = z.object({
|
|
17
|
+
authorizationUrl: z.url(),
|
|
18
|
+
redirectUrl: z.literal(GITHUB_CONNECT_REDIRECT),
|
|
19
|
+
});
|
|
20
|
+
export const GitHubConnectCompleteSchema = z.object({
|
|
21
|
+
code: z.string().min(1).max(512),
|
|
22
|
+
state: z.string().regex(/^[A-Za-z0-9_-]{43}$/),
|
|
23
|
+
});
|
|
24
|
+
export type GitHubConnection = z.infer<typeof GitHubConnectionSchema>;
|
|
25
|
+
|
|
26
|
+
export const GitHubContributionDaySchema = z.object({
|
|
27
|
+
date: z.iso.date(),
|
|
28
|
+
contributionCount: z.number().int().nonnegative(),
|
|
29
|
+
contributionLevel: z.enum([
|
|
30
|
+
'NONE',
|
|
31
|
+
'FIRST_QUARTILE',
|
|
32
|
+
'SECOND_QUARTILE',
|
|
33
|
+
'THIRD_QUARTILE',
|
|
34
|
+
'FOURTH_QUARTILE',
|
|
35
|
+
]),
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
export const GitHubContributionSnapshotSchema = z.object({
|
|
39
|
+
login: z.string().regex(/^[a-z\d](?:[a-z\d-]{0,37}[a-z\d])?$/i),
|
|
40
|
+
fetchedAt: z.number().int().positive(),
|
|
41
|
+
totalContributions: z.number().int().nonnegative(),
|
|
42
|
+
weeks: z
|
|
43
|
+
.array(
|
|
44
|
+
z.object({
|
|
45
|
+
contributionDays: z.array(GitHubContributionDaySchema).min(1).max(7),
|
|
46
|
+
}),
|
|
47
|
+
)
|
|
48
|
+
.min(1)
|
|
49
|
+
.max(54),
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
export const GitHubContributionsResponseSchema = z.object({
|
|
53
|
+
status: z.enum([
|
|
54
|
+
'ready',
|
|
55
|
+
'refreshing',
|
|
56
|
+
'unavailable',
|
|
57
|
+
'reconnect',
|
|
58
|
+
'disconnected',
|
|
59
|
+
]),
|
|
60
|
+
snapshot: GitHubContributionSnapshotSchema.nullable(),
|
|
61
|
+
retryAt: z.number().int().nonnegative(),
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
export type GitHubContributionDay = z.infer<typeof GitHubContributionDaySchema>;
|
|
65
|
+
export type GitHubContributionSnapshot = z.infer<
|
|
66
|
+
typeof GitHubContributionSnapshotSchema
|
|
67
|
+
>;
|
|
68
|
+
export type GitHubContributionsResponse = z.infer<
|
|
69
|
+
typeof GitHubContributionsResponseSchema
|
|
70
|
+
>;
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import {
|
|
2
|
+
shiftStudioDate,
|
|
3
|
+
studioLocalDate,
|
|
4
|
+
type HabitColor,
|
|
5
|
+
type HabitIcon,
|
|
6
|
+
type HabitHistory,
|
|
7
|
+
type StudioHabit,
|
|
8
|
+
} from './cardStudio.js';
|
|
9
|
+
|
|
10
|
+
export const HABIT_ICONS: Record<HabitIcon, string> = {
|
|
11
|
+
check: 'Checkmark',
|
|
12
|
+
book: 'Book',
|
|
13
|
+
guitar: 'Guitar',
|
|
14
|
+
dumbbell: 'Weights',
|
|
15
|
+
walk: 'Walking',
|
|
16
|
+
water: 'Water',
|
|
17
|
+
leaf: 'Leaf',
|
|
18
|
+
heart: 'Heart',
|
|
19
|
+
moon: 'Moon',
|
|
20
|
+
pencil: 'Pencil',
|
|
21
|
+
code: 'Code',
|
|
22
|
+
music: 'Music',
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/** Colours are tokens, not arbitrary styles. Each has a readable light/dark treatment. */
|
|
26
|
+
export const HABIT_COLORS: Record<
|
|
27
|
+
HabitColor,
|
|
28
|
+
{
|
|
29
|
+
label: string;
|
|
30
|
+
light: string;
|
|
31
|
+
dark: string;
|
|
32
|
+
lightSurface: string;
|
|
33
|
+
darkSurface: string;
|
|
34
|
+
}
|
|
35
|
+
> = {
|
|
36
|
+
green: {
|
|
37
|
+
label: 'Green',
|
|
38
|
+
light: '#3E7C56',
|
|
39
|
+
dark: '#8DD5A5',
|
|
40
|
+
lightSurface: '#E8F0E7',
|
|
41
|
+
darkSurface: '#25392C',
|
|
42
|
+
},
|
|
43
|
+
amber: {
|
|
44
|
+
label: 'Amber',
|
|
45
|
+
light: '#996019',
|
|
46
|
+
dark: '#E8BC75',
|
|
47
|
+
lightSurface: '#F0E6D2',
|
|
48
|
+
darkSurface: '#3C3020',
|
|
49
|
+
},
|
|
50
|
+
berry: {
|
|
51
|
+
label: 'Berry',
|
|
52
|
+
light: '#A34470',
|
|
53
|
+
dark: '#E7A4C4',
|
|
54
|
+
lightSurface: '#F5E7ED',
|
|
55
|
+
darkSurface: '#3D2935',
|
|
56
|
+
},
|
|
57
|
+
blue: {
|
|
58
|
+
label: 'Blue',
|
|
59
|
+
light: '#356F9C',
|
|
60
|
+
dark: '#8AC6EE',
|
|
61
|
+
lightSurface: '#E5EFF6',
|
|
62
|
+
darkSurface: '#233744',
|
|
63
|
+
},
|
|
64
|
+
coral: {
|
|
65
|
+
label: 'Coral',
|
|
66
|
+
light: '#B04D37',
|
|
67
|
+
dark: '#F2AD96',
|
|
68
|
+
lightSurface: '#F6E7DF',
|
|
69
|
+
darkSurface: '#402D27',
|
|
70
|
+
},
|
|
71
|
+
teal: {
|
|
72
|
+
label: 'Teal',
|
|
73
|
+
light: '#277C79',
|
|
74
|
+
dark: '#84D5CD',
|
|
75
|
+
lightSurface: '#E2F0EC',
|
|
76
|
+
darkSurface: '#233C38',
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
/** 91 recent days cover all thirteen calendar weeks and the existing 90-day editor. */
|
|
81
|
+
export function buildHabitHistory(dates: readonly string[], today: string): HabitHistory {
|
|
82
|
+
const windowStart = shiftStudioDate(today, -90);
|
|
83
|
+
const days = [...new Set(dates)].filter((day) => day <= today).sort();
|
|
84
|
+
const before = days.filter((day) => day < windowStart);
|
|
85
|
+
let longestBefore = 0;
|
|
86
|
+
let streak = 0;
|
|
87
|
+
let previous: string | undefined;
|
|
88
|
+
for (const day of before) {
|
|
89
|
+
streak = previous && shiftStudioDate(previous, 1) === day ? streak + 1 : 1;
|
|
90
|
+
longestBefore = Math.max(longestBefore, streak);
|
|
91
|
+
previous = day;
|
|
92
|
+
}
|
|
93
|
+
return {
|
|
94
|
+
windowStart,
|
|
95
|
+
firstDayBefore: before[0] ?? null,
|
|
96
|
+
totalBefore: before.length,
|
|
97
|
+
longestBefore,
|
|
98
|
+
streakBefore: previous === shiftStudioDate(windowStart, -1) ? streak : 0,
|
|
99
|
+
days: days.filter((day) => day >= windowStart),
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export function habitContributionSummary(habit: StudioHabit, today: string, timeZone: string) {
|
|
104
|
+
if (!habit.history) return null;
|
|
105
|
+
const history = habit.history;
|
|
106
|
+
const days = [...new Set(history.days)].filter((day) => day <= today).sort();
|
|
107
|
+
const created = studioLocalDate(new Date(habit.createdAt), timeZone);
|
|
108
|
+
// Daily rhythm permits backdating. Honour those real check-ins rather than hide them.
|
|
109
|
+
const start = [created, history.firstDayBefore ?? today, days[0] ?? today, today].sort()[0]!;
|
|
110
|
+
let streak = history.streakBefore;
|
|
111
|
+
let longest = history.longestBefore;
|
|
112
|
+
let previous = shiftStudioDate(history.windowStart, -1);
|
|
113
|
+
for (const day of days) {
|
|
114
|
+
streak = shiftStudioDate(previous, 1) === day ? streak + 1 : 1;
|
|
115
|
+
longest = Math.max(longest, streak);
|
|
116
|
+
previous = day;
|
|
117
|
+
}
|
|
118
|
+
const eligibleDays =
|
|
119
|
+
Math.round((Date.parse(today + 'T12:00:00Z') - Date.parse(start + 'T12:00:00Z')) / 86_400_000) +
|
|
120
|
+
1;
|
|
121
|
+
const total = history.totalBefore + days.length;
|
|
122
|
+
return {
|
|
123
|
+
start,
|
|
124
|
+
eligibleDays,
|
|
125
|
+
total,
|
|
126
|
+
longest,
|
|
127
|
+
completion: Math.round((100 * total) / eligibleDays),
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export type HabitCellState = 'logged' | 'unlogged' | 'unavailable';
|
|
132
|
+
export function habitContributionWeeks(days: readonly string[], today: string, start: string) {
|
|
133
|
+
const weekday = (new Date(today + 'T12:00:00Z').getUTCDay() + 6) % 7;
|
|
134
|
+
const first = shiftStudioDate(today, -weekday - 84);
|
|
135
|
+
const logged = new Set(days);
|
|
136
|
+
return Array.from({ length: 13 }, (_, week) =>
|
|
137
|
+
Array.from({ length: 7 }, (_, row) => {
|
|
138
|
+
const day = shiftStudioDate(first, week * 7 + row);
|
|
139
|
+
const state: HabitCellState =
|
|
140
|
+
day < start || day > today ? 'unavailable' : logged.has(day) ? 'logged' : 'unlogged';
|
|
141
|
+
return { day, state, today: day === today };
|
|
142
|
+
})
|
|
143
|
+
);
|
|
144
|
+
}
|
|
@@ -1,5 +1,29 @@
|
|
|
1
|
+
export * from './githubContributions.js';
|
|
2
|
+
export * from './projectCapture.js';
|
|
3
|
+
export * from './taskActivity.js';
|
|
4
|
+
export * from './recurrence.js';
|
|
5
|
+
export * from './vault-search.js';
|
|
6
|
+
export * from './journal-vault.js';
|
|
7
|
+
export * from './journal-migration.js';
|
|
8
|
+
|
|
1
9
|
// Constants
|
|
2
|
-
export {
|
|
10
|
+
export {
|
|
11
|
+
CARD_SYMBOL_NAMES,
|
|
12
|
+
CardStatementSegmentSchema,
|
|
13
|
+
validatedCardSegments,
|
|
14
|
+
} from './cardStatement.js';
|
|
15
|
+
export type {
|
|
16
|
+
CardSymbol,
|
|
17
|
+
CardStatementSegment,
|
|
18
|
+
StyledCardStatement,
|
|
19
|
+
} from './cardStatement.js';
|
|
20
|
+
export {
|
|
21
|
+
setupPage,
|
|
22
|
+
setupStyles,
|
|
23
|
+
setupMark,
|
|
24
|
+
setupIllustration,
|
|
25
|
+
escapeSetupHtml,
|
|
26
|
+
} from './setupAppearance.js';
|
|
3
27
|
export {
|
|
4
28
|
TASK_STATUS,
|
|
5
29
|
TASK_STATUS_VALUES,
|
|
@@ -262,7 +286,9 @@ export {
|
|
|
262
286
|
VoiceDiagChunkSchema,
|
|
263
287
|
VoiceDiagReportRequestSchema,
|
|
264
288
|
VoiceDiagAckResponseSchema,
|
|
289
|
+
ProviderHandoffSchema,
|
|
265
290
|
} from './schemas/harness.js';
|
|
291
|
+
export type { ProviderHandoff } from './schemas/harness.js';
|
|
266
292
|
|
|
267
293
|
// Types
|
|
268
294
|
export type {
|
|
@@ -403,3 +429,18 @@ export { AgentModelOptionSchema } from './schemas/harness.js';
|
|
|
403
429
|
export type { AgentModelOption } from './schemas/harness.js';
|
|
404
430
|
|
|
405
431
|
export * from './computer.js';
|
|
432
|
+
export * from './cardStudio.js';
|
|
433
|
+
export * from './habitContributions.js';
|
|
434
|
+
export * from './speech.js';
|
|
435
|
+
export * from './smartCapture.js';
|
|
436
|
+
export * from './commands.js';
|
|
437
|
+
export * from './commandText.js';
|
|
438
|
+
export * from './commandLocal.js';
|
|
439
|
+
export * from './reminderWords.js';
|
|
440
|
+
export * from './spokenNames.js';
|
|
441
|
+
export * from './voiceCapture.js';
|
|
442
|
+
export * from './automations.js';
|
|
443
|
+
export * from './automationTemplates.js';
|
|
444
|
+
|
|
445
|
+
export { parseAgentCommand, findAgentCommand } from './agentCommands.js';
|
|
446
|
+
export type { AgentCommandOption, AgentCommandContext } from './agentCommands.js';
|