@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
|
@@ -1,4 +1,10 @@
|
|
|
1
|
+
import {
|
|
2
|
+
parseAgentCommand,
|
|
3
|
+
findAgentCommand,
|
|
4
|
+
type AgentCommandOption,
|
|
5
|
+
} from '@lucidity/shared';
|
|
1
6
|
import { readFileSync } from 'node:fs';
|
|
7
|
+
import { randomUUID } from 'node:crypto';
|
|
2
8
|
import {
|
|
3
9
|
CodexRpc,
|
|
4
10
|
initializeCodex,
|
|
@@ -19,6 +25,16 @@ import type { TurnStartParams } from './codexProtocol/v2/TurnStartParams.js';
|
|
|
19
25
|
import type { TurnSteerParams } from './codexProtocol/v2/TurnSteerParams.js';
|
|
20
26
|
import type { ModelListResponse } from './codexProtocol/v2/ModelListResponse.js';
|
|
21
27
|
import type { UserInput } from './codexProtocol/v2/UserInput.js';
|
|
28
|
+
import type { ReviewStartParams } from './codexProtocol/v2/ReviewStartParams.js';
|
|
29
|
+
import type { ThreadSetNameParams } from './codexProtocol/v2/ThreadSetNameParams.js';
|
|
30
|
+
import type { GetAccountRateLimitsResponse } from './codexProtocol/v2/GetAccountRateLimitsResponse.js';
|
|
31
|
+
import type { SkillsListResponse } from './codexProtocol/v2/SkillsListResponse.js';
|
|
32
|
+
|
|
33
|
+
// App-server does not persist an empty thread until its first turn. Keep a durable
|
|
34
|
+
// reset marker in Lucidity's provider session envelope until that turn starts.
|
|
35
|
+
const EMPTY_SESSION_PREFIX = 'lucidity-codex-empty:';
|
|
36
|
+
const isEmptySession = (id?: string) =>
|
|
37
|
+
id?.startsWith(EMPTY_SESSION_PREFIX) ?? false;
|
|
22
38
|
|
|
23
39
|
function userInput(
|
|
24
40
|
input: Pick<ExecutorRunInput, 'userPrompt' | 'images'>,
|
|
@@ -38,7 +54,7 @@ export function codexRunConfig(
|
|
|
38
54
|
inherited: Record<string, unknown>,
|
|
39
55
|
): NonNullable<ThreadStartParams['config']> {
|
|
40
56
|
const config: NonNullable<ThreadStartParams['config']> = {
|
|
41
|
-
'features.shell_tool': !!input.permissionMode,
|
|
57
|
+
'features.shell_tool': !!input.permissionMode && !input.noTools,
|
|
42
58
|
'features.apps': false,
|
|
43
59
|
'features.multi_agent': false,
|
|
44
60
|
'features.multi_agent_v2': false,
|
|
@@ -55,7 +71,10 @@ export function codexRunConfig(
|
|
|
55
71
|
'features.code_mode_only': false,
|
|
56
72
|
'features.skill_mcp_dependency_install': false,
|
|
57
73
|
'features.workspace_dependencies': false,
|
|
58
|
-
'features.hooks':
|
|
74
|
+
'features.hooks':
|
|
75
|
+
!!input.permissionMode &&
|
|
76
|
+
input.permissionMode !== 'plan' &&
|
|
77
|
+
!input.noTools,
|
|
59
78
|
model_provider: 'openai',
|
|
60
79
|
};
|
|
61
80
|
// config/read expands optional fields to null; those cannot round-trip to TOML.
|
|
@@ -81,17 +100,29 @@ export function codexRunConfig(
|
|
|
81
100
|
};
|
|
82
101
|
}
|
|
83
102
|
config.mcp_servers = serversConfig;
|
|
103
|
+
if (input.readTools)
|
|
104
|
+
config.web_search = input.readTools.includes('WebSearch')
|
|
105
|
+
? 'live'
|
|
106
|
+
: 'disabled';
|
|
84
107
|
config.plugins = Object.fromEntries(
|
|
85
108
|
Object.keys((inherited.plugins ?? {}) as object).map((name) => [
|
|
86
109
|
name,
|
|
87
110
|
{ enabled: false },
|
|
88
111
|
]),
|
|
89
112
|
);
|
|
90
|
-
if (input.
|
|
113
|
+
if (input.noTools) config.web_search = 'disabled';
|
|
114
|
+
if (input.mcp && !input.noTools) {
|
|
91
115
|
const servers = JSON.parse(readFileSync(input.mcp.configPath, 'utf8'))
|
|
92
116
|
.mcpServers as Record<
|
|
93
117
|
string,
|
|
94
|
-
{
|
|
118
|
+
{
|
|
119
|
+
command?: string;
|
|
120
|
+
args?: string[];
|
|
121
|
+
env?: Record<string, string>;
|
|
122
|
+
type?: string;
|
|
123
|
+
url?: string;
|
|
124
|
+
headers?: Record<string, string>;
|
|
125
|
+
}
|
|
95
126
|
>;
|
|
96
127
|
for (const [name, server] of Object.entries(servers)) {
|
|
97
128
|
const prefix = `mcp__${name}__`;
|
|
@@ -102,7 +133,16 @@ export function codexRunConfig(
|
|
|
102
133
|
if (allowed.some((tool) => tool.includes('*') && tool !== '*'))
|
|
103
134
|
throw new Error('Unsupported MCP tool pattern for Codex.');
|
|
104
135
|
serversConfig[name] = {
|
|
105
|
-
...server
|
|
136
|
+
...(server.url
|
|
137
|
+
? {
|
|
138
|
+
url: server.url,
|
|
139
|
+
...(server.headers ? { http_headers: server.headers } : {}),
|
|
140
|
+
}
|
|
141
|
+
: {
|
|
142
|
+
command: server.command!,
|
|
143
|
+
...(server.args ? { args: server.args } : {}),
|
|
144
|
+
...(server.env ? { env: server.env } : {}),
|
|
145
|
+
}),
|
|
106
146
|
enabled: true,
|
|
107
147
|
required: true,
|
|
108
148
|
default_tools_approval_mode: 'approve',
|
|
@@ -170,6 +210,51 @@ export class CodexExecutor implements AgentExecutor {
|
|
|
170
210
|
}
|
|
171
211
|
}
|
|
172
212
|
|
|
213
|
+
async commands(
|
|
214
|
+
input: Pick<ExecutorRunInput, 'cwd' | 'permissionMode'> = {},
|
|
215
|
+
): Promise<AgentCommandOption[]> {
|
|
216
|
+
return [
|
|
217
|
+
{
|
|
218
|
+
name: 'compact',
|
|
219
|
+
description: 'Summarize older messages to free up context.',
|
|
220
|
+
argumentHint: '',
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
name: 'new',
|
|
224
|
+
aliases: ['clear'],
|
|
225
|
+
description:
|
|
226
|
+
'Start fresh context while keeping earlier messages visible.',
|
|
227
|
+
argumentHint: '',
|
|
228
|
+
clearsContext: true,
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
name: 'status',
|
|
232
|
+
description: 'Show the model, workspace and account limits.',
|
|
233
|
+
argumentHint: '',
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
name: 'rename',
|
|
237
|
+
description: 'Rename the provider conversation.',
|
|
238
|
+
argumentHint: '<name>',
|
|
239
|
+
},
|
|
240
|
+
...(input.cwd && input.permissionMode
|
|
241
|
+
? [
|
|
242
|
+
{
|
|
243
|
+
name: 'review',
|
|
244
|
+
description:
|
|
245
|
+
'Review uncommitted changes or give review instructions.',
|
|
246
|
+
argumentHint: '[instructions]',
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
name: 'skills',
|
|
250
|
+
description: 'List skills available in this workspace.',
|
|
251
|
+
argumentHint: '',
|
|
252
|
+
},
|
|
253
|
+
]
|
|
254
|
+
: []),
|
|
255
|
+
];
|
|
256
|
+
}
|
|
257
|
+
|
|
173
258
|
async run(input: ExecutorRunInput): Promise<ExecutorResult> {
|
|
174
259
|
for await (const event of this.runStream(input))
|
|
175
260
|
if (event.type === 'done') return event;
|
|
@@ -179,6 +264,52 @@ export class CodexExecutor implements AgentExecutor {
|
|
|
179
264
|
async *runStream(
|
|
180
265
|
input: ExecutorRunInput,
|
|
181
266
|
): AsyncIterable<ExecutorStreamEvent> {
|
|
267
|
+
if (input.signal?.aborted) throw abortError();
|
|
268
|
+
let command = parseAgentCommand(input.userPrompt);
|
|
269
|
+
if (command) {
|
|
270
|
+
const supported = findAgentCommand(
|
|
271
|
+
await this.commands(input),
|
|
272
|
+
command.name,
|
|
273
|
+
);
|
|
274
|
+
if (!supported)
|
|
275
|
+
throw new Error(
|
|
276
|
+
`/${command.name} is not supported by Codex in Lucidity.`,
|
|
277
|
+
);
|
|
278
|
+
if (!input.resume)
|
|
279
|
+
throw new Error('Start a conversation before using commands.');
|
|
280
|
+
if (
|
|
281
|
+
(!supported.argumentHint && command.arguments) ||
|
|
282
|
+
input.images?.length
|
|
283
|
+
)
|
|
284
|
+
throw new Error(
|
|
285
|
+
`/${supported.name} does not accept ${input.images?.length ? 'images' : 'arguments'} with Codex.`,
|
|
286
|
+
);
|
|
287
|
+
if (supported.name === 'rename' && !command.arguments)
|
|
288
|
+
throw new Error('Enter a name after /rename.');
|
|
289
|
+
command = { ...command, name: supported.name };
|
|
290
|
+
}
|
|
291
|
+
if (command?.name === 'new') {
|
|
292
|
+
const sessionId = `${EMPTY_SESSION_PREFIX}${randomUUID()}`;
|
|
293
|
+
yield { type: 'session', sessionId };
|
|
294
|
+
yield {
|
|
295
|
+
type: 'done',
|
|
296
|
+
text: 'Context cleared. Earlier messages remain visible here.',
|
|
297
|
+
sessionId,
|
|
298
|
+
};
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
301
|
+
if (isEmptySession(input.resume) && command?.name === 'compact') {
|
|
302
|
+
yield {
|
|
303
|
+
type: 'done',
|
|
304
|
+
text: 'Not enough messages to compact.',
|
|
305
|
+
sessionId: input.resume,
|
|
306
|
+
};
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
309
|
+
if (isEmptySession(input.resume) && command?.name === 'rename')
|
|
310
|
+
throw new Error(
|
|
311
|
+
'Send a message in the new conversation before renaming it.',
|
|
312
|
+
);
|
|
182
313
|
let threadId = '';
|
|
183
314
|
let turnId = '';
|
|
184
315
|
let ended = false;
|
|
@@ -186,6 +317,10 @@ export class CodexExecutor implements AgentExecutor {
|
|
|
186
317
|
let owner: ReturnType<LiveTurns['open']>;
|
|
187
318
|
try {
|
|
188
319
|
owner = this.turns.open(input, async (text) => {
|
|
320
|
+
if (command)
|
|
321
|
+
throw new Error(
|
|
322
|
+
'Wait for the command to finish before sending a message.',
|
|
323
|
+
);
|
|
189
324
|
if (!turnId || ended)
|
|
190
325
|
throw new Error('Codex has no active turn to steer.');
|
|
191
326
|
const params: TurnSteerParams = {
|
|
@@ -268,7 +403,10 @@ export class CodexExecutor implements AgentExecutor {
|
|
|
268
403
|
: input.permissionMode && input.permissionMode !== 'plan'
|
|
269
404
|
? 'on-request'
|
|
270
405
|
: 'never',
|
|
271
|
-
|
|
406
|
+
// Apply the daemon's Auto mode on both new and resumed threads instead
|
|
407
|
+
// of overriding it with a human reviewer on every turn.
|
|
408
|
+
approvalsReviewer:
|
|
409
|
+
input.permissionMode === 'auto' ? 'auto_review' : 'user',
|
|
272
410
|
sandbox:
|
|
273
411
|
input.permissionMode === 'bypassPermissions'
|
|
274
412
|
? 'danger-full-access'
|
|
@@ -278,32 +416,129 @@ export class CodexExecutor implements AgentExecutor {
|
|
|
278
416
|
developerInstructions: input.systemPrompt,
|
|
279
417
|
config: codexRunConfig(input, inherited.config),
|
|
280
418
|
};
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
419
|
+
type ThreadInfo = {
|
|
420
|
+
thread: { id: string };
|
|
421
|
+
model?: string;
|
|
422
|
+
reasoningEffort?: string | null;
|
|
423
|
+
cwd?: string;
|
|
424
|
+
};
|
|
425
|
+
const thread =
|
|
426
|
+
input.resume && !isEmptySession(input.resume)
|
|
427
|
+
? await rpc.request<ThreadInfo>('thread/resume', {
|
|
428
|
+
...params,
|
|
429
|
+
threadId: input.resume,
|
|
430
|
+
} satisfies ThreadResumeParams)
|
|
431
|
+
: await rpc.request<ThreadInfo>('thread/start', params);
|
|
287
432
|
threadId = thread.thread.id;
|
|
433
|
+
const sessionId =
|
|
434
|
+
isEmptySession(input.resume) &&
|
|
435
|
+
command &&
|
|
436
|
+
['status', 'skills'].includes(command.name)
|
|
437
|
+
? input.resume!
|
|
438
|
+
: threadId;
|
|
288
439
|
// Publish affinity before tools run, so an interrupted first turn can resume safely.
|
|
289
|
-
yield { type: 'session', sessionId
|
|
440
|
+
yield { type: 'session', sessionId };
|
|
441
|
+
// These controls finish with their RPC response and never start an inference turn.
|
|
442
|
+
if (command && ['status', 'rename', 'skills'].includes(command.name)) {
|
|
443
|
+
yield { type: 'tool_call', name: `/${command.name}`, phase: 'start' };
|
|
444
|
+
let text = '';
|
|
445
|
+
if (command.name === 'rename') {
|
|
446
|
+
await rpc.request('thread/name/set', {
|
|
447
|
+
threadId,
|
|
448
|
+
name: command.arguments,
|
|
449
|
+
} satisfies ThreadSetNameParams);
|
|
450
|
+
text = `Conversation renamed to ${command.arguments}.`;
|
|
451
|
+
}
|
|
452
|
+
if (command.name === 'status') {
|
|
453
|
+
const limits = await rpc.request<GetAccountRateLimitsResponse>(
|
|
454
|
+
'account/rateLimits/read',
|
|
455
|
+
{},
|
|
456
|
+
);
|
|
457
|
+
const buckets = limits.rateLimitsByLimitId
|
|
458
|
+
? Object.values(limits.rateLimitsByLimitId).filter(Boolean)
|
|
459
|
+
: [limits.rateLimits];
|
|
460
|
+
text = [
|
|
461
|
+
`Model: ${thread.model ?? input.model ?? 'Provider default'}`,
|
|
462
|
+
`Effort: ${input.effort ?? thread.reasoningEffort ?? 'Provider default'}`,
|
|
463
|
+
`Workspace: ${thread.cwd ?? input.cwd ?? 'Default'}`,
|
|
464
|
+
...buckets.flatMap((bucket) =>
|
|
465
|
+
[bucket?.primary, bucket?.secondary].flatMap((window) =>
|
|
466
|
+
window
|
|
467
|
+
? [
|
|
468
|
+
`${bucket?.limitName ?? 'Usage'} (${window.windowDurationMins ? `${window.windowDurationMins} min` : 'window'}): ${window.usedPercent}% used${window.resetsAt ? `; resets ${new Date(window.resetsAt * 1000).toISOString()}` : ''}`,
|
|
469
|
+
]
|
|
470
|
+
: [],
|
|
471
|
+
),
|
|
472
|
+
),
|
|
473
|
+
].join('\n');
|
|
474
|
+
}
|
|
475
|
+
if (command.name === 'skills') {
|
|
476
|
+
const result = await rpc.request<SkillsListResponse>('skills/list', {
|
|
477
|
+
cwds: [input.cwd!],
|
|
478
|
+
forceReload: true,
|
|
479
|
+
});
|
|
480
|
+
text =
|
|
481
|
+
result.data
|
|
482
|
+
.flatMap((entry) => [
|
|
483
|
+
...entry.skills
|
|
484
|
+
.filter((skill) => skill.enabled)
|
|
485
|
+
.map((skill) => `- $${skill.name}: ${skill.description}`),
|
|
486
|
+
...entry.errors.map(
|
|
487
|
+
(error) => `Could not load skill: ${error.message}`,
|
|
488
|
+
),
|
|
489
|
+
])
|
|
490
|
+
.join('\n') || 'No skills are available in this workspace.';
|
|
491
|
+
}
|
|
492
|
+
owner.check();
|
|
493
|
+
ended = true;
|
|
494
|
+
yield { type: 'tool_call', name: `/${command.name}`, phase: 'end' };
|
|
495
|
+
yield { type: 'done', text, sessionId };
|
|
496
|
+
return;
|
|
497
|
+
}
|
|
290
498
|
const start: TurnStartParams = {
|
|
291
499
|
threadId,
|
|
292
500
|
input: userInput(input),
|
|
293
501
|
model: input.model,
|
|
294
502
|
effort: input.effort as TurnStartParams['effort'],
|
|
503
|
+
outputSchema: input.outputSchema as TurnStartParams['outputSchema'],
|
|
295
504
|
};
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
505
|
+
if (command?.name === 'compact') {
|
|
506
|
+
yield {
|
|
507
|
+
type: 'tool_call',
|
|
508
|
+
name: 'Compact conversation',
|
|
509
|
+
phase: 'start',
|
|
510
|
+
};
|
|
511
|
+
await rpc.request('thread/compact/start', { threadId });
|
|
512
|
+
} else if (command?.name === 'review') {
|
|
513
|
+
yield { type: 'tool_call', name: '/review', phase: 'start' };
|
|
514
|
+
const review = await rpc.request<{ turn: { id: string } }>(
|
|
515
|
+
'review/start',
|
|
516
|
+
{
|
|
517
|
+
threadId,
|
|
518
|
+
delivery: 'inline',
|
|
519
|
+
target: command.arguments
|
|
520
|
+
? { type: 'custom', instructions: command.arguments }
|
|
521
|
+
: { type: 'uncommittedChanges' },
|
|
522
|
+
} satisfies ReviewStartParams,
|
|
523
|
+
);
|
|
524
|
+
turnId = review.turn.id;
|
|
525
|
+
} else {
|
|
526
|
+
const turn = await rpc.request<{ turn: { id: string } }>(
|
|
527
|
+
'turn/start',
|
|
528
|
+
start,
|
|
529
|
+
);
|
|
530
|
+
turnId = turn.turn.id;
|
|
531
|
+
}
|
|
301
532
|
let finalText = '';
|
|
302
533
|
let streamedText = '';
|
|
303
534
|
for await (const event of rpc.events) {
|
|
304
535
|
owner.check();
|
|
305
536
|
const p = event.params ?? {};
|
|
306
537
|
if (p.threadId !== threadId) continue;
|
|
538
|
+
if (command && event.method === 'turn/started' && !turnId) {
|
|
539
|
+
turnId = (p.turn as { id: string }).id;
|
|
540
|
+
continue;
|
|
541
|
+
}
|
|
307
542
|
if (p.turnId && p.turnId !== turnId) continue;
|
|
308
543
|
if (
|
|
309
544
|
event.method === 'item/agentMessage/delta' &&
|
|
@@ -321,7 +556,13 @@ export class CodexExecutor implements AgentExecutor {
|
|
|
321
556
|
phase?: string;
|
|
322
557
|
tool?: string;
|
|
323
558
|
server?: string;
|
|
559
|
+
review?: string;
|
|
324
560
|
};
|
|
561
|
+
if (
|
|
562
|
+
item.type === 'exitedReviewMode' &&
|
|
563
|
+
event.method === 'item/completed'
|
|
564
|
+
)
|
|
565
|
+
finalText = item.review ?? finalText;
|
|
325
566
|
if (
|
|
326
567
|
item.type === 'agentMessage' &&
|
|
327
568
|
event.method === 'item/completed' &&
|
|
@@ -335,7 +576,15 @@ export class CodexExecutor implements AgentExecutor {
|
|
|
335
576
|
? 'Edit files'
|
|
336
577
|
: item.type === 'mcpToolCall'
|
|
337
578
|
? `mcp__${item.server}__${item.tool}`
|
|
338
|
-
:
|
|
579
|
+
: item.type === 'webSearch'
|
|
580
|
+
? 'WebSearch'
|
|
581
|
+
: item.type === 'imageView'
|
|
582
|
+
? 'View image'
|
|
583
|
+
: item.type === 'imageGeneration'
|
|
584
|
+
? 'Generate image'
|
|
585
|
+
: item.type === 'dynamicToolCall'
|
|
586
|
+
? (item.tool ?? 'Dynamic tool')
|
|
587
|
+
: undefined;
|
|
339
588
|
if (name)
|
|
340
589
|
yield {
|
|
341
590
|
type: 'tool_call',
|
|
@@ -355,9 +604,21 @@ export class CodexExecutor implements AgentExecutor {
|
|
|
355
604
|
throw new Error(
|
|
356
605
|
completed.error?.message ?? `Codex turn ${completed.status}.`,
|
|
357
606
|
);
|
|
607
|
+
if (command)
|
|
608
|
+
yield {
|
|
609
|
+
type: 'tool_call',
|
|
610
|
+
name:
|
|
611
|
+
command.name === 'compact'
|
|
612
|
+
? 'Compact conversation'
|
|
613
|
+
: `/${command.name}`,
|
|
614
|
+
phase: 'end',
|
|
615
|
+
};
|
|
358
616
|
yield {
|
|
359
617
|
type: 'done',
|
|
360
|
-
text:
|
|
618
|
+
text:
|
|
619
|
+
command?.name === 'compact'
|
|
620
|
+
? 'Conversation compacted. You can continue here.'
|
|
621
|
+
: (finalText || streamedText).trim(),
|
|
361
622
|
sessionId: threadId,
|
|
362
623
|
};
|
|
363
624
|
return;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// GENERATED CODE! DO NOT MODIFY BY HAND!
|
|
2
|
+
|
|
3
|
+
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
|
4
|
+
|
|
5
|
+
export type PlanType = "free" | "go" | "plus" | "pro" | "prolite" | "team" | "self_serve_business_prolite" | "self_serve_business_usage_based" | "business" | "ent26" | "enterprise_cbp_automation" | "enterprise_cbp_usage_based" | "enterprise" | "edu" | "edu_plus" | "edu_pro" | "unknown";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// GENERATED CODE! DO NOT MODIFY BY HAND!
|
|
2
|
+
|
|
3
|
+
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
|
4
|
+
import type { JsonValue } from "../serde_json/JsonValue.js";
|
|
5
|
+
import type { RateLimitResetCreditsSummary } from "./RateLimitResetCreditsSummary.js";
|
|
6
|
+
import type { RateLimitSnapshot } from "./RateLimitSnapshot.js";
|
|
7
|
+
|
|
8
|
+
export type GetAccountRateLimitsResponse = {
|
|
9
|
+
/**
|
|
10
|
+
* Backward-compatible single-bucket view; mirrors the historical payload.
|
|
11
|
+
*/
|
|
12
|
+
rateLimits: RateLimitSnapshot,
|
|
13
|
+
/**
|
|
14
|
+
* Multi-bucket view keyed by metered `limit_id` (for example, `codex`).
|
|
15
|
+
*/
|
|
16
|
+
rateLimitsByLimitId: { [key in string]?: RateLimitSnapshot } | null, rateLimitResetCredits: RateLimitResetCreditsSummary | null,
|
|
17
|
+
/**
|
|
18
|
+
* Account associated with this usage snapshot, when supplied by the backend.
|
|
19
|
+
*/
|
|
20
|
+
accountId: string | null,
|
|
21
|
+
/**
|
|
22
|
+
* Optional backend-owned banner from the same usage read. Its nested keys retain the
|
|
23
|
+
* backend's snake_case contract; an absent banner leaves the client's existing UI unchanged.
|
|
24
|
+
*/
|
|
25
|
+
rateLimitUpsell: JsonValue | null, };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// GENERATED CODE! DO NOT MODIFY BY HAND!
|
|
2
|
+
|
|
3
|
+
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
|
4
|
+
|
|
5
|
+
export type RateLimitReachedType = "rate_limit_reached" | "workspace_owner_credits_depleted" | "workspace_member_credits_depleted" | "workspace_owner_usage_limit_reached" | "workspace_member_usage_limit_reached";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// GENERATED CODE! DO NOT MODIFY BY HAND!
|
|
2
|
+
|
|
3
|
+
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
|
4
|
+
import type { RateLimitResetCreditStatus } from "./RateLimitResetCreditStatus.js";
|
|
5
|
+
import type { RateLimitResetType } from "./RateLimitResetType.js";
|
|
6
|
+
|
|
7
|
+
export type RateLimitResetCredit = {
|
|
8
|
+
/**
|
|
9
|
+
* Opaque backend identifier for this reset credit.
|
|
10
|
+
*/
|
|
11
|
+
id: string, resetType: RateLimitResetType, status: RateLimitResetCreditStatus,
|
|
12
|
+
/**
|
|
13
|
+
* Unix timestamp in seconds when the credit was granted.
|
|
14
|
+
*/
|
|
15
|
+
grantedAt: number,
|
|
16
|
+
/**
|
|
17
|
+
* Unix timestamp in seconds when the credit expires, or `null` if it does not expire.
|
|
18
|
+
*/
|
|
19
|
+
expiresAt: number | null,
|
|
20
|
+
/**
|
|
21
|
+
* Backend-provided display title for this credit, or `null` when unavailable.
|
|
22
|
+
*/
|
|
23
|
+
title: string | null,
|
|
24
|
+
/**
|
|
25
|
+
* Backend-provided display description for this credit, or `null` when unavailable.
|
|
26
|
+
*/
|
|
27
|
+
description: string | null, };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// GENERATED CODE! DO NOT MODIFY BY HAND!
|
|
2
|
+
|
|
3
|
+
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
|
4
|
+
import type { RateLimitResetCredit } from "./RateLimitResetCredit.js";
|
|
5
|
+
|
|
6
|
+
export type RateLimitResetCreditsSummary = { availableCount: bigint,
|
|
7
|
+
/**
|
|
8
|
+
* Detail rows for available reset credits, when the backend provides them.
|
|
9
|
+
*
|
|
10
|
+
* `null` means only `availableCount` is known, while an empty array means details were fetched
|
|
11
|
+
* and no available credits were returned. The backend may cap this list, so its length can be
|
|
12
|
+
* less than `availableCount`.
|
|
13
|
+
*/
|
|
14
|
+
credits: Array<RateLimitResetCredit> | null, };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// GENERATED CODE! DO NOT MODIFY BY HAND!
|
|
2
|
+
|
|
3
|
+
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
|
4
|
+
import type { PlanType } from "../PlanType.js";
|
|
5
|
+
import type { CreditsSnapshot } from "./CreditsSnapshot.js";
|
|
6
|
+
import type { RateLimitReachedType } from "./RateLimitReachedType.js";
|
|
7
|
+
import type { RateLimitWindow } from "./RateLimitWindow.js";
|
|
8
|
+
import type { SpendControlLimitSnapshot } from "./SpendControlLimitSnapshot.js";
|
|
9
|
+
|
|
10
|
+
export type RateLimitSnapshot = { limitId: string | null, limitName: string | null, primary: RateLimitWindow | null, secondary: RateLimitWindow | null, credits: CreditsSnapshot | null, individualLimit: SpendControlLimitSnapshot | null,
|
|
11
|
+
/**
|
|
12
|
+
* Backend-reported spend-control state. `None` is unavailable, not a sparse-update recovery.
|
|
13
|
+
*/
|
|
14
|
+
spendControlReached: boolean | null, planType: PlanType | null, rateLimitReachedType: RateLimitReachedType | null, };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// GENERATED CODE! DO NOT MODIFY BY HAND!
|
|
2
|
+
|
|
3
|
+
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
|
4
|
+
|
|
5
|
+
export type RateLimitWindow = { usedPercent: number, windowDurationMins: number | null, resetsAt: number | null, };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// GENERATED CODE! DO NOT MODIFY BY HAND!
|
|
2
|
+
|
|
3
|
+
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
|
4
|
+
import type { ReviewDelivery } from "./ReviewDelivery.js";
|
|
5
|
+
import type { ReviewTarget } from "./ReviewTarget.js";
|
|
6
|
+
|
|
7
|
+
export type ReviewStartParams = { threadId: string, target: ReviewTarget,
|
|
8
|
+
/**
|
|
9
|
+
* Where to run the review: inline (default) on the current thread or
|
|
10
|
+
* detached on a new thread (returned in `reviewThreadId`).
|
|
11
|
+
*/
|
|
12
|
+
delivery?: ReviewDelivery | null, };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// GENERATED CODE! DO NOT MODIFY BY HAND!
|
|
2
|
+
|
|
3
|
+
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
|
4
|
+
|
|
5
|
+
export type ReviewTarget = { "type": "uncommittedChanges" } | { "type": "baseBranch", branch: string, } | { "type": "commit", sha: string,
|
|
6
|
+
/**
|
|
7
|
+
* Optional human-readable label (e.g., commit subject) for UIs.
|
|
8
|
+
*/
|
|
9
|
+
title: string | null, } | { "type": "custom", instructions: string, };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// GENERATED CODE! DO NOT MODIFY BY HAND!
|
|
2
|
+
|
|
3
|
+
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
|
4
|
+
import type { SkillToolDependency } from "./SkillToolDependency.js";
|
|
5
|
+
|
|
6
|
+
export type SkillDependencies = { tools: Array<SkillToolDependency>, };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// GENERATED CODE! DO NOT MODIFY BY HAND!
|
|
2
|
+
|
|
3
|
+
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
|
4
|
+
import type { AbsolutePathBuf } from "../AbsolutePathBuf.js";
|
|
5
|
+
|
|
6
|
+
export type SkillInterface = { displayName?: string, shortDescription?: string, iconSmall?: AbsolutePathBuf, iconLarge?: AbsolutePathBuf,
|
|
7
|
+
/**
|
|
8
|
+
* Remote small icon URL from the plugin catalog.
|
|
9
|
+
*/
|
|
10
|
+
iconSmallUrl: string | null,
|
|
11
|
+
/**
|
|
12
|
+
* Remote large icon URL from the plugin catalog.
|
|
13
|
+
*/
|
|
14
|
+
iconLargeUrl: string | null, brandColor?: string, defaultPrompt?: string, };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// GENERATED CODE! DO NOT MODIFY BY HAND!
|
|
2
|
+
|
|
3
|
+
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
|
4
|
+
import type { AbsolutePathBuf } from "../AbsolutePathBuf.js";
|
|
5
|
+
import type { SkillDependencies } from "./SkillDependencies.js";
|
|
6
|
+
import type { SkillInterface } from "./SkillInterface.js";
|
|
7
|
+
import type { SkillScope } from "./SkillScope.js";
|
|
8
|
+
|
|
9
|
+
export type SkillMetadata = { name: string, description: string,
|
|
10
|
+
/**
|
|
11
|
+
* Legacy short_description from SKILL.md. Prefer SKILL.json interface.short_description.
|
|
12
|
+
*/
|
|
13
|
+
shortDescription?: string, interface?: SkillInterface, dependencies?: SkillDependencies, path: AbsolutePathBuf, scope: SkillScope, enabled: boolean,
|
|
14
|
+
/**
|
|
15
|
+
* Owning plugin ID, matching `PluginSummary.id`, when known.
|
|
16
|
+
*/
|
|
17
|
+
pluginId: string | null, };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// GENERATED CODE! DO NOT MODIFY BY HAND!
|
|
2
|
+
|
|
3
|
+
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
|
4
|
+
|
|
5
|
+
export type SkillToolDependency = { type: string, value: string, description?: string, transport?: string, command?: string, url?: string, };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// GENERATED CODE! DO NOT MODIFY BY HAND!
|
|
2
|
+
|
|
3
|
+
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
|
4
|
+
import type { SkillErrorInfo } from "./SkillErrorInfo.js";
|
|
5
|
+
import type { SkillMetadata } from "./SkillMetadata.js";
|
|
6
|
+
|
|
7
|
+
export type SkillsListEntry = { cwd: string, skills: Array<SkillMetadata>, errors: Array<SkillErrorInfo>, };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// GENERATED CODE! DO NOT MODIFY BY HAND!
|
|
2
|
+
|
|
3
|
+
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
|
4
|
+
import type { SkillsListEntry } from "./SkillsListEntry.js";
|
|
5
|
+
|
|
6
|
+
export type SkillsListResponse = { data: Array<SkillsListEntry>, };
|