@damian87/omp 0.8.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/.github/skills/create-skill/SKILL.md +3 -3
  2. package/.github/skills/daily-log/SKILL.md +1 -1
  3. package/.github/skills/jira-ticket/SKILL.md +6 -3
  4. package/.github/skills/omp-autopilot/SKILL.md +1 -1
  5. package/.github/skills/ralph/SKILL.md +6 -4
  6. package/.github/skills/research-codebase/SKILL.md +6 -6
  7. package/.github/skills/research-codebase/reference/agent-prompts.md +8 -8
  8. package/.github/skills/slack/SKILL.md +83 -0
  9. package/.github/skills/team/SKILL.md +5 -3
  10. package/.github/skills/team/scripts/team-launch.sh +11 -5
  11. package/.github/skills/ultraqa/SKILL.md +5 -2
  12. package/.github/skills/ultrawork/SKILL.md +5 -5
  13. package/.github/skills/weighted-consensus/SKILL.md +4 -3
  14. package/README.md +36 -38
  15. package/catalog/capabilities.json +46 -0
  16. package/catalog/skills-general.json +26 -0
  17. package/dist/src/cli.js +58 -5
  18. package/dist/src/cli.js.map +1 -1
  19. package/dist/src/comms/index.d.ts +13 -6
  20. package/dist/src/comms/index.js +65 -10
  21. package/dist/src/comms/index.js.map +1 -1
  22. package/dist/src/copilot/doctor.js +40 -5
  23. package/dist/src/copilot/doctor.js.map +1 -1
  24. package/dist/src/copilot/env-passthrough.d.ts +16 -0
  25. package/dist/src/copilot/env-passthrough.js +28 -0
  26. package/dist/src/copilot/env-passthrough.js.map +1 -0
  27. package/dist/src/copilot/launch.js +9 -1
  28. package/dist/src/copilot/launch.js.map +1 -1
  29. package/dist/src/copilot/trust.d.ts +22 -0
  30. package/dist/src/copilot/trust.js +62 -0
  31. package/dist/src/copilot/trust.js.map +1 -0
  32. package/dist/src/copilot/version.js +10 -0
  33. package/dist/src/copilot/version.js.map +1 -1
  34. package/dist/src/env/init.d.ts +6 -0
  35. package/dist/src/env/init.js +18 -0
  36. package/dist/src/env/init.js.map +1 -1
  37. package/dist/src/gateway/notify.d.ts +35 -0
  38. package/dist/src/gateway/notify.js +261 -0
  39. package/dist/src/gateway/notify.js.map +1 -0
  40. package/dist/src/gateway/target-parser.d.ts +76 -0
  41. package/dist/src/gateway/target-parser.js +105 -0
  42. package/dist/src/gateway/target-parser.js.map +1 -0
  43. package/dist/src/instructions-memory.js +6 -5
  44. package/dist/src/instructions-memory.js.map +1 -1
  45. package/dist/src/schedule/commands.js +1 -0
  46. package/dist/src/schedule/commands.js.map +1 -1
  47. package/dist/src/schedule/runner.d.ts +9 -0
  48. package/dist/src/schedule/runner.js +31 -1
  49. package/dist/src/schedule/runner.js.map +1 -1
  50. package/dist/src/schedule/types.d.ts +9 -0
  51. package/dist/src/team/tmux.d.ts +1 -1
  52. package/dist/src/team/tmux.js +41 -10
  53. package/dist/src/team/tmux.js.map +1 -1
  54. package/docs/plans/copilot-native-hooks.md +119 -0
  55. package/docs/plans/verification-plan.md +104 -0
  56. package/docs/slack-setup.md +33 -0
  57. package/hooks/hooks.json +52 -72
  58. package/package.json +11 -3
  59. package/plugin.json +12 -4
  60. package/scripts/agent-stop.mjs +87 -0
  61. package/scripts/error.mjs +1 -1
  62. package/scripts/lib/hook-output.mjs +32 -3
  63. package/scripts/lib/loop-driver.mjs +44 -0
  64. package/scripts/lib/version-check.mjs +3 -0
  65. package/scripts/post-tool-use.mjs +1 -1
  66. package/scripts/pre-tool-use.mjs +1 -1
  67. package/scripts/prompt-submit.mjs +4 -6
  68. package/scripts/session-end.mjs +1 -1
  69. package/scripts/session-start.mjs +5 -9
  70. package/dist/src/mcp/server.d.ts +0 -10
  71. package/dist/src/mcp/server.js +0 -44
  72. package/dist/src/mcp/server.js.map +0 -1
  73. package/dist/src/mcp/tools/daily-log.d.ts +0 -2
  74. package/dist/src/mcp/tools/daily-log.js +0 -148
  75. package/dist/src/mcp/tools/daily-log.js.map +0 -1
  76. package/dist/src/mcp/tools/index.d.ts +0 -9
  77. package/dist/src/mcp/tools/index.js +0 -15
  78. package/dist/src/mcp/tools/index.js.map +0 -1
  79. package/dist/src/mcp/tools/notepad.d.ts +0 -2
  80. package/dist/src/mcp/tools/notepad.js +0 -135
  81. package/dist/src/mcp/tools/notepad.js.map +0 -1
  82. package/dist/src/mcp/tools/project-memory.d.ts +0 -2
  83. package/dist/src/mcp/tools/project-memory.js +0 -91
  84. package/dist/src/mcp/tools/project-memory.js.map +0 -1
  85. package/dist/src/mcp/tools/shared-memory.d.ts +0 -2
  86. package/dist/src/mcp/tools/shared-memory.js +0 -148
  87. package/dist/src/mcp/tools/shared-memory.js.map +0 -1
  88. package/dist/src/mcp/tools/state.d.ts +0 -2
  89. package/dist/src/mcp/tools/state.js +0 -107
  90. package/dist/src/mcp/tools/state.js.map +0 -1
  91. package/dist/src/mcp/tools/trace.d.ts +0 -10
  92. package/dist/src/mcp/tools/trace.js +0 -102
  93. package/dist/src/mcp/tools/trace.js.map +0 -1
  94. package/dist/src/mcp/types.d.ts +0 -29
  95. package/dist/src/mcp/types.js +0 -7
  96. package/dist/src/mcp/types.js.map +0 -1
  97. package/dist/test/catalog.test.d.ts +0 -1
  98. package/dist/test/catalog.test.js +0 -21
  99. package/dist/test/catalog.test.js.map +0 -1
  100. package/dist/test/jira.test.d.ts +0 -1
  101. package/dist/test/jira.test.js +0 -26
  102. package/dist/test/jira.test.js.map +0 -1
  103. package/dist/test/lint.test.d.ts +0 -1
  104. package/dist/test/lint.test.js +0 -9
  105. package/dist/test/lint.test.js.map +0 -1
  106. package/dist/test/sync.test.d.ts +0 -1
  107. package/dist/test/sync.test.js +0 -15
  108. package/dist/test/sync.test.js.map +0 -1
