oh-my-githubcopilot 1.8.1 → 2.0.0-alpha.1cd01f4

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 (60) hide show
  1. package/.claude-plugin/plugin.json +23 -3
  2. package/AGENTS.md +29 -25
  3. package/CHANGELOG.md +49 -336
  4. package/README.md +7 -2
  5. package/agents/code-reviewer.agent.md +5 -0
  6. package/agents/{simplifier.agent.md → code-simplifier.agent.md} +2 -2
  7. package/agents/debugger.agent.md +1 -1
  8. package/agents/document-specialist.agent.md +6 -1
  9. package/agents/{explorer.agent.md → explore.agent.md} +2 -2
  10. package/agents/security-reviewer.agent.md +1 -1
  11. package/agents/test-engineer.agent.md +3 -1
  12. package/bin/omp-statusline.mjs +12 -11
  13. package/bin/omp-statusline.mjs.map +2 -2
  14. package/bin/omp.mjs +885 -42
  15. package/bin/omp.mjs.map +4 -4
  16. package/dist/hooks/delegation-enforcer.mjs +65 -13
  17. package/dist/hooks/delegation-enforcer.mjs.map +4 -4
  18. package/dist/hooks/hud-emitter.mjs +80 -28
  19. package/dist/hooks/hud-emitter.mjs.map +4 -4
  20. package/dist/hooks/keyword-detector.mjs +117 -11
  21. package/dist/hooks/keyword-detector.mjs.map +4 -4
  22. package/dist/hooks/model-router.mjs +64 -12
  23. package/dist/hooks/model-router.mjs.map +4 -4
  24. package/dist/hooks/stop-continuation.mjs +66 -14
  25. package/dist/hooks/stop-continuation.mjs.map +4 -4
  26. package/dist/hooks/token-tracker.mjs +81 -19
  27. package/dist/hooks/token-tracker.mjs.map +4 -4
  28. package/dist/mcp/server.mjs +17 -16
  29. package/dist/mcp/server.mjs.map +2 -2
  30. package/extension/extension.mjs +659 -0
  31. package/hooks/hooks.json +6 -6
  32. package/package.json +3 -2
  33. package/plugin.json +23 -3
  34. package/skills/build-fix/SKILL.md +35 -0
  35. package/skills/cancel/SKILL.md +33 -0
  36. package/skills/ccg/SKILL.md +37 -0
  37. package/skills/code-review/SKILL.md +33 -0
  38. package/skills/deep-dive/SKILL.md +33 -0
  39. package/skills/deepinit/SKILL.md +33 -0
  40. package/skills/deepsearch/SKILL.md +33 -0
  41. package/skills/design/SKILL.md +37 -0
  42. package/skills/external-context/SKILL.md +33 -0
  43. package/skills/help/SKILL.md +33 -0
  44. package/skills/omp-doctor/SKILL.md +23 -1
  45. package/skills/omp-reference/SKILL.md +20 -24
  46. package/skills/remember/SKILL.md +39 -0
  47. package/skills/research/SKILL.md +1 -1
  48. package/skills/sciomc/SKILL.md +35 -0
  49. package/skills/security-review/SKILL.md +33 -0
  50. package/skills/self-improve/SKILL.md +35 -0
  51. package/skills/ultragoal/SKILL.md +33 -0
  52. package/skills/ultraqa/SKILL.md +33 -0
  53. package/skills/verify/SKILL.md +33 -0
  54. package/skills/visual-verdict/SKILL.md +35 -0
  55. package/skills/web-clone/SKILL.md +35 -0
  56. package/skills/writer-memory/SKILL.md +37 -0
  57. package/agents/orchestrator.agent.md +0 -26
  58. package/agents/researcher.agent.md +0 -18
  59. package/agents/reviewer.agent.md +0 -23
  60. package/agents/tester.agent.md +0 -20
package/bin/omp.mjs CHANGED
@@ -44,7 +44,7 @@ function renderAnsi(state) {
44
44
  const modeStr = mode === "-" ? "-" : `\x1B[36m${mode}${reset()}`;
45
45
  const reqWarning = state.warningActive ? " !!" : "";
46
46
  const reqStr = `req:${state.premiumRequests ?? 0}/${state.premiumRequestsTotal ?? 1500}${reqWarning}`;
47
- return `[OMP v${state.version}] ${modeStr} | ${model} | ${ctxStr} | ${tokenStr} | ${reqStr} | ${age} | tools:${state.toolsUsed?.size || 0}/${state.toolsTotal ?? 13} | skills:${state.skillsUsed?.size || 0}/${state.skillsTotal ?? 25} | agents:${state.cumulativeAgentsUsed}/${state.agentsTotal ?? 23} | ${icon} ${state.status}`;
47
+ return `[OMP v${state.version}] ${modeStr} | ${model} | ${ctxStr} | ${tokenStr} | ${reqStr} | ${age} | tools:${state.toolsUsed?.size || 0}/${state.toolsTotal ?? 13} | skills:${state.skillsUsed?.size || 0}/${state.skillsTotal ?? 25} | agents:${state.cumulativeAgentsUsed}/${state.agentsTotal ?? 19} | ${icon} ${state.status}`;
48
48
  }
