oh-my-opencode 5.0.0-beta.33 → 5.0.0-beta.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/skills/codex-qa/scripts/lsp-e2e.sh +1 -3
- package/.agents/skills/opencode-qa/scripts/lsp-e2e.sh +1 -1
- package/.agents/skills/tech-debt-audit/SKILL.md +6 -76
- package/README.ja.md +1 -1
- package/README.ko.md +1 -1
- package/README.md +1 -1
- package/README.ru.md +1 -1
- package/README.zh-cn.md +1 -1
- package/THIRD-PARTY-NOTICES.md +27 -99
- package/dist/cli/index.js +48350 -48559
- package/dist/cli-node/index.js +48480 -48689
- package/dist/config/index.d.ts +1 -1
- package/dist/config/schema/hooks.d.ts +0 -1
- package/dist/config/schema/oh-my-opencode-config.d.ts +0 -10
- package/dist/config/schema.d.ts +0 -1
- package/dist/create-hooks.d.ts +0 -1
- package/dist/hooks/index.d.ts +0 -1
- package/dist/index.js +11675 -13742
- package/dist/mcp/index.d.ts +0 -4
- package/dist/mcp/types.d.ts +0 -1
- package/dist/oh-my-opencode.schema.json +1 -45
- package/dist/plugin/hooks/create-core-hooks.d.ts +0 -1
- package/dist/plugin/hooks/create-session-hooks.d.ts +1 -2
- package/dist/shared/omo-process-sweep.d.ts +2 -4
- package/dist/skills/init-deep/SKILL.md +13 -13
- package/dist/skills/ulw-plan/SKILL.md +0 -1
- package/dist/tui.js +44809 -44910
- package/package.json +16 -18
- package/packages/omo-codex/THIRD-PARTY-NOTICES.md +0 -17
- package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -3
- package/packages/omo-codex/plugin/.mcp.json +0 -6
- package/packages/omo-codex/plugin/AGENTS.md +5 -5
- package/packages/omo-codex/plugin/README.md +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/dist/cli.js +1 -15
- package/packages/omo-codex/plugin/components/bootstrap/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/package.json +1 -1
- package/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/comment-checker/package.json +1 -1
- package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/git-bash/package.json +1 -1
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/package.json +1 -1
- package/packages/omo-codex/plugin/components/lcx/skills/lcx-doctor/SKILL.md +1 -1
- package/packages/omo-codex/plugin/components/lsp/dist/.omo-runtime-manifest.json +2 -2
- package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/lsp/package.json +1 -1
- package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +4 -4
- package/packages/omo-codex/plugin/components/rules/package.json +1 -1
- package/packages/omo-codex/plugin/components/teammode/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/teammode/package.json +1 -1
- package/packages/omo-codex/plugin/components/teammode/test/thread-title-hook.test.ts +1 -1
- package/packages/omo-codex/plugin/components/telemetry/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/telemetry/package.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/dist/cli.js +2 -2
- package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/package.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/SKILL.md +0 -1
- package/packages/omo-codex/plugin/components/ultrawork/src/directive-content.ts +1 -1
- package/packages/omo-codex/plugin/components/ulw-execute-continuation/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/ulw-execute-continuation/package.json +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/README.md +11 -1
- package/packages/omo-codex/plugin/components/ulw-loop/directive.md +2 -2
- package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint-codex-validation.d.ts +12 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint-codex-validation.js +45 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint-reconciliation.d.ts +1 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint-reconciliation.js +5 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint-template.js +10 -3
- package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint.js +35 -38
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli.js +278 -193
- package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate-aggregate.d.ts +5 -0
- package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate-aggregate.js +7 -51
- package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate-artifacts.js +39 -22
- package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate-fields.d.ts +13 -1
- package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate-fields.js +64 -8
- package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate-verdicts.js +5 -1
- package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate.js +37 -18
- package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +4 -4
- package/packages/omo-codex/plugin/components/ulw-loop/package.json +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/full-workflow.md +2 -1
- package/packages/omo-codex/plugin/components/ulw-loop/src/checkpoint-codex-validation.ts +81 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/checkpoint-reconciliation.ts +6 -0
- package/packages/omo-codex/plugin/components/ulw-loop/src/checkpoint-template.ts +10 -3
- package/packages/omo-codex/plugin/components/ulw-loop/src/checkpoint.ts +32 -63
- package/packages/omo-codex/plugin/components/ulw-loop/src/quality-gate-aggregate.ts +7 -53
- package/packages/omo-codex/plugin/components/ulw-loop/src/quality-gate-artifacts.ts +50 -31
- package/packages/omo-codex/plugin/components/ulw-loop/src/quality-gate-fields.ts +67 -14
- package/packages/omo-codex/plugin/components/ulw-loop/src/quality-gate-verdicts.ts +6 -1
- package/packages/omo-codex/plugin/components/ulw-loop/src/quality-gate.ts +36 -17
- package/packages/omo-codex/plugin/components/ulw-loop/test/checkpoint-final.test.ts +26 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/checkpoint-template.test.ts +47 -2
- package/packages/omo-codex/plugin/components/ulw-loop/test/quality-gate-aggregate-basics.test.ts +258 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/quality-gate-cap-and-dedupe.test.ts +22 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/quality-gate-poisoning-cascades.test.ts +97 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/quality-gate-single-report.test.ts +241 -0
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-git-bash-mcp-reminder.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-lsp-diagnostics-cache.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-project-rule-cache.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-comments.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-lsp-diagnostics.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-thread-title-hygiene.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-matching-project-rules.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-guarding-ulw-loop-spawns.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-recommending-git-bash-mcp.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-checking-auto-update.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-checking-bootstrap-provisioning.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-loading-project-rules.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-recording-session-telemetry.json +1 -1
- package/packages/omo-codex/plugin/hooks/stop-checking-ulw-execute-continuation.json +1 -1
- package/packages/omo-codex/plugin/hooks/stop-checking-ulw-loop-resume.json +1 -1
- package/packages/omo-codex/plugin/hooks/subagent-stop-checking-ulw-execute-continuation.json +1 -1
- package/packages/omo-codex/plugin/hooks/subagent-stop-verifying-lazycodex-executor-evidence.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ultrawork-trigger.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ulw-loop-steering.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-loading-project-rules.json +1 -1
- package/packages/omo-codex/plugin/package-lock.json +12 -146
- package/packages/omo-codex/plugin/package.json +1 -2
- package/packages/omo-codex/plugin/scripts/AGENTS.md +0 -1
- package/packages/omo-codex/plugin/scripts/auto-update-plan.mjs +0 -1
- package/packages/omo-codex/plugin/scripts/auto-update.mjs +0 -9
- package/packages/omo-codex/plugin/scripts/canonical-ultrawork-directive.mjs +17 -0
- package/packages/omo-codex/plugin/scripts/hook-status-message.mjs +0 -1
- package/packages/omo-codex/plugin/scripts/sync-skills.mjs +2 -8
- package/packages/omo-codex/plugin/shared/src/config-loader.ts +2 -102
- package/packages/omo-codex/plugin/shared/src/config-migration.ts +0 -1
- package/packages/omo-codex/plugin/shared/test/config-loader.test.ts +41 -130
- package/packages/omo-codex/plugin/skills/init-deep/SKILL.md +13 -13
- package/packages/omo-codex/plugin/skills/lcx-doctor/SKILL.md +1 -1
- package/packages/omo-codex/plugin/skills/ultrawork/SKILL.md +2 -2
- package/packages/omo-codex/plugin/skills/ulw-loop/references/full-workflow.md +2 -1
- package/packages/omo-codex/plugin/skills/ulw-plan/SKILL.md +0 -1
- package/packages/omo-codex/plugin/test/AGENTS.md +2 -2
- package/packages/omo-codex/plugin/test/aggregate-hooks.test.mjs +2 -21
- package/packages/omo-codex/plugin/test/aggregate-manifest.test.mjs +1 -2
- package/packages/omo-codex/plugin/test/aggregate-mcp.test.mjs +2 -7
- package/packages/omo-codex/plugin/test/auto-update.test.mjs +0 -25
- package/packages/omo-codex/plugin/test/bootstrap-setup.test.mjs +0 -31
- package/packages/omo-codex/plugin/test/canonical-ultrawork-directive.test.mjs +53 -0
- package/packages/omo-codex/plugin/test/component-bundled-cli.test.mjs +0 -50
- package/packages/omo-codex/plugin/test/hook-status-message.test.mjs +0 -1
- package/packages/omo-codex/plugin/test/mcp-research-servers.test.mjs +1 -3
- package/packages/omo-codex/scripts/install-cache-copy.test.mjs +27 -1
- package/packages/omo-codex/scripts/install-config-git-bash.test.mjs +0 -23
- package/packages/omo-codex/scripts/install-dist/install-local.mjs +238 -431
- package/packages/omo-codex/scripts/install-git-bash-mcp-env.test.mjs +1 -25
- package/packages/omo-codex/scripts/install-mcp-runtime.test.mjs +0 -36
- package/packages/shared-skills/skills/init-deep/SKILL.md +13 -13
- package/packages/shared-skills/skills/ulw-plan/SKILL.md +0 -1
- package/dist/config/schema/codegraph.d.ts +0 -12
- package/dist/hooks/codegraph-bootstrap/command-runner.d.ts +0 -17
- package/dist/hooks/codegraph-bootstrap/hook.d.ts +0 -35
- package/dist/hooks/codegraph-bootstrap/index.d.ts +0 -1
- package/dist/hooks/codegraph-bootstrap/project-root.d.ts +0 -1
- package/dist/hooks/codegraph-bootstrap/status.d.ts +0 -11
- package/dist/mcp/codegraph.d.ts +0 -16
- package/packages/omo-codex/plugin/components/codegraph/AGENTS.md +0 -58
- package/packages/omo-codex/plugin/components/codegraph/LICENSE +0 -21
- package/packages/omo-codex/plugin/components/codegraph/NODE-RUNTIME-LICENSES.md +0 -2951
- package/packages/omo-codex/plugin/components/codegraph/NOTICE +0 -16
- package/packages/omo-codex/plugin/components/codegraph/dist/cli.js +0 -12326
- package/packages/omo-codex/plugin/components/codegraph/dist/serve.js +0 -9908
- package/packages/omo-codex/plugin/components/codegraph/package.json +0 -33
- package/packages/omo-codex/plugin/components/codegraph/src/cache-gc.ts +0 -29
- package/packages/omo-codex/plugin/components/codegraph/src/cli.ts +0 -79
- package/packages/omo-codex/plugin/components/codegraph/src/hook-input.ts +0 -33
- package/packages/omo-codex/plugin/components/codegraph/src/hook-sweep.ts +0 -25
- package/packages/omo-codex/plugin/components/codegraph/src/hook-types.ts +0 -131
- package/packages/omo-codex/plugin/components/codegraph/src/hook.ts +0 -258
- package/packages/omo-codex/plugin/components/codegraph/src/mcp-bridge.ts +0 -310
- package/packages/omo-codex/plugin/components/codegraph/src/mcp-unavailable.ts +0 -92
- package/packages/omo-codex/plugin/components/codegraph/src/post-tool-use-hook.ts +0 -34
- package/packages/omo-codex/plugin/components/codegraph/src/serve-invocation.ts +0 -29
- package/packages/omo-codex/plugin/components/codegraph/src/serve.ts +0 -263
- package/packages/omo-codex/plugin/components/codegraph/src/session-start-command.ts +0 -106
- package/packages/omo-codex/plugin/components/codegraph/src/session-start-cooldown.ts +0 -145
- package/packages/omo-codex/plugin/components/codegraph/src/session-start-hook-runtime.ts +0 -22
- package/packages/omo-codex/plugin/components/codegraph/src/session-start-lock.ts +0 -139
- package/packages/omo-codex/plugin/components/codegraph/src/session-start-outcome.ts +0 -15
- package/packages/omo-codex/plugin/components/codegraph/src/session-start-paths.ts +0 -32
- package/packages/omo-codex/plugin/components/codegraph/src/session-start-project.ts +0 -109
- package/packages/omo-codex/plugin/components/codegraph/src/session-start-worker-result.ts +0 -148
- package/packages/omo-codex/plugin/components/codegraph/src/session-start-worker.ts +0 -175
- package/packages/omo-codex/plugin/components/codegraph/src/sweep-cli.ts +0 -81
- package/packages/omo-codex/plugin/components/codegraph/test/cache-gc.test.ts +0 -34
- package/packages/omo-codex/plugin/components/codegraph/test/hook-exclusion.test.ts +0 -112
- package/packages/omo-codex/plugin/components/codegraph/test/hook-registration.test.ts +0 -26
- package/packages/omo-codex/plugin/components/codegraph/test/hook-session-start-guard.test.ts +0 -160
- package/packages/omo-codex/plugin/components/codegraph/test/hook-store-upgrade.test.ts +0 -50
- package/packages/omo-codex/plugin/components/codegraph/test/hook-sweep.test.ts +0 -29
- package/packages/omo-codex/plugin/components/codegraph/test/hook.test.ts +0 -320
- package/packages/omo-codex/plugin/components/codegraph/test/mcp-bridge-fixtures.ts +0 -172
- package/packages/omo-codex/plugin/components/codegraph/test/package-runtime.test.ts +0 -91
- package/packages/omo-codex/plugin/components/codegraph/test/provisioned-node-guard.test.ts +0 -100
- package/packages/omo-codex/plugin/components/codegraph/test/serve-built-wrapper.test.ts +0 -76
- package/packages/omo-codex/plugin/components/codegraph/test/serve-mcp-bridge-lifecycle.test.ts +0 -133
- package/packages/omo-codex/plugin/components/codegraph/test/serve-mcp-bridge.test.ts +0 -245
- package/packages/omo-codex/plugin/components/codegraph/test/serve-mcp-facade.test.ts +0 -69
- package/packages/omo-codex/plugin/components/codegraph/test/serve-node-support.test.ts +0 -43
- package/packages/omo-codex/plugin/components/codegraph/test/serve-provision.test.ts +0 -147
- package/packages/omo-codex/plugin/components/codegraph/test/serve-unavailable-idle.test.ts +0 -47
- package/packages/omo-codex/plugin/components/codegraph/test/serve-unavailable.test.ts +0 -175
- package/packages/omo-codex/plugin/components/codegraph/test/serve.test.ts +0 -385
- package/packages/omo-codex/plugin/components/codegraph/test/session-start-node-support.test.ts +0 -206
- package/packages/omo-codex/plugin/components/codegraph/test/session-start-project.test.ts +0 -58
- package/packages/omo-codex/plugin/components/codegraph/test/session-start-state.test.ts +0 -104
- package/packages/omo-codex/plugin/components/codegraph/test/session-start-trust-boundary.test.ts +0 -65
- package/packages/omo-codex/plugin/components/codegraph/test/session-start-worker-availability.test.ts +0 -106
- package/packages/omo-codex/plugin/components/codegraph/test/session-start-worker-cooldown.test.ts +0 -116
- package/packages/omo-codex/plugin/components/codegraph/test/session-start-worker-flow.test.ts +0 -258
- package/packages/omo-codex/plugin/components/codegraph/test/sweep-cli.test.ts +0 -56
- package/packages/omo-codex/plugin/components/codegraph/tsconfig.build.json +0 -13
- package/packages/omo-codex/plugin/components/codegraph/tsconfig.json +0 -25
- package/packages/omo-codex/plugin/components/ulw-loop/test/quality-gate-aggregate.test.ts +0 -101
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-codegraph-init-guidance.json +0 -18
- package/packages/omo-codex/plugin/hooks/session-start-checking-codegraph-bootstrap.json +0 -17
- package/packages/omo-codex/plugin/scripts/migrate-omo-sot/editor.mjs +0 -125
- package/packages/omo-codex/plugin/scripts/migrate-omo-sot/jsonc.mjs +0 -43
- package/packages/omo-codex/plugin/scripts/migrate-omo-sot/scaffold.mjs +0 -29
- package/packages/omo-codex/plugin/scripts/migrate-omo-sot.mjs +0 -121
- package/packages/omo-codex/plugin/test/component-codegraph-mcp-smoke.test.mjs +0 -76
- package/packages/omo-codex/plugin/test/migrate-omo-sot.test.mjs +0 -179
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from "bun:test";
|
|
2
|
-
import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
|
|
3
|
-
import { tmpdir } from "node:os";
|
|
4
|
-
import { join } from "node:path";
|
|
5
|
-
|
|
6
|
-
import { runCodegraphServe } from "../src/serve.ts";
|
|
7
|
-
|
|
8
|
-
describe("runCodegraphServe provisioning", () => {
|
|
9
|
-
it("#given CodeGraph is unresolved and daemon is omitted #when serving MCP #then provisions CodeGraph with daemon-on", async () => {
|
|
10
|
-
// given
|
|
11
|
-
const binPath = join("/tmp/home/.omo/codegraph", "bin", "codegraph");
|
|
12
|
-
const calls: Array<{
|
|
13
|
-
readonly args: readonly string[];
|
|
14
|
-
readonly command: string;
|
|
15
|
-
readonly env: Record<string, string | undefined>;
|
|
16
|
-
}> = [];
|
|
17
|
-
const stderr: string[] = [];
|
|
18
|
-
|
|
19
|
-
// when
|
|
20
|
-
const exitCode = await runCodegraphServe({
|
|
21
|
-
config: { codegraph: { enabled: true }, sources: [], warnings: [] },
|
|
22
|
-
env: { PATH: "/bin" },
|
|
23
|
-
homeDir: "/tmp/home",
|
|
24
|
-
nodeVersion: "22.14.0",
|
|
25
|
-
resolve: () => ({ argsPrefix: [], command: "codegraph", exists: false, source: "path" }),
|
|
26
|
-
ensureProvisioned: (options) =>
|
|
27
|
-
Promise.resolve({
|
|
28
|
-
binPath: join(options.installDir ?? "/tmp/home/.omo/codegraph", "bin", "codegraph"),
|
|
29
|
-
provisioned: true,
|
|
30
|
-
}),
|
|
31
|
-
runProcess: (command, args, options) => {
|
|
32
|
-
calls.push({ args, command, env: options.env });
|
|
33
|
-
return Promise.resolve(0);
|
|
34
|
-
},
|
|
35
|
-
stderr: { write: (chunk: string) => stderr.push(chunk) },
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
// then
|
|
39
|
-
expect(exitCode).toBe(0);
|
|
40
|
-
expect(stderr).toEqual([]);
|
|
41
|
-
expect(calls).toEqual([
|
|
42
|
-
{
|
|
43
|
-
args: ["serve", "--mcp"],
|
|
44
|
-
command: binPath,
|
|
45
|
-
env: {
|
|
46
|
-
CODEGRAPH_INSTALL_DIR: join("/tmp/home", ".omo", "codegraph"),
|
|
47
|
-
CODEGRAPH_NO_DOWNLOAD: "1",
|
|
48
|
-
CODEGRAPH_TELEMETRY: "0",
|
|
49
|
-
DO_NOT_TRACK: "1",
|
|
50
|
-
PATH: "/bin",
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
]);
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
it("#given a bundled runtime and a stale managed install #when serving MCP #then it upgrades and uses the managed runtime", async () => {
|
|
57
|
-
// given
|
|
58
|
-
const homeDir = mkdtempSync(join(tmpdir(), "omo-codegraph-serve-managed-upgrade-"));
|
|
59
|
-
const installDir = join(homeDir, ".omo", "codegraph");
|
|
60
|
-
const binPath = join(installDir, "bin", "codegraph");
|
|
61
|
-
mkdirSync(join(installDir, "bin"), { recursive: true });
|
|
62
|
-
mkdirSync(join(installDir, ".provisioned"), { recursive: true });
|
|
63
|
-
writeFileSync(binPath, "stale codegraph\n");
|
|
64
|
-
writeFileSync(
|
|
65
|
-
join(installDir, ".provisioned", "codegraph-1.4.1.json"),
|
|
66
|
-
`${JSON.stringify({ binPath, version: "1.4.1" })}\n`,
|
|
67
|
-
);
|
|
68
|
-
const provisionCalls: unknown[] = [];
|
|
69
|
-
const processCalls: Array<{ readonly args: readonly string[]; readonly command: string }> = [];
|
|
70
|
-
|
|
71
|
-
try {
|
|
72
|
-
// when
|
|
73
|
-
const exitCode = await runCodegraphServe({
|
|
74
|
-
config: { codegraph: { enabled: true }, sources: [], warnings: [] },
|
|
75
|
-
homeDir,
|
|
76
|
-
managedInstallExists: () => true,
|
|
77
|
-
nodeVersion: "22.14.0",
|
|
78
|
-
resolve: () => ({ argsPrefix: ["codegraph.js"], command: "/opt/node22/bin/node", exists: true, source: "bundled" }),
|
|
79
|
-
resolveManagedBin: () => null,
|
|
80
|
-
ensureProvisioned: (options) => {
|
|
81
|
-
provisionCalls.push(options);
|
|
82
|
-
return Promise.resolve({ binPath, provisioned: true });
|
|
83
|
-
},
|
|
84
|
-
runProcess: (command, args) => {
|
|
85
|
-
processCalls.push({ args, command });
|
|
86
|
-
return Promise.resolve(0);
|
|
87
|
-
},
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
// then
|
|
91
|
-
expect(exitCode).toBe(0);
|
|
92
|
-
expect(provisionCalls).toEqual([{ installDir, lockDir: join(installDir, ".locks"), version: "1.5.0" }]);
|
|
93
|
-
expect(processCalls).toEqual([{ args: ["serve", "--mcp"], command: binPath }]);
|
|
94
|
-
} finally {
|
|
95
|
-
rmSync(homeDir, { force: true, recursive: true });
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
it("#given CodeGraph is unresolved and codegraph.daemon=false #when serving MCP #then provisions CodeGraph with daemon-off", async () => {
|
|
100
|
-
// given
|
|
101
|
-
const binPath = join("/tmp/home/.omo/codegraph", "bin", "codegraph");
|
|
102
|
-
const calls: Array<{
|
|
103
|
-
readonly args: readonly string[];
|
|
104
|
-
readonly command: string;
|
|
105
|
-
readonly env: Record<string, string | undefined>;
|
|
106
|
-
}> = [];
|
|
107
|
-
const stderr: string[] = [];
|
|
108
|
-
|
|
109
|
-
// when
|
|
110
|
-
const exitCode = await runCodegraphServe({
|
|
111
|
-
config: { codegraph: { daemon: false, enabled: true }, sources: [], warnings: [] },
|
|
112
|
-
env: { PATH: "/bin" },
|
|
113
|
-
homeDir: "/tmp/home",
|
|
114
|
-
nodeVersion: "22.14.0",
|
|
115
|
-
resolve: () => ({ argsPrefix: [], command: "codegraph", exists: false, source: "path" }),
|
|
116
|
-
ensureProvisioned: (options) =>
|
|
117
|
-
Promise.resolve({
|
|
118
|
-
binPath: join(options.installDir ?? "/tmp/home/.omo/codegraph", "bin", "codegraph"),
|
|
119
|
-
provisioned: true,
|
|
120
|
-
}),
|
|
121
|
-
runProcess: (command, args, options) => {
|
|
122
|
-
calls.push({ args, command, env: options.env });
|
|
123
|
-
return Promise.resolve(0);
|
|
124
|
-
},
|
|
125
|
-
stderr: { write: (chunk: string) => stderr.push(chunk) },
|
|
126
|
-
});
|
|
127
|
-
|
|
128
|
-
// then
|
|
129
|
-
expect(exitCode).toBe(0);
|
|
130
|
-
expect(stderr).toEqual([]);
|
|
131
|
-
expect(calls).toEqual([
|
|
132
|
-
{
|
|
133
|
-
args: ["serve", "--mcp"],
|
|
134
|
-
command: binPath,
|
|
135
|
-
env: {
|
|
136
|
-
CODEGRAPH_INSTALL_DIR: join("/tmp/home", ".omo", "codegraph"),
|
|
137
|
-
CODEGRAPH_NO_DAEMON: "1",
|
|
138
|
-
CODEGRAPH_NO_DOWNLOAD: "1",
|
|
139
|
-
CODEGRAPH_TELEMETRY: "0",
|
|
140
|
-
DO_NOT_TRACK: "1",
|
|
141
|
-
PATH: "/bin",
|
|
142
|
-
},
|
|
143
|
-
},
|
|
144
|
-
]);
|
|
145
|
-
expect(calls[0]?.env["CODEGRAPH_NO_DAEMON"]).toBe("1");
|
|
146
|
-
});
|
|
147
|
-
});
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from "bun:test";
|
|
2
|
-
import { PassThrough } from "node:stream";
|
|
3
|
-
|
|
4
|
-
import { runUnavailableCodegraphMcpServer } from "../src/mcp-unavailable.ts";
|
|
5
|
-
|
|
6
|
-
describe("unavailable codegraph MCP idle teardown", () => {
|
|
7
|
-
it("#given the codex host (no respawn for exited stdio servers) #when the unavailable stub starts #then the idle timeout is disabled", async () => {
|
|
8
|
-
// given — codex never respawns a user-configured stdio MCP server
|
|
9
|
-
// (codex-rs reconnects only its own codex_apps server), so if the stub
|
|
10
|
-
// inherited the mcp-stdio-core default idle timeout it would destroy its
|
|
11
|
-
// own stdin after 10 idle minutes and every later codegraph tool call in
|
|
12
|
-
// a long-lived session would fail on a dead connection instead of
|
|
13
|
-
// answering with the skip reason.
|
|
14
|
-
const stdin = new PassThrough();
|
|
15
|
-
const stdout = new PassThrough();
|
|
16
|
-
stdout.resume();
|
|
17
|
-
const lifecycle: Array<{ readonly event: string; readonly data?: unknown }> = [];
|
|
18
|
-
|
|
19
|
-
try {
|
|
20
|
-
// when
|
|
21
|
-
const served = runUnavailableCodegraphMcpServer({
|
|
22
|
-
input: stdin,
|
|
23
|
-
output: stdout,
|
|
24
|
-
reason: "CodeGraph MCP skipped: test reason",
|
|
25
|
-
serverVersion: "0.0.0-test",
|
|
26
|
-
lifecycleLog: (event, data) => {
|
|
27
|
-
lifecycle.push({ event, data });
|
|
28
|
-
},
|
|
29
|
-
});
|
|
30
|
-
const outcome = await Promise.race([
|
|
31
|
-
served.then(() => "settled" as const),
|
|
32
|
-
Bun.sleep(500).then(() => "parked" as const),
|
|
33
|
-
]);
|
|
34
|
-
|
|
35
|
-
// then — the server must park on the held-open pipe (no idle timer
|
|
36
|
-
// tore it down) and must have started with the timeout disabled.
|
|
37
|
-
expect(outcome).toBe("parked");
|
|
38
|
-
expect(lifecycle).toContainEqual({
|
|
39
|
-
event: "stdio_started",
|
|
40
|
-
data: expect.objectContaining({ idle_timeout_ms: 0 }),
|
|
41
|
-
});
|
|
42
|
-
} finally {
|
|
43
|
-
stdin.destroy();
|
|
44
|
-
stdout.destroy();
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
});
|
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from "bun:test";
|
|
2
|
-
import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
|
|
3
|
-
import { tmpdir } from "node:os";
|
|
4
|
-
import { join } from "node:path";
|
|
5
|
-
import { PassThrough } from "node:stream";
|
|
6
|
-
|
|
7
|
-
import { runCodegraphServe } from "../src/serve.ts";
|
|
8
|
-
|
|
9
|
-
describe("runCodegraphServe unavailable CodeGraph paths", () => {
|
|
10
|
-
it("#given CodeGraph is unresolved #when serving MCP #then exposes an empty facade with a skip hint", async () => {
|
|
11
|
-
// given
|
|
12
|
-
const stderr: string[] = [];
|
|
13
|
-
const spawned: string[] = [];
|
|
14
|
-
|
|
15
|
-
// when
|
|
16
|
-
const exitCode = await runCodegraphServe({
|
|
17
|
-
...closedMcpStdio(),
|
|
18
|
-
config: { codegraph: { auto_provision: false, enabled: true }, sources: [], warnings: [] },
|
|
19
|
-
env: { PATH: "/bin" },
|
|
20
|
-
nodeVersion: "22.14.0",
|
|
21
|
-
buildEnv: () => ({}),
|
|
22
|
-
resolve: () => ({ argsPrefix: [], command: "codegraph", exists: false, source: "path" }),
|
|
23
|
-
runProcess: (command: string) => {
|
|
24
|
-
spawned.push(command);
|
|
25
|
-
return Promise.resolve(0);
|
|
26
|
-
},
|
|
27
|
-
stderr: { write: (chunk: string) => stderr.push(chunk) },
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
// then
|
|
31
|
-
expect(exitCode).toBe(0);
|
|
32
|
-
expect(spawned).toEqual([]);
|
|
33
|
-
expect(stderr).toEqual([
|
|
34
|
-
"CodeGraph MCP skipped: codegraph binary not found. Install CodeGraph or set OMO_CODEGRAPH_BIN.\n",
|
|
35
|
-
]);
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
it("#given an unsupported local Node #when serving MCP #then exposes an empty facade without spawning codegraph", async () => {
|
|
39
|
-
// given
|
|
40
|
-
const stderr: string[] = [];
|
|
41
|
-
const spawned: string[] = [];
|
|
42
|
-
|
|
43
|
-
// when
|
|
44
|
-
const exitCode = await runCodegraphServe({
|
|
45
|
-
...closedMcpStdio(),
|
|
46
|
-
env: {},
|
|
47
|
-
nodeVersion: "26.3.0",
|
|
48
|
-
buildEnv: () => ({}),
|
|
49
|
-
resolve: () => ({ argsPrefix: [], command: "codegraph", exists: true, source: "path" }),
|
|
50
|
-
runProcess: (command: string) => {
|
|
51
|
-
spawned.push(command);
|
|
52
|
-
return Promise.resolve(0);
|
|
53
|
-
},
|
|
54
|
-
stderr: { write: (chunk: string) => stderr.push(chunk) },
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
// then
|
|
58
|
-
expect(exitCode).toBe(0);
|
|
59
|
-
expect(spawned).toEqual([]);
|
|
60
|
-
expect(stderr).toHaveLength(1);
|
|
61
|
-
expect(stderr[0]).toContain("CodeGraph MCP skipped");
|
|
62
|
-
expect(stderr[0]).toContain("CODEGRAPH_ALLOW_UNSAFE_NODE");
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
it("#given OMO_CODEGRAPH_BIN points at a missing path #when serving MCP #then exposes an empty facade before spawn", async () => {
|
|
66
|
-
// given
|
|
67
|
-
const stderr: string[] = [];
|
|
68
|
-
const spawned: string[] = [];
|
|
69
|
-
|
|
70
|
-
// when
|
|
71
|
-
const exitCode = await runCodegraphServe({
|
|
72
|
-
...closedMcpStdio(),
|
|
73
|
-
buildEnv: () => ({}),
|
|
74
|
-
commandExists: () => false,
|
|
75
|
-
resolve: () => ({ argsPrefix: [], command: "/nonexistent", exists: true, source: "env" }),
|
|
76
|
-
runProcess: (command: string) => {
|
|
77
|
-
spawned.push(command);
|
|
78
|
-
return Promise.resolve(0);
|
|
79
|
-
},
|
|
80
|
-
stderr: { write: (chunk: string) => stderr.push(chunk) },
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
// then
|
|
84
|
-
expect(exitCode).toBe(0);
|
|
85
|
-
expect(spawned).toEqual([]);
|
|
86
|
-
expect(stderr).toEqual([
|
|
87
|
-
"CodeGraph MCP skipped: codegraph binary not found. Install CodeGraph or set OMO_CODEGRAPH_BIN.\n",
|
|
88
|
-
]);
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
it("#given Codex SOT disables CodeGraph #when serving MCP #then exposes an empty facade with a disabled hint", async () => {
|
|
92
|
-
// given
|
|
93
|
-
const homeDir = mkdtempSync(join(tmpdir(), "omo-codegraph-serve-disabled-home-"));
|
|
94
|
-
const workspace = mkdtempSync(join(tmpdir(), "omo-codegraph-serve-disabled-workspace-"));
|
|
95
|
-
const stderr: string[] = [];
|
|
96
|
-
const spawned: string[] = [];
|
|
97
|
-
try {
|
|
98
|
-
mkdirSync(join(homeDir, ".omo"), { recursive: true });
|
|
99
|
-
mkdirSync(join(workspace, ".omo"), { recursive: true });
|
|
100
|
-
writeFileSync(join(homeDir, ".omo", "omo.jsonc"), '{ "codegraph": { "enabled": true } }\n');
|
|
101
|
-
writeFileSync(join(workspace, ".omo", "omo.jsonc"), '{ "[codex]": { "codegraph": { "enabled": false } } }\n');
|
|
102
|
-
|
|
103
|
-
// when
|
|
104
|
-
const exitCode = await runCodegraphServe({
|
|
105
|
-
...closedMcpStdio(),
|
|
106
|
-
cwd: workspace,
|
|
107
|
-
env: { HOME: homeDir },
|
|
108
|
-
runProcess: (command: string) => {
|
|
109
|
-
spawned.push(command);
|
|
110
|
-
return Promise.resolve(0);
|
|
111
|
-
},
|
|
112
|
-
stderr: { write: (chunk: string) => stderr.push(chunk) },
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
// then
|
|
116
|
-
expect(exitCode).toBe(0);
|
|
117
|
-
expect(spawned).toEqual([]);
|
|
118
|
-
expect(stderr).toEqual([
|
|
119
|
-
"CodeGraph MCP skipped: disabled by OMO SOT config. Set [codex].codegraph.enabled=true to enable it.\n",
|
|
120
|
-
]);
|
|
121
|
-
} finally {
|
|
122
|
-
rmSync(homeDir, { recursive: true, force: true });
|
|
123
|
-
rmSync(workspace, { recursive: true, force: true });
|
|
124
|
-
}
|
|
125
|
-
});
|
|
126
|
-
|
|
127
|
-
it("#given the unavailable facade with held-open stdio and a dead parent #when the watchdog polls #then the placeholder server settles without waiting for stdin EOF", async () => {
|
|
128
|
-
// given
|
|
129
|
-
// win32: the real-timer watchdog + PassThrough.destroy() teardown race leaves
|
|
130
|
-
// the read loop's async iterator pending on Windows, so this held-open-stdin
|
|
131
|
-
// case cannot settle under bun:test (which has no fake timers). The watchdog
|
|
132
|
-
// settle path IS covered deterministically by mcp-stdio-core's fake-timer test
|
|
133
|
-
// (passes on win32) and by real-process QA (task-13-*); production settles via
|
|
134
|
-
// stdin EOF, exercised by the other tests in this file that run on win32.
|
|
135
|
-
if (process.platform === "win32") return;
|
|
136
|
-
// Client stdio is held open and never sees EOF, so the parent-liveness
|
|
137
|
-
// watchdog is the only settle path for the placeholder server.
|
|
138
|
-
const stdin = new PassThrough();
|
|
139
|
-
const stdout = new PassThrough();
|
|
140
|
-
stdout.resume();
|
|
141
|
-
const stderr: string[] = [];
|
|
142
|
-
|
|
143
|
-
try {
|
|
144
|
-
// when
|
|
145
|
-
const exitCode = await runCodegraphServe({
|
|
146
|
-
config: { codegraph: { enabled: false }, sources: [], warnings: [] },
|
|
147
|
-
env: {},
|
|
148
|
-
stdin,
|
|
149
|
-
stdout,
|
|
150
|
-
stderr: { write: (chunk: string) => stderr.push(chunk) },
|
|
151
|
-
parentWatchdog: { pollIntervalMs: 10, probeAlive: () => false },
|
|
152
|
-
});
|
|
153
|
-
|
|
154
|
-
// then
|
|
155
|
-
expect(exitCode).toBe(0);
|
|
156
|
-
expect(stderr).toEqual([
|
|
157
|
-
"CodeGraph MCP skipped: disabled by OMO SOT config. Set [codex].codegraph.enabled=true to enable it.\n",
|
|
158
|
-
]);
|
|
159
|
-
} finally {
|
|
160
|
-
// The held-open streams are never ended by the test; destroy them so the
|
|
161
|
-
// bun test runner's event loop can drain and exit (an undestroyed
|
|
162
|
-
// PassThrough keeps the process alive on win32 and hangs the suite).
|
|
163
|
-
stdin.destroy();
|
|
164
|
-
stdout.destroy();
|
|
165
|
-
}
|
|
166
|
-
});
|
|
167
|
-
});
|
|
168
|
-
|
|
169
|
-
function closedMcpStdio(): { readonly stdin: PassThrough; readonly stdout: PassThrough } {
|
|
170
|
-
const stdin = new PassThrough();
|
|
171
|
-
const stdout = new PassThrough();
|
|
172
|
-
stdout.resume();
|
|
173
|
-
stdin.end();
|
|
174
|
-
return { stdin, stdout };
|
|
175
|
-
}
|