@@ -0,0 +1,87 @@
1
+ #!/usr/bin/env node
2
+ // Copilot CLI `agentStop` hook: drives the omp persistence loops (ralph /
3
+ // ultrawork / ultraqa). When a loop is active and not yet complete, returns
4
+ // {decision:"block", reason:"<next-turn prompt>"} so Copilot takes another turn;
5
+ // otherwise {decision:"allow"}. Fail-OPEN (never traps the user in a loop).
6
+ import { existsSync, readFileSync, writeFileSync, statSync, openSync, readSync, closeSync } from "node:fs";
7
+ import { join, resolve } from "node:path";
8
+ import { readStdin } from "./lib/stdin.mjs";
9
+ import { hookCwd, printStopDecision, appendHookLog } from "./lib/hook-output.mjs";
10
+ import { decideLoop, LOOP_MODES } from "./lib/loop-driver.mjs";
11
+
12
+ const HOOK_NAME = "agentStop";
13
+ const TRANSCRIPT_TAIL_BYTES = 64 * 1024;
14
+
15
+ // Match the omp CLI's modeStatePath (src/mode-state/paths.ts): literal resolved
16
+ // cwd, NOT ompRoot — so the hook reads/writes the exact files `omp ralph start`
17
+ // wrote, even when invoked from a subdirectory.
18
+ function stateFile(root, mode) {
19
+ return join(root, ".omp", "state", `${mode}.json`);
20
+ }
21
+
22
+ function readState(root, mode) {
23
+ const p = stateFile(root, mode);
24
+ if (!existsSync(p)) return undefined;
25
+ try {
26
+ return JSON.parse(readFileSync(p, "utf8"));
27
+ } catch {
28
+ return undefined;
29
+ }
30
+ }
31
+
32
+ // Read only the tail of the transcript — it can be large, and a completion
33
+ // sentinel from this turn lives at the end.
34
+ function readTranscriptTail(path) {
35
+ if (!path || !existsSync(path)) return "";
36
+ try {
37
+ const size = statSync(path).size;
38
+ const start = Math.max(0, size - TRANSCRIPT_TAIL_BYTES);
39
+ const len = size - start;
40
+ const fd = openSync(path, "r");
41
+ try {
42
+ const buf = Buffer.alloc(len);
43
+ readSync(fd, buf, 0, len, start);
44
+ return buf.toString("utf8");
45
+ } finally {
46
+ closeSync(fd);
47
+ }
48
+ } catch {
49
+ return "";
50
+ }
51
+ }
52
+
53
+ (async () => {
54
+ try {
55
+ const raw = await readStdin();
56
+ const data = raw ? JSON.parse(raw) : {};
57
+ const directory = hookCwd(data);
58
+ const root = resolve(directory);
59
+
60
+ const states = {};
61
+ for (const m of LOOP_MODES) states[m.key] = readState(root, m.key);
62
+
63
+ const transcript = readTranscriptTail(data.transcriptPath ?? data.transcript_path);
64
+ const result = decideLoop(states, transcript);
65
+
66
+ // Persist counter increment (block) or clear the loop (allow on complete/cap).
67
+ if (result.patch) {
68
+ const s = states[result.patch.mode];
69
+ if (s) {
70
+ s[result.patch.counter] = result.patch.value;
71
+ try { writeFileSync(stateFile(root, result.patch.mode), JSON.stringify(s, null, 2)); } catch { /* best effort */ }
72
+ }
73
+ } else if (result.clear) {
74
+ const s = states[result.clear];
75
+ if (s) {
76
+ s.active = false;
77
+ try { writeFileSync(stateFile(root, result.clear), JSON.stringify(s, null, 2)); } catch { /* best effort */ }
78
+ }
79
+ }
80
+
81
+ appendHookLog(directory, HOOK_NAME, { decision: result.decision, reason: result.reason });
82
+ printStopDecision(result.decision, result.decision === "block" ? result.reason : "");
83
+ } catch (err) {
84
+ console.error(`[hook ${HOOK_NAME}] failed: ${err?.message ?? err}`);
85
+ printStopDecision("allow"); // fail-open: never trap the loop on an error
86
+ }
87
+ })();
package/scripts/error.mjs CHANGED
@@ -10,7 +10,7 @@ const HOOK_NAME = "Error";
10
10
  const raw = await readStdin();
