@nexus-cortex/cli 4.26.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/.cortex/agents/AGENT_PROFILE_GUIDE.md +307 -0
- package/.cortex/agents/README.md +268 -0
- package/.cortex/agents/a-frontend-landing-page-designer.md +41 -0
- package/.cortex/agents/autoresearch-agent.md +49 -0
- package/.cortex/agents/code-reviewer.md +63 -0
- package/.cortex/agents/context-research.md +26 -0
- package/.cortex/agents/doc-writer.md +92 -0
- package/.cortex/agents/explore.md +63 -0
- package/.cortex/agents/new-model-api-integrator-analyst.md +41 -0
- package/.cortex/agents/plan.md +109 -0
- package/.cortex/agents/pr-architecture-reviewer.md +77 -0
- package/.cortex/agents/pr-code-quality.md +78 -0
- package/.cortex/agents/pr-implementer.md +50 -0
- package/.cortex/agents/pr-security-auditor.md +62 -0
- package/.cortex/agents/pr-test-writer.md +67 -0
- package/.cortex/agents/refactor.md +118 -0
- package/.cortex/agents/test-writer.md +72 -0
- package/.cortex/agents/web-researcher.md +72 -0
- package/.cortex/bench/tasks/sample-tasks.json +20 -0
- package/.cortex/commands/compare.md +14 -0
- package/.cortex/commands/deps.md +16 -0
- package/.cortex/commands/diff.md +14 -0
- package/.cortex/commands/explain.md +16 -0
- package/.cortex/commands/find-bug.md +13 -0
- package/.cortex/commands/profile.md +15 -0
- package/.cortex/commands/review.md +18 -0
- package/.cortex/commands/search.md +16 -0
- package/.cortex/commands/test.md +15 -0
- package/.cortex/permissions.dev.json +20 -0
- package/.cortex/permissions.example.json +71 -0
- package/.cortex/permissions.prod.json +63 -0
- package/.cortex/permissions.test.json +19 -0
- package/.cortex/skills/autoresearch/SKILL.md +77 -0
- package/.cortex/skills/autoresearch/personas/README.md +45 -0
- package/.cortex/skills/autoresearch/personas/aggressive-refactor.md +25 -0
- package/.cortex/skills/autoresearch/personas/creative.md +29 -0
- package/.cortex/skills/autoresearch/personas/perf-hunter.md +27 -0
- package/.cortex/skills/autoresearch/personas/precise.md +23 -0
- package/.cortex/skills/autoresearch/personas/root-cause.md +26 -0
- package/.cortex/skills/autoresearch/personas/security-auditor.md +29 -0
- package/.cortex/skills/autoresearch/personas/skeptic-reviewer.md +31 -0
- package/.cortex/skills/autoresearch/personas/test-first.md +25 -0
- package/.cortex/skills/best-of-n/SKILL.md +76 -0
- package/.cortex/skills/cortex/SKILL.md +834 -0
- package/.cortex/skills/cortex-bench/SKILL.md +354 -0
- package/.cortex/skills/docx/SKILL.md +83 -0
- package/.cortex/skills/pdf-documents/SKILL.md +297 -0
- package/.cortex/skills/pdf-documents/sections/01-image-acquisition.md +132 -0
- package/.cortex/skills/pdf-documents/sections/02-ai-image-generation.md +274 -0
- package/.cortex/skills/pdf-documents/sections/03-paper-sizes.md +89 -0
- package/.cortex/skills/pdf-documents/sections/04-design-system.md +549 -0
- package/.cortex/skills/pdf-documents/sections/05-css-print-rules.md +135 -0
- package/.cortex/skills/pdf-documents/sections/06-svg-charts.md +100 -0
- package/.cortex/skills/pdf-documents/sections/07-templates.md +224 -0
- package/.cortex/skills/pdf-documents/sections/08-scaled-output.md +164 -0
- package/.cortex/skills/pdf-documents/sections/09-preview-qa.md +66 -0
- package/.cortex/skills/pdf-documents/sections/10-reading-pdfs.md +499 -0
- package/.cortex/skills/pdf-documents/sections/11-form-filling.md +241 -0
- package/.cortex/skills/pptx/SKILL.md +90 -0
- package/.cortex/skills/resume-analyst/SKILL.md +373 -0
- package/.cortex/skills/verify-work/SKILL.md +74 -0
- package/.cortex/skills/xlsx/SKILL.md +101 -0
- package/.cortex/system-messages/messages/WORK_QUALITY.md +159 -0
- package/.cortex/system-messages/registry.json +18 -0
- package/LICENSE +202 -0
- package/NOTICE +2 -0
- package/README.md +13 -0
- package/bin/cortex.js +548 -0
- package/dist/agent-mode.d.ts +21 -0
- package/dist/agent-mode.d.ts.map +1 -0
- package/dist/agent-mode.js +511 -0
- package/dist/agent-mode.js.map +1 -0
- package/dist/client/CortexClient.d.ts +84 -0
- package/dist/client/CortexClient.d.ts.map +1 -0
- package/dist/client/CortexClient.js +163 -0
- package/dist/client/CortexClient.js.map +1 -0
- package/dist/commands/artifact/list.d.ts +15 -0
- package/dist/commands/artifact/list.d.ts.map +1 -0
- package/dist/commands/artifact/list.js +89 -0
- package/dist/commands/artifact/list.js.map +1 -0
- package/dist/commands/artifact/restart.d.ts +13 -0
- package/dist/commands/artifact/restart.d.ts.map +1 -0
- package/dist/commands/artifact/restart.js +56 -0
- package/dist/commands/artifact/restart.js.map +1 -0
- package/dist/commands/artifact/status.d.ts +13 -0
- package/dist/commands/artifact/status.d.ts.map +1 -0
- package/dist/commands/artifact/status.js +100 -0
- package/dist/commands/artifact/status.js.map +1 -0
- package/dist/commands/artifact/stop.d.ts +13 -0
- package/dist/commands/artifact/stop.d.ts.map +1 -0
- package/dist/commands/artifact/stop.js +50 -0
- package/dist/commands/artifact/stop.js.map +1 -0
- package/dist/commands/autoresearch/bench.d.ts +32 -0
- package/dist/commands/autoresearch/bench.d.ts.map +1 -0
- package/dist/commands/autoresearch/bench.js +123 -0
- package/dist/commands/autoresearch/bench.js.map +1 -0
- package/dist/commands/autoresearch/commandRunner.d.ts +35 -0
- package/dist/commands/autoresearch/commandRunner.d.ts.map +1 -0
- package/dist/commands/autoresearch/commandRunner.js +91 -0
- package/dist/commands/autoresearch/commandRunner.js.map +1 -0
- package/dist/commands/autoresearch/evaluate.d.ts +18 -0
- package/dist/commands/autoresearch/evaluate.d.ts.map +1 -0
- package/dist/commands/autoresearch/evaluate.js +117 -0
- package/dist/commands/autoresearch/evaluate.js.map +1 -0
- package/dist/commands/autoresearch/experiment.d.ts +38 -0
- package/dist/commands/autoresearch/experiment.d.ts.map +1 -0
- package/dist/commands/autoresearch/experiment.js +168 -0
- package/dist/commands/autoresearch/experiment.js.map +1 -0
- package/dist/commands/autoresearch/fix.d.ts +10 -0
- package/dist/commands/autoresearch/fix.d.ts.map +1 -0
- package/dist/commands/autoresearch/fix.js +86 -0
- package/dist/commands/autoresearch/fix.js.map +1 -0
- package/dist/commands/autoresearch/harnessProcess.d.ts +48 -0
- package/dist/commands/autoresearch/harnessProcess.d.ts.map +1 -0
- package/dist/commands/autoresearch/harnessProcess.js +140 -0
- package/dist/commands/autoresearch/harnessProcess.js.map +1 -0
- package/dist/commands/autoresearch/list.d.ts +6 -0
- package/dist/commands/autoresearch/list.d.ts.map +1 -0
- package/dist/commands/autoresearch/list.js +38 -0
- package/dist/commands/autoresearch/list.js.map +1 -0
- package/dist/commands/autoresearch/loop.d.ts +26 -0
- package/dist/commands/autoresearch/loop.d.ts.map +1 -0
- package/dist/commands/autoresearch/loop.js +242 -0
- package/dist/commands/autoresearch/loop.js.map +1 -0
- package/dist/commands/cache/metrics.d.ts +13 -0
- package/dist/commands/cache/metrics.d.ts.map +1 -0
- package/dist/commands/cache/metrics.js +77 -0
- package/dist/commands/cache/metrics.js.map +1 -0
- package/dist/commands/chat/AgenticChat.d.ts +39 -0
- package/dist/commands/chat/AgenticChat.d.ts.map +1 -0
- package/dist/commands/chat/AgenticChat.js +201 -0
- package/dist/commands/chat/AgenticChat.js.map +1 -0
- package/dist/commands/chat/renderers/CodeRenderer.d.ts +36 -0
- package/dist/commands/chat/renderers/CodeRenderer.d.ts.map +1 -0
- package/dist/commands/chat/renderers/CodeRenderer.js +85 -0
- package/dist/commands/chat/renderers/CodeRenderer.js.map +1 -0
- package/dist/commands/chat/renderers/ToolRenderer.d.ts +30 -0
- package/dist/commands/chat/renderers/ToolRenderer.d.ts.map +1 -0
- package/dist/commands/chat/renderers/ToolRenderer.js +93 -0
- package/dist/commands/chat/renderers/ToolRenderer.js.map +1 -0
- package/dist/commands/chat/single-message.d.ts +15 -0
- package/dist/commands/chat/single-message.d.ts.map +1 -0
- package/dist/commands/chat/single-message.js +85 -0
- package/dist/commands/chat/single-message.js.map +1 -0
- package/dist/commands/config/categories.d.ts +8 -0
- package/dist/commands/config/categories.d.ts.map +1 -0
- package/dist/commands/config/categories.js +75 -0
- package/dist/commands/config/categories.js.map +1 -0
- package/dist/commands/config/category.d.ts +8 -0
- package/dist/commands/config/category.d.ts.map +1 -0
- package/dist/commands/config/category.js +81 -0
- package/dist/commands/config/category.js.map +1 -0
- package/dist/commands/config/get.d.ts +9 -0
- package/dist/commands/config/get.d.ts.map +1 -0
- package/dist/commands/config/get.js +98 -0
- package/dist/commands/config/get.js.map +1 -0
- package/dist/commands/config/reset.d.ts +6 -0
- package/dist/commands/config/reset.d.ts.map +1 -0
- package/dist/commands/config/reset.js +68 -0
- package/dist/commands/config/reset.js.map +1 -0
- package/dist/commands/config/set.d.ts +6 -0
- package/dist/commands/config/set.d.ts.map +1 -0
- package/dist/commands/config/set.js +60 -0
- package/dist/commands/config/set.js.map +1 -0
- package/dist/commands/config/utils.d.ts +14 -0
- package/dist/commands/config/utils.d.ts.map +1 -0
- package/dist/commands/config/utils.js +54 -0
- package/dist/commands/config/utils.js.map +1 -0
- package/dist/commands/context/boundaries.d.ts +13 -0
- package/dist/commands/context/boundaries.d.ts.map +1 -0
- package/dist/commands/context/boundaries.js +45 -0
- package/dist/commands/context/boundaries.js.map +1 -0
- package/dist/commands/context/compact.d.ts +13 -0
- package/dist/commands/context/compact.d.ts.map +1 -0
- package/dist/commands/context/compact.js +41 -0
- package/dist/commands/context/compact.js.map +1 -0
- package/dist/commands/context/savings.d.ts +13 -0
- package/dist/commands/context/savings.d.ts.map +1 -0
- package/dist/commands/context/savings.js +49 -0
- package/dist/commands/context/savings.js.map +1 -0
- package/dist/commands/context/status.d.ts +13 -0
- package/dist/commands/context/status.d.ts.map +1 -0
- package/dist/commands/context/status.js +52 -0
- package/dist/commands/context/status.js.map +1 -0
- package/dist/commands/context/strategy.d.ts +13 -0
- package/dist/commands/context/strategy.d.ts.map +1 -0
- package/dist/commands/context/strategy.js +66 -0
- package/dist/commands/context/strategy.js.map +1 -0
- package/dist/commands/mcp/disable.d.ts +5 -0
- package/dist/commands/mcp/disable.d.ts.map +1 -0
- package/dist/commands/mcp/disable.js +26 -0
- package/dist/commands/mcp/disable.js.map +1 -0
- package/dist/commands/mcp/edit.d.ts +9 -0
- package/dist/commands/mcp/edit.d.ts.map +1 -0
- package/dist/commands/mcp/edit.js +62 -0
- package/dist/commands/mcp/edit.js.map +1 -0
- package/dist/commands/mcp/enable.d.ts +5 -0
- package/dist/commands/mcp/enable.d.ts.map +1 -0
- package/dist/commands/mcp/enable.js +27 -0
- package/dist/commands/mcp/enable.js.map +1 -0
- package/dist/commands/mcp/init.d.ts +9 -0
- package/dist/commands/mcp/init.d.ts.map +1 -0
- package/dist/commands/mcp/init.js +97 -0
- package/dist/commands/mcp/init.js.map +1 -0
- package/dist/commands/mcp/list.d.ts +6 -0
- package/dist/commands/mcp/list.d.ts.map +1 -0
- package/dist/commands/mcp/list.js +56 -0
- package/dist/commands/mcp/list.js.map +1 -0
- package/dist/commands/mcp/server.d.ts +6 -0
- package/dist/commands/mcp/server.d.ts.map +1 -0
- package/dist/commands/mcp/server.js +44 -0
- package/dist/commands/mcp/server.js.map +1 -0
- package/dist/commands/mcp/status.d.ts +6 -0
- package/dist/commands/mcp/status.d.ts.map +1 -0
- package/dist/commands/mcp/status.js +43 -0
- package/dist/commands/mcp/status.js.map +1 -0
- package/dist/commands/mcp/tools.d.ts +7 -0
- package/dist/commands/mcp/tools.d.ts.map +1 -0
- package/dist/commands/mcp/tools.js +82 -0
- package/dist/commands/mcp/tools.js.map +1 -0
- package/dist/commands/mcp/validate.d.ts +8 -0
- package/dist/commands/mcp/validate.d.ts.map +1 -0
- package/dist/commands/mcp/validate.js +121 -0
- package/dist/commands/mcp/validate.js.map +1 -0
- package/dist/commands/middleware/config.d.ts +13 -0
- package/dist/commands/middleware/config.d.ts.map +1 -0
- package/dist/commands/middleware/config.js +87 -0
- package/dist/commands/middleware/config.js.map +1 -0
- package/dist/commands/middleware/disable.d.ts +13 -0
- package/dist/commands/middleware/disable.d.ts.map +1 -0
- package/dist/commands/middleware/disable.js +50 -0
- package/dist/commands/middleware/disable.js.map +1 -0
- package/dist/commands/middleware/enable.d.ts +13 -0
- package/dist/commands/middleware/enable.d.ts.map +1 -0
- package/dist/commands/middleware/enable.js +50 -0
- package/dist/commands/middleware/enable.js.map +1 -0
- package/dist/commands/middleware/list.d.ts +13 -0
- package/dist/commands/middleware/list.d.ts.map +1 -0
- package/dist/commands/middleware/list.js +64 -0
- package/dist/commands/middleware/list.js.map +1 -0
- package/dist/commands/middleware/status.d.ts +13 -0
- package/dist/commands/middleware/status.d.ts.map +1 -0
- package/dist/commands/middleware/status.js +80 -0
- package/dist/commands/middleware/status.js.map +1 -0
- package/dist/commands/models/compare.d.ts +9 -0
- package/dist/commands/models/compare.d.ts.map +1 -0
- package/dist/commands/models/compare.js +76 -0
- package/dist/commands/models/compare.js.map +1 -0
- package/dist/commands/models/cost.d.ts +9 -0
- package/dist/commands/models/cost.d.ts.map +1 -0
- package/dist/commands/models/cost.js +64 -0
- package/dist/commands/models/cost.js.map +1 -0
- package/dist/commands/models/info.d.ts +9 -0
- package/dist/commands/models/info.d.ts.map +1 -0
- package/dist/commands/models/info.js +61 -0
- package/dist/commands/models/info.js.map +1 -0
- package/dist/commands/models/list.d.ts +6 -0
- package/dist/commands/models/list.d.ts.map +1 -0
- package/dist/commands/models/list.js +66 -0
- package/dist/commands/models/list.js.map +1 -0
- package/dist/commands/models/providers.d.ts +13 -0
- package/dist/commands/models/providers.d.ts.map +1 -0
- package/dist/commands/models/providers.js +45 -0
- package/dist/commands/models/providers.js.map +1 -0
- package/dist/commands/models/search.d.ts +10 -0
- package/dist/commands/models/search.d.ts.map +1 -0
- package/dist/commands/models/search.js +56 -0
- package/dist/commands/models/search.js.map +1 -0
- package/dist/commands/models/switch.d.ts +14 -0
- package/dist/commands/models/switch.d.ts.map +1 -0
- package/dist/commands/models/switch.js +67 -0
- package/dist/commands/models/switch.js.map +1 -0
- package/dist/commands/permissions/auto-approve.d.ts +13 -0
- package/dist/commands/permissions/auto-approve.d.ts.map +1 -0
- package/dist/commands/permissions/auto-approve.js +53 -0
- package/dist/commands/permissions/auto-approve.js.map +1 -0
- package/dist/commands/permissions/grant.d.ts +13 -0
- package/dist/commands/permissions/grant.d.ts.map +1 -0
- package/dist/commands/permissions/grant.js +46 -0
- package/dist/commands/permissions/grant.js.map +1 -0
- package/dist/commands/permissions/mode.d.ts +12 -0
- package/dist/commands/permissions/mode.d.ts.map +1 -0
- package/dist/commands/permissions/mode.js +61 -0
- package/dist/commands/permissions/mode.js.map +1 -0
- package/dist/commands/permissions/policies.d.ts +13 -0
- package/dist/commands/permissions/policies.d.ts.map +1 -0
- package/dist/commands/permissions/policies.js +47 -0
- package/dist/commands/permissions/policies.js.map +1 -0
- package/dist/commands/permissions/revoke.d.ts +13 -0
- package/dist/commands/permissions/revoke.d.ts.map +1 -0
- package/dist/commands/permissions/revoke.js +46 -0
- package/dist/commands/permissions/revoke.js.map +1 -0
- package/dist/commands/permissions/set.d.ts +13 -0
- package/dist/commands/permissions/set.d.ts.map +1 -0
- package/dist/commands/permissions/set.js +57 -0
- package/dist/commands/permissions/set.js.map +1 -0
- package/dist/commands/permissions/tools.d.ts +13 -0
- package/dist/commands/permissions/tools.d.ts.map +1 -0
- package/dist/commands/permissions/tools.js +50 -0
- package/dist/commands/permissions/tools.js.map +1 -0
- package/dist/commands/server/start.d.ts +11 -0
- package/dist/commands/server/start.d.ts.map +1 -0
- package/dist/commands/server/start.js +58 -0
- package/dist/commands/server/start.js.map +1 -0
- package/dist/commands/session/checkpoints.d.ts +6 -0
- package/dist/commands/session/checkpoints.d.ts.map +1 -0
- package/dist/commands/session/checkpoints.js +41 -0
- package/dist/commands/session/checkpoints.js.map +1 -0
- package/dist/commands/session/compact.d.ts +13 -0
- package/dist/commands/session/compact.d.ts.map +1 -0
- package/dist/commands/session/compact.js +56 -0
- package/dist/commands/session/compact.js.map +1 -0
- package/dist/commands/session/export.d.ts +6 -0
- package/dist/commands/session/export.d.ts.map +1 -0
- package/dist/commands/session/export.js +31 -0
- package/dist/commands/session/export.js.map +1 -0
- package/dist/commands/session/list.d.ts +7 -0
- package/dist/commands/session/list.d.ts.map +1 -0
- package/dist/commands/session/list.js +63 -0
- package/dist/commands/session/list.js.map +1 -0
- package/dist/commands/session/new.d.ts +8 -0
- package/dist/commands/session/new.d.ts.map +1 -0
- package/dist/commands/session/new.js +23 -0
- package/dist/commands/session/new.js.map +1 -0
- package/dist/commands/session/resume.d.ts +6 -0
- package/dist/commands/session/resume.d.ts.map +1 -0
- package/dist/commands/session/resume.js +32 -0
- package/dist/commands/session/resume.js.map +1 -0
- package/dist/commands/session/search.d.ts +10 -0
- package/dist/commands/session/search.d.ts.map +1 -0
- package/dist/commands/session/search.js +65 -0
- package/dist/commands/session/search.js.map +1 -0
- package/dist/commands/session/stats.d.ts +6 -0
- package/dist/commands/session/stats.d.ts.map +1 -0
- package/dist/commands/session/stats.js +58 -0
- package/dist/commands/session/stats.js.map +1 -0
- package/dist/commands/session/view.d.ts +6 -0
- package/dist/commands/session/view.d.ts.map +1 -0
- package/dist/commands/session/view.js +65 -0
- package/dist/commands/session/view.js.map +1 -0
- package/dist/commands/slash/CommandPalette.d.ts +60 -0
- package/dist/commands/slash/CommandPalette.d.ts.map +1 -0
- package/dist/commands/slash/CommandPalette.js +351 -0
- package/dist/commands/slash/CommandPalette.js.map +1 -0
- package/dist/commands/slash/SlashCommandParser.d.ts +11 -0
- package/dist/commands/slash/SlashCommandParser.d.ts.map +1 -0
- package/dist/commands/slash/SlashCommandParser.js +11 -0
- package/dist/commands/slash/SlashCommandParser.js.map +1 -0
- package/dist/commands/slash/SlashCommandRegistry.d.ts +11 -0
- package/dist/commands/slash/SlashCommandRegistry.d.ts.map +1 -0
- package/dist/commands/slash/SlashCommandRegistry.js +11 -0
- package/dist/commands/slash/SlashCommandRegistry.js.map +1 -0
- package/dist/commands/slash/index.d.ts +11 -0
- package/dist/commands/slash/index.d.ts.map +1 -0
- package/dist/commands/slash/index.js +13 -0
- package/dist/commands/slash/index.js.map +1 -0
- package/dist/commands/system-messages/list.d.ts +13 -0
- package/dist/commands/system-messages/list.d.ts.map +1 -0
- package/dist/commands/system-messages/list.js +54 -0
- package/dist/commands/system-messages/list.js.map +1 -0
- package/dist/commands/system-messages/reload.d.ts +13 -0
- package/dist/commands/system-messages/reload.d.ts.map +1 -0
- package/dist/commands/system-messages/reload.js +36 -0
- package/dist/commands/system-messages/reload.js.map +1 -0
- package/dist/commands/system-messages/view.d.ts +13 -0
- package/dist/commands/system-messages/view.d.ts.map +1 -0
- package/dist/commands/system-messages/view.js +52 -0
- package/dist/commands/system-messages/view.js.map +1 -0
- package/dist/commands/tmux/list.d.ts +13 -0
- package/dist/commands/tmux/list.d.ts.map +1 -0
- package/dist/commands/tmux/list.js +68 -0
- package/dist/commands/tmux/list.js.map +1 -0
- package/dist/commands/tools/info.d.ts +13 -0
- package/dist/commands/tools/info.d.ts.map +1 -0
- package/dist/commands/tools/info.js +82 -0
- package/dist/commands/tools/info.js.map +1 -0
- package/dist/commands/tools/list.d.ts +14 -0
- package/dist/commands/tools/list.d.ts.map +1 -0
- package/dist/commands/tools/list.js +67 -0
- package/dist/commands/tools/list.js.map +1 -0
- package/dist/config/ConfigManager.d.ts +40 -0
- package/dist/config/ConfigManager.d.ts.map +1 -0
- package/dist/config/ConfigManager.js +162 -0
- package/dist/config/ConfigManager.js.map +1 -0
- package/dist/config/extension.d.ts +12 -0
- package/dist/config/extension.d.ts.map +1 -0
- package/dist/config/extension.js +5 -0
- package/dist/config/extension.js.map +1 -0
- package/dist/config/settings.d.ts +42 -0
- package/dist/config/settings.d.ts.map +1 -0
- package/dist/config/settings.js +32 -0
- package/dist/config/settings.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +883 -0
- package/dist/index.js.map +1 -0
- package/dist/orchestrator/OrchestratorClient.d.ts +385 -0
- package/dist/orchestrator/OrchestratorClient.d.ts.map +1 -0
- package/dist/orchestrator/OrchestratorClient.js +1195 -0
- package/dist/orchestrator/OrchestratorClient.js.map +1 -0
- package/dist/themes/DefaultTheme.d.ts +9 -0
- package/dist/themes/DefaultTheme.d.ts.map +1 -0
- package/dist/themes/DefaultTheme.js +29 -0
- package/dist/themes/DefaultTheme.js.map +1 -0
- package/dist/themes/MinimalTheme.d.ts +9 -0
- package/dist/themes/MinimalTheme.d.ts.map +1 -0
- package/dist/themes/MinimalTheme.js +29 -0
- package/dist/themes/MinimalTheme.js.map +1 -0
- package/dist/themes/Theme.interface.d.ts +36 -0
- package/dist/themes/Theme.interface.d.ts.map +1 -0
- package/dist/themes/Theme.interface.js +5 -0
- package/dist/themes/Theme.interface.js.map +1 -0
- package/dist/themes/ThemeManager.d.ts +63 -0
- package/dist/themes/ThemeManager.d.ts.map +1 -0
- package/dist/themes/ThemeManager.js +257 -0
- package/dist/themes/ThemeManager.js.map +1 -0
- package/dist/themes/colors.d.ts +108 -0
- package/dist/themes/colors.d.ts.map +1 -0
- package/dist/themes/colors.js +284 -0
- package/dist/themes/colors.js.map +1 -0
- package/dist/themes/createTheme.d.ts +40 -0
- package/dist/themes/createTheme.d.ts.map +1 -0
- package/dist/themes/createTheme.js +114 -0
- package/dist/themes/createTheme.js.map +1 -0
- package/dist/themes/themeDefinitions.d.ts +27 -0
- package/dist/themes/themeDefinitions.d.ts.map +1 -0
- package/dist/themes/themeDefinitions.js +244 -0
- package/dist/themes/themeDefinitions.js.map +1 -0
- package/dist/utils/CodeDiffRenderer.d.ts +124 -0
- package/dist/utils/CodeDiffRenderer.d.ts.map +1 -0
- package/dist/utils/CodeDiffRenderer.js +257 -0
- package/dist/utils/CodeDiffRenderer.js.map +1 -0
- package/dist/utils/MarkdownRenderer.d.ts +74 -0
- package/dist/utils/MarkdownRenderer.d.ts.map +1 -0
- package/dist/utils/MarkdownRenderer.js +260 -0
- package/dist/utils/MarkdownRenderer.js.map +1 -0
- package/dist/utils/MessageRenderer.d.ts +200 -0
- package/dist/utils/MessageRenderer.d.ts.map +1 -0
- package/dist/utils/MessageRenderer.js +283 -0
- package/dist/utils/MessageRenderer.js.map +1 -0
- package/dist/utils/ToolFormatter.d.ts +103 -0
- package/dist/utils/ToolFormatter.d.ts.map +1 -0
- package/dist/utils/ToolFormatter.js +357 -0
- package/dist/utils/ToolFormatter.js.map +1 -0
- package/dist/utils/boxDrawing.d.ts +23 -0
- package/dist/utils/boxDrawing.d.ts.map +1 -0
- package/dist/utils/boxDrawing.js +78 -0
- package/dist/utils/boxDrawing.js.map +1 -0
- package/dist/utils/checks.d.ts +9 -0
- package/dist/utils/checks.d.ts.map +1 -0
- package/dist/utils/checks.js +11 -0
- package/dist/utils/checks.js.map +1 -0
- package/dist/utils/events.d.ts +24 -0
- package/dist/utils/events.d.ts.map +1 -0
- package/dist/utils/events.js +17 -0
- package/dist/utils/events.js.map +1 -0
- package/dist/utils/formatters.d.ts +255 -0
- package/dist/utils/formatters.d.ts.map +1 -0
- package/dist/utils/formatters.js +361 -0
- package/dist/utils/formatters.js.map +1 -0
- package/dist/utils/math.d.ts +11 -0
- package/dist/utils/math.d.ts.map +1 -0
- package/dist/utils/math.js +13 -0
- package/dist/utils/math.js.map +1 -0
- package/package.json +82 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,883 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Nexus Cortex CLI
|
|
4
|
+
* Main entry point
|
|
5
|
+
*/
|
|
6
|
+
import { Command } from 'commander';
|
|
7
|
+
import { listModels } from './commands/models/list.js';
|
|
8
|
+
import { modelInfo } from './commands/models/info.js';
|
|
9
|
+
import { modelsSearch } from './commands/models/search.js';
|
|
10
|
+
import { modelsCompare } from './commands/models/compare.js';
|
|
11
|
+
import { modelsCost } from './commands/models/cost.js';
|
|
12
|
+
import { modelsProviders } from './commands/models/providers.js';
|
|
13
|
+
import { modelSwitch } from './commands/models/switch.js';
|
|
14
|
+
// interactiveChat moved to @nexus-cortex/tui
|
|
15
|
+
import { sendSingleMessage } from './commands/chat/single-message.js';
|
|
16
|
+
import { serverStart } from './commands/server/start.js';
|
|
17
|
+
import { listSessions } from './commands/session/list.js';
|
|
18
|
+
import { viewSession } from './commands/session/view.js';
|
|
19
|
+
import { exportSession } from './commands/session/export.js';
|
|
20
|
+
import { resumeSession } from './commands/session/resume.js';
|
|
21
|
+
import { listCheckpoints } from './commands/session/checkpoints.js';
|
|
22
|
+
import { sessionStats } from './commands/session/stats.js';
|
|
23
|
+
import { sessionsSearch } from './commands/session/search.js';
|
|
24
|
+
import { listMcpServers } from './commands/mcp/list.js';
|
|
25
|
+
import { mcpStatus } from './commands/mcp/status.js';
|
|
26
|
+
import { mcpServer } from './commands/mcp/server.js';
|
|
27
|
+
import { mcpTools } from './commands/mcp/tools.js';
|
|
28
|
+
import { mcpEnable } from './commands/mcp/enable.js';
|
|
29
|
+
import { mcpDisable } from './commands/mcp/disable.js';
|
|
30
|
+
import { mcpInit } from './commands/mcp/init.js';
|
|
31
|
+
import { mcpValidate } from './commands/mcp/validate.js';
|
|
32
|
+
import { mcpEdit } from './commands/mcp/edit.js';
|
|
33
|
+
import { permissionsMode } from './commands/permissions/mode.js';
|
|
34
|
+
import { permissionsSet } from './commands/permissions/set.js';
|
|
35
|
+
import { permissionsAutoApprove } from './commands/permissions/auto-approve.js';
|
|
36
|
+
import { permissionsPolicies } from './commands/permissions/policies.js';
|
|
37
|
+
import { permissionsTools } from './commands/permissions/tools.js';
|
|
38
|
+
import { permissionsGrant } from './commands/permissions/grant.js';
|
|
39
|
+
import { permissionsRevoke } from './commands/permissions/revoke.js';
|
|
40
|
+
import { configGet } from './commands/config/get.js';
|
|
41
|
+
import { configSet } from './commands/config/set.js';
|
|
42
|
+
import { configCategories } from './commands/config/categories.js';
|
|
43
|
+
import { configCategory } from './commands/config/category.js';
|
|
44
|
+
import { configReset } from './commands/config/reset.js';
|
|
45
|
+
import { autoResearchEvaluate } from './commands/autoresearch/evaluate.js';
|
|
46
|
+
import { autoResearchList } from './commands/autoresearch/list.js';
|
|
47
|
+
import { autoResearchBench } from './commands/autoresearch/bench.js';
|
|
48
|
+
import { autoResearchExperiment } from './commands/autoresearch/experiment.js';
|
|
49
|
+
import { autoResearchFix } from './commands/autoresearch/fix.js';
|
|
50
|
+
import { autoResearchLoop } from './commands/autoresearch/loop.js';
|
|
51
|
+
import { tmuxList } from './commands/tmux/list.js';
|
|
52
|
+
import { middlewareList } from './commands/middleware/list.js';
|
|
53
|
+
import { middlewareStatus } from './commands/middleware/status.js';
|
|
54
|
+
import { middlewareEnable } from './commands/middleware/enable.js';
|
|
55
|
+
import { middlewareDisable } from './commands/middleware/disable.js';
|
|
56
|
+
import { middlewareConfig } from './commands/middleware/config.js';
|
|
57
|
+
import { artifactList } from './commands/artifact/list.js';
|
|
58
|
+
import { artifactStop } from './commands/artifact/stop.js';
|
|
59
|
+
import { artifactRestart } from './commands/artifact/restart.js';
|
|
60
|
+
import { artifactStatus } from './commands/artifact/status.js';
|
|
61
|
+
import { sessionCompact } from './commands/session/compact.js';
|
|
62
|
+
import { contextStatus } from './commands/context/status.js';
|
|
63
|
+
import { contextCompact } from './commands/context/compact.js';
|
|
64
|
+
import { contextBoundaries } from './commands/context/boundaries.js';
|
|
65
|
+
import { contextStrategy } from './commands/context/strategy.js';
|
|
66
|
+
import { contextSavings } from './commands/context/savings.js';
|
|
67
|
+
import { toolsList } from './commands/tools/list.js';
|
|
68
|
+
import { toolsInfo } from './commands/tools/info.js';
|
|
69
|
+
import { cacheMetrics } from './commands/cache/metrics.js';
|
|
70
|
+
import { systemMessagesList } from './commands/system-messages/list.js';
|
|
71
|
+
import { systemMessagesView } from './commands/system-messages/view.js';
|
|
72
|
+
import { systemMessagesReload } from './commands/system-messages/reload.js';
|
|
73
|
+
import chalk from 'chalk';
|
|
74
|
+
const program = new Command();
|
|
75
|
+
program
|
|
76
|
+
.name('cortex')
|
|
77
|
+
.description('Nexus Cortex - Multi-provider LLM CLI')
|
|
78
|
+
.version('4.0.0');
|
|
79
|
+
// Global options
|
|
80
|
+
program
|
|
81
|
+
.option('--server <url>', 'Server URL', 'http://localhost:4000')
|
|
82
|
+
.option('--debug', 'Enable debug logging')
|
|
83
|
+
.option('--json', 'Output JSON format')
|
|
84
|
+
.option('--no-color', 'Disable colored output');
|
|
85
|
+
// Interactive chat (the `chat` default command) lives in @nexus-cortex/tui now.
|
|
86
|
+
// Headless cli: use `message` for one-shot, or the `cortex` HTTP client / `neoncortex` TUI.
|
|
87
|
+
// Message command — send a single message and exit
|
|
88
|
+
program
|
|
89
|
+
.command('message <prompt>')
|
|
90
|
+
.description('Send a single message and exit')
|
|
91
|
+
.option('-m, --model <id>', 'Model ID to use')
|
|
92
|
+
.option('--system <message>', 'System message')
|
|
93
|
+
.option('--max-tokens <number>', 'Maximum tokens', parseInt)
|
|
94
|
+
.option('--json', 'Output full JSON response')
|
|
95
|
+
.action(async (prompt, options) => {
|
|
96
|
+
const globalOpts = program.opts();
|
|
97
|
+
await sendSingleMessage(prompt, {
|
|
98
|
+
serverUrl: globalOpts.server,
|
|
99
|
+
model: options.model,
|
|
100
|
+
system: options.system,
|
|
101
|
+
maxTokens: options.maxTokens,
|
|
102
|
+
json: options.json || globalOpts.json,
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
// Models commands
|
|
106
|
+
const models = program.command('models').description('Model management');
|
|
107
|
+
models
|
|
108
|
+
.command('list')
|
|
109
|
+
.description('List all available models')
|
|
110
|
+
.option('--provider <name>', 'Filter by provider')
|
|
111
|
+
.action(async (options) => {
|
|
112
|
+
const globalOpts = program.opts();
|
|
113
|
+
await listModels({
|
|
114
|
+
serverUrl: globalOpts.server,
|
|
115
|
+
provider: options.provider,
|
|
116
|
+
json: globalOpts.json,
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
models
|
|
120
|
+
.command('info <id>')
|
|
121
|
+
.description('Show detailed model information')
|
|
122
|
+
.action(async (id) => {
|
|
123
|
+
const globalOpts = program.opts();
|
|
124
|
+
await modelInfo(id, {
|
|
125
|
+
serverUrl: globalOpts.server,
|
|
126
|
+
json: globalOpts.json,
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
models
|
|
130
|
+
.command('search <query>')
|
|
131
|
+
.description('Search models by keyword')
|
|
132
|
+
.option('--provider <name>', 'Filter by provider')
|
|
133
|
+
.action(async (query, options) => {
|
|
134
|
+
const globalOpts = program.opts();
|
|
135
|
+
await modelsSearch(query, {
|
|
136
|
+
serverUrl: globalOpts.server,
|
|
137
|
+
provider: options.provider,
|
|
138
|
+
json: globalOpts.json,
|
|
139
|
+
});
|
|
140
|
+
});
|
|
141
|
+
models
|
|
142
|
+
.command('compare <model1> <model2>')
|
|
143
|
+
.description('Compare two models side-by-side')
|
|
144
|
+
.action(async (model1, model2) => {
|
|
145
|
+
const globalOpts = program.opts();
|
|
146
|
+
await modelsCompare(model1, model2, {
|
|
147
|
+
serverUrl: globalOpts.server,
|
|
148
|
+
json: globalOpts.json,
|
|
149
|
+
});
|
|
150
|
+
});
|
|
151
|
+
models
|
|
152
|
+
.command('cost <id>')
|
|
153
|
+
.description('Show pricing details for a model')
|
|
154
|
+
.action(async (id) => {
|
|
155
|
+
const globalOpts = program.opts();
|
|
156
|
+
await modelsCost(id, {
|
|
157
|
+
serverUrl: globalOpts.server,
|
|
158
|
+
json: globalOpts.json,
|
|
159
|
+
});
|
|
160
|
+
});
|
|
161
|
+
models
|
|
162
|
+
.command('providers')
|
|
163
|
+
.description('List all providers')
|
|
164
|
+
.action(async () => {
|
|
165
|
+
const globalOpts = program.opts();
|
|
166
|
+
await modelsProviders({
|
|
167
|
+
serverUrl: globalOpts.server,
|
|
168
|
+
json: globalOpts.json,
|
|
169
|
+
});
|
|
170
|
+
});
|
|
171
|
+
models
|
|
172
|
+
.command('switch <session-id> <model-id>')
|
|
173
|
+
.description('Switch model for a session')
|
|
174
|
+
.option('--reason <text>', 'Reason for model switch')
|
|
175
|
+
.action(async (sessionId, modelId, options) => {
|
|
176
|
+
const globalOpts = program.opts();
|
|
177
|
+
await modelSwitch(sessionId, modelId, {
|
|
178
|
+
serverUrl: globalOpts.server,
|
|
179
|
+
json: globalOpts.json,
|
|
180
|
+
reason: options.reason,
|
|
181
|
+
});
|
|
182
|
+
});
|
|
183
|
+
// Server commands
|
|
184
|
+
const server = program.command('server').description('Server management');
|
|
185
|
+
server
|
|
186
|
+
.command('status')
|
|
187
|
+
.description('Check server status')
|
|
188
|
+
.action(async () => {
|
|
189
|
+
const globalOpts = program.opts();
|
|
190
|
+
const { CortexClient } = await import('./client/CortexClient.js');
|
|
191
|
+
const client = new CortexClient(globalOpts.server);
|
|
192
|
+
try {
|
|
193
|
+
const health = await client.health();
|
|
194
|
+
console.log(chalk.green('✓ Server is running'));
|
|
195
|
+
console.log(chalk.gray(JSON.stringify(health, null, 2)));
|
|
196
|
+
}
|
|
197
|
+
catch (error) {
|
|
198
|
+
console.error(chalk.red('✗ Server is not responding'));
|
|
199
|
+
console.error(chalk.gray(error.message));
|
|
200
|
+
process.exit(1);
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
server
|
|
204
|
+
.command('start')
|
|
205
|
+
.description('Start server (if not running)')
|
|
206
|
+
.option('-p, --port <number>', 'Server port', parseInt)
|
|
207
|
+
.option('-d, --detach', 'Run in background')
|
|
208
|
+
.action(async (options) => {
|
|
209
|
+
const globalOpts = program.opts();
|
|
210
|
+
await serverStart({
|
|
211
|
+
serverUrl: globalOpts.server,
|
|
212
|
+
port: options.port,
|
|
213
|
+
detach: options.detach,
|
|
214
|
+
});
|
|
215
|
+
});
|
|
216
|
+
// Session commands
|
|
217
|
+
const sessions = program.command('sessions').description('Session management');
|
|
218
|
+
sessions
|
|
219
|
+
.command('list')
|
|
220
|
+
.description('List all sessions')
|
|
221
|
+
.option('--limit <number>', 'Limit number of sessions', parseInt)
|
|
222
|
+
.action(async (options) => {
|
|
223
|
+
const globalOpts = program.opts();
|
|
224
|
+
await listSessions({
|
|
225
|
+
serverUrl: globalOpts.server,
|
|
226
|
+
json: globalOpts.json,
|
|
227
|
+
limit: options.limit,
|
|
228
|
+
});
|
|
229
|
+
});
|
|
230
|
+
sessions
|
|
231
|
+
.command('view <id>')
|
|
232
|
+
.description('View session details')
|
|
233
|
+
.action(async (id) => {
|
|
234
|
+
const globalOpts = program.opts();
|
|
235
|
+
await viewSession(id, {
|
|
236
|
+
serverUrl: globalOpts.server,
|
|
237
|
+
json: globalOpts.json,
|
|
238
|
+
});
|
|
239
|
+
});
|
|
240
|
+
sessions
|
|
241
|
+
.command('export <id>')
|
|
242
|
+
.description('Export session to JSON')
|
|
243
|
+
.option('-o, --output <file>', 'Output file')
|
|
244
|
+
.action(async (id, options) => {
|
|
245
|
+
const globalOpts = program.opts();
|
|
246
|
+
await exportSession(id, {
|
|
247
|
+
serverUrl: globalOpts.server,
|
|
248
|
+
output: options.output,
|
|
249
|
+
});
|
|
250
|
+
});
|
|
251
|
+
sessions
|
|
252
|
+
.command('resume <id>')
|
|
253
|
+
.description('Resume from a checkpoint')
|
|
254
|
+
.option('--checkpoint-id <id>', 'Checkpoint ID to resume from')
|
|
255
|
+
.action(async (id, options) => {
|
|
256
|
+
const globalOpts = program.opts();
|
|
257
|
+
await resumeSession(id, {
|
|
258
|
+
serverUrl: globalOpts.server,
|
|
259
|
+
checkpointId: options.checkpointId,
|
|
260
|
+
});
|
|
261
|
+
});
|
|
262
|
+
sessions
|
|
263
|
+
.command('checkpoints <id>')
|
|
264
|
+
.description('List session checkpoints')
|
|
265
|
+
.action(async (id) => {
|
|
266
|
+
const globalOpts = program.opts();
|
|
267
|
+
await listCheckpoints(id, {
|
|
268
|
+
serverUrl: globalOpts.server,
|
|
269
|
+
json: globalOpts.json,
|
|
270
|
+
});
|
|
271
|
+
});
|
|
272
|
+
sessions
|
|
273
|
+
.command('stats <id>')
|
|
274
|
+
.description('Show session statistics')
|
|
275
|
+
.action(async (id) => {
|
|
276
|
+
const globalOpts = program.opts();
|
|
277
|
+
await sessionStats(id, {
|
|
278
|
+
serverUrl: globalOpts.server,
|
|
279
|
+
json: globalOpts.json,
|
|
280
|
+
});
|
|
281
|
+
});
|
|
282
|
+
sessions
|
|
283
|
+
.command('search <query>')
|
|
284
|
+
.description('Search sessions by keyword')
|
|
285
|
+
.option('--limit <number>', 'Limit number of results', parseInt)
|
|
286
|
+
.action(async (query, options) => {
|
|
287
|
+
const globalOpts = program.opts();
|
|
288
|
+
await sessionsSearch(query, {
|
|
289
|
+
serverUrl: globalOpts.server,
|
|
290
|
+
limit: options.limit,
|
|
291
|
+
json: globalOpts.json,
|
|
292
|
+
});
|
|
293
|
+
});
|
|
294
|
+
// MCP commands
|
|
295
|
+
const mcp = program.command('mcp').description('MCP server management');
|
|
296
|
+
mcp
|
|
297
|
+
.command('list')
|
|
298
|
+
.description('List all MCP servers')
|
|
299
|
+
.action(async () => {
|
|
300
|
+
const globalOpts = program.opts();
|
|
301
|
+
await listMcpServers({
|
|
302
|
+
serverUrl: globalOpts.server,
|
|
303
|
+
json: globalOpts.json,
|
|
304
|
+
});
|
|
305
|
+
});
|
|
306
|
+
mcp
|
|
307
|
+
.command('status')
|
|
308
|
+
.description('Show overall MCP status')
|
|
309
|
+
.action(async () => {
|
|
310
|
+
const globalOpts = program.opts();
|
|
311
|
+
await mcpStatus({
|
|
312
|
+
serverUrl: globalOpts.server,
|
|
313
|
+
json: globalOpts.json,
|
|
314
|
+
});
|
|
315
|
+
});
|
|
316
|
+
mcp
|
|
317
|
+
.command('server <name>')
|
|
318
|
+
.description('Show specific MCP server details')
|
|
319
|
+
.action(async (name) => {
|
|
320
|
+
const globalOpts = program.opts();
|
|
321
|
+
await mcpServer(name, {
|
|
322
|
+
serverUrl: globalOpts.server,
|
|
323
|
+
json: globalOpts.json,
|
|
324
|
+
});
|
|
325
|
+
});
|
|
326
|
+
mcp
|
|
327
|
+
.command('tools [server]')
|
|
328
|
+
.description('List MCP tools (from specific server or all)')
|
|
329
|
+
.option('--all', 'Show all MCP tools across all servers')
|
|
330
|
+
.action(async (server, cmdOptions) => {
|
|
331
|
+
const globalOpts = program.opts();
|
|
332
|
+
await mcpTools(server, {
|
|
333
|
+
serverUrl: globalOpts.server,
|
|
334
|
+
json: globalOpts.json,
|
|
335
|
+
all: cmdOptions.all,
|
|
336
|
+
});
|
|
337
|
+
});
|
|
338
|
+
mcp
|
|
339
|
+
.command('enable <name>')
|
|
340
|
+
.description('Enable an MCP server')
|
|
341
|
+
.action(async (name) => {
|
|
342
|
+
const globalOpts = program.opts();
|
|
343
|
+
await mcpEnable(name, {
|
|
344
|
+
serverUrl: globalOpts.server,
|
|
345
|
+
});
|
|
346
|
+
});
|
|
347
|
+
mcp
|
|
348
|
+
.command('disable <name>')
|
|
349
|
+
.description('Disable an MCP server')
|
|
350
|
+
.action(async (name) => {
|
|
351
|
+
const globalOpts = program.opts();
|
|
352
|
+
await mcpDisable(name, {
|
|
353
|
+
serverUrl: globalOpts.server,
|
|
354
|
+
});
|
|
355
|
+
});
|
|
356
|
+
mcp
|
|
357
|
+
.command('init')
|
|
358
|
+
.description('Initialize MCP configuration for project')
|
|
359
|
+
.option('--force', 'Overwrite existing configuration')
|
|
360
|
+
.option('--template <name>', 'Use configuration template')
|
|
361
|
+
.action(async (options) => {
|
|
362
|
+
await mcpInit({
|
|
363
|
+
force: options.force,
|
|
364
|
+
template: options.template,
|
|
365
|
+
});
|
|
366
|
+
});
|
|
367
|
+
mcp
|
|
368
|
+
.command('validate')
|
|
369
|
+
.description('Validate MCP_CONFIG.md syntax')
|
|
370
|
+
.option('--file <path>', 'Path to config file')
|
|
371
|
+
.action(async (options) => {
|
|
372
|
+
await mcpValidate({
|
|
373
|
+
file: options.file,
|
|
374
|
+
});
|
|
375
|
+
});
|
|
376
|
+
mcp
|
|
377
|
+
.command('edit')
|
|
378
|
+
.description('Edit MCP_CONFIG.md in editor')
|
|
379
|
+
.option('--file <path>', 'Path to config file')
|
|
380
|
+
.option('--editor <name>', 'Editor to use')
|
|
381
|
+
.action(async (options) => {
|
|
382
|
+
await mcpEdit({
|
|
383
|
+
file: options.file,
|
|
384
|
+
editor: options.editor,
|
|
385
|
+
});
|
|
386
|
+
});
|
|
387
|
+
// Permissions commands
|
|
388
|
+
const permissions = program.command('permissions').description('Permission management');
|
|
389
|
+
permissions
|
|
390
|
+
.command('mode')
|
|
391
|
+
.description('Show current permission mode')
|
|
392
|
+
.action(async () => {
|
|
393
|
+
const globalOpts = program.opts();
|
|
394
|
+
await permissionsMode({
|
|
395
|
+
serverUrl: globalOpts.server,
|
|
396
|
+
json: globalOpts.json,
|
|
397
|
+
});
|
|
398
|
+
});
|
|
399
|
+
permissions
|
|
400
|
+
.command('set <mode>')
|
|
401
|
+
.description('Set permission mode (interactive/auto/disabled)')
|
|
402
|
+
.action(async (mode) => {
|
|
403
|
+
const globalOpts = program.opts();
|
|
404
|
+
await permissionsSet(mode, {
|
|
405
|
+
serverUrl: globalOpts.server,
|
|
406
|
+
});
|
|
407
|
+
});
|
|
408
|
+
permissions
|
|
409
|
+
.command('auto-approve')
|
|
410
|
+
.description('Toggle auto-approve actions')
|
|
411
|
+
.option('--enable', 'Enable auto-approve')
|
|
412
|
+
.option('--disable', 'Disable auto-approve')
|
|
413
|
+
.action(async (options) => {
|
|
414
|
+
const globalOpts = program.opts();
|
|
415
|
+
await permissionsAutoApprove({
|
|
416
|
+
serverUrl: globalOpts.server,
|
|
417
|
+
enable: options.enable,
|
|
418
|
+
disable: options.disable,
|
|
419
|
+
});
|
|
420
|
+
});
|
|
421
|
+
permissions
|
|
422
|
+
.command('policies')
|
|
423
|
+
.description('List active policies')
|
|
424
|
+
.action(async () => {
|
|
425
|
+
const globalOpts = program.opts();
|
|
426
|
+
await permissionsPolicies({
|
|
427
|
+
serverUrl: globalOpts.server,
|
|
428
|
+
json: globalOpts.json,
|
|
429
|
+
});
|
|
430
|
+
});
|
|
431
|
+
permissions
|
|
432
|
+
.command('tools')
|
|
433
|
+
.description('List all tool permissions')
|
|
434
|
+
.action(async () => {
|
|
435
|
+
const globalOpts = program.opts();
|
|
436
|
+
await permissionsTools({
|
|
437
|
+
serverUrl: globalOpts.server,
|
|
438
|
+
json: globalOpts.json,
|
|
439
|
+
});
|
|
440
|
+
});
|
|
441
|
+
permissions
|
|
442
|
+
.command('grant <tool>')
|
|
443
|
+
.description('Grant permission for a tool')
|
|
444
|
+
.action(async (tool) => {
|
|
445
|
+
const globalOpts = program.opts();
|
|
446
|
+
await permissionsGrant(tool, {
|
|
447
|
+
serverUrl: globalOpts.server,
|
|
448
|
+
json: globalOpts.json,
|
|
449
|
+
});
|
|
450
|
+
});
|
|
451
|
+
permissions
|
|
452
|
+
.command('revoke <tool>')
|
|
453
|
+
.description('Revoke permission for a tool')
|
|
454
|
+
.action(async (tool) => {
|
|
455
|
+
const globalOpts = program.opts();
|
|
456
|
+
await permissionsRevoke(tool, {
|
|
457
|
+
serverUrl: globalOpts.server,
|
|
458
|
+
json: globalOpts.json,
|
|
459
|
+
});
|
|
460
|
+
});
|
|
461
|
+
// Config commands
|
|
462
|
+
const config = program.command('config').description('Configuration management');
|
|
463
|
+
config
|
|
464
|
+
.command('get [key]')
|
|
465
|
+
.description('Get configuration value(s)')
|
|
466
|
+
.action(async (key) => {
|
|
467
|
+
const globalOpts = program.opts();
|
|
468
|
+
await configGet(key, {
|
|
469
|
+
json: globalOpts.json,
|
|
470
|
+
});
|
|
471
|
+
});
|
|
472
|
+
config
|
|
473
|
+
.command('set <key> <value>')
|
|
474
|
+
.description('Set configuration value')
|
|
475
|
+
.action(async (key, value) => {
|
|
476
|
+
await configSet(key, value);
|
|
477
|
+
});
|
|
478
|
+
config
|
|
479
|
+
.command('categories')
|
|
480
|
+
.description('List configuration categories')
|
|
481
|
+
.action(async () => {
|
|
482
|
+
const globalOpts = program.opts();
|
|
483
|
+
await configCategories({
|
|
484
|
+
json: globalOpts.json,
|
|
485
|
+
});
|
|
486
|
+
});
|
|
487
|
+
config
|
|
488
|
+
.command('category <name>')
|
|
489
|
+
.description('Show category settings')
|
|
490
|
+
.action(async (name) => {
|
|
491
|
+
const globalOpts = program.opts();
|
|
492
|
+
await configCategory(name, {
|
|
493
|
+
json: globalOpts.json,
|
|
494
|
+
});
|
|
495
|
+
});
|
|
496
|
+
config
|
|
497
|
+
.command('reset')
|
|
498
|
+
.description('Reset all settings to benchmark-proven optimal defaults (preserves API keys)')
|
|
499
|
+
.option('--include-keys', 'Also reset API keys to empty')
|
|
500
|
+
.action(async (opts) => {
|
|
501
|
+
await configReset({
|
|
502
|
+
includeKeys: opts.includeKeys,
|
|
503
|
+
});
|
|
504
|
+
});
|
|
505
|
+
// Auto-research keep/discard gate (recursive self-improvement decision layer)
|
|
506
|
+
const autoresearch = program
|
|
507
|
+
.command('autoresearch')
|
|
508
|
+
.description('Auto-research keep/discard decision gate (Monte-Carlo, FWER-adjusted)');
|
|
509
|
+
autoresearch
|
|
510
|
+
.command('evaluate')
|
|
511
|
+
.description('Run the keep/discard gate over recorded base/candidate runs → writes .cortex/experiments.jsonl')
|
|
512
|
+
.requiredOption('--experiment-tag <tag>', 'experiment / swarm-member id')
|
|
513
|
+
.requiredOption('--base <ref>', 'base harness ref (control)')
|
|
514
|
+
.requiredOption('--candidate <ref>', 'candidate harness ref (under test)')
|
|
515
|
+
.requiredOption('--branch <branch>', 'worktree branch the experiment runs on')
|
|
516
|
+
.option('--deficiency-id <id>', 'ResearchBacklog deficiency this experiment addresses')
|
|
517
|
+
.option('--benchmark-source <src>', "which benchmark lens (cortex-bench | swebench | …)")
|
|
518
|
+
.option('--model-id <id>', 'restrict comparison to one model (default: all pooled)')
|
|
519
|
+
.option('--n-family <n>', 'parallel experiments in the family (FWER N)', '1')
|
|
520
|
+
.option('--alpha <a>', 'family-wise significance level', '0.05')
|
|
521
|
+
.option('--seed <s>', 'PRNG seed for reproducible verdict')
|
|
522
|
+
.option('--epsilon <e>', 'regression dead-band on the 0-100 scale')
|
|
523
|
+
.option('--min-runs <n>', 'minimum runs per arm for a task to count')
|
|
524
|
+
.option('--verify-holdout', 'also run the held-out gate (merge needs both)')
|
|
525
|
+
.action(async (opts) => {
|
|
526
|
+
const globalOpts = program.opts();
|
|
527
|
+
await autoResearchEvaluate({ ...opts, json: globalOpts.json });
|
|
528
|
+
});
|
|
529
|
+
autoresearch
|
|
530
|
+
.command('fix')
|
|
531
|
+
.description('Headless autonomous coding-agent edit of a worktree (Edit/Write/Bash, no approval) — edits, does NOT commit')
|
|
532
|
+
.requiredOption('--cwd <path>', 'worktree to edit (the candidate checkout)')
|
|
533
|
+
.option('--prompt <text>', 'fix instruction (deficiency description + repro + strategy; NO task sets)')
|
|
534
|
+
.option('--prompt-file <path>', 'read the fix instruction from a file')
|
|
535
|
+
.option('--model <id>', 'coding model (default: DEFAULT_MODEL_ID)')
|
|
536
|
+
.option('--max-iterations <n>', 'max tool iterations')
|
|
537
|
+
.action(async (opts) => {
|
|
538
|
+
const globalOpts = program.opts();
|
|
539
|
+
await autoResearchFix({ ...opts, json: globalOpts.json });
|
|
540
|
+
});
|
|
541
|
+
autoresearch
|
|
542
|
+
.command('experiment')
|
|
543
|
+
.description('Full single experiment: build+serve base & candidate → bench both arms (train+holdout) → gate → verdict + JSONL artifact')
|
|
544
|
+
.requiredOption('--experiment-tag <tag>', 'experiment / swarm-member id')
|
|
545
|
+
.requiredOption('--candidate-dir <path>', 'checkout/worktree with the candidate fix (gets built + served)')
|
|
546
|
+
.requiredOption('--task-set <path>', 'TRAIN task-set JSON file or dir (drives keep/discard)')
|
|
547
|
+
.option('--base-dir <path>', 'base checkout (default: project root; assumed prebuilt unless --build-base)')
|
|
548
|
+
.option('--holdout-set <path>', 'HOLDOUT task-set (separate file; required for a mergeable verdict)')
|
|
549
|
+
.option('--branch <name>', 'branch label for the ledger record (default: candidate ref)')
|
|
550
|
+
.option('--n-family <n>', 'parallel experiments this round (FWER width)', '1')
|
|
551
|
+
.option('--runs <n>', 'runs per task per arm', '2')
|
|
552
|
+
.option('--model <id>', 'model both arms use (default: DEFAULT_MODEL_ID)')
|
|
553
|
+
.option('--temperature <n>', 'dispatch temperature recorded on both arms (effectiveness layer; else inherits CORTEX_SUBAGENT_TEMPERATURE)')
|
|
554
|
+
.option('--strategy <label>', 'arm persona/strategy label recorded on both arms (effectiveness layer; else inherits CORTEX_ARM_STRATEGY)')
|
|
555
|
+
.option('--deficiency-id <id>', 'ResearchBacklog deficiency this addresses')
|
|
556
|
+
.option('--benchmark-source <src>', 'benchmark source label')
|
|
557
|
+
.option('--base-ref <ref>', 'override base harness label (default: git short SHA of base-dir)')
|
|
558
|
+
.option('--candidate-ref <ref>', 'override candidate harness label (default: git short SHA of candidate-dir)')
|
|
559
|
+
.option('--build-base', 'also run npm build in base-dir (default: assume prebuilt)')
|
|
560
|
+
.option('--no-build', 'skip the candidate build (config/env experiments where code is unchanged)')
|
|
561
|
+
.option('--base-port <n>', 'base server port (default: auto free port)')
|
|
562
|
+
.option('--candidate-port <n>', 'candidate server port (default: auto free port)')
|
|
563
|
+
.option('--cortex-dir <path>', 'shared .cortex store + JSONL artifact dir (default: project root)')
|
|
564
|
+
.option('--seed <s>', 'PRNG seed for reproducible verdict')
|
|
565
|
+
.option('--alpha <a>', 'family-wise significance level')
|
|
566
|
+
.option('--epsilon <e>', 'regression dead-band (0-100)')
|
|
567
|
+
.option('--min-runs <n>', 'min runs per arm for a task to count')
|
|
568
|
+
.option('--run-cmd <template>', 'NON-CORTEX target: grade a shell command per task in each arm dir ({prompt}/{case} substituted) instead of building+serving a cortex server')
|
|
569
|
+
.option('--build-cmd <cmd>', 'build command run in each arm dir before benching a --run-cmd target (subject to --build-base/--no-build)')
|
|
570
|
+
.option('--accept-exit <codes>', 'comma list of exit codes whose stdout is graded (default 0)', '0')
|
|
571
|
+
.action(async (opts) => {
|
|
572
|
+
const globalOpts = program.opts();
|
|
573
|
+
await autoResearchExperiment({ ...opts, json: globalOpts.json });
|
|
574
|
+
});
|
|
575
|
+
autoresearch
|
|
576
|
+
.command('bench')
|
|
577
|
+
.description('Run + grade a task set through the harness → writes REAL scored records to router-matrix.jsonl')
|
|
578
|
+
.requiredOption('--task-set <path>', 'task-set JSON file or directory of *.json (prompt + verifier per task)')
|
|
579
|
+
.requiredOption('--experiment-tag <tag>', 'experiment / swarm-member id')
|
|
580
|
+
.option('--runs <n>', 'runs per task (>=2 for significance)', '2')
|
|
581
|
+
.option('--split <split>', "train | holdout (holdout is the overfitting-proof verifier set)", 'train')
|
|
582
|
+
.option('--model <id>', 'model to bench (default: DEFAULT_MODEL_ID)')
|
|
583
|
+
.option('--temperature <n>', 'dispatch temperature recorded with each run (effectiveness layer; else inherits CORTEX_SUBAGENT_TEMPERATURE)')
|
|
584
|
+
.option('--strategy <label>', 'arm persona/strategy label recorded with each run (effectiveness layer; else inherits CORTEX_ARM_STRATEGY)')
|
|
585
|
+
.option('--harness-ref <ref>', 'override the auto-stamped git SHA (single-box base/candidate sim)')
|
|
586
|
+
.option('--benchmark-source <src>', 'benchmark source label (default: cortex-bench)')
|
|
587
|
+
.option('--server-url <url>', 'cortex server URL (default: $CORTEX_SERVER_URL or http://localhost:4000)')
|
|
588
|
+
.option('--run-cmd <template>', 'NON-CORTEX target: grade a shell command per task ({prompt}/{case} substituted) instead of a cortex server — pair with numeric verifiers')
|
|
589
|
+
.option('--build-cmd <cmd>', 'one-shot build, run once in --cwd before benching a --run-cmd target')
|
|
590
|
+
.option('--cwd <dir>', 'working dir for --run-cmd/--build-cmd (default: project root)')
|
|
591
|
+
.option('--accept-exit <codes>', 'comma list of exit codes whose stdout is graded (default 0)', '0')
|
|
592
|
+
.option('--no-seed-backlog', 'do not auto-seed a deficiency for each failing task (use for candidate-worktree benches)')
|
|
593
|
+
.action(async (opts) => {
|
|
594
|
+
const globalOpts = program.opts();
|
|
595
|
+
await autoResearchBench({ ...opts, json: globalOpts.json });
|
|
596
|
+
});
|
|
597
|
+
autoresearch
|
|
598
|
+
.command('loop')
|
|
599
|
+
.description('Autonomous loop: fix → measure → keep-if-verified → advance → repeat, on an isolated loop branch')
|
|
600
|
+
.requiredOption('--repo <path>', 'git repo to improve (worktrees are made off a dedicated loop branch; your branch is untouched)')
|
|
601
|
+
.requiredOption('--task-set <path>', 'train task-set JSON file or directory')
|
|
602
|
+
.option('--holdout-set <path>', 'holdout task-set — REQUIRED for verified merges (else accepts on train-only, unverified)')
|
|
603
|
+
.option('--prompt <goal>', 'fixed improvement directive each round (default: pull the highest-priority backlog deficiency)')
|
|
604
|
+
.option('--fixer-cmd <cmd>', 'run THIS in the candidate worktree as the mutation step ({prompt} substituted) instead of the LLM Fixer')
|
|
605
|
+
.option('--run-cmd <template>', 'non-cortex target: grade a shell command per task (else build+serve a cortex server per arm)')
|
|
606
|
+
.option('--build-cmd <cmd>', 'build command run in each candidate worktree before benching')
|
|
607
|
+
.option('--accept-exit <codes>', 'comma list of exit codes whose stdout is graded (default 0)', '0')
|
|
608
|
+
.option('--runs <n>', 'bench runs per task per arm', '3')
|
|
609
|
+
.option('--model <id>', 'model for cortex targets / the LLM Fixer')
|
|
610
|
+
.option('--temperature <n>', 'dispatch temperature passed through to each round’s experiment (effectiveness layer)')
|
|
611
|
+
.option('--strategy <label>', 'arm persona/strategy label passed through to each round’s experiment (effectiveness layer)')
|
|
612
|
+
.option('--max-rounds <n>', 'maximum rounds', '10')
|
|
613
|
+
.option('--max-stale <n>', 'stop after this many consecutive non-merge rounds (default: max-rounds)')
|
|
614
|
+
.option('--success-metric <taskId:threshold>', 'stop early when the candidate mean score for taskId reaches the threshold')
|
|
615
|
+
.option('--base-ref <ref>', 'starting ref (default: repo HEAD)')
|
|
616
|
+
.option('--branch <name>', 'loop branch name (default: autoresearch/loop-<sha>)')
|
|
617
|
+
.option('--cortex-dir <path>', 'shared .cortex store + JSONL artifacts (default: repo)')
|
|
618
|
+
.option('--keep-worktrees', 'do not remove rejected candidate worktrees (debugging)')
|
|
619
|
+
.action(async (opts) => {
|
|
620
|
+
const globalOpts = program.opts();
|
|
621
|
+
await autoResearchLoop({ ...opts, json: globalOpts.json });
|
|
622
|
+
});
|
|
623
|
+
autoresearch
|
|
624
|
+
.command('list')
|
|
625
|
+
.description('Show recorded keep/discard decisions from .cortex/experiments.jsonl')
|
|
626
|
+
.option('--decision <d>', 'filter: keep | discard | pending')
|
|
627
|
+
.action(async (opts) => {
|
|
628
|
+
const globalOpts = program.opts();
|
|
629
|
+
await autoResearchList({ decision: opts.decision, json: globalOpts.json });
|
|
630
|
+
});
|
|
631
|
+
// Tmux terminal integration commands
|
|
632
|
+
const tmux = program.command('tmux').description('Tmux terminal integration');
|
|
633
|
+
tmux
|
|
634
|
+
.command('list')
|
|
635
|
+
.description('List all tmux sessions')
|
|
636
|
+
.action(async () => {
|
|
637
|
+
const globalOpts = program.opts();
|
|
638
|
+
await tmuxList({
|
|
639
|
+
serverUrl: globalOpts.server,
|
|
640
|
+
json: globalOpts.json,
|
|
641
|
+
});
|
|
642
|
+
});
|
|
643
|
+
// Middleware commands
|
|
644
|
+
const middleware = program.command('middleware').description('Middleware system management');
|
|
645
|
+
middleware
|
|
646
|
+
.command('list')
|
|
647
|
+
.description('List all middleware systems')
|
|
648
|
+
.action(async () => {
|
|
649
|
+
const globalOpts = program.opts();
|
|
650
|
+
await middlewareList({
|
|
651
|
+
serverUrl: globalOpts.server,
|
|
652
|
+
json: globalOpts.json,
|
|
653
|
+
});
|
|
654
|
+
});
|
|
655
|
+
middleware
|
|
656
|
+
.command('status <name>')
|
|
657
|
+
.description('Show middleware status and configuration')
|
|
658
|
+
.action(async (name) => {
|
|
659
|
+
const globalOpts = program.opts();
|
|
660
|
+
await middlewareStatus(name, {
|
|
661
|
+
serverUrl: globalOpts.server,
|
|
662
|
+
json: globalOpts.json,
|
|
663
|
+
});
|
|
664
|
+
});
|
|
665
|
+
middleware
|
|
666
|
+
.command('enable <name>')
|
|
667
|
+
.description('Enable a middleware system')
|
|
668
|
+
.action(async (name) => {
|
|
669
|
+
const globalOpts = program.opts();
|
|
670
|
+
await middlewareEnable(name, {
|
|
671
|
+
serverUrl: globalOpts.server,
|
|
672
|
+
json: globalOpts.json,
|
|
673
|
+
});
|
|
674
|
+
});
|
|
675
|
+
middleware
|
|
676
|
+
.command('disable <name>')
|
|
677
|
+
.description('Disable a middleware system')
|
|
678
|
+
.action(async (name) => {
|
|
679
|
+
const globalOpts = program.opts();
|
|
680
|
+
await middlewareDisable(name, {
|
|
681
|
+
serverUrl: globalOpts.server,
|
|
682
|
+
json: globalOpts.json,
|
|
683
|
+
});
|
|
684
|
+
});
|
|
685
|
+
middleware
|
|
686
|
+
.command('config <name>')
|
|
687
|
+
.description('Show middleware configuration details')
|
|
688
|
+
.action(async (name) => {
|
|
689
|
+
const globalOpts = program.opts();
|
|
690
|
+
await middlewareConfig(name, {
|
|
691
|
+
serverUrl: globalOpts.server,
|
|
692
|
+
json: globalOpts.json,
|
|
693
|
+
});
|
|
694
|
+
});
|
|
695
|
+
// Artifact commands
|
|
696
|
+
const artifact = program.command('artifact').description('Artifact system - Visual programming');
|
|
697
|
+
artifact
|
|
698
|
+
.command('list')
|
|
699
|
+
.description('List all artifacts')
|
|
700
|
+
.option('--status <status>', 'Filter by status (running, stopped, all)')
|
|
701
|
+
.option('--type <type>', 'Filter by type')
|
|
702
|
+
.action(async (options) => {
|
|
703
|
+
const globalOpts = program.opts();
|
|
704
|
+
await artifactList({
|
|
705
|
+
serverUrl: globalOpts.server,
|
|
706
|
+
json: globalOpts.json,
|
|
707
|
+
status: options.status,
|
|
708
|
+
type: options.type,
|
|
709
|
+
});
|
|
710
|
+
});
|
|
711
|
+
artifact
|
|
712
|
+
.command('stop <id>')
|
|
713
|
+
.description('Stop artifact')
|
|
714
|
+
.action(async (id) => {
|
|
715
|
+
const globalOpts = program.opts();
|
|
716
|
+
await artifactStop(id, {
|
|
717
|
+
serverUrl: globalOpts.server,
|
|
718
|
+
json: globalOpts.json,
|
|
719
|
+
});
|
|
720
|
+
});
|
|
721
|
+
artifact
|
|
722
|
+
.command('restart <id>')
|
|
723
|
+
.description('Restart artifact')
|
|
724
|
+
.action(async (id) => {
|
|
725
|
+
const globalOpts = program.opts();
|
|
726
|
+
await artifactRestart(id, {
|
|
727
|
+
serverUrl: globalOpts.server,
|
|
728
|
+
json: globalOpts.json,
|
|
729
|
+
});
|
|
730
|
+
});
|
|
731
|
+
artifact
|
|
732
|
+
.command('status <id>')
|
|
733
|
+
.description('Show artifact status')
|
|
734
|
+
.action(async (id) => {
|
|
735
|
+
const globalOpts = program.opts();
|
|
736
|
+
await artifactStatus(id, {
|
|
737
|
+
serverUrl: globalOpts.server,
|
|
738
|
+
json: globalOpts.json,
|
|
739
|
+
});
|
|
740
|
+
});
|
|
741
|
+
// Session compact command
|
|
742
|
+
sessions
|
|
743
|
+
.command('compact <id>')
|
|
744
|
+
.description('Manually trigger compaction')
|
|
745
|
+
.action(async (id) => {
|
|
746
|
+
const globalOpts = program.opts();
|
|
747
|
+
await sessionCompact(id, {
|
|
748
|
+
serverUrl: globalOpts.server,
|
|
749
|
+
json: globalOpts.json,
|
|
750
|
+
});
|
|
751
|
+
});
|
|
752
|
+
// Context Management commands
|
|
753
|
+
const context = program.command('context').description('Context budget management');
|
|
754
|
+
context
|
|
755
|
+
.command('status <session-id>')
|
|
756
|
+
.description('Show context budget status')
|
|
757
|
+
.action(async (sessionId) => {
|
|
758
|
+
const globalOpts = program.opts();
|
|
759
|
+
await contextStatus(sessionId, {
|
|
760
|
+
serverUrl: globalOpts.server,
|
|
761
|
+
json: globalOpts.json,
|
|
762
|
+
});
|
|
763
|
+
});
|
|
764
|
+
context
|
|
765
|
+
.command('compact <session-id>')
|
|
766
|
+
.description('Trigger manual compaction')
|
|
767
|
+
.action(async (sessionId) => {
|
|
768
|
+
const globalOpts = program.opts();
|
|
769
|
+
await contextCompact(sessionId, {
|
|
770
|
+
serverUrl: globalOpts.server,
|
|
771
|
+
json: globalOpts.json,
|
|
772
|
+
});
|
|
773
|
+
});
|
|
774
|
+
context
|
|
775
|
+
.command('boundaries <session-id>')
|
|
776
|
+
.description('List compaction boundaries')
|
|
777
|
+
.action(async (sessionId) => {
|
|
778
|
+
const globalOpts = program.opts();
|
|
779
|
+
await contextBoundaries(sessionId, {
|
|
780
|
+
serverUrl: globalOpts.server,
|
|
781
|
+
json: globalOpts.json,
|
|
782
|
+
});
|
|
783
|
+
});
|
|
784
|
+
context
|
|
785
|
+
.command('strategy [strategy]')
|
|
786
|
+
.description('Get or set context strategy')
|
|
787
|
+
.action(async (strategy) => {
|
|
788
|
+
const globalOpts = program.opts();
|
|
789
|
+
await contextStrategy(strategy, {
|
|
790
|
+
serverUrl: globalOpts.server,
|
|
791
|
+
json: globalOpts.json,
|
|
792
|
+
});
|
|
793
|
+
});
|
|
794
|
+
context
|
|
795
|
+
.command('savings')
|
|
796
|
+
.description('Show token savings from compaction')
|
|
797
|
+
.action(async () => {
|
|
798
|
+
const globalOpts = program.opts();
|
|
799
|
+
await contextSavings({
|
|
800
|
+
serverUrl: globalOpts.server,
|
|
801
|
+
json: globalOpts.json,
|
|
802
|
+
});
|
|
803
|
+
});
|
|
804
|
+
// Tools commands
|
|
805
|
+
const tools = program.command('tools').description('Tool management');
|
|
806
|
+
tools
|
|
807
|
+
.command('list')
|
|
808
|
+
.description('List all available tools')
|
|
809
|
+
.option('--grouped', 'Group tools by category')
|
|
810
|
+
.action(async (options) => {
|
|
811
|
+
const globalOpts = program.opts();
|
|
812
|
+
await toolsList({
|
|
813
|
+
serverUrl: globalOpts.server,
|
|
814
|
+
json: globalOpts.json,
|
|
815
|
+
grouped: options.grouped,
|
|
816
|
+
});
|
|
817
|
+
});
|
|
818
|
+
tools
|
|
819
|
+
.command('info <name>')
|
|
820
|
+
.description('Show detailed tool information')
|
|
821
|
+
.action(async (name) => {
|
|
822
|
+
const globalOpts = program.opts();
|
|
823
|
+
await toolsInfo(name, {
|
|
824
|
+
serverUrl: globalOpts.server,
|
|
825
|
+
json: globalOpts.json,
|
|
826
|
+
});
|
|
827
|
+
});
|
|
828
|
+
// Cache commands
|
|
829
|
+
const cache = program.command('cache').description('Prompt cache management');
|
|
830
|
+
cache
|
|
831
|
+
.command('metrics <session-id>')
|
|
832
|
+
.description('Show cache metrics for session')
|
|
833
|
+
.action(async (sessionId) => {
|
|
834
|
+
const globalOpts = program.opts();
|
|
835
|
+
await cacheMetrics(sessionId, {
|
|
836
|
+
serverUrl: globalOpts.server,
|
|
837
|
+
json: globalOpts.json,
|
|
838
|
+
});
|
|
839
|
+
});
|
|
840
|
+
// System Messages commands
|
|
841
|
+
const systemMessages = program.command('system-messages').description('System message management');
|
|
842
|
+
systemMessages
|
|
843
|
+
.command('list')
|
|
844
|
+
.description('List available system messages')
|
|
845
|
+
.action(async () => {
|
|
846
|
+
const globalOpts = program.opts();
|
|
847
|
+
await systemMessagesList({
|
|
848
|
+
serverUrl: globalOpts.server,
|
|
849
|
+
json: globalOpts.json,
|
|
850
|
+
});
|
|
851
|
+
});
|
|
852
|
+
systemMessages
|
|
853
|
+
.command('view <id>')
|
|
854
|
+
.description('View system message content')
|
|
855
|
+
.action(async (id) => {
|
|
856
|
+
const globalOpts = program.opts();
|
|
857
|
+
await systemMessagesView(id, {
|
|
858
|
+
serverUrl: globalOpts.server,
|
|
859
|
+
json: globalOpts.json,
|
|
860
|
+
});
|
|
861
|
+
});
|
|
862
|
+
systemMessages
|
|
863
|
+
.command('reload')
|
|
864
|
+
.description('Reload system messages from disk')
|
|
865
|
+
.action(async () => {
|
|
866
|
+
const globalOpts = program.opts();
|
|
867
|
+
await systemMessagesReload({
|
|
868
|
+
serverUrl: globalOpts.server,
|
|
869
|
+
json: globalOpts.json,
|
|
870
|
+
});
|
|
871
|
+
});
|
|
872
|
+
// `ui` interactive command group moved to @nexus-cortex/tui (neoncortex / cli-full).
|
|
873
|
+
// Error handling
|
|
874
|
+
program.exitOverride((err) => {
|
|
875
|
+
if (err.code !== 'commander.version' && err.code !== 'commander.helpDisplayed') {
|
|
876
|
+
console.error(chalk.red('Error:'), err.message);
|
|
877
|
+
process.exit(1);
|
|
878
|
+
}
|
|
879
|
+
process.exit(0);
|
|
880
|
+
});
|
|
881
|
+
// Parse command line
|
|
882
|
+
program.parse();
|
|
883
|
+
//# sourceMappingURL=index.js.map
|