@trac3er/oh-my-god 2.0.0 → 2.0.2

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.
Files changed (243) hide show
  1. package/.claude-plugin/marketplace.json +8 -8
  2. package/.claude-plugin/plugin.json +5 -4
  3. package/.claude-plugin/scripts/uninstall.sh +74 -3
  4. package/.claude-plugin/scripts/update.sh +78 -3
  5. package/.coveragerc +26 -0
  6. package/.mcp.json +4 -4
  7. package/CHANGELOG.md +14 -0
  8. package/CODE_OF_CONDUCT.md +27 -0
  9. package/CONTRIBUTING.md +62 -0
  10. package/OMG-setup.sh +1201 -355
  11. package/README.md +77 -56
  12. package/SECURITY.md +25 -0
  13. package/agents/__init__.py +1 -0
  14. package/agents/model_roles.py +196 -0
  15. package/agents/omg-architect-mode.md +3 -5
  16. package/agents/omg-backend-engineer.md +3 -5
  17. package/agents/omg-database-engineer.md +3 -5
  18. package/agents/omg-frontend-designer.md +4 -5
  19. package/agents/omg-implement-mode.md +4 -5
  20. package/agents/omg-infra-engineer.md +3 -5
  21. package/agents/omg-research-mode.md +4 -6
  22. package/agents/omg-security-auditor.md +3 -5
  23. package/agents/omg-testing-engineer.md +3 -5
  24. package/build/lib/yaml.py +321 -0
  25. package/commands/OMG:ai-commit.md +101 -14
  26. package/commands/OMG:arch.md +302 -19
  27. package/commands/OMG:ccg.md +12 -7
  28. package/commands/OMG:compat.md +25 -17
  29. package/commands/OMG:cost.md +173 -13
  30. package/commands/OMG:crazy.md +1 -1
  31. package/commands/OMG:create-agent.md +170 -20
  32. package/commands/OMG:deps.md +235 -17
  33. package/commands/OMG:domain-init.md +1 -1
  34. package/commands/OMG:escalate.md +41 -12
  35. package/commands/OMG:health-check.md +37 -13
  36. package/commands/OMG:init.md +122 -14
  37. package/commands/OMG:project-init.md +1 -1
  38. package/commands/OMG:session-branch.md +76 -9
  39. package/commands/OMG:session-fork.md +42 -5
  40. package/commands/OMG:session-merge.md +124 -8
  41. package/commands/OMG:setup.md +69 -12
  42. package/commands/OMG:stats.md +215 -14
  43. package/commands/OMG:teams.md +19 -10
  44. package/config/lsp_languages.yaml +8 -0
  45. package/hooks/__init__.py +0 -0
  46. package/hooks/_agent_registry.py +423 -0
  47. package/hooks/_analytics.py +291 -0
  48. package/hooks/_budget.py +31 -0
  49. package/hooks/_common.py +569 -0
  50. package/hooks/_compression_optimizer.py +119 -0
  51. package/hooks/_cost_ledger.py +176 -0
  52. package/hooks/_learnings.py +126 -0
  53. package/hooks/_memory.py +103 -0
  54. package/hooks/_protected_context.py +150 -0
  55. package/hooks/_token_counter.py +221 -0
  56. package/hooks/branch_manager.py +236 -0
  57. package/hooks/budget_governor.py +232 -0
  58. package/hooks/circuit-breaker.py +270 -0
  59. package/hooks/compression_feedback.py +254 -0
  60. package/hooks/config-guard.py +216 -0
  61. package/hooks/context_pressure.py +53 -0
  62. package/hooks/credential_store.py +1020 -0
  63. package/hooks/fetch-rate-limits.py +212 -0
  64. package/hooks/firewall.py +48 -0
  65. package/hooks/hashline-formatter-bridge.py +224 -0
  66. package/hooks/hashline-injector.py +273 -0
  67. package/hooks/hashline-validator.py +216 -0
  68. package/hooks/idle-detector.py +95 -0
  69. package/hooks/intentgate-keyword-detector.py +188 -0
  70. package/hooks/magic-keyword-router.py +195 -0
  71. package/hooks/policy_engine.py +505 -0
  72. package/hooks/post-tool-failure.py +19 -0
  73. package/hooks/post-write.py +219 -0
  74. package/hooks/post_write.py +46 -0
  75. package/hooks/pre-compact.py +398 -0
  76. package/hooks/pre-tool-inject.py +98 -0
  77. package/hooks/prompt-enhancer.py +672 -0
  78. package/hooks/quality-runner.py +191 -0
  79. package/hooks/query.py +512 -0
  80. package/hooks/secret-guard.py +61 -0
  81. package/hooks/secret_audit.py +144 -0
  82. package/hooks/session-end-capture.py +137 -0
  83. package/hooks/session-start.py +277 -0
  84. package/hooks/setup_wizard.py +582 -0
  85. package/hooks/shadow_manager.py +297 -0
  86. package/hooks/state_migration.py +225 -0
  87. package/hooks/stop-gate.py +7 -0
  88. package/hooks/stop_dispatcher.py +945 -0
  89. package/hooks/test-validator.py +361 -0
  90. package/hooks/test_generator_hook.py +123 -0
  91. package/hooks/todo-state-tracker.py +114 -0
  92. package/hooks/tool-ledger.py +149 -0
  93. package/hooks/trust_review.py +585 -0
  94. package/hud/omg-hud.mjs +31 -1
  95. package/lab/__init__.py +1 -0
  96. package/lab/pipeline.py +75 -0
  97. package/lab/policies.py +52 -0
  98. package/package.json +7 -18
  99. package/plugins/README.md +33 -61
  100. package/plugins/advanced/commands/OMG:deep-plan.md +3 -3
  101. package/plugins/advanced/commands/OMG:learn.md +1 -1
  102. package/plugins/advanced/commands/OMG:security-review.md +3 -3
  103. package/plugins/advanced/commands/OMG:ship.md +1 -1
  104. package/plugins/advanced/plugin.json +1 -1
  105. package/plugins/core/plugin.json +8 -3
  106. package/plugins/dephealth/__init__.py +0 -0
  107. package/plugins/dephealth/cve_scanner.py +188 -0
  108. package/plugins/dephealth/license_checker.py +135 -0
  109. package/plugins/dephealth/manifest_detector.py +423 -0
  110. package/plugins/dephealth/vuln_analyzer.py +169 -0
  111. package/plugins/testgen/__init__.py +0 -0
  112. package/plugins/testgen/codamosa_engine.py +402 -0
  113. package/plugins/testgen/edge_case_synthesizer.py +184 -0
  114. package/plugins/testgen/framework_detector.py +271 -0
  115. package/plugins/testgen/skeleton_generator.py +219 -0
  116. package/plugins/viz/__init__.py +0 -0
  117. package/plugins/viz/ast_parser.py +139 -0
  118. package/plugins/viz/diagram_generator.py +192 -0
  119. package/plugins/viz/graph_builder.py +444 -0
  120. package/plugins/viz/native_parsers.py +259 -0
  121. package/plugins/viz/regex_parser.py +112 -0
  122. package/pyproject.toml +81 -0
  123. package/rules/contextual/write-verify.md +2 -2
  124. package/rules/core/00-truth.md +1 -1
  125. package/rules/core/01-surgical.md +1 -1
  126. package/rules/core/02-circuit-breaker.md +2 -2
  127. package/rules/core/03-ensemble.md +3 -3
  128. package/rules/core/04-testing.md +3 -3
  129. package/runtime/__init__.py +32 -0
  130. package/runtime/adapters/__init__.py +13 -0
  131. package/runtime/adapters/claude.py +60 -0
  132. package/runtime/adapters/gpt.py +53 -0
  133. package/runtime/adapters/local.py +53 -0
  134. package/runtime/adoption.py +212 -0
  135. package/runtime/business_workflow.py +220 -0
  136. package/runtime/cli_provider.py +85 -0
  137. package/runtime/compat.py +1299 -0
  138. package/runtime/custom_agent_loader.py +366 -0
  139. package/runtime/dispatcher.py +47 -0
  140. package/runtime/ecosystem.py +371 -0
  141. package/runtime/legacy_compat.py +7 -0
  142. package/runtime/mcp_config_writers.py +115 -0
  143. package/runtime/mcp_lifecycle.py +153 -0
  144. package/runtime/mcp_memory_server.py +135 -0
  145. package/runtime/memory_parsers/__init__.py +0 -0
  146. package/runtime/memory_parsers/chatgpt_parser.py +257 -0
  147. package/runtime/memory_parsers/claude_import.py +107 -0
  148. package/runtime/memory_parsers/export.py +97 -0
  149. package/runtime/memory_parsers/gemini_import.py +91 -0
  150. package/runtime/memory_parsers/kimi_import.py +91 -0
  151. package/runtime/memory_store.py +215 -0
  152. package/runtime/omc_compat.py +7 -0
  153. package/runtime/providers/__init__.py +0 -0
  154. package/runtime/providers/codex_provider.py +112 -0
  155. package/runtime/providers/gemini_provider.py +128 -0
  156. package/runtime/providers/kimi_provider.py +151 -0
  157. package/runtime/providers/opencode_provider.py +144 -0
  158. package/runtime/subagent_dispatcher.py +362 -0
  159. package/runtime/team_router.py +1167 -0
  160. package/runtime/tmux_session_manager.py +169 -0
  161. package/scripts/check-omg-compat-contract-snapshot.py +137 -0
  162. package/scripts/check-omg-contract-snapshot.py +12 -0
  163. package/scripts/check-omg-public-ready.py +193 -0
  164. package/scripts/check-omg-standalone-clean.py +103 -0
  165. package/scripts/legacy_to_omg_migrate.py +29 -0
  166. package/scripts/migrate-legacy.py +464 -0
  167. package/scripts/omc_to_omg_migrate.py +12 -0
  168. package/scripts/omg.py +492 -0
  169. package/scripts/settings-merge.py +283 -0
  170. package/scripts/verify-standalone.sh +8 -4
  171. package/settings.json +126 -29
  172. package/templates/profile.yaml +1 -1
  173. package/tools/__init__.py +2 -0
  174. package/tools/browser_consent.py +289 -0
  175. package/tools/browser_stealth.py +481 -0
  176. package/tools/browser_tool.py +448 -0
  177. package/tools/changelog_generator.py +347 -0
  178. package/tools/commit_splitter.py +746 -0
  179. package/tools/config_discovery.py +151 -0
  180. package/tools/config_merger.py +449 -0
  181. package/tools/dashboard_generator.py +300 -0
  182. package/tools/git_inspector.py +298 -0
  183. package/tools/lsp_client.py +275 -0
  184. package/tools/lsp_discovery.py +231 -0
  185. package/tools/lsp_operations.py +392 -0
  186. package/tools/pr_generator.py +404 -0
  187. package/tools/python_repl.py +656 -0
  188. package/tools/python_sandbox.py +609 -0
  189. package/tools/search_providers/__init__.py +77 -0
  190. package/tools/search_providers/brave.py +115 -0
  191. package/tools/search_providers/exa.py +116 -0
  192. package/tools/search_providers/jina.py +104 -0
  193. package/tools/search_providers/perplexity.py +139 -0
  194. package/tools/search_providers/synthetic.py +74 -0
  195. package/tools/session_snapshot.py +736 -0
  196. package/tools/ssh_manager.py +912 -0
  197. package/tools/theme_engine.py +294 -0
  198. package/tools/theme_selector.py +137 -0
  199. package/tools/web_search.py +622 -0
  200. package/yaml.py +321 -0
  201. package/.claude-plugin/scripts/install.sh +0 -9
  202. package/bun.lock +0 -23
  203. package/bunfig.toml +0 -3
  204. package/hooks/_budget.ts +0 -1
  205. package/hooks/_common.ts +0 -63
  206. package/hooks/circuit-breaker.ts +0 -101
  207. package/hooks/config-guard.ts +0 -4
  208. package/hooks/firewall.ts +0 -20
  209. package/hooks/policy_engine.ts +0 -156
  210. package/hooks/post-tool-failure.ts +0 -22
  211. package/hooks/post-write.ts +0 -4
  212. package/hooks/pre-tool-inject.ts +0 -4
  213. package/hooks/prompt-enhancer.ts +0 -46
  214. package/hooks/quality-runner.ts +0 -24
  215. package/hooks/secret-guard.ts +0 -4
  216. package/hooks/session-end-capture.ts +0 -19
  217. package/hooks/session-start.ts +0 -19
  218. package/hooks/shadow_manager.ts +0 -81
  219. package/hooks/stop-gate.ts +0 -22
  220. package/hooks/stop_dispatcher.ts +0 -147
  221. package/hooks/test-generator-hook.ts +0 -4
  222. package/hooks/tool-ledger.ts +0 -27
  223. package/hooks/trust_review.ts +0 -175
  224. package/lab/pipeline.ts +0 -75
  225. package/lab/policies.ts +0 -68
  226. package/runtime/common.ts +0 -111
  227. package/runtime/compat.ts +0 -174
  228. package/runtime/dispatcher.ts +0 -25
  229. package/runtime/ecosystem.ts +0 -186
  230. package/runtime/provider_bootstrap.ts +0 -99
  231. package/runtime/provider_smoke.ts +0 -34
  232. package/runtime/release_readiness.ts +0 -186
  233. package/runtime/team_router.ts +0 -144
  234. package/scripts/check-omg-compat-contract-snapshot.ts +0 -20
  235. package/scripts/check-omg-standalone-clean.ts +0 -12
  236. package/scripts/check-runtime-clean.ts +0 -94
  237. package/scripts/omg.ts +0 -352
  238. package/scripts/settings-merge.ts +0 -93
  239. package/tools/commit_splitter.ts +0 -23
  240. package/tools/git_inspector.ts +0 -18
  241. package/tools/session_snapshot.ts +0 -47
  242. package/trac3er-oh-my-god-2.0.0.tgz +0 -0
  243. package/tsconfig.json +0 -15
