oh-my-opencode 4.7.0 → 4.7.1

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 (23) hide show
  1. package/dist/cli/index.js +5334 -5150
  2. package/dist/index.js +3447 -3334
  3. package/package.json +13 -13
  4. package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +13 -0
  5. package/packages/omo-codex/plugin/components/lsp/src/cli.ts +6 -2
  6. package/packages/omo-codex/plugin/components/lsp/src/codex-hook-cli.ts +13 -2
  7. package/packages/omo-codex/plugin/components/lsp/src/codex-hook.ts +30 -79
  8. package/packages/omo-codex/plugin/components/lsp/src/lsp-session-state.ts +116 -0
  9. package/packages/omo-codex/plugin/components/lsp/src/mutated-file-paths.ts +88 -0
  10. package/packages/omo-codex/plugin/components/lsp/test/codex-hook-unavailable.test.ts +206 -0
  11. package/packages/omo-codex/plugin/components/lsp/test/package-smoke.test.ts +5 -3
  12. package/packages/omo-codex/plugin/components/rules/src/codex-hook-options.ts +1 -0
  13. package/packages/omo-codex/plugin/components/rules/src/rules/finder.ts +15 -2
  14. package/packages/omo-codex/plugin/components/rules/src/rules-engine-factory.ts +4 -1
  15. package/packages/omo-codex/plugin/components/rules/test/windows-git-bash-bundled-rule.test.ts +28 -5
  16. package/packages/omo-codex/plugin/hooks/hooks.json +13 -2
  17. package/packages/omo-codex/plugin/scripts/sync-hook-status-messages.mjs +1 -8
  18. package/packages/omo-codex/plugin/test/aggregate.test.mjs +16 -0
  19. package/packages/omo-codex/plugin/test/hook-status-message.test.mjs +6 -28
  20. package/packages/omo-codex/plugin/test/sync-hook-status-messages.test.mjs +26 -1
  21. package/packages/omo-codex/scripts/install/permissions.mjs +11 -0
  22. package/packages/omo-codex/scripts/install-config-autonomous-features.test.mjs +83 -0
  23. package/packages/omo-codex/scripts/install-local.test.mjs +3 -1
@@ -0,0 +1,83 @@
1
+ import assert from "node:assert/strict";
2
+ import { 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 { updateCodexConfig } from "./install/config.mjs";
8
+
9
+ const AUTONOMOUS_FEATURES = ["multi_agent", "child_agents_md", "unified_exec", "goals"];
10
+
11
+ test("#given autonomous permissions requested #when script installer updates config #then enables Codex autonomy feature flags", async () => {
12
+ // given
13
+ const root = await mkdtemp(join(tmpdir(), "omo-codex-script-config-autonomous-features-"));
14
+ const configPath = join(root, "config.toml");
15
+ await writeFile(
16
+ configPath,
17
+ [
18
+ 'network_access = "disabled"',
19
+ "",
20
+ "[features]",
21
+ "multi_agent = false",
22
+ "child_agents_md = false",
23
+ "unified_exec = false",
24
+ "goals = false",
25
+ "",
26
+ ].join("\n"),
27
+ );
28
+
29
+ // when
30
+ await updateCodexConfig({
31
+ configPath,
32
+ repoRoot: "/repo/packages/omo-codex",
33
+ marketplaceName: "debug",
34
+ marketplaceSource: { sourceType: "local", source: "/repo/packages/omo-codex" },
35
+ pluginNames: ["omo"],
36
+ autonomousPermissions: true,
37
+ });
38
+
39
+ // then
40
+ const content = await readFile(configPath, "utf8");
41
+ assert.match(content, /network_access = "enabled"/);
42
+ for (const featureName of AUTONOMOUS_FEATURES) {
43
+ assert.match(content, new RegExp(`${featureName} = true`));
44
+ }
45
+ });
46
+
47
+ test("#given autonomous permissions disabled #when script installer updates config #then preserves autonomy feature opt-outs", async () => {
48
+ // given
49
+ const root = await mkdtemp(join(tmpdir(), "omo-codex-script-config-autonomous-features-disabled-"));
50
+ const configPath = join(root, "config.toml");
51
+ await writeFile(
52
+ configPath,
53
+ [
54
+ 'network_access = "disabled"',
55
+ "",
56
+ "[features]",
57
+ "multi_agent = false",
58
+ "child_agents_md = false",
59
+ "unified_exec = false",
60
+ "goals = false",
61
+ "",
62
+ ].join("\n"),
63
+ );
64
+
65
+ // when
66
+ await updateCodexConfig({
67
+ configPath,
68
+ repoRoot: "/repo/packages/omo-codex",
69
+ marketplaceName: "debug",
70
+ marketplaceSource: { sourceType: "local", source: "/repo/packages/omo-codex" },
71
+ pluginNames: ["omo"],
72
+ autonomousPermissions: false,
73
+ });
74
+
75
+ // then
76
+ const content = await readFile(configPath, "utf8");
77
+ assert.match(content, /network_access = "disabled"/);
78
+ for (const featureName of AUTONOMOUS_FEATURES) {
79
+ assert.match(content, new RegExp(`${featureName} = false`));
80
+ }
81
+ assert.match(content, /plugins = true/);
82
+ assert.match(content, /plugin_hooks = true/);
83
+ });
@@ -219,7 +219,9 @@ test("#given local marketplace #when installing #then copies versioned plugins a
219
219
  );
220
220
 
221
221
  const config = await readFile(join(codexHome, "config.toml"), "utf8");
222
- assert.match(config, /\[features\]\n(?:plugin_hooks = true\n)?plugins = true/);
222
+ assert.match(config, /\[features\]/);
223
+ assert.match(config, /plugins = true/);
224
+ assert.match(config, /plugin_hooks = true/);
223
225
  assert.match(config, /\[marketplaces\.debug-marketplace\]/);
224
226
  assert.match(config, /source_type = "local"/);
225
227
  assert.match(config, /\[plugins\."alpha@debug-marketplace"\]\nenabled = true/);