11
11
  const data = raw ? JSON.parse(raw) : {};
12
12
  const sessionId = data.sessionId ?? data.session_id ?? "unknown";
13
- const directory = data.directory ?? process.cwd();
13
+ const directory = data.cwd ?? data.directory ?? process.cwd();
14
14
  const toolName = data.toolName ?? data.tool_name ?? "unknown";
15
15
  const errorMessage = data.error?.message ?? data.message ?? "unknown";
16
16
  const logFile = join(directory, ".omp", "state", "hooks.log");
@@ -2,13 +2,42 @@ import { appendFileSync, mkdirSync } from "node:fs";
2
2
  import { dirname, join } from "node:path";
3
3
  import { ompRoot } from "./omp-root.mjs";
4
4
 
5
+ // Hook scripts run under BOTH GitHub Copilot CLI (camelCase events, top-level
6
+ // `additionalContext` / `{decision,reason}` / `{permissionDecision}`) and Claude
7
+ // Code (`{continue, hookSpecificOutput}` / `{decision, reason}`). We dual-emit:
8
+ // every output object carries both vocabularies, and each host ignores the keys
9
+ // it does not recognize. See docs/plans/copilot-native-hooks.md.
10
+
11
+ /** Project directory from hook input — Copilot sends `cwd`, Claude sends `directory`. */
12
+ export function hookCwd(data) {
13
+ return data?.cwd ?? data?.directory ?? process.cwd();
14
+ }
15
+
16
+ /** sessionStart / postToolUse style: inject `additionalContext` (or a plain continue). */
5
17
  export function printContinue(hookEventName, additionalContext = "") {
6
- const output = additionalContext
7
- ? { continue: true, hookSpecificOutput: { hookEventName, additionalContext } }
8
- : { continue: true };
18
+ const output = { continue: true };
19
+ if (additionalContext) {
20
+ output.additionalContext = additionalContext; // Copilot CLI
21
+ output.hookSpecificOutput = { hookEventName, additionalContext }; // Claude Code
22
+ }
9
23
  console.log(JSON.stringify(output));
10
24
  }
11
25
 
26
+ /** agentStop (Copilot) / Stop (Claude): both honor {decision, reason}. */
27
+ export function printStopDecision(decision, reason = "") {
28
+ const out = { decision }; // "block" forces another turn; "allow" lets it stop
29
+ if (reason) out.reason = reason; // serves as the next-turn prompt when blocked
30
+ console.log(JSON.stringify(out));
31
+ }
32
+
33
+ /** preToolUse (Copilot): allow | deny | ask, with optional reason / modified args. */
34
+ export function printPermission(permissionDecision, reason = "", modifiedArgs) {
35
+ const out = { permissionDecision };
36
+ if (reason) out.permissionDecisionReason = reason;
37
+ if (modifiedArgs) out.modifiedArgs = modifiedArgs;
38
+ console.log(JSON.stringify(out));
39
+ }
40
+
12
41
  export function printBlock(reason) {
13
42
  console.log(JSON.stringify({ continue: false, reason }));
14
43
  }