@@ -1,94 +0,0 @@
1
- #!/usr/bin/env bun
2
- import { readdirSync, readFileSync, statSync } from "node:fs";
3
- import { join } from "node:path";
4
- import { ROOT_DIR } from "../runtime/common.ts";
5
-
6
- const DOT = String.fromCharCode(46);
7
- const DASH = String.fromCharCode(45);
8
-
9
- function fromCodes(...codes: number[]) {
10
- return String.fromCharCode(...codes);
11
- }
12
-
13
- function escapeRegex(value: string) {
14
- return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
15
- }
16
-
17
- const PY = `${DOT}${fromCodes(112, 121)}`;
18
- const PYTHON = fromCodes(112, 121, 116, 104, 111, 110);
19
- const PYTEST = fromCodes(112, 121, 116, 101, 115, 116);
20
- const OMG_PY = `scripts/omg${PY}`;
21
- const CHECK_DIRS = [
22
- ".github",
23
- ".claude-plugin",
24
- "commands",
25
- "control_plane",
26
- "hooks",
27
- "hud",
28
- "lab",
29
- "omg_natives",
30
- "plugins",
31
- "registry",
32
- "runtime",
33
- "scripts",
34
- "tools",
35
- "README.md",
36
- "settings.json",
37
- "package.json",
38
- "OMG-setup.sh"
39
- ];
40
- const SKIP_FILES = new Set(["scripts/check-runtime-clean.ts", "bun.lock"]);
41
- const BLOCKED_EXTENSIONS = [PY];
42
- const BLOCKED_PATTERNS = [
43
- new RegExp(`\\b${escapeRegex(PYTHON)}3?\\b`, "i"),
44
- new RegExp(`\\b${escapeRegex(PYTEST)}\\b`, "i"),
45
- new RegExp(escapeRegex(OMG_PY)),
46
- new RegExp(escapeRegex(PY)),
47
- /\bopencode\b/i,
48
- /\bOpenCode\b/
49
- ];
50
-
51
- function walk(path: string, files: string[] = []): string[] {
52
- const full = join(ROOT_DIR, path);
53
- const stats = statSync(full);
54
- if (stats.isFile()) {
55
- files.push(path);
56
- return files;
57
- }
58
- for (const entry of readdirSync(full)) {
59
- if (entry === "build" || entry === "node_modules" || entry === ".git") {
60
- continue;
61
- }
62
- walk(join(path, entry), files);
63
- }
64
- return files;
65
- }
66
-
67
- function main() {
68
- const files = CHECK_DIRS.flatMap((path) => walk(path));
69
- const violations: string[] = [];
70
- for (const file of files) {
71
- if (SKIP_FILES.has(file)) {
72
- continue;
73
- }
74
- if (BLOCKED_EXTENSIONS.some((extension) => file.endsWith(extension))) {
75
- violations.push(`blocked extension: ${file}`);
76
- continue;
77
- }
78
- const content = readFileSync(join(ROOT_DIR, file), "utf8");
79
- for (const pattern of BLOCKED_PATTERNS) {
80
- if (pattern.test(content)) {
81
- violations.push(`blocked content in ${file}: ${pattern}`);
82
- }
83
- }
84
- }
85
- if (violations.length > 0) {
86
- process.stderr.write(`${violations.join("\n")}\n`);
87
- return 1;
88
- }
89
- return 0;
90
- }
91
-
92
- if (import.meta.main) {
93
- process.exit(main());
94
- }
package/scripts/omg.ts DELETED
@@ -1,352 +0,0 @@
1
- #!/usr/bin/env bun
2
- import { existsSync } from "node:fs";
3
- import { join } from "node:path";
4
- import {
5
- ensureParent,
6
- ensureProjectDir,
7
- nowRunId,
8
- parseSimpleIdeaYaml,
9
- printJson,
10
- readJsonFile,
11
- relativeToProject
12
- } from "../runtime/common.ts";
13
- import { dispatchRuntime } from "../runtime/dispatcher.ts";
14
- import {
15
- DEFAULT_CONTRACT_SNAPSHOT_PATH,
16
- DEFAULT_GAP_REPORT_PATH,
17
- buildCompatGapReport,
18
- buildContractSnapshotPayload,
19
- dispatchCompatSkill,
20
- getCompatSkillContract,
21
- listCompatSkillContracts,
22
- listCompatSkills
23
- } from "../runtime/compat.ts";
24
- import { listEcosystemRepos, ecosystemStatus, syncEcosystemRepos } from "../runtime/ecosystem.ts";
25
- import { dispatchTeam, executeCcgMode, executeCrazyMode } from "../runtime/team_router.ts";
26
- import { evaluateBashCommand } from "../hooks/policy_engine.ts";
27
- import { createEvidencePack } from "../hooks/shadow_manager.ts";
28
- import { reviewConfigChange, writeTrustManifest } from "../hooks/trust_review.ts";
29
- import { collectProviderStatusWithOptions, repairProviderHosts } from "../runtime/provider_bootstrap.ts";
30
- import { runProviderSmokeMatrix } from "../runtime/provider_smoke.ts";
31
- import { collectReleaseReadiness } from "../runtime/release_readiness.ts";
32
-
33
- function loadJson(path: string): Record<string, unknown> {
34
- return readJsonFile<Record<string, unknown>>(path, {});
35
- }
36
-
37
- function loadIdea(pathOrJson: string, isInlineJson = false): Record<string, unknown> {
38
- if (isInlineJson) {
39
- return JSON.parse(pathOrJson) as Record<string, unknown>;
40
- }
41
- if (pathOrJson.endsWith(".yml") || pathOrJson.endsWith(".yaml")) {
42
- return parseSimpleIdeaYaml(pathOrJson) as unknown as Record<string, unknown>;
43
- }
44
- return loadJson(pathOrJson);
45
- }
46
-
47
- function usage(): never {
48
- const text = `OMG Bun CLI
49
-
50
- Usage:
51
- omg ship --runtime <claude|gpt|local> --idea <path>
52
- omg fix --issue <id> [--runtime <runtime>]
53
- omg secure --command "<bash>"
54
- omg maintainer [--mode <triage|release|review|impact>]
55
- omg trust review --old <path> --new <path> [--file settings.json]
56
- omg runtime dispatch --runtime <claude|gpt|local> [--idea <path> | --idea-json <json>]
57
- omg teams --problem <text> [--target auto|codex|gemini|ccg]
58
- omg ccg --problem <text>
59
- omg crazy --problem <text>
60
- omg compat <list|contract|gap-report|snapshot|gate|run> [...]
61
- omg omc <compat-subcommand> [...]
62
- omg ecosystem <list|status|sync> [...]
63
- omg providers <status|smoke|repair> [...]
64
- omg release readiness
65
- `;
66
- process.stderr.write(text);
67
- process.exit(2);
68
- }
69
-
70
- function parseFlags(args: string[]): Record<string, string | boolean> {
71
- const flags: Record<string, string | boolean> = {};
72
- for (let index = 0; index < args.length; index += 1) {
73
- const arg = args[index];
74
- if (!arg.startsWith("--")) {
75
- continue;
76
- }
77
- const key = arg.slice(2);
78
- const next = args[index + 1];
79
- if (!next || next.startsWith("--")) {
80
- flags[key] = true;
81
- continue;
82
- }
83
- flags[key] = next;
84
- index += 1;
85
- }
86
- return flags;
87
- }
88
-
89
- function splitFiles(value: string | boolean | undefined): string[] {
90
- if (typeof value !== "string") {
91
- return [];
92
- }
93
- return value
94
- .split(",")
95
- .map((item) => item.trim())
96
- .filter(Boolean);
97
- }
98
-
99
- async function main(argv = process.argv.slice(2)): Promise<number> {
100
- let [command, maybeSubcommand, ...rest] = argv;
101
- let subcommand = maybeSubcommand || "";
102
- if (subcommand.startsWith("--")) {
103
- rest = [subcommand, ...rest];
104
- subcommand = "";
105
- }
106
- const flags = parseFlags(rest);
107
- const projectDir = ensureProjectDir();
108
-
109
- if (!command) {
110
- usage();
111
- }
112
-
113
- if (command === "ship") {
114
- const ideaPath = String(flags.idea || ".omg/idea.yml");
115
- const runtime = String(flags.runtime || "claude");
116
- const idea = loadIdea(ideaPath);
117
- const dispatched = dispatchRuntime(runtime, idea);
118
- const runId = String(flags["run-id"] || nowRunId());
119
- const evidencePath = createEvidencePack(projectDir, runId, {
120
- tests: (dispatched.verification as any)?.checks || [],
121
- diff_summary: { runtime, goal: String(idea.goal || "") },
122
- reproducibility: { command: `omg ship --runtime ${runtime} --idea ${ideaPath}` }
123
- });
124
- printJson({
125
- status: "ok",
126
- command: "ship",
127
- runtime,
128
- run_id: runId,
129
- goal: String(idea.goal || ""),
130
- evidence_path: relativeToProject(projectDir, evidencePath)
131
- });
132
- return 0;
133
- }
134
-
135
- if (command === "fix") {
136
- const runtime = String(flags.runtime || "claude");
137
- const issue = String(flags.issue || "");
138
- const result = dispatchRuntime(runtime, {
139
- goal: `Fix issue ${issue}`,
140
- acceptance: [`issue-${issue}-resolved`]
141
- });
142
- printJson(result);
143
- return result.status === "ok" ? 0 : 2;
144
- }
145
-
146
- if (command === "secure") {
147
- const result = evaluateBashCommand(String(flags.command || ""));
148
- printJson(result);
149
- return result.action === "deny" ? 3 : 0;
150
- }
151
-
152
- if (command === "maintainer") {
153
- const path = join(projectDir, ".omg", "evidence", "oss-impact.json");
154
- const payload = {
155
- status: "ok",
156
- path,
157
- generated_at: new Date().toISOString(),
158
- mode: String(flags.mode || "impact"),
159
- activity: { commits: "unverified", reviews: "unverified", releases: "unverified" }
160
- };
161
- ensureParent(path);
162
- Bun.write(path, JSON.stringify(payload, null, 2));
163
- printJson(payload);
164
- return 0;
165
- }
166
-
167
- if (command === "trust" && subcommand === "review") {
168
- const oldCfg = loadJson(String(flags.old || ""));
169
- const newCfg = loadJson(String(flags.new || ""));
170
- const review = reviewConfigChange(String(flags.file || "settings.json"), oldCfg, newCfg);
171
- const manifest = writeTrustManifest(projectDir, review);
172
- printJson({ review, manifest });
173
- return 0;
174
- }
175
-
176
- if (command === "runtime" && subcommand === "dispatch") {
177
- const runtime = String(flags.runtime || "claude");
178
- const idea = flags["idea-json"] ? loadIdea(String(flags["idea-json"]), true) : loadIdea(String(flags.idea || "{}"));
179
- const result = dispatchRuntime(runtime, idea);
180
- printJson(result);
181
- return result.status === "ok" ? 0 : 2;
182
- }
183
-
184
- if (command === "teams") {
185
- const result = dispatchTeam({
186
- target: String(flags.target || "auto"),
187
- problem: String(flags.problem || ""),
188
- context: String(flags.context || ""),
189
- files: splitFiles(flags.files),
190
- expected_outcome: String(flags["expected-outcome"] || "")
191
- });
192
- printJson(result);
193
- return 0;
194
- }
195
-
196
- if (command === "ccg") {
197
- const result = executeCcgMode({
198
- problem: String(flags.problem || ""),
199
- project_dir: projectDir,
200
- context: String(flags.context || ""),
201
- files: splitFiles(flags.files)
202
- });
203
- printJson(result);
204
- return 0;
205
- }
206
-
207
- if (command === "crazy") {
208
- const result = executeCrazyMode({
209
- problem: String(flags.problem || ""),
210
- project_dir: projectDir,
211
- context: String(flags.context || ""),
212
- files: splitFiles(flags.files)
213
- });
214
- printJson(result);
215
- return 0;
216
- }
217
-
218
- if ((command === "compat" || command === "omc") && subcommand === "list") {
219
- const skills = listCompatSkills();
220
- printJson({ status: "ok", count: skills.length, skills });
221
- return 0;
222
- }
223
-
224
- if ((command === "compat" || command === "omc") && subcommand === "contract") {
225
- if (flags.all) {
226
- const contracts = listCompatSkillContracts();
227
- printJson({ status: "ok", count: contracts.length, contracts });
228
- return 0;
229
- }
230
- const skill = String(flags.skill || "");
231
- const contract = getCompatSkillContract(skill);
232
- if (!contract) {
233
- printJson({ status: "error", message: `Unknown skill: ${skill}` });
234
- return 2;
235
- }
236
- printJson({ status: "ok", contract });
237
- return 0;
238
- }
239
-
240
- if ((command === "compat" || command === "omc") && subcommand === "gap-report") {
241
- const report = buildCompatGapReport(projectDir);
242
- const output = String(flags.output || DEFAULT_GAP_REPORT_PATH);
243
- ensureParent(output);
244
- Bun.write(output, JSON.stringify(report, null, 2));
245
- printJson({ status: "ok", report });
246
- return 0;
247
- }
248
-
249
- if ((command === "compat" || command === "omc") && subcommand === "snapshot") {
250
- const payload = buildContractSnapshotPayload({ includeGeneratedAt: true });
251
- const output = String(flags.output || DEFAULT_CONTRACT_SNAPSHOT_PATH);
252
- ensureParent(output);
253
- Bun.write(output, JSON.stringify(payload, null, 2));
254
- printJson({ status: "ok", output, count: payload.count });
255
- return 0;
256
- }
257
-
258
- if ((command === "compat" || command === "omc") && subcommand === "gate") {
259
- const report = buildCompatGapReport(projectDir);
260
- const output = String(flags.output || DEFAULT_GAP_REPORT_PATH);
261
- ensureParent(output);
262
- Bun.write(output, JSON.stringify(report, null, 2));
263
- const maxBridge = Number(flags["max-bridge"] || 0);
264
- const bridgeCount = Number((report.maturity_counts as Record<string, number>).bridge || 0);
265
- if (bridgeCount > maxBridge) {
266
- printJson({
267
- status: "error",
268
- message: `OMG compat gate failed: bridge=${bridgeCount} > max_bridge=${maxBridge}`,
269
- report
270
- });
271
- return 3;
272
- }
273
- printJson({
274
- status: "ok",
275
- message: `OMG compat gate passed: bridge=${bridgeCount} <= max_bridge=${maxBridge}`,
276
- report
277
- });
278
- return 0;
279
- }
280
-
281
- if ((command === "compat" || command === "omc") && subcommand === "run") {
282
- const result = dispatchCompatSkill({
283
- skill: String(flags.skill || ""),
284
- problem: String(flags.problem || ""),
285
- context: String(flags.context || ""),
286
- files: splitFiles(flags.files),
287
- expected_outcome: String(flags["expected-outcome"] || ""),
288
- project_dir: projectDir
289
- });
290
- printJson(result);
291
- return result.status === "ok" ? 0 : 2;
292
- }
293
-
294
- if (command === "ecosystem" && subcommand === "list") {
295
- const repos = listEcosystemRepos();
296
- printJson({ status: "ok", count: repos.length, repos });
297
- return 0;
298
- }
299
-
300
- if (command === "ecosystem" && subcommand === "status") {
301
- printJson(ecosystemStatus({ project_dir: projectDir }));
302
- return 0;
303
- }
304
-
305
- if (command === "ecosystem" && subcommand === "sync") {
306
- const result = syncEcosystemRepos({
307
- project_dir: projectDir,
308
- names: splitFiles(flags.names),
309
- update: Boolean(flags.update),
310
- depth: Number(flags.depth || 1)
311
- });
312
- printJson(result);
313
- return 0;
314
- }
315
-
316
- if (command === "providers" && subcommand === "status") {
317
- const result = collectProviderStatusWithOptions(projectDir, {
318
- includeSmoke: Boolean(flags.smoke),
319
- smokeHostMode: String(flags["host-mode"] || "claude_dispatch")
320
- });
321
- printJson(result);
322
- return 0;
323
- }
324
-
325
- if (command === "providers" && subcommand === "smoke") {
326
- const result = runProviderSmokeMatrix({
327
- project_dir: projectDir,
328
- provider: String(flags.provider || "all"),
329
- host_mode: String(flags["host-mode"] || "claude_dispatch")
330
- });
331
- printJson(result);
332
- return 0;
333
- }
334
-
335
- if (command === "providers" && subcommand === "repair") {
336
- const result = repairProviderHosts(projectDir, String(flags.provider || ""));
337
- printJson(result);
338
- return 0;
339
- }
340
-
341
- if (command === "release" && subcommand === "readiness") {
342
- printJson(collectReleaseReadiness(projectDir));
343
- return 0;
344
- }
345
-
346
- usage();
347
- }
348
-
349
- if (import.meta.main) {
350
- const exitCode = await main();
351
- process.exit(exitCode);
352
- }
@@ -1,93 +0,0 @@
1
- #!/usr/bin/env bun
2
- import { existsSync, readFileSync, writeFileSync } from "node:fs";
3
- import { dirname } from "node:path";
4
-
5
- function readJson(path: string): Record<string, any> {
6
- if (!existsSync(path)) {
7
- return {};
8
- }
9
- return JSON.parse(readFileSync(path, "utf8"));
10
- }
11
-
12
- function unique<T>(items: T[]): T[] {
13
- return [...new Set(items)];
14
- }
15
-
16
- type HookCommandEntry = {
17
- command?: unknown;
18
- [key: string]: unknown;
19
- };
20
-
21
- const RETIRED_HOOK_COMMANDS = new Set([
22
- "\"$HOME/.claude/hooks/pre-tool-inject.ts\"",
23
- "\"$HOME/.claude/hooks/test-generator-hook.ts\"",
24
- "\"$HOME/.claude/hooks/post-write.ts\""
25
- ]);
26
-
27
- function pruneRetiredHooks(hooks: Record<string, any>) {
28
- const pruned: Record<string, any[]> = {};
29
- for (const [event, entries] of Object.entries(hooks)) {
30
- const nextEntries = (Array.isArray(entries) ? entries : [])
31
- .map((entry) => {
32
- const nextHooks = (Array.isArray(entry?.hooks) ? entry.hooks : []).filter(
33
- (hook: HookCommandEntry) => !RETIRED_HOOK_COMMANDS.has(String(hook.command || ""))
34
- );
35
- return nextHooks.length > 0 ? { ...entry, hooks: nextHooks } : null;
36
- })
37
- .filter(Boolean);
38
- if (nextEntries.length > 0) {
39
- pruned[event] = nextEntries as any[];
40
- }
41
- }
42
- return pruned;
43
- }
44
-
45
- function mergeHooks(target: Record<string, any>, source: Record<string, any>) {
46
- const merged: Record<string, any[]> = { ...target };
47
- for (const [event, entries] of Object.entries(source)) {
48
- const current = Array.isArray(merged[event]) ? merged[event] : [];
49
- const next = Array.isArray(entries) ? entries : [];
50
- const serialized = new Set(current.map((entry) => JSON.stringify(entry)));
51
- for (const entry of next) {
52
- const key = JSON.stringify(entry);
53
- if (!serialized.has(key)) {
54
- current.push(entry);
55
- serialized.add(key);
56
- }
57
- }
58
- merged[event] = current;
59
- }
60
- return pruneRetiredHooks(merged);
61
- }
62
-
63
- function mergeSettings(target: Record<string, any>, source: Record<string, any>) {
64
- return {
65
- ...target,
66
- ...source,
67
- permissions: {
68
- allow: unique([...(target.permissions?.allow || []), ...(source.permissions?.allow || [])]),
69
- ask: unique([...(target.permissions?.ask || []), ...(source.permissions?.ask || [])]),
70
- deny: unique([...(target.permissions?.deny || []), ...(source.permissions?.deny || [])])
71
- },
72
- hooks: mergeHooks(target.hooks || {}, source.hooks || {})
73
- };
74
- }
75
-
76
- function main(argv = process.argv.slice(2)) {
77
- const [targetPath, sourcePath] = argv;
78
- if (!targetPath || !sourcePath) {
79
- process.stderr.write("Usage: settings-merge.ts <target> <source>\n");
80
- return 2;
81
- }
82
- const merged = mergeSettings(readJson(targetPath), readJson(sourcePath));
83
- if (argv.includes("--dry-run")) {
84
- process.stdout.write(`${JSON.stringify(merged, null, 2)}\n`);
85
- return 0;
86
- }
87
- Bun.write(targetPath, JSON.stringify(merged, null, 2));
88
- return 0;
89
- }
90
-
91
- if (import.meta.main) {
92
- process.exit(main());
93
- }
@@ -1,23 +0,0 @@
1
- #!/usr/bin/env bun
2
- function main(argv = process.argv.slice(2)) {
3
- const dryRun = argv.includes("--dry-run");
4
- process.stdout.write(
5
- `${JSON.stringify(
6
- {
7
- status: "ok",
8
- dry_run: dryRun,
9
- groups: [
10
- { type: "runtime", files: ["runtime/compat.ts"] },
11
- { type: "hooks", files: ["hooks/circuit-breaker.ts"] }
12
- ]
13
- },
14
- null,
15
- 2
16
- )}\n`
17
- );
18
- return 0;
19
- }
20
-
21
- if (import.meta.main) {
22
- process.exit(main());
23
- }
@@ -1,18 +0,0 @@
1
- #!/usr/bin/env bun
2
- function main() {
3
- process.stdout.write(
4
- `${JSON.stringify(
5
- {
6
- status: "ok",
7
- hunks: []
8
- },
9
- null,
10
- 2
11
- )}\n`
12
- );
13
- return 0;
14
- }
15
-
16
- if (import.meta.main) {
17
- process.exit(main());
18
- }
@@ -1,47 +0,0 @@
1
- #!/usr/bin/env bun
2
- import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
3
- import { join } from "node:path";
4
-
5
- function stateDir(): string {
6
- const projectDir = process.env.CLAUDE_PROJECT_DIR || process.cwd();
7
- return join(projectDir, ".omg", "state", "session-snapshots");
8
- }
9
-
10
- function ensureState() {
11
- mkdirSync(stateDir(), { recursive: true });
12
- }
13
-
14
- function main(argv = process.argv.slice(2)) {
15
- ensureState();
16
- const [command = "list", name = "snapshot"] = argv;
17
- const outputPath = join(stateDir(), `${name}.json`);
18
- if (command === "list" || command === "branches") {
19
- const names = existsSync(stateDir())
20
- ? Bun.spawnSync({ cmd: ["bash", "-lc", `find "${stateDir()}" -maxdepth 1 -name '*.json' -print | xargs -n1 basename | sed 's/.json$//'`] })
21
- .stdout.toString()
22
- .split(/\r?\n/)
23
- .filter(Boolean)
24
- : [];
25
- process.stdout.write(`${JSON.stringify({ status: "ok", names }, null, 2)}\n`);
26
- return 0;
27
- }
28
- if (command === "switch") {
29
- process.stdout.write(`${JSON.stringify({ status: "ok", active: name }, null, 2)}\n`);
30
- return 0;
31
- }
32
- if (command === "branch") {
33
- writeFileSync(outputPath, JSON.stringify({ name, created_at: new Date().toISOString() }, null, 2));
34
- process.stdout.write(`${JSON.stringify({ status: "ok", path: outputPath }, null, 2)}\n`);
35
- return 0;
36
- }
37
- if (command === "merge-preview" || command === "merge") {
38
- process.stdout.write(`${JSON.stringify({ status: "ok", command, source: name }, null, 2)}\n`);
39
- return 0;
40
- }
41
- process.stderr.write(`Unknown command: ${command}\n`);
42
- return 2;
43
- }
44
-
45
- if (import.meta.main) {
46
- process.exit(main());
47
- }
Binary file
package/tsconfig.json DELETED
@@ -1,15 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2022",
4
- "module": "ESNext",
5
- "moduleResolution": "bundler",
6
- "allowImportingTsExtensions": true,
7
- "strict": true,
8
- "skipLibCheck": true,
9
- "esModuleInterop": true,
10
- "forceConsistentCasingInFileNames": true,
11
- "noEmit": true,
12
- "types": ["bun-types", "node"]
13
- },
14
- "include": ["hooks/**/*.ts", "runtime/**/*.ts", "scripts/**/*.ts", "tests/**/*.ts"]
15
- }