@opencorelabs/lucidity 0.3.0 → 0.7.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 +18 -3
- 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 +185 -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 +266 -47
- package/dist/room/computer.d.ts.map +1 -1
- package/dist/room/computer.js +9 -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 +202 -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 +320 -54
- package/src/room/computer.ts +9 -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/dayPlan.d.ts +9 -0
- package/vendor/decisions/dist/dayPlan.js +82 -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 +6 -0
- package/vendor/decisions/dist/index.js +6 -0
- package/vendor/decisions/dist/jev.d.ts +15 -0
- package/vendor/decisions/dist/jev.js +244 -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/dayPlan.ts +80 -0
- package/vendor/decisions/src/gate.ts +32 -0
- package/vendor/decisions/src/index.ts +6 -0
- package/vendor/decisions/src/jev.ts +295 -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 +117 -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 +214 -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 +10 -0
- package/vendor/runtime/dist/executor/types.d.ts.map +1 -1
- package/vendor/runtime/dist/harness/index.d.ts +2 -0
- package/vendor/runtime/dist/harness/index.d.ts.map +1 -1
- package/vendor/runtime/dist/harness/index.js +46 -1
- package/vendor/runtime/dist/harness/types.d.ts +5 -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/dayPlanning.d.ts +44 -0
- package/vendor/runtime/dist/prompts/dayPlanning.d.ts.map +1 -0
- package/vendor/runtime/dist/prompts/dayPlanning.js +42 -0
- 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 +137 -7
- package/vendor/runtime/src/executor/claudeCode.ts +6 -4
- package/vendor/runtime/src/executor/codex.ts +281 -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 +10 -0
- package/vendor/runtime/src/harness/index.ts +51 -6
- package/vendor/runtime/src/harness/types.ts +5 -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/dayPlanning.ts +46 -0
- 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 +664 -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 +1534 -0
- package/vendor/shared/dist/commands.d.ts.map +1 -0
- package/vendor/shared/dist/commands.js +233 -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 +12 -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/dayPlan.d.ts +86 -0
- package/vendor/shared/dist/dayPlan.d.ts.map +1 -0
- package/vendor/shared/dist/dayPlan.js +46 -0
- package/vendor/shared/dist/dayPlanning.d.ts +139 -0
- package/vendor/shared/dist/dayPlanning.d.ts.map +1 -0
- package/vendor/shared/dist/dayPlanning.js +67 -0
- 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 +28 -2
- package/vendor/shared/dist/index.d.ts.map +1 -1
- package/vendor/shared/dist/index.js +25 -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 +976 -59
- package/vendor/shared/dist/schemas/harness.d.ts.map +1 -1
- package/vendor/shared/dist/schemas/harness.js +124 -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 +740 -0
- package/vendor/shared/src/commandText.ts +25 -0
- package/vendor/shared/src/commands.ts +255 -0
- package/vendor/shared/src/computer.ts +25 -6
- package/vendor/shared/src/constants.ts +9 -2
- package/vendor/shared/src/dayPlan.ts +81 -0
- package/vendor/shared/src/dayPlanning.ts +77 -0
- package/vendor/shared/src/githubContributions.ts +70 -0
- package/vendor/shared/src/habitContributions.ts +144 -0
- package/vendor/shared/src/index.ts +44 -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 +146 -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,505 @@
|
|
|
1
|
+
import { Cron } from 'croner';
|
|
2
|
+
import { uuidv7 } from 'uuidv7';
|
|
3
|
+
import {
|
|
4
|
+
AutomationCommandSchema,
|
|
5
|
+
type AutomationCommand,
|
|
6
|
+
type AutomationJob,
|
|
7
|
+
type AutomationRun,
|
|
8
|
+
type AutomationSchedule,
|
|
9
|
+
type AutomationSnapshot,
|
|
10
|
+
type AutomationInput,
|
|
11
|
+
isDesignerInput,
|
|
12
|
+
} from '@lucidity/shared';
|
|
13
|
+
import { AutomationStore } from './store.js';
|
|
14
|
+
|
|
15
|
+
export function nextOccurrence(
|
|
16
|
+
schedule: AutomationSchedule,
|
|
17
|
+
after: Date,
|
|
18
|
+
): string | null {
|
|
19
|
+
if (schedule.frequency === 'manual') return null;
|
|
20
|
+
const [hour, minute] = schedule.time.split(':');
|
|
21
|
+
const expression =
|
|
22
|
+
schedule.frequency === 'interval'
|
|
23
|
+
? `0 */${schedule.everyHours} * * *`
|
|
24
|
+
: `${minute} ${hour} * * ${schedule.frequency === 'weekly' ? schedule.dayOfWeek : schedule.frequency === 'weekdays' ? '1-5' : '*'}`;
|
|
25
|
+
const cron = new Cron(expression, {
|
|
26
|
+
timezone: schedule.timezone,
|
|
27
|
+
paused: true,
|
|
28
|
+
});
|
|
29
|
+
try {
|
|
30
|
+
const next = cron.nextRun(after);
|
|
31
|
+
if (!next) throw new Error('This schedule has no next occurrence');
|
|
32
|
+
return next.toISOString();
|
|
33
|
+
} finally {
|
|
34
|
+
cron.stop();
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface AutomationServiceDeps {
|
|
39
|
+
store: AutomationStore;
|
|
40
|
+
execute: (
|
|
41
|
+
job: AutomationJob,
|
|
42
|
+
run: AutomationRun,
|
|
43
|
+
signal: AbortSignal,
|
|
44
|
+
) => Promise<Partial<AutomationRun>>;
|
|
45
|
+
validateRepo: (id: string) => void;
|
|
46
|
+
saveGuidance: (run: AutomationRun) => Promise<string | void>;
|
|
47
|
+
validateInput?: (input: AutomationInput) => void;
|
|
48
|
+
computerName?: string;
|
|
49
|
+
supportedSources?: () => AutomationSnapshot['supportedSources'];
|
|
50
|
+
connections: () => AutomationSnapshot['connections'];
|
|
51
|
+
scheduledWork: () => boolean;
|
|
52
|
+
now?: () => Date;
|
|
53
|
+
changed?: () => void;
|
|
54
|
+
logger?: (message: string) => void;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** A single writer serializes admission; inference runs asynchronously and is always recorded. */
|
|
58
|
+
export class AutomationService {
|
|
59
|
+
private readonly active = new Map<
|
|
60
|
+
string,
|
|
61
|
+
{ runId: string; controller: AbortController; done: Promise<void> }
|
|
62
|
+
>();
|
|
63
|
+
private timer?: ReturnType<typeof setInterval>;
|
|
64
|
+
private readonly now: () => Date;
|
|
65
|
+
constructor(private readonly deps: AutomationServiceDeps) {
|
|
66
|
+
this.now = deps.now ?? (() => new Date());
|
|
67
|
+
for (const run of deps.store.runs()) {
|
|
68
|
+
if (run.status === 'running')
|
|
69
|
+
this.finish(run, {
|
|
70
|
+
status: 'interrupted',
|
|
71
|
+
error:
|
|
72
|
+
'The computer restarted before this run finished. Review any saved or external output before retrying.',
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
registerBuiltin(
|
|
77
|
+
id: string,
|
|
78
|
+
name: string,
|
|
79
|
+
schedule: AutomationSchedule,
|
|
80
|
+
enabled = true,
|
|
81
|
+
) {
|
|
82
|
+
const previous = this.deps.store.jobs().find((job) => job.id === id);
|
|
83
|
+
const configSignature = JSON.stringify({ schedule, enabled });
|
|
84
|
+
if (previous?.configSignature === configSignature) return;
|
|
85
|
+
const now = this.now().toISOString();
|
|
86
|
+
this.deps.store.saveJob({
|
|
87
|
+
id,
|
|
88
|
+
kind: 'builtin',
|
|
89
|
+
name,
|
|
90
|
+
schedule,
|
|
91
|
+
enabled,
|
|
92
|
+
configSignature,
|
|
93
|
+
catchUp: 'skip',
|
|
94
|
+
nextRunAt: nextOccurrence(schedule, this.now()),
|
|
95
|
+
createdAt: previous?.createdAt ?? now,
|
|
96
|
+
updatedAt: now,
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
start() {
|
|
100
|
+
if (this.timer) return;
|
|
101
|
+
const tick = () => {
|
|
102
|
+
try {
|
|
103
|
+
this.tick();
|
|
104
|
+
} catch (error) {
|
|
105
|
+
this.deps.logger?.(`Automations: ${String(error)}`);
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
tick();
|
|
109
|
+
this.timer = setInterval(tick, 30_000);
|
|
110
|
+
this.timer.unref();
|
|
111
|
+
}
|
|
112
|
+
async stop() {
|
|
113
|
+
clearInterval(this.timer);
|
|
114
|
+
this.timer = undefined;
|
|
115
|
+
const active = [...this.active.values()];
|
|
116
|
+
for (const entry of active) entry.controller.abort();
|
|
117
|
+
await Promise.allSettled(active.map((entry) => entry.done));
|
|
118
|
+
}
|
|
119
|
+
snapshot(
|
|
120
|
+
options: {
|
|
121
|
+
jobId?: string;
|
|
122
|
+
runId?: string;
|
|
123
|
+
before?: string;
|
|
124
|
+
limit?: number;
|
|
125
|
+
} = {},
|
|
126
|
+
): AutomationSnapshot {
|
|
127
|
+
const history = this.deps.store.runs();
|
|
128
|
+
const all = options.runId
|
|
129
|
+
? [this.deps.store.run(options.runId)]
|
|
130
|
+
: history.filter(
|
|
131
|
+
(run) =>
|
|
132
|
+
(!options.jobId || run.jobId === options.jobId) &&
|
|
133
|
+
(!options.before || run.id < options.before),
|
|
134
|
+
);
|
|
135
|
+
const limit = Math.min(30, Math.max(1, options.limit ?? 20));
|
|
136
|
+
return {
|
|
137
|
+
jobs: this.deps.store.jobs(),
|
|
138
|
+
runs: all.slice(0, limit).map((run) =>
|
|
139
|
+
options.runId
|
|
140
|
+
? run
|
|
141
|
+
: {
|
|
142
|
+
...run,
|
|
143
|
+
guidance: undefined,
|
|
144
|
+
tasteDraft: undefined,
|
|
145
|
+
designDraft: undefined,
|
|
146
|
+
summary: run.summary.slice(0, 4000),
|
|
147
|
+
},
|
|
148
|
+
),
|
|
149
|
+
pendingRuns: history.flatMap((run) =>
|
|
150
|
+
(run.status === 'running' ||
|
|
151
|
+
run.status === 'needs_review' ||
|
|
152
|
+
run.status === 'failed' ||
|
|
153
|
+
run.status === 'interrupted') &&
|
|
154
|
+
!run.acknowledgedAt
|
|
155
|
+
? [
|
|
156
|
+
{
|
|
157
|
+
id: run.id,
|
|
158
|
+
jobName: run.jobName,
|
|
159
|
+
jobId: run.jobId,
|
|
160
|
+
status: run.status,
|
|
161
|
+
startedAt: run.startedAt,
|
|
162
|
+
},
|
|
163
|
+
]
|
|
164
|
+
: [],
|
|
165
|
+
),
|
|
166
|
+
...(all.length > limit ? { nextBefore: all[limit - 1]!.id } : {}),
|
|
167
|
+
connections: this.deps.connections(),
|
|
168
|
+
scheduledWork: this.deps.scheduledWork(),
|
|
169
|
+
computerName: this.deps.computerName,
|
|
170
|
+
supportedSources: this.deps.supportedSources?.(),
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
private job(id: string) {
|
|
174
|
+
const job = this.deps.store.jobs().find((entry) => entry.id === id);
|
|
175
|
+
if (!job) throw new Error('Automation not found');
|
|
176
|
+
return job;
|
|
177
|
+
}
|
|
178
|
+
private saveJob(job: AutomationJob) {
|
|
179
|
+
this.deps.store.saveJob({ ...job, updatedAt: this.now().toISOString() });
|
|
180
|
+
this.deps.changed?.();
|
|
181
|
+
}
|
|
182
|
+
private assertIdle(jobId: string) {
|
|
183
|
+
if (this.active.has(jobId))
|
|
184
|
+
throw new Error(
|
|
185
|
+
'This automation already has a running job. Open it or cancel it before starting another.',
|
|
186
|
+
);
|
|
187
|
+
}
|
|
188
|
+
async command(raw: AutomationCommand | unknown): Promise<AutomationSnapshot> {
|
|
189
|
+
const command = AutomationCommandSchema.parse(raw);
|
|
190
|
+
let runId: string | undefined,
|
|
191
|
+
jobId: string | undefined,
|
|
192
|
+
message: string | undefined;
|
|
193
|
+
if (command.action === 'save') {
|
|
194
|
+
if (command.input.repoId) this.deps.validateRepo(command.input.repoId);
|
|
195
|
+
const previous = command.jobId ? this.job(command.jobId) : undefined;
|
|
196
|
+
if (previous?.kind === 'builtin')
|
|
197
|
+
throw new Error('Use schedule controls to edit a built-in job.');
|
|
198
|
+
if (previous?.input && previous.input.workflow !== command.input.workflow)
|
|
199
|
+
throw new Error(
|
|
200
|
+
'Create a separate automation to change workflow type.',
|
|
201
|
+
);
|
|
202
|
+
if (command.input.enabled) {
|
|
203
|
+
if (command.input.schedule.frequency === 'manual')
|
|
204
|
+
throw new Error('Choose a schedule before enabling recurring runs.');
|
|
205
|
+
this.deps.validateInput?.(command.input);
|
|
206
|
+
}
|
|
207
|
+
jobId = previous?.id ?? uuidv7();
|
|
208
|
+
const now = this.now().toISOString();
|
|
209
|
+
this.saveJob({
|
|
210
|
+
id: jobId,
|
|
211
|
+
kind: isDesignerInput(command.input) ? 'deck-designer' : 'agent',
|
|
212
|
+
name: command.input.name,
|
|
213
|
+
input: command.input,
|
|
214
|
+
enabled: command.input.enabled,
|
|
215
|
+
pausedUntil: command.input.enabled ? previous?.pausedUntil : undefined,
|
|
216
|
+
catchUp: command.input.catchUp,
|
|
217
|
+
schedule: command.input.schedule,
|
|
218
|
+
nextRunAt: nextOccurrence(
|
|
219
|
+
command.input.schedule,
|
|
220
|
+
new Date(
|
|
221
|
+
Math.max(
|
|
222
|
+
Date.parse(now),
|
|
223
|
+
command.input.enabled && previous?.pausedUntil
|
|
224
|
+
? Date.parse(previous.pausedUntil)
|
|
225
|
+
: 0,
|
|
226
|
+
),
|
|
227
|
+
),
|
|
228
|
+
),
|
|
229
|
+
createdAt: previous?.createdAt ?? now,
|
|
230
|
+
updatedAt: now,
|
|
231
|
+
});
|
|
232
|
+
} else if (command.action === 'enable' || command.action === 'schedule') {
|
|
233
|
+
const job = this.job(command.jobId);
|
|
234
|
+
if (command.action === 'schedule') {
|
|
235
|
+
job.schedule = command.schedule;
|
|
236
|
+
if (command.schedule.frequency === 'manual') {
|
|
237
|
+
job.enabled = false;
|
|
238
|
+
if (job.input) job.input.enabled = false;
|
|
239
|
+
}
|
|
240
|
+
if (job.input) job.input.schedule = command.schedule;
|
|
241
|
+
} else {
|
|
242
|
+
if (command.enabled && job.schedule.frequency === 'manual')
|
|
243
|
+
throw new Error(
|
|
244
|
+
'Choose a schedule before turning this automation on. Run now is available anytime.',
|
|
245
|
+
);
|
|
246
|
+
if (command.enabled && job.input) this.deps.validateInput?.(job.input);
|
|
247
|
+
if (command.pausedUntil && new Date(command.pausedUntil) <= this.now())
|
|
248
|
+
throw new Error('Choose a pause end in the future');
|
|
249
|
+
job.enabled = command.enabled;
|
|
250
|
+
job.pausedUntil = command.pausedUntil;
|
|
251
|
+
if (job.input) job.input.enabled = command.enabled;
|
|
252
|
+
}
|
|
253
|
+
job.nextRunAt = nextOccurrence(
|
|
254
|
+
job.schedule,
|
|
255
|
+
new Date(
|
|
256
|
+
Math.max(
|
|
257
|
+
this.now().getTime(),
|
|
258
|
+
job.pausedUntil ? Date.parse(job.pausedUntil) : 0,
|
|
259
|
+
),
|
|
260
|
+
),
|
|
261
|
+
);
|
|
262
|
+
this.saveJob(job);
|
|
263
|
+
} else if (command.action === 'run') {
|
|
264
|
+
const job = this.job(command.jobId);
|
|
265
|
+
runId = this.launch(
|
|
266
|
+
job,
|
|
267
|
+
job.kind === 'builtin'
|
|
268
|
+
? 'builtin'
|
|
269
|
+
: job.kind === 'agent'
|
|
270
|
+
? 'agent'
|
|
271
|
+
: command.stage === 'agent'
|
|
272
|
+
? 'design'
|
|
273
|
+
: command.stage,
|
|
274
|
+
'manual',
|
|
275
|
+
);
|
|
276
|
+
} else if (command.action === 'cancel') {
|
|
277
|
+
const run = this.deps.store.run(command.runId);
|
|
278
|
+
const active = this.active.get(run.jobId);
|
|
279
|
+
if (!active || active.runId !== run.id)
|
|
280
|
+
throw new Error('This run has already ended');
|
|
281
|
+
active.controller.abort();
|
|
282
|
+
message =
|
|
283
|
+
'Cancellation requested. Completed external edits remain available for review.';
|
|
284
|
+
} else {
|
|
285
|
+
const run = this.deps.store.run(command.runId);
|
|
286
|
+
if (run.status === 'running')
|
|
287
|
+
throw new Error('Wait for this run to finish before reviewing it');
|
|
288
|
+
if (command.action === 'acknowledge') {
|
|
289
|
+
run.acknowledgedAt = this.now().toISOString();
|
|
290
|
+
this.deps.store.saveRun(run);
|
|
291
|
+
} else if (command.action === 'review') {
|
|
292
|
+
if (command.decision === 'approve') {
|
|
293
|
+
if (!['needs_review', 'approved'].includes(run.status))
|
|
294
|
+
throw new Error('Only a completed proposal can be approved');
|
|
295
|
+
if (!['agent', 'design', 'revision'].includes(run.stage))
|
|
296
|
+
throw new Error(
|
|
297
|
+
'Choose a design proposal to approve. Save accepted taste drafts with save-guidance.',
|
|
298
|
+
);
|
|
299
|
+
if (
|
|
300
|
+
run.stage !== 'agent' &&
|
|
301
|
+
!run.directions.some(
|
|
302
|
+
(direction) => direction.id === command.directionId,
|
|
303
|
+
)
|
|
304
|
+
)
|
|
305
|
+
throw new Error('Choose a direction from this run');
|
|
306
|
+
run.selectedDirectionId = command.directionId;
|
|
307
|
+
run.status = 'approved';
|
|
308
|
+
} else run.status = 'archived';
|
|
309
|
+
this.deps.store.saveRun(run);
|
|
310
|
+
} else if (command.action === 'save-guidance') {
|
|
311
|
+
if (
|
|
312
|
+
!run.tasteDraft ||
|
|
313
|
+
!run.designDraft ||
|
|
314
|
+
!['needs_review', 'approved'].includes(run.status)
|
|
315
|
+
)
|
|
316
|
+
throw new Error('This run has no guidance ready to save');
|
|
317
|
+
const saved = await this.deps.saveGuidance(run);
|
|
318
|
+
run.status = 'approved';
|
|
319
|
+
this.deps.store.saveRun(run);
|
|
320
|
+
message =
|
|
321
|
+
saved ??
|
|
322
|
+
'Saved docs/taste.md and docs/design.md in the repository. Review and commit them so other worktrees can use them.';
|
|
323
|
+
} else {
|
|
324
|
+
const job = this.job(run.jobId);
|
|
325
|
+
if (!run.input || job.kind === 'builtin')
|
|
326
|
+
throw new Error('This action is available for custom automations');
|
|
327
|
+
this.assertIdle(job.id);
|
|
328
|
+
if (command.action === 'implement') {
|
|
329
|
+
if (!isDesignerInput(run.input) || !run.input.repoId)
|
|
330
|
+
throw new Error(
|
|
331
|
+
'Implementation requires a UI design created with a selected project repository.',
|
|
332
|
+
);
|
|
333
|
+
if (run.status !== 'approved' || !run.selectedDirectionId)
|
|
334
|
+
throw new Error('Approve a design direction before implementation');
|
|
335
|
+
if (
|
|
336
|
+
this.deps.store
|
|
337
|
+
.runs()
|
|
338
|
+
.some(
|
|
339
|
+
(entry) =>
|
|
340
|
+
entry.parentRunId === run.id &&
|
|
341
|
+
entry.stage === 'implementation' &&
|
|
342
|
+
!['failed', 'cancelled', 'interrupted'].includes(
|
|
343
|
+
entry.status,
|
|
344
|
+
),
|
|
345
|
+
)
|
|
346
|
+
)
|
|
347
|
+
throw new Error('This design already has an implementation run');
|
|
348
|
+
runId = this.launch(
|
|
349
|
+
{ ...job, input: run.input },
|
|
350
|
+
'implementation',
|
|
351
|
+
'manual',
|
|
352
|
+
run,
|
|
353
|
+
);
|
|
354
|
+
} else {
|
|
355
|
+
if (run.stage === 'implementation')
|
|
356
|
+
throw new Error(
|
|
357
|
+
'Continue implementation changes on its saved branch. Revise the parent design to create a new proposal.',
|
|
358
|
+
);
|
|
359
|
+
run.feedback.push({
|
|
360
|
+
at: this.now().toISOString(),
|
|
361
|
+
text: command.feedback,
|
|
362
|
+
});
|
|
363
|
+
this.deps.store.saveRun(run);
|
|
364
|
+
runId = this.launch(
|
|
365
|
+
{ ...job, input: run.input },
|
|
366
|
+
run.stage === 'agent'
|
|
367
|
+
? 'agent'
|
|
368
|
+
: run.stage === 'taste'
|
|
369
|
+
? 'taste'
|
|
370
|
+
: 'revision',
|
|
371
|
+
'manual',
|
|
372
|
+
run,
|
|
373
|
+
);
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
this.deps.changed?.();
|
|
377
|
+
}
|
|
378
|
+
return {
|
|
379
|
+
...this.snapshot(),
|
|
380
|
+
...(runId ? { runId } : {}),
|
|
381
|
+
...(jobId ? { jobId } : {}),
|
|
382
|
+
...(message ? { message } : {}),
|
|
383
|
+
};
|
|
384
|
+
}
|
|
385
|
+
tick() {
|
|
386
|
+
const now = this.now();
|
|
387
|
+
for (const job of this.deps.store.jobs()) {
|
|
388
|
+
if (!this.deps.scheduledWork() && job.id !== 'builtin:prune') continue;
|
|
389
|
+
if (!job.enabled || (job.pausedUntil && new Date(job.pausedUntil) > now))
|
|
390
|
+
continue;
|
|
391
|
+
if (job.schedule.frequency === 'manual') continue;
|
|
392
|
+
if (!job.nextRunAt) {
|
|
393
|
+
this.saveJob({ ...job, nextRunAt: nextOccurrence(job.schedule, now) });
|
|
394
|
+
continue;
|
|
395
|
+
}
|
|
396
|
+
if (new Date(job.nextRunAt) > now) continue;
|
|
397
|
+
const late = now.getTime() - Date.parse(job.nextRunAt) > 90_000;
|
|
398
|
+
// Claim the scheduled occurrence before inference. A crash never replays it.
|
|
399
|
+
this.saveJob({
|
|
400
|
+
...job,
|
|
401
|
+
pausedUntil: undefined,
|
|
402
|
+
nextRunAt: nextOccurrence(job.schedule, now),
|
|
403
|
+
});
|
|
404
|
+
if (this.active.has(job.id) || (late && job.catchUp === 'skip')) {
|
|
405
|
+
const at = now.toISOString();
|
|
406
|
+
this.deps.store.saveRun({
|
|
407
|
+
id: uuidv7(),
|
|
408
|
+
jobId: job.id,
|
|
409
|
+
jobName: job.name,
|
|
410
|
+
stage:
|
|
411
|
+
job.kind === 'builtin'
|
|
412
|
+
? 'builtin'
|
|
413
|
+
: job.kind === 'agent'
|
|
414
|
+
? 'agent'
|
|
415
|
+
: 'design',
|
|
416
|
+
trigger: 'scheduled',
|
|
417
|
+
status: 'skipped',
|
|
418
|
+
startedAt: at,
|
|
419
|
+
finishedAt: at,
|
|
420
|
+
summary: this.active.has(job.id)
|
|
421
|
+
? 'Previous run is still active.'
|
|
422
|
+
: 'Scheduled time was missed while the computer was unavailable. Catch-up is disabled.',
|
|
423
|
+
directions: [],
|
|
424
|
+
feedback: [],
|
|
425
|
+
});
|
|
426
|
+
} else
|
|
427
|
+
this.launch(
|
|
428
|
+
job,
|
|
429
|
+
job.kind === 'builtin'
|
|
430
|
+
? 'builtin'
|
|
431
|
+
: job.kind === 'agent'
|
|
432
|
+
? 'agent'
|
|
433
|
+
: 'design',
|
|
434
|
+
late ? 'catch-up' : 'scheduled',
|
|
435
|
+
);
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
private launch(
|
|
439
|
+
job: AutomationJob,
|
|
440
|
+
stage: AutomationRun['stage'],
|
|
441
|
+
trigger: AutomationRun['trigger'],
|
|
442
|
+
parent?: AutomationRun,
|
|
443
|
+
): string {
|
|
444
|
+
this.assertIdle(job.id);
|
|
445
|
+
const run: AutomationRun = {
|
|
446
|
+
id: uuidv7(),
|
|
447
|
+
jobId: job.id,
|
|
448
|
+
jobName: job.name,
|
|
449
|
+
stage,
|
|
450
|
+
trigger,
|
|
451
|
+
status: 'running',
|
|
452
|
+
startedAt: this.now().toISOString(),
|
|
453
|
+
summary: 'Starting…',
|
|
454
|
+
input: job.input,
|
|
455
|
+
parentRunId: parent?.id,
|
|
456
|
+
feedback: parent?.feedback ?? [],
|
|
457
|
+
directions: stage === 'implementation' ? (parent?.directions ?? []) : [],
|
|
458
|
+
selectedDirectionId:
|
|
459
|
+
stage === 'implementation' ? parent?.selectedDirectionId : undefined,
|
|
460
|
+
};
|
|
461
|
+
this.deps.store.saveRun(run);
|
|
462
|
+
const controller = new AbortController();
|
|
463
|
+
// Microtask admission makes the active marker visible before any executor can finish.
|
|
464
|
+
const done = Promise.resolve()
|
|
465
|
+
.then(async () => {
|
|
466
|
+
try {
|
|
467
|
+
const result = await this.deps.execute(job, run, controller.signal);
|
|
468
|
+
this.finish(
|
|
469
|
+
run,
|
|
470
|
+
controller.signal.aborted
|
|
471
|
+
? { ...result, status: 'cancelled' }
|
|
472
|
+
: result,
|
|
473
|
+
);
|
|
474
|
+
} catch (error) {
|
|
475
|
+
this.finish(run, {
|
|
476
|
+
status: controller.signal.aborted ? 'cancelled' : 'failed',
|
|
477
|
+
error: error instanceof Error ? error.message : String(error),
|
|
478
|
+
});
|
|
479
|
+
} finally {
|
|
480
|
+
this.active.delete(job.id);
|
|
481
|
+
this.deps.changed?.();
|
|
482
|
+
}
|
|
483
|
+
})
|
|
484
|
+
.catch((error) => {
|
|
485
|
+
this.deps.logger?.(
|
|
486
|
+
`Could not persist automation result ${run.id}: ${String(error)}`,
|
|
487
|
+
);
|
|
488
|
+
});
|
|
489
|
+
this.active.set(job.id, { runId: run.id, controller, done });
|
|
490
|
+
this.deps.changed?.();
|
|
491
|
+
return run.id;
|
|
492
|
+
}
|
|
493
|
+
private finish(run: AutomationRun, patch: Partial<AutomationRun>) {
|
|
494
|
+
const finishedAt = this.now().toISOString();
|
|
495
|
+
this.deps.store.saveRun({
|
|
496
|
+
...run,
|
|
497
|
+
status: 'completed',
|
|
498
|
+
...patch,
|
|
499
|
+
id: run.id,
|
|
500
|
+
jobId: run.jobId,
|
|
501
|
+
finishedAt,
|
|
502
|
+
durationMs: Date.parse(finishedAt) - Date.parse(run.startedAt),
|
|
503
|
+
});
|
|
504
|
+
}
|
|
505
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { spawn } from 'node:child_process';
|
|
2
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
3
|
+
import { join } from 'node:path';
|
|
4
|
+
import { clientCommand } from '../mcp/clients.js';
|
|
5
|
+
import { CONFIG_DIR } from '../config.js';
|
|
6
|
+
|
|
7
|
+
/** Explicit interactive setup; never launched by a scheduled job or the phone. */
|
|
8
|
+
export async function setupDesign(args: string[]) {
|
|
9
|
+
if (args.includes('--help')) {
|
|
10
|
+
process.stdout.write(
|
|
11
|
+
'lucidity setup-design\nConnect Figma through the bundled Codex OAuth client and save the daemon’s design connection.\nFor Claude or an authenticated Pinterest server, see docs/deck-designer.md.\n',
|
|
12
|
+
);
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
const path = join(CONFIG_DIR, 'design-mcp.json');
|
|
16
|
+
const config = existsSync(path)
|
|
17
|
+
? JSON.parse(readFileSync(path, 'utf8'))
|
|
18
|
+
: { mcpServers: {} };
|
|
19
|
+
const server = config.mcpServers?.figma;
|
|
20
|
+
if (
|
|
21
|
+
server &&
|
|
22
|
+
(server.type !== 'http' || server.url !== 'https://mcp.figma.com/mcp')
|
|
23
|
+
)
|
|
24
|
+
throw new Error(
|
|
25
|
+
'A custom Figma connection already exists. Keep it or edit design-mcp.json explicitly before using this setup.',
|
|
26
|
+
);
|
|
27
|
+
const cli = clientCommand('codex');
|
|
28
|
+
const run = (argv: string[], capture = false): Promise<string> =>
|
|
29
|
+
new Promise((resolve, reject) => {
|
|
30
|
+
const child = spawn(cli.command, [...cli.prefix, ...argv], {
|
|
31
|
+
stdio: capture ? ['ignore', 'pipe', 'pipe'] : 'inherit',
|
|
32
|
+
});
|
|
33
|
+
let output = '';
|
|
34
|
+
child.stdout?.on('data', (data) => {
|
|
35
|
+
output += data;
|
|
36
|
+
});
|
|
37
|
+
child.on('error', () =>
|
|
38
|
+
reject(new Error('Could not start the bundled Codex client')),
|
|
39
|
+
);
|
|
40
|
+
child.on('exit', (code) =>
|
|
41
|
+
code === 0
|
|
42
|
+
? resolve(output)
|
|
43
|
+
: reject(
|
|
44
|
+
new Error(
|
|
45
|
+
'Figma setup did not complete. Existing credentials and jobs were preserved.',
|
|
46
|
+
),
|
|
47
|
+
),
|
|
48
|
+
);
|
|
49
|
+
});
|
|
50
|
+
const servers = JSON.parse(await run(['mcp', 'list', '--json'], true)) as {
|
|
51
|
+
name: string;
|
|
52
|
+
transport?: { url?: string };
|
|
53
|
+
}[];
|
|
54
|
+
const existing = servers.find((entry) => entry.name === 'figma');
|
|
55
|
+
if (existing && existing.transport?.url !== 'https://mcp.figma.com/mcp')
|
|
56
|
+
throw new Error(
|
|
57
|
+
'Codex already has a different server named figma. Resolve that name explicitly before connecting.',
|
|
58
|
+
);
|
|
59
|
+
if (!existing)
|
|
60
|
+
await run(['mcp', 'add', 'figma', '--url', 'https://mcp.figma.com/mcp']);
|
|
61
|
+
await run(['mcp', 'login', 'figma']);
|
|
62
|
+
mkdirSync(CONFIG_DIR, { recursive: true, mode: 0o700 });
|
|
63
|
+
config.mcpServers = {
|
|
64
|
+
...config.mcpServers,
|
|
65
|
+
figma: server ?? { type: 'http', url: 'https://mcp.figma.com/mcp' },
|
|
66
|
+
};
|
|
67
|
+
writeFileSync(path, JSON.stringify(config, null, 2) + '\n', { mode: 0o600 });
|
|
68
|
+
process.stdout.write(
|
|
69
|
+
'Figma is configured for Codex design runs. In Lucidity, open Automations, save your board and Figma links, and run Study my taste.\n',
|
|
70
|
+
);
|
|
71
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import { dirname, join } from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
|
|
5
|
+
/** Project-scoped installation is explicit and never replaces a customized skill. */
|
|
6
|
+
export function installAutomationSkill(
|
|
7
|
+
client: string = 'both',
|
|
8
|
+
root = process.cwd(),
|
|
9
|
+
) {
|
|
10
|
+
if (!['claude', 'codex', 'both'].includes(client))
|
|
11
|
+
throw new Error(
|
|
12
|
+
'Use lucidity automations install-skill [claude|codex|both] from your project directory.',
|
|
13
|
+
);
|
|
14
|
+
const directory = dirname(fileURLToPath(import.meta.url));
|
|
15
|
+
const source = [
|
|
16
|
+
join(directory, '../skills/lucidity-automations/SKILL.md'),
|
|
17
|
+
join(directory, '../../skills/lucidity-automations/SKILL.md'),
|
|
18
|
+
].find(existsSync);
|
|
19
|
+
if (!source)
|
|
20
|
+
throw new Error(
|
|
21
|
+
'This installation is missing the automation skill. Reinstall Lucidity.',
|
|
22
|
+
);
|
|
23
|
+
const content = readFileSync(source, 'utf8');
|
|
24
|
+
const targets = (
|
|
25
|
+
client === 'both'
|
|
26
|
+
? ['.agents', '.claude']
|
|
27
|
+
: [client === 'codex' ? '.agents' : '.claude']
|
|
28
|
+
).map((folder) => join(root, folder, 'skills/lucidity-automations/SKILL.md'));
|
|
29
|
+
for (const target of targets)
|
|
30
|
+
if (existsSync(target) && readFileSync(target, 'utf8') !== content)
|
|
31
|
+
throw new Error(
|
|
32
|
+
`A customized skill exists at ${target}. Keep it or update it explicitly; it was not replaced.`,
|
|
33
|
+
);
|
|
34
|
+
for (const target of targets) {
|
|
35
|
+
if (existsSync(target)) continue;
|
|
36
|
+
mkdirSync(dirname(target), { recursive: true });
|
|
37
|
+
writeFileSync(target, content, { flag: 'wx' });
|
|
38
|
+
}
|
|
39
|
+
return targets;
|
|
40
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import {
|
|
2
|
+
existsSync,
|
|
3
|
+
mkdirSync,
|
|
4
|
+
readFileSync,
|
|
5
|
+
readdirSync,
|
|
6
|
+
renameSync,
|
|
7
|
+
writeFileSync,
|
|
8
|
+
} from 'node:fs';
|
|
9
|
+
import { join } from 'node:path';
|
|
10
|
+
import {
|
|
11
|
+
AutomationJobSchema,
|
|
12
|
+
AutomationRunSchema,
|
|
13
|
+
type AutomationJob,
|
|
14
|
+
type AutomationRun,
|
|
15
|
+
} from '@lucidity/shared';
|
|
16
|
+
|
|
17
|
+
/** Only the daemon writes this store; CLI and phone go through its authenticated gateway. */
|
|
18
|
+
export class AutomationStore {
|
|
19
|
+
constructor(readonly directory: string) {
|
|
20
|
+
mkdirSync(join(directory, 'runs'), { recursive: true, mode: 0o700 });
|
|
21
|
+
}
|
|
22
|
+
private write(path: string, value: unknown) {
|
|
23
|
+
const temporary = `${path}.tmp`;
|
|
24
|
+
writeFileSync(temporary, JSON.stringify(value, null, 2), { mode: 0o600 });
|
|
25
|
+
renameSync(temporary, path);
|
|
26
|
+
}
|
|
27
|
+
jobs(): AutomationJob[] {
|
|
28
|
+
const path = join(this.directory, 'jobs.json');
|
|
29
|
+
if (!existsSync(path)) return [];
|
|
30
|
+
// Corruption must be surfaced, never mistaken for an empty store and overwritten.
|
|
31
|
+
return AutomationJobSchema.array().parse(
|
|
32
|
+
JSON.parse(readFileSync(path, 'utf8')),
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
saveJob(job: AutomationJob) {
|
|
36
|
+
const jobs = this.jobs();
|
|
37
|
+
this.write(join(this.directory, 'jobs.json'), [
|
|
38
|
+
...jobs.filter((row) => row.id !== job.id),
|
|
39
|
+
AutomationJobSchema.parse(job),
|
|
40
|
+
]);
|
|
41
|
+
}
|
|
42
|
+
run(id: string): AutomationRun {
|
|
43
|
+
if (!/^[a-zA-Z0-9-]+$/.test(id)) throw new Error('Invalid run ID');
|
|
44
|
+
return AutomationRunSchema.parse(
|
|
45
|
+
JSON.parse(
|
|
46
|
+
readFileSync(join(this.directory, 'runs', `${id}.json`), 'utf8'),
|
|
47
|
+
),
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
saveRun(run: AutomationRun) {
|
|
51
|
+
if (!/^[a-zA-Z0-9-]+$/.test(run.id)) throw new Error('Invalid run ID');
|
|
52
|
+
this.write(
|
|
53
|
+
join(this.directory, 'runs', `${run.id}.json`),
|
|
54
|
+
AutomationRunSchema.parse(run),
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
runs(): AutomationRun[] {
|
|
58
|
+
return readdirSync(join(this.directory, 'runs'))
|
|
59
|
+
.filter((name) => name.endsWith('.json'))
|
|
60
|
+
.map((name) => this.run(name.slice(0, -5)))
|
|
61
|
+
.sort((a, b) => b.id.localeCompare(a.id));
|
|
62
|
+
}
|
|
63
|
+
}
|