oh-my-codex-cli 0.1.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/.agent/skills/agent-kb/HOW_TO_USE.md +428 -0
- package/.agent/skills/agent-kb/README.md +46 -0
- package/.agent/skills/agent-kb/SKILL.md +128 -0
- package/.agent/skills/agent-kb/references/intelligent-analysis-explained.md +333 -0
- package/.agent/skills/agent-kb/references/query-optimization.md +225 -0
- package/.agent/skills/aireview/SKILL.md +704 -0
- package/.agent/skills/analyze/SKILL.md +81 -0
- package/.agent/skills/architect-planner/HOW_TO_USE.md +238 -0
- package/.agent/skills/architect-planner/README.md +41 -0
- package/.agent/skills/architect-planner/SKILL.md +539 -0
- package/.agent/skills/auto-mbti/SKILL.md +291 -0
- package/.agent/skills/autopilot/SKILL.md +222 -0
- package/.agent/skills/backend-patterns/SKILL.md +602 -0
- package/.agent/skills/bdd-generator/README.md +78 -0
- package/.agent/skills/bdd-generator/SKILL.md +436 -0
- package/.agent/skills/brainstorming/HOW_TO_USE.md +289 -0
- package/.agent/skills/brainstorming/README.md +41 -0
- package/.agent/skills/brainstorming/SKILL.md +165 -0
- package/.agent/skills/build-fix/SKILL.md +190 -0
- package/.agent/skills/cancel/SKILL.md +658 -0
- package/.agent/skills/checkpoint/SKILL.md +94 -0
- package/.agent/skills/code-review/SKILL.md +273 -0
- package/.agent/skills/coding-standards/SKILL.md +535 -0
- package/.agent/skills/conductor/SKILL.md +128 -0
- package/.agent/skills/conductor/commands/conductor/implement.toml +358 -0
- package/.agent/skills/conductor/commands/conductor/newTrack.toml +142 -0
- package/.agent/skills/conductor/commands/conductor/revert.toml +123 -0
- package/.agent/skills/conductor/commands/conductor/setup.toml +429 -0
- package/.agent/skills/conductor/commands/conductor/status.toml +57 -0
- package/.agent/skills/conductor/scripts/install.sh +89 -0
- package/.agent/skills/conductor/templates/code_styleguides/csharp.md +115 -0
- package/.agent/skills/conductor/templates/code_styleguides/dart.md +238 -0
- package/.agent/skills/conductor/templates/code_styleguides/general.md +23 -0
- package/.agent/skills/conductor/templates/code_styleguides/go.md +48 -0
- package/.agent/skills/conductor/templates/code_styleguides/html-css.md +49 -0
- package/.agent/skills/conductor/templates/code_styleguides/javascript.md +51 -0
- package/.agent/skills/conductor/templates/code_styleguides/python.md +37 -0
- package/.agent/skills/conductor/templates/code_styleguides/typescript.md +43 -0
- package/.agent/skills/conductor/templates/rules/README.md +23 -0
- package/.agent/skills/conductor/templates/rules/agents.md +49 -0
- package/.agent/skills/conductor/templates/rules/coding-style.md +70 -0
- package/.agent/skills/conductor/templates/rules/dev.md +20 -0
- package/.agent/skills/conductor/templates/rules/git-workflow.md +45 -0
- package/.agent/skills/conductor/templates/rules/hooks.md +6 -0
- package/.agent/skills/conductor/templates/rules/patterns.md +55 -0
- package/.agent/skills/conductor/templates/rules/performance.md +47 -0
- package/.agent/skills/conductor/templates/rules/research.md +26 -0
- package/.agent/skills/conductor/templates/rules/review.md +22 -0
- package/.agent/skills/conductor/templates/rules/security.md +36 -0
- package/.agent/skills/conductor/templates/rules/testing.md +30 -0
- package/.agent/skills/conductor/templates/workflow.md +333 -0
- package/.agent/skills/consensus/HOW_TO_USE.md +191 -0
- package/.agent/skills/consensus/README.md +41 -0
- package/.agent/skills/consensus/SKILL.md +317 -0
- package/.agent/skills/content-research-writer/SKILL.md +537 -0
- package/.agent/skills/debug-analysis/SKILL.md +331 -0
- package/.agent/skills/deepinit/SKILL.md +347 -0
- package/.agent/skills/deepsearch/SKILL.md +56 -0
- package/.agent/skills/doctor/SKILL.md +158 -0
- package/.agent/skills/drawio/EXAMPLES.md +382 -0
- package/.agent/skills/drawio/QUICK_START.md +237 -0
- package/.agent/skills/drawio/README.md +315 -0
- package/.agent/skills/drawio/SETUP_GUIDE.md +254 -0
- package/.agent/skills/drawio/SKILL.md +1176 -0
- package/.agent/skills/e2e/SKILL.md +396 -0
- package/.agent/skills/ecomode/SKILL.md +160 -0
- package/.agent/skills/electron-driver/SKILL.md +144 -0
- package/.agent/skills/electron-driver/scripts/driver-template.js +71 -0
- package/.agent/skills/eval/SKILL.md +140 -0
- package/.agent/skills/eval-harness/SKILL.md +242 -0
- package/.agent/skills/evolve/SKILL.md +213 -0
- package/.agent/skills/frontend-design/SKILL.md +42 -0
- package/.agent/skills/frontend-patterns/SKILL.md +646 -0
- package/.agent/skills/frontend-ui-ux/SKILL.md +70 -0
- package/.agent/skills/git-master/SKILL.md +75 -0
- package/.agent/skills/help/SKILL.md +89 -0
- package/.agent/skills/iterative-retrieval/SKILL.md +217 -0
- package/.agent/skills/local-skills-setup/SKILL.md +483 -0
- package/.agent/skills/log-analyzer/SKILL.md +187 -0
- package/.agent/skills/mcp-setup/SKILL.md +226 -0
- package/.agent/skills/multi-model-research/HOW_TO_USE.md +614 -0
- package/.agent/skills/multi-model-research/README.md +233 -0
- package/.agent/skills/multi-model-research/SKILL.md +541 -0
- package/.agent/skills/multi-model-research/references/troubleshooting.md +415 -0
- package/.agent/skills/note/SKILL.md +80 -0
- package/.agent/skills/omc-setup/SKILL.md +219 -0
- package/.agent/skills/orchestrate/SKILL.md +620 -0
- package/.agent/skills/patent-workflow/IMPLEMENTATION_SUMMARY.md +500 -0
- package/.agent/skills/patent-workflow/README.md +455 -0
- package/.agent/skills/patent-workflow/SKILL.md +1036 -0
- package/.agent/skills/patent-workflow/tools/irr_checker.py +260 -0
- package/.agent/skills/patent-workflow/tools/sample_terminology.json +49 -0
- package/.agent/skills/patent-workflow/tools/term_checker.py +355 -0
- package/.agent/skills/pattern-recognition/SKILL.md +792 -0
- package/.agent/skills/pipeline/SKILL.md +448 -0
- package/.agent/skills/plan/SKILL.md +309 -0
- package/.agent/skills/planning-methodology/SKILL.md +370 -0
- package/.agent/skills/planning-with-files/SKILL.md +210 -0
- package/.agent/skills/planning-with-files/examples.md +202 -0
- package/.agent/skills/planning-with-files/reference.md +218 -0
- package/.agent/skills/planning-with-files/scripts/check-complete.ps1 +42 -0
- package/.agent/skills/planning-with-files/scripts/check-complete.sh +44 -0
- package/.agent/skills/planning-with-files/scripts/init-session.ps1 +120 -0
- package/.agent/skills/planning-with-files/scripts/init-session.sh +120 -0
- package/.agent/skills/planning-with-files/scripts/session-catchup.py +208 -0
- package/.agent/skills/planning-with-files/templates/findings.md +95 -0
- package/.agent/skills/planning-with-files/templates/progress.md +114 -0
- package/.agent/skills/planning-with-files/templates/task_plan.md +132 -0
- package/.agent/skills/project-analyze/CLAUDE.md +18 -0
- package/.agent/skills/project-analyze/HOW_TO_USE.md +145 -0
- package/.agent/skills/project-analyze/README.md +42 -0
- package/.agent/skills/project-analyze/SKILL.md +289 -0
- package/.agent/skills/project-analyze/SKILL.md.backup +287 -0
- package/.agent/skills/project-analyze/SKILL.md.backup_20260105_093646 +287 -0
- package/.agent/skills/project-analyze/assets/analysis-report-template.md +433 -0
- package/.agent/skills/project-analyze/references/analysis-patterns.md +422 -0
- package/.agent/skills/project-analyze/references/projectmind-explained.md +535 -0
- package/.agent/skills/project-session-manager/SKILL.md +428 -0
- package/.agent/skills/project-session-manager/lib/config.sh +86 -0
- package/.agent/skills/project-session-manager/lib/parse.sh +121 -0
- package/.agent/skills/project-session-manager/lib/session.sh +132 -0
- package/.agent/skills/project-session-manager/lib/tmux.sh +103 -0
- package/.agent/skills/project-session-manager/lib/worktree.sh +171 -0
- package/.agent/skills/project-session-manager/psm.sh +629 -0
- package/.agent/skills/project-session-manager/templates/feature.md +56 -0
- package/.agent/skills/project-session-manager/templates/issue-fix.md +57 -0
- package/.agent/skills/project-session-manager/templates/pr-review.md +65 -0
- package/.agent/skills/project-session-manager/templates/projects.json +19 -0
- package/.agent/skills/quality-check/HOW_TO_USE.md +171 -0
- package/.agent/skills/quality-check/README.md +50 -0
- package/.agent/skills/quality-check/SKILL.md +240 -0
- package/.agent/skills/quality-check/SKILL.md.backup +238 -0
- package/.agent/skills/quality-check/SKILL.md.backup_20260105_093646 +238 -0
- package/.agent/skills/quality-check/assets/quality-report-template.md +437 -0
- package/.agent/skills/quality-check/references/refactoring-patterns.md +550 -0
- package/.agent/skills/quality-check/references/scoring-criteria.md +454 -0
- package/.agent/skills/quality-validation/SKILL.md +519 -0
- package/.agent/skills/quality-validation/SKILL.md.backup +573 -0
- package/.agent/skills/quality-validation/SKILL.md.backup_20260105_093646 +573 -0
- package/.agent/skills/ralph/SKILL.md +236 -0
- package/.agent/skills/ralph-init/SKILL.md +78 -0
- package/.agent/skills/ralplan/SKILL.md +58 -0
- package/.agent/skills/refactor-clean/SKILL.md +49 -0
- package/.agent/skills/release/SKILL.md +84 -0
- package/.agent/skills/research/SKILL.md +526 -0
- package/.agent/skills/research-methodology/SKILL.md +268 -0
- package/.agent/skills/review/SKILL.md +53 -0
- package/.agent/skills/security-review/SKILL.md +509 -0
- package/.agent/skills/security-review/cloud-infrastructure-security.md +361 -0
- package/.agent/skills/setup-pm/SKILL.md +102 -0
- package/.agent/skills/skill/SKILL.md +424 -0
- package/.agent/skills/skill-create/SKILL.md +209 -0
- package/.agent/skills/skill-debugger/HOW_TO_USE.md +244 -0
- package/.agent/skills/skill-debugger/README.md +44 -0
- package/.agent/skills/skill-debugger/SKILL.md +326 -0
- package/.agent/skills/skill-debugger/diagnostic_checklist.md +115 -0
- package/.agent/skills/skill-development/SKILL.md +661 -0
- package/.agent/skills/skill-development/references/skill-creator-original.md +209 -0
- package/.agent/skills/skill-doc-generator/README.md +37 -0
- package/.agent/skills/skill-doc-generator/SKILL.md +331 -0
- package/.agent/skills/skill-quality-analyzer/HOW_TO_USE.md +243 -0
- package/.agent/skills/skill-quality-analyzer/README.md +61 -0
- package/.agent/skills/skill-quality-analyzer/SKILL.md +247 -0
- package/.agent/skills/skill-quality-analyzer/analyzer.py +209 -0
- package/.agent/skills/skill-quality-analyzer/expected_output.json +81 -0
- package/.agent/skills/skill-quality-analyzer/sample_input.json +9 -0
- package/.agent/skills/skill-tester/README.md +46 -0
- package/.agent/skills/skill-tester/SKILL.md +345 -0
- package/.agent/skills/start-dev/SKILL.md +701 -0
- package/.agent/skills/swarm/SKILL.md +691 -0
- package/.agent/skills/task-kb-lookup/SKILL.md +211 -0
- package/.agent/skills/task-kb-record/SKILL.md +417 -0
- package/.agent/skills/tdd/SKILL.md +446 -0
- package/.agent/skills/tdd-generator/DEMO.md +516 -0
- package/.agent/skills/tdd-generator/README.md +89 -0
- package/.agent/skills/tdd-generator/SKILL.md +278 -0
- package/.agent/skills/tdd-workflow/SKILL.md +424 -0
- package/.agent/skills/test-coverage/SKILL.md +48 -0
- package/.agent/skills/thinkdeep/HOW_TO_USE.md +183 -0
- package/.agent/skills/thinkdeep/README.md +41 -0
- package/.agent/skills/thinkdeep/SKILL.md +343 -0
- package/.agent/skills/ui-ux-pro-max/SKILL.md +228 -0
- package/.agent/skills/ui-ux-pro-max/data/charts.csv +26 -0
- package/.agent/skills/ui-ux-pro-max/data/colors.csv +97 -0
- package/.agent/skills/ui-ux-pro-max/data/landing.csv +31 -0
- package/.agent/skills/ui-ux-pro-max/data/products.csv +97 -0
- package/.agent/skills/ui-ux-pro-max/data/prompts.csv +24 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/react.csv +54 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/vue.csv +50 -0
- package/.agent/skills/ui-ux-pro-max/data/styles.csv +59 -0
- package/.agent/skills/ui-ux-pro-max/data/typography.csv +58 -0
- package/.agent/skills/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
- package/.agent/skills/ui-ux-pro-max/scripts/core.py +236 -0
- package/.agent/skills/ui-ux-pro-max/scripts/search.py +61 -0
- package/.agent/skills/ultrapilot/SKILL.md +647 -0
- package/.agent/skills/ultraqa/SKILL.md +152 -0
- package/.agent/skills/ultrawork/SKILL.md +123 -0
- package/.agent/skills/update-codemaps/SKILL.md +38 -0
- package/.agent/skills/update-docs/SKILL.md +52 -0
- package/.agent/skills/verification-loop/SKILL.md +140 -0
- package/.agent/skills/verify/SKILL.md +80 -0
- package/.agent/skills/writer-memory/SKILL.md +459 -0
- package/.agent/skills/writer-memory/lib/character-tracker.ts +338 -0
- package/.agent/skills/writer-memory/lib/memory-manager.ts +804 -0
- package/.agent/skills/writer-memory/lib/relationship-graph.ts +400 -0
- package/.agent/skills/writer-memory/lib/scene-organizer.ts +544 -0
- package/.agent/skills/writer-memory/lib/synopsis-builder.ts +339 -0
- package/.agent/skills/writer-memory/templates/synopsis-template.md +46 -0
- package/.governance/skill-lint.allowlist +4 -0
- package/.governance/skill-llm.allowlist +4 -0
- package/AGENTS.md +59 -0
- package/LICENSE +21 -0
- package/README.md +169 -0
- package/README.zh.md +145 -0
- package/bin/omcodex.js +8 -0
- package/commands/conductor/implement.toml +358 -0
- package/commands/conductor/newTrack.toml +142 -0
- package/commands/conductor/revert.toml +123 -0
- package/commands/conductor/setup.toml +429 -0
- package/commands/conductor/status.toml +57 -0
- package/docs/ALIGNMENT.md +40 -0
- package/docs/CODEX.md +133 -0
- package/docs/NOTIFY.md +81 -0
- package/docs/SKILL_GOVERNANCE.md +72 -0
- package/docs/SKILL_GOVERNANCE_FRAMEWORK.md +182 -0
- package/docs/SKILL_GOVERNANCE_FRAMEWORK.zh.md +170 -0
- package/package.json +50 -0
- package/prompts/architect.md +105 -0
- package/prompts/executor.md +134 -0
- package/prompts/planner.md +113 -0
- package/scripts/check-skill-governance.sh +84 -0
- package/scripts/check-skill-llm-governance.js +302 -0
- package/scripts/eval-skills.js +217 -0
- package/scripts/generate-catalog-docs.js +95 -0
- package/scripts/generate-codex-mcp-config.sh +22 -0
- package/scripts/install-codex-force.sh +5 -0
- package/scripts/install-codex-incremental.sh +5 -0
- package/scripts/install-codex.sh +79 -0
- package/scripts/notify-dispatch.js +15 -0
- package/scripts/setup-package-manager.js +137 -0
- package/src/catalog/generated/public-catalog.json +547 -0
- package/src/catalog/manifest.json +542 -0
- package/src/catalog/reader.js +43 -0
- package/src/catalog/schema.js +79 -0
- package/src/cli/doctor.js +62 -0
- package/src/cli/index.js +85 -0
- package/src/cli/notify.js +127 -0
- package/src/cli/route.js +43 -0
- package/src/cli/setup.js +155 -0
- package/src/cli/team.js +125 -0
- package/src/config/generator.js +119 -0
- package/src/mcp/memory-server.js +241 -0
- package/src/mcp/state-server.js +112 -0
- package/src/mcp/trace-server.js +168 -0
- package/src/notify/dispatch.js +74 -0
- package/src/notify/extensibility/dispatcher.js +113 -0
- package/src/notify/extensibility/events.js +15 -0
- package/src/notify/extensibility/loader.js +54 -0
- package/src/router/skill-router.js +90 -0
- package/src/team/auto-advance.js +72 -0
- package/src/team/orchestrator.js +82 -0
- package/src/team/state-store.js +33 -0
- package/src/utils/paths.js +33 -0
- package/templates/AGENTS.md +15 -0
- package/templates/catalog-manifest.json +542 -0
- package/templates/code_styleguides/csharp.md +115 -0
- package/templates/code_styleguides/dart.md +238 -0
- package/templates/code_styleguides/general.md +23 -0
- package/templates/code_styleguides/go.md +48 -0
- package/templates/code_styleguides/html-css.md +49 -0
- package/templates/code_styleguides/javascript.md +51 -0
- package/templates/code_styleguides/python.md +37 -0
- package/templates/code_styleguides/typescript.md +43 -0
- package/templates/rules/README.md +23 -0
- package/templates/rules/agents.md +49 -0
- package/templates/rules/coding-style.md +70 -0
- package/templates/rules/dev.md +20 -0
- package/templates/rules/git-workflow.md +45 -0
- package/templates/rules/notify.md +6 -0
- package/templates/rules/patterns.md +55 -0
- package/templates/rules/performance.md +47 -0
- package/templates/rules/research.md +26 -0
- package/templates/rules/review.md +22 -0
- package/templates/rules/security.md +36 -0
- package/templates/rules/testing.md +30 -0
- package/templates/workflow.md +333 -0
|
@@ -0,0 +1,658 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cancel
|
|
3
|
+
description: Cancel any active OMC mode (autopilot, ralph, ultrawork, ecomode, ultraqa, swarm, ultrapilot, pipeline)
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Cancel Skill
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
## Native Subagent Protocol (Codex)
|
|
10
|
+
|
|
11
|
+
Codex supports native subagents. Delegate with `spawn_agent`, coordinate with `send_input`, collect via `wait`, and clean up with `close_agent`.
|
|
12
|
+
|
|
13
|
+
Execution preference:
|
|
14
|
+
1. Use native subagents first for independent workstreams (parallel when possible).
|
|
15
|
+
2. Merge results in main thread and run final verification.
|
|
16
|
+
3. Fallback only when delegation is blocked: use the `[ANALYST]`/`[ARCHITECT]`/`[EXECUTOR]`/`[REVIEWER]` structure in a single response.
|
|
17
|
+
|
|
18
|
+
Minimal orchestration pattern:
|
|
19
|
+
```text
|
|
20
|
+
spawn_agent -> send_input (optional) -> wait -> close_agent
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
> Codex invocation: use `$cancel ...` or `cancel: ...`
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
Intelligent cancellation that detects and cancels the active OMC mode.
|
|
27
|
+
|
|
28
|
+
## What It Does
|
|
29
|
+
|
|
30
|
+
Automatically detects which mode is active and cancels it:
|
|
31
|
+
- **Autopilot**: Stops workflow, preserves progress for resume
|
|
32
|
+
- **Ralph**: Stops persistence loop, clears linked ultrawork if applicable
|
|
33
|
+
- **Ultrawork**: Stops parallel execution (standalone or linked)
|
|
34
|
+
- **Ecomode**: Stops token-efficient parallel execution (standalone or linked to ralph)
|
|
35
|
+
- **UltraQA**: Stops QA cycling workflow
|
|
36
|
+
- **Swarm**: Stops coordinated agent swarm, releases claimed tasks
|
|
37
|
+
- **Ultrapilot**: Stops parallel autopilot workers
|
|
38
|
+
- **Pipeline**: Stops sequential agent pipeline
|
|
39
|
+
|
|
40
|
+
## Usage
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
$cancel
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Or say: "cancelomc", "stopomc"
|
|
47
|
+
|
|
48
|
+
## Auto-Detection
|
|
49
|
+
|
|
50
|
+
The skill checks state files to determine what's active:
|
|
51
|
+
- `.omc/state/autopilot-state.json` → Autopilot detected
|
|
52
|
+
- `.omc/state/ralph-state.json` → Ralph detected
|
|
53
|
+
- `.omc/state/ultrawork-state.json` → Ultrawork detected
|
|
54
|
+
- `.omc/state/ecomode-state.json` → Ecomode detected
|
|
55
|
+
- `.omc/state/ultraqa-state.json` → UltraQA detected
|
|
56
|
+
- `.omc/state/swarm.db` → Swarm detected (SQLite database)
|
|
57
|
+
- `.omc/state/ultrapilot-state.json` → Ultrapilot detected
|
|
58
|
+
- `.omc/state/pipeline-state.json` → Pipeline detected
|
|
59
|
+
- `.omc/state/plan-consensus.json` → Plan Consensus detected
|
|
60
|
+
- `.omc/state/ralplan-state.json` → Plan Consensus detected (legacy)
|
|
61
|
+
|
|
62
|
+
If multiple modes are active, they're cancelled in order of dependency:
|
|
63
|
+
1. Autopilot (includes ralph/ultraqa/ecomode cleanup)
|
|
64
|
+
2. Ralph (includes linked ultrawork OR ecomode cleanup)
|
|
65
|
+
3. Ultrawork (standalone)
|
|
66
|
+
4. Ecomode (standalone)
|
|
67
|
+
5. UltraQA (standalone)
|
|
68
|
+
6. Swarm (standalone)
|
|
69
|
+
7. Ultrapilot (standalone)
|
|
70
|
+
8. Pipeline (standalone)
|
|
71
|
+
9. Plan Consensus (standalone)
|
|
72
|
+
|
|
73
|
+
## Force Clear All
|
|
74
|
+
|
|
75
|
+
To clear ALL state files regardless of what's active:
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
$cancel --force
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Or use the `--all` alias:
|
|
82
|
+
|
|
83
|
+
```
|
|
84
|
+
$cancel --all
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
This removes all state files:
|
|
88
|
+
- `.omc/state/autopilot-state.json`
|
|
89
|
+
- `.omc/state/ralph-state.json`
|
|
90
|
+
- `.omc/state/ultrawork-state.json`
|
|
91
|
+
- `.omc/state/ecomode-state.json`
|
|
92
|
+
- `.omc/state/ultraqa-state.json`
|
|
93
|
+
- `.omc/state/swarm.db`
|
|
94
|
+
- `.omc/state/swarm.db-wal`
|
|
95
|
+
- `.omc/state/swarm.db-shm`
|
|
96
|
+
- `.omc/state/swarm-active.marker`
|
|
97
|
+
- `.omc/state/ultrapilot-state.json`
|
|
98
|
+
- `.omc/state/pipeline-state.json`
|
|
99
|
+
- `.omc/state/plan-consensus.json`
|
|
100
|
+
- `.omc/state/ralplan-state.json`
|
|
101
|
+
- `~/.codex/ralph-state.json`
|
|
102
|
+
- `~/.codex/ultrawork-state.json`
|
|
103
|
+
- `~/.codex/ecomode-state.json`
|
|
104
|
+
|
|
105
|
+
## Implementation Steps
|
|
106
|
+
|
|
107
|
+
When you invoke this skill:
|
|
108
|
+
|
|
109
|
+
### 1. Parse Arguments
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
# Check for --force or --all flags
|
|
113
|
+
FORCE_MODE=false
|
|
114
|
+
if [[ "$*" == *"--force"* ]] || [[ "$*" == *"--all"* ]]; then
|
|
115
|
+
FORCE_MODE=true
|
|
116
|
+
fi
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### 2. Detect Active Modes
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
# Check which modes are active
|
|
123
|
+
AUTOPILOT_ACTIVE=false
|
|
124
|
+
RALPH_ACTIVE=false
|
|
125
|
+
ULTRAWORK_ACTIVE=false
|
|
126
|
+
ECOMODE_ACTIVE=false
|
|
127
|
+
ULTRAQA_ACTIVE=false
|
|
128
|
+
|
|
129
|
+
if [[ -f .omc/state/autopilot-state.json ]]; then
|
|
130
|
+
AUTOPILOT_ACTIVE=$(cat .omc/state/autopilot-state.json | jq -r '.active // false')
|
|
131
|
+
fi
|
|
132
|
+
|
|
133
|
+
if [[ -f .omc/state/ralph-state.json ]]; then
|
|
134
|
+
RALPH_ACTIVE=$(cat .omc/state/ralph-state.json | jq -r '.active // false')
|
|
135
|
+
fi
|
|
136
|
+
|
|
137
|
+
if [[ -f .omc/state/ultrawork-state.json ]]; then
|
|
138
|
+
ULTRAWORK_ACTIVE=$(cat .omc/state/ultrawork-state.json | jq -r '.active // false')
|
|
139
|
+
fi
|
|
140
|
+
|
|
141
|
+
if [[ -f .omc/state/ecomode-state.json ]]; then
|
|
142
|
+
ECOMODE_ACTIVE=$(cat .omc/state/ecomode-state.json | jq -r '.active // false')
|
|
143
|
+
fi
|
|
144
|
+
|
|
145
|
+
if [[ -f .omc/state/ultraqa-state.json ]]; then
|
|
146
|
+
ULTRAQA_ACTIVE=$(cat .omc/state/ultraqa-state.json | jq -r '.active // false')
|
|
147
|
+
fi
|
|
148
|
+
|
|
149
|
+
PLAN_CONSENSUS_ACTIVE=false
|
|
150
|
+
|
|
151
|
+
# Check both new and legacy locations
|
|
152
|
+
if [[ -f .omc/state/plan-consensus.json ]]; then
|
|
153
|
+
PLAN_CONSENSUS_ACTIVE=$(cat .omc/state/plan-consensus.json | jq -r '.active // false')
|
|
154
|
+
elif [[ -f .omc/state/ralplan-state.json ]]; then
|
|
155
|
+
PLAN_CONSENSUS_ACTIVE=$(cat .omc/state/ralplan-state.json | jq -r '.active // false')
|
|
156
|
+
fi
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### 3A. Force Mode (if --force or --all)
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
if [[ "$FORCE_MODE" == "true" ]]; then
|
|
163
|
+
echo "FORCE CLEAR: Removing all OMC state files..."
|
|
164
|
+
|
|
165
|
+
# Remove local state files
|
|
166
|
+
rm -f .omc/state/autopilot-state.json
|
|
167
|
+
rm -f .omc/state/ralph-state.json
|
|
168
|
+
rm -f .omc/state/ultrawork-state.json
|
|
169
|
+
rm -f .omc/state/ecomode-state.json
|
|
170
|
+
rm -f .omc/state/ultraqa-state.json
|
|
171
|
+
rm -f .omc/state/ralph-plan-state.json
|
|
172
|
+
rm -f .omc/state/ralph-verification.json
|
|
173
|
+
rm -f .omc/state/swarm.db
|
|
174
|
+
rm -f .omc/state/swarm.db-wal
|
|
175
|
+
rm -f .omc/state/swarm.db-shm
|
|
176
|
+
rm -f .omc/state/swarm-active.marker
|
|
177
|
+
rm -f .omc/state/ultrapilot-state.json
|
|
178
|
+
rm -f .omc/state/pipeline-state.json
|
|
179
|
+
rm -f .omc/state/plan-consensus.json
|
|
180
|
+
rm -f .omc/state/ralplan-state.json
|
|
181
|
+
|
|
182
|
+
# Remove global state files
|
|
183
|
+
rm -f ~/.codex/ralph-state.json
|
|
184
|
+
rm -f ~/.codex/ultrawork-state.json
|
|
185
|
+
rm -f ~/.codex/ecomode-state.json
|
|
186
|
+
|
|
187
|
+
echo "All OMC modes cleared. You are free to start fresh."
|
|
188
|
+
exit 0
|
|
189
|
+
fi
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
### 3B. Smart Cancellation (default)
|
|
193
|
+
|
|
194
|
+
#### If Autopilot Active
|
|
195
|
+
|
|
196
|
+
Call `cancelAutopilot()` from `src/hooks/autopilot/cancel.ts:27-78`:
|
|
197
|
+
|
|
198
|
+
```bash
|
|
199
|
+
# Autopilot handles its own cleanup + ralph + ultraqa
|
|
200
|
+
# Just mark autopilot as inactive (preserves state for resume)
|
|
201
|
+
if [[ -f .omc/state/autopilot-state.json ]]; then
|
|
202
|
+
# Clean up ralph if active
|
|
203
|
+
if [[ -f .omc/state/ralph-state.json ]]; then
|
|
204
|
+
RALPH_STATE=$(cat .omc/state/ralph-state.json)
|
|
205
|
+
LINKED_UW=$(echo "$RALPH_STATE" | jq -r '.linked_ultrawork // false')
|
|
206
|
+
|
|
207
|
+
# Clean linked ultrawork first
|
|
208
|
+
if [[ "$LINKED_UW" == "true" ]] && [[ -f .omc/state/ultrawork-state.json ]]; then
|
|
209
|
+
rm -f .omc/state/ultrawork-state.json
|
|
210
|
+
rm -f ~/.codex/ultrawork-state.json
|
|
211
|
+
echo "Cleaned up: ultrawork (linked to ralph)"
|
|
212
|
+
fi
|
|
213
|
+
|
|
214
|
+
# Clean ralph
|
|
215
|
+
rm -f .omc/state/ralph-state.json
|
|
216
|
+
rm -f ~/.codex/ralph-state.json
|
|
217
|
+
rm -f .omc/state/ralph-verification.json
|
|
218
|
+
echo "Cleaned up: ralph"
|
|
219
|
+
fi
|
|
220
|
+
|
|
221
|
+
# Clean up ultraqa if active
|
|
222
|
+
if [[ -f .omc/state/ultraqa-state.json ]]; then
|
|
223
|
+
rm -f .omc/state/ultraqa-state.json
|
|
224
|
+
echo "Cleaned up: ultraqa"
|
|
225
|
+
fi
|
|
226
|
+
|
|
227
|
+
# Mark autopilot inactive but preserve state
|
|
228
|
+
CURRENT_STATE=$(cat .omc/state/autopilot-state.json)
|
|
229
|
+
CURRENT_PHASE=$(echo "$CURRENT_STATE" | jq -r '.phase // "unknown"')
|
|
230
|
+
echo "$CURRENT_STATE" | jq '.active = false' > .omc/state/autopilot-state.json
|
|
231
|
+
|
|
232
|
+
echo "Autopilot cancelled at phase: $CURRENT_PHASE. Progress preserved for resume."
|
|
233
|
+
echo "Run $autopilot to resume."
|
|
234
|
+
fi
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
#### If Ralph Active (but not Autopilot)
|
|
238
|
+
|
|
239
|
+
Call `clearRalphState()` + `clearLinkedUltraworkState()` from `src/hooks/ralph-loop/index.ts:147-182`:
|
|
240
|
+
|
|
241
|
+
```bash
|
|
242
|
+
if [[ -f .omc/state/ralph-state.json ]]; then
|
|
243
|
+
# Check if ultrawork is linked
|
|
244
|
+
RALPH_STATE=$(cat .omc/state/ralph-state.json)
|
|
245
|
+
LINKED_UW=$(echo "$RALPH_STATE" | jq -r '.linked_ultrawork // false')
|
|
246
|
+
|
|
247
|
+
# Clean linked ultrawork first
|
|
248
|
+
if [[ "$LINKED_UW" == "true" ]] && [[ -f .omc/state/ultrawork-state.json ]]; then
|
|
249
|
+
UW_STATE=$(cat .omc/state/ultrawork-state.json)
|
|
250
|
+
UW_LINKED=$(echo "$UW_STATE" | jq -r '.linked_to_ralph // false')
|
|
251
|
+
|
|
252
|
+
# Only clear if it was linked to ralph
|
|
253
|
+
if [[ "$UW_LINKED" == "true" ]]; then
|
|
254
|
+
rm -f .omc/state/ultrawork-state.json
|
|
255
|
+
rm -f ~/.codex/ultrawork-state.json
|
|
256
|
+
echo "Cleaned up: ultrawork (linked to ralph)"
|
|
257
|
+
fi
|
|
258
|
+
fi
|
|
259
|
+
|
|
260
|
+
# Clean ralph state (both local and global)
|
|
261
|
+
rm -f .omc/state/ralph-state.json
|
|
262
|
+
rm -f ~/.codex/ralph-state.json
|
|
263
|
+
rm -f .omc/state/ralph-plan-state.json
|
|
264
|
+
rm -f .omc/state/ralph-verification.json
|
|
265
|
+
|
|
266
|
+
echo "Ralph cancelled. Persistent mode deactivated."
|
|
267
|
+
fi
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
#### If Ultrawork Active (standalone, not linked)
|
|
271
|
+
|
|
272
|
+
Call `deactivateUltrawork()` from `src/hooks/ultrawork/index.ts:150-173`:
|
|
273
|
+
|
|
274
|
+
```bash
|
|
275
|
+
if [[ -f .omc/state/ultrawork-state.json ]]; then
|
|
276
|
+
# Check if linked to ralph
|
|
277
|
+
UW_STATE=$(cat .omc/state/ultrawork-state.json)
|
|
278
|
+
LINKED=$(echo "$UW_STATE" | jq -r '.linked_to_ralph // false')
|
|
279
|
+
|
|
280
|
+
if [[ "$LINKED" == "true" ]]; then
|
|
281
|
+
echo "Ultrawork is linked to Ralph. Use $cancel to cancel both."
|
|
282
|
+
exit 1
|
|
283
|
+
fi
|
|
284
|
+
|
|
285
|
+
# Remove both local and global state
|
|
286
|
+
rm -f .omc/state/ultrawork-state.json
|
|
287
|
+
rm -f ~/.codex/ultrawork-state.json
|
|
288
|
+
|
|
289
|
+
echo "Ultrawork cancelled. Parallel execution mode deactivated."
|
|
290
|
+
fi
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
#### If UltraQA Active (standalone)
|
|
294
|
+
|
|
295
|
+
Call `clearUltraQAState()` from `src/hooks/ultraqa/index.ts:107-120`:
|
|
296
|
+
|
|
297
|
+
```bash
|
|
298
|
+
if [[ -f .omc/state/ultraqa-state.json ]]; then
|
|
299
|
+
rm -f .omc/state/ultraqa-state.json
|
|
300
|
+
echo "UltraQA cancelled. QA cycling workflow stopped."
|
|
301
|
+
fi
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
#### No Active Modes
|
|
305
|
+
|
|
306
|
+
```bash
|
|
307
|
+
echo "No active OMC modes detected."
|
|
308
|
+
echo ""
|
|
309
|
+
echo "Checked for:"
|
|
310
|
+
echo " - Autopilot (.omc/state/autopilot-state.json)"
|
|
311
|
+
echo " - Ralph (.omc/state/ralph-state.json)"
|
|
312
|
+
echo " - Ultrawork (.omc/state/ultrawork-state.json)"
|
|
313
|
+
echo " - UltraQA (.omc/state/ultraqa-state.json)"
|
|
314
|
+
echo ""
|
|
315
|
+
echo "Use --force to clear all state files anyway."
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
## Complete Implementation
|
|
319
|
+
|
|
320
|
+
Here's the complete bash implementation you should run:
|
|
321
|
+
|
|
322
|
+
```bash
|
|
323
|
+
#!/bin/bash
|
|
324
|
+
|
|
325
|
+
# Parse arguments
|
|
326
|
+
FORCE_MODE=false
|
|
327
|
+
if [[ "$*" == *"--force"* ]] || [[ "$*" == *"--all"* ]]; then
|
|
328
|
+
FORCE_MODE=true
|
|
329
|
+
fi
|
|
330
|
+
|
|
331
|
+
# Force mode: clear everything
|
|
332
|
+
if [[ "$FORCE_MODE" == "true" ]]; then
|
|
333
|
+
echo "FORCE CLEAR: Removing all OMC state files..."
|
|
334
|
+
|
|
335
|
+
mkdir -p .omc ~/.codex
|
|
336
|
+
|
|
337
|
+
# Remove local state files
|
|
338
|
+
rm -f .omc/state/autopilot-state.json
|
|
339
|
+
rm -f .omc/state/ralph-state.json
|
|
340
|
+
rm -f .omc/state/ultrawork-state.json
|
|
341
|
+
rm -f .omc/state/ecomode-state.json
|
|
342
|
+
rm -f .omc/state/ultraqa-state.json
|
|
343
|
+
rm -f .omc/state/ralph-plan-state.json
|
|
344
|
+
rm -f .omc/state/ralph-verification.json
|
|
345
|
+
rm -f .omc/state/swarm.db
|
|
346
|
+
rm -f .omc/state/swarm.db-wal
|
|
347
|
+
rm -f .omc/state/swarm.db-shm
|
|
348
|
+
rm -f .omc/state/swarm-active.marker
|
|
349
|
+
rm -f .omc/state/ultrapilot-state.json
|
|
350
|
+
rm -f .omc/state/pipeline-state.json
|
|
351
|
+
rm -f .omc/state/plan-consensus.json
|
|
352
|
+
rm -f .omc/state/ralplan-state.json
|
|
353
|
+
|
|
354
|
+
# Remove global state files
|
|
355
|
+
rm -f ~/.codex/ralph-state.json
|
|
356
|
+
rm -f ~/.codex/ultrawork-state.json
|
|
357
|
+
rm -f ~/.codex/ecomode-state.json
|
|
358
|
+
|
|
359
|
+
echo ""
|
|
360
|
+
echo "All OMC modes cleared. You are free to start fresh."
|
|
361
|
+
exit 0
|
|
362
|
+
fi
|
|
363
|
+
|
|
364
|
+
# Track what we cancelled
|
|
365
|
+
CANCELLED_ANYTHING=false
|
|
366
|
+
|
|
367
|
+
# 1. Check Autopilot (highest priority, includes cleanup of ralph/ultraqa)
|
|
368
|
+
if [[ -f .omc/state/autopilot-state.json ]]; then
|
|
369
|
+
AUTOPILOT_STATE=$(cat .omc/state/autopilot-state.json)
|
|
370
|
+
AUTOPILOT_ACTIVE=$(echo "$AUTOPILOT_STATE" | jq -r '.active // false')
|
|
371
|
+
|
|
372
|
+
if [[ "$AUTOPILOT_ACTIVE" == "true" ]]; then
|
|
373
|
+
CURRENT_PHASE=$(echo "$AUTOPILOT_STATE" | jq -r '.phase // "unknown"')
|
|
374
|
+
CLEANED_UP=()
|
|
375
|
+
|
|
376
|
+
# Clean up ralph if active
|
|
377
|
+
if [[ -f .omc/state/ralph-state.json ]]; then
|
|
378
|
+
RALPH_STATE=$(cat .omc/state/ralph-state.json)
|
|
379
|
+
RALPH_ACTIVE=$(echo "$RALPH_STATE" | jq -r '.active // false')
|
|
380
|
+
|
|
381
|
+
if [[ "$RALPH_ACTIVE" == "true" ]]; then
|
|
382
|
+
LINKED_UW=$(echo "$RALPH_STATE" | jq -r '.linked_ultrawork // false')
|
|
383
|
+
|
|
384
|
+
# Clean linked ultrawork first
|
|
385
|
+
if [[ "$LINKED_UW" == "true" ]] && [[ -f .omc/state/ultrawork-state.json ]]; then
|
|
386
|
+
rm -f .omc/state/ultrawork-state.json
|
|
387
|
+
rm -f ~/.codex/ultrawork-state.json
|
|
388
|
+
CLEANED_UP+=("ultrawork")
|
|
389
|
+
fi
|
|
390
|
+
|
|
391
|
+
# Clean ralph
|
|
392
|
+
rm -f .omc/state/ralph-state.json
|
|
393
|
+
rm -f ~/.codex/ralph-state.json
|
|
394
|
+
rm -f .omc/state/ralph-verification.json
|
|
395
|
+
CLEANED_UP+=("ralph")
|
|
396
|
+
fi
|
|
397
|
+
fi
|
|
398
|
+
|
|
399
|
+
# Clean up ultraqa if active
|
|
400
|
+
if [[ -f .omc/state/ultraqa-state.json ]]; then
|
|
401
|
+
ULTRAQA_STATE=$(cat .omc/state/ultraqa-state.json)
|
|
402
|
+
ULTRAQA_ACTIVE=$(echo "$ULTRAQA_STATE" | jq -r '.active // false')
|
|
403
|
+
|
|
404
|
+
if [[ "$ULTRAQA_ACTIVE" == "true" ]]; then
|
|
405
|
+
rm -f .omc/state/ultraqa-state.json
|
|
406
|
+
CLEANED_UP+=("ultraqa")
|
|
407
|
+
fi
|
|
408
|
+
fi
|
|
409
|
+
|
|
410
|
+
# Mark autopilot inactive but preserve state for resume
|
|
411
|
+
echo "$AUTOPILOT_STATE" | jq '.active = false' > .omc/state/autopilot-state.json
|
|
412
|
+
|
|
413
|
+
echo "Autopilot cancelled at phase: $CURRENT_PHASE."
|
|
414
|
+
|
|
415
|
+
if [[ ${#CLEANED_UP[@]} -gt 0 ]]; then
|
|
416
|
+
echo "Cleaned up: ${CLEANED_UP[*]}"
|
|
417
|
+
fi
|
|
418
|
+
|
|
419
|
+
echo "Progress preserved for resume. Run $autopilot to continue."
|
|
420
|
+
CANCELLED_ANYTHING=true
|
|
421
|
+
exit 0
|
|
422
|
+
fi
|
|
423
|
+
fi
|
|
424
|
+
|
|
425
|
+
# 2. Check Ralph (if not handled by autopilot)
|
|
426
|
+
if [[ -f .omc/state/ralph-state.json ]]; then
|
|
427
|
+
RALPH_STATE=$(cat .omc/state/ralph-state.json)
|
|
428
|
+
RALPH_ACTIVE=$(echo "$RALPH_STATE" | jq -r '.active // false')
|
|
429
|
+
|
|
430
|
+
if [[ "$RALPH_ACTIVE" == "true" ]]; then
|
|
431
|
+
LINKED_UW=$(echo "$RALPH_STATE" | jq -r '.linked_ultrawork // false')
|
|
432
|
+
|
|
433
|
+
# Clean linked ultrawork first
|
|
434
|
+
if [[ "$LINKED_UW" == "true" ]] && [[ -f .omc/state/ultrawork-state.json ]]; then
|
|
435
|
+
UW_STATE=$(cat .omc/state/ultrawork-state.json)
|
|
436
|
+
UW_LINKED=$(echo "$UW_STATE" | jq -r '.linked_to_ralph // false')
|
|
437
|
+
|
|
438
|
+
# Only clear if it was linked to ralph
|
|
439
|
+
if [[ "$UW_LINKED" == "true" ]]; then
|
|
440
|
+
rm -f .omc/state/ultrawork-state.json
|
|
441
|
+
rm -f ~/.codex/ultrawork-state.json
|
|
442
|
+
echo "Cleaned up: ultrawork (linked to ralph)"
|
|
443
|
+
fi
|
|
444
|
+
fi
|
|
445
|
+
|
|
446
|
+
# Clean linked ecomode if present
|
|
447
|
+
LINKED_ECO=$(echo "$RALPH_STATE" | jq -r '.linked_ecomode // false')
|
|
448
|
+
|
|
449
|
+
if [[ "$LINKED_ECO" == "true" ]] && [[ -f .omc/state/ecomode-state.json ]]; then
|
|
450
|
+
ECO_STATE=$(cat .omc/state/ecomode-state.json)
|
|
451
|
+
ECO_LINKED=$(echo "$ECO_STATE" | jq -r '.linked_to_ralph // false')
|
|
452
|
+
|
|
453
|
+
if [[ "$ECO_LINKED" == "true" ]]; then
|
|
454
|
+
rm -f .omc/state/ecomode-state.json
|
|
455
|
+
rm -f ~/.codex/ecomode-state.json
|
|
456
|
+
echo "Cleaned up: ecomode (linked to ralph)"
|
|
457
|
+
fi
|
|
458
|
+
fi
|
|
459
|
+
|
|
460
|
+
# Clean ralph state (both local and global)
|
|
461
|
+
rm -f .omc/state/ralph-state.json
|
|
462
|
+
rm -f ~/.codex/ralph-state.json
|
|
463
|
+
rm -f .omc/state/ralph-plan-state.json
|
|
464
|
+
rm -f .omc/state/ralph-verification.json
|
|
465
|
+
|
|
466
|
+
echo "Ralph cancelled. Persistent mode deactivated."
|
|
467
|
+
CANCELLED_ANYTHING=true
|
|
468
|
+
exit 0
|
|
469
|
+
fi
|
|
470
|
+
fi
|
|
471
|
+
|
|
472
|
+
# 3. Check Ultrawork (standalone, not linked)
|
|
473
|
+
if [[ -f .omc/state/ultrawork-state.json ]]; then
|
|
474
|
+
UW_STATE=$(cat .omc/state/ultrawork-state.json)
|
|
475
|
+
UW_ACTIVE=$(echo "$UW_STATE" | jq -r '.active // false')
|
|
476
|
+
|
|
477
|
+
if [[ "$UW_ACTIVE" == "true" ]]; then
|
|
478
|
+
LINKED=$(echo "$UW_STATE" | jq -r '.linked_to_ralph // false')
|
|
479
|
+
|
|
480
|
+
if [[ "$LINKED" == "true" ]]; then
|
|
481
|
+
echo "Warning: Ultrawork is linked to Ralph, but Ralph is not active."
|
|
482
|
+
echo "Clearing ultrawork state anyway..."
|
|
483
|
+
fi
|
|
484
|
+
|
|
485
|
+
# Remove both local and global state
|
|
486
|
+
rm -f .omc/state/ultrawork-state.json
|
|
487
|
+
rm -f ~/.codex/ultrawork-state.json
|
|
488
|
+
|
|
489
|
+
echo "Ultrawork cancelled. Parallel execution mode deactivated."
|
|
490
|
+
CANCELLED_ANYTHING=true
|
|
491
|
+
exit 0
|
|
492
|
+
fi
|
|
493
|
+
fi
|
|
494
|
+
|
|
495
|
+
# 4. Check Ecomode (standalone, not linked)
|
|
496
|
+
if [[ -f .omc/state/ecomode-state.json ]]; then
|
|
497
|
+
ECO_STATE=$(cat .omc/state/ecomode-state.json)
|
|
498
|
+
ECO_ACTIVE=$(echo "$ECO_STATE" | jq -r '.active // false')
|
|
499
|
+
|
|
500
|
+
if [[ "$ECO_ACTIVE" == "true" ]]; then
|
|
501
|
+
LINKED=$(echo "$ECO_STATE" | jq -r '.linked_to_ralph // false')
|
|
502
|
+
|
|
503
|
+
if [[ "$LINKED" == "true" ]]; then
|
|
504
|
+
echo "Warning: Ecomode is linked to Ralph, but Ralph is not active."
|
|
505
|
+
echo "Clearing ecomode state anyway..."
|
|
506
|
+
fi
|
|
507
|
+
|
|
508
|
+
# Remove both local and global state
|
|
509
|
+
rm -f .omc/state/ecomode-state.json
|
|
510
|
+
rm -f ~/.codex/ecomode-state.json
|
|
511
|
+
|
|
512
|
+
echo "Ecomode cancelled. Token-efficient execution mode deactivated."
|
|
513
|
+
CANCELLED_ANYTHING=true
|
|
514
|
+
exit 0
|
|
515
|
+
fi
|
|
516
|
+
fi
|
|
517
|
+
|
|
518
|
+
# 5. Check UltraQA (standalone)
|
|
519
|
+
if [[ -f .omc/state/ultraqa-state.json ]]; then
|
|
520
|
+
ULTRAQA_STATE=$(cat .omc/state/ultraqa-state.json)
|
|
521
|
+
ULTRAQA_ACTIVE=$(echo "$ULTRAQA_STATE" | jq -r '.active // false')
|
|
522
|
+
|
|
523
|
+
if [[ "$ULTRAQA_ACTIVE" == "true" ]]; then
|
|
524
|
+
rm -f .omc/state/ultraqa-state.json
|
|
525
|
+
echo "UltraQA cancelled. QA cycling workflow stopped."
|
|
526
|
+
CANCELLED_ANYTHING=true
|
|
527
|
+
exit 0
|
|
528
|
+
fi
|
|
529
|
+
fi
|
|
530
|
+
|
|
531
|
+
# 6. Check Swarm (SQLite-based)
|
|
532
|
+
SWARM_DB=".omc/state/swarm.db"
|
|
533
|
+
if [[ -f "$SWARM_DB" ]]; then
|
|
534
|
+
# Check if sqlite3 CLI is available
|
|
535
|
+
if command -v sqlite3 &>/dev/null; then
|
|
536
|
+
# Query SQLite to check if swarm is active
|
|
537
|
+
SWARM_ACTIVE=$(sqlite3 "$SWARM_DB" "SELECT active FROM swarm_session WHERE id = 1;" 2>/dev/null || echo "0")
|
|
538
|
+
|
|
539
|
+
if [[ "$SWARM_ACTIVE" == "1" ]]; then
|
|
540
|
+
# Get stats before cancelling
|
|
541
|
+
DONE_TASKS=$(sqlite3 "$SWARM_DB" "SELECT COUNT(*) FROM tasks WHERE status = 'done';" 2>/dev/null || echo "0")
|
|
542
|
+
TOTAL_TASKS=$(sqlite3 "$SWARM_DB" "SELECT COUNT(*) FROM tasks;" 2>/dev/null || echo "0")
|
|
543
|
+
|
|
544
|
+
# Mark swarm as inactive
|
|
545
|
+
sqlite3 "$SWARM_DB" "UPDATE swarm_session SET active = 0, completed_at = $(date +%s000) WHERE id = 1;"
|
|
546
|
+
|
|
547
|
+
echo "Swarm cancelled. $DONE_TASKS/$TOTAL_TASKS tasks completed."
|
|
548
|
+
echo "Database preserved at $SWARM_DB for analysis."
|
|
549
|
+
CANCELLED_ANYTHING=true
|
|
550
|
+
exit 0
|
|
551
|
+
fi
|
|
552
|
+
else
|
|
553
|
+
# Fallback: Check marker file if sqlite3 is not available
|
|
554
|
+
MARKER_FILE=".omc/state/swarm-active.marker"
|
|
555
|
+
if [[ -f "$MARKER_FILE" ]]; then
|
|
556
|
+
rm -f "$MARKER_FILE"
|
|
557
|
+
echo "Swarm cancelled (marker file removed). Database at $SWARM_DB may need manual cleanup."
|
|
558
|
+
CANCELLED_ANYTHING=true
|
|
559
|
+
exit 0
|
|
560
|
+
fi
|
|
561
|
+
fi
|
|
562
|
+
fi
|
|
563
|
+
|
|
564
|
+
# 7. Check Ultrapilot (standalone)
|
|
565
|
+
if [[ -f .omc/state/ultrapilot-state.json ]]; then
|
|
566
|
+
ULTRAPILOT_STATE=$(cat .omc/state/ultrapilot-state.json)
|
|
567
|
+
ULTRAPILOT_ACTIVE=$(echo "$ULTRAPILOT_STATE" | jq -r '.active // false')
|
|
568
|
+
|
|
569
|
+
if [[ "$ULTRAPILOT_ACTIVE" == "true" ]]; then
|
|
570
|
+
rm -f .omc/state/ultrapilot-state.json
|
|
571
|
+
echo "Ultrapilot cancelled. Parallel autopilot workers stopped."
|
|
572
|
+
CANCELLED_ANYTHING=true
|
|
573
|
+
exit 0
|
|
574
|
+
fi
|
|
575
|
+
fi
|
|
576
|
+
|
|
577
|
+
# 8. Check Pipeline (standalone)
|
|
578
|
+
if [[ -f .omc/state/pipeline-state.json ]]; then
|
|
579
|
+
PIPELINE_STATE=$(cat .omc/state/pipeline-state.json)
|
|
580
|
+
PIPELINE_ACTIVE=$(echo "$PIPELINE_STATE" | jq -r '.active // false')
|
|
581
|
+
|
|
582
|
+
if [[ "$PIPELINE_ACTIVE" == "true" ]]; then
|
|
583
|
+
rm -f .omc/state/pipeline-state.json
|
|
584
|
+
echo "Pipeline cancelled. Sequential agent chain stopped."
|
|
585
|
+
CANCELLED_ANYTHING=true
|
|
586
|
+
exit 0
|
|
587
|
+
fi
|
|
588
|
+
fi
|
|
589
|
+
|
|
590
|
+
# 9. Check Plan Consensus (standalone)
|
|
591
|
+
if [[ "$PLAN_CONSENSUS_ACTIVE" == "true" ]]; then
|
|
592
|
+
echo "Cancelling Plan Consensus mode..."
|
|
593
|
+
|
|
594
|
+
# Clear state files
|
|
595
|
+
rm -f .omc/state/plan-consensus.json
|
|
596
|
+
rm -f .omc/state/ralplan-state.json
|
|
597
|
+
|
|
598
|
+
echo "Plan Consensus cancelled. Planning session ended."
|
|
599
|
+
echo "Note: Plan file preserved at path specified in state."
|
|
600
|
+
CANCELLED_ANYTHING=true
|
|
601
|
+
exit 0
|
|
602
|
+
fi
|
|
603
|
+
|
|
604
|
+
# No active modes found
|
|
605
|
+
if [[ "$CANCELLED_ANYTHING" == "false" ]]; then
|
|
606
|
+
echo "No active OMC modes detected."
|
|
607
|
+
echo ""
|
|
608
|
+
echo "Checked for:"
|
|
609
|
+
echo " - Autopilot (.omc/state/autopilot-state.json)"
|
|
610
|
+
echo " - Ralph (.omc/state/ralph-state.json)"
|
|
611
|
+
echo " - Ultrawork (.omc/state/ultrawork-state.json)"
|
|
612
|
+
echo " - Ecomode (.omc/state/ecomode-state.json)"
|
|
613
|
+
echo " - UltraQA (.omc/state/ultraqa-state.json)"
|
|
614
|
+
echo " - Swarm (.omc/state/swarm.db)"
|
|
615
|
+
echo " - Ultrapilot (.omc/state/ultrapilot-state.json)"
|
|
616
|
+
echo " - Pipeline (.omc/state/pipeline-state.json)"
|
|
617
|
+
echo " - Plan Consensus (.omc/state/plan-consensus.json)"
|
|
618
|
+
echo ""
|
|
619
|
+
echo "Use --force to clear all state files anyway."
|
|
620
|
+
fi
|
|
621
|
+
```
|
|
622
|
+
|
|
623
|
+
## Messages Reference
|
|
624
|
+
|
|
625
|
+
| Mode | Success Message |
|
|
626
|
+
|------|-----------------|
|
|
627
|
+
| Autopilot | "Autopilot cancelled at phase: {phase}. Progress preserved for resume." |
|
|
628
|
+
| Ralph | "Ralph cancelled. Persistent mode deactivated." |
|
|
629
|
+
| Ultrawork | "Ultrawork cancelled. Parallel execution mode deactivated." |
|
|
630
|
+
| Ecomode | "Ecomode cancelled. Token-efficient execution mode deactivated." |
|
|
631
|
+
| UltraQA | "UltraQA cancelled. QA cycling workflow stopped." |
|
|
632
|
+
| Swarm | "Swarm cancelled. Coordinated agents stopped." |
|
|
633
|
+
| Ultrapilot | "Ultrapilot cancelled. Parallel autopilot workers stopped." |
|
|
634
|
+
| Pipeline | "Pipeline cancelled. Sequential agent chain stopped." |
|
|
635
|
+
| Plan Consensus | "Plan Consensus cancelled. Planning session ended." |
|
|
636
|
+
| Force | "All OMC modes cleared. You are free to start fresh." |
|
|
637
|
+
| None | "No active OMC modes detected." |
|
|
638
|
+
|
|
639
|
+
## What Gets Preserved
|
|
640
|
+
|
|
641
|
+
| Mode | State Preserved | Resume Command |
|
|
642
|
+
|------|-----------------|----------------|
|
|
643
|
+
| Autopilot | Yes (phase, files, spec, plan, verdicts) | `$autopilot` |
|
|
644
|
+
| Ralph | No | N/A |
|
|
645
|
+
| Ultrawork | No | N/A |
|
|
646
|
+
| UltraQA | No | N/A |
|
|
647
|
+
| Swarm | No | N/A |
|
|
648
|
+
| Ultrapilot | No | N/A |
|
|
649
|
+
| Pipeline | No | N/A |
|
|
650
|
+
| Plan Consensus | Yes (plan file path preserved) | N/A |
|
|
651
|
+
|
|
652
|
+
## Notes
|
|
653
|
+
|
|
654
|
+
- **Dependency-aware**: Autopilot cancellation cleans up Ralph and UltraQA
|
|
655
|
+
- **Link-aware**: Ralph cancellation cleans up linked Ultrawork or Ecomode
|
|
656
|
+
- **Safe**: Only clears linked Ultrawork, preserves standalone Ultrawork
|
|
657
|
+
- **Dual-location**: Clears both `.omc/` and `~/.codex/` state files
|
|
658
|
+
- **Resume-friendly**: Autopilot state is preserved for seamless resume
|