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
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import { mkdir, mkdtemp, rm, 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 {
|
|
8
|
+
canonicalUltraworkDirectiveRelativePath,
|
|
9
|
+
resolveCanonicalUltraworkDirectivePath,
|
|
10
|
+
} from "../scripts/canonical-ultrawork-directive.mjs";
|
|
11
|
+
|
|
12
|
+
test("#given a repo checkout #when resolving the ultrawork directive #then the checkout copy wins over a plugin-internal copy", async () => {
|
|
13
|
+
// given
|
|
14
|
+
const root = await mkdtemp(join(tmpdir(), "omo-canonical-prompt-"));
|
|
15
|
+
const pluginRoot = join(root, "plugin");
|
|
16
|
+
const repoRoot = join(root, "checkout");
|
|
17
|
+
const checkoutPrompt = join(repoRoot, canonicalUltraworkDirectiveRelativePath);
|
|
18
|
+
const pluginPrompt = join(pluginRoot, canonicalUltraworkDirectiveRelativePath);
|
|
19
|
+
await mkdir(join(checkoutPrompt, ".."), { recursive: true });
|
|
20
|
+
await mkdir(join(pluginPrompt, ".."), { recursive: true });
|
|
21
|
+
await writeFile(checkoutPrompt, "checkout");
|
|
22
|
+
await writeFile(pluginPrompt, "staged");
|
|
23
|
+
|
|
24
|
+
try {
|
|
25
|
+
// when
|
|
26
|
+
const resolved = resolveCanonicalUltraworkDirectivePath(pluginRoot, repoRoot);
|
|
27
|
+
|
|
28
|
+
// then
|
|
29
|
+
assert.equal(resolved, checkoutPrompt);
|
|
30
|
+
} finally {
|
|
31
|
+
await rm(root, { recursive: true, force: true });
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
test("#given the flattened plugin cache #when the repo-relative directive is absent #then the plugin-internal copy is resolved", async () => {
|
|
36
|
+
// given
|
|
37
|
+
const root = await mkdtemp(join(tmpdir(), "omo-canonical-prompt-"));
|
|
38
|
+
const pluginRoot = join(root, "plugins", "cache", "sisyphuslabs", "omo", "0.1.0");
|
|
39
|
+
const repoRoot = join(pluginRoot, "..", "..", "..");
|
|
40
|
+
const pluginPrompt = join(pluginRoot, canonicalUltraworkDirectiveRelativePath);
|
|
41
|
+
await mkdir(join(pluginPrompt, ".."), { recursive: true });
|
|
42
|
+
await writeFile(pluginPrompt, "staged");
|
|
43
|
+
|
|
44
|
+
try {
|
|
45
|
+
// when
|
|
46
|
+
const resolved = resolveCanonicalUltraworkDirectivePath(pluginRoot, repoRoot);
|
|
47
|
+
|
|
48
|
+
// then
|
|
49
|
+
assert.equal(resolved, pluginPrompt);
|
|
50
|
+
} finally {
|
|
51
|
+
await rm(root, { recursive: true, force: true });
|
|
52
|
+
}
|
|
53
|
+
});
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import assert from "node:assert/strict";
|
|
2
2
|
import {
|
|
3
|
-
chmodSync,
|
|
4
3
|
cpSync,
|
|
5
4
|
existsSync,
|
|
6
5
|
mkdirSync,
|
|
@@ -31,7 +30,6 @@ const HOOK_EVENTS_BY_COMPONENT = {
|
|
|
31
30
|
ultrawork: "user-prompt-submit",
|
|
32
31
|
"ulw-loop": "pre-tool-use",
|
|
33
32
|
};
|
|
34
|
-
const MCP_ONLY_COMPONENTS = new Set(["codegraph"]);
|
|
35
33
|
const HOOK_CLI_TEST_TIMEOUT_MS = 45_000;
|
|
36
34
|
const DAEMON_EXIT_TIMEOUT_MS = 5_000;
|
|
37
35
|
|
|
@@ -84,38 +82,6 @@ test("#given built workspace component CLIs #when dynamically imported with hook
|
|
|
84
82
|
assert.deepEqual(failures, []);
|
|
85
83
|
});
|
|
86
84
|
|
|
87
|
-
test("#given built MCP-only CodeGraph entries #when executed with a fake binary #then each entry is self-contained", () => {
|
|
88
|
-
const tempRoot = mkdtempSync(join(tmpdir(), "omo-codex-mcp-wrapper-"));
|
|
89
|
-
try {
|
|
90
|
-
const fakeBinaryPath = join(tempRoot, "codegraph-fake.cjs");
|
|
91
|
-
const invocationLogPath = join(tempRoot, "invocations.log");
|
|
92
|
-
writeFileSync(
|
|
93
|
-
fakeBinaryPath,
|
|
94
|
-
[
|
|
95
|
-
"#!/usr/bin/env node",
|
|
96
|
-
"const fs = require('node:fs');",
|
|
97
|
-
"fs.appendFileSync(process.env.CODEGRAPH_FAKE_LOG, JSON.stringify(process.argv.slice(2)) + '\\n');",
|
|
98
|
-
"",
|
|
99
|
-
].join("\n"),
|
|
100
|
-
);
|
|
101
|
-
chmodSync(fakeBinaryPath, 0o755);
|
|
102
|
-
|
|
103
|
-
const serveResult = runCodegraphMcpEntry("serve.js", tempRoot, fakeBinaryPath, invocationLogPath);
|
|
104
|
-
const cliResult = runCodegraphMcpEntry("cli.js", tempRoot, fakeBinaryPath, invocationLogPath);
|
|
105
|
-
|
|
106
|
-
assert.equal(serveResult.status, 0, `serve.js stderr: ${serveResult.stderr}`);
|
|
107
|
-
assert.equal(cliResult.status, 0, `cli.js stderr: ${cliResult.stderr}`);
|
|
108
|
-
assert.equal(serveResult.stderr, "");
|
|
109
|
-
assert.equal(cliResult.stderr, "");
|
|
110
|
-
assert.deepEqual(readFileSync(invocationLogPath, "utf8").trim().split("\n"), [
|
|
111
|
-
'["serve","--mcp"]',
|
|
112
|
-
'["serve","--mcp"]',
|
|
113
|
-
]);
|
|
114
|
-
} finally {
|
|
115
|
-
rmSync(tempRoot, { recursive: true, force: true });
|
|
116
|
-
}
|
|
117
|
-
});
|
|
118
|
-
|
|
119
85
|
test("#given representative component hook payloads #when executed through dist CLI contract #then current hook behavior is preserved", async () => {
|
|
120
86
|
const tempRoot = mkdtempSync(join(tmpdir(), "omo-codex-cli-contract-"));
|
|
121
87
|
try {
|
|
@@ -264,7 +230,6 @@ test("#given aggregate hook manifest #when command hooks are inspected #then com
|
|
|
264
230
|
// when
|
|
265
231
|
const missingContracts = components.filter(
|
|
266
232
|
(component) =>
|
|
267
|
-
!MCP_ONLY_COMPONENTS.has(component) &&
|
|
268
233
|
!commands.some((command) =>
|
|
269
234
|
command.startsWith(`node "\${PLUGIN_ROOT}/components/${component}/dist/cli.js" hook `),
|
|
270
235
|
),
|
|
@@ -279,7 +244,6 @@ async function workspaceComponents() {
|
|
|
279
244
|
return packageJson.workspaces
|
|
280
245
|
.filter((workspace) => workspace.startsWith("components/"))
|
|
281
246
|
.map((workspace) => workspace.slice("components/".length))
|
|
282
|
-
.filter((component) => !MCP_ONLY_COMPONENTS.has(component))
|
|
283
247
|
.sort();
|
|
284
248
|
}
|
|
285
249
|
|
|
@@ -306,20 +270,6 @@ function componentCliPath(component) {
|
|
|
306
270
|
return join(root, "components", component, "dist", "cli.js");
|
|
307
271
|
}
|
|
308
272
|
|
|
309
|
-
function runCodegraphMcpEntry(entryName, tempRoot, fakeBinaryPath, invocationLogPath) {
|
|
310
|
-
return spawnSync(process.execPath, [join(root, "components", "codegraph", "dist", entryName)], {
|
|
311
|
-
cwd: root,
|
|
312
|
-
encoding: "utf8",
|
|
313
|
-
env: {
|
|
314
|
-
...process.env,
|
|
315
|
-
CODEGRAPH_FAKE_LOG: invocationLogPath,
|
|
316
|
-
HOME: tempRoot,
|
|
317
|
-
OMO_CODEGRAPH_BIN: fakeBinaryPath,
|
|
318
|
-
},
|
|
319
|
-
timeout: HOOK_CLI_TEST_TIMEOUT_MS,
|
|
320
|
-
});
|
|
321
|
-
}
|
|
322
|
-
|
|
323
273
|
function runHookCli(component, event, payload, tempRoot, extraEnv = {}) {
|
|
324
274
|
return runHookCliAsync(component, event, `${JSON.stringify(payload)}\n`, tempRoot, extraEnv);
|
|
325
275
|
}
|
|
@@ -25,7 +25,6 @@ const AGGREGATE_EXPECTED_LABELS = new Map([
|
|
|
25
25
|
["hooks/hooks.json:PreToolUse:1:0", "Enforcing Unlimited Goal Budget"],
|
|
26
26
|
["hooks/hooks.json:PostToolUse:0:0", "Checking Comments"],
|
|
27
27
|
["hooks/hooks.json:PostToolUse:0:1", "Checking LSP Diagnostics"],
|
|
28
|
-
["hooks/hooks.json:PostToolUse:0:2", "Checking CodeGraph Init Guidance"],
|
|
29
28
|
["hooks/hooks.json:PostToolUse:1:0", "Matching Project Rules"],
|
|
30
29
|
["hooks/hooks.json:PostCompact:0:0", "Resetting Git Bash MCP Reminder"],
|
|
31
30
|
["hooks/hooks.json:PostCompact:1:0", "Resetting Project Rule Cache"],
|
|
@@ -14,11 +14,9 @@ test("#given aggregate MCP config #when inspected #then registers research MCPs
|
|
|
14
14
|
const serverNames = Object.keys(mcp.mcpServers).sort();
|
|
15
15
|
|
|
16
16
|
// then
|
|
17
|
-
assert.deepEqual(serverNames, ["
|
|
17
|
+
assert.deepEqual(serverNames, ["context7", "git_bash", "grep_app", "lsp"]);
|
|
18
18
|
assert.equal(mcp.mcpServers.grep_app.url, "https://mcp.grep.app");
|
|
19
19
|
assert.equal(mcp.mcpServers.context7.url, "https://mcp.context7.com/mcp");
|
|
20
20
|
assert.equal(Object.hasOwn(mcp.mcpServers, "ast_grep"), false);
|
|
21
|
-
assert.deepEqual(mcp.mcpServers.codegraph.args, ["components/codegraph/dist/serve.js"]);
|
|
22
|
-
assert.equal(mcp.mcpServers.codegraph.required, false);
|
|
23
21
|
assert.equal(mcp.mcpServers.lsp.startup_timeout_sec, 10);
|
|
24
22
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import assert from "node:assert/strict";
|
|
2
2
|
import { realpathSync } from "node:fs";
|
|
3
3
|
import { mkdir, readdir, readFile, rename, stat, writeFile } from "node:fs/promises";
|
|
4
|
-
import { basename, join, relative, sep } from "node:path";
|
|
4
|
+
import { basename, dirname, join, relative, sep } from "node:path";
|
|
5
5
|
import test from "node:test";
|
|
6
6
|
|
|
7
7
|
import { installCachedPlugin } from "./install-dist/install-local.mjs";
|
|
@@ -166,6 +166,32 @@ test("#given packaged root CLI runtimes #when caching omo plugin #then root dist
|
|
|
166
166
|
assert.equal(await readFile(join(installed.path, "dist", "cli-node", "index.js"), "utf8"), "console.log('omo node')\n");
|
|
167
167
|
});
|
|
168
168
|
|
|
169
|
+
test("#given packaged prompts-core directive #when caching omo plugin #then the ultrawork directive is materialized into the plugin cache", async () => {
|
|
170
|
+
// given
|
|
171
|
+
const root = await makeTempDir();
|
|
172
|
+
const repoRoot = join(root, "repo");
|
|
173
|
+
const codexHome = join(root, "codex-home");
|
|
174
|
+
const sourceRoot = join(repoRoot, "packages", "omo-codex", "plugin");
|
|
175
|
+
const directiveRelativePath = join("packages", "prompts-core", "prompts", "ultrawork", "codex.md");
|
|
176
|
+
await mkdir(sourceRoot, { recursive: true });
|
|
177
|
+
await mkdir(dirname(join(repoRoot, directiveRelativePath)), { recursive: true });
|
|
178
|
+
await writeFile(join(sourceRoot, "package.json"), JSON.stringify({ name: "@scope/omo", version: "0.1.0" }));
|
|
179
|
+
await writeFile(join(repoRoot, directiveRelativePath), "# ultrawork directive\n");
|
|
180
|
+
|
|
181
|
+
// when
|
|
182
|
+
const installed = await installCachedPlugin({
|
|
183
|
+
codexHome,
|
|
184
|
+
marketplaceName: "sisyphuslabs",
|
|
185
|
+
name: "omo",
|
|
186
|
+
sourcePath: sourceRoot,
|
|
187
|
+
version: "0.1.0",
|
|
188
|
+
runCommand: async () => {},
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
// then
|
|
192
|
+
assert.equal(await readFile(join(installed.path, directiveRelativePath), "utf8"), "# ultrawork directive\n");
|
|
193
|
+
});
|
|
194
|
+
|
|
169
195
|
test("#given existing cache #when npm install fails #then previous active cache is preserved", async () => {
|
|
170
196
|
// given
|
|
171
197
|
const root = await makeTempDir();
|
|
@@ -89,26 +89,3 @@ test("#given non-windows platforms #when updating config #then disables git_bash
|
|
|
89
89
|
assert.match(content, /\[plugins\."omo@sisyphuslabs"\.mcp_servers\.git_bash\][\s\S]*?enabled = false/);
|
|
90
90
|
}
|
|
91
91
|
});
|
|
92
|
-
|
|
93
|
-
test("#given CodeGraph MCP disabled by installer policy #when updating config #then disables only codegraph plugin mcp policy", async () => {
|
|
94
|
-
// given
|
|
95
|
-
const root = await mkdtemp(join(tmpdir(), "omo-codex-config-codegraph-disabled-"));
|
|
96
|
-
const configPath = join(root, "config.toml");
|
|
97
|
-
|
|
98
|
-
// when
|
|
99
|
-
await updateCodexConfig({
|
|
100
|
-
configPath,
|
|
101
|
-
repoRoot: "/repo/packages/omo-codex",
|
|
102
|
-
marketplaceName: "sisyphuslabs",
|
|
103
|
-
marketplaceSource: { sourceType: "local", source: "/repo/packages/omo-codex/cache/sisyphuslabs" },
|
|
104
|
-
pluginNames: ["omo"],
|
|
105
|
-
platform: "darwin",
|
|
106
|
-
codegraphMcpEnabled: false,
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
// then
|
|
110
|
-
const content = await readFile(configPath, "utf8");
|
|
111
|
-
assert.match(content, /\[plugins\."omo@sisyphuslabs"\][\s\S]*?enabled = true/);
|
|
112
|
-
assert.match(content, /\[plugins\."omo@sisyphuslabs"\.mcp_servers\.codegraph\][\s\S]*?enabled = false/);
|
|
113
|
-
assert.match(content, /\[plugins\."omo@sisyphuslabs"\.mcp_servers\.context7\][\s\S]*?enabled = true/);
|
|
114
|
-
});
|