@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,186 +0,0 @@
1
- import { existsSync, readFileSync, writeFileSync } from "node:fs";
2
- import { join } from "node:path";
3
- import { ensureDir, nowIso } from "./common.ts";
4
-
5
- export const DEFAULT_ECOSYSTEM_REPO_DIR = ".omg/ecosystem/repos";
6
- export const DEFAULT_ECOSYSTEM_LOCK_PATH = ".omg/state/ecosystem-lock.json";
7
-
8
- type EcosystemRepo = {
9
- name: string;
10
- aliases: string[];
11
- repo: string;
12
- ref: string;
13
- route: string;
14
- category: string;
15
- capabilities: string[];
16
- notes: string;
17
- };
18
-
19
- const ECOSYSTEM_REPOS: EcosystemRepo[] = [
20
- {
21
- name: "omg-superpowers",
22
- aliases: ["omg-superpowers"],
23
- repo: "https://github.com/trac3er00/OMG.git",
24
- ref: "main",
25
- route: "plan",
26
- category: "tdd",
27
- capabilities: ["tdd", "planning", "execution"],
28
- notes: "Strict execution and verification patterns."
29
- },
30
- {
31
- name: "ralph-wiggum",
32
- aliases: ["ralph-wiggum", "ralph"],
33
- repo: "https://github.com/anthropics/claude-code.git",
34
- ref: "main",
35
- route: "runtime_ship",
36
- category: "persistent-loop",
37
- capabilities: ["persistent-mode", "completion-promises", "iteration"],
38
- notes: "Persistent loop patterns."
39
- },
40
- {
41
- name: "claude-flow",
42
- aliases: ["claude-flow"],
43
- repo: "https://github.com/ruvnet/claude-flow.git",
44
- ref: "main",
45
- route: "ccg",
46
- category: "orchestration",
47
- capabilities: ["multi-agent", "coordination", "task-routing"],
48
- notes: "CCG orchestration ideas."
49
- },
50
- {
51
- name: "claude-mem",
52
- aliases: ["claude-mem"],
53
- repo: "https://github.com/thedotmack/claude-mem.git",
54
- ref: "main",
55
- route: "memory",
56
- category: "memory",
57
- capabilities: ["session-memory", "knowledge-capture", "recall"],
58
- notes: "Memory workflows."
59
- },
60
- {
61
- name: "memsearch",
62
- aliases: ["memsearch", "memory-search"],
63
- repo: "https://github.com/rjyo/memory-search.git",
64
- ref: "main",
65
- route: "memory",
66
- category: "memory-search",
67
- capabilities: ["semantic-search", "retrieval", "indexing"],
68
- notes: "Focused memory retrieval."
69
- },
70
- {
71
- name: "beads",
72
- aliases: ["beads"],
73
- repo: "https://github.com/steveyegge/beads.git",
74
- ref: "main",
75
- route: "maintainer",
76
- category: "context-engineering",
77
- capabilities: ["context", "workflow", "agent-patterns"],
78
- notes: "Context engineering."
79
- },
80
- {
81
- name: "planning-with-files",
82
- aliases: ["planning-with-files", "planning with files"],
83
- repo: "https://github.com/OthmanAdi/planning-with-files.git",
84
- ref: "master",
85
- route: "plan",
86
- category: "planning",
87
- capabilities: ["file-based-plans", "checklists", "handoff"],
88
- notes: "Plan artifacts."
89
- },
90
- {
91
- name: "hooks-mastery",
92
- aliases: ["hooks-mastery"],
93
- repo: "https://github.com/disler/claude-code-hooks-mastery.git",
94
- ref: "main",
95
- route: "health",
96
- category: "hooks",
97
- capabilities: ["hook-design", "hook-hardening", "hook-automation"],
98
- notes: "Hook hardening references."
99
- },
100
- {
101
- name: "compound-engineering",
102
- aliases: ["compound-engineering", "compounding-engineering"],
103
- repo: "https://github.com/EveryInc/compounding-engineering-plugin.git",
104
- ref: "main",
105
- route: "ccg",
106
- category: "compound-workflows",
107
- capabilities: ["iterative-improvement", "compound-results", "workflow-composition"],
108
- notes: "Compound workflows."
109
- }
110
- ];
111
-
112
- function canonical(name: string): string {
113
- return name.trim().toLowerCase().replace(/\s+/g, "-");
114
- }
115
-
116
- export function listEcosystemRepos(): EcosystemRepo[] {
117
- return ECOSYSTEM_REPOS.map((repo) => ({ ...repo, aliases: [...repo.aliases], capabilities: [...repo.capabilities] }));
118
- }
119
-
120
- export function ecosystemStatus(options: { project_dir: string }) {
121
- const repos = listEcosystemRepos().map((repo) => {
122
- const repoDir = join(options.project_dir, DEFAULT_ECOSYSTEM_REPO_DIR, repo.name);
123
- return {
124
- ...repo,
125
- repo_segments: [".omg", "ecosystem", "repos", repo.name],
126
- installed: existsSync(repoDir),
127
- path: repoDir
128
- };
129
- });
130
- return {
131
- schema: "OmgEcosystemStatus",
132
- status: "ok",
133
- generated_at: nowIso(),
134
- repos
135
- };
136
- }
137
-
138
- export function syncEcosystemRepos(options: {
139
- project_dir: string;
140
- names?: string[];
141
- update?: boolean;
142
- depth?: number;
143
- }) {
144
- const requested = options.names || [];
145
- const selected = requested.length
146
- ? requested
147
- : ECOSYSTEM_REPOS.map((repo) => repo.name);
148
- const lockPath = join(options.project_dir, DEFAULT_ECOSYSTEM_LOCK_PATH);
149
- const unknown: string[] = [];
150
- const entries: Record<string, unknown>[] = [];
151
- const lockData = existsSync(lockPath) ? JSON.parse(readFileSync(lockPath, "utf8")) : {};
152
-
153
- ensureDir(join(options.project_dir, ".omg", "ecosystem", "repos"));
154
- ensureDir(join(options.project_dir, ".omg", "state"));
155
-
156
- for (const raw of selected) {
157
- const repo = ECOSYSTEM_REPOS.find((candidate) => canonical(candidate.name) === canonical(raw) || candidate.aliases.some((alias) => canonical(alias) === canonical(raw)));
158
- if (!repo) {
159
- unknown.push(raw);
160
- continue;
161
- }
162
- const repoDir = join(options.project_dir, DEFAULT_ECOSYSTEM_REPO_DIR, repo.name);
163
- ensureDir(repoDir);
164
- entries.push({
165
- status: "ok",
166
- name: repo.name,
167
- action: existsSync(join(repoDir, ".git")) ? (options.update ? "updated" : "cached") : "prepared",
168
- repo_segments: [".omg", "ecosystem", "repos", repo.name],
169
- path: repoDir
170
- });
171
- (lockData as Record<string, unknown>)[repo.name] = {
172
- repo: repo.repo,
173
- ref: repo.ref,
174
- synced_at: nowIso()
175
- };
176
- }
177
-
178
- writeFileSync(lockPath, `${JSON.stringify(lockData, null, 2)}\n`, "utf8");
179
- return {
180
- schema: "OmgEcosystemSync",
181
- status: "ok",
182
- generated_at: nowIso(),
183
- unknown,
184
- entries
185
- };
186
- }
@@ -1,99 +0,0 @@
1
- import { copyFileSync, existsSync, readFileSync, writeFileSync } from "node:fs";
2
- import { join } from "node:path";
3
- import { nowIso } from "./common.ts";
4
-
5
- type ProviderMeta = {
6
- provider: string;
7
- command: string;
8
- };
9
-
10
- const PROVIDERS: ProviderMeta[] = [
11
- { provider: "codex", command: "codex" },
12
- { provider: "gemini", command: "gemini" },
13
- { provider: "kimi", command: "kimi" }
14
- ];
15
-
16
- function commandExists(command: string): boolean {
17
- const proc = Bun.spawnSync({
18
- cmd: ["bash", "-lc", `command -v ${command}`],
19
- stdout: "ignore",
20
- stderr: "ignore"
21
- });
22
- return proc.exitCode === 0;
23
- }
24
-
25
- export function collectProviderStatusWithOptions(
26
- projectDir: string,
27
- options: { includeSmoke?: boolean; smokeHostMode?: string } = {}
28
- ) {
29
- const providers = PROVIDERS.map((provider) => {
30
- const installed = commandExists(provider.command);
31
- return {
32
- provider: provider.provider,
33
- command: provider.command,
34
- installed,
35
- smoke_host_mode: options.smokeHostMode || "claude_dispatch",
36
- parity_state: installed ? "ready" : "blocked",
37
- native_ready: installed,
38
- dispatch_ready: installed,
39
- local_steps: installed ? [] : [`install_${provider.command}_cli`],
40
- provider_steps: installed ? [] : ["login_to_provider"],
41
- native_ready_reasons: installed ? [] : ["provider_cli_missing"],
42
- dispatch_ready_reasons: installed ? [] : ["provider_cli_missing"],
43
- smoke_status: options.includeSmoke ? (installed ? "ready" : "blocked") : "not-requested"
44
- };
45
- });
46
- return {
47
- schema: "OmgProviderStatus",
48
- status: "ok",
49
- generated_at: nowIso(),
50
- project_dir: projectDir,
51
- providers
52
- };
53
- }
54
-
55
- export function collectProviderStatus(projectDir: string) {
56
- return collectProviderStatusWithOptions(projectDir);
57
- }
58
-
59
- export function bootstrapProviderHosts(projectDir: string) {
60
- return {
61
- status: "ok",
62
- schema: "OmgProviderBootstrap",
63
- generated_at: nowIso(),
64
- project_dir: projectDir,
65
- actions: PROVIDERS.map((provider) => ({
66
- provider: provider.provider,
67
- action: "noop"
68
- }))
69
- };
70
- }
71
-
72
- export function repairProviderHosts(projectDir: string, provider: string) {
73
- const configPath =
74
- provider === "codex"
75
- ? join(process.env.HOME || "", ".codex", "config.toml")
76
- : provider === "gemini"
77
- ? join(process.env.HOME || "", ".gemini", "config.toml")
78
- : "";
79
- let backup = "";
80
- let changed = false;
81
- if (configPath && existsSync(configPath)) {
82
- backup = `${configPath}.bak.${Date.now()}`;
83
- copyFileSync(configPath, backup);
84
- const cleaned = readFileSync(configPath, "utf8").replace(/^.*rmcp_client.*$\n?/gm, "");
85
- if (cleaned !== readFileSync(configPath, "utf8")) {
86
- writeFileSync(configPath, cleaned, "utf8");
87
- changed = true;
88
- }
89
- }
90
- return {
91
- status: "ok",
92
- schema: "OmgProviderRepair",
93
- generated_at: nowIso(),
94
- project_dir: projectDir,
95
- provider,
96
- changed,
97
- backup
98
- };
99
- }
@@ -1,34 +0,0 @@
1
- import { collectProviderStatusWithOptions } from "./provider_bootstrap.ts";
2
- import { nowIso } from "./common.ts";
3
-
4
- export function runProviderSmokeMatrix(input: {
5
- project_dir: string;
6
- provider?: string;
7
- host_mode?: string;
8
- }) {
9
- const status = collectProviderStatusWithOptions(input.project_dir, {
10
- includeSmoke: true,
11
- smokeHostMode: input.host_mode || "claude_dispatch"
12
- });
13
- const selected = String(input.provider || "all");
14
- const providers = status.providers.filter((entry: any) => selected === "all" || entry.provider === selected);
15
- const results = providers.map((entry: any) => {
16
- if (!entry.installed) {
17
- return { provider: entry.provider, status: "skipped", reason: "provider_cli_missing" };
18
- }
19
- const proc = Bun.spawnSync({ cmd: [entry.command, "--version"], stdout: "pipe", stderr: "pipe" });
20
- return {
21
- provider: entry.provider,
22
- status: proc.exitCode === 0 ? "passed" : "failed",
23
- exit_code: proc.exitCode,
24
- stdout: proc.stdout.toString().trim(),
25
- stderr: proc.stderr.toString().trim()
26
- };
27
- });
28
- return {
29
- schema: "OmgProviderSmokeMatrix",
30
- status: "ok",
31
- generated_at: nowIso(),
32
- results
33
- };
34
- }
@@ -1,186 +0,0 @@
1
- import { existsSync, readFileSync, statSync } from "node:fs";
2
- import { join } from "node:path";
3
- import { nowIso, readJsonFile } from "./common.ts";
4
- import { collectProviderStatusWithOptions } from "./provider_bootstrap.ts";
5
-
6
- const STABLE_METADATA_FILES = [
7
- "package.json",
8
- "README.md",
9
- "settings.json",
10
- ".claude-plugin/plugin.json",
11
- ".claude-plugin/marketplace.json",
12
- "plugins/core/plugin.json",
13
- "plugins/advanced/plugin.json",
14
- "runtime/compat.ts"
15
- ];
16
-
17
- const DEPRECATED_PROVIDER_FILES = [
18
- "README.md",
19
- "plugins/README.md",
20
- "hud/omg-hud.mjs",
21
- "runtime/provider_bootstrap.ts"
22
- ];
23
-
24
- const REQUIRED_INSTALL_SCRIPTS = [
25
- "OMG-setup.sh",
26
- ".claude-plugin/scripts/install.sh",
27
- ".claude-plugin/scripts/update.sh",
28
- ".claude-plugin/scripts/uninstall.sh"
29
- ];
30
-
31
- function git(projectDir: string, args: string[]): string {
32
- const proc = Bun.spawnSync({
33
- cmd: ["git", ...args],
34
- cwd: projectDir,
35
- stdout: "pipe",
36
- stderr: "pipe"
37
- });
38
- return proc.exitCode === 0 ? proc.stdout.toString().trim() : "";
39
- }
40
-
41
- function readTextIfPresent(projectDir: string, relativePath: string): string {
42
- const path = join(projectDir, relativePath);
43
- return existsSync(path) ? readFileSync(path, "utf8") : "";
44
- }
45
-
46
- function isExecutable(projectDir: string, relativePath: string): boolean {
47
- const path = join(projectDir, relativePath);
48
- if (!existsSync(path)) {
49
- return false;
50
- }
51
- return (statSync(path).mode & 0o111) !== 0;
52
- }
53
-
54
- function collectStableMetadataBlockers(projectDir: string): string[] {
55
- const blockers: string[] = [];
56
- const betaPattern = /\b2\.0\.0-beta\.\d+\b|\bv2\.0\.0-beta\.\d+\b/;
57
-
58
- for (const relativePath of STABLE_METADATA_FILES) {
59
- const content = readTextIfPresent(projectDir, relativePath);
60
- if (content && betaPattern.test(content)) {
61
- blockers.push(`beta marker in ${relativePath}`);
62
- }
63
- }
64
-
65
- const pkg = readJsonFile<Record<string, unknown>>(join(projectDir, "package.json"), {});
66
- if (String(pkg.version || "").includes("-beta.")) {
67
- blockers.push("beta marker in package.json");
68
- }
69
-
70
- return [...new Set(blockers)];
71
- }
72
-
73
- function collectDeprecatedProviderBlockers(projectDir: string): string[] {
74
- const blockers: string[] = [];
75
-
76
- for (const relativePath of DEPRECATED_PROVIDER_FILES) {
77
- const content = readTextIfPresent(projectDir, relativePath);
78
- if (content && /\bopencode\b/i.test(content)) {
79
- blockers.push(`deprecated provider token in ${relativePath}`);
80
- }
81
- }
82
-
83
- return blockers;
84
- }
85
-
86
- function collectPackagingBlockers(projectDir: string): string[] {
87
- const blockers: string[] = [];
88
- const pkg = readJsonFile<Record<string, any>>(join(projectDir, "package.json"), {});
89
- const scripts = pkg.scripts && typeof pkg.scripts === "object" ? (pkg.scripts as Record<string, string>) : {};
90
-
91
- if (scripts.postinstall !== "bash ./OMG-setup.sh install --non-interactive") {
92
- blockers.push("packaged install smoke missing: package.json postinstall must use bash ./OMG-setup.sh");
93
- }
94
- if (scripts.update !== "bash ./OMG-setup.sh update") {
95
- blockers.push("packaged install smoke missing: package.json update must use bash ./OMG-setup.sh");
96
- }
97
- if (scripts.uninstall !== "bash ./OMG-setup.sh uninstall") {
98
- blockers.push("packaged install smoke missing: package.json uninstall must use bash ./OMG-setup.sh");
99
- }
100
-
101
- const npmignore = readTextIfPresent(projectDir, ".npmignore");
102
- if (npmignore) {
103
- const ignoresInstallScript = npmignore.split(/\r?\n/).some((line) => line.trim() === "install.sh");
104
- const restoresPluginInstallScript = npmignore
105
- .split(/\r?\n/)
106
- .some((line) => line.trim() === "!.claude-plugin/scripts/install.sh");
107
- if (ignoresInstallScript && !restoresPluginInstallScript) {
108
- blockers.push("packaged install smoke missing: .npmignore excludes .claude-plugin/scripts/install.sh");
109
- }
110
- }
111
-
112
- for (const relativePath of REQUIRED_INSTALL_SCRIPTS) {
113
- const path = join(projectDir, relativePath);
114
- if (!existsSync(path)) {
115
- blockers.push(`packaged install smoke missing: ${relativePath}`);
116
- continue;
117
- }
118
- if (!isExecutable(projectDir, relativePath)) {
119
- blockers.push(`packaged install smoke missing: ${relativePath} is not executable`);
120
- }
121
- }
122
-
123
- return blockers;
124
- }
125
-
126
- export function collectReleaseReadiness(projectDir: string) {
127
- const providerStatus = collectProviderStatusWithOptions(projectDir, {
128
- includeSmoke: true,
129
- smokeHostMode: "claude_dispatch"
130
- });
131
- const providers = providerStatus.providers as Array<Record<string, unknown>>;
132
- const blocked = providers
133
- .filter((entry) => String(entry.parity_state) === "blocked")
134
- .map((entry) => String(entry.provider));
135
- const native_ready = providers
136
- .filter((entry) => Boolean(entry.native_ready))
137
- .map((entry) => String(entry.provider));
138
-
139
- const staticBlockers = {
140
- stable_metadata: collectStableMetadataBlockers(projectDir),
141
- deprecated_provider_tokens: collectDeprecatedProviderBlockers(projectDir),
142
- packaged_install_smoke: collectPackagingBlockers(projectDir)
143
- };
144
-
145
- const statusLines = git(projectDir, ["status", "--short"])
146
- .split(/\r?\n/)
147
- .filter(Boolean);
148
- const blockers = [
149
- ...staticBlockers.stable_metadata,
150
- ...staticBlockers.deprecated_provider_tokens,
151
- ...staticBlockers.packaged_install_smoke,
152
- ...(statusLines.length > 0 ? ["git working tree is dirty"] : [])
153
- ];
154
-
155
- return {
156
- schema: "OmgReleaseReadiness",
157
- status: "ok",
158
- generated_at: nowIso(),
159
- git: {
160
- branch: git(projectDir, ["branch", "--show-current"]),
161
- dirty: statusLines.length > 0,
162
- status_lines: statusLines
163
- },
164
- providers: {
165
- blocked,
166
- native_ready,
167
- matrix: providerStatus
168
- },
169
- static_checks: {
170
- stable_metadata: {
171
- status: staticBlockers.stable_metadata.length === 0 ? "ok" : "blocked",
172
- blockers: staticBlockers.stable_metadata
173
- },
174
- deprecated_provider_tokens: {
175
- status: staticBlockers.deprecated_provider_tokens.length === 0 ? "ok" : "blocked",
176
- blockers: staticBlockers.deprecated_provider_tokens
177
- },
178
- packaged_install_smoke: {
179
- status: staticBlockers.packaged_install_smoke.length === 0 ? "ok" : "blocked",
180
- blockers: staticBlockers.packaged_install_smoke
181
- }
182
- },
183
- blockers,
184
- ready_for_release: blockers.length === 0
185
- };
186
- }
@@ -1,144 +0,0 @@
1
- import { normalizeWhitespace } from "./common.ts";
2
-
3
- export type TeamDispatchRequest = {
4
- target: string;
5
- problem: string;
6
- context?: string;
7
- files?: string[];
8
- expected_outcome?: string;
9
- };
10
-
11
- type Phase = {
12
- agent: string;
13
- focus: string;
14
- };
15
-
16
- export type TeamDispatchResult = {
17
- status: "ok";
18
- schema: "TeamDispatchResult";
19
- target: string;
20
- evidence: Record<string, unknown>;
21
- worker_count: number;
22
- target_worker_count: number;
23
- parallel_execution: boolean;
24
- sequential_execution: boolean;
25
- phases: Phase[];
26
- actions: string[];
27
- };
28
-
29
- function inferAutoTarget(problem: string): { target: string; reason: string } {
30
- const normalized = normalizeWhitespace(problem).toLowerCase();
31
- if (/\bgemini\b/.test(normalized)) {
32
- return { target: "gemini", reason: "explicit-provider-mention" };
33
- }
34
- if (/\bcodex\b/.test(normalized)) {
35
- return { target: "codex", reason: "explicit-provider-mention" };
36
- }
37
- const ui = /\b(ui|ux|layout|component|design|css|visual|dashboard|frontend)\b/.test(normalized);
38
- const code = /\b(api|auth|backend|service|bug|debug|security|database|logic|review|full stack)\b/.test(normalized);
39
- const ccg = /\bccg\b/.test(normalized) || (ui && code);
40
- if (ccg) {
41
- return { target: "ccg", reason: "mixed-ui-and-code-signals" };
42
- }
43
- if (ui) {
44
- return { target: "gemini", reason: "frontend-signals" };
45
- }
46
- return { target: "codex", reason: "default-backend-path" };
47
- }
48
-
49
- function buildSingleTrack(target: string, problem: string, reason: string): TeamDispatchResult {
50
- const phase: Phase =
51
- target === "gemini"
52
- ? { agent: "frontend-designer", focus: `Design response for "${problem}"` }
53
- : { agent: "backend-engineer", focus: `Implement or debug "${problem}"` };
54
- return {
55
- status: "ok",
56
- schema: "TeamDispatchResult",
57
- target,
58
- evidence: { target, reason },
59
- worker_count: 1,
60
- target_worker_count: 1,
61
- parallel_execution: false,
62
- sequential_execution: true,
63
- phases: [phase],
64
- actions: [`route:${target}`, `problem:${problem}`]
65
- };
66
- }
67
-
68
- export function executeCcgMode(input: {
69
- problem: string;
70
- project_dir?: string;
71
- context?: string;
72
- files?: string[];
73
- }): TeamDispatchResult {
74
- return {
75
- status: "ok",
76
- schema: "TeamDispatchResult",
77
- target: "ccg",
78
- evidence: {
79
- target: "ccg",
80
- reason: "dual-track-orchestrator",
81
- project_dir: input.project_dir || ""
82
- },
83
- worker_count: 2,
84
- target_worker_count: 2,
85
- parallel_execution: true,
86
- sequential_execution: false,
87
- phases: [
88
- { agent: "backend-engineer", focus: `Codex track for "${input.problem}"` },
89
- { agent: "frontend-designer", focus: `Gemini track for "${input.problem}"` }
90
- ],
91
- actions: ["route:codex", "route:gemini"]
92
- };
93
- }
94
-
95
- export function executeCrazyMode(input: {
96
- problem: string;
97
- project_dir?: string;
98
- context?: string;
99
- files?: string[];
100
- }): TeamDispatchResult {
101
- return {
102
- status: "ok",
103
- schema: "TeamDispatchResult",
104
- target: "crazy",
105
- evidence: {
106
- target: "crazy",
107
- reason: "parallel-multi-agent-mode",
108
- project_dir: input.project_dir || ""
109
- },
110
- worker_count: 5,
111
- target_worker_count: 5,
112
- parallel_execution: true,
113
- sequential_execution: false,
114
- phases: [
115
- { agent: "architect-mode", focus: `Define execution lanes for "${input.problem}"` },
116
- { agent: "backend-engineer", focus: "Core backend and logic pass" },
117
- { agent: "frontend-designer", focus: "UI, UX, and interaction pass" },
118
- { agent: "security-auditor", focus: "Security risk scan" },
119
- { agent: "testing-engineer", focus: "Verification and regression coverage" }
120
- ],
121
- actions: ["plan", "backend", "frontend", "security", "test"]
122
- };
123
- }
124
-
125
- export function dispatchTeam(request: TeamDispatchRequest): TeamDispatchResult {
126
- const requested = request.target || "auto";
127
- const resolved = requested === "auto" ? inferAutoTarget(request.problem) : { target: requested, reason: "explicit-target" };
128
- if (resolved.target === "ccg") {
129
- const ccg = executeCcgMode({
130
- problem: request.problem,
131
- context: request.context || "",
132
- files: request.files || []
133
- });
134
- ccg.evidence = { ...ccg.evidence, requested_target: requested };
135
- return ccg;
136
- }
137
- const single = buildSingleTrack(resolved.target, request.problem, resolved.reason);
138
- single.evidence = {
139
- ...single.evidence,
140
- requested_target: requested,
141
- expected_outcome: request.expected_outcome || ""
142
- };
143
- return single;
144
- }
@@ -1,20 +0,0 @@
1
- #!/usr/bin/env bun
2
- import { readFileSync } from "node:fs";
3
- import { join } from "node:path";
4
- import { ROOT_DIR } from "../runtime/common.ts";
5
- import { buildContractSnapshotPayload } from "../runtime/compat.ts";
6
-
7
- function main() {
8
- const snapshotPath = join(ROOT_DIR, "runtime", "omg_compat_contract_snapshot.json");
9
- const actual = JSON.parse(readFileSync(snapshotPath, "utf8"));
10
- const expected = buildContractSnapshotPayload();
11
- if (JSON.stringify(actual.contracts) !== JSON.stringify(expected.contracts)) {
12
- process.stderr.write("compat contract snapshot drift detected\n");
13
- return 1;
14
- }
15
- return 0;
16
- }
17
-
18
- if (import.meta.main) {
19
- process.exit(main());
20
- }
@@ -1,12 +0,0 @@
1
- #!/usr/bin/env bun
2
- import { spawnSync } from "bun";
3
-
4
- if (import.meta.main) {
5
- const proc = spawnSync({
6
- cmd: ["bun", "scripts/check-runtime-clean.ts"],
7
- cwd: process.cwd(),
8
- stdout: "inherit",
9
- stderr: "inherit"
10
- });
11
- process.exit(proc.exitCode);
12
- }