49
49
  function renderPlain(state) {
50
50
  const age = formatAge(state.startedAt);
@@ -54,7 +54,7 @@ function renderPlain(state) {
54
54
  const model = state.activeModel || "sonnet";
55
55
  const reqWarningPlain = state.warningActive ? " !!" : "";
56
56
  const reqStrPlain = `req:${state.premiumRequests ?? 0}/${state.premiumRequestsTotal ?? 1500}${reqWarningPlain}`;
57
- return `[OMP v${state.version}] ${mode} | ${model} | ctx:${ctx}% | tok:~${tokens}/${state.tokensTotal} | ${reqStrPlain} | ${age} | tools:${state.toolsUsed?.size || 0}/${state.toolsTotal ?? 13} | skills:${state.skillsUsed?.size || 0}/${state.skillsTotal ?? 25} | agents:${state.cumulativeAgentsUsed}/${state.agentsTotal ?? 23} | ${state.status}`;
57
+ return `[OMP v${state.version}] ${mode} | ${model} | ctx:${ctx}% | tok:~${tokens}/${state.tokensTotal} | ${reqStrPlain} | ${age} | tools:${state.toolsUsed?.size || 0}/${state.toolsTotal ?? 13} | skills:${state.skillsUsed?.size || 0}/${state.skillsTotal ?? 25} | agents:${state.cumulativeAgentsUsed}/${state.agentsTotal ?? 19} | ${state.status}`;
58
58
  }
59
59
  var STATUS_ICONS;
60
60
  var init_renderer = __esm({
@@ -134,8 +134,8 @@ function deserializeHudState(raw) {
134
134
  toolsUsed,
135
135
  skillsUsed,
136
136
  toolsTotal: typeof value.toolsTotal === "number" ? value.toolsTotal : 13,
137
- skillsTotal: typeof value.skillsTotal === "number" ? value.skillsTotal : 25,
138
- agentsTotal: typeof value.agentsTotal === "number" ? value.agentsTotal : 23,
137
+ skillsTotal: typeof value.skillsTotal === "number" ? value.skillsTotal : 59,
138
+ agentsTotal: typeof value.agentsTotal === "number" ? value.agentsTotal : 19,
139
139
  premiumRequests: typeof value.premiumRequests === "number" ? value.premiumRequests : 0,
140
140
  premiumRequestsTotal: typeof value.premiumRequestsTotal === "number" ? value.premiumRequestsTotal : DEFAULT_PREMIUM_REQUESTS_TOTAL,
141
141
  warningActive: typeof value.warningActive === "boolean" ? value.warningActive : false
@@ -167,8 +167,8 @@ function buildHudState(snapshot, now = Date.now()) {
167
167
  toolsUsed,
168
168
  skillsUsed,
169
169
  toolsTotal: 13,
170
- skillsTotal: 25,
171
- agentsTotal: 23,
170
+ skillsTotal: 59,
171
+ agentsTotal: 19,
172
172
  premiumRequests: snapshot.premium_requests ?? 0,
173
173
  premiumRequestsTotal: snapshot.premium_requests_total ?? DEFAULT_PREMIUM_REQUESTS_TOTAL,
174
174
  warningActive: snapshot.warning_active ?? false
@@ -189,17 +189,17 @@ function writeHudArtifacts(snapshot, paths = getStatuslinePaths()) {
189
189
  return { line, state, paths };
190
190
  }
191
191
  function readStatusline(paths = getStatuslinePaths()) {
192
- try {
193
- const line = readFileSync(paths.displayPath, "utf-8").trim();
194
- if (line) return line;
195
- } catch {
196
- }
197
192
  try {
198
193
  const parsed = JSON.parse(readFileSync(paths.statusJsonPath, "utf-8"));
199
194
  const state = deserializeHudState(parsed);
200
195
  if (state) return renderPlain(state);
201
196
  } catch {
202
197
  }
198
+ try {
199
+ const line = readFileSync(paths.displayPath, "utf-8").trim();
200
+ if (line) return line;
201
+ } catch {
202
+ }
203
203
  try {
204
204
  const line = readFileSync(paths.legacyLinePath, "utf-8").trim();
205
205
  if (line) return line;
@@ -216,7 +216,7 @@ var init_statusline = __esm({
216
216
  DEFAULT_STATUSLINE = "OMP | hud: no active session";
217
217
  DEFAULT_TOKEN_BUDGET = 2e5;
218
218
  DEFAULT_PREMIUM_REQUESTS_TOTAL = 1500;
219
- if (process.argv[1] === fileURLToPath(import.meta.url)) {
219
+ if (process.argv[1] === fileURLToPath(import.meta.url) && (process.argv[1].endsWith("omp-statusline.mjs") || process.argv[1].endsWith("statusline.mts"))) {
220
220
  console.log(readStatusline());
221
221
  }
222
222
  }
@@ -250,7 +250,7 @@ function tick(paths = getStatuslinePaths()) {
250
250
  function runHudWatch() {
251
251
  const intervalMs = Math.max(
252
252
  500,
253
- parseInt(process.env["OMP_HUD_INTERVAL"] ?? "", 10) || DEFAULT_INTERVAL_MS
253
+ parseInt(process.env["OMP_HUD_POLL_MS"] ?? "", 10) || parseInt(process.env["OMP_HUD_INTERVAL"] ?? "", 10) || DEFAULT_INTERVAL_MS
254
254
  );
255
255
  const paths = getStatuslinePaths();
256
256
  process.stdout.write("\x1B[?25l");
@@ -278,11 +278,252 @@ var init_watch = __esm({
278
278
  "use strict";
279
279
  init_statusline();
280
280
  init_renderer();
281
- DEFAULT_INTERVAL_MS = 2e3;
281
+ DEFAULT_INTERVAL_MS = 1e3;
282
282
  STATE_PATH = join3(homedir3(), ".omp", "state", "session.json");
283
283
  }
284
284
  });
285
285
 
286
+ // src/cli/install.mts
287
+ var install_exports = {};
288
+ __export(install_exports, {
289
+ runInstall: () => runInstall
290
+ });
291
+ import { mkdir as mkdir2, readFile as readFile2, rename, writeFile as writeFile2 } from "fs/promises";
292
+ import { homedir as homedir4 } from "os";
293
+ import { dirname as dirname3, join as join4 } from "path";
294
+ import { fileURLToPath as fileURLToPath2 } from "url";
295
+ async function runInstall(settingsPath = join4(homedir4(), ".copilot", "settings.json")) {
296
+ const pkgRoot = join4(dirname3(fileURLToPath2(import.meta.url)), "..");
297
+ const statusLineCommand = join4(pkgRoot, "bin", "omp-statusline.sh");
298
+ const marketplacePath = pkgRoot;
299
+ let existing = {};
300
+ try {
301
+ const raw = await readFile2(settingsPath, "utf-8");
302
+ const parsed = JSON.parse(raw);
303
+ if (parsed !== null && typeof parsed === "object" && !Array.isArray(parsed)) {
304
+ existing = parsed;
305
+ }
306
+ } catch {
307
+ }
308
+ const existingPlugins = typeof existing.enabledPlugins === "object" && existing.enabledPlugins !== null && !Array.isArray(existing.enabledPlugins) ? existing.enabledPlugins : {};
309
+ const existingMarketplaces = typeof existing.extraKnownMarketplaces === "object" && existing.extraKnownMarketplaces !== null && !Array.isArray(existing.extraKnownMarketplaces) ? existing.extraKnownMarketplaces : {};
310
+ const merged = {
311
+ ...existing,
312
+ enabledPlugins: {
313
+ ...existingPlugins,
314
+ "oh-my-githubcopilot@oh-my-githubcopilot": true
315
+ },
316
+ experimental: true,
317
+ statusLine: { type: "command", command: statusLineCommand },
318
+ extraKnownMarketplaces: {
319
+ ...existingMarketplaces,
320
+ "oh-my-githubcopilot": {
321
+ source: { source: "directory", path: marketplacePath }
322
+ }
323
+ }
324
+ };
325
+ const tmp = `${settingsPath}.tmp`;
326
+ await mkdir2(dirname3(settingsPath), { recursive: true });
327
+ await writeFile2(tmp, JSON.stringify(merged, null, 2) + "\n", "utf-8");
328
+ await rename(tmp, settingsPath);
329
+ console.log(`omp install: wrote ${settingsPath}`);
330
+ console.log(` statusLine.command: ${statusLineCommand}`);
331
+ console.log(` marketplace path: ${marketplacePath}`);
332
+ console.log(` plugin: oh-my-githubcopilot@oh-my-githubcopilot`);
333
+ console.log(`
334
+ Restart Copilot CLI to activate OMP.`);
335
+ }
336
+ var init_install = __esm({
337
+ "src/cli/install.mts"() {
338
+ "use strict";
339
+ }
340
+ });
341
+
342
+ // src/cli/doctor.mts
343
+ var doctor_exports = {};
344
+ __export(doctor_exports, {
345
+ AGENT_MIGRATIONS: () => AGENT_MIGRATIONS,
346
+ runDoctor: () => runDoctor,
347
+ scanProjectForStaleAgents: () => scanProjectForStaleAgents,
348
+ scanTextForStaleAgents: () => scanTextForStaleAgents
349
+ });
350
+ import { existsSync, readFileSync as readFileSync3, readdirSync, statSync } from "fs";
351
+ import { join as join5, relative } from "path";
352
+ function scanTextForStaleAgents(text, file) {
353
+ const warnings = [];
354
+ const lines = text.split("\n");
355
+ for (let i = 0; i < lines.length; i++) {
356
+ const line = lines[i];
357
+ for (const match of line.matchAll(STALE_AGENT_PATTERN)) {
358
+ const staleId = match[1];
359
+ warnings.push({
360
+ file,
361
+ line: i + 1,
362
+ staleId: `@${staleId}`,
363
+ replacement: AGENT_MIGRATIONS[staleId],
364
+ text: line.trim()
365
+ });
366
+ }
367
+ }
368
+ return warnings;
369
+ }
370
+ function collectDirFiles(dir, depth) {
371
+ if (depth > MAX_SCAN_DEPTH) return [];
372
+ const files = [];
373
+ let entries;
374
+ try {
375
+ entries = readdirSync(dir);
376
+ } catch {
377
+ return [];
378
+ }
379
+ for (const entry of entries) {
380
+ const fullPath = join5(dir, entry);
381
+ try {
382
+ const stats = statSync(fullPath);
383
+ if (stats.isDirectory()) {
384
+ files.push(...collectDirFiles(fullPath, depth + 1));
385
+ } else if (SCANNABLE_EXTENSIONS.some((ext) => entry.endsWith(ext))) {
386
+ files.push(fullPath);
387
+ }
388
+ } catch {
389
+ }
390
+ }
391
+ return files;
392
+ }
393
+ function scanProjectForStaleAgents(cwd) {
394
+ const targets = [];
395
+ for (const file of SCAN_FILES) {
396
+ const fullPath = join5(cwd, file);
397
+ if (existsSync(fullPath)) targets.push(fullPath);
398
+ }
399
+ for (const dir of SCAN_DIRS) {
400
+ const fullPath = join5(cwd, dir);
401
+ if (existsSync(fullPath)) targets.push(...collectDirFiles(fullPath, 0));
402
+ }
403
+ const warnings = [];
404
+ for (const target of targets) {
405
+ try {
406
+ const text = readFileSync3(target, "utf-8");
407
+ warnings.push(...scanTextForStaleAgents(text, relative(cwd, target)));
408
+ } catch {
409
+ }
410
+ }
411
+ return warnings;
412
+ }
413
+ function runDoctor(cwd = process.cwd()) {
414
+ console.log("OMP Doctor \u2014 agent migration check (2.0)");
415
+ console.log("");
416
+ const warnings = scanProjectForStaleAgents(cwd);
417
+ if (warnings.length === 0) {
418
+ console.log("OK: no stale agent references found.");
419
+ return 0;
420
+ }
421
+ console.log(`WARN: found ${warnings.length} stale agent reference(s):`);
422
+ console.log("");
423
+ for (const warning of warnings) {
424
+ console.log(` ${warning.file}:${warning.line} \u2014 ${warning.staleId} \u2192 ${warning.replacement}`);
425
+ console.log(` ${warning.text}`);
426
+ }
427
+ console.log("");
428
+ console.log("Suggested replacements (OMP 2.0 agent parity):");
429
+ for (const [staleId, replacement] of Object.entries(AGENT_MIGRATIONS)) {
430
+ console.log(` @${staleId} \u2192 ${replacement}`);
431
+ }
432
+ return warnings.length;
433
+ }
434
+ var AGENT_MIGRATIONS, STALE_AGENT_PATTERN, SCAN_FILES, SCAN_DIRS, SCANNABLE_EXTENSIONS, MAX_SCAN_DEPTH;
435
+ var init_doctor = __esm({
436
+ "src/cli/doctor.mts"() {
437
+ "use strict";
438
+ AGENT_MIGRATIONS = {
439
+ explorer: "explore",
440
+ simplifier: "code-simplifier",
441
+ researcher: "document-specialist",
442
+ reviewer: "code-reviewer",
443
+ tester: "test-engineer",
444
+ orchestrator: "top-level orchestration role (no longer a delegatable agent)"
445
+ };
446
+ STALE_AGENT_PATTERN = /(?<![\w-])@(explorer|simplifier|researcher|reviewer|tester|orchestrator)(?![\w-])/g;
447
+ SCAN_FILES = [
448
+ ".github/copilot-instructions.md",
449
+ ".copilot/copilot-instructions.md",
450
+ "AGENTS.md"
451
+ ];
452
+ SCAN_DIRS = [".omg", ".omp"];
453
+ SCANNABLE_EXTENSIONS = [".md", ".json", ".yml", ".yaml", ".txt"];
454
+ MAX_SCAN_DEPTH = 3;
455
+ }
456
+ });
457
+
458
+ // src/hooks/runner.mts
459
+ var runner_exports = {};
460
+ __export(runner_exports, {
461
+ readStdin: () => readStdin,
462
+ runHookMain: () => runHookMain
463
+ });
464
+ import { appendFileSync, mkdirSync as mkdirSync2 } from "fs";
465
+ import { homedir as homedir5 } from "os";
466
+ import { join as join6 } from "path";
467
+ async function readStdin() {
468
+ const readStdinActual = async () => {
469
+ const chunks = [];
470
+ for await (const chunk of process.stdin) {
471
+ chunks.push(String(chunk));
472
+ }
473
+ return chunks.join("");
474
+ };
475
+ const stdinTimeout = new Promise(
476
+ (resolve) => setTimeout(
477
+ () => resolve(""),
478
+ parseInt(process.env.OMP_HOOK_STDIN_TIMEOUT_MS ?? "500") || 500
479
+ )
480
+ );
481
+ return Promise.race([readStdinActual(), stdinTimeout]);
482
+ }
483
+ function logHookFailure(hook, reason) {
484
+ try {
485
+ process.stderr.write(`[omp hook fail-open] ${hook}: ${reason}
486
+ `);
487
+ } catch {
488
+ }
489
+ try {
490
+ const logsDir = join6(homedir5(), ".omp", "logs");
491
+ mkdirSync2(logsDir, { recursive: true });
492
+ const record = JSON.stringify({ ts: (/* @__PURE__ */ new Date()).toISOString(), hook, reason });
493
+ appendFileSync(join6(logsDir, "hook-failures.jsonl"), record + "\n", "utf-8");
494
+ } catch {
495
+ }
496
+ }
497
+ async function runHookMain(processHook2, options = {}) {
498
+ let outputJson;
499
+ try {
500
+ const input = JSON.parse(await readStdin());
501
+ const serialized = JSON.stringify(processHook2(input));
502
+ if (typeof serialized !== "string") {
503
+ throw new Error("hook produced no serializable output");
504
+ }
505
+ outputJson = serialized;
506
+ } catch (err) {
507
+ const reason = err instanceof Error ? err.message : String(err);
508
+ logHookFailure(options.hookName ?? "unknown", reason);
509
+ const failOpen = {
510
+ ...options.failOpenDecision ? { decision: "allow" } : {},
511
+ status: "error",
512
+ latencyMs: 0,
513
+ mutations: [],
514
+ log: [`fail-open: ${reason}`]
515
+ };
516
+ outputJson = JSON.stringify(failOpen);
517
+ }
518
+ console.log(outputJson);
519
+ process.exitCode = 0;
520
+ }
521
+ var init_runner = __esm({
522
+ "src/hooks/runner.mts"() {
523
+ "use strict";
524
+ }
525
+ });
526
+
286
527
  // src/hooks/keyword-detector.mts
287
528
  var keyword_detector_exports = {};
288
529
  __export(keyword_detector_exports, {
@@ -374,17 +615,11 @@ function processHook(input) {
374
615
  };
375
616
  }
376
617
  }
377
- async function readStdin() {
378
- const chunks = [];
379
- for await (const chunk of process.stdin) {
380
- chunks.push(chunk);
381
- }
382
- return chunks.join("");
383
- }
384
618
  var KEYWORD_MAP, KEYWORD_ENTRIES, CANONICAL_COMMAND_MAP;
385
619
  var init_keyword_detector = __esm({
386
620
  async "src/hooks/keyword-detector.mts"() {
387
621
  "use strict";
622
+ init_runner();
388
623
  KEYWORD_MAP = {
389
624
  "autopilot:": "autopilot",
390
625
  "/autopilot": "autopilot",
@@ -485,7 +720,63 @@ var init_keyword_detector = __esm({
485
720
  "/omp:notifications": "notifications",
486
721
  "session:": "session",
487
722
  "/session": "session",
488
- "/omp:session": "session"
723
+ "/omp:session": "session",
724
+ "verify:": "verify",
725
+ "/verify": "verify",
726
+ "/omp:verify": "verify",
727
+ "cancel:": "cancel",
728
+ "/omp:cancel": "cancel",
729
+ "help:": "help",
730
+ "/omp:help": "help",
731
+ "code-review:": "code-review",
732
+ "/code-review": "code-review",
733
+ "/omp:code-review": "code-review",
734
+ "security-review:": "security-review",
735
+ "/security-review": "security-review",
736
+ "/omp:security-review": "security-review",
737
+ "ultraqa:": "ultraqa",
738
+ "/ultraqa": "ultraqa",
739
+ "/omp:ultraqa": "ultraqa",
740
+ "ultragoal:": "ultragoal",
741
+ "/ultragoal": "ultragoal",
742
+ "/omp:ultragoal": "ultragoal",
743
+ "deep-dive:": "deep-dive",
744
+ "/deep-dive": "deep-dive",
745
+ "/omp:deep-dive": "deep-dive",
746
+ "external-context:": "external-context",
747
+ "/external-context": "external-context",
748
+ "/omp:external-context": "external-context",
749
+ "deepsearch:": "deepsearch",
750
+ "/deepsearch": "deepsearch",
751
+ "/omp:deepsearch": "deepsearch",
752
+ "sciomc:": "sciomc",
753
+ "/sciomc": "sciomc",
754
+ "/omp:sciomc": "sciomc",
755
+ "remember:": "remember",
756
+ "/omp:remember": "remember",
757
+ "writer-memory:": "writer-memory",
758
+ "/writer-memory": "writer-memory",
759
+ "/omp:writer-memory": "writer-memory",
760
+ "deepinit:": "deepinit",
761
+ "/deepinit": "deepinit",
762
+ "/omp:deepinit": "deepinit",
763
+ "self-improve:": "self-improve",
764
+ "/self-improve": "self-improve",
765
+ "/omp:self-improve": "self-improve",
766
+ "visual-verdict:": "visual-verdict",
767
+ "/visual-verdict": "visual-verdict",
768
+ "/omp:visual-verdict": "visual-verdict",
769
+ "ccg:": "ccg",
770
+ "/ccg": "ccg",
771
+ "/omp:ccg": "ccg",
772
+ "build-fix:": "build-fix",
773
+ "/build-fix": "build-fix",
774
+ "/omp:build-fix": "build-fix",
775
+ "design:": "design",
776
+ "/omp:design": "design",
777
+ "web-clone:": "web-clone",
778
+ "/web-clone": "web-clone",
779
+ "/omp:web-clone": "web-clone"
489
780
  };
490
781
  KEYWORD_ENTRIES = Object.entries(KEYWORD_MAP).sort(([a], [b]) => b.length - a.length);
491
782
  CANONICAL_COMMAND_MAP = {
@@ -494,13 +785,350 @@ var init_keyword_detector = __esm({
494
785
  "mcp-setup": "/mcp"
495
786
  };
496
787
  if (process.argv[1]?.endsWith("keyword-detector.mjs") || process.argv[1]?.endsWith("keyword-detector.mts")) {
497
- const input = JSON.parse(await readStdin());
498
- const output = processHook(input);
499
- console.log(JSON.stringify(output));
788
+ await runHookMain(processHook, { failOpenDecision: true, hookName: "keyword-detector" });
500
789
  }
501
790
  }
502
791
  });
503
792
 
793
+ // src/extension/commands.mts
794
+ function buildActivationInstruction(skillId, args) {
795
+ const trimmed = args.trim();
796
+ return `Activate the OMP skill "${skillId}" with args: ${trimmed.length > 0 ? trimmed : "(none)"}`;
797
+ }
798
+ function buildCommands(registry) {
799
+ const commands = [];
800
+ for (const entry of registry) {
801
+ commands.push({
802
+ name: entry.id,
803
+ description: entry.description,
804
+ handler: (args) => buildActivationInstruction(entry.id, args)
805
+ });
806
+ for (const alias of entry.aliases ?? []) {
807
+ commands.push({
808
+ name: alias,
809
+ description: `Alias for /${entry.id} \u2014 ${entry.description}`,
810
+ handler: (args) => buildActivationInstruction(entry.id, args)
811
+ });
812
+ }
813
+ }
814
+ return commands;
815
+ }
816
+ var init_commands = __esm({
817
+ "src/extension/commands.mts"() {
818
+ "use strict";
819
+ }
820
+ });
821
+
822
+ // src/extension/registry.mts
823
+ var registry_exports = {};
824
+ __export(registry_exports, {
825
+ SKILL_REGISTRY: () => SKILL_REGISTRY,
826
+ getCommandDefinitions: () => getCommandDefinitions
827
+ });
828
+ function getCommandDefinitions() {
829
+ return buildCommands(SKILL_REGISTRY);
830
+ }
831
+ var SKILL_REGISTRY;
832
+ var init_registry = __esm({
833
+ "src/extension/registry.mts"() {
834
+ "use strict";
835
+ init_commands();
836
+ SKILL_REGISTRY = [
837
+ {
838
+ id: "autopilot",
839
+ description: "Autonomous end-to-end execution from idea to working code",
840
+ keywords: ["autopilot:"]
841
+ },
842
+ {
843
+ id: "ralph",
844
+ description: "Persistence loop with architect verification gate",
845
+ keywords: ["ralph:"]
846
+ },
847
+ {
848
+ id: "ultrawork",
849
+ description: "Parallel multi-agent high-throughput implementation",
850
+ aliases: ["ulw"],
851
+ keywords: ["ulw:", "ultrawork:"]
852
+ },
853
+ {
854
+ id: "team",
855
+ description: "Coordinated N-agent team with staged pipeline",
856
+ keywords: ["team:"]
857
+ },
858
+ {
859
+ id: "ecomode",
860
+ description: "Cost-optimized execution with low-cost model tier",
861
+ aliases: ["eco"],
862
+ keywords: ["eco:", "ecomode:"]
863
+ },
864
+ {
865
+ id: "swarm",
866
+ description: "Parallel agent swarm for independent subtasks",
867
+ keywords: ["swarm:"]
868
+ },
869
+ {
870
+ id: "pipeline",
871
+ description: "Sequential stage-based execution pipeline",
872
+ keywords: ["pipeline:"]
873
+ },
874
+ {
875
+ id: "deep-interview",
876
+ description: "Socratic deep requirements interview with ambiguity gating",
877
+ aliases: ["di"],
878
+ keywords: ["deep interview:"]
879
+ },
880
+ {
881
+ id: "omp-plan",
882
+ description: "Strategic planning with interview, direct, consensus, and review modes",
883
+ aliases: ["plan"],
884
+ keywords: ["plan:"]
885
+ },
886
+ {
887
+ id: "omp-setup",
888
+ description: "OMP onboarding and configuration wizard",
889
+ keywords: ["setup:"]
890
+ },
891
+ {
892
+ id: "hud",
893
+ description: "Display current HUD session state",
894
+ keywords: ["hud:"]
895
+ },
896
+ {
897
+ id: "wiki",
898
+ description: "Project wiki operations and management",
899
+ keywords: ["wiki:"]
900
+ },
901
+ {
902
+ id: "learner",
903
+ description: "Structured learning and knowledge sessions",
904
+ keywords: ["learner:"]
905
+ },
906
+ {
907
+ id: "note",
908
+ description: "Session notes and context management",
909
+ keywords: ["note:"]
910
+ },
911
+ {
912
+ id: "trace",
913
+ description: "Execution tracing and debugging",
914
+ keywords: ["trace:"]
915
+ },
916
+ {
917
+ id: "release",
918
+ description: "Guided release workflow and automation",
919
+ keywords: ["release:"]
920
+ },
921
+ {
922
+ id: "configure-notifications",
923
+ description: "Configure session notification settings",
924
+ keywords: ["configure-notifications:"]
925
+ },
926
+ {
927
+ id: "psm",
928
+ description: "Plugin State Manager operations",
929
+ keywords: ["psm:"]
930
+ },
931
+ {
932
+ id: "swe-bench",
933
+ description: "SWE-bench evaluation harness runner",
934
+ keywords: ["swe-bench:"]
935
+ },
936
+ {
937
+ id: "mcp-setup",
938
+ description: "MCP server configuration wizard",
939
+ keywords: ["mcp:", "mcp-setup:"]
940
+ },
941
+ {
942
+ id: "setup",
943
+ description: "OMP setup and onboarding wizard"
944
+ },
945
+ {
946
+ id: "graphify",
947
+ description: "Convert any input to a knowledge graph",
948
+ keywords: ["graphify:"]
949
+ },
950
+ {
951
+ id: "graphwiki",
952
+ description: "GraphWiki CLI operations: query, lint, build",
953
+ keywords: ["graphwiki:"]
954
+ },
955
+ {
956
+ id: "graph-provider",
957
+ description: "Manage and configure the active graph provider",
958
+ keywords: ["graph:"]
959
+ },
960
+ {
961
+ id: "spending",
962
+ description: "Track and reset premium request usage",
963
+ keywords: ["spending:"]
964
+ },
965
+ {
966
+ id: "ralplan",
967
+ description: "Consensus planning gate for vague ralph/autopilot/team requests"
968
+ },
969
+ {
970
+ id: "research",
971
+ description: "Research and investigation workflows (investigate, deep dive)",
972
+ keywords: ["autoresearch:"]
973
+ },
974
+ {
975
+ id: "omp-doctor",
976
+ description: "Diagnose and fix oh-my-githubcopilot installation issues"
977
+ },
978
+ {
979
+ id: "omp-reference",
980
+ description: "OMP agent catalog, tools, routing, commit protocol, and skills registry"
981
+ },
982
+ {
983
+ id: "ai-slop-cleaner",
984
+ description: "Clean AI-generated code slop with a regression-safe, deletion-first workflow",
985
+ keywords: ["deslop", "anti-slop"]
986
+ },
987
+ {
988
+ id: "tdd",
989
+ description: "Test-Driven Development with Red-Green-Refactor cycle",
990
+ keywords: ["tdd:"]
991
+ },
992
+ {
993
+ id: "improve-codebase-architecture",
994
+ description: "Deep exploration and architectural improvement via friction detection"
995
+ },
996
+ {
997
+ id: "skillify",
998
+ description: "Turn a repeatable session workflow into a reusable OMP skill draft"
999
+ },
1000
+ {
1001
+ id: "interview",
1002
+ description: "Socratic interview and ambiguity scoring",
1003
+ keywords: ["interview:"]
1004
+ },
1005
+ {
1006
+ id: "graph-context",
1007
+ description: "Load codebase context from the knowledge graph instead of raw files"
1008
+ },
1009
+ {
1010
+ id: "interactive-menu",
1011
+ description: "Numbered-choice selection pattern for OMP's conversational TUI"
1012
+ },
1013
+ {
1014
+ id: "notifications",
1015
+ description: "Send and manage runtime notifications (Telegram, Discord, Slack, Email)",
1016
+ keywords: ["notifications:"]
1017
+ },
1018
+ {
1019
+ id: "doctor",
1020
+ description: "Diagnose and fix common issues",
1021
+ keywords: ["doctor:"]
1022
+ },
1023
+ {
1024
+ id: "session",
1025
+ description: "Worktree and tmux session management",
1026
+ keywords: ["session:"]
1027
+ },
1028
+ {
1029
+ id: "verify",
1030
+ description: "Evidence-based completion check via verifier agent",
1031
+ keywords: ["verify:"]
1032
+ },
1033
+ {
1034
+ id: "cancel",
1035
+ description: "Ends active execution modes and clears .omp/state/",
1036
+ keywords: ["cancel:"]
1037
+ },
1038
+ {
1039
+ id: "help",
1040
+ description: "Command and skill discovery; prints the full skill catalog",
1041
+ keywords: ["help:"]
1042
+ },
1043
+ {
1044
+ id: "code-review",
1045
+ description: "Trigger the code-reviewer agent lane for structured code review",
1046
+ keywords: ["code-review:"]
1047
+ },
1048
+ {
1049
+ id: "security-review",
1050
+ description: "Trigger the security-reviewer agent lane for security analysis",
1051
+ keywords: ["security-review:"]
1052
+ },
1053
+ {
1054
+ id: "ultraqa",
1055
+ description: "QA cycle loop with qa-tester agent; runs until all checks pass",
1056
+ keywords: ["ultraqa:"]
1057
+ },
1058
+ {
1059
+ id: "ultragoal",
1060
+ description: "Durable goal ledger in .omp/ultragoal/ with fail-closed checkpoints",
1061
+ keywords: ["ultragoal:"]
1062
+ },
1063
+ {
1064
+ id: "deep-dive",
1065
+ description: "Trace\u2192deep-interview pipeline for deep investigation",
1066
+ keywords: ["deep-dive:"]
1067
+ },
1068
+ {
1069
+ id: "external-context",
1070
+ description: "Load external docs/URLs into session context",
1071
+ keywords: ["external-context:"]
1072
+ },
1073
+ {
1074
+ id: "deepsearch",
1075
+ description: "Multi-source deep search across codebase and web",
1076
+ keywords: ["deepsearch:"]
1077
+ },
1078
+ {
1079
+ id: "sciomc",
1080
+ description: "Scientific/analytical reasoning workflow \u2014 hypothesis\u2192experiment\u2192conclusion",
1081
+ keywords: ["sciomc:"]
1082
+ },
1083
+ {
1084
+ id: "remember",
1085
+ description: "Persist key facts/decisions to .omp/memory/",
1086
+ keywords: ["remember:"]
1087
+ },
1088
+ {
1089
+ id: "writer-memory",
1090
+ description: "Writing style memory \u2014 stores voice/tone preferences",
1091
+ keywords: ["writer-memory:"]
1092
+ },
1093
+ {
1094
+ id: "deepinit",
1095
+ description: "Deep project initialization \u2014 full codebase onboarding",
1096
+ keywords: ["deepinit:"]
1097
+ },
1098
+ {
1099
+ id: "self-improve",
1100
+ description: "OMP self-improvement \u2014 analyse own skills/agents and propose improvements",
1101
+ keywords: ["self-improve:"]
1102
+ },
1103
+ {
1104
+ id: "visual-verdict",
1105
+ description: "Visual diff/screenshot comparison verdict",
1106
+ keywords: ["visual-verdict:"]
1107
+ },
1108
+ {
1109
+ id: "ccg",
1110
+ description: "Concurrent code generation via multi-model picker",
1111
+ keywords: ["ccg:"]
1112
+ },
1113
+ {
1114
+ id: "build-fix",
1115
+ description: "Diagnose and fix build/CI failures automatically",
1116
+ keywords: ["build-fix:"]
1117
+ },
1118
+ {
1119
+ id: "design",
1120
+ description: "UI/UX design and frontend component generation",
1121
+ keywords: ["design:"]
1122
+ },
1123
+ {
1124
+ id: "web-clone",
1125
+ description: "Clone and adapt a web page/design to the codebase",
1126
+ keywords: ["web-clone:"]
1127
+ }
1128
+ ];
1129
+ }
1130
+ });
1131
+
504
1132
  // src/index.mts
505
1133
  import { parseArgs } from "util";
506
1134
  import { createRequire } from "module";
@@ -698,6 +1326,77 @@ async function main() {
698
1326
  case "hook":
699
1327
  await runHook(positionals.slice(1));
700
1328
  break;
1329
+ case "install": {
1330
+ const { runInstall: runInstall2 } = await Promise.resolve().then(() => (init_install(), install_exports));
1331
+ await runInstall2();
1332
+ break;
1333
+ }
1334
+ case "doctor": {
1335
+ const { runDoctor: runDoctor2 } = await Promise.resolve().then(() => (init_doctor(), doctor_exports));
1336
+ const warnings = runDoctor2(process.cwd());
1337
+ process.exitCode = warnings > 0 ? 1 : 0;
1338
+ break;
1339
+ }
1340
+ case "verify":
1341
+ console.log("OMP verify: use /verify or /oh-my-githubcopilot:verify in GitHub Copilot CLI to trigger @verifier evidence-based completion check.");
1342
+ break;
1343
+ case "cancel":
1344
+ await runCancel();
1345
+ break;
1346
+ case "help":
1347
+ await runHelp();
1348
+ break;
1349
+ case "code-review":
1350
+ console.log("OMP code-review: use /code-review or /oh-my-githubcopilot:code-review in GitHub Copilot CLI to trigger @code-reviewer agent.");
1351
+ break;
1352
+ case "security-review":
1353
+ console.log("OMP security-review: use /security-review or /oh-my-githubcopilot:security-review in GitHub Copilot CLI to trigger @security-reviewer agent.");
1354
+ break;
1355
+ case "ultraqa":
1356
+ console.log("OMP ultraqa: use /ultraqa or /oh-my-githubcopilot:ultraqa in GitHub Copilot CLI to start a QA cycle with @qa-tester agent.");
1357
+ break;
1358
+ case "ultragoal":
1359
+ await runUltragoal(positionals.slice(1));
1360
+ break;
1361
+ case "deep-dive":
1362
+ console.log("OMP deep-dive: use /deep-dive or /oh-my-githubcopilot:deep-dive in GitHub Copilot CLI to run the trace\u2192deep-interview investigation pipeline.");
1363
+ break;
1364
+ case "external-context":
1365
+ await runExternalContext(positionals.slice(1));
1366
+ break;
1367
+ case "deepsearch":
1368
+ console.log("OMP deepsearch: use /deepsearch or /oh-my-githubcopilot:deepsearch in GitHub Copilot CLI to run multi-source deep search.");
1369
+ break;
1370
+ case "sciomc":
1371
+ console.log("OMP sciomc: use /sciomc or /oh-my-githubcopilot:sciomc in GitHub Copilot CLI to run the scientific hypothesis\u2192experiment\u2192conclusion reasoning workflow.");
1372
+ break;
1373
+ case "remember":
1374
+ await runRemember(positionals.slice(1));
1375
+ break;
1376
+ case "writer-memory":
1377
+ await runWriterMemory(positionals.slice(1));
1378
+ break;
1379
+ case "deepinit":
1380
+ console.log("OMP deepinit: use /deepinit or /oh-my-githubcopilot:deepinit in GitHub Copilot CLI to run deep project initialization.");
1381
+ break;
1382
+ case "self-improve":
1383
+ console.log("OMP self-improve: use /self-improve in Copilot CLI to analyse OMP skills/agents and propose improvements.");
1384
+ break;
1385
+ case "visual-verdict":
1386
+ console.log("OMP visual-verdict: use /visual-verdict in Copilot CLI to compare visual diffs or screenshots.");
1387
+ break;
1388
+ case "ccg":
1389
+ console.log("OMP ccg: use /ccg in Copilot CLI to run concurrent code generation via multi-model picker.");
1390
+ break;
1391
+ case "build-fix":
1392
+ console.log("OMP build-fix: use /build-fix in Copilot CLI to diagnose and fix build/CI failures automatically.");
1393
+ break;
1394
+ case "design":
1395
+ console.log("OMP design: use /omp:design in Copilot CLI to generate UI/UX designs and frontend components.");
1396
+ break;
1397
+ case "web-clone":
1398
+ console.log("OMP web-clone: use /web-clone in Copilot CLI to clone and adapt a web page/design to your codebase.");
1399
+ break;
701
1400
  default:
702
1401
  console.error(`Unknown subcommand: ${resolvedSubcommand}`);
703
1402
  printUsage(true);
@@ -706,15 +1405,15 @@ async function main() {
706
1405
  }
707
1406
  function printUsage(stderr = false) {
708
1407
  const output = stderr ? console.error : console.log;
709
- output("Usage: omp [hud|version|psm|bench|hook] [--watch]");
1408
+ output("Usage: omp [hud|install|doctor|version|psm|bench|hook|verify|cancel|help|code-review|security-review|ultraqa|ultragoal|deep-dive|external-context|deepsearch|sciomc|remember|writer-memory|deepinit|self-improve|visual-verdict|ccg|build-fix|design|web-clone] [--watch]");
710
1409
  }
711
1410
  async function printHud() {
712
1411
  try {
713
- const { readFileSync: readFileSync3 } = await import("fs");
714
- const { join: join4 } = await import("path");
715
- const { homedir: homedir4 } = await import("os");
716
- const hudPath = join4(homedir4(), ".omp", "hud.line");
717
- const line = readFileSync3(hudPath, "utf-8").trim();
1412
+ const { readFileSync: readFileSync4 } = await import("fs");
1413
+ const { join: join7 } = await import("path");
1414
+ const { homedir: homedir6 } = await import("os");
1415
+ const hudPath = join7(homedir6(), ".omp", "hud.line");
1416
+ const line = readFileSync4(hudPath, "utf-8").trim();
718
1417
  console.log(line);
719
1418
  } catch {
720
1419
  console.log(`OMP v${PKG_VERSION} | hud: no active session`);
@@ -734,22 +1433,166 @@ async function runHook(args) {
734
1433
  process.exit(1);
735
1434
  }
736
1435
  const { processHook: processHook2 } = await init_keyword_detector().then(() => keyword_detector_exports);
737
- const inputText = await readStdin2();
738
- const input = JSON.parse(inputText || "{}");
739
- const output = processHook2(input);
740
- console.log(JSON.stringify(output));
741
- }
742
- async function readStdin2() {
743
- const chunks = [];
744
- for await (const chunk of process.stdin) {
745
- chunks.push(String(chunk));
746
- }
747
- return chunks.join("");
1436
+ const { runHookMain: runHookMain2 } = await Promise.resolve().then(() => (init_runner(), runner_exports));
1437
+ await runHookMain2(processHook2, { failOpenDecision: true, hookName: "keyword-detector" });
748
1438
  }
749
1439
  async function runBench(_args) {
750
1440
  console.log("SWE-bench requires Node.js subprocess with Python evaluation harness.");
751
1441
  console.log("Usage: /omp:swe-bench --suite lite --compare baseline");
752
1442
  }
1443
+ async function runCancel() {
1444
+ try {
1445
+ const { rmSync, existsSync: existsSync2 } = await import("fs");
1446
+ const { join: join7 } = await import("path");
1447
+ const statePath = join7(process.cwd(), ".omp", "state");
1448
+ if (existsSync2(statePath)) {
1449
+ rmSync(statePath, { recursive: true, force: true });
1450
+ console.log("OMP: active session cancelled. .omp/state/ cleared.");
1451
+ } else {
1452
+ console.log("OMP: no active session state found. Nothing to cancel.");
1453
+ }
1454
+ } catch (err) {
1455
+ console.error("OMP cancel failed:", err);
1456
+ process.exitCode = 1;
1457
+ }
1458
+ }
1459
+ async function runHelp() {
1460
+ try {
1461
+ const { SKILL_REGISTRY: SKILL_REGISTRY2 } = await Promise.resolve().then(() => (init_registry(), registry_exports));
1462
+ console.log("OMP Skills Catalog\n");
1463
+ console.log(" ID Description");
1464
+ console.log(" " + "-".repeat(70));
1465
+ for (const skill of SKILL_REGISTRY2) {
1466
+ const id = skill.id.padEnd(30);
1467
+ console.log(` ${id} ${skill.description}`);
1468
+ }
1469
+ console.log(`
1470
+ Total: ${SKILL_REGISTRY2.length} skills`);
1471
+ console.log("\nUsage: /omp:<skill-id> [args]");
1472
+ } catch (err) {
1473
+ console.error("OMP help failed:", err);
1474
+ process.exitCode = 1;
1475
+ }
1476
+ }
1477
+ async function runUltragoal(args) {
1478
+ try {
1479
+ const { mkdirSync: mkdirSync3, readFileSync: readFileSync4, writeFileSync: writeFileSync2, existsSync: existsSync2 } = await import("fs");
1480
+ const { join: join7 } = await import("path");
1481
+ const goalDir = join7(process.cwd(), ".omp", "ultragoal");
1482
+ const goalsPath = join7(goalDir, "goals.json");
1483
+ mkdirSync3(goalDir, { recursive: true });
1484
+ let goals = [];
1485
+ if (existsSync2(goalsPath)) {
1486
+ const parsed = JSON.parse(readFileSync4(goalsPath, "utf-8"));
1487
+ if (Array.isArray(parsed)) {
1488
+ goals = parsed;
1489
+ } else {
1490
+ console.error("OMP UltraGoal: goals.json is corrupted (not an array). Resetting to empty.");
1491
+ goals = [];
1492
+ }
1493
+ }
1494
+ if (args.length > 0) {
1495
+ const nextId = goals.length === 0 ? 1 : Math.max(...goals.map((g) => g.id)) + 1;
1496
+ const newGoal = { id: nextId, goal: args.join(" "), status: "active", createdAt: (/* @__PURE__ */ new Date()).toISOString() };
1497
+ goals.push(newGoal);
1498
+ const tmpPath = goalsPath + ".tmp";
1499
+ writeFileSync2(tmpPath, JSON.stringify(goals, null, 2));
1500
+ const { renameSync: renameSync2 } = await import("fs");
1501
+ renameSync2(tmpPath, goalsPath);
1502
+ console.log(`OMP UltraGoal: added goal #${newGoal.id}: "${newGoal.goal}"`);
1503
+ } else {
1504
+ if (goals.length === 0) {
1505
+ console.log("OMP UltraGoal: no goals set. Use: omp ultragoal <goal description>");
1506
+ } else {
1507
+ console.log("OMP UltraGoal \u2014 Current Goals:\n");
1508
+ for (const g of goals) {
1509
+ console.log(` #${g.id} [${g.status}] ${g.goal}`);
1510
+ }
1511
+ }
1512
+ }
1513
+ } catch (err) {
1514
+ console.error("OMP ultragoal failed:", err);
1515
+ process.exitCode = 1;
1516
+ }
1517
+ }
1518
+ async function runExternalContext(args) {
1519
+ if (args.length === 0) {
1520
+ console.log("OMP external-context: use /external-context <url-or-path> or /oh-my-githubcopilot:external-context in GitHub Copilot CLI to load external docs into session context.");
1521
+ return;
1522
+ }
1523
+ const target = args.join(" ");
1524
+ console.log(`External context loaded: ${target}. Use /external-context ${target} in Copilot CLI to load into session.`);
1525
+ }
1526
+ async function runRemember(args) {
1527
+ try {
1528
+ const { mkdirSync: mkdirSync3, readdirSync: readdirSync2, writeFileSync: writeFileSync2, existsSync: existsSync2 } = await import("fs");
1529
+ const { join: join7 } = await import("path");
1530
+ const memoryDir = join7(process.cwd(), ".omp", "memory");
1531
+ mkdirSync3(memoryDir, { recursive: true });
1532
+ if (args.length === 0) {
1533
+ if (!existsSync2(memoryDir)) {
1534
+ console.log("OMP Remember: no memories found. Use: omp remember <text>");
1535
+ return;
1536
+ }
1537
+ const files = readdirSync2(memoryDir).filter((f) => f.endsWith(".md")).sort();
1538
+ if (files.length === 0) {
1539
+ console.log("OMP Remember: no memories found. Use: omp remember <text>");
1540
+ } else {
1541
+ console.log("OMP Remember \u2014 Stored Memories:\n");
1542
+ for (const file of files) {
1543
+ console.log(` ${file}`);
1544
+ }
1545
+ console.log(`
1546
+ Total: ${files.length} memor${files.length === 1 ? "y" : "ies"}`);
1547
+ }
1548
+ return;
1549
+ }
1550
+ const text = args.join(" ");
1551
+ const timestamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
1552
+ const fileName = `${timestamp}.md`;
1553
+ const filePath = join7(memoryDir, fileName);
1554
+ const tmpPath = filePath + ".tmp";
1555
+ const content = `# Memory: ${(/* @__PURE__ */ new Date()).toISOString()}
1556
+
1557
+ ${text}
1558
+ `;
1559
+ writeFileSync2(tmpPath, content, "utf-8");
1560
+ const { renameSync: renameSync2 } = await import("fs");
1561
+ renameSync2(tmpPath, filePath);
1562
+ console.log(`OMP Remember: saved memory to .omp/memory/${fileName}`);
1563
+ } catch (err) {
1564
+ console.error("OMP remember failed:", err);
1565
+ process.exitCode = 1;
1566
+ }
1567
+ }
1568
+ async function runWriterMemory(args) {
1569
+ try {
1570
+ const { mkdirSync: mkdirSync3, readFileSync: readFileSync4, appendFileSync: appendFileSync2, existsSync: existsSync2 } = await import("fs");
1571
+ const { join: join7, dirname: dirname4 } = await import("path");
1572
+ const filePath = join7(process.cwd(), ".omp", "writer-memory.md");
1573
+ mkdirSync3(dirname4(filePath), { recursive: true });
1574
+ if (args.length === 0) {
1575
+ if (!existsSync2(filePath)) {
1576
+ console.log("OMP Writer Memory: no style notes found. Use: omp writer-memory <style-note>");
1577
+ return;
1578
+ }
1579
+ const content = readFileSync4(filePath, "utf-8");
1580
+ console.log(content);
1581
+ return;
1582
+ }
1583
+ const note = args.join(" ");
1584
+ const entry = `
1585
+ ## ${(/* @__PURE__ */ new Date()).toISOString()}
1586
+
1587
+ ${note}
1588
+ `;
1589
+ appendFileSync2(filePath, entry, "utf-8");
1590
+ console.log(`OMP Writer Memory: appended style note to .omp/writer-memory.md`);
1591
+ } catch (err) {
1592
+ console.error("OMP writer-memory failed:", err);
1593
+ process.exitCode = 1;
1594
+ }
1595
+ }
753
1596
  main().catch((err) => {
754
1597
  console.error(err);
755
1598
  process.exit(1);