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,179 +0,0 @@
|
|
|
1
|
-
import assert from "node:assert/strict";
|
|
2
|
-
import { mkdir, mkdtemp, readFile, writeFile } from "node:fs/promises";
|
|
3
|
-
import { tmpdir } from "node:os";
|
|
4
|
-
import { join } from "node:path";
|
|
5
|
-
import test from "node:test";
|
|
6
|
-
|
|
7
|
-
import { migrateOmoSotConfig } from "../scripts/migrate-omo-sot.mjs";
|
|
8
|
-
|
|
9
|
-
test("#given no OMO SOT #when seeding #then creates a parseable scaffold once", async () => {
|
|
10
|
-
const home = await mkdtemp(join(tmpdir(), "omo-sot-seed-"));
|
|
11
|
-
|
|
12
|
-
const first = await migrateOmoSotConfig({ env: { HOME: home }, seed: true });
|
|
13
|
-
const before = await readFile(join(home, ".omo", "config.jsonc"), "utf8");
|
|
14
|
-
const second = await migrateOmoSotConfig({ env: { HOME: home }, seed: true });
|
|
15
|
-
const after = await readFile(join(home, ".omo", "config.jsonc"), "utf8");
|
|
16
|
-
|
|
17
|
-
assert.equal(first.seeded, true);
|
|
18
|
-
assert.equal(second.seeded, false);
|
|
19
|
-
assert.equal(after, before);
|
|
20
|
-
assert.equal(parseJsonc(after)["[codex]"].codegraph.enabled, undefined);
|
|
21
|
-
assert.equal(parseJsonc(after).codegraph.enabled, undefined);
|
|
22
|
-
assert.match(after, /"enabled"/);
|
|
23
|
-
assert.match(after, /"\[opencode\]"/);
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
test("#given no OMO SOT and legacy CodeGraph env #when seeding #then creates scaffold with Codex scoped migration", async () => {
|
|
27
|
-
const home = await mkdtemp(join(tmpdir(), "omo-sot-seed-env-"));
|
|
28
|
-
|
|
29
|
-
await migrateOmoSotConfig({
|
|
30
|
-
env: {
|
|
31
|
-
HOME: home,
|
|
32
|
-
CODEX_CODEGRAPH_AUTO_PROVISION: "yes",
|
|
33
|
-
CODEX_CODEGRAPH_ENABLED: "1",
|
|
34
|
-
OMO_CODEGRAPH_INSTALL_DIR: "/tmp/codegraph",
|
|
35
|
-
OMO_CODEGRAPH_TELEMETRY: "false",
|
|
36
|
-
},
|
|
37
|
-
seed: true,
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
const content = await readFile(join(home, ".omo", "config.jsonc"), "utf8");
|
|
41
|
-
const parsed = parseJsonc(content);
|
|
42
|
-
assert.equal(parsed.codegraph.enabled, undefined);
|
|
43
|
-
assert.deepEqual(parsed["[codex]"].codegraph, {
|
|
44
|
-
auto_provision: true,
|
|
45
|
-
enabled: true,
|
|
46
|
-
install_dir: "/tmp/codegraph",
|
|
47
|
-
telemetry: false,
|
|
48
|
-
});
|
|
49
|
-
assert.match(content, /Shared OMO settings/);
|
|
50
|
-
assert.match(content, /"\[opencode\]"/);
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
test("#given legacy CodeGraph env #when migrating #then adds Codex scoped codegraph values", async () => {
|
|
54
|
-
const home = await mkdtemp(join(tmpdir(), "omo-sot-env-"));
|
|
55
|
-
await mkdir(join(home, ".omo"), { recursive: true });
|
|
56
|
-
await writeFile(join(home, ".omo", "config.jsonc"), "{\n}\n");
|
|
57
|
-
|
|
58
|
-
const result = await migrateOmoSotConfig({
|
|
59
|
-
env: {
|
|
60
|
-
HOME: home,
|
|
61
|
-
CODEX_CODEGRAPH_AUTO_PROVISION: "0",
|
|
62
|
-
CODEX_CODEGRAPH_ENABLED: "false",
|
|
63
|
-
OMO_CODEGRAPH_INSTALL_DIR: "/tmp/codegraph",
|
|
64
|
-
OMO_CODEGRAPH_TELEMETRY: "1",
|
|
65
|
-
},
|
|
66
|
-
seed: true,
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
const parsed = parseJsonc(await readFile(join(home, ".omo", "config.jsonc"), "utf8"));
|
|
70
|
-
assert.equal(result.changed, true);
|
|
71
|
-
assert.deepEqual(parsed["[codex]"].codegraph, {
|
|
72
|
-
auto_provision: false,
|
|
73
|
-
enabled: false,
|
|
74
|
-
install_dir: "/tmp/codegraph",
|
|
75
|
-
telemetry: true,
|
|
76
|
-
});
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
test("#given existing user SOT #when migrating env #then preserves user values and comments", async () => {
|
|
80
|
-
const home = await mkdtemp(join(tmpdir(), "omo-sot-preserve-"));
|
|
81
|
-
const configPath = join(home, ".omo", "config.jsonc");
|
|
82
|
-
await mkdir(join(home, ".omo"), { recursive: true });
|
|
83
|
-
await writeFile(
|
|
84
|
-
configPath,
|
|
85
|
-
[
|
|
86
|
-
"{",
|
|
87
|
-
" // keep my debounce",
|
|
88
|
-
' "codegraph": {',
|
|
89
|
-
" \"watch_debounce_ms\": 4242",
|
|
90
|
-
" }",
|
|
91
|
-
"}",
|
|
92
|
-
"",
|
|
93
|
-
].join("\n"),
|
|
94
|
-
);
|
|
95
|
-
|
|
96
|
-
await migrateOmoSotConfig({ env: { HOME: home, CODEX_CODEGRAPH_ENABLED: "0" }, seed: true });
|
|
97
|
-
|
|
98
|
-
const content = await readFile(configPath, "utf8");
|
|
99
|
-
const parsed = parseJsonc(content);
|
|
100
|
-
assert.match(content, /keep my debounce/);
|
|
101
|
-
assert.equal(parsed.codegraph.watch_debounce_ms, 4242);
|
|
102
|
-
assert.equal(parsed["[codex]"].codegraph.enabled, false);
|
|
103
|
-
});
|
|
104
|
-
|
|
105
|
-
test("#given existing Codex scoped SOT #when migrating env #then user value wins", async () => {
|
|
106
|
-
const home = await mkdtemp(join(tmpdir(), "omo-sot-user-wins-"));
|
|
107
|
-
const configPath = join(home, ".omo", "config.jsonc");
|
|
108
|
-
await mkdir(join(home, ".omo"), { recursive: true });
|
|
109
|
-
await writeFile(configPath, '{\n "[codex]": { "codegraph": { "enabled": true } }\n}\n');
|
|
110
|
-
|
|
111
|
-
await migrateOmoSotConfig({ env: { HOME: home, CODEX_CODEGRAPH_ENABLED: "0" }, seed: true });
|
|
112
|
-
|
|
113
|
-
const parsed = parseJsonc(await readFile(configPath, "utf8"));
|
|
114
|
-
assert.equal(parsed["[codex]"].codegraph.enabled, true);
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
test("#given opencode scoped SOT #when migrating env #then opencode block is not changed", async () => {
|
|
118
|
-
const home = await mkdtemp(join(tmpdir(), "omo-sot-opencode-"));
|
|
119
|
-
const configPath = join(home, ".omo", "config.jsonc");
|
|
120
|
-
await mkdir(join(home, ".omo"), { recursive: true });
|
|
121
|
-
await writeFile(configPath, '{\n "[opencode]": { "codegraph": { "enabled": true } }\n}\n');
|
|
122
|
-
|
|
123
|
-
await migrateOmoSotConfig({ env: { HOME: home, CODEX_CODEGRAPH_ENABLED: "0" }, seed: true });
|
|
124
|
-
|
|
125
|
-
const parsed = parseJsonc(await readFile(configPath, "utf8"));
|
|
126
|
-
assert.equal(parsed["[opencode]"].codegraph.enabled, true);
|
|
127
|
-
assert.equal(parsed["[codex]"].codegraph.enabled, false);
|
|
128
|
-
});
|
|
129
|
-
|
|
130
|
-
test("#given malformed existing SOT #when migrating #then leaves it untouched and warns", async () => {
|
|
131
|
-
const home = await mkdtemp(join(tmpdir(), "omo-sot-malformed-"));
|
|
132
|
-
const configPath = join(home, ".omo", "config.jsonc");
|
|
133
|
-
await mkdir(join(home, ".omo"), { recursive: true });
|
|
134
|
-
await writeFile(configPath, '{ "codegraph":');
|
|
135
|
-
|
|
136
|
-
const result = await migrateOmoSotConfig({ env: { HOME: home, CODEX_CODEGRAPH_ENABLED: "0" }, seed: true });
|
|
137
|
-
|
|
138
|
-
assert.equal(await readFile(configPath, "utf8"), '{ "codegraph":');
|
|
139
|
-
assert.equal(result.changed, false);
|
|
140
|
-
assert.equal(result.seeded, false);
|
|
141
|
-
assert.match(result.warnings.join("\n"), /Could not parse/);
|
|
142
|
-
});
|
|
143
|
-
|
|
144
|
-
function parseJsonc(content) {
|
|
145
|
-
return JSON.parse(stripTrailingCommas(stripJsonComments(content)));
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
function stripJsonComments(content) {
|
|
149
|
-
let result = "";
|
|
150
|
-
let inString = false;
|
|
151
|
-
let escape = false;
|
|
152
|
-
for (let index = 0; index < content.length; index += 1) {
|
|
153
|
-
const char = content[index];
|
|
154
|
-
const next = content[index + 1];
|
|
155
|
-
if (inString) {
|
|
156
|
-
result += char;
|
|
157
|
-
if (escape) escape = false;
|
|
158
|
-
else if (char === "\\") escape = true;
|
|
159
|
-
else if (char === "\"") inString = false;
|
|
160
|
-
continue;
|
|
161
|
-
}
|
|
162
|
-
if (char === "\"") {
|
|
163
|
-
inString = true;
|
|
164
|
-
result += char;
|
|
165
|
-
continue;
|
|
166
|
-
}
|
|
167
|
-
if (char === "/" && next === "/") {
|
|
168
|
-
while (index < content.length && content[index] !== "\n") index += 1;
|
|
169
|
-
result += "\n";
|
|
170
|
-
continue;
|
|
171
|
-
}
|
|
172
|
-
result += char;
|
|
173
|
-
}
|
|
174
|
-
return result;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
function stripTrailingCommas(content) {
|
|
178
|
-
return content.replace(/,\s*([}\]])/g, "$1");
|
|
179
|
-
}
|