oh-my-codex 0.3.2 → 0.3.3
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/dist/config/__tests__/generator-notify.test.js +81 -90
- package/dist/config/__tests__/generator-notify.test.js.map +1 -1
- package/dist/config/generator.d.ts +14 -1
- package/dist/config/generator.d.ts.map +1 -1
- package/dist/config/generator.js +79 -31
- package/dist/config/generator.js.map +1 -1
- package/package.json +1 -1
|
@@ -4,62 +4,58 @@ import { mkdir, mkdtemp, readFile, rm, writeFile } from 'node:fs/promises';
|
|
|
4
4
|
import { tmpdir } from 'node:os';
|
|
5
5
|
import { join } from 'node:path';
|
|
6
6
|
import { mergeConfig } from '../generator.js';
|
|
7
|
-
describe('config generator
|
|
8
|
-
it('
|
|
7
|
+
describe('config generator', () => {
|
|
8
|
+
it('places top-level keys before [features]', async () => {
|
|
9
9
|
const wd = await mkdtemp(join(tmpdir(), 'omx-config-gen-'));
|
|
10
10
|
try {
|
|
11
11
|
const configPath = join(wd, 'config.toml');
|
|
12
12
|
await mergeConfig(configPath, wd);
|
|
13
13
|
const toml = await readFile(configPath, 'utf-8');
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
// Top-level keys must appear before the first [table] header
|
|
15
|
+
const notifyIdx = toml.indexOf('notify =');
|
|
16
|
+
const reasoningIdx = toml.indexOf('model_reasoning_effort =');
|
|
17
|
+
const devInstrIdx = toml.indexOf('developer_instructions =');
|
|
18
|
+
const featuresIdx = toml.indexOf('[features]');
|
|
19
|
+
assert.ok(notifyIdx >= 0, 'notify not found');
|
|
20
|
+
assert.ok(reasoningIdx >= 0, 'model_reasoning_effort not found');
|
|
21
|
+
assert.ok(devInstrIdx >= 0, 'developer_instructions not found');
|
|
22
|
+
assert.ok(featuresIdx >= 0, '[features] not found');
|
|
23
|
+
assert.ok(notifyIdx < featuresIdx, 'notify must come before [features]');
|
|
24
|
+
assert.ok(reasoningIdx < featuresIdx, 'model_reasoning_effort must come before [features]');
|
|
25
|
+
assert.ok(devInstrIdx < featuresIdx, 'developer_instructions must come before [features]');
|
|
16
26
|
}
|
|
17
27
|
finally {
|
|
18
28
|
await rm(wd, { recursive: true, force: true });
|
|
19
29
|
}
|
|
20
30
|
});
|
|
21
|
-
it('writes notify as
|
|
31
|
+
it('writes notify as a TOML array', async () => {
|
|
22
32
|
const wd = await mkdtemp(join(tmpdir(), 'omx-config-gen-'));
|
|
23
|
-
const prev = process.env.OMX_NOTIFY_FORMAT;
|
|
24
33
|
try {
|
|
25
|
-
process.env.OMX_NOTIFY_FORMAT = 'string';
|
|
26
34
|
const configPath = join(wd, 'config.toml');
|
|
27
35
|
await mergeConfig(configPath, wd);
|
|
28
36
|
const toml = await readFile(configPath, 'utf-8');
|
|
29
|
-
assert.match(toml, /^notify = ".*"$/m);
|
|
30
|
-
assert.doesNotMatch(toml, /^notify = \[/m);
|
|
31
|
-
assert.match(toml, /notify = "node /);
|
|
37
|
+
assert.match(toml, /^notify = \["node", ".*notify-hook\.js"\]$/m);
|
|
32
38
|
}
|
|
33
39
|
finally {
|
|
34
|
-
if (prev === undefined) {
|
|
35
|
-
delete process.env.OMX_NOTIFY_FORMAT;
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
process.env.OMX_NOTIFY_FORMAT = prev;
|
|
39
|
-
}
|
|
40
40
|
await rm(wd, { recursive: true, force: true });
|
|
41
41
|
}
|
|
42
42
|
});
|
|
43
|
-
it('
|
|
44
|
-
const
|
|
45
|
-
const wd = join(base, 'pkg root');
|
|
43
|
+
it('writes model_reasoning_effort and developer_instructions', async () => {
|
|
44
|
+
const wd = await mkdtemp(join(tmpdir(), 'omx-config-gen-'));
|
|
46
45
|
try {
|
|
47
|
-
await mkdir(wd, { recursive: true });
|
|
48
46
|
const configPath = join(wd, 'config.toml');
|
|
49
47
|
await mergeConfig(configPath, wd);
|
|
50
48
|
const toml = await readFile(configPath, 'utf-8');
|
|
51
|
-
|
|
52
|
-
assert.
|
|
53
|
-
assert.match(m[1], /pkg root/);
|
|
54
|
-
assert.match(m[1], /notify-hook\.js$/);
|
|
49
|
+
assert.match(toml, /^model_reasoning_effort = "high"$/m);
|
|
50
|
+
assert.match(toml, /^developer_instructions = "You have oh-my-codex installed/m);
|
|
55
51
|
}
|
|
56
52
|
finally {
|
|
57
|
-
await rm(
|
|
53
|
+
await rm(wd, { recursive: true, force: true });
|
|
58
54
|
}
|
|
59
55
|
});
|
|
60
|
-
it('
|
|
61
|
-
const base = await mkdtemp(join(tmpdir(), 'omx
|
|
62
|
-
const wd = join(base, '
|
|
56
|
+
it('handles paths with spaces in notify array', async () => {
|
|
57
|
+
const base = await mkdtemp(join(tmpdir(), 'omx config gen space-'));
|
|
58
|
+
const wd = join(base, 'pkg root');
|
|
63
59
|
try {
|
|
64
60
|
await mkdir(wd, { recursive: true });
|
|
65
61
|
const configPath = join(wd, 'config.toml');
|
|
@@ -67,103 +63,71 @@ describe('config generator notify', () => {
|
|
|
67
63
|
const toml = await readFile(configPath, 'utf-8');
|
|
68
64
|
const m = toml.match(/^notify = \["node", "(.*)"\]$/m);
|
|
69
65
|
assert.ok(m, 'notify array not found');
|
|
70
|
-
assert.
|
|
66
|
+
assert.match(m[1], /pkg root/);
|
|
67
|
+
assert.match(m[1], /notify-hook\.js$/);
|
|
71
68
|
}
|
|
72
69
|
finally {
|
|
73
70
|
await rm(base, { recursive: true, force: true });
|
|
74
71
|
}
|
|
75
72
|
});
|
|
76
|
-
it('
|
|
77
|
-
const wd = await mkdtemp(join(tmpdir(), 'omx-config-gen-'));
|
|
78
|
-
try {
|
|
79
|
-
const configPath = join(wd, 'config.toml');
|
|
80
|
-
await mergeConfig(configPath, wd);
|
|
81
|
-
const toml = await readFile(configPath, 'utf-8');
|
|
82
|
-
assert.doesNotMatch(toml, /developer_instructions/);
|
|
83
|
-
assert.doesNotMatch(toml, /model_reasoning_effort/);
|
|
84
|
-
}
|
|
85
|
-
finally {
|
|
86
|
-
await rm(wd, { recursive: true, force: true });
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
it('re-runs setup by replacing OMX block cleanly', async () => {
|
|
73
|
+
it('re-runs setup replacing OMX config cleanly', async () => {
|
|
90
74
|
const wd = await mkdtemp(join(tmpdir(), 'omx-config-gen-'));
|
|
91
75
|
try {
|
|
92
76
|
const configPath = join(wd, 'config.toml');
|
|
93
77
|
await mergeConfig(configPath, wd);
|
|
78
|
+
// Simulate user adding content
|
|
94
79
|
let toml = await readFile(configPath, 'utf-8');
|
|
95
80
|
toml += '\n# user tail\n[user.settings]\nname = "kept"\n';
|
|
96
81
|
await writeFile(configPath, toml);
|
|
82
|
+
// Re-run setup
|
|
97
83
|
await mergeConfig(configPath, wd);
|
|
98
84
|
const rerun = await readFile(configPath, 'utf-8');
|
|
85
|
+
// OMX block appears exactly once
|
|
99
86
|
assert.equal((rerun.match(/# oh-my-codex \(OMX\) Configuration/g) ?? []).length, 1);
|
|
100
87
|
assert.equal((rerun.match(/# End oh-my-codex/g) ?? []).length, 1);
|
|
88
|
+
// Features correct
|
|
101
89
|
assert.equal((rerun.match(/^\[features\]$/gm) ?? []).length, 1);
|
|
102
90
|
assert.match(rerun, /^collab = true$/m);
|
|
103
91
|
assert.match(rerun, /^child_agents_md = true$/m);
|
|
92
|
+
// User content preserved
|
|
104
93
|
assert.match(rerun, /^\[user.settings\]$/m);
|
|
105
94
|
assert.match(rerun, /^name = "kept"$/m);
|
|
95
|
+
// Top-level keys present and before [features]
|
|
106
96
|
assert.match(rerun, /^notify = \["node", ".*notify-hook\.js"\]$/m);
|
|
97
|
+
assert.match(rerun, /^model_reasoning_effort = "high"$/m);
|
|
98
|
+
const notifyIdx = rerun.indexOf('notify =');
|
|
99
|
+
const featuresIdx = rerun.indexOf('[features]');
|
|
100
|
+
assert.ok(notifyIdx < featuresIdx, 'notify must come before [features]');
|
|
107
101
|
}
|
|
108
102
|
finally {
|
|
109
103
|
await rm(wd, { recursive: true, force: true });
|
|
110
104
|
}
|
|
111
105
|
});
|
|
112
|
-
it('
|
|
106
|
+
it('preserves existing user top-level config', async () => {
|
|
113
107
|
const wd = await mkdtemp(join(tmpdir(), 'omx-config-gen-'));
|
|
114
108
|
try {
|
|
115
109
|
const configPath = join(wd, 'config.toml');
|
|
116
|
-
const
|
|
117
|
-
'
|
|
118
|
-
'
|
|
119
|
-
'',
|
|
120
|
-
'# ============================================================',
|
|
121
|
-
'# oh-my-codex (OMX) Configuration',
|
|
122
|
-
'# Managed by omx setup - manual edits preserved on next setup',
|
|
123
|
-
'# ============================================================',
|
|
124
|
-
'',
|
|
125
|
-
'notify = ["node", "/tmp/notify-hook.js"]',
|
|
126
|
-
'',
|
|
127
|
-
'[mcp_servers.omx_state]',
|
|
128
|
-
'command = "node"',
|
|
129
|
-
'args = ["/tmp/state-server.js"]',
|
|
110
|
+
const existing = [
|
|
111
|
+
'model = "o3"',
|
|
112
|
+
'approval_policy = "on-failure"',
|
|
130
113
|
'',
|
|
131
|
-
'# ============================================================',
|
|
132
|
-
'# End oh-my-codex',
|
|
133
|
-
'',
|
|
134
|
-
].join('\n');
|
|
135
|
-
await writeFile(configPath, legacy);
|
|
136
|
-
await mergeConfig(configPath, wd);
|
|
137
|
-
const merged = await readFile(configPath, 'utf-8');
|
|
138
|
-
assert.match(merged, /^notify = \["node", ".*notify-hook\.js"\]$/m);
|
|
139
|
-
assert.equal((merged.match(/# oh-my-codex \(OMX\) Configuration/g) ?? []).length, 1);
|
|
140
|
-
}
|
|
141
|
-
finally {
|
|
142
|
-
await rm(wd, { recursive: true, force: true });
|
|
143
|
-
}
|
|
144
|
-
});
|
|
145
|
-
it('merges into existing [features] table without duplicating it', async () => {
|
|
146
|
-
const wd = await mkdtemp(join(tmpdir(), 'omx-config-gen-'));
|
|
147
|
-
try {
|
|
148
|
-
const configPath = join(wd, 'config.toml');
|
|
149
|
-
const original = [
|
|
150
114
|
'[features]',
|
|
151
|
-
'
|
|
152
|
-
'child_agents_md = false',
|
|
153
|
-
'',
|
|
154
|
-
'[user.settings]',
|
|
155
|
-
'name = "kept"',
|
|
115
|
+
'web_search = true',
|
|
156
116
|
'',
|
|
157
117
|
].join('\n');
|
|
158
|
-
await writeFile(configPath,
|
|
118
|
+
await writeFile(configPath, existing);
|
|
159
119
|
await mergeConfig(configPath, wd);
|
|
160
|
-
const
|
|
161
|
-
|
|
162
|
-
assert.match(
|
|
163
|
-
assert.match(
|
|
164
|
-
|
|
165
|
-
assert.match(
|
|
166
|
-
assert.match(
|
|
120
|
+
const toml = await readFile(configPath, 'utf-8');
|
|
121
|
+
// User's existing top-level keys preserved
|
|
122
|
+
assert.match(toml, /^model = "o3"$/m);
|
|
123
|
+
assert.match(toml, /^approval_policy = "on-failure"$/m);
|
|
124
|
+
// OMX keys added
|
|
125
|
+
assert.match(toml, /^notify = \[/m);
|
|
126
|
+
assert.match(toml, /^model_reasoning_effort = "high"$/m);
|
|
127
|
+
// User's feature flag preserved
|
|
128
|
+
assert.match(toml, /^web_search = true$/m);
|
|
129
|
+
// OMX feature flags added
|
|
130
|
+
assert.match(toml, /^collab = true$/m);
|
|
167
131
|
}
|
|
168
132
|
finally {
|
|
169
133
|
await rm(wd, { recursive: true, force: true });
|
|
@@ -203,5 +167,32 @@ describe('config generator notify', () => {
|
|
|
203
167
|
await rm(wd, { recursive: true, force: true });
|
|
204
168
|
}
|
|
205
169
|
});
|
|
170
|
+
it('merges into existing [features] table without duplicating it', async () => {
|
|
171
|
+
const wd = await mkdtemp(join(tmpdir(), 'omx-config-gen-'));
|
|
172
|
+
try {
|
|
173
|
+
const configPath = join(wd, 'config.toml');
|
|
174
|
+
const original = [
|
|
175
|
+
'[features]',
|
|
176
|
+
'custom_user_flag = false',
|
|
177
|
+
'child_agents_md = false',
|
|
178
|
+
'',
|
|
179
|
+
'[user.settings]',
|
|
180
|
+
'name = "kept"',
|
|
181
|
+
'',
|
|
182
|
+
].join('\n');
|
|
183
|
+
await writeFile(configPath, original);
|
|
184
|
+
await mergeConfig(configPath, wd);
|
|
185
|
+
const merged = await readFile(configPath, 'utf-8');
|
|
186
|
+
assert.equal((merged.match(/^\[features\]$/gm) ?? []).length, 1);
|
|
187
|
+
assert.match(merged, /^custom_user_flag = false$/m);
|
|
188
|
+
assert.match(merged, /^collab = true$/m);
|
|
189
|
+
assert.match(merged, /^child_agents_md = true$/m);
|
|
190
|
+
assert.match(merged, /^\[user.settings\]$/m);
|
|
191
|
+
assert.match(merged, /^name = "kept"$/m);
|
|
192
|
+
}
|
|
193
|
+
finally {
|
|
194
|
+
await rm(wd, { recursive: true, force: true });
|
|
195
|
+
}
|
|
196
|
+
});
|
|
206
197
|
});
|
|
207
198
|
//# sourceMappingURL=generator-notify.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator-notify.test.js","sourceRoot":"","sources":["../../../src/config/__tests__/generator-notify.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC3E,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"generator-notify.test.js","sourceRoot":"","sources":["../../../src/config/__tests__/generator-notify.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC3E,OAAO,EAAE,MAAM,EAAE,M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AAC,MAAM,EAAE,CAAC,CAAC,CAAC;YACjE,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,6BAA6B,CAAC,CAAC;YACpD,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;YACzC,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,2BAA2B,CAAC,CAAC;YAClD,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAC;YAC7C,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;QAC3C,CAAC;gBAAS,CAAC;YACT,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QACjD,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1,13 +1,26 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Config.toml generator/merger for oh-my-codex
|
|
3
3
|
* Merges OMX MCP server entries and feature flags into existing config.toml
|
|
4
|
+
*
|
|
5
|
+
* TOML structure reminder: bare key=value pairs after a [table] header belong
|
|
6
|
+
* to that table. Top-level (root-table) keys MUST appear before the first
|
|
7
|
+
* [table] header. This generator therefore splits its output into:
|
|
8
|
+
* 1. Top-level keys (notify, model_reasoning_effort, developer_instructions)
|
|
9
|
+
* 2. [features] flags
|
|
10
|
+
* 3. [table] sections (mcp_servers, tui)
|
|
4
11
|
*/
|
|
5
12
|
interface MergeOptions {
|
|
6
13
|
verbose?: boolean;
|
|
7
14
|
}
|
|
8
15
|
/**
|
|
9
16
|
* Merge OMX config into existing config.toml
|
|
10
|
-
* Preserves existing user settings, appends OMX block if not present
|
|
17
|
+
* Preserves existing user settings, appends OMX block if not present.
|
|
18
|
+
*
|
|
19
|
+
* Layout:
|
|
20
|
+
* 1. OMX top-level keys (notify, model_reasoning_effort, developer_instructions)
|
|
21
|
+
* 2. [features] with collab + child_agents_md
|
|
22
|
+
* 3. … user sections …
|
|
23
|
+
* 4. OMX [table] sections (mcp_servers, tui)
|
|
11
24
|
*/
|
|
12
25
|
export declare function mergeConfig(configPath: string, pkgRoot: string, options?: MergeOptions): Promise<void>;
|
|
13
26
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../src/config/generator.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../src/config/generator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAMH,UAAU,YAAY;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAqND;;;;;;;;;GASG;AACH,wBAAsB,WAAW,CAC/B,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,YAAiB,GACzB,OAAO,CAAC,IAAI,CAAC,CAiCf"}
|
package/dist/config/generator.js
CHANGED
|
@@ -1,10 +1,64 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Config.toml generator/merger for oh-my-codex
|
|
3
3
|
* Merges OMX MCP server entries and feature flags into existing config.toml
|
|
4
|
+
*
|
|
5
|
+
* TOML structure reminder: bare key=value pairs after a [table] header belong
|
|
6
|
+
* to that table. Top-level (root-table) keys MUST appear before the first
|
|
7
|
+
* [table] header. This generator therefore splits its output into:
|
|
8
|
+
* 1. Top-level keys (notify, model_reasoning_effort, developer_instructions)
|
|
9
|
+
* 2. [features] flags
|
|
10
|
+
* 3. [table] sections (mcp_servers, tui)
|
|
4
11
|
*/
|
|
5
12
|
import { readFile, writeFile } from 'fs/promises';
|
|
6
13
|
import { existsSync } from 'fs';
|
|
7
14
|
import { join } from 'path';
|
|
15
|
+
// ---------------------------------------------------------------------------
|
|
16
|
+
// Top-level OMX keys (must live before any [table] header)
|
|
17
|
+
// ---------------------------------------------------------------------------
|
|
18
|
+
/** Keys we own at the TOML root level. Used for upsert + strip. */
|
|
19
|
+
const OMX_TOP_LEVEL_KEYS = [
|
|
20
|
+
'notify',
|
|
21
|
+
'model_reasoning_effort',
|
|
22
|
+
'developer_instructions',
|
|
23
|
+
];
|
|
24
|
+
function getOmxTopLevelLines(pkgRoot) {
|
|
25
|
+
const notifyHookPath = join(pkgRoot, 'scripts', 'notify-hook.js');
|
|
26
|
+
const escapedPath = notifyHookPath
|
|
27
|
+
.replace(/\\/g, '\\\\')
|
|
28
|
+
.replace(/"/g, '\\"');
|
|
29
|
+
return [
|
|
30
|
+
'# oh-my-codex top-level settings (must be before any [table])',
|
|
31
|
+
`notify = ["node", "${escapedPath}"]`,
|
|
32
|
+
'model_reasoning_effort = "high"',
|
|
33
|
+
`developer_instructions = "You have oh-my-codex installed. Use /prompts:architect, /prompts:executor, /prompts:planner for specialized agent roles. Workflow skills via $name: $ralph, $autopilot, $plan. AGENTS.md is your orchestration brain."`,
|
|
34
|
+
];
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Remove any existing OMX-owned top-level keys so we can re-insert them
|
|
38
|
+
* cleanly. Also removes the comment line that precedes them.
|
|
39
|
+
*/
|
|
40
|
+
function stripOmxTopLevelKeys(config) {
|
|
41
|
+
let lines = config.split(/\r?\n/);
|
|
42
|
+
// Remove the OMX top-level comment line
|
|
43
|
+
lines = lines.filter((l) => l.trim() !== '# oh-my-codex top-level settings (must be before any [table])');
|
|
44
|
+
// Remove lines matching OMX-owned keys (only in root scope, i.e. before
|
|
45
|
+
// the first [table] header).
|
|
46
|
+
const firstTable = lines.findIndex((l) => /^\s*\[/.test(l));
|
|
47
|
+
const boundary = firstTable >= 0 ? firstTable : lines.length;
|
|
48
|
+
const result = [];
|
|
49
|
+
for (let i = 0; i < lines.length; i++) {
|
|
50
|
+
if (i < boundary) {
|
|
51
|
+
const isOmxKey = OMX_TOP_LEVEL_KEYS.some((k) => new RegExp(`^\\s*${k}\\s*=`).test(lines[i]));
|
|
52
|
+
if (isOmxKey)
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
result.push(lines[i]);
|
|
56
|
+
}
|
|
57
|
+
return result.join('\n');
|
|
58
|
+
}
|
|
59
|
+
// ---------------------------------------------------------------------------
|
|
60
|
+
// [features] upsert
|
|
61
|
+
// ---------------------------------------------------------------------------
|
|
8
62
|
function upsertFeatureFlags(config) {
|
|
9
63
|
const lines = config.split(/\r?\n/);
|
|
10
64
|
const featuresStart = lines.findIndex((line) => /^\s*\[features\]\s*$/.test(line));
|
|
@@ -53,27 +107,9 @@ function upsertFeatureFlags(config) {
|
|
|
53
107
|
}
|
|
54
108
|
return lines.join('\n');
|
|
55
109
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
return forced;
|
|
60
|
-
// Default to array to match Codex schema (notify expects a sequence).
|
|
61
|
-
// String format is available with OMX_NOTIFY_FORMAT=string for legacy environments.
|
|
62
|
-
return 'array';
|
|
63
|
-
}
|
|
64
|
-
function getNotifyConfigLine(notifyHookPath) {
|
|
65
|
-
const format = selectNotifyFormat();
|
|
66
|
-
const escapedNotifyHookPath = notifyHookPath
|
|
67
|
-
.replace(/\\/g, '\\\\')
|
|
68
|
-
.replace(/"/g, '\\"');
|
|
69
|
-
const notifyCommand = `node "${notifyHookPath}"`
|
|
70
|
-
.replace(/\\/g, '\\\\')
|
|
71
|
-
.replace(/"/g, '\\"');
|
|
72
|
-
if (format === 'array') {
|
|
73
|
-
return `notify = ["node", "${escapedNotifyHookPath}"]`;
|
|
74
|
-
}
|
|
75
|
-
return `notify = "${notifyCommand}"`;
|
|
76
|
-
}
|
|
110
|
+
// ---------------------------------------------------------------------------
|
|
111
|
+
// OMX [table] sections block (appended at end of file)
|
|
112
|
+
// ---------------------------------------------------------------------------
|
|
77
113
|
function stripExistingOmxBlocks(config) {
|
|
78
114
|
const marker = 'oh-my-codex (OMX) Configuration';
|
|
79
115
|
const endMarker = '# End oh-my-codex';
|
|
@@ -107,14 +143,14 @@ function stripExistingOmxBlocks(config) {
|
|
|
107
143
|
return { cleaned, removed };
|
|
108
144
|
}
|
|
109
145
|
/**
|
|
110
|
-
* OMX
|
|
146
|
+
* OMX table-section block (MCP servers, TUI).
|
|
147
|
+
* Contains ONLY [table] sections — no bare keys.
|
|
111
148
|
*/
|
|
112
|
-
function
|
|
149
|
+
function getOmxTablesBlock(pkgRoot) {
|
|
113
150
|
const stateServerPath = join(pkgRoot, 'dist', 'mcp', 'state-server.js');
|
|
114
151
|
const memoryServerPath = join(pkgRoot, 'dist', 'mcp', 'memory-server.js');
|
|
115
152
|
const codeIntelServerPath = join(pkgRoot, 'dist', 'mcp', 'code-intel-server.js');
|
|
116
153
|
const traceServerPath = join(pkgRoot, 'dist', 'mcp', 'trace-server.js');
|
|
117
|
-
const notifyHookPath = join(pkgRoot, 'scripts', 'notify-hook.js');
|
|
118
154
|
return [
|
|
119
155
|
'',
|
|
120
156
|
'# ============================================================',
|
|
@@ -122,9 +158,6 @@ function getOmxConfigBlock(pkgRoot) {
|
|
|
122
158
|
'# Managed by omx setup - manual edits preserved on next setup',
|
|
123
159
|
'# ============================================================',
|
|
124
160
|
'',
|
|
125
|
-
'# Notification hook - fires after each agent turn',
|
|
126
|
-
getNotifyConfigLine(notifyHookPath),
|
|
127
|
-
'',
|
|
128
161
|
'# OMX State Management MCP Server',
|
|
129
162
|
'[mcp_servers.omx_state]',
|
|
130
163
|
'command = "node"',
|
|
@@ -162,16 +195,25 @@ function getOmxConfigBlock(pkgRoot) {
|
|
|
162
195
|
'',
|
|
163
196
|
].join('\n');
|
|
164
197
|
}
|
|
198
|
+
// ---------------------------------------------------------------------------
|
|
199
|
+
// Public API
|
|
200
|
+
// ---------------------------------------------------------------------------
|
|
165
201
|
/**
|
|
166
202
|
* Merge OMX config into existing config.toml
|
|
167
|
-
* Preserves existing user settings, appends OMX block if not present
|
|
203
|
+
* Preserves existing user settings, appends OMX block if not present.
|
|
204
|
+
*
|
|
205
|
+
* Layout:
|
|
206
|
+
* 1. OMX top-level keys (notify, model_reasoning_effort, developer_instructions)
|
|
207
|
+
* 2. [features] with collab + child_agents_md
|
|
208
|
+
* 3. … user sections …
|
|
209
|
+
* 4. OMX [table] sections (mcp_servers, tui)
|
|
168
210
|
*/
|
|
169
211
|
export async function mergeConfig(configPath, pkgRoot, options = {}) {
|
|
170
212
|
let existing = '';
|
|
171
213
|
if (existsSync(configPath)) {
|
|
172
214
|
existing = await readFile(configPath, 'utf-8');
|
|
173
215
|
}
|
|
174
|
-
//
|
|
216
|
+
// Strip old OMX table-section block
|
|
175
217
|
if (existing.includes('oh-my-codex (OMX) Configuration')) {
|
|
176
218
|
const stripped = stripExistingOmxBlocks(existing);
|
|
177
219
|
existing = stripped.cleaned;
|
|
@@ -179,9 +221,15 @@ export async function mergeConfig(configPath, pkgRoot, options = {}) {
|
|
|
179
221
|
console.log(' Updating existing OMX config block.');
|
|
180
222
|
}
|
|
181
223
|
}
|
|
224
|
+
// Strip any stale OMX top-level keys (from previous runs or wrong positions)
|
|
225
|
+
existing = stripOmxTopLevelKeys(existing);
|
|
226
|
+
// Upsert [features] flags
|
|
182
227
|
existing = upsertFeatureFlags(existing);
|
|
183
|
-
|
|
184
|
-
|
|
228
|
+
// Build final config:
|
|
229
|
+
// top-level keys → existing content (with [features]) → OMX tables block
|
|
230
|
+
const topLines = getOmxTopLevelLines(pkgRoot);
|
|
231
|
+
const tablesBlock = getOmxTablesBlock(pkgRoot);
|
|
232
|
+
const finalConfig = topLines.join('\n') + '\n\n' + existing.trimEnd() + '\n' + tablesBlock;
|
|
185
233
|
await writeFile(configPath, finalConfig);
|
|
186
234
|
if (options.verbose) {
|
|
187
235
|
console.log(` Written to ${configPath}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../src/config/generator.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../src/config/generator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,E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