@cortex-agent/server 2026.5.19-1
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/defaults/.claude/settings.json +13 -0
- package/defaults/CORTEX.md +15 -0
- package/defaults/config/budget.json +4 -0
- package/defaults/config/session-hooks.json +7 -0
- package/defaults/config/thread-templates.json +528 -0
- package/defaults/context/CORTEX.md +40 -0
- package/defaults/context/decisions/DR-0012.md +54 -0
- package/defaults/context/ideas/CORTEX.md +10 -0
- package/defaults/context/projects/CORTEX.md +25 -0
- package/defaults/context/scans/CORTEX.md +13 -0
- package/defaults/context/user/CORTEX.md +21 -0
- package/defaults/data/schedules.json +52 -0
- package/defaults/gitignore +44 -0
- package/defaults/hooks/ask-user-question-hook.mjs +66 -0
- package/defaults/hooks/cortex-md-injector.mjs +237 -0
- package/defaults/hooks/exit-plan-mode-hook.mjs +84 -0
- package/defaults/hooks/memory-ref-tracker.mjs +154 -0
- package/defaults/hooks/new-session-hook.mjs +83 -0
- package/defaults/hooks/post-task-hook.mjs +63 -0
- package/defaults/hooks/rules-loader.mjs +212 -0
- package/defaults/hooks/sensitive-file-edit.mjs +84 -0
- package/defaults/hooks/session-activity-tracker.mjs +254 -0
- package/defaults/hooks/task-status-check.mjs +218 -0
- package/defaults/hooks/tasks-yaml-guard.mjs +230 -0
- package/defaults/plugins/cortex-coder/.claude-plugin/plugin.json +5 -0
- package/defaults/plugins/cortex-coder/skills/cli-standards/SKILL.md +208 -0
- package/defaults/plugins/cortex-coder/skills/code-standards/SKILL.md +146 -0
- package/defaults/plugins/cortex-coder/skills/develop/SKILL.md +164 -0
- package/defaults/plugins/cortex-common/.claude-plugin/plugin.json +5 -0
- package/defaults/plugins/cortex-common/skills/compound/SKILL.md +349 -0
- package/defaults/plugins/cortex-common/skills/compound-simple/SKILL.md +104 -0
- package/defaults/plugins/cortex-common/skills/critique/SKILL.md +88 -0
- package/defaults/plugins/cortex-common/skills/debug-campaign/SKILL.md +508 -0
- package/defaults/plugins/cortex-common/skills/diagnose/SKILL.md +169 -0
- package/defaults/plugins/cortex-common/skills/postmortem/SKILL.md +135 -0
- package/defaults/plugins/cortex-common/skills/solution-design/SKILL.md +183 -0
- package/defaults/plugins/cortex-common/skills/synthesize/SKILL.md +120 -0
- package/defaults/plugins/cortex-stage-gate/.claude-plugin/plugin.json +5 -0
- package/defaults/plugins/cortex-stage-gate/skills/need-approval/SKILL.md +89 -0
- package/defaults/plugins/cortex-stage-gate/skills/reorient/SKILL.md +163 -0
- package/defaults/plugins/cortex-stage-gate/skills/task/SKILL.md +425 -0
- package/defaults/plugins/cortex-system/.claude-plugin/plugin.json +5 -0
- package/defaults/plugins/cortex-system/skills/approval/SKILL.md +84 -0
- package/defaults/plugins/cortex-system/skills/client-manage/SKILL.md +199 -0
- package/defaults/plugins/cortex-system/skills/deep-retrospective/CORTEX.md +8 -0
- package/defaults/plugins/cortex-system/skills/deep-retrospective/SKILL.md +201 -0
- package/defaults/plugins/cortex-system/skills/deep-retrospective/scripts/CORTEX.md +8 -0
- package/defaults/plugins/cortex-system/skills/deep-retrospective/scripts/extract_session.py +165 -0
- package/defaults/plugins/cortex-system/skills/deep-retrospective/scripts/scan_logs.py +402 -0
- package/defaults/plugins/cortex-system/skills/evolve/SKILL.md +115 -0
- package/defaults/plugins/cortex-system/skills/feedback/SKILL.md +262 -0
- package/defaults/plugins/cortex-system/skills/gravity/SKILL.md +125 -0
- package/defaults/plugins/cortex-system/skills/orient/SKILL.md +310 -0
- package/defaults/plugins/cortex-system/skills/orient-project/SKILL.md +85 -0
- package/defaults/plugins/cortex-system/skills/project-init/SKILL.md +167 -0
- package/defaults/plugins/cortex-system/skills/refresh-skills/SKILL.md +153 -0
- package/defaults/plugins/cortex-system/skills/schedule/SKILL.md +209 -0
- package/defaults/plugins/cortex-system/skills/thread/SKILL.md +478 -0
- package/defaults/plugins/cortex-system/skills/user-learn/SKILL.md +95 -0
- package/defaults/prompts/directives/coder-reviewer.md +106 -0
- package/defaults/prompts/directives/coder.md +90 -0
- package/defaults/prompts/directives/director.md +97 -0
- package/defaults/prompts/directives/doc-reviewer.md +93 -0
- package/defaults/prompts/directives/doc-writer.md +85 -0
- package/defaults/prompts/directives/executor-reviewer.md +96 -0
- package/defaults/prompts/directives/executor.md +85 -0
- package/defaults/prompts/directives/milestone-executor.md +119 -0
- package/defaults/prompts/directives/milestone-reviewer.md +108 -0
- package/defaults/prompts/directives/plan-executor.md +121 -0
- package/defaults/prompts/directives/plan-reviewer.md +99 -0
- package/defaults/prompts/systemPrompts/coder.md +64 -0
- package/defaults/prompts/systemPrompts/direct.md +92 -0
- package/defaults/prompts/systemPrompts/web-opus-4-6.md +68 -0
- package/defaults/prompts/systemPrompts/web-sonnet-4-6.md +76 -0
- package/defaults/prompts/systemPrompts/web.md +50 -0
- package/defaults/prompts/systemPrompts/worker.md +67 -0
- package/defaults/rules/correction-propagation.md +31 -0
- package/defaults/rules/decision-records.md +49 -0
- package/defaults/rules/experiment-format.md +165 -0
- package/defaults/rules/issues-md.md +37 -0
- package/defaults/rules/meta-conventions.md +45 -0
- package/defaults/rules/mission-md.md +47 -0
- package/defaults/rules/overview-md.md +41 -0
- package/defaults/rules/roadmap-md.md +55 -0
- package/defaults/rules/status-md.md +49 -0
- package/defaults/rules/task-system.md +53 -0
- package/dist/agent-adapter/capabilities.d.ts +12 -0
- package/dist/agent-adapter/capabilities.js +52 -0
- package/dist/agent-adapter/claude/adapter-tui.d.ts +140 -0
- package/dist/agent-adapter/claude/adapter-tui.js +422 -0
- package/dist/agent-adapter/claude/adapter.d.ts +85 -0
- package/dist/agent-adapter/claude/adapter.js +771 -0
- package/dist/agent-adapter/claude/cost-from-usage.d.ts +62 -0
- package/dist/agent-adapter/claude/cost-from-usage.js +97 -0
- package/dist/agent-adapter/claude/defaults.d.ts +30 -0
- package/dist/agent-adapter/claude/defaults.js +49 -0
- package/dist/agent-adapter/claude/event-parser.d.ts +28 -0
- package/dist/agent-adapter/claude/event-parser.js +173 -0
- package/dist/agent-adapter/claude/hooks-builder.d.ts +36 -0
- package/dist/agent-adapter/claude/hooks-builder.js +57 -0
- package/dist/agent-adapter/claude/jsonl-tail.d.ts +68 -0
- package/dist/agent-adapter/claude/jsonl-tail.js +344 -0
- package/dist/agent-adapter/claude/spawn-args.d.ts +38 -0
- package/dist/agent-adapter/claude/spawn-args.js +83 -0
- package/dist/agent-adapter/claude/tmux-control.d.ts +69 -0
- package/dist/agent-adapter/claude/tmux-control.js +127 -0
- package/dist/agent-adapter/claude/tool-summarizers.d.ts +2 -0
- package/dist/agent-adapter/claude/tool-summarizers.js +24 -0
- package/dist/agent-adapter/codex/adapter.d.ts +42 -0
- package/dist/agent-adapter/codex/adapter.js +916 -0
- package/dist/agent-adapter/codex/event-parser.d.ts +17 -0
- package/dist/agent-adapter/codex/event-parser.js +41 -0
- package/dist/agent-adapter/codex/spawn-args.d.ts +6 -0
- package/dist/agent-adapter/codex/spawn-args.js +30 -0
- package/dist/agent-adapter/index.d.ts +8 -0
- package/dist/agent-adapter/index.js +33 -0
- package/dist/agent-adapter/normalize/event-stream.d.ts +6 -0
- package/dist/agent-adapter/normalize/event-stream.js +47 -0
- package/dist/agent-adapter/normalize/event-types.d.ts +58 -0
- package/dist/agent-adapter/normalize/event-types.js +5 -0
- package/dist/agent-adapter/normalize/hooks.d.ts +26 -0
- package/dist/agent-adapter/normalize/hooks.js +5 -0
- package/dist/agent-adapter/normalize/prompt-builder.d.ts +6 -0
- package/dist/agent-adapter/normalize/prompt-builder.js +23 -0
- package/dist/agent-adapter/normalize/tool-names.d.ts +6 -0
- package/dist/agent-adapter/normalize/tool-names.js +73 -0
- package/dist/agent-adapter/pi/adapter.d.ts +60 -0
- package/dist/agent-adapter/pi/adapter.js +626 -0
- package/dist/agent-adapter/pi/agent-dir.d.ts +11 -0
- package/dist/agent-adapter/pi/agent-dir.js +34 -0
- package/dist/agent-adapter/pi/event-parser.d.ts +26 -0
- package/dist/agent-adapter/pi/event-parser.js +313 -0
- package/dist/agent-adapter/pi/framing.d.ts +6 -0
- package/dist/agent-adapter/pi/framing.js +35 -0
- package/dist/agent-adapter/pi/hook-bridge.d.ts +59 -0
- package/dist/agent-adapter/pi/hook-bridge.js +233 -0
- package/dist/agent-adapter/pi/mcp-bridge.d.ts +26 -0
- package/dist/agent-adapter/pi/mcp-bridge.js +140 -0
- package/dist/agent-adapter/pi/pi-ext-types.d.ts +90 -0
- package/dist/agent-adapter/pi/pi-ext-types.js +5 -0
- package/dist/agent-adapter/pi/spawn-args.d.ts +20 -0
- package/dist/agent-adapter/pi/spawn-args.js +54 -0
- package/dist/agent-adapter/pi/tool-shims.d.ts +2 -0
- package/dist/agent-adapter/pi/tool-shims.js +181 -0
- package/dist/agent-adapter/types.d.ts +94 -0
- package/dist/agent-adapter/types.js +5 -0
- package/dist/core/async-mutex.d.ts +6 -0
- package/dist/core/async-mutex.js +36 -0
- package/dist/core/cli-utils.d.ts +37 -0
- package/dist/core/cli-utils.js +69 -0
- package/dist/core/config-generator.d.ts +9 -0
- package/dist/core/config-generator.js +58 -0
- package/dist/core/gateway-generator.d.ts +46 -0
- package/dist/core/gateway-generator.js +336 -0
- package/dist/core/log.d.ts +7 -0
- package/dist/core/log.js +103 -0
- package/dist/core/paths.d.ts +32 -0
- package/dist/core/paths.js +49 -0
- package/dist/core/profile-generator.d.ts +65 -0
- package/dist/core/profile-generator.js +310 -0
- package/dist/core/running-executions.d.ts +88 -0
- package/dist/core/running-executions.js +186 -0
- package/dist/core/status-format.d.ts +18 -0
- package/dist/core/status-format.js +31 -0
- package/dist/core/task-parser.d.ts +69 -0
- package/dist/core/task-parser.js +423 -0
- package/dist/core/types/agent-types.d.ts +31 -0
- package/dist/core/types/agent-types.js +5 -0
- package/dist/core/types/thread-types.d.ts +261 -0
- package/dist/core/types/thread-types.js +5 -0
- package/dist/core/utils.d.ts +29 -0
- package/dist/core/utils.js +98 -0
- package/dist/core/version.d.ts +3 -0
- package/dist/core/version.js +12 -0
- package/dist/domain/agents/config.d.ts +58 -0
- package/dist/domain/agents/config.js +313 -0
- package/dist/domain/agents/facade.d.ts +52 -0
- package/dist/domain/agents/facade.js +264 -0
- package/dist/domain/agents/index.d.ts +2 -0
- package/dist/domain/agents/index.js +4 -0
- package/dist/domain/agents/profile-manager.d.ts +54 -0
- package/dist/domain/agents/profile-manager.js +161 -0
- package/dist/domain/costs/codex-event-format.d.ts +4 -0
- package/dist/domain/costs/codex-event-format.js +66 -0
- package/dist/domain/costs/codex-usage-monitor.d.ts +7 -0
- package/dist/domain/costs/codex-usage-monitor.js +72 -0
- package/dist/domain/costs/cost-tracker.d.ts +115 -0
- package/dist/domain/costs/cost-tracker.js +327 -0
- package/dist/domain/costs/gateway-manager.d.ts +6 -0
- package/dist/domain/costs/gateway-manager.js +228 -0
- package/dist/domain/costs/rate-limit-parser.d.ts +11 -0
- package/dist/domain/costs/rate-limit-parser.js +87 -0
- package/dist/domain/costs/rate-limit-throttle.d.ts +32 -0
- package/dist/domain/costs/rate-limit-throttle.js +129 -0
- package/dist/domain/executions/registry.d.ts +20 -0
- package/dist/domain/executions/registry.js +124 -0
- package/dist/domain/mcp/core-server.d.ts +2 -0
- package/dist/domain/mcp/core-server.js +34 -0
- package/dist/domain/mcp/server.d.ts +3 -0
- package/dist/domain/mcp/server.js +78 -0
- package/dist/domain/mcp/tools/context.d.ts +23 -0
- package/dist/domain/mcp/tools/context.js +51 -0
- package/dist/domain/mcp/tools/cortex-md.d.ts +17 -0
- package/dist/domain/mcp/tools/cortex-md.js +36 -0
- package/dist/domain/mcp/tools/cost.d.ts +2 -0
- package/dist/domain/mcp/tools/cost.js +54 -0
- package/dist/domain/mcp/tools/executions.d.ts +2 -0
- package/dist/domain/mcp/tools/executions.js +94 -0
- package/dist/domain/mcp/tools/schedule.d.ts +23 -0
- package/dist/domain/mcp/tools/schedule.js +245 -0
- package/dist/domain/mcp/tools/slack.d.ts +21 -0
- package/dist/domain/mcp/tools/slack.js +124 -0
- package/dist/domain/mcp/tools/task-ops.d.ts +2 -0
- package/dist/domain/mcp/tools/task-ops.js +509 -0
- package/dist/domain/mcp/tools/tui-ask.d.ts +31 -0
- package/dist/domain/mcp/tools/tui-ask.js +108 -0
- package/dist/domain/mcp/tools/tui-plan.d.ts +28 -0
- package/dist/domain/mcp/tools/tui-plan.js +118 -0
- package/dist/domain/mcp/tui-server.d.ts +2 -0
- package/dist/domain/mcp/tui-server.js +69 -0
- package/dist/domain/memory/consolidate.d.ts +55 -0
- package/dist/domain/memory/consolidate.js +471 -0
- package/dist/domain/memory/cortex-md-injector.d.ts +30 -0
- package/dist/domain/memory/cortex-md-injector.js +123 -0
- package/dist/domain/memory/cortex-md-scanner.d.ts +9 -0
- package/dist/domain/memory/cortex-md-scanner.js +67 -0
- package/dist/domain/memory/index-regen.d.ts +19 -0
- package/dist/domain/memory/index-regen.js +398 -0
- package/dist/domain/memory/rules-loader.d.ts +27 -0
- package/dist/domain/memory/rules-loader.js +97 -0
- package/dist/domain/memory/skill-scanner.d.ts +5 -0
- package/dist/domain/memory/skill-scanner.js +132 -0
- package/dist/domain/memory/user-context.d.ts +5 -0
- package/dist/domain/memory/user-context.js +34 -0
- package/dist/domain/memory/watcher.d.ts +2 -0
- package/dist/domain/memory/watcher.js +81 -0
- package/dist/domain/monitor/disk-monitor.d.ts +20 -0
- package/dist/domain/monitor/disk-monitor.js +97 -0
- package/dist/domain/monitor/gpu-monitor.d.ts +26 -0
- package/dist/domain/monitor/gpu-monitor.js +135 -0
- package/dist/domain/remote/client-bootstrap.d.ts +1 -0
- package/dist/domain/remote/client-bootstrap.js +139 -0
- package/dist/domain/remote/client-hot-reload.d.ts +18 -0
- package/dist/domain/remote/client-hot-reload.js +142 -0
- package/dist/domain/remote/client-manager.d.ts +50 -0
- package/dist/domain/remote/client-manager.js +452 -0
- package/dist/domain/remote/cortex-client.d.ts +1 -0
- package/dist/domain/remote/cortex-client.js +704 -0
- package/dist/domain/scheduling/job-registry.d.ts +31 -0
- package/dist/domain/scheduling/job-registry.js +34 -0
- package/dist/domain/scheduling/jobs/_shared.d.ts +14 -0
- package/dist/domain/scheduling/jobs/_shared.js +45 -0
- package/dist/domain/scheduling/jobs/memory-index-regen.d.ts +1 -0
- package/dist/domain/scheduling/jobs/memory-index-regen.js +16 -0
- package/dist/domain/scheduling/jobs/scheduled-task.d.ts +11 -0
- package/dist/domain/scheduling/jobs/scheduled-task.js +186 -0
- package/dist/domain/scheduling/jobs/target-dispatch.d.ts +41 -0
- package/dist/domain/scheduling/jobs/target-dispatch.js +48 -0
- package/dist/domain/scheduling/jobs/task-archive.d.ts +1 -0
- package/dist/domain/scheduling/jobs/task-archive.js +19 -0
- package/dist/domain/scheduling/jobs/task-dispatch.d.ts +12 -0
- package/dist/domain/scheduling/jobs/task-dispatch.js +214 -0
- package/dist/domain/scheduling/runner.d.ts +13 -0
- package/dist/domain/scheduling/runner.js +24 -0
- package/dist/domain/scheduling/schedule-cli.d.ts +16 -0
- package/dist/domain/scheduling/schedule-cli.js +268 -0
- package/dist/domain/scheduling/schedule-command.d.ts +4 -0
- package/dist/domain/scheduling/schedule-command.js +274 -0
- package/dist/domain/scheduling/scheduler.d.ts +86 -0
- package/dist/domain/scheduling/scheduler.js +544 -0
- package/dist/domain/sessions/session-backup.d.ts +49 -0
- package/dist/domain/sessions/session-backup.js +217 -0
- package/dist/domain/sessions/session-hooks.d.ts +103 -0
- package/dist/domain/sessions/session-hooks.js +311 -0
- package/dist/domain/sessions/session-registry.d.ts +21 -0
- package/dist/domain/sessions/session-registry.js +31 -0
- package/dist/domain/sessions/session.d.ts +3 -0
- package/dist/domain/sessions/session.js +14 -0
- package/dist/domain/tasks/archiver.d.ts +9 -0
- package/dist/domain/tasks/archiver.js +123 -0
- package/dist/domain/tasks/dispatch-utils.d.ts +37 -0
- package/dist/domain/tasks/dispatch-utils.js +143 -0
- package/dist/domain/tasks/dispatcher.d.ts +48 -0
- package/dist/domain/tasks/dispatcher.js +285 -0
- package/dist/domain/tasks/lint.d.ts +12 -0
- package/dist/domain/tasks/lint.js +102 -0
- package/dist/domain/tasks/mutator.d.ts +21 -0
- package/dist/domain/tasks/mutator.js +208 -0
- package/dist/domain/tasks/parser.d.ts +1 -0
- package/dist/domain/tasks/parser.js +6 -0
- package/dist/domain/tasks/pending-tracker.d.ts +67 -0
- package/dist/domain/tasks/pending-tracker.js +163 -0
- package/dist/domain/tasks/recommendation/extractor.d.ts +12 -0
- package/dist/domain/tasks/recommendation/extractor.js +563 -0
- package/dist/domain/tasks/recommendation/patterns.d.ts +11 -0
- package/dist/domain/tasks/recommendation/patterns.js +99 -0
- package/dist/domain/tasks/recommendation/types.d.ts +67 -0
- package/dist/domain/tasks/recommendation/types.js +5 -0
- package/dist/domain/tasks/store.d.ts +1 -0
- package/dist/domain/tasks/store.js +3 -0
- package/dist/domain/tasks/system/cortex-run.d.ts +24 -0
- package/dist/domain/tasks/system/cortex-run.js +342 -0
- package/dist/domain/tasks/system/task-cli.d.ts +49 -0
- package/dist/domain/tasks/system/task-cli.js +664 -0
- package/dist/domain/tasks/system/task-completion.d.ts +22 -0
- package/dist/domain/tasks/system/task-completion.js +89 -0
- package/dist/domain/tasks/system/task-id-utils.d.ts +24 -0
- package/dist/domain/tasks/system/task-id-utils.js +84 -0
- package/dist/domain/tasks/system/task-lifecycle-edit.d.ts +34 -0
- package/dist/domain/tasks/system/task-lifecycle-edit.js +208 -0
- package/dist/domain/tasks/system/task-lock.d.ts +25 -0
- package/dist/domain/tasks/system/task-lock.js +139 -0
- package/dist/domain/tasks/system/task-mutations.d.ts +31 -0
- package/dist/domain/tasks/system/task-mutations.js +110 -0
- package/dist/domain/tasks/system/task-process.d.ts +37 -0
- package/dist/domain/tasks/system/task-process.js +119 -0
- package/dist/domain/tasks/system/task-state.d.ts +70 -0
- package/dist/domain/tasks/system/task-state.js +176 -0
- package/dist/domain/threads/artifact-io.d.ts +18 -0
- package/dist/domain/threads/artifact-io.js +182 -0
- package/dist/domain/threads/auto-thread.d.ts +3 -0
- package/dist/domain/threads/auto-thread.js +19 -0
- package/dist/domain/threads/hook-runner.d.ts +4 -0
- package/dist/domain/threads/hook-runner.js +250 -0
- package/dist/domain/threads/index.d.ts +5 -0
- package/dist/domain/threads/index.js +7 -0
- package/dist/domain/threads/prompt-builder.d.ts +25 -0
- package/dist/domain/threads/prompt-builder.js +176 -0
- package/dist/domain/threads/runner.d.ts +83 -0
- package/dist/domain/threads/runner.js +434 -0
- package/dist/domain/threads/state-machine.d.ts +61 -0
- package/dist/domain/threads/state-machine.js +440 -0
- package/dist/domain/threads/template-loader.d.ts +20 -0
- package/dist/domain/threads/template-loader.js +189 -0
- package/dist/domain/threads/template-resolver.d.ts +1 -0
- package/dist/domain/threads/template-resolver.js +95 -0
- package/dist/domain/threads/utils.d.ts +19 -0
- package/dist/domain/threads/utils.js +49 -0
- package/dist/entry/app.d.ts +1 -0
- package/dist/entry/app.js +234 -0
- package/dist/entry/cli.d.ts +12 -0
- package/dist/entry/cli.js +254 -0
- package/dist/entry/daemon.d.ts +11 -0
- package/dist/entry/daemon.js +521 -0
- package/dist/entry/init.d.ts +93 -0
- package/dist/entry/init.js +1299 -0
- package/dist/entry/startup-helpers.d.ts +2 -0
- package/dist/entry/startup-helpers.js +56 -0
- package/dist/entry/startup-notify.d.ts +10 -0
- package/dist/entry/startup-notify.js +20 -0
- package/dist/events/event-bus.d.ts +42 -0
- package/dist/events/event-bus.js +84 -0
- package/dist/events/event-logger.d.ts +12 -0
- package/dist/events/event-logger.js +135 -0
- package/dist/events/event-replay.d.ts +1 -0
- package/dist/events/event-replay.js +51 -0
- package/dist/events/event-types.d.ts +145 -0
- package/dist/events/event-types.js +5 -0
- package/dist/events/index.d.ts +5 -0
- package/dist/events/index.js +6 -0
- package/dist/hooks/ask-user-question-hook.mjs +66 -0
- package/dist/hooks/cortex-md-injector.mjs +237 -0
- package/dist/hooks/exit-plan-mode-hook.mjs +84 -0
- package/dist/hooks/memory-ref-tracker.mjs +154 -0
- package/dist/hooks/new-session-hook.mjs +83 -0
- package/dist/hooks/post-task-hook.mjs +63 -0
- package/dist/hooks/rules-loader.mjs +212 -0
- package/dist/hooks/sensitive-file-edit.mjs +84 -0
- package/dist/hooks/session-activity-tracker.mjs +254 -0
- package/dist/hooks/task-status-check.mjs +218 -0
- package/dist/hooks/tasks-yaml-guard.mjs +230 -0
- package/dist/orchestration/agent-runner.d.ts +72 -0
- package/dist/orchestration/agent-runner.js +289 -0
- package/dist/orchestration/busy-tracker.d.ts +12 -0
- package/dist/orchestration/busy-tracker.js +35 -0
- package/dist/orchestration/channel-queue.d.ts +18 -0
- package/dist/orchestration/channel-queue.js +32 -0
- package/dist/orchestration/dispatch-reconciler.d.ts +1 -0
- package/dist/orchestration/dispatch-reconciler.js +16 -0
- package/dist/orchestration/durable-helpers.d.ts +4 -0
- package/dist/orchestration/durable-helpers.js +42 -0
- package/dist/orchestration/interactions/ask-user-question.d.ts +32 -0
- package/dist/orchestration/interactions/ask-user-question.js +182 -0
- package/dist/orchestration/interactions/command-action-router.d.ts +47 -0
- package/dist/orchestration/interactions/command-action-router.js +91 -0
- package/dist/orchestration/interactions/interaction-handlers.d.ts +5 -0
- package/dist/orchestration/interactions/interaction-handlers.js +279 -0
- package/dist/orchestration/interactions/plan-approvals.d.ts +47 -0
- package/dist/orchestration/interactions/plan-approvals.js +77 -0
- package/dist/orchestration/interactions/plan-handler.d.ts +6 -0
- package/dist/orchestration/interactions/plan-handler.js +12 -0
- package/dist/orchestration/lifecycle.d.ts +50 -0
- package/dist/orchestration/lifecycle.js +308 -0
- package/dist/orchestration/orchestrator.d.ts +29 -0
- package/dist/orchestration/orchestrator.js +25 -0
- package/dist/orchestration/routing/commands/cancel.d.ts +10 -0
- package/dist/orchestration/routing/commands/cancel.js +136 -0
- package/dist/orchestration/routing/commands/channel.d.ts +11 -0
- package/dist/orchestration/routing/commands/channel.js +219 -0
- package/dist/orchestration/routing/commands/command-context.d.ts +29 -0
- package/dist/orchestration/routing/commands/command-context.js +4 -0
- package/dist/orchestration/routing/commands/cost.d.ts +3 -0
- package/dist/orchestration/routing/commands/cost.js +22 -0
- package/dist/orchestration/routing/commands/device.d.ts +6 -0
- package/dist/orchestration/routing/commands/device.js +83 -0
- package/dist/orchestration/routing/commands/dispatch.d.ts +2 -0
- package/dist/orchestration/routing/commands/dispatch.js +49 -0
- package/dist/orchestration/routing/commands/index.d.ts +15 -0
- package/dist/orchestration/routing/commands/index.js +130 -0
- package/dist/orchestration/routing/commands/mode.d.ts +13 -0
- package/dist/orchestration/routing/commands/mode.js +290 -0
- package/dist/orchestration/routing/commands/nvtop.d.ts +3 -0
- package/dist/orchestration/routing/commands/nvtop.js +103 -0
- package/dist/orchestration/routing/commands/orient.d.ts +2 -0
- package/dist/orchestration/routing/commands/orient.js +3 -0
- package/dist/orchestration/routing/commands/schedule.d.ts +4 -0
- package/dist/orchestration/routing/commands/schedule.js +132 -0
- package/dist/orchestration/routing/commands/sendfile.d.ts +2 -0
- package/dist/orchestration/routing/commands/sendfile.js +92 -0
- package/dist/orchestration/routing/commands/session.d.ts +9 -0
- package/dist/orchestration/routing/commands/session.js +153 -0
- package/dist/orchestration/routing/commands/status.d.ts +7 -0
- package/dist/orchestration/routing/commands/status.js +180 -0
- package/dist/orchestration/routing/commands/tail.d.ts +2 -0
- package/dist/orchestration/routing/commands/tail.js +73 -0
- package/dist/orchestration/routing/commands/task.d.ts +6 -0
- package/dist/orchestration/routing/commands/task.js +142 -0
- package/dist/orchestration/routing/commands/thread-handlers.d.ts +2 -0
- package/dist/orchestration/routing/commands/thread-handlers.js +138 -0
- package/dist/orchestration/routing/commands/thread.d.ts +2 -0
- package/dist/orchestration/routing/commands/thread.js +2 -0
- package/dist/orchestration/routing/edit-handler.d.ts +24 -0
- package/dist/orchestration/routing/edit-handler.js +161 -0
- package/dist/orchestration/routing/file-handler.d.ts +6 -0
- package/dist/orchestration/routing/file-handler.js +23 -0
- package/dist/orchestration/routing/hook-bridge-subscribers.d.ts +4 -0
- package/dist/orchestration/routing/hook-bridge-subscribers.js +79 -0
- package/dist/orchestration/routing/hook-bridge.d.ts +30 -0
- package/dist/orchestration/routing/hook-bridge.js +112 -0
- package/dist/orchestration/routing/message-router.d.ts +6 -0
- package/dist/orchestration/routing/message-router.js +70 -0
- package/dist/orchestration/routing/webhook.d.ts +10 -0
- package/dist/orchestration/routing/webhook.js +239 -0
- package/dist/orchestration/status-helpers.d.ts +66 -0
- package/dist/orchestration/status-helpers.js +222 -0
- package/dist/orchestration/superseded-edits.d.ts +22 -0
- package/dist/orchestration/superseded-edits.js +31 -0
- package/dist/orchestration/thread-executor.d.ts +31 -0
- package/dist/orchestration/thread-executor.js +234 -0
- package/dist/platform/adapter.d.ts +28 -0
- package/dist/platform/adapter.js +5 -0
- package/dist/platform/adapters/feishu.d.ts +66 -0
- package/dist/platform/adapters/feishu.js +558 -0
- package/dist/platform/adapters/index.d.ts +16 -0
- package/dist/platform/adapters/index.js +65 -0
- package/dist/platform/adapters/slack.d.ts +90 -0
- package/dist/platform/adapters/slack.js +630 -0
- package/dist/platform/index.d.ts +12 -0
- package/dist/platform/index.js +10 -0
- package/dist/platform/interactive-builder.d.ts +27 -0
- package/dist/platform/interactive-builder.js +120 -0
- package/dist/platform/testing.d.ts +100 -0
- package/dist/platform/testing.js +190 -0
- package/dist/platform/tool-trace.d.ts +33 -0
- package/dist/platform/tool-trace.js +165 -0
- package/dist/platform/types.d.ts +176 -0
- package/dist/platform/types.js +5 -0
- package/dist/platform/utils/rate-limiter.d.ts +92 -0
- package/dist/platform/utils/rate-limiter.js +213 -0
- package/dist/platform/virtual-message.d.ts +68 -0
- package/dist/platform/virtual-message.js +464 -0
- package/dist/store/atomic-write.d.ts +6 -0
- package/dist/store/atomic-write.js +18 -0
- package/dist/store/channel-repo.d.ts +21 -0
- package/dist/store/channel-repo.js +55 -0
- package/dist/store/conversation-ledger-repo.d.ts +86 -0
- package/dist/store/conversation-ledger-repo.js +220 -0
- package/dist/store/cost-repo.d.ts +57 -0
- package/dist/store/cost-repo.js +135 -0
- package/dist/store/execution-repo.d.ts +172 -0
- package/dist/store/execution-repo.js +343 -0
- package/dist/store/in-memory-repository.d.ts +14 -0
- package/dist/store/in-memory-repository.js +31 -0
- package/dist/store/json-repository.d.ts +51 -0
- package/dist/store/json-repository.js +118 -0
- package/dist/store/outbound-queue.d.ts +65 -0
- package/dist/store/outbound-queue.js +269 -0
- package/dist/store/profile-repo.d.ts +36 -0
- package/dist/store/profile-repo.js +144 -0
- package/dist/store/project-dir-repo.d.ts +22 -0
- package/dist/store/project-dir-repo.js +60 -0
- package/dist/store/schedule-repo.d.ts +92 -0
- package/dist/store/schedule-repo.js +88 -0
- package/dist/store/session-registry-repo.d.ts +38 -0
- package/dist/store/session-registry-repo.js +96 -0
- package/dist/store/session-repo.d.ts +14 -0
- package/dist/store/session-repo.js +56 -0
- package/dist/store/task-repo.d.ts +41 -0
- package/dist/store/task-repo.js +137 -0
- package/dist/store/thread-repo.d.ts +50 -0
- package/dist/store/thread-repo.js +190 -0
- package/package.json +58 -0
- package/scripts/postinstall-restart-trigger.mjs +39 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"permissions": {
|
|
3
|
+
"defaultMode": "bypassPermissions"
|
|
4
|
+
},
|
|
5
|
+
"skipDangerousModePermissionPrompt": true,
|
|
6
|
+
"enabledPlugins": {
|
|
7
|
+
"skill-creator@claude-plugins-official": true
|
|
8
|
+
},
|
|
9
|
+
"plansDirectory": "./plan",
|
|
10
|
+
"env": {
|
|
11
|
+
"ENABLE_CLAUDEAI_MCP_SERVERS": "false"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Cortex
|
|
2
|
+
|
|
3
|
+
This is your Cortex data directory. Cortex is an autonomous agent system for long-running projects.
|
|
4
|
+
|
|
5
|
+
## Directory Structure
|
|
6
|
+
|
|
7
|
+
- `data/` — Persistent store for JSON state & config files
|
|
8
|
+
- `logs/` — Runtime logs
|
|
9
|
+
- `tmp/` — Workspace for thread artifacts and tool results
|
|
10
|
+
- `projects/` — Project directories (one subdirectory per active project)
|
|
11
|
+
- `user/` — User preferences
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
Run `cortex start` to launch the server, or `cortex daemon` for daemon mode.
|
|
@@ -0,0 +1,528 @@
|
|
|
1
|
+
{
|
|
2
|
+
"agents": {
|
|
3
|
+
"main": {
|
|
4
|
+
"name": "main",
|
|
5
|
+
"description": "General-purpose agent, using the currently active profile",
|
|
6
|
+
"profile": "__active__",
|
|
7
|
+
"persistSession": true,
|
|
8
|
+
"promptTemplate": "{{input}}\n\nWrite your final reply to {{artifactPath}}.",
|
|
9
|
+
"tools": "Agent,AskUserQuestion,Bash,Edit,EnterPlanMode,ExitPlanMode,Glob,Grep,Read,Skill,TaskStop,TodoWrite,WebFetch,WebSearch,Write",
|
|
10
|
+
"pluginDirs": [
|
|
11
|
+
"plugins/cortex-common",
|
|
12
|
+
"plugins/cortex-stage-gate",
|
|
13
|
+
"plugins/cortex-coder",
|
|
14
|
+
"plugins/cortex-system"
|
|
15
|
+
]
|
|
16
|
+
},
|
|
17
|
+
"direct": {
|
|
18
|
+
"name": "direct",
|
|
19
|
+
"description": "Direct-interaction agent, does not use artifact file",
|
|
20
|
+
"profile": "__active__",
|
|
21
|
+
"persistSession": true,
|
|
22
|
+
"promptTemplate": "{{input}}",
|
|
23
|
+
"tools": "Agent,AskUserQuestion,Bash,Edit,EnterPlanMode,ExitPlanMode,Glob,Grep,Read,Skill,TaskStop,TodoWrite,WebFetch,WebSearch,Write",
|
|
24
|
+
"pluginDirs": [
|
|
25
|
+
"plugins/cortex-common",
|
|
26
|
+
"plugins/cortex-stage-gate",
|
|
27
|
+
"plugins/cortex-coder",
|
|
28
|
+
"plugins/cortex-system"
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
"direct-web": {
|
|
32
|
+
"name": "direct-web",
|
|
33
|
+
"description": "Direct-interaction agent, with web system prompt",
|
|
34
|
+
"profile": "__active__",
|
|
35
|
+
"persistSession": true,
|
|
36
|
+
"promptTemplate": "{{input}}",
|
|
37
|
+
"systemPrompt": "file:web.md",
|
|
38
|
+
"tools": "Agent,AskUserQuestion,Bash,Edit,EnterPlanMode,ExitPlanMode,Glob,Grep,Read,Skill,TaskStop,TodoWrite,WebFetch,WebSearch,Write",
|
|
39
|
+
"pluginDirs": [
|
|
40
|
+
"plugins/cortex-common",
|
|
41
|
+
"plugins/cortex-stage-gate",
|
|
42
|
+
"plugins/cortex-coder",
|
|
43
|
+
"plugins/cortex-system"
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
"direct-review": {
|
|
47
|
+
"name": "direct-review",
|
|
48
|
+
"description": "Direct-interaction review agent, does not use artifact file",
|
|
49
|
+
"profile": "execute",
|
|
50
|
+
"persistSession": false,
|
|
51
|
+
"directive": "",
|
|
52
|
+
"promptTemplate": "{{input}}\n\n{{previousOutput}}",
|
|
53
|
+
"tools": "Agent,Bash,Edit,Glob,Grep,Read,Skill,TaskStop,TodoWrite,WebFetch,WebSearch,Write",
|
|
54
|
+
"pluginDirs": [
|
|
55
|
+
"plugins/cortex-common",
|
|
56
|
+
"plugins/cortex-stage-gate",
|
|
57
|
+
"plugins/cortex-coder",
|
|
58
|
+
"plugins/cortex-system"
|
|
59
|
+
]
|
|
60
|
+
},
|
|
61
|
+
"scheduler-main": {
|
|
62
|
+
"name": "scheduler-main",
|
|
63
|
+
"description": "Scheduled task agent, executes scheduled tasks",
|
|
64
|
+
"profile": "__active__",
|
|
65
|
+
"persistSession": false,
|
|
66
|
+
"promptTemplate": "{{input}}",
|
|
67
|
+
"tools": "Agent,Bash,Edit,Glob,Grep,Read,Skill,TaskStop,TodoWrite,WebFetch,WebSearch,Write",
|
|
68
|
+
"pluginDirs": [
|
|
69
|
+
"plugins/cortex-common",
|
|
70
|
+
"plugins/cortex-stage-gate",
|
|
71
|
+
"plugins/cortex-coder",
|
|
72
|
+
"plugins/cortex-system"
|
|
73
|
+
]
|
|
74
|
+
},
|
|
75
|
+
"planner": {
|
|
76
|
+
"name": "planner",
|
|
77
|
+
"description": "Planner — draft plans and write to artifact",
|
|
78
|
+
"profile": "plan",
|
|
79
|
+
"persistSession": true,
|
|
80
|
+
"promptTemplate": "Write your plan to {{artifactPath}}.\n\nUser request:\n{{input}}",
|
|
81
|
+
"tools": "Agent,Bash,Edit,Glob,Grep,Read,Skill,TaskStop,TodoWrite,WebFetch,WebSearch,Write",
|
|
82
|
+
"pluginDirs": [
|
|
83
|
+
"plugins/cortex-common",
|
|
84
|
+
"plugins/cortex-system"
|
|
85
|
+
]
|
|
86
|
+
},
|
|
87
|
+
"reviewer": {
|
|
88
|
+
"name": "reviewer",
|
|
89
|
+
"description": "Reviewer — evaluate artifact content and give feedback, end with [APPROVED] or list Blockers",
|
|
90
|
+
"profile": "execute",
|
|
91
|
+
"persistSession": true,
|
|
92
|
+
"directive": "You are a strict reviewer. Evaluate the plan for correctness, completeness, and feasibility.",
|
|
93
|
+
"promptTemplate": "Read the content in {{artifactPath}} and perform a review. Append your review to the ## Review section at the end of the file. If the content passes, write [APPROVED] at the end of the review. Otherwise provide specific suggestions for improvement.",
|
|
94
|
+
"tools": "Agent,Bash,Edit,Glob,Grep,Read,Skill,TaskStop,TodoWrite,WebFetch,WebSearch,Write",
|
|
95
|
+
"pluginDirs": [
|
|
96
|
+
"plugins/cortex-common",
|
|
97
|
+
"plugins/cortex-system"
|
|
98
|
+
]
|
|
99
|
+
},
|
|
100
|
+
"plan-reviewer": {
|
|
101
|
+
"name": "plan-reviewer",
|
|
102
|
+
"description": "Plan Reviewer — audit one phase's output against the external plan's acceptance criteria in the plan-gate template, issue Approve / Revise / Reject on the last line",
|
|
103
|
+
"profile": "execute",
|
|
104
|
+
"persistSession": false,
|
|
105
|
+
"directive": "file:plan-reviewer.md",
|
|
106
|
+
"promptTemplate": "Execute the plan-phase audit per the plan-reviewer directive.\n\nTask / context (must declare plan path, phase under review, and where the phase's artifacts live):\n{{input}}\n\n---\n\nWrite the review to {{artifactPath}}. Walk every acceptance criterion of the phase explicitly (met / partially met / not met with a citation). End the artifact with a single line in the exact form: `Verdict: Approve | Revise | Reject` (one word, no modifiers).",
|
|
107
|
+
"tools": "Agent,Bash,Edit,Glob,Grep,Read,Skill,TaskStop,TodoWrite,WebFetch,WebSearch,Write",
|
|
108
|
+
"pluginDirs": [
|
|
109
|
+
"plugins/cortex-common",
|
|
110
|
+
"plugins/cortex-stage-gate"
|
|
111
|
+
]
|
|
112
|
+
},
|
|
113
|
+
"plan-executor": {
|
|
114
|
+
"name": "plan-executor",
|
|
115
|
+
"description": "Plan Executor — translate Plan Reviewer's verdict into task creation in the plan-gate template (Approve→next phase / Revise→patch+retry gate / Reject→stop), do not modify plan file structure",
|
|
116
|
+
"profile": "plan",
|
|
117
|
+
"persistSession": false,
|
|
118
|
+
"directive": "file:plan-executor.md",
|
|
119
|
+
"promptTemplate": "Translate Plan Reviewer's verdict into operations per the plan-executor directive.\n\nPlan Reviewer's report (previous step):\n{{previousOutput}}\n\n---\n\nOriginal task / context:\n{{input}}\n\n---\n\nReviewer's full artifact is at {{artifactPath}} — read it end-to-end first, extract the `Verdict:` word, then run the matching branch (Approve / Revise / Reject). All new tasks MUST carry `template:plan-gate` and full metadata; gate tasks always start `PLAN-GATE: `. Do NOT modify the plan file's structure or acceptance criteria.",
|
|
120
|
+
"tools": "Agent,Bash,Edit,Glob,Grep,Read,Skill,TaskStop,TodoWrite,WebFetch,WebSearch,Write",
|
|
121
|
+
"pluginDirs": [
|
|
122
|
+
"plugins/cortex-stage-gate"
|
|
123
|
+
]
|
|
124
|
+
},
|
|
125
|
+
"milestone-reviewer": {
|
|
126
|
+
"name": "milestone-reviewer",
|
|
127
|
+
"description": "Milestone Reviewer — execute adversarial review in the milestone-gate template, check milestone output against roadmap.md success conditions, output Blocker / Nice-to-have, do not issue verdict (Director is responsible)",
|
|
128
|
+
"profile": "execute",
|
|
129
|
+
"persistSession": false,
|
|
130
|
+
"directive": "file:milestone-reviewer.md",
|
|
131
|
+
"promptTemplate": "Execute the milestone adversarial audit per the milestone-reviewer directive.\n\nTask / context:\n{{input}}\n\n---\n\nWrite the review to {{artifactPath}}. Cover every dimension the milestone's success criteria can be judged on. Each issue must carry a citation and a Blocker / Nice-to-have label. Do NOT issue a Director-style verdict — that belongs to Director.",
|
|
132
|
+
"tools": "Agent,Bash,Edit,Glob,Grep,Read,Skill,TaskStop,TodoWrite,WebFetch,WebSearch,Write",
|
|
133
|
+
"pluginDirs": [
|
|
134
|
+
"plugins/cortex-common",
|
|
135
|
+
"plugins/cortex-stage-gate"
|
|
136
|
+
]
|
|
137
|
+
},
|
|
138
|
+
"director": {
|
|
139
|
+
"name": "director",
|
|
140
|
+
"description": "Project Director — consume Milestone Reviewer report in the milestone-gate template and issue Proceed / Iterate / Pivot / Abort verdict; write result to artifact",
|
|
141
|
+
"profile": "execute",
|
|
142
|
+
"persistSession": false,
|
|
143
|
+
"directive": "file:director.md",
|
|
144
|
+
"promptTemplate": "Execute the milestone verdict per the director directive.\n\nMilestone Reviewer's report (previous step):\n{{previousOutput}}\n\n---\n\nOriginal task / context:\n{{input}}\n\n---\n\nReviewer's full artifact is at {{artifactPath}} — read it end-to-end first. Write your analysis and the final `Verdict:` line back to the same artifact. Artifact MUST agree on verdict word and top reasons.",
|
|
145
|
+
"tools": "Agent,Bash,Edit,Glob,Grep,Read,Skill,TaskStop,TodoWrite,WebFetch,WebSearch,Write",
|
|
146
|
+
"pluginDirs": [
|
|
147
|
+
"plugins/cortex-common",
|
|
148
|
+
"plugins/cortex-stage-gate"
|
|
149
|
+
]
|
|
150
|
+
},
|
|
151
|
+
"milestone-executor": {
|
|
152
|
+
"name": "milestone-executor",
|
|
153
|
+
"description": "Milestone Executor — translate Director's verdict into roadmap updates and task creation in the milestone-gate template, all writes go to project files",
|
|
154
|
+
"profile": "plan",
|
|
155
|
+
"persistSession": false,
|
|
156
|
+
"directive": "file:milestone-executor.md",
|
|
157
|
+
"promptTemplate": "Translate Director's verdict into operations per the milestone-executor directive.\n\nDirector's analysis (previous step):\n{{previousOutput}}\n\n---\n\nOriginal task / context:\n{{input}}\n\n---\n\nDirector's full artifact is at {{artifactPath}} — read it end-to-end first and extract the `Verdict:` word. Then execute the matching branch (Proceed / Iterate / Pivot / Abort) per directive.",
|
|
158
|
+
"tools": "Agent,Bash,Edit,Glob,Grep,Read,Skill,TaskStop,TodoWrite,WebFetch,WebSearch,Write",
|
|
159
|
+
"pluginDirs": [
|
|
160
|
+
"plugins/cortex-stage-gate"
|
|
161
|
+
]
|
|
162
|
+
},
|
|
163
|
+
"doc-writer": {
|
|
164
|
+
"name": "doc-writer",
|
|
165
|
+
"description": "Doc Writer — general document producer, outputs structured documents such as status / digest / decision / report / knowledge entry, writes to project files",
|
|
166
|
+
"profile": "plan",
|
|
167
|
+
"persistSession": true,
|
|
168
|
+
"directive": "file:doc-writer.md",
|
|
169
|
+
"entryStage": "write",
|
|
170
|
+
"stages": {
|
|
171
|
+
"write": {
|
|
172
|
+
"description": "Initial writing pass — produce or update the target document, then summarize changes in the artifact.",
|
|
173
|
+
"promptTemplate": "Task:\n{{input}}\n\nProduce or update the document(s) per the doc-writer directive. After writing, append `## Write Summary (iteration 1)` to {{artifactPath}} listing each file you modified and the key changes. Do NOT write `[APPROVED]` — only the reviewer writes that."
|
|
174
|
+
},
|
|
175
|
+
"retry": {
|
|
176
|
+
"description": "After a blocking `## Review`: fix and append `## Write Summary (iteration N)` + `[REVISED]`.",
|
|
177
|
+
"continuesSession": true,
|
|
178
|
+
"promptTemplate": "The Reviewer's `## Review` has been written to {{artifactPath}}. First verify each Blocker against its cited source — the Reviewer is not infallible. Then fix the document files per the feedback. When done, append `## Write Summary (iteration N)` and MUST write `[REVISED]` to {{artifactPath}} on its own line."
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
"tools": "Agent,Bash,Edit,Glob,Grep,Read,Skill,TaskStop,TodoWrite,WebFetch,WebSearch,Write",
|
|
182
|
+
"pluginDirs": [
|
|
183
|
+
"plugins/cortex-common",
|
|
184
|
+
"plugins/cortex-system"
|
|
185
|
+
]
|
|
186
|
+
},
|
|
187
|
+
"doc-reviewer": {
|
|
188
|
+
"name": "doc-reviewer",
|
|
189
|
+
"description": "Doc Reviewer — audit Doc Writer's changes to project documents, grade by original requirements + Blocker / Nice-to-have",
|
|
190
|
+
"profile": "execute",
|
|
191
|
+
"persistSession": true,
|
|
192
|
+
"directive": "file:doc-reviewer.md",
|
|
193
|
+
"promptTemplate": "Audit Doc Writer's project-file changes (changes by other agents in the same files may appear — ignore those):\n{{modifiedFiles}}\n\nOriginal task:\n{{input}}\n\nApply the doc-reviewer directive and append your review to {{artifactPath}} under `## Review (iteration N)`. End the section with `[APPROVED]` if no Blockers remain; otherwise list the Blockers so Doc Writer can revise.",
|
|
194
|
+
"tools": "Agent,Bash,Edit,Glob,Grep,Read,Skill,TaskStop,TodoWrite,WebFetch,WebSearch,Write",
|
|
195
|
+
"pluginDirs": [
|
|
196
|
+
"plugins/cortex-common",
|
|
197
|
+
"plugins/cortex-system"
|
|
198
|
+
]
|
|
199
|
+
},
|
|
200
|
+
"coder": {
|
|
201
|
+
"name": "coder",
|
|
202
|
+
"description": "Coder — code implementation executor. Works in multiple stages in the coder-review template: plan → implement → retry, driven by transition graph rather than artifact section inference",
|
|
203
|
+
"profile": "plan",
|
|
204
|
+
"persistSession": true,
|
|
205
|
+
"directive": "file:coder.md",
|
|
206
|
+
"systemPrompt": "file:coder.md",
|
|
207
|
+
"entryStage": "plan",
|
|
208
|
+
"stages": {
|
|
209
|
+
"plan": {
|
|
210
|
+
"description": "Draft the implementation plan under `## Plan (iteration 1)`.",
|
|
211
|
+
"promptTemplate": "Task:\n{{input}}\n\nDraft your implementation plan under a new `## Plan (iteration 1)` section into {{artifactPath}}. You MUST DO NOT implement yet. JUST WRITE THE PLAN."
|
|
212
|
+
},
|
|
213
|
+
"implement": {
|
|
214
|
+
"description": "After `## Plan Review`: exit plan mode, implement, append `## Implementation Summary (iteration 1)`.",
|
|
215
|
+
"continuesSession": true,
|
|
216
|
+
"promptTemplate": "Begin implementation. When done, append `## Implementation Summary (iteration 1)` to the end of the artifact, listing changed files, commit short-SHAs, flagged ambiguities, env changes, and accept/reject with rationale for each plan-review item. Do NOT write `[IMPL-APPROVED]` — only the reviewer writes that."
|
|
217
|
+
},
|
|
218
|
+
"retry": {
|
|
219
|
+
"description": "After a blocking `## Impl Review`: fix and append `## Implementation Summary (iteration 2)` + `[REVISED]`.",
|
|
220
|
+
"continuesSession": true,
|
|
221
|
+
"promptTemplate": "The latest `## Impl Review` did not provide `[IMPL-APPROVED]`. Re-verify each Blocker against its cited source, then fix the code per the feedback. When finished revising, MUST write `[REVISED]` to {{artifactPath}} on its own line."
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
"tools": "Agent,Bash,Edit,Glob,Grep,Read,Skill,TaskStop,TodoWrite,WebFetch,WebSearch,Write",
|
|
225
|
+
"pluginDirs": [
|
|
226
|
+
"plugins/cortex-common",
|
|
227
|
+
"plugins/cortex-coder"
|
|
228
|
+
]
|
|
229
|
+
},
|
|
230
|
+
"coder-reviewer": {
|
|
231
|
+
"name": "coder-reviewer",
|
|
232
|
+
"description": "Coder Reviewer — works in two stages (planReview / implReview) in the coder-review template, transition graph determines stage rather than artifact inference",
|
|
233
|
+
"profile": "execute",
|
|
234
|
+
"persistSession": true,
|
|
235
|
+
"directive": "file:coder-reviewer.md",
|
|
236
|
+
"systemPrompt": "file:coder.md",
|
|
237
|
+
"entryStage": "planReview",
|
|
238
|
+
"stages": {
|
|
239
|
+
"planReview": {
|
|
240
|
+
"description": "Read `## Plan` and append `## Plan Review (iteration N)` — no approval marker here.",
|
|
241
|
+
"promptTemplate": "Task:\n{{input}}\n\nRead {{artifactPath}} end-to-end and review the latest `## Plan (iteration N)` section. Confirm Coder only touched the artifact file (no premature implementation). Append `## Plan Review (iteration N)` to {{artifactPath}}. Do NOT write any approval marker in Plan Review — Coder decides per-Blocker what to accept/reject."
|
|
242
|
+
},
|
|
243
|
+
"implReview": {
|
|
244
|
+
"description": "Read `## Implementation Summary` + diff and append `## Impl Review (iteration M)` — must end with `[IMPL-APPROVED]` or list Blockers.",
|
|
245
|
+
"continuesSession": true,
|
|
246
|
+
"promptTemplate": "Audit Coder's project-file changes (changes by other agents in the same files may appear — ignore those):\n{{modifiedFiles}}\n\nRead the latest `## Implementation Summary (iteration M)` in {{artifactPath}} (and the following `## Response to Impl Review` if present). Append `## Impl Review (iteration M)` to {{artifactPath}}. **Remember: you MUST write your review to {{artifactPath}}.** If approved, end with `[IMPL-APPROVED]`; otherwise list the Blockers. Coder gets only 1 retry after the first block; beyond that the pipeline ends. Do not fabricate approval markers."
|
|
247
|
+
}
|
|
248
|
+
},
|
|
249
|
+
"tools": "Agent,Bash,Edit,Glob,Grep,Read,Skill,TaskStop,TodoWrite,WebFetch,WebSearch,Write",
|
|
250
|
+
"pluginDirs": [
|
|
251
|
+
"plugins/cortex-common",
|
|
252
|
+
"plugins/cortex-coder"
|
|
253
|
+
]
|
|
254
|
+
},
|
|
255
|
+
"executor": {
|
|
256
|
+
"name": "executor",
|
|
257
|
+
"description": "Executor — general task executor, performs assigned work (edit files, run commands, modify code, config changes, etc.), writes results to artifact. Stages: execute → retry",
|
|
258
|
+
"profile": "execute",
|
|
259
|
+
"persistSession": true,
|
|
260
|
+
"directive": "file:executor.md",
|
|
261
|
+
"systemPrompt": "file:worker.md",
|
|
262
|
+
"entryStage": "execute",
|
|
263
|
+
"stages": {
|
|
264
|
+
"execute": {
|
|
265
|
+
"description": "Execute the task, write ## Execute Summary to artifact",
|
|
266
|
+
"promptTemplate": "Task:\n{{input}}\n\nExecute the task per the executor directive. After completion, append `## Execute Summary (iteration 1)` to {{artifactPath}} listing what you did, what changed, and any decisions made. Do NOT write `[APPROVED]` — only the reviewer writes that."
|
|
267
|
+
},
|
|
268
|
+
"retry": {
|
|
269
|
+
"description": "Address reviewer Blockers, write [REVISED] after fixing",
|
|
270
|
+
"continuesSession": true,
|
|
271
|
+
"promptTemplate": "The Reviewer's `## Review` has been written to {{artifactPath}}. First verify each Blocker against its cited source — the Reviewer is not infallible. Fix the issues per the feedback. When done, append `## Execute Summary (iteration N)` and MUST write `[REVISED]` to {{artifactPath}} on its own line."
|
|
272
|
+
}
|
|
273
|
+
},
|
|
274
|
+
"tools": "Agent,Bash,Edit,Glob,Grep,Read,Skill,TaskStop,Write,WebFetch,WebSearch",
|
|
275
|
+
"pluginDirs": [
|
|
276
|
+
"plugins/cortex-common",
|
|
277
|
+
"plugins/cortex-system"
|
|
278
|
+
]
|
|
279
|
+
},
|
|
280
|
+
"executor-reviewer": {
|
|
281
|
+
"name": "executor-reviewer",
|
|
282
|
+
"description": "Executor Reviewer — audit Executor's execution results, check correctness, completeness, and safety against task requirements + diff",
|
|
283
|
+
"profile": "execute",
|
|
284
|
+
"persistSession": true,
|
|
285
|
+
"directive": "file:executor-reviewer.md",
|
|
286
|
+
"systemPrompt": "file:worker.md",
|
|
287
|
+
"promptTemplate": "Audit Executor's work. Read `## Execute Summary` at {{artifactPath}}, cross-check the modified files:\n{{modifiedFiles}}\n\nOriginal task:\n{{input}}\n\nApply the executor-reviewer directive and append your review to {{artifactPath}} under `## Review (iteration N)`. End the section with `[APPROVED]` if no Blockers remain; otherwise list the Blockers so Executor can revise.",
|
|
288
|
+
"tools": "Agent,Bash,Edit,Glob,Grep,Read,Skill,TaskStop,Write,WebFetch,WebSearch",
|
|
289
|
+
"pluginDirs": [
|
|
290
|
+
"plugins/cortex-common",
|
|
291
|
+
"plugins/cortex-system"
|
|
292
|
+
]
|
|
293
|
+
}
|
|
294
|
+
},
|
|
295
|
+
"templates": {
|
|
296
|
+
"default": {
|
|
297
|
+
"name": "default",
|
|
298
|
+
"description": "Single agent with file workspace; entry agent resolves to current !agent",
|
|
299
|
+
"agents": [
|
|
300
|
+
"__active__"
|
|
301
|
+
],
|
|
302
|
+
"transitions": [],
|
|
303
|
+
"entryAgent": "__active__",
|
|
304
|
+
"maxTotalSteps": 1
|
|
305
|
+
},
|
|
306
|
+
"scheduler": {
|
|
307
|
+
"name": "scheduler",
|
|
308
|
+
"description": "Scheduled task — single agent + onEnd hook (compound + git commit)",
|
|
309
|
+
"agents": [
|
|
310
|
+
"scheduler-main"
|
|
311
|
+
],
|
|
312
|
+
"transitions": [],
|
|
313
|
+
"entryAgent": "scheduler-main",
|
|
314
|
+
"maxTotalSteps": 1,
|
|
315
|
+
"hooks": {
|
|
316
|
+
"onEnd": {
|
|
317
|
+
"command": "node ~/.cortex/hooks/post-task-hook.mjs",
|
|
318
|
+
"args": [
|
|
319
|
+
"scheduler-main"
|
|
320
|
+
],
|
|
321
|
+
"timeout": 10000
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
},
|
|
325
|
+
"plan-review": {
|
|
326
|
+
"name": "plan-review",
|
|
327
|
+
"description": "Plan-then-review (no execution): planner drafts → reviewer audits → END. Use this when you want a multi-step plan adversarially reviewed before committing to execution.",
|
|
328
|
+
"agents": [
|
|
329
|
+
"planner",
|
|
330
|
+
"reviewer"
|
|
331
|
+
],
|
|
332
|
+
"transitions": [
|
|
333
|
+
{
|
|
334
|
+
"from": "planner",
|
|
335
|
+
"to": "reviewer",
|
|
336
|
+
"condition": {
|
|
337
|
+
"type": "always"
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
],
|
|
341
|
+
"entryAgent": "planner",
|
|
342
|
+
"maxTotalSteps": 2
|
|
343
|
+
},
|
|
344
|
+
"doc-review": {
|
|
345
|
+
"name": "doc-review",
|
|
346
|
+
"description": "Generic produce-then-audit for documents (status / digest / decision / report / knowledge entry). Stages: doc-writer(write) → doc-reviewer → (if not [APPROVED]) doc-writer(retry, write [REVISED] at end) → END",
|
|
347
|
+
"agents": [
|
|
348
|
+
"doc-writer",
|
|
349
|
+
"doc-reviewer"
|
|
350
|
+
],
|
|
351
|
+
"transitions": [
|
|
352
|
+
{
|
|
353
|
+
"from": "doc-writer:write",
|
|
354
|
+
"to": "doc-reviewer",
|
|
355
|
+
"condition": {
|
|
356
|
+
"type": "always"
|
|
357
|
+
}
|
|
358
|
+
},
|
|
359
|
+
{
|
|
360
|
+
"from": "doc-reviewer",
|
|
361
|
+
"to": "doc-writer:retry",
|
|
362
|
+
"condition": {
|
|
363
|
+
"type": "convergence",
|
|
364
|
+
"marker": "[APPROVED]",
|
|
365
|
+
"maxIterations": 1
|
|
366
|
+
}
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
"from": "doc-writer:retry",
|
|
370
|
+
"to": "doc-reviewer",
|
|
371
|
+
"condition": {
|
|
372
|
+
"type": "output_not_contains",
|
|
373
|
+
"pattern": "\\[REVISED\\]"
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
],
|
|
377
|
+
"entryAgent": "doc-writer",
|
|
378
|
+
"entryStage": "write",
|
|
379
|
+
"maxTotalSteps": 4,
|
|
380
|
+
"hooks": {
|
|
381
|
+
"onEnd": {
|
|
382
|
+
"command": "node ~/.cortex/hooks/post-task-hook.mjs",
|
|
383
|
+
"args": [
|
|
384
|
+
"doc-writer"
|
|
385
|
+
],
|
|
386
|
+
"timeout": 10000
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
},
|
|
390
|
+
"coder-review": {
|
|
391
|
+
"name": "coder-review",
|
|
392
|
+
"description": "Stage-driven coder loop: coder(plan) → coder(implement) → reviewer(implReview) → (if implReview lacks [IMPL-APPROVED]) coder(retry, write [REVISED] at end) → END. Each stage's prompt is selected by the transition graph in thread-engine, no longer inferred from artifact sections.",
|
|
393
|
+
"agents": [
|
|
394
|
+
"coder",
|
|
395
|
+
"coder-reviewer"
|
|
396
|
+
],
|
|
397
|
+
"transitions": [
|
|
398
|
+
{
|
|
399
|
+
"from": "coder:plan",
|
|
400
|
+
"to": "coder:implement",
|
|
401
|
+
"condition": {
|
|
402
|
+
"type": "always"
|
|
403
|
+
}
|
|
404
|
+
},
|
|
405
|
+
{
|
|
406
|
+
"from": "coder:implement",
|
|
407
|
+
"to": "coder-reviewer:implReview",
|
|
408
|
+
"condition": {
|
|
409
|
+
"type": "always"
|
|
410
|
+
}
|
|
411
|
+
},
|
|
412
|
+
{
|
|
413
|
+
"from": "coder-reviewer:implReview",
|
|
414
|
+
"to": "coder:retry",
|
|
415
|
+
"condition": {
|
|
416
|
+
"type": "convergence",
|
|
417
|
+
"marker": "[IMPL-APPROVED]",
|
|
418
|
+
"maxIterations": 1
|
|
419
|
+
}
|
|
420
|
+
},
|
|
421
|
+
{
|
|
422
|
+
"from": "coder:retry",
|
|
423
|
+
"to": "coder-reviewer:implReview",
|
|
424
|
+
"condition": {
|
|
425
|
+
"type": "output_not_contains",
|
|
426
|
+
"pattern": "\\[REVISED\\]"
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
],
|
|
430
|
+
"entryAgent": "coder",
|
|
431
|
+
"entryStage": "plan",
|
|
432
|
+
"maxTotalSteps": 6,
|
|
433
|
+
"hooks": {
|
|
434
|
+
"onEnd": {
|
|
435
|
+
"command": "node ~/.cortex/hooks/post-task-hook.mjs",
|
|
436
|
+
"args": [
|
|
437
|
+
"coder"
|
|
438
|
+
],
|
|
439
|
+
"timeout": 10000
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
},
|
|
443
|
+
"plan-gate": {
|
|
444
|
+
"name": "plan-gate",
|
|
445
|
+
"description": "Plan-phase gate: plan-reviewer audits one phase against the externally-supplied plan's acceptance criteria and issues Approve / Revise / Reject; plan-executor dispatches the matching branch (next-phase tasks / patch tasks / stop). Does NOT touch roadmap.md or plan-file structure.",
|
|
446
|
+
"agents": [
|
|
447
|
+
"plan-reviewer",
|
|
448
|
+
"plan-executor"
|
|
449
|
+
],
|
|
450
|
+
"transitions": [
|
|
451
|
+
{
|
|
452
|
+
"from": "plan-reviewer",
|
|
453
|
+
"to": "plan-executor",
|
|
454
|
+
"condition": {
|
|
455
|
+
"type": "always"
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
],
|
|
459
|
+
"entryAgent": "plan-reviewer",
|
|
460
|
+
"maxTotalSteps": 3,
|
|
461
|
+
"hooks": {
|
|
462
|
+
"onEnd": {
|
|
463
|
+
"command": "node ~/.cortex/hooks/post-task-hook.mjs",
|
|
464
|
+
"args": [
|
|
465
|
+
"plan-executor"
|
|
466
|
+
],
|
|
467
|
+
"timeout": 10000
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
},
|
|
471
|
+
"milestone-gate": {
|
|
472
|
+
"name": "milestone-gate",
|
|
473
|
+
"description": "Milestone evaluation: adversarial review → strategic verdict (Proceed/Iterate/Pivot/Abort) → operational follow-up. milestone-reviewer audits milestone output → director issues verdict → milestone-executor writes roadmap / creates next-phase tasks. Suitable for phase decisions in any mission-driven project.",
|
|
474
|
+
"agents": [
|
|
475
|
+
"milestone-reviewer",
|
|
476
|
+
"director",
|
|
477
|
+
"milestone-executor"
|
|
478
|
+
],
|
|
479
|
+
"transitions": [
|
|
480
|
+
{
|
|
481
|
+
"from": "milestone-reviewer",
|
|
482
|
+
"to": "director",
|
|
483
|
+
"condition": {
|
|
484
|
+
"type": "always"
|
|
485
|
+
}
|
|
486
|
+
},
|
|
487
|
+
{
|
|
488
|
+
"from": "director",
|
|
489
|
+
"to": "milestone-executor",
|
|
490
|
+
"condition": {
|
|
491
|
+
"type": "always"
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
],
|
|
495
|
+
"entryAgent": "milestone-reviewer",
|
|
496
|
+
"maxTotalSteps": 4,
|
|
497
|
+
"hooks": {
|
|
498
|
+
"onEnd": {
|
|
499
|
+
"command": "node ~/.cortex/hooks/post-task-hook.mjs",
|
|
500
|
+
"args": [
|
|
501
|
+
"milestone-executor"
|
|
502
|
+
],
|
|
503
|
+
"timeout": 10000
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
},
|
|
507
|
+
"execute-review": {
|
|
508
|
+
"name": "execute-review",
|
|
509
|
+
"description": "Execute-then-review: executor executes task → executor-reviewer audits → at most 1 retry. Suitable for any verifiable task (code changes, config changes, file edits, script execution, etc.)",
|
|
510
|
+
"agents": ["executor", "executor-reviewer"],
|
|
511
|
+
"transitions": [
|
|
512
|
+
{ "from": "executor:execute", "to": "executor-reviewer", "condition": { "type": "always" } },
|
|
513
|
+
{ "from": "executor-reviewer", "to": "executor:retry", "condition": { "type": "convergence", "marker": "[APPROVED]", "maxIterations": 1 } },
|
|
514
|
+
{ "from": "executor:retry", "to": "executor-reviewer", "condition": { "type": "output_not_contains", "pattern": "\\[REVISED\\]" } }
|
|
515
|
+
],
|
|
516
|
+
"entryAgent": "executor",
|
|
517
|
+
"entryStage": "execute",
|
|
518
|
+
"maxTotalSteps": 4,
|
|
519
|
+
"hooks": {
|
|
520
|
+
"onEnd": {
|
|
521
|
+
"command": "node ~/.cortex/hooks/post-task-hook.mjs",
|
|
522
|
+
"args": ["executor"],
|
|
523
|
+
"timeout": 10000
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# context/ Index
|
|
2
|
+
|
|
3
|
+
Root directory for project context. All project state, experiment records, knowledge entries, patterns, decisions, and scan reports live here.
|
|
4
|
+
|
|
5
|
+
## Directory Structure
|
|
6
|
+
|
|
7
|
+
| Path | Purpose | Description |
|
|
8
|
+
|------|---------|-------------|
|
|
9
|
+
| `OVERVIEW.md` | Global overview | One-line status per project + Last Scan date |
|
|
10
|
+
| `decisions/` | System-level decision records | Design decisions affecting Cortex overall behavior, named as `NNNN-title.md` |
|
|
11
|
+
| `projects/` | Project context | One subdirectory per active project |
|
|
12
|
+
| `scans/` | Knowledge scan reports | Named by date `YYYY-MM-DD.md`, each scan outputs here |
|
|
13
|
+
| `ideas/` | Idea incubation library | Directions in Incubating status, promoted to project when mature |
|
|
14
|
+
| `retrospectives/` | Experience distillation reports | Mined by `/deep-retrospective` from historical logs for cross-session knowledge, named as `YYYY-MM-DD-<topic>.md` |
|
|
15
|
+
| `user/` | User profile | Cross-project user personal preferences (identity, communication style, output format, etc.), maintained by `/user-learn`, hard limit 3KB |
|
|
16
|
+
| `PENDING_APPROVALS.md` | Approval queue | Operations requiring user confirmation, written by need-approval, managed by /approval |
|
|
17
|
+
|
|
18
|
+
## Lookup Rules
|
|
19
|
+
|
|
20
|
+
- **Find user preferences** -> `user/USER.md`
|
|
21
|
+
- **Find system-level decisions** -> `decisions/` (browse with ls, search with grep)
|
|
22
|
+
- **Find project-level decisions** -> `projects/<name>/decisions/`
|
|
23
|
+
- **Find project task queue** -> `projects/<name>/TASKS.md` (structured task list)
|
|
24
|
+
- **Find experience distillation** -> `retrospectives/YYYY-MM-DD-<topic>.md`
|
|
25
|
+
- **Find scan report** -> `scans/YYYY-MM-DD.md`
|
|
26
|
+
- **Find project current state** -> `projects/<name>/STATUS.md`
|
|
27
|
+
- **Find project execution friction/efficiency issues** -> `projects/<name>/ISSUES.md`
|
|
28
|
+
- **Find experiment records** -> `projects/<name>/experiments/index.md` (index table), details via Read specific `EXP-NNN.md`
|
|
29
|
+
- **Find knowledge entries** -> `projects/<name>/knowledge/index.md` (index table), details via Read specific `K-NNN.md`
|
|
30
|
+
- **Find cross-experiment patterns** -> `projects/<name>/patterns/index.md`
|
|
31
|
+
- **Find completed task history** -> `projects/<name>/tasks-archive.md` (auto-archive >3 days after completion)
|
|
32
|
+
- **Find project goals** -> `projects/<name>/mission.md`
|
|
33
|
+
- **Find roadmap** -> `projects/<name>/roadmap.md`
|
|
34
|
+
- **Find incubating direction ideas** -> `ideas/<name>.md`
|
|
35
|
+
- **Find global overview** -> `OVERVIEW.md`
|
|
36
|
+
- **Find pending approval operations** -> `PENDING_APPROVALS.md`
|
|
37
|
+
|
|
38
|
+
## Key System Decisions
|
|
39
|
+
|
|
40
|
+
<!-- Add inline reference here after adding a new decision -->
|