@@ -0,0 +1,44 @@
1
+ // Pure decision logic for the agentStop loop driver. Given the current loop-mode
2
+ // states and the session transcript text, decide whether Copilot should stop
3
+ // (`allow`) or take another turn (`block` + a next-turn `reason`). Kept side-effect
4
+ // free so it is unit-testable; file I/O lives in scripts/agent-stop.mjs.
5
+
6
+ // Priority order: a single-owner ralph loop wins over a QA cycle over a batch.
7
+ export const LOOP_MODES = [
8
+ { key: "ralph", sentinel: "RALPH_COMPLETE", counter: "iteration", max: "maxIterations", defMax: 10 },
9
+ { key: "ultraqa", sentinel: "ULTRAQA_COMPLETE", counter: "cycleCount", max: "maxCycles", defMax: 5 },
10
+ { key: "ultrawork", sentinel: "ULTRAWORK_COMPLETE", counter: "iteration", max: "maxIterations", defMax: 20 },
11
+ ];
12
+
13
+ /**
14
+ * @param {Record<string, any>} states e.g. { ralph: {active, iteration, maxIterations}, ... }
15
+ * @param {string} transcriptText recent transcript text to scan for a completion sentinel
16
+ * @returns {{decision:"allow"|"block", reason?:string, clear?:string, patch?:{mode:string,counter:string,value:number}}}
17
+ */
18
+ export function decideLoop(states = {}, transcriptText = "") {
19
+ for (const m of LOOP_MODES) {
20
+ const s = states[m.key];
21
+ if (!s || !s.active) continue;
22
+
23
+ // The model signals completion by emitting the sentinel token — let it stop.
24
+ if (transcriptText.includes(m.sentinel)) {
25
+ return { decision: "allow", clear: m.key, reason: `${m.key} complete (sentinel seen)` };
26
+ }
27
+
28
+ const cur = Number(s[m.counter] ?? 0);
29
+ const max = Number(s[m.max] ?? m.defMax);
30
+ // Safety cap: never loop past the configured maximum, even without a sentinel.
31
+ if (cur + 1 >= max) {
32
+ return { decision: "allow", clear: m.key, reason: `${m.key} reached max (${max})` };
33
+ }
34
+
35
+ const next = cur + 1;
36
+ const reason =
37
+ `[${m.key.toUpperCase()} ITERATION ${next}/${max}] Not finished. Continue the task. ` +
38
+ `When ALL acceptance criteria pass, output the exact token ${m.sentinel} on its own line.`;
39
+ return { decision: "block", patch: { mode: m.key, counter: m.counter, value: next }, reason };
40
+ }
41
+
42
+ // No active loop — normal stop.
43
+ return { decision: "allow" };
44
+ }
@@ -5,6 +5,7 @@ import { fileURLToPath } from "node:url";
5
5
  const CACHE_TTL_MS = 6 * 60 * 60 * 1000;
6
6
  const FETCH_TIMEOUT_MS = 2000;
7
7
  const PACKAGE_NAME = "@damian87/omp";
8
+ const VERSION_OVERRIDE_ENV = "OMP_VERSION_OVERRIDE";
8
9
 
