@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
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Puts the names the app knows back into what speech recognition heard.
|
|
3
|
+
*
|
|
4
|
+
* Names are what recognition gets wrong, and Parakeet can't be told a vocabulary: "Neucleosoft"
|
|
5
|
+
* arrives as "nucleus of". So a run of heard words is compared with each project, milestone and
|
|
6
|
+
* organization name by how it sounds, and replaced when the two are one sound apart.
|
|
7
|
+
*
|
|
8
|
+
* Deliberately cautious, since a wrong swap changes what an instruction does, and tuned against
|
|
9
|
+
* the instructions actually said to Fast mode. A name said right is never touched. Only names with
|
|
10
|
+
* at least five consonant sounds are considered, and those with five must sound exactly alike;
|
|
11
|
+
* longer ones may be one sound apart ("nucleus of" for "Neucleosoft"). The first sound must match
|
|
12
|
+
* ("voice setting" is not "Vacation in goa"), a run never starts with a command word ("open cone"
|
|
13
|
+
* is not "Pinecone"), and a run that could be two names is left alone.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/** Consonant sounds in order, similar ones merged, vowels dropped: "nucleus of" is "nklsf". */
|
|
17
|
+
export function soundKey(words: string): string {
|
|
18
|
+
return words
|
|
19
|
+
.normalize('NFKD')
|
|
20
|
+
.toLowerCase()
|
|
21
|
+
.replace(/[^a-z]/g, '')
|
|
22
|
+
.replace(/ph/g, 'f')
|
|
23
|
+
.replace(/ck/g, 'k')
|
|
24
|
+
.replace(/sch/g, 'sk')
|
|
25
|
+
.replace(/[cs]h/g, 'x')
|
|
26
|
+
.replace(/c(?=[eiy])/g, 's')
|
|
27
|
+
.replace(/[cq]/g, 'k')
|
|
28
|
+
.replace(/x/g, 'ks')
|
|
29
|
+
.replace(/z/g, 's')
|
|
30
|
+
.replace(/v/g, 'f')
|
|
31
|
+
.replace(/dg/g, 'j')
|
|
32
|
+
.replace(/g(?=[eiy])/g, 'j')
|
|
33
|
+
.replace(/^kn/, 'n')
|
|
34
|
+
.replace(/^wr/, 'r')
|
|
35
|
+
.replace(/[aeiouyhw]/g, '')
|
|
36
|
+
.replace(/(.)\1+/g, '$1');
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function distance(a: string, b: string): number {
|
|
40
|
+
const row = Array.from({ length: b.length + 1 }, (_, i) => i);
|
|
41
|
+
for (let i = 1; i <= a.length; i++) {
|
|
42
|
+
let diagonal = row[0]!;
|
|
43
|
+
row[0] = i;
|
|
44
|
+
for (let j = 1; j <= b.length; j++) {
|
|
45
|
+
const above = row[j]!;
|
|
46
|
+
row[j] = Math.min(row[j]! + 1, row[j - 1]! + 1, diagonal + (a[i - 1] === b[j - 1] ? 0 : 1));
|
|
47
|
+
diagonal = above;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return row[b.length]!;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** Words a name never starts with in speech: verbs and small words of the instruction around it. */
|
|
54
|
+
const NOT_A_START = new Set([
|
|
55
|
+
'open', 'show', 'go', 'take', 'add', 'move', 'put', 'create', 'make', 'mark', 'set', 'the', 'a',
|
|
56
|
+
'an', 'my', 'to', 'in', 'into', 'for', 'of', 'on', 'at', 'and', 'it', 'this', 'that', 'project',
|
|
57
|
+
'projects', 'task', 'tasks', 'milestone', 'milestones', 'me', 'please',
|
|
58
|
+
]);
|
|
59
|
+
|
|
60
|
+
const MIN_SOUNDS = 5;
|
|
61
|
+
/** Names this long or longer may be one sound off. */
|
|
62
|
+
const FUZZY_SOUNDS = 6;
|
|
63
|
+
|
|
64
|
+
/** The name as it should read in text: no emoji or symbols, "neucleosoft/K5" as two words. */
|
|
65
|
+
const plain = (name: string) =>
|
|
66
|
+
name.replace(/[/:_]/g, ' ').replace(/[^\p{L}\p{N}\s'&.-]/gu, '').replace(/\s+/g, ' ').trim();
|
|
67
|
+
|
|
68
|
+
export interface RepairedName {
|
|
69
|
+
heard: string;
|
|
70
|
+
name: string;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export function repairNames(text: string, names: readonly string[]): { text: string; repaired: RepairedName[] } {
|
|
74
|
+
const known = [...new Set(names.map(plain).filter(Boolean))]
|
|
75
|
+
.map((name) => ({ name, key: soundKey(name), words: name.split(' ').length }))
|
|
76
|
+
.filter((n) => n.key.length >= MIN_SOUNDS);
|
|
77
|
+
const exact = new Set(known.map((n) => n.name.toLowerCase()));
|
|
78
|
+
const words = text.split(/\s+/).filter(Boolean);
|
|
79
|
+
if (!known.length || !words.length) return { text, repaired: [] };
|
|
80
|
+
|
|
81
|
+
const bare = (word: string) => word.toLowerCase().replace(/[^\p{L}\p{N}']/gu, '');
|
|
82
|
+
const out: string[] = [];
|
|
83
|
+
const repaired: RepairedName[] = [];
|
|
84
|
+
const longest = Math.max(...known.map((n) => n.words));
|
|
85
|
+
for (let i = 0; i < words.length; ) {
|
|
86
|
+
// A name said right: keep it as said, and don't let part of it start another match.
|
|
87
|
+
const said = Array.from({ length: Math.min(longest, words.length - i) }, (_, k) => i + k + 1)
|
|
88
|
+
.reverse()
|
|
89
|
+
.find((end) => exact.has(words.slice(i, end).map(bare).join(' ')));
|
|
90
|
+
if (said) {
|
|
91
|
+
out.push(...words.slice(i, said));
|
|
92
|
+
i = said;
|
|
93
|
+
continue;
|
|
94
|
+
}
|
|
95
|
+
let best: { name: string; end: number; score: number; off: number } | null = null;
|
|
96
|
+
let tied = false;
|
|
97
|
+
if (!NOT_A_START.has(bare(words[i]!))) {
|
|
98
|
+
for (const n of known) {
|
|
99
|
+
for (let end = i + 1; end <= Math.min(words.length, i + n.words + 2); end++) {
|
|
100
|
+
const key = soundKey(words.slice(i, end).map(bare).join(' '));
|
|
101
|
+
if (!key || key[0] !== n.key[0]) continue;
|
|
102
|
+
const score = distance(key, n.key);
|
|
103
|
+
if (score > (n.key.length >= FUZZY_SOUNDS ? 1 : 0)) continue;
|
|
104
|
+
// Closest in sound, then closest in length to the name, then the longer run: "nucleus of
|
|
105
|
+
// procurement" is "neucleosoft/Procurement" before it is "Neucleosoft".
|
|
106
|
+
const off = Math.abs(end - i - n.words);
|
|
107
|
+
const better =
|
|
108
|
+
!best || score < best.score || (score === best.score && (off < best.off || (off === best.off && end > best.end)));
|
|
109
|
+
if (better) {
|
|
110
|
+
best = { name: n.name, end, score, off };
|
|
111
|
+
tied = false;
|
|
112
|
+
} else if (score === best!.score && off === best!.off && end === best!.end && best!.name !== n.name) tied = true;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
if (best && !tied) {
|
|
117
|
+
// Keep the punctuation that ended the run: "nucleus of." reads "Neucleosoft.".
|
|
118
|
+
const trailing = /[^\p{L}\p{N}]+$/u.exec(words[best.end - 1]!)?.[0] ?? '';
|
|
119
|
+
repaired.push({ heard: words.slice(i, best.end).join(' '), name: best.name });
|
|
120
|
+
out.push(best.name + trailing);
|
|
121
|
+
i = best.end;
|
|
122
|
+
} else {
|
|
123
|
+
out.push(words[i]!);
|
|
124
|
+
i++;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
return repaired.length ? { text: out.join(' '), repaired } : { text, repaired };
|
|
128
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export const TASK_ACTIVITY_FIELDS = [
|
|
4
|
+
'title', 'description', 'status', 'dueDate', 'reminderAt', 'recurringFrequency',
|
|
5
|
+
'projectId', 'milestoneId', 'parentTaskId', 'assigneeId', 'priority',
|
|
6
|
+
'recurringReminder', 'recurrenceTimeZone',
|
|
7
|
+
] as const;
|
|
8
|
+
|
|
9
|
+
export const TaskActivityChangeSchema = z.object({
|
|
10
|
+
field: z.enum(TASK_ACTIVITY_FIELDS),
|
|
11
|
+
from: z.union([z.string(), z.number(), z.null()]),
|
|
12
|
+
to: z.union([z.string(), z.number(), z.null()]),
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export const TaskEventSchema = z.object({
|
|
16
|
+
id: z.uuid(),
|
|
17
|
+
taskId: z.uuid(),
|
|
18
|
+
occurrenceId: z.uuid().nullable().optional(),
|
|
19
|
+
occurrenceDate: z.iso.date().nullable().optional(),
|
|
20
|
+
actorId: z.uuid().nullable(),
|
|
21
|
+
actorKind: z.enum(['human', 'agent', 'system', 'unknown']),
|
|
22
|
+
actorName: z.string().nullable(),
|
|
23
|
+
actorHandle: z.string().nullable(),
|
|
24
|
+
agentProvider: z.enum(['claude', 'codex']).nullable(),
|
|
25
|
+
agentModel: z.string().nullable(),
|
|
26
|
+
agentClient: z.string().nullable(),
|
|
27
|
+
type: z.enum(['created', 'updated', 'deleted', 'restored', 'occurrence']),
|
|
28
|
+
changes: z.array(TaskActivityChangeSchema),
|
|
29
|
+
createdAt: z.coerce.date(),
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
export type TaskEvent = z.infer<typeof TaskEventSchema>;
|
|
33
|
+
export type TaskActivityChange = z.infer<typeof TaskActivityChangeSchema>;
|
|
34
|
+
export type TaskActivityPage = { events: TaskEvent[]; nextCursor: string | null };
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
/** Local-only search. Adapters supply SQLite; no network or filesystem dependency. */
|
|
2
|
+
export interface SearchDatabase {
|
|
3
|
+
exec(sql: string): Promise<unknown>;
|
|
4
|
+
run(sql: string, params: (string | number | null)[]): Promise<unknown>;
|
|
5
|
+
all<T>(sql: string, params: (string | number | null)[]): Promise<T[]>;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface IndexedDocument {
|
|
9
|
+
id: string;
|
|
10
|
+
kind: 'note' | 'journal';
|
|
11
|
+
path: string;
|
|
12
|
+
title: string;
|
|
13
|
+
body: string;
|
|
14
|
+
revision: string;
|
|
15
|
+
fingerprint: string;
|
|
16
|
+
modifiedAt: number;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface ContentMatch {
|
|
20
|
+
query: string;
|
|
21
|
+
excerpt: string;
|
|
22
|
+
anchor: string;
|
|
23
|
+
start: number;
|
|
24
|
+
end: number;
|
|
25
|
+
line: number;
|
|
26
|
+
revision: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface IndexedSearchHit extends IndexedDocument {
|
|
30
|
+
match: ContentMatch;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** Return original UTF-16 offsets even when lowercasing changes string length. */
|
|
34
|
+
export function findLiteralRange(
|
|
35
|
+
text: string,
|
|
36
|
+
query: string,
|
|
37
|
+
): { start: number; end: number } | null {
|
|
38
|
+
if (!query) return null;
|
|
39
|
+
const folded = text.toLowerCase();
|
|
40
|
+
const start = folded.indexOf(query.toLowerCase());
|
|
41
|
+
if (start < 0) return null;
|
|
42
|
+
const end = start + query.toLowerCase().length;
|
|
43
|
+
let sourceOffset = 0;
|
|
44
|
+
let foldedOffset = 0;
|
|
45
|
+
let sourceStart = -1;
|
|
46
|
+
for (const character of text) {
|
|
47
|
+
const length = character.toLowerCase().length;
|
|
48
|
+
if (sourceStart < 0 && foldedOffset + length > start)
|
|
49
|
+
sourceStart = sourceOffset;
|
|
50
|
+
sourceOffset += character.length;
|
|
51
|
+
foldedOffset += length;
|
|
52
|
+
if (foldedOffset >= end) return { start: sourceStart, end: sourceOffset };
|
|
53
|
+
}
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export function contentMatch(
|
|
58
|
+
document: IndexedDocument,
|
|
59
|
+
query: string,
|
|
60
|
+
): ContentMatch {
|
|
61
|
+
const range = findLiteralRange(document.body, query);
|
|
62
|
+
const text = range ? document.body : document.title + '\n' + document.path;
|
|
63
|
+
const found = range ?? findLiteralRange(text, query) ?? { start: 0, end: 0 };
|
|
64
|
+
const from = Math.max(0, found.start - 55);
|
|
65
|
+
const to = Math.min(text.length, Math.max(found.end + 90, from + 140));
|
|
66
|
+
return {
|
|
67
|
+
query,
|
|
68
|
+
excerpt:
|
|
69
|
+
(from ? '…' : '') +
|
|
70
|
+
text.slice(from, to).replace(/\s+/g, ' ') +
|
|
71
|
+
(to < text.length ? '…' : ''),
|
|
72
|
+
anchor: range ? document.body.slice(range.start, range.end) : '',
|
|
73
|
+
start: range?.start ?? -1,
|
|
74
|
+
end: range?.end ?? -1,
|
|
75
|
+
line: range ? document.body.slice(0, range.start).split('\n').length : 0,
|
|
76
|
+
revision: document.revision,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/** Exact literal matching, including punctuation. Trigrams accelerate longer queries. */
|
|
81
|
+
export class LocalSearchIndex {
|
|
82
|
+
private tail: Promise<unknown> = Promise.resolve();
|
|
83
|
+
private ready: Promise<void> | undefined;
|
|
84
|
+
private trigrams = false;
|
|
85
|
+
constructor(private readonly db: SearchDatabase) {}
|
|
86
|
+
|
|
87
|
+
private serial<T>(work: () => Promise<T>): Promise<T> {
|
|
88
|
+
const next = this.tail.then(work);
|
|
89
|
+
this.tail = next.catch(() => undefined);
|
|
90
|
+
return next;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
private initialize(): Promise<void> {
|
|
94
|
+
return (this.ready ??= (async () => {
|
|
95
|
+
await this.db.exec(`
|
|
96
|
+
PRAGMA journal_mode=WAL;
|
|
97
|
+
PRAGMA secure_delete=ON;
|
|
98
|
+
CREATE TABLE IF NOT EXISTS vault_search_v1 (
|
|
99
|
+
scope TEXT NOT NULL, kind TEXT NOT NULL, id TEXT NOT NULL,
|
|
100
|
+
path TEXT NOT NULL, title TEXT NOT NULL, body TEXT NOT NULL,
|
|
101
|
+
revision TEXT NOT NULL, fingerprint TEXT NOT NULL,
|
|
102
|
+
modifiedAt REAL NOT NULL, search TEXT NOT NULL,
|
|
103
|
+
UNIQUE(scope,kind,id)
|
|
104
|
+
);
|
|
105
|
+
CREATE INDEX IF NOT EXISTS vault_search_scope ON vault_search_v1(scope,kind);
|
|
106
|
+
`);
|
|
107
|
+
try {
|
|
108
|
+
await this.db
|
|
109
|
+
.exec(`CREATE VIRTUAL TABLE IF NOT EXISTS vault_search_fts_v1
|
|
110
|
+
USING fts5(search, content='vault_search_v1', content_rowid='rowid',
|
|
111
|
+
tokenize='trigram case_sensitive 1');`);
|
|
112
|
+
const triggers = await this.db.all<{ name: string }>(
|
|
113
|
+
"SELECT name FROM sqlite_master WHERE type='trigger' AND name='vault_search_insert_v1'",
|
|
114
|
+
[],
|
|
115
|
+
);
|
|
116
|
+
await this.db.exec(`
|
|
117
|
+
CREATE TRIGGER IF NOT EXISTS vault_search_insert_v1 AFTER INSERT ON vault_search_v1 BEGIN
|
|
118
|
+
INSERT INTO vault_search_fts_v1(rowid,search) VALUES(new.rowid,new.search);
|
|
119
|
+
END;
|
|
120
|
+
CREATE TRIGGER IF NOT EXISTS vault_search_delete_v1 AFTER DELETE ON vault_search_v1 BEGIN
|
|
121
|
+
INSERT INTO vault_search_fts_v1(vault_search_fts_v1,rowid,search) VALUES('delete',old.rowid,old.search);
|
|
122
|
+
END;
|
|
123
|
+
CREATE TRIGGER IF NOT EXISTS vault_search_update_v1 AFTER UPDATE ON vault_search_v1 BEGIN
|
|
124
|
+
INSERT INTO vault_search_fts_v1(vault_search_fts_v1,rowid,search) VALUES('delete',old.rowid,old.search);
|
|
125
|
+
INSERT INTO vault_search_fts_v1(rowid,search) VALUES(new.rowid,new.search);
|
|
126
|
+
END;
|
|
127
|
+
`);
|
|
128
|
+
if (!triggers.length)
|
|
129
|
+
await this.db.exec(
|
|
130
|
+
"INSERT INTO vault_search_fts_v1(vault_search_fts_v1) VALUES('rebuild');",
|
|
131
|
+
);
|
|
132
|
+
this.trigrams = true;
|
|
133
|
+
} catch (error) {
|
|
134
|
+
// Older SQLite builds still provide complete literal search. Never hide
|
|
135
|
+
// unrelated disk/corruption failures behind a silent in-memory fallback.
|
|
136
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
137
|
+
if (!/no such (module: fts5|tokenizer: trigram)/i.test(message))
|
|
138
|
+
throw error;
|
|
139
|
+
}
|
|
140
|
+
})().catch((error) => {
|
|
141
|
+
this.ready = undefined;
|
|
142
|
+
throw error;
|
|
143
|
+
}));
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
put(scope: string, document: IndexedDocument): Promise<void> {
|
|
147
|
+
return this.serial(async () => {
|
|
148
|
+
await this.initialize();
|
|
149
|
+
const d = document;
|
|
150
|
+
await this.db.run(
|
|
151
|
+
`INSERT INTO vault_search_v1
|
|
152
|
+
(scope,kind,id,path,title,body,revision,fingerprint,modifiedAt,search)
|
|
153
|
+
VALUES (?,?,?,?,?,?,?,?,?,?) ON CONFLICT(scope,kind,id) DO UPDATE SET
|
|
154
|
+
path=excluded.path,title=excluded.title,body=excluded.body,
|
|
155
|
+
revision=excluded.revision,fingerprint=excluded.fingerprint,
|
|
156
|
+
modifiedAt=excluded.modifiedAt,search=excluded.search`,
|
|
157
|
+
[
|
|
158
|
+
scope,
|
|
159
|
+
d.kind,
|
|
160
|
+
d.id,
|
|
161
|
+
d.path,
|
|
162
|
+
d.title,
|
|
163
|
+
d.body,
|
|
164
|
+
d.revision,
|
|
165
|
+
d.fingerprint,
|
|
166
|
+
d.modifiedAt,
|
|
167
|
+
(d.title + '\n' + d.path + '\n' + d.body).toLowerCase(),
|
|
168
|
+
],
|
|
169
|
+
);
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
inventory(scope: string, kind: IndexedDocument['kind']) {
|
|
174
|
+
return this.serial(async () => {
|
|
175
|
+
await this.initialize();
|
|
176
|
+
return this.db.all<Pick<IndexedDocument, 'id' | 'fingerprint'>>(
|
|
177
|
+
'SELECT id,fingerprint FROM vault_search_v1 WHERE scope=? AND kind=?',
|
|
178
|
+
[scope, kind],
|
|
179
|
+
);
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
remove(
|
|
184
|
+
scope: string,
|
|
185
|
+
kind: IndexedDocument['kind'],
|
|
186
|
+
id: string,
|
|
187
|
+
): Promise<void> {
|
|
188
|
+
return this.serial(async () => {
|
|
189
|
+
await this.initialize();
|
|
190
|
+
await this.db.run(
|
|
191
|
+
'DELETE FROM vault_search_v1 WHERE scope=? AND kind=? AND id=?',
|
|
192
|
+
[scope, kind, id],
|
|
193
|
+
);
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
clear(scope?: string): Promise<void> {
|
|
198
|
+
return this.serial(async () => {
|
|
199
|
+
await this.initialize();
|
|
200
|
+
if (scope)
|
|
201
|
+
await this.db.run('DELETE FROM vault_search_v1 WHERE scope=?', [scope]);
|
|
202
|
+
else await this.db.exec('DELETE FROM vault_search_v1;');
|
|
203
|
+
await this.db.exec('PRAGMA wal_checkpoint(TRUNCATE);');
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
search(
|
|
208
|
+
scope: string,
|
|
209
|
+
kind: IndexedDocument['kind'],
|
|
210
|
+
input: string,
|
|
211
|
+
limit = 100,
|
|
212
|
+
offset = 0,
|
|
213
|
+
): Promise<IndexedSearchHit[]> {
|
|
214
|
+
return this.serial(async () => {
|
|
215
|
+
await this.initialize();
|
|
216
|
+
const query = input.trim().slice(0, 200);
|
|
217
|
+
if (!query) return [];
|
|
218
|
+
const folded = query.toLowerCase();
|
|
219
|
+
const fts = this.trigrams && Array.from(folded).length >= 3;
|
|
220
|
+
const rows = await this.db.all<IndexedDocument>(
|
|
221
|
+
`SELECT d.id,d.kind,d.path,d.title,d.body,
|
|
222
|
+
d.revision,d.fingerprint,d.modifiedAt FROM vault_search_v1 d
|
|
223
|
+
${fts ? 'JOIN vault_search_fts_v1 f ON f.rowid=d.rowid' : ''}
|
|
224
|
+
WHERE d.scope=? AND d.kind=? AND ${fts ? 'f.search MATCH ?' : 'instr(d.search,?)>0'}
|
|
225
|
+
ORDER BY CASE WHEN lower(d.title)=? THEN 0 WHEN instr(lower(d.title),?)>0 THEN 1 ELSE 2 END,
|
|
226
|
+
d.modifiedAt DESC,d.path LIMIT ? OFFSET ?`,
|
|
227
|
+
[
|
|
228
|
+
scope,
|
|
229
|
+
kind,
|
|
230
|
+
fts ? '"' + folded.replace(/"/g, '""') + '"' : folded,
|
|
231
|
+
folded,
|
|
232
|
+
folded,
|
|
233
|
+
Math.min(200, Math.max(1, limit)),
|
|
234
|
+
Math.min(100000, Math.max(0, offset)),
|
|
235
|
+
],
|
|
236
|
+
);
|
|
237
|
+
return rows.map((document) => ({
|
|
238
|
+
...document,
|
|
239
|
+
match: contentMatch(document, query),
|
|
240
|
+
}));
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { SpeechAudioSchema } from './speech.js';
|
|
3
|
+
|
|
4
|
+
export const MAX_CAPTURE_BYTES = 2 * 1024 * 1024;
|
|
5
|
+
export const MAX_CAPTURE_SECONDS = 120;
|
|
6
|
+
export const VoiceCaptureAudioSchema = SpeechAudioSchema.extend({
|
|
7
|
+
format: z.literal('m4a'),
|
|
8
|
+
base64: SpeechAudioSchema.shape.base64.refine(
|
|
9
|
+
(value) => value.length <= 4 * Math.ceil(MAX_CAPTURE_BYTES / 3),
|
|
10
|
+
),
|
|
11
|
+
});
|
|
12
|
+
export const VoiceCaptureInputSchema = z
|
|
13
|
+
.object({
|
|
14
|
+
captureId: z.uuid(),
|
|
15
|
+
audio: VoiceCaptureAudioSchema,
|
|
16
|
+
})
|
|
17
|
+
.strict();
|
|
18
|
+
export const VoiceCaptureReceiptSchema = z.object({
|
|
19
|
+
captureId: z.uuid(),
|
|
20
|
+
state: z.enum([
|
|
21
|
+
'queued',
|
|
22
|
+
'transcribing',
|
|
23
|
+
'acting',
|
|
24
|
+
'done',
|
|
25
|
+
'failed',
|
|
26
|
+
'uncertain',
|
|
27
|
+
]),
|
|
28
|
+
transcript: z.string().max(8000).optional(),
|
|
29
|
+
result: z.string().max(4000).optional(),
|
|
30
|
+
message: z.string().max(1000).optional(),
|
|
31
|
+
updatedAt: z.string().datetime(),
|
|
32
|
+
});
|
|
33
|
+
export type VoiceCaptureReceipt = z.infer<typeof VoiceCaptureReceiptSchema>;
|
|
34
|
+
export type VoiceCaptureInput = z.infer<typeof VoiceCaptureInputSchema>;
|