oh-my-codex 0.21.46 → 0.21.47
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/Cargo.lock +6 -6
- package/Cargo.toml +1 -1
- package/README.md +1 -1
- package/dist/config/quality-gates.d.ts +5 -3
- package/dist/config/quality-gates.d.ts.map +1 -1
- package/dist/config/quality-gates.js +4 -2
- package/dist/config/quality-gates.js.map +1 -1
- package/dist/hooks/__tests__/skill-guidance-contract.test.js +43 -0
- package/dist/hooks/__tests__/skill-guidance-contract.test.js.map +1 -1
- package/dist/team/__tests__/tmux-session.test.js +127 -3
- package/dist/team/__tests__/tmux-session.test.js.map +1 -1
- package/dist/team/tmux-session.d.ts +2 -1
- package/dist/team/tmux-session.d.ts.map +1 -1
- package/dist/team/tmux-session.js +42 -13
- package/dist/team/tmux-session.js.map +1 -1
- package/package.json +1 -1
- package/plugins/oh-my-codex/.codex-plugin/plugin.json +2 -2
- package/plugins/oh-my-codex/skills/doctor/SKILL.md +49 -30
- package/skills/doctor/SKILL.md +49 -30
package/Cargo.lock
CHANGED
|
@@ -32,7 +32,7 @@ checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98"
|
|
|
32
32
|
|
|
33
33
|
[[package]]
|
|
34
34
|
name = "omx-api"
|
|
35
|
-
version = "0.21.
|
|
35
|
+
version = "0.21.47"
|
|
36
36
|
dependencies = [
|
|
37
37
|
"serde",
|
|
38
38
|
"serde_json",
|
|
@@ -40,14 +40,14 @@ dependencies = [
|
|
|
40
40
|
|
|
41
41
|
[[package]]
|
|
42
42
|
name = "omx-explore-harness"
|
|
43
|
-
version = "0.21.
|
|
43
|
+
version = "0.21.47"
|
|
44
44
|
dependencies = [
|
|
45
45
|
"libc",
|
|
46
46
|
]
|
|
47
47
|
|
|
48
48
|
[[package]]
|
|
49
49
|
name = "omx-mux"
|
|
50
|
-
version = "0.21.
|
|
50
|
+
version = "0.21.47"
|
|
51
51
|
dependencies = [
|
|
52
52
|
"serde",
|
|
53
53
|
"serde_json",
|
|
@@ -55,7 +55,7 @@ dependencies = [
|
|
|
55
55
|
|
|
56
56
|
[[package]]
|
|
57
57
|
name = "omx-runtime"
|
|
58
|
-
version = "0.21.
|
|
58
|
+
version = "0.21.47"
|
|
59
59
|
dependencies = [
|
|
60
60
|
"fs2",
|
|
61
61
|
"libc",
|
|
@@ -67,7 +67,7 @@ dependencies = [
|
|
|
67
67
|
|
|
68
68
|
[[package]]
|
|
69
69
|
name = "omx-runtime-core"
|
|
70
|
-
version = "0.21.
|
|
70
|
+
version = "0.21.47"
|
|
71
71
|
dependencies = [
|
|
72
72
|
"fs2",
|
|
73
73
|
"serde",
|
|
@@ -76,7 +76,7 @@ dependencies = [
|
|
|
76
76
|
|
|
77
77
|
[[package]]
|
|
78
78
|
name = "omx-sparkshell"
|
|
79
|
-
version = "0.21.
|
|
79
|
+
version = "0.21.47"
|
|
80
80
|
dependencies = [
|
|
81
81
|
"omx-mux",
|
|
82
82
|
]
|
package/Cargo.toml
CHANGED
package/README.md
CHANGED
|
@@ -104,7 +104,7 @@ Choose the setup scope deliberately:
|
|
|
104
104
|
`--force` is independent and transient: it is neither recorded nor replayed, and does not override an explicit merge policy. Setup atomically commits explicit set or clear intent only after all setup work succeeds, including when active-session or plugin-symlink safeguards skip the current `AGENTS.md` write, so the next refresh can honor the requested policy. This does not make merge the default or revive the rejected #2892 merge-by-default approach. Older OMX versions safely ignore the field, but may erase it when rewriting their known setup preferences.
|
|
105
105
|
|
|
106
106
|
|
|
107
|
-
**Codex plugin install note:** this repo also ships an official Codex plugin layout at `plugins/oh-my-codex` with marketplace metadata in `.agents/plugins/marketplace.json`. That plugin bundles the mirrored skill surface plus plugin-scoped companion metadata for official Codex lifecycle hooks, optional MCP compatibility servers, and apps. It is still **not** a replacement for the global `oh-my-codex` CLI plus scoped setup: plugin-scoped hooks launch the installed `omx` CLI,
|
|
107
|
+
**Codex plugin install note:** this repo also ships an official Codex plugin layout at `plugins/oh-my-codex` with marketplace metadata in `.agents/plugins/marketplace.json`. That plugin bundles the mirrored skill surface plus plugin-scoped companion metadata for official Codex lifecycle hooks, optional MCP compatibility servers, and apps. It is still **not** a replacement for the global `oh-my-codex` CLI plus scoped setup: plugin-scoped hooks launch the installed `omx` CLI, and both setup modes normally install setup-owned native agent TOMLs for `agent_type` routing. In either mode, `omx setup --disable-hooks` disables OMX-owned hook registrations and related enablement, then returns before normal asset installation, configuration, `AGENTS.md`, HUD, and state setup. Legacy mode also installs prompt and skill copies. Plugin mode uses plugin discovery for bundled skills, archives/removes legacy OMX-managed prompt copies, and removes stale generated/non-installable native-agent files. Plugin setup without `--force` preserves user-authored or ambiguous role files, except that disabling Team (`--disable-team` or persisted `teamMode: "disabled"`) backs up and removes `team-executor.toml` regardless of ownership. See [Plugin bundle SSOT](docs/plugin-bundle-ssot.md) for these ownership rules. Plugin mode still needs a persistent scope `AGENTS.md` (`~/.codex/AGENTS.md` for user setup or `./AGENTS.md` for project setup) as the durable orchestration guidance layer; session-scoped AGENTS files only compose that durable guidance with runtime overlays and are not a replacement.
|
|
108
108
|
|
|
109
109
|
Then work normally inside Codex:
|
|
110
110
|
|
|
@@ -12,13 +12,15 @@
|
|
|
12
12
|
* }
|
|
13
13
|
* }
|
|
14
14
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
15
|
+
* This module discovers configuration; it does not run reviewers or approve a stage.
|
|
16
|
+
* Owning skills define gate order and completion guidance. Current Ralplan runtime
|
|
17
|
+
* skips unavailable gates, including blocking ones, despite its skill's fail-closed
|
|
18
|
+
* guidance; see docs/reference/omx-config-quality-gates.md for that mismatch.
|
|
17
19
|
*/
|
|
18
20
|
/**
|
|
19
21
|
* Workflow stage where quality gates apply
|
|
20
22
|
* - 'deep-interview': deep-interview final-spec stage
|
|
21
|
-
* - 'ralplan': ralplan Architect→Critic review (
|
|
23
|
+
* - 'ralplan': ralplan Architect→Critic consensus review (not lightweight $plan)
|
|
22
24
|
* - 'code-review': code-review stage
|
|
23
25
|
*/
|
|
24
26
|
export type QualityGateStage = 'deep-interview' | 'ralplan' | 'code-review';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quality-gates.d.ts","sourceRoot":"","sources":["../../src/config/quality-gates.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"quality-gates.d.ts","sourceRoot":"","sources":["../../src/config/quality-gates.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAOH;;;;;GAKG;AACH,MAAM,MAAM,gBAAgB,GAAG,gBAAgB,GAAG,SAAS,GAAG,aAAa,CAAC;AAE5E;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,iBAAiB,CAAC;AAE1D;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,8BAA8B;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,oDAAoD;IACpD,IAAI,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;IAC/B,uCAAuC;IACvC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,UAAU,GAAG,UAAU,CAAC;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,4DAA4D;IAC5D,gBAAgB,CAAC,EAAE,gBAAgB,EAAE,CAAC;IACtC,kEAAkE;IAClE,SAAS,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC/B,8CAA8C;IAC9C,aAAa,CAAC,EAAE,gBAAgB,EAAE,CAAC;CACpC;AAoBD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAuBnF;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,cAAc,GAAG,IAAI,CAsCxE;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,iBAAiB,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,kBAAkB,GAAG,IAAI,CAmD1G;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,cAAc,EAAE,CAYpH;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,iBAAiB,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG;IACjF,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,MAAM,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,gBAAgB,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC9F,CAoDA"}
|
|
@@ -12,8 +12,10 @@
|
|
|
12
12
|
* }
|
|
13
13
|
* }
|
|
14
14
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
15
|
+
* This module discovers configuration; it does not run reviewers or approve a stage.
|
|
16
|
+
* Owning skills define gate order and completion guidance. Current Ralplan runtime
|
|
17
|
+
* skips unavailable gates, including blocking ones, despite its skill's fail-closed
|
|
18
|
+
* guidance; see docs/reference/omx-config-quality-gates.md for that mismatch.
|
|
17
19
|
*/
|
|
18
20
|
import { existsSync, readFileSync } from 'fs';
|
|
19
21
|
import { join } from 'path';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quality-gates.js","sourceRoot":"","sources":["../../src/config/quality-gates.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"quality-gates.js","sourceRoot":"","sources":["../../src/config/quality-gates.ts"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CAAC;yBAAM,CAAC;wBACN,KAAK,GAAG,iBAAiB,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,KAAK,IAAI,eAAe,CAAC;oBAChE,CAAC;gBACH,CAAC;qBAAM,CAAC;oBACN,KAAK,GAAG,mEAAmE,CAAC;gBAC9E,CAAC;gBAED,MAAM,CAAC,IAAI,CAAC;oBACV,KAAK;oBACL,UAAU,EAAE,CAAC;oBACb,KAAK,EAAE,QAAQ;oBACf,KAAK;iBACN,CAAC,CAAC;YACL,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;AAC3B,CAAC"}
|
|
@@ -8,6 +8,42 @@ describe('execution-heavy skill guidance contract', () => {
|
|
|
8
8
|
assertContractSurface(contract);
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
|
+
it('doctor recovery preserves owned boundaries rather than deleting mixed roots', () => {
|
|
12
|
+
for (const path of ['skills/doctor/SKILL.md', 'plugins/oh-my-codex/skills/doctor/SKILL.md']) {
|
|
13
|
+
const content = loadSurface(path);
|
|
14
|
+
const commands = [...content.matchAll(/```(?:bash|text)\n([\s\S]*?)```/g)]
|
|
15
|
+
.map((match) => match[1]).join('\n');
|
|
16
|
+
assert.doesNotMatch(commands, /\brm\s+-rf\b|\bfind\b[^\n]*-exec\s+rm|WebFetch\(/);
|
|
17
|
+
assert.match(content, /exact target, ownership evidence, current content\/identity, active consumers, preserved dependencies/);
|
|
18
|
+
assert.match(content, /Current setup-owned native TOMLs.*expected in both plugin and legacy setup modes/);
|
|
19
|
+
assert.match(content, /omx setup --scope user --plugin --mcp compat --enable-team --merge-agents --dry-run/);
|
|
20
|
+
assert.match(content, /omx setup --scope project --plugin --mcp compat --enable-team --merge-agents --dry-run/);
|
|
21
|
+
assert.match(content, /user scope uses `\$CODEX_DIR\/agents\/`, while project scope uses `<project>\/.codex\/agents\/`/);
|
|
22
|
+
assert.match(content, /a missing persistent AGENTS.md in plugin mode.*`--merge-agents` cannot create it/);
|
|
23
|
+
assert.match(content, /omx setup --scope user --plugin --mcp compat --enable-team --no-merge-agents --dry-run/);
|
|
24
|
+
assert.match(content, /omx setup --scope project --plugin --mcp compat --enable-team --no-merge-agents --dry-run/);
|
|
25
|
+
assert.match(content, /Record Doctor's resolved setup scope, install mode, and MCP mode/);
|
|
26
|
+
assert.match(content, /replace `--plugin` with `--legacy`.*replace `--mcp compat` with `--mcp none`/);
|
|
27
|
+
assert.match(content, /Carry the same explicit install-mode, MCP-mode, and Team-mode selectors through merge, creation, policy restoration, and hook restoration/);
|
|
28
|
+
assert.match(content, /record the prior matching-scope `mergeAgents` policy/);
|
|
29
|
+
assert.match(content, /After successful AGENTS repair, restore the recorded policy/);
|
|
30
|
+
assert.match(content, /`--merge-agents` for `true`, `--no-merge-agents` for `false`, or `--clear-merge-agents-policy` if it was absent/);
|
|
31
|
+
assert.match(content, /Record the prior Team mode/);
|
|
32
|
+
assert.match(content, /replace `--enable-team` with `--disable-team`/);
|
|
33
|
+
assert.match(content, /For a symlink.*setup skips both merge and defaults/);
|
|
34
|
+
assert.match(content, /Update the authorized target through its owning source/);
|
|
35
|
+
assert.match(content, /restore intentionally disabled hooks after the AGENTS write and policy restoration/);
|
|
36
|
+
assert.match(content, /--disable-hooks`.*returns before the AGENTS phase/);
|
|
37
|
+
assert.match(content, /temporary re-enablement/);
|
|
38
|
+
assert.match(content, /omx setup --scope user --plugin --mcp compat --enable-team --disable-hooks --dry-run/);
|
|
39
|
+
assert.match(content, /omx setup --scope project --plugin --mcp compat --enable-team --disable-hooks --dry-run/);
|
|
40
|
+
assert.match(content, /Keep active or uncertain entries/);
|
|
41
|
+
assert.match(content, /`omx doctor --dry-run --force` is an ownership-check preview, not a repair-eligibility preview/);
|
|
42
|
+
assert.match(content, /Doctor may recover a native-hook claim journal before that check, even with `--dry-run`/);
|
|
43
|
+
assert.match(content, /Recovery can restore a canonical file, remove a claim file, and clear the journal/);
|
|
44
|
+
assert.doesNotMatch(content, /--dry-run --force` previews those repairs/);
|
|
45
|
+
}
|
|
46
|
+
});
|
|
11
47
|
it('ultraqa requires adversarial dynamic e2e coverage and structured reporting', () => {
|
|
12
48
|
const rootSkill = loadSurface('skills/ultraqa/SKILL.md');
|
|
13
49
|
const pluginSkill = loadSurface('plugins/oh-my-codex/skills/ultraqa/SKILL.md');
|
|
@@ -70,6 +106,13 @@ describe('execution-heavy skill guidance contract', () => {
|
|
|
70
106
|
assert.match('Classify harness setup failures separately: record it as harness debris, fix the harness, and rerun the scenario before declaring a product defect.', harnessDebris);
|
|
71
107
|
assert.doesNotMatch('Harness debris noted.', harnessDebris);
|
|
72
108
|
});
|
|
109
|
+
for (const path of ['docs/reference/omx-config-quality-gates.md', 'src/config/quality-gates.ts']) {
|
|
110
|
+
it(`${path} keeps Ralplan consensus separate from lightweight Plan`, () => {
|
|
111
|
+
const content = loadSurface(path).replace(/`/g, '');
|
|
112
|
+
assert.match(content, /Lightweight \$plan modes do not run this stage|not lightweight \$plan/i);
|
|
113
|
+
assert.doesNotMatch(content, /also (?:used by )?\$plan/i);
|
|
114
|
+
});
|
|
115
|
+
}
|
|
73
116
|
it('ultrawork is a sunset stub pointing to team', () => {
|
|
74
117
|
const rootSkill = loadSurface('skills/ultrawork/SKILL.md');
|
|
75
118
|
assert.match(rootSkill, /was removed/i);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skill-guidance-contract.test.js","sourceRoot":"","sources":["../../../src/hooks/__tests__/skill-guidance-contract.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAEvF,QAAQ,CAAC,yCAAyC,EAAE,GAAG,EAAE;IACvD,KAAK,MAAM,QAA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AAC;QACF,MAAM,CAAC,YAAY,CACjB,gFAAgF,EAChF,eAAe,CAChB,CAAC;QAEF,MAAM,UAAU,GAAG,WAAW,CAAC,wBAAwB,CAAC,CAAC;QACzD,MAAM,CAAC,KAAK,CACV,6GAA6G,EAC7G,UAAU,CACX,CAAC;QACF,MAAM,CAAC,YAAY,CACjB,gFAAgF,EAChF,UAAU,CACX,CAAC;QAEF,MAAM,YAAY,GAAG,WAAW,CAAC,8CAA8C,CAAC,CAAC;QACjF,MAAM,CAAC,KAAK,CACV,iIAAiI,EACjI,YAAY,CACb,CAAC;QACF,MAAM,CAAC,YAAY,CACjB,oGAAoG,EACpG,YAAY,CACb,CAAC;QAEF,MAAM,aAAa,GAAG,WAAW,CAAC,4CAA4C,CAAC,CAAC;QAChF,MAAM,CAAC,KAAK,CACV,qJAAqJ,EACrJ,aAAa,CACd,CAAC;QACF,MAAM,CAAC,YAAY,CAAC,uBAAuB,EAAE,aAAa,CAAC,CAAC;IAC9D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,6CAA6C,EAAE,GAAG,EAAE;QACrD,MAAM,SAAS,GAAG,WAAW,CAAC,2BAA2B,CAAC,CAAC;QAE3D,MAAM,CAAC,KAAK,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;QACxC,MAAM,CAAC,KAAK,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"skill-guidance-contract.test.js","sourceRoot":"","sources":["../../../src/hooks/__tests__/skill-guidance-contract.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAEvF,QAAQ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';
|
|
8
8
|
import { dirname, join } from 'path';
|
|
9
9
|
import { tmpdir } from 'os';
|
|
10
|
-
import { buildClientAttachedReconcileHookName, assertTeamWorkerCliBinaryAvailable, buildWorkerProcessLaunchSpec, buildReconcileHudResizeArgs, buildRegisterClientAttachedReconcileArgs, buildRegisterResizeHookArgs, buildResizeHookName, buildResizeHookTarget, buildScheduleDelayedHudResizeArgs, buildUnregisterClientAttachedReconcileArgs, buildUnregisterResizeHookArgs, buildWorkerStartupCommand, trustWorkerMiseConfigIfAvailable, writeWorkerStartupScriptCommand, shouldSourceTeamWorkerShellRc, buildHudPaneTarget, chooseTeamLeaderPaneId, createTeamSession, CreateTeamSessionPartialError, enableMouseScrolling, isMsysOrGitBash, isNativeWindows, isTmuxAvailable, isWorkerPaneOpen, restoreStandaloneHudPane, finalizeRestoredHudCleanupDebtSync, reconcileRestoredHudCleanupDebtSync, translatePathForMsys, isWsl2, isWorkerAlive, killWorker, getWorkerPanePid, killWorkerByPaneId, killWorkerByPaneIdAsync, teardownWorkerPanes, listTeamSessions, destroyTeamSession, queryDetachedTeamSession, requestDetachedTeamSessionDestroy, resolveTeamWorkerCli, resolveTeamWorkerLaunchMode, resolveWorkerCliForSend, resolveTeamWorkerCliPlan, buildWorkerSubmitPlan, sanitizeTeamName, shouldAttemptAdaptiveRetry, sendToWorker, sendToWorkerStdin, sleepFractionalSeconds, translateWorkerLaunchArgsForCli, waitForWorkerReady, waitForWorkerReadyAsync, paneIsBootstrapping, parseSplitWindowPaneId, bindSplitWindowReceiptFormat, classifyWorkerStartupInjectSafety, checkWorkerStartupInjectSafety, dismissTrustPromptIfPresent, evaluateStartupDirectTriggerSafetyCapture, classifyCodexBypassMdmIncompatibility, mitigateCopyModeUnderlineArtifacts, listPaneIds, } from '../tmux-session.js';
|
|
10
|
+
import { buildClientAttachedReconcileHookName, assertTeamWorkerCliBinaryAvailable, buildWorkerProcessLaunchSpec, buildReconcileHudResizeArgs, buildRegisterClientAttachedReconcileArgs, buildRegisterResizeHookArgs, buildResizeHookName, buildResizeHookTarget, buildScheduleDelayedHudResizeArgs, buildUnregisterClientAttachedReconcileArgs, buildUnregisterResizeHookArgs, buildWorkerStartupCommand, trustWorkerMiseConfigIfAvailable, writeWorkerStartupScriptCommand, shouldSourceTeamWorkerShellRc, buildHudPaneTarget, chooseTeamLeaderPaneId, createTeamSession, CreateTeamSessionPartialError, enableMouseScrolling, isMsysOrGitBash, isNativeWindows, isTmuxAvailable, isWorkerPaneOpen, restoreStandaloneHudPane, finalizeRestoredHudCleanupDebtSync, reconcileRestoredHudCleanupDebtSync, translatePathForMsys, isWsl2, isWorkerAlive, killWorker, getWorkerPanePid, killWorkerByPaneId, killWorkerByPaneIdAsync, teardownWorkerPanes, listTeamSessions, destroyTeamSession, queryDetachedTeamSession, requestDetachedTeamSessionDestroy, resolveTeamWorkerCli, resolveTeamWorkerLaunchMode, resolveWorkerCliForSend, resolveTeamWorkerCliPlan, buildWorkerSubmitPlan, sanitizeTeamName, shouldAttemptAdaptiveRetry, sendToWorker, sendToWorkerStdin, sleepFractionalSeconds, translateWorkerLaunchArgsForCli, waitForWorkerReady, waitForWorkerReadyAsync, paneIsBootstrapping, parseSplitWindowPaneId, bindSplitReceiptToPaneCommand, bindSplitWindowReceiptFormat, classifyWorkerStartupInjectSafety, checkWorkerStartupInjectSafety, dismissTrustPromptIfPresent, evaluateStartupDirectTriggerSafetyCapture, classifyCodexBypassMdmIncompatibility, mitigateCopyModeUnderlineArtifacts, listPaneIds, } from '../tmux-session.js';
|
|
11
11
|
import { HUD_RESIZE_RECONCILE_DELAY_SECONDS, HUD_TMUX_TEAM_HEIGHT_LINES } from '../../hud/constants.js';
|
|
12
12
|
import * as tmuxSessionModule from '../tmux-session.js';
|
|
13
13
|
import { OMX_ENTRY_PATH_ENV, OMX_STARTUP_CWD_ENV } from '../../utils/paths.js';
|
|
@@ -2759,8 +2759,8 @@ describe('buildWorkerStartupCommand', () => {
|
|
|
2759
2759
|
process.env.OMX_BYPASS_DEFAULT_SYSTEM_PROMPT = '0';
|
|
2760
2760
|
try {
|
|
2761
2761
|
const cmd = withMockedExistsSync((candidate) => candidate === '/opt/custom/fish', () => buildWorkerStartupCommand('alpha', 1, [], process.cwd()));
|
|
2762
|
-
assert.match(cmd,
|
|
2763
|
-
assert.doesNotMatch(cmd,
|
|
2762
|
+
assert.match(cmd, /\/bin\/sh\b/, 'must launch workers through /bin/sh when no supported shells exist');
|
|
2763
|
+
assert.doesNotMatch(cmd, /\/bin\/sh -lc\b/);
|
|
2764
2764
|
assert.doesNotMatch(cmd, /\.zshrc|\.bashrc/, 'must not source zsh/bash rc files for /bin/sh fallback');
|
|
2765
2765
|
}
|
|
2766
2766
|
finally {
|
|
@@ -2774,6 +2774,81 @@ describe('buildWorkerStartupCommand', () => {
|
|
|
2774
2774
|
delete process.env.OMX_BYPASS_DEFAULT_SYSTEM_PROMPT;
|
|
2775
2775
|
}
|
|
2776
2776
|
});
|
|
2777
|
+
it('embeds receipt in PowerShell script before encoding (when on native Windows) or appends to POSIX', () => {
|
|
2778
|
+
const receipt = 'omx_source_test_receipt';
|
|
2779
|
+
const prevShell = process.env.SHELL;
|
|
2780
|
+
const prevBypass = process.env.OMX_BYPASS_DEFAULT_SYSTEM_PROMPT;
|
|
2781
|
+
process.env.OMX_BYPASS_DEFAULT_SYSTEM_PROMPT = '0';
|
|
2782
|
+
try {
|
|
2783
|
+
// buildWorkerStartupCommand should either:
|
|
2784
|
+
// - On Windows: embed receipt in the PowerShell script before encoding
|
|
2785
|
+
// - On POSIX: append receipt as shell comment
|
|
2786
|
+
const cmdWithReceipt = buildWorkerStartupCommand('alpha', 1, [], process.cwd(), {}, undefined, undefined, undefined, receipt);
|
|
2787
|
+
if (cmdWithReceipt.includes('-EncodedCommand')) {
|
|
2788
|
+
// Windows PowerShell case: Verify receipt is in the encoded command
|
|
2789
|
+
const match = cmdWithReceipt.match(/-EncodedCommand\s+([A-Za-z0-9+/=]+)/);
|
|
2790
|
+
assert(match, 'Should have encoded command with receipt');
|
|
2791
|
+
const decoded = Buffer.from(match[1], 'base64').toString('utf16le');
|
|
2792
|
+
assert(decoded.includes(`# ${receipt}`), 'Decoded script should contain receipt');
|
|
2793
|
+
// Verify the invocation line (exec ...) is not inside the comment
|
|
2794
|
+
const lines = decoded.split(';');
|
|
2795
|
+
const commentLineIndex = lines.findIndex((line) => line.includes(`# ${receipt}`));
|
|
2796
|
+
assert(commentLineIndex >= 0, 'Should find receipt comment line');
|
|
2797
|
+
const invocationLineIndex = lines.findIndex((line) => line.includes('&'));
|
|
2798
|
+
assert(invocationLineIndex >= 0, 'Should find invocation line with &');
|
|
2799
|
+
assert(invocationLineIndex < commentLineIndex || lines[commentLineIndex]?.includes('&') === false, 'Invocation must not be inside comment');
|
|
2800
|
+
}
|
|
2801
|
+
else {
|
|
2802
|
+
// POSIX case: Verify receipt is appended
|
|
2803
|
+
assert(cmdWithReceipt.includes(`# ${receipt}`), 'Receipt should be appended as comment in POSIX command');
|
|
2804
|
+
}
|
|
2805
|
+
}
|
|
2806
|
+
finally {
|
|
2807
|
+
if (typeof prevShell === 'string')
|
|
2808
|
+
process.env.SHELL = prevShell;
|
|
2809
|
+
else
|
|
2810
|
+
delete process.env.SHELL;
|
|
2811
|
+
if (typeof prevBypass === 'string')
|
|
2812
|
+
process.env.OMX_BYPASS_DEFAULT_SYSTEM_PROMPT = prevBypass;
|
|
2813
|
+
else
|
|
2814
|
+
delete process.env.OMX_BYPASS_DEFAULT_SYSTEM_PROMPT;
|
|
2815
|
+
}
|
|
2816
|
+
});
|
|
2817
|
+
it('appends receipt to POSIX worker startup commands without modifying the inner command', () => {
|
|
2818
|
+
const receipt = 'omx_source_posix_receipt';
|
|
2819
|
+
const prevBypass = process.env.OMX_BYPASS_DEFAULT_SYSTEM_PROMPT;
|
|
2820
|
+
const prevShell = process.env.SHELL;
|
|
2821
|
+
process.env.SHELL = '/bin/bash';
|
|
2822
|
+
process.env.OMX_BYPASS_DEFAULT_SYSTEM_PROMPT = '0';
|
|
2823
|
+
try {
|
|
2824
|
+
const cmdNoReceipt = buildWorkerStartupCommand('alpha', 1, [], process.cwd());
|
|
2825
|
+
const cmdWithReceipt = buildWorkerStartupCommand('alpha', 1, [], process.cwd(), {}, undefined, undefined, undefined, receipt);
|
|
2826
|
+
// If it's a PowerShell command (Windows), receipt should be embedded in the script
|
|
2827
|
+
// If it's a POSIX command (Unix/macOS), receipt should be appended
|
|
2828
|
+
assert(cmdWithReceipt.includes(receipt), 'Receipt must be present in command');
|
|
2829
|
+
if (cmdWithReceipt.includes('-EncodedCommand')) {
|
|
2830
|
+
// PowerShell case
|
|
2831
|
+
const match = cmdWithReceipt.match(/-EncodedCommand\s+([A-Za-z0-9+/=]+)/);
|
|
2832
|
+
assert(match, 'Should extract encoded command');
|
|
2833
|
+
const decoded = Buffer.from(match[1], 'base64').toString('utf16le');
|
|
2834
|
+
assert(decoded.includes(receipt), 'Decoded script should contain receipt');
|
|
2835
|
+
}
|
|
2836
|
+
else {
|
|
2837
|
+
// POSIX case: verify receipt is appended as comment
|
|
2838
|
+
assert(cmdWithReceipt.includes(`# ${receipt}`), 'Receipt should be appended as comment to POSIX command');
|
|
2839
|
+
}
|
|
2840
|
+
}
|
|
2841
|
+
finally {
|
|
2842
|
+
if (typeof prevBypass === 'string')
|
|
2843
|
+
process.env.OMX_BYPASS_DEFAULT_SYSTEM_PROMPT = prevBypass;
|
|
2844
|
+
else
|
|
2845
|
+
delete process.env.OMX_BYPASS_DEFAULT_SYSTEM_PROMPT;
|
|
2846
|
+
if (typeof prevShell === 'string')
|
|
2847
|
+
process.env.SHELL = prevShell;
|
|
2848
|
+
else
|
|
2849
|
+
delete process.env.SHELL;
|
|
2850
|
+
}
|
|
2851
|
+
});
|
|
2777
2852
|
});
|
|
2778
2853
|
describe('team worker CLI helpers', () => {
|
|
2779
2854
|
it('resolveTeamWorkerCli auto-detects claude models', () => {
|
|
@@ -4469,6 +4544,55 @@ describe('createTeamSession tmux instance tagging', () => {
|
|
|
4469
4544
|
assert.throws(() => bindSplitWindowReceiptFormat(effect, invalidReceipt), /tmux_source_transaction_receipt_invalid/);
|
|
4470
4545
|
}
|
|
4471
4546
|
});
|
|
4547
|
+
it('embeds receipt in PowerShell script before encoding and appends to POSIX commands', () => {
|
|
4548
|
+
const receipt = 'omx_source_receipt_example';
|
|
4549
|
+
// PowerShell commands from buildWorkerStartupCommand have receipt embedded in the script,
|
|
4550
|
+
// but bindSplitReceiptToPaneCommand will append " # receipt" as plaintext (for fallback detection).
|
|
4551
|
+
const scriptWithReceipt = `$ErrorActionPreference = 'Stop'; # ${receipt}`;
|
|
4552
|
+
const encodedReceipt = Buffer.from(scriptWithReceipt, 'utf16le').toString('base64');
|
|
4553
|
+
const powershellCommand = `powershell.exe -NoLogo -NoProfile -ExecutionPolicy Bypass -EncodedCommand ${encodedReceipt}`;
|
|
4554
|
+
// PowerShell commands don't have plaintext receipt, so it gets appended
|
|
4555
|
+
const result = bindSplitReceiptToPaneCommand(powershellCommand, receipt);
|
|
4556
|
+
assert.equal(result, `${powershellCommand} # ${receipt}`, 'PowerShell command should have receipt appended as plaintext for detection');
|
|
4557
|
+
// POSIX shell commands should have receipt appended as a comment
|
|
4558
|
+
const bashCommand = '/bin/bash -c "worker_command"';
|
|
4559
|
+
assert.equal(bindSplitReceiptToPaneCommand(bashCommand, receipt), `${bashCommand} # ${receipt}`, 'Bash command should have receipt appended as comment');
|
|
4560
|
+
// Plain command should have receipt appended
|
|
4561
|
+
const plainCommand = 'worker_process';
|
|
4562
|
+
assert.equal(bindSplitReceiptToPaneCommand(plainCommand, receipt), `${plainCommand} # ${receipt}`, 'Plain command should have receipt appended as comment');
|
|
4563
|
+
// Test POSIX command containing the literal text '-EncodedCommand' in its content
|
|
4564
|
+
// This should NOT be misparsed; receipt should just be appended
|
|
4565
|
+
const posixWithEncodedCommandText = 'echo "Usage: -EncodedCommand option for PowerShell"';
|
|
4566
|
+
const resultWithEncodedText = bindSplitReceiptToPaneCommand(posixWithEncodedCommandText, receipt);
|
|
4567
|
+
assert.equal(resultWithEncodedText, `${posixWithEncodedCommandText} # ${receipt}`, 'POSIX command with -EncodedCommand text should get receipt appended like any other POSIX command');
|
|
4568
|
+
});
|
|
4569
|
+
it('detects receipt in both POSIX shell comments and PowerShell encoded commands for fallback reconciliation', () => {
|
|
4570
|
+
const receipt = 'omx_source_test_fallback';
|
|
4571
|
+
// Test POSIX shell case: receipt in command as comment
|
|
4572
|
+
const posixCommand = `/bin/bash -c "worker" # ${receipt}`;
|
|
4573
|
+
assert(posixCommand.includes(receipt), 'POSIX command should contain receipt');
|
|
4574
|
+
// Test PowerShell case: receipt should be detectable inside the decoded script
|
|
4575
|
+
const scriptWithReceipt = `# ${receipt}\n$ErrorActionPreference = 'Stop'`;
|
|
4576
|
+
const encodedWithReceipt = Buffer.from(scriptWithReceipt, 'utf16le').toString('base64');
|
|
4577
|
+
const powerShellCommand = `powershell.exe -NoLogo -NoProfile -ExecutionPolicy Bypass -EncodedCommand ${encodedWithReceipt}`;
|
|
4578
|
+
// Extract and verify the receipt is in the decoded script
|
|
4579
|
+
const psMatch = powerShellCommand.match(/EncodedCommand\s+([A-Za-z0-9+/=]+)/);
|
|
4580
|
+
assert(psMatch, 'Should extract encoded command');
|
|
4581
|
+
const psDecoded = Buffer.from(psMatch[1], 'base64').toString('utf16le');
|
|
4582
|
+
assert(psDecoded.includes(receipt), 'Decoded PS command should contain receipt');
|
|
4583
|
+
// Verify that panes WITHOUT receipts would not match (prevents false reconciliation)
|
|
4584
|
+
const noReceiptCommand = '/bin/bash -c "worker"';
|
|
4585
|
+
assert(!noReceiptCommand.includes(receipt), 'Pane without receipt should not match');
|
|
4586
|
+
// PowerShell command without receipt
|
|
4587
|
+
const scriptNoReceipt = '$ErrorActionPreference = "Stop"';
|
|
4588
|
+
const encodedNoReceipt = Buffer.from(scriptNoReceipt, 'utf16le').toString('base64');
|
|
4589
|
+
const psNoReceiptCommand = `powershell.exe -EncodedCommand ${encodedNoReceipt}`;
|
|
4590
|
+
const psNoReceiptMatch = psNoReceiptCommand.match(/EncodedCommand\s+([A-Za-z0-9+/=]+)/);
|
|
4591
|
+
if (psNoReceiptMatch) {
|
|
4592
|
+
const psNoReceiptDecoded = Buffer.from(psNoReceiptMatch[1], 'base64').toString('utf16le');
|
|
4593
|
+
assert(!psNoReceiptDecoded.includes(receipt), 'PS pane without receipt should not match');
|
|
4594
|
+
}
|
|
4595
|
+
});
|
|
4472
4596
|
it('fails closed on multi-row worker and HUD split-window output', async () => {
|
|
4473
4597
|
const prevTmux = process.env.TMUX;
|
|
4474
4598
|
const prevTmuxPane = process.env.TMUX_PANE;
|