9
10
  export function isNewer(latest, current) {
10
11
  if (!latest || !current) return false;
@@ -21,6 +22,8 @@ export function formatUpdateNotice(current, latest) {
21
22
  }
22
23
 
23
24
  export function readCurrentVersion() {
25
+ const overriddenVersion = process.env[VERSION_OVERRIDE_ENV]?.trim();
26
+ if (overriddenVersion) return overriddenVersion;
24
27
  try {
25
28
  const here = dirname(fileURLToPath(import.meta.url));
26
29
  const pkgPath = join(here, "..", "..", "package.json");
@@ -10,7 +10,7 @@ const HOOK_NAME = "PostToolUse";
10
10
  const raw = await readStdin();
11
11
  const data = raw ? JSON.parse(raw) : {};
12
12
  const sessionId = data.sessionId ?? data.session_id ?? "unknown";
13
- const directory = data.directory ?? process.cwd();
13
+ const directory = data.cwd ?? data.directory ?? process.cwd();
14
14
  const toolName = data.toolName ?? data.tool_name ?? "unknown";
15
15
  const ok = data.toolOutput != null;
16
16
  const logFile = join(directory, ".omp", "state", "hooks.log");
@@ -10,7 +10,7 @@ const HOOK_NAME = "PreToolUse";
10
10
  const raw = await readStdin();
11
11
  const data = raw ? JSON.parse(raw) : {};
12
12
  const sessionId = data.sessionId ?? data.session_id ?? "unknown";
13
- const directory = data.directory ?? process.cwd();
13
+ const directory = data.cwd ?? data.directory ?? process.cwd();
14
14
  const toolName = data.toolName ?? data.tool_name ?? "unknown";
15
15
  const logFile = join(directory, ".omp", "state", "hooks.log");
16
16
  try {
@@ -2,6 +2,7 @@
2
2
  import { appendFileSync, existsSync, mkdirSync, readFileSync } from "node:fs";
3
3
  import { dirname, join } from "node:path";
4
4
  import { readStdin } from "./lib/stdin.mjs";
5
+ import { hookCwd, printContinue, failOpen } from "./lib/hook-output.mjs";
5
6
  import { recordPrompt } from "./lib/daily-log.mjs";
6
7
  import { ompRoot } from "./lib/omp-root.mjs";
7
8
 
@@ -53,7 +54,7 @@ function appendLog(directory, payload) {
53
54
  const raw = await readStdin();
54
55
  const data = raw ? JSON.parse(raw) : {};
55
56
  const sessionId = data.sessionId ?? data.session_id ?? "unknown";
56
- const directory = data.directory ?? process.cwd();
57
+ const directory = hookCwd(data);
57
58
  const prompt = data.prompt ?? data.message?.content ?? "";
58
59
  appendLog(directory, { sessionId, promptBytes: String(prompt).length });
59
60
  // Count this prompt as session work (signals the SessionEnd nudge logic).
@@ -67,12 +68,9 @@ function appendLog(directory, payload) {
67
68
  const cont = buildContinuationContext(directory);
68
69
  if (cont) parts.push(cont);
69
70
  const additionalContext = parts.join("\n\n---\n\n");
70
- const output = additionalContext
71
- ? { continue: true, hookSpecificOutput: { hookEventName: HOOK_NAME, additionalContext } }
72
- : { continue: true };
73
- console.log(JSON.stringify(output));
71
+ printContinue(HOOK_NAME, additionalContext);
74
72
  } catch (err) {
75
73
  console.error(`[hook ${HOOK_NAME}] failed: ${err?.message ?? err}`);
76
- console.log(JSON.stringify({ continue: true }));
74
+ failOpen();
77
75
  }
78
76
  })();
@@ -12,7 +12,7 @@ const HOOK_NAME = "SessionEnd";
12
12
  const raw = await readStdin();
13
13
  const data = raw ? JSON.parse(raw) : {};
14
14
  const sessionId = data.sessionId ?? data.session_id ?? "unknown";
15
- const directory = data.directory ?? process.cwd();
15
+ const directory = data.cwd ?? data.directory ?? process.cwd();
16
16
  const logFile = join(ompRoot(directory), ".omp", "state", "hooks.log");
17
17
  try {
18
18
  mkdirSync(dirname(logFile), { recursive: true });
@@ -2,6 +2,7 @@
2
2
  import { appendFileSync, mkdirSync } from "node:fs";
3
3
  import { dirname, join } from "node:path";
4
4
  import { readStdin } from "./lib/stdin.mjs";
5
+ import { hookCwd, printContinue, failOpen } from "./lib/hook-output.mjs";
5
6
  import { checkForUpdate, formatUpdateNotice } from "./lib/version-check.mjs";
6
7
  import { scanScheduleResults } from "./lib/schedule-results.mjs";
7
8
  import { readRepoGoal, readTodayGoal, recentEntryStats, startSession } from "./lib/daily-log.mjs";
@@ -19,7 +20,7 @@ function buildDailyLogBreadcrumb(directory) {
19
20
  if (goal) lines.push(`Goal: ${goal}`);
20
21
  if (entries > 0)
21
22
  lines.push(
22
- `${entries} ${entries === 1 ? "entry" : "entries"} logged in the last 7 days — run \`omp daily-log read\` to load if relevant.`,
23
+ `${entries} ${entries === 1 ? "entry" : "entries"} logged in the last 7 days — run \`omp daily-log read --days 7\` to load if relevant.`,
23
24
  );
24
25
  return lines.join("\n");
25
26
  } catch {
@@ -32,7 +33,7 @@ function buildDailyLogBreadcrumb(directory) {
32
33
  const raw = await readStdin();
33
34
  const data = raw ? JSON.parse(raw) : {};
34
35
  const sessionId = data.sessionId ?? data.session_id ?? "unknown";
35
- const directory = data.directory ?? process.cwd();
36
+ const directory = hookCwd(data);
36
37
  const stateDir = join(ompRoot(directory), ".omp", "state");
37
38
  const logFile = join(stateDir, "hooks.log");
38
39
  mkdirSync(dirname(logFile), { recursive: true });
@@ -84,14 +85,9 @@ function buildDailyLogBreadcrumb(directory) {
84
85
  if (flush) parts.push(`[DAILY LOG] ${flush}`);
85
86
  const additionalContext = parts.join("\n\n---\n\n");
86
87
 
87
- console.log(
88
- JSON.stringify({
89
- continue: true,
90
- hookSpecificOutput: { hookEventName: HOOK_NAME, additionalContext },
91
- }),
92
- );
88
+ printContinue(HOOK_NAME, additionalContext);
93
89
  } catch (err) {
94
90
  console.error(`[hook ${HOOK_NAME}] failed: ${err?.message ?? err}`);
95
- console.log(JSON.stringify({ continue: true }));
91
+ failOpen();
96
92
  }
97
93
  })();
@@ -1,10 +0,0 @@
1
- import { Server } from "@modelcontextprotocol/sdk/server/index.js";
2
- import type { ToolDefinition } from "./types.js";
3
- export interface ServerOptions {
4
- name?: string;
5
- version?: string;
6
- tools: ToolDefinition[];
7
- }
8
- export declare function filterToolsByEnv(tools: ToolDefinition[], envValue?: string | undefined): ToolDefinition[];
9
- export declare function buildMcpServer(options: ServerOptions): Server;
10
- export declare function runMcpServer(options: ServerOptions): Promise<void>;
@@ -1,44 +0,0 @@
1
- import { Server } from "@modelcontextprotocol/sdk/server/index.js";
2
- import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
3
- import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
4
- import { textResult } from "./types.js";
5
- export function filterToolsByEnv(tools, envValue = process.env.OMP_DISABLE_TOOLS ?? process.env.OMC_DISABLE_TOOLS) {
6
- if (!envValue)
7
- return tools;
8
- const disabled = new Set(envValue.split(",").map((s) => s.trim()).filter(Boolean));
9
- if (disabled.size === 0)
10
- return tools;
11
- return tools.filter((t) => !disabled.has(t.category));
12
- }
13
- export function buildMcpServer(options) {
14
- const server = new Server({ name: options.name ?? "oh-my-copilot", version: options.version ?? "0.1.0" }, { capabilities: { tools: {} } });
15
- server.setRequestHandler(ListToolsRequestSchema, async () => ({
16
- tools: options.tools.map((t) => ({
17
- name: t.name,
18
- description: t.description,
19
- inputSchema: t.inputSchema,
20
- })),
21
- }));
22
- server.setRequestHandler(CallToolRequestSchema, async (request) => {
23
- const tool = options.tools.find((t) => t.name === request.params.name);
24
- if (!tool)
25
- return textResult(`Unknown tool: ${request.params.name}`, true);
26
- try {
27
- const args = (request.params.arguments ?? {});
28
- const result = await tool.handler(args);
29
- return result;
30
- }
31
- catch (error) {
32
- const message = error instanceof Error ? error.message : String(error);
33
- return textResult(`Error: ${message}`, true);
34
- }
35
- });
36
- return server;
37
- }
38
- export async function runMcpServer(options) {
39
- const server = buildMcpServer(options);
40
- const transport = new StdioServerTransport();
41
- await server.connect(transport);
42
- console.error(`MCP server running (${options.tools.length} tools)`);
43
- }
44
- //# sourceMappingURL=server.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../../../src/mcp/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAQxC,MAAM,UAAU,gBAAgB,CAC9B,KAAuB,EACvB,WAA+B,OAAO,CAAC,GAAG,CAAC,iBAAiB,IAAI,OAAO,CAAC,GAAG,CAAC,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IAAI,KAAK,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACvE,IAAI,CAAC,IAAI;YAAE,OAAO,UAAU,CAAC,iBAAiB,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,IAAI,CAAU,CAAC;QACpF,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,IAAI,EAAE,CAA4B,CAAC;YACzE,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YACxC,OAAO,MAAe,CAAC;QACzB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACvE,OAAO,UAAU,CAAC,UAAU,OAAO,EAAE,EAAE,IAAI,CAAU,CAAC;QACxD,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,OAAsB;IACvD,MAAM,MAAM,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;IACvC,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,CAAC,KAAK,CAAC,uBAAuB,OAAO,CAAC,KAAK,CAAC,MAAM,SAAS,CAAC,CAAC;AACtE,CAAC"}
@@ -1,2 +0,0 @@
1
- import { type ToolDefinition } from "../types.js";
2
- export declare const dailyLogTools: ToolDefinition[];
@@ -1,148 +0,0 @@
1
- import { existsSync, mkdirSync, readdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
2
- import { dirname, join, resolve } from "node:path";
3
- import { jsonResult, textResult } from "../types.js";
4
- const DAY_FILE_RE = /^\d{4}-\d{2}-\d{2}\.md$/;
5
- const READ_CHAR_BUDGET = 4000;
6
- function pad(n) {
7
- return String(n).padStart(2, "0");
8
- }
9
- function todayStr(d = new Date()) {
10
- return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`;
11
- }
12
- function timeStr(d = new Date()) {
13
- return `${pad(d.getHours())}:${pad(d.getMinutes())}`;
14
- }
15
- function dailyDir(cwd) {
16
- return join(resolve(cwd), ".omp", "memory", "daily");
17
- }
18
- function dayFile(cwd, date = todayStr()) {
19
- return join(dailyDir(cwd), `${date}.md`);
20
- }
21
- function parseDay(text) {
22
- let section = null;
23
- const goalLines = [];
24
- const log = [];
25
- for (const line of text.split("\n")) {
26
- if (/^#\s+/.test(line))
27
- continue;
28
- if (/^##\s+Goal\s*$/i.test(line)) {
29
- section = "goal";
30
- continue;
31
- }
32
- if (/^##\s+Log\s*$/i.test(line)) {
33
- section = "log";
34
- continue;
35
- }
36
- if (section === "goal")
37
- goalLines.push(line);
38
- // Preserve any non-empty line a user may have hand-written, verbatim (bullets,
39
- // prose, indented sub-notes). Only blank spacer lines are dropped on round-trip.
40
- else if (section === "log" && line.trim() !== "")
41
- log.push(line);
42
- }
43
- return { goal: goalLines.join("\n").trim(), log };
44
- }
45
- function serializeDay(date, doc) {
46
- const parts = [`# ${date}`, "", "## Goal", doc.goal.trim(), "", "## Log", ...doc.log];
47
- return `${parts.join("\n").replace(/\n+$/, "")}\n`;
48
- }
49
- function readDay(cwd, date = todayStr()) {
50
- const p = dayFile(cwd, date);
51
- if (!existsSync(p))
52
- return { goal: "", log: [] };
53
- try {
54
- return parseDay(readFileSync(p, "utf8"));
55
- }
56
- catch {
57
- return { goal: "", log: [] };
58
- }
59
- }
60
- function writeDay(cwd, doc, date = todayStr()) {
61
- const p = dayFile(cwd, date);
62
- mkdirSync(dirname(p), { recursive: true });
63
- const tmp = `${p}.tmp.${process.pid}.${Date.now()}`;
64
- writeFileSync(tmp, serializeDay(date, doc), "utf8");
65
- renameSync(tmp, p);
66
- }
67
- function readRecent(cwd, days) {
68
- const dir = dailyDir(cwd);
69
- if (!existsSync(dir))
70
- return "";
71
- const files = readdirSync(dir)
72
- .filter((f) => DAY_FILE_RE.test(f))
73
- .sort()
74
- .reverse()
75
- .slice(0, Math.max(0, days) + 1);
76
- let out = "";
77
- for (const f of files) {
78
- try {
79
- out += `${readFileSync(join(dir, f), "utf8").trim()}\n\n`;
80
- }
81
- catch {
82
- // skip unreadable day file
83
- }
84
- if (out.length > READ_CHAR_BUDGET) {
85
- out = `${out.slice(0, READ_CHAR_BUDGET)}\n…(truncated)`;
86
- break;
87
- }
88
- }
89
- return out.trim();
90
- }
91
- export const dailyLogTools = [
92
- {
93
- name: "daily_log_set_goal",
94
- category: "daily_log",
95
- description: "Set/replace today's Goal in .omp/memory/daily/<today>.md.",
96
- inputSchema: {
97
- type: "object",
98
- properties: { goal: { type: "string" }, cwd: { type: "string" } },
99
- required: ["goal"],
100
- },
101
- handler: (args) => {
102
- const cwd = args.cwd ?? process.cwd();
103
- const doc = readDay(cwd);
104
- doc.goal = String(args.goal ?? "");
105
- writeDay(cwd, doc);
106
- return jsonResult({ ok: true, date: todayStr(), goal: doc.goal });
107
- },
108
- },
109
- {
110
- name: "daily_log_add",
111
- category: "daily_log",
112
- description: "Append a timestamped entry to today's Log in .omp/memory/daily/<today>.md.",
113
- inputSchema: {
114
- type: "object",
115
- properties: { text: { type: "string" }, cwd: { type: "string" } },
116
- required: ["text"],
117
- },
118
- handler: (args) => {
119
- const cwd = args.cwd ?? process.cwd();
120
- // Collapse to a single line so an entry can never contain a `## Goal`/`## Log`
121
- // marker that parseDay would later misread as a section boundary.
122
- const text = String(args.text ?? "")
123
- .replace(/\s*\n\s*/g, " ")
124
- .trim();
125
- if (!text)
126
- return jsonResult({ ok: false, error: "text is required" });
127
- const doc = readDay(cwd);
128
- doc.log.push(`- ${timeStr()} — ${text}`);
129
- writeDay(cwd, doc);
130
- return jsonResult({ ok: true, date: todayStr(), count: doc.log.length });
131
- },
132
- },
133
- {
134
- name: "daily_log_read",
135
- category: "daily_log",
136
- description: "Read the daily log for today plus the previous `days` days (default 1). Char-capped to ~4KB.",
137
- inputSchema: {
138
- type: "object",
139
- properties: { days: { type: "number" }, cwd: { type: "string" } },
140
- },
141
- handler: (args) => {
142
- const cwd = args.cwd ?? process.cwd();
143
- const days = typeof args.days === "number" ? args.days : 1;
144
- return textResult(readRecent(cwd, days) || "(no daily log entries)");
145
- },
146
- },
147
- ];
148
- //# sourceMappingURL=daily-log.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"daily-log.js","sourceRoot":"","sources":["../../../../src/mcp/tools/daily-log.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACtG,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAuB,MAAM,aAAa,CAAC;AAO1E,MAAM,WAAW,GAAG,yBAAyB,CAAC;AAC9C,MAAM,gBAAgB,GAAG,IAAI,CAAC;AAE9B,SAAS,GAAG,CAAC,CAAS;IACpB,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AACpC,CAAC;AAED,SAAS,QAAQ,CAAC,CAAC,GAAG,IAAI,IAAI,EAAE;IAC9B,OAAO,GAAG,CAAC,CAAC,WAAW,EAAE,IAAI,GAAG,CAAC,CAAC,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC;AAC3E,CAAC;AAED,SAAS,OAAO,CAAC,CAAC,GAAG,IAAI,IAAI,EAAE;IAC7B,OAAO,GAAG,GAAG,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,IAAI,GAAG,CAAC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,EAAE,CAAC,CAAC;YACvE,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;YACzB,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,OAAO,EAAE,MAAM,IAAI,EAAE,CAAC,CAAC;YACzC,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;YACnB,OAAO,UAAU,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,GAAG,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;QAC3E,CAAC;KACF;IACD;QACE,IAAI,EAAE,gBAAgB;QACtB,QAAQ,EAAE,WAAW;QACrB,WAAW,EACT,8FAA8F;QAChG,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;SAClE;QACD,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE;YAChB,MAAM,GAAG,GAAI,IAAI,CAAC,GAAc,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;YAClD,MAAM,IAAI,GAAG,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAE,IAAI,CAAC,IAAe,CAAC,CAAC,CAAC,CAAC,CAAC;YACvE,OAAO,UAAU,CAAC,UAAU,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,wBAAwB,CAAC,CAAC;QACvE,CAAC;KACF;CACF,CAAC"}
@@ -1,9 +0,0 @@
1
- import type { ToolDefinition } from "../types.js";
2
- import { stateTools } from "./state.js";
3
- import { notepadTools } from "./notepad.js";
4
- import { projectMemoryTools } from "./project-memory.js";
5
- import { sharedMemoryTools } from "./shared-memory.js";
6
- import { traceTools } from "./trace.js";
7
- export declare const allTools: ToolDefinition[];
8
- export { stateTools, notepadTools, projectMemoryTools, sharedMemoryTools, traceTools };
9
- export { appendTraceEntry } from "./trace.js";
@@ -1,15 +0,0 @@
1
- import { stateTools } from "./state.js";
2
- import { notepadTools } from "./notepad.js";
3
- import { projectMemoryTools } from "./project-memory.js";
4
- import { sharedMemoryTools } from "./shared-memory.js";
5
- import { traceTools } from "./trace.js";
6
- export const allTools = [
7
- ...stateTools,
8
- ...notepadTools,
9
- ...projectMemoryTools,
10
- ...sharedMemoryTools,
11
- ...traceTools,
12
- ];
13
- export { stateTools, notepadTools, projectMemoryTools, sharedMemoryTools, traceTools };
14
- export { appendTraceEntry } from "./trace.js";
15
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/mcp/tools/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,MAAM,CAAC,MAAM,QAAQ,GAAqB;IACxC,GAAG,UAAU;IACb,GAAG,YAAY;IACf,GAAG,kBAAkB;IACrB,GAAG,iBAAiB;IACpB,GAAG,UAAU;CACd,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,UAAU,EAAE,CAAC;AACvF,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC"}
@@ -1,2 +0,0 @@
1
- import { type ToolDefinition } from "../types.js";
2
- export declare const notepadTools: ToolDefinition[];