oh-my-codex 0.18.13 → 0.18.14
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 +31 -11
- package/dist/agents/__tests__/native-config.test.js +25 -0
- package/dist/agents/__tests__/native-config.test.js.map +1 -1
- package/dist/agents/native-config.d.ts.map +1 -1
- package/dist/agents/native-config.js +5 -1
- package/dist/agents/native-config.js.map +1 -1
- package/dist/autopilot/__tests__/fsm.test.js +7 -0
- package/dist/autopilot/__tests__/fsm.test.js.map +1 -1
- package/dist/autopilot/__tests__/planner-routing.test.d.ts +2 -0
- package/dist/autopilot/__tests__/planner-routing.test.d.ts.map +1 -0
- package/dist/autopilot/__tests__/planner-routing.test.js +74 -0
- package/dist/autopilot/__tests__/planner-routing.test.js.map +1 -0
- package/dist/autopilot/__tests__/ralplan-gate.test.js +315 -0
- package/dist/autopilot/__tests__/ralplan-gate.test.js.map +1 -1
- package/dist/autopilot/completion-gate.js +1 -1
- package/dist/autopilot/completion-gate.js.map +1 -1
- package/dist/autopilot/fsm.d.ts +2 -2
- package/dist/autopilot/fsm.d.ts.map +1 -1
- package/dist/autopilot/fsm.js +3 -0
- package/dist/autopilot/fsm.js.map +1 -1
- package/dist/autopilot/planner-routing.d.ts +21 -0
- package/dist/autopilot/planner-routing.d.ts.map +1 -0
- package/dist/autopilot/planner-routing.js +59 -0
- package/dist/autopilot/planner-routing.js.map +1 -0
- package/dist/autopilot/ralplan-gate.d.ts.map +1 -1
- package/dist/autopilot/ralplan-gate.js +30 -0
- package/dist/autopilot/ralplan-gate.js.map +1 -1
- package/dist/autoresearch/goal.d.ts.map +1 -1
- package/dist/autoresearch/goal.js +10 -1
- package/dist/autoresearch/goal.js.map +1 -1
- package/dist/cli/__tests__/autoresearch-goal.test.js +33 -0
- package/dist/cli/__tests__/autoresearch-goal.test.js.map +1 -1
- package/dist/cli/__tests__/codex-plugin-layout.test.js +30 -0
- package/dist/cli/__tests__/codex-plugin-layout.test.js.map +1 -1
- package/dist/cli/__tests__/doctor-artifact-ownership.test.d.ts +2 -0
- package/dist/cli/__tests__/doctor-artifact-ownership.test.d.ts.map +1 -0
- package/dist/cli/__tests__/doctor-artifact-ownership.test.js +158 -0
- package/dist/cli/__tests__/doctor-artifact-ownership.test.js.map +1 -0
- package/dist/cli/__tests__/doctor-spark-routing.test.js +13 -0
- package/dist/cli/__tests__/doctor-spark-routing.test.js.map +1 -1
- package/dist/cli/__tests__/doctor-warning-copy.test.js +1 -0
- package/dist/cli/__tests__/doctor-warning-copy.test.js.map +1 -1
- package/dist/cli/__tests__/index.test.js +5 -0
- package/dist/cli/__tests__/index.test.js.map +1 -1
- package/dist/cli/__tests__/nested-help-routing.test.js +4 -0
- package/dist/cli/__tests__/nested-help-routing.test.js.map +1 -1
- package/dist/cli/__tests__/package-bin-contract.test.js +7 -1
- package/dist/cli/__tests__/package-bin-contract.test.js.map +1 -1
- package/dist/cli/__tests__/performance-goal.test.js +22 -0
- package/dist/cli/__tests__/performance-goal.test.js.map +1 -1
- package/dist/cli/__tests__/resume.test.js +96 -0
- package/dist/cli/__tests__/resume.test.js.map +1 -1
- package/dist/cli/__tests__/session-scoped-runtime.test.js +162 -0
- package/dist/cli/__tests__/session-scoped-runtime.test.js.map +1 -1
- package/dist/cli/__tests__/session-search.test.js +36 -0
- package/dist/cli/__tests__/session-search.test.js.map +1 -1
- package/dist/cli/__tests__/setup-agents-overwrite.test.js +35 -1
- package/dist/cli/__tests__/setup-agents-overwrite.test.js.map +1 -1
- package/dist/cli/__tests__/setup-install-mode.test.js +33 -0
- package/dist/cli/__tests__/setup-install-mode.test.js.map +1 -1
- package/dist/cli/__tests__/team.test.js +17 -3
- package/dist/cli/__tests__/team.test.js.map +1 -1
- package/dist/cli/__tests__/ultragoal.test.js +37 -0
- package/dist/cli/__tests__/ultragoal.test.js.map +1 -1
- package/dist/cli/__tests__/update.test.js +1 -0
- package/dist/cli/__tests__/update.test.js.map +1 -1
- package/dist/cli/autoresearch-goal.d.ts.map +1 -1
- package/dist/cli/autoresearch-goal.js +2 -1
- package/dist/cli/autoresearch-goal.js.map +1 -1
- package/dist/cli/doctor.d.ts +22 -0
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +263 -4
- package/dist/cli/doctor.js.map +1 -1
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +65 -4
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/performance-goal.d.ts.map +1 -1
- package/dist/cli/performance-goal.js +4 -2
- package/dist/cli/performance-goal.js.map +1 -1
- package/dist/cli/plugin-marketplace.d.ts +1 -0
- package/dist/cli/plugin-marketplace.d.ts.map +1 -1
- package/dist/cli/plugin-marketplace.js +67 -5
- package/dist/cli/plugin-marketplace.js.map +1 -1
- package/dist/cli/project-runtime-codex-homes.d.ts +2 -0
- package/dist/cli/project-runtime-codex-homes.d.ts.map +1 -1
- package/dist/cli/project-runtime-codex-homes.js +112 -5
- package/dist/cli/project-runtime-codex-homes.js.map +1 -1
- package/dist/cli/setup.d.ts.map +1 -1
- package/dist/cli/setup.js +15 -6
- package/dist/cli/setup.js.map +1 -1
- package/dist/cli/ultragoal.d.ts.map +1 -1
- package/dist/cli/ultragoal.js +5 -1
- package/dist/cli/ultragoal.js.map +1 -1
- package/dist/cli/update.d.ts.map +1 -1
- package/dist/cli/update.js +3 -0
- package/dist/cli/update.js.map +1 -1
- package/dist/config/__tests__/models.test.js +21 -1
- package/dist/config/__tests__/models.test.js.map +1 -1
- package/dist/config/models.d.ts +5 -0
- package/dist/config/models.d.ts.map +1 -1
- package/dist/config/models.js +23 -0
- package/dist/config/models.js.map +1 -1
- package/dist/goal-workflows/codex-goal-snapshot.d.ts +2 -0
- package/dist/goal-workflows/codex-goal-snapshot.d.ts.map +1 -1
- package/dist/goal-workflows/codex-goal-snapshot.js +10 -0
- package/dist/goal-workflows/codex-goal-snapshot.js.map +1 -1
- package/dist/hooks/__tests__/autopilot-skill-contract.test.js +7 -0
- package/dist/hooks/__tests__/autopilot-skill-contract.test.js.map +1 -1
- package/dist/hooks/__tests__/keyword-detector.test.js +46 -0
- package/dist/hooks/__tests__/keyword-detector.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-fallback-watcher.test.js +100 -0
- package/dist/hooks/__tests__/notify-fallback-watcher.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-all-workers-idle.test.js +75 -0
- package/dist/hooks/__tests__/notify-hook-all-workers-idle.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-auto-nudge.test.js +225 -0
- package/dist/hooks/__tests__/notify-hook-auto-nudge.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-team-dispatch.test.js +75 -0
- package/dist/hooks/__tests__/notify-hook-team-dispatch.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-team-leader-nudge.test.js +200 -0
- package/dist/hooks/__tests__/notify-hook-team-leader-nudge.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-team-tmux-guard.test.js +187 -12
- package/dist/hooks/__tests__/notify-hook-team-tmux-guard.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-tmux-heal.test.js +225 -0
- package/dist/hooks/__tests__/notify-hook-tmux-heal.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-tmux-scrollback.test.js +0 -0
- package/dist/hooks/__tests__/notify-hook-tmux-scrollback.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-worker-idle.test.js +75 -0
- package/dist/hooks/__tests__/notify-hook-worker-idle.test.js.map +1 -1
- package/dist/hooks/keyword-detector.d.ts.map +1 -1
- package/dist/hooks/keyword-detector.js +4 -0
- package/dist/hooks/keyword-detector.js.map +1 -1
- package/dist/hud/__tests__/reconcile.test.js +137 -2
- package/dist/hud/__tests__/reconcile.test.js.map +1 -1
- package/dist/hud/__tests__/state.test.js +107 -0
- package/dist/hud/__tests__/state.test.js.map +1 -1
- package/dist/hud/__tests__/tmux.test.js +17 -0
- package/dist/hud/__tests__/tmux.test.js.map +1 -1
- package/dist/hud/reconcile.d.ts.map +1 -1
- package/dist/hud/reconcile.js +21 -7
- package/dist/hud/reconcile.js.map +1 -1
- package/dist/hud/render.d.ts.map +1 -1
- package/dist/hud/render.js +9 -0
- package/dist/hud/render.js.map +1 -1
- package/dist/hud/state.d.ts.map +1 -1
- package/dist/hud/state.js +43 -5
- package/dist/hud/state.js.map +1 -1
- package/dist/hud/types.d.ts +6 -0
- package/dist/hud/types.d.ts.map +1 -1
- package/dist/hud/types.js.map +1 -1
- package/dist/modes/__tests__/base-autopilot-gates.test.js +48 -0
- package/dist/modes/__tests__/base-autopilot-gates.test.js.map +1 -1
- package/dist/modes/base.d.ts.map +1 -1
- package/dist/modes/base.js +1 -0
- package/dist/modes/base.js.map +1 -1
- package/dist/performance-goal/artifacts.d.ts.map +1 -1
- package/dist/performance-goal/artifacts.js +10 -1
- package/dist/performance-goal/artifacts.js.map +1 -1
- package/dist/ralplan/__tests__/consensus-gate.test.js +112 -0
- package/dist/ralplan/__tests__/consensus-gate.test.js.map +1 -1
- package/dist/ralplan/consensus-gate.d.ts +23 -0
- package/dist/ralplan/consensus-gate.d.ts.map +1 -1
- package/dist/ralplan/consensus-gate.js +133 -21
- package/dist/ralplan/consensus-gate.js.map +1 -1
- package/dist/scripts/__tests__/codex-native-hook.test.js +831 -2
- package/dist/scripts/__tests__/codex-native-hook.test.js.map +1 -1
- package/dist/scripts/codex-native-hook.d.ts.map +1 -1
- package/dist/scripts/codex-native-hook.js +486 -21
- package/dist/scripts/codex-native-hook.js.map +1 -1
- package/dist/scripts/notify-hook/team-tmux-guard.d.ts.map +1 -1
- package/dist/scripts/notify-hook/team-tmux-guard.js +87 -8
- package/dist/scripts/notify-hook/team-tmux-guard.js.map +1 -1
- package/dist/scripts/notify-hook/tmux-injection.js +1 -1
- package/dist/scripts/notify-hook/tmux-injection.js.map +1 -1
- package/dist/scripts/run-compiled-ci.d.ts +2 -0
- package/dist/scripts/run-compiled-ci.d.ts.map +1 -0
- package/dist/scripts/run-compiled-ci.js +77 -0
- package/dist/scripts/run-compiled-ci.js.map +1 -0
- package/dist/scripts/sync-plugin-mirror.d.ts.map +1 -1
- package/dist/scripts/sync-plugin-mirror.js +1 -0
- package/dist/scripts/sync-plugin-mirror.js.map +1 -1
- package/dist/session-history/search.d.ts.map +1 -1
- package/dist/session-history/search.js +24 -9
- package/dist/session-history/search.js.map +1 -1
- package/dist/state/__tests__/operations.test.js +107 -3
- package/dist/state/__tests__/operations.test.js.map +1 -1
- package/dist/state/operations.d.ts.map +1 -1
- package/dist/state/operations.js +57 -2
- package/dist/state/operations.js.map +1 -1
- package/dist/team/__tests__/delivery-e2e-smoke.test.js +22 -1
- package/dist/team/__tests__/delivery-e2e-smoke.test.js.map +1 -1
- package/dist/team/__tests__/model-contract.test.js +57 -1
- package/dist/team/__tests__/model-contract.test.js.map +1 -1
- package/dist/team/__tests__/runtime.test.js +1468 -110
- package/dist/team/__tests__/runtime.test.js.map +1 -1
- package/dist/team/__tests__/scaling.test.js +63 -0
- package/dist/team/__tests__/scaling.test.js.map +1 -1
- package/dist/team/__tests__/state.test.js +24 -1
- package/dist/team/__tests__/state.test.js.map +1 -1
- package/dist/team/__tests__/tmux-session.test.js +512 -0
- package/dist/team/__tests__/tmux-session.test.js.map +1 -1
- package/dist/team/__tests__/worker-bootstrap.test.js +42 -9
- package/dist/team/__tests__/worker-bootstrap.test.js.map +1 -1
- package/dist/team/model-contract.d.ts +16 -0
- package/dist/team/model-contract.d.ts.map +1 -1
- package/dist/team/model-contract.js +41 -1
- package/dist/team/model-contract.js.map +1 -1
- package/dist/team/runtime.d.ts.map +1 -1
- package/dist/team/runtime.js +116 -30
- package/dist/team/runtime.js.map +1 -1
- package/dist/team/scaling.d.ts.map +1 -1
- package/dist/team/scaling.js +9 -1
- package/dist/team/scaling.js.map +1 -1
- package/dist/team/state/types.d.ts +2 -0
- package/dist/team/state/types.d.ts.map +1 -1
- package/dist/team/state/types.js.map +1 -1
- package/dist/team/state.d.ts +3 -0
- package/dist/team/state.d.ts.map +1 -1
- package/dist/team/state.js +20 -0
- package/dist/team/state.js.map +1 -1
- package/dist/team/tmux-session.d.ts +38 -3
- package/dist/team/tmux-session.d.ts.map +1 -1
- package/dist/team/tmux-session.js +275 -36
- package/dist/team/tmux-session.js.map +1 -1
- package/dist/team/worker-bootstrap.d.ts.map +1 -1
- package/dist/team/worker-bootstrap.js +26 -1
- package/dist/team/worker-bootstrap.js.map +1 -1
- package/dist/ultragoal/__tests__/artifacts.test.js +238 -0
- package/dist/ultragoal/__tests__/artifacts.test.js.map +1 -1
- package/dist/ultragoal/__tests__/docs-contract.test.js +3 -0
- package/dist/ultragoal/__tests__/docs-contract.test.js.map +1 -1
- package/dist/ultragoal/artifacts.d.ts +15 -0
- package/dist/ultragoal/artifacts.d.ts.map +1 -1
- package/dist/ultragoal/artifacts.js +167 -4
- package/dist/ultragoal/artifacts.js.map +1 -1
- package/dist/utils/__tests__/agents-md.test.js +39 -1
- package/dist/utils/__tests__/agents-md.test.js.map +1 -1
- package/dist/utils/__tests__/agents-model-table.test.js +28 -0
- package/dist/utils/__tests__/agents-model-table.test.js.map +1 -1
- package/dist/utils/agents-md.d.ts +4 -0
- package/dist/utils/agents-md.d.ts.map +1 -1
- package/dist/utils/agents-md.js +25 -0
- package/dist/utils/agents-md.js.map +1 -1
- package/dist/utils/agents-model-table.d.ts +7 -3
- package/dist/utils/agents-model-table.d.ts.map +1 -1
- package/dist/utils/agents-model-table.js +16 -8
- package/dist/utils/agents-model-table.js.map +1 -1
- package/dist/verification/__tests__/ci-rust-gates.test.js +4 -0
- package/dist/verification/__tests__/ci-rust-gates.test.js.map +1 -1
- package/package.json +2 -2
- package/plugins/oh-my-codex/.codex-plugin/plugin.json +1 -1
- package/plugins/oh-my-codex/hooks/codex-native-hook.mjs +59 -8
- package/plugins/oh-my-codex/skills/autopilot/SKILL.md +9 -5
- package/plugins/oh-my-codex/skills/autoresearch-goal/SKILL.md +3 -0
- package/plugins/oh-my-codex/skills/performance-goal/SKILL.md +3 -0
- package/plugins/oh-my-codex/skills/ralplan/SKILL.md +1 -1
- package/plugins/oh-my-codex/skills/ultragoal/SKILL.md +22 -4
- package/plugins/oh-my-codex/skills/ultrawork/SKILL.md +2 -2
- package/plugins/oh-my-codex/skills/ultrawork/references/agent-tiers.md +61 -0
- package/skills/autopilot/SKILL.md +9 -5
- package/skills/autoresearch-goal/SKILL.md +3 -0
- package/skills/ecomode/SKILL.md +1 -1
- package/skills/ecomode/references/agent-tiers.md +61 -0
- package/skills/performance-goal/SKILL.md +3 -0
- package/skills/ralplan/SKILL.md +1 -1
- package/skills/ultragoal/SKILL.md +22 -4
- package/skills/ultrawork/SKILL.md +2 -2
- package/skills/ultrawork/references/agent-tiers.md +61 -0
- package/src/scripts/__tests__/codex-native-hook.test.ts +975 -40
- package/src/scripts/codex-native-hook.ts +529 -22
- package/src/scripts/notify-hook/team-tmux-guard.ts +92 -8
- package/src/scripts/notify-hook/tmux-injection.ts +1 -1
- package/src/scripts/run-compiled-ci.ts +85 -0
- package/src/scripts/sync-plugin-mirror.ts +1 -0
- package/templates/AGENTS.md +6 -0
|
@@ -11,6 +11,28 @@ import {
|
|
|
11
11
|
} from '../tmux-hook-engine.js';
|
|
12
12
|
|
|
13
13
|
export const PANE_READINESS_UNVERIFIED_REASON = 'pane_readiness_unverified';
|
|
14
|
+
let nextTmuxBufferId = 0;
|
|
15
|
+
|
|
16
|
+
function buildSafePasteArgv(target: string, prompt: string): {
|
|
17
|
+
bufferName: string;
|
|
18
|
+
setBufferArgv: string[];
|
|
19
|
+
showBufferArgv: string[];
|
|
20
|
+
clearComposerArgv: string[];
|
|
21
|
+
pasteBufferArgv: string[];
|
|
22
|
+
deleteBufferArgv: string[];
|
|
23
|
+
} {
|
|
24
|
+
nextTmuxBufferId += 1;
|
|
25
|
+
const bufferName = `omx-pane-input-${process.pid}-${Date.now()}-${nextTmuxBufferId}`;
|
|
26
|
+
return {
|
|
27
|
+
bufferName,
|
|
28
|
+
setBufferArgv: ['set-buffer', '-b', bufferName, '--', prompt],
|
|
29
|
+
showBufferArgv: ['show-buffer', '-b', bufferName],
|
|
30
|
+
clearComposerArgv: ['send-keys', '-t', target, 'C-u'],
|
|
31
|
+
pasteBufferArgv: ['paste-buffer', '-t', target, '-b', bufferName, '-p', '-d'],
|
|
32
|
+
deleteBufferArgv: ['delete-buffer', '-b', bufferName],
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
|
|
14
36
|
|
|
15
37
|
export function mapPaneInjectionReadinessReason(reason: any): any {
|
|
16
38
|
return reason === 'pane_running_shell' ? 'agent_not_running' : reason;
|
|
@@ -145,24 +167,82 @@ export async function sendPaneInput({
|
|
|
145
167
|
? Math.max(0, Math.floor(submitKeyPresses))
|
|
146
168
|
: 2;
|
|
147
169
|
const literalPrompt = safeString(prompt);
|
|
148
|
-
const
|
|
149
|
-
?
|
|
150
|
-
typeArgv: ['send-keys', '-t', target, '-l', literalPrompt],
|
|
151
|
-
submitArgv: [] as string[][],
|
|
152
|
-
}
|
|
170
|
+
const submitArgv = normalizedSubmitKeyPresses === 0
|
|
171
|
+
? [] as string[][]
|
|
153
172
|
: buildSendKeysArgv({
|
|
154
173
|
paneTarget: target,
|
|
155
174
|
prompt: literalPrompt,
|
|
156
175
|
dryRun: false,
|
|
157
176
|
submitKeyPresses: normalizedSubmitKeyPresses,
|
|
158
|
-
});
|
|
159
|
-
if (!
|
|
177
|
+
})?.submitArgv;
|
|
178
|
+
if (!submitArgv) {
|
|
160
179
|
return { ok: false, sent: false, reason: 'send_failed', paneTarget: target };
|
|
161
180
|
}
|
|
181
|
+
const pasteArgv = buildSafePasteArgv(target, literalPrompt);
|
|
182
|
+
const argv = {
|
|
183
|
+
typeArgv: pasteArgv.pasteBufferArgv,
|
|
184
|
+
submitArgv,
|
|
185
|
+
bufferName: pasteArgv.bufferName,
|
|
186
|
+
setBufferArgv: pasteArgv.setBufferArgv,
|
|
187
|
+
showBufferArgv: pasteArgv.showBufferArgv,
|
|
188
|
+
clearComposerArgv: pasteArgv.clearComposerArgv,
|
|
189
|
+
pasteBufferArgv: pasteArgv.pasteBufferArgv,
|
|
190
|
+
deleteBufferArgv: pasteArgv.deleteBufferArgv,
|
|
191
|
+
};
|
|
162
192
|
|
|
193
|
+
let bufferSet = false;
|
|
163
194
|
try {
|
|
164
195
|
if (typePrompt) {
|
|
165
|
-
|
|
196
|
+
try {
|
|
197
|
+
await runProcess('tmux', pasteArgv.setBufferArgv, 3000);
|
|
198
|
+
bufferSet = true;
|
|
199
|
+
} catch (error) {
|
|
200
|
+
return {
|
|
201
|
+
ok: false,
|
|
202
|
+
sent: false,
|
|
203
|
+
reason: 'buffer_set_failed',
|
|
204
|
+
paneTarget: target,
|
|
205
|
+
argv,
|
|
206
|
+
error: error instanceof Error ? error.message : safeString(error),
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
let verifiedBuffer;
|
|
210
|
+
try {
|
|
211
|
+
verifiedBuffer = await runProcess('tmux', pasteArgv.showBufferArgv, 3000);
|
|
212
|
+
} catch (error) {
|
|
213
|
+
return {
|
|
214
|
+
ok: false,
|
|
215
|
+
sent: false,
|
|
216
|
+
reason: 'buffer_show_failed',
|
|
217
|
+
paneTarget: target,
|
|
218
|
+
argv,
|
|
219
|
+
error: error instanceof Error ? error.message : safeString(error),
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
if (verifiedBuffer.stdout !== literalPrompt) {
|
|
223
|
+
return {
|
|
224
|
+
ok: false,
|
|
225
|
+
sent: false,
|
|
226
|
+
reason: 'buffer_verify_failed',
|
|
227
|
+
paneTarget: target,
|
|
228
|
+
argv,
|
|
229
|
+
expectedBytes: literalPrompt.length,
|
|
230
|
+
actualBytes: verifiedBuffer.stdout.length,
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
try {
|
|
234
|
+
await runProcess('tmux', pasteArgv.clearComposerArgv, 3000);
|
|
235
|
+
await runProcess('tmux', pasteArgv.pasteBufferArgv, 3000);
|
|
236
|
+
} catch (error) {
|
|
237
|
+
return {
|
|
238
|
+
ok: false,
|
|
239
|
+
sent: false,
|
|
240
|
+
reason: 'buffer_paste_failed',
|
|
241
|
+
paneTarget: target,
|
|
242
|
+
argv,
|
|
243
|
+
error: error instanceof Error ? error.message : safeString(error),
|
|
244
|
+
};
|
|
245
|
+
}
|
|
166
246
|
}
|
|
167
247
|
if (queueFirstSubmit && argv.submitArgv.length > 0) {
|
|
168
248
|
await runProcess('tmux', ['send-keys', '-t', target, 'Tab'], 3000);
|
|
@@ -186,6 +266,10 @@ export async function sendPaneInput({
|
|
|
186
266
|
argv,
|
|
187
267
|
error: error instanceof Error ? error.message : safeString(error),
|
|
188
268
|
};
|
|
269
|
+
} finally {
|
|
270
|
+
if (bufferSet) {
|
|
271
|
+
await runProcess('tmux', pasteArgv.deleteBufferArgv, 3000).catch(() => {});
|
|
272
|
+
}
|
|
189
273
|
}
|
|
190
274
|
}
|
|
191
275
|
|
|
@@ -71,7 +71,7 @@ async function finalizeResolvedPane(paneId: string, reason: string, expectedCwd:
|
|
|
71
71
|
|
|
72
72
|
async function resolveCanonicalPaneFromPaneTarget(paneTarget: any, expectedCwd: any): Promise<any> {
|
|
73
73
|
const paneResult = await runProcess('tmux', ['display-message', '-p', '-t', paneTarget, '#{pane_id}']);
|
|
74
|
-
const paneId = safeString(paneResult.stdout).trim();
|
|
74
|
+
const paneId = safeString(paneResult.stdout).trim() || (safeString(paneTarget).trim().match(/^%\d+$/) ? safeString(paneTarget).trim() : '');
|
|
75
75
|
if (!paneId) return { paneTarget: null, reason: 'target_not_found' };
|
|
76
76
|
|
|
77
77
|
let startCommand = '';
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { spawnSync } from "node:child_process";
|
|
2
|
+
import { existsSync } from "node:fs";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
|
|
5
|
+
const SOURCE_CHECKOUT_SENTINELS = [
|
|
6
|
+
"src/catalog/manifest.json",
|
|
7
|
+
"docs/troubleshooting.md",
|
|
8
|
+
".github/workflows/ci.yml",
|
|
9
|
+
] as const;
|
|
10
|
+
|
|
11
|
+
const INSTALLED_PACKAGE_TEST_FILES = [
|
|
12
|
+
"dist/scripts/__tests__/smoke-packed-install.test.js",
|
|
13
|
+
"dist/cli/__tests__/nested-help-routing.test.js",
|
|
14
|
+
"dist/cli/__tests__/mcp-parity.test.js",
|
|
15
|
+
] as const;
|
|
16
|
+
|
|
17
|
+
const INSTALLED_PACKAGE_CLI_SMOKE_COMMANDS = [
|
|
18
|
+
["--help"],
|
|
19
|
+
["version"],
|
|
20
|
+
["api", "--help"],
|
|
21
|
+
["sparkshell", "--help"],
|
|
22
|
+
["notepad", "--help"],
|
|
23
|
+
["project-memory", "--help"],
|
|
24
|
+
["trace", "--help"],
|
|
25
|
+
["code-intel", "--help"],
|
|
26
|
+
] as const;
|
|
27
|
+
|
|
28
|
+
function npmBin(): string {
|
|
29
|
+
return process.platform === "win32" ? "npm.cmd" : "npm";
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function run(command: string, args: readonly string[]): void {
|
|
33
|
+
const result = spawnSync(command, [...args], {
|
|
34
|
+
cwd: process.cwd(),
|
|
35
|
+
env: {
|
|
36
|
+
...process.env,
|
|
37
|
+
OMX_AUTO_UPDATE: "0",
|
|
38
|
+
OMX_NOTIFY_FALLBACK: "0",
|
|
39
|
+
OMX_HOOK_DERIVED_SIGNALS: "0",
|
|
40
|
+
},
|
|
41
|
+
stdio: "inherit",
|
|
42
|
+
});
|
|
43
|
+
if (result.error) {
|
|
44
|
+
throw result.error;
|
|
45
|
+
}
|
|
46
|
+
if (result.status !== 0) {
|
|
47
|
+
throw new Error(`Command failed: ${command} ${args.join(" ")}`);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function isSourceCheckout(): boolean {
|
|
52
|
+
return SOURCE_CHECKOUT_SENTINELS.every((sentinel) =>
|
|
53
|
+
existsSync(join(process.cwd(), sentinel)),
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function runSourceCheckoutGate(): void {
|
|
58
|
+
run(npmBin(), ["run", "verify:native-agents"]);
|
|
59
|
+
run(npmBin(), ["run", "verify:plugin-bundle"]);
|
|
60
|
+
run(npmBin(), ["run", "test:node"]);
|
|
61
|
+
run(process.execPath, ["dist/scripts/generate-catalog-docs.js", "--check"]);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function runInstalledPackageGate(): void {
|
|
65
|
+
run(npmBin(), ["run", "verify:native-agents"]);
|
|
66
|
+
run(npmBin(), ["run", "verify:plugin-bundle"]);
|
|
67
|
+
run(process.execPath, [
|
|
68
|
+
"dist/scripts/run-test-files.js",
|
|
69
|
+
...INSTALLED_PACKAGE_TEST_FILES,
|
|
70
|
+
]);
|
|
71
|
+
for (const argv of INSTALLED_PACKAGE_CLI_SMOKE_COMMANDS) {
|
|
72
|
+
run(process.execPath, ["dist/cli/omx.js", ...argv]);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
try {
|
|
77
|
+
if (isSourceCheckout()) {
|
|
78
|
+
runSourceCheckoutGate();
|
|
79
|
+
} else {
|
|
80
|
+
runInstalledPackageGate();
|
|
81
|
+
}
|
|
82
|
+
} catch (error) {
|
|
83
|
+
console.error(error instanceof Error ? error.message : String(error));
|
|
84
|
+
process.exit(1);
|
|
85
|
+
}
|
|
@@ -59,6 +59,7 @@ const SETUP_OWNED_PLUGIN_MANIFEST_FIELDS = [
|
|
|
59
59
|
] as const;
|
|
60
60
|
const OMX_PLUGIN_HOOK_COMMAND =
|
|
61
61
|
'node "${PLUGIN_ROOT}/hooks/codex-native-hook.mjs"';
|
|
62
|
+
// The launcher itself must not shell-wrap node.exe on Windows; see GH #2858.
|
|
62
63
|
const OMX_PLUGIN_HOOK_LAUNCHER_CONTRACT_MARKER =
|
|
63
64
|
"omx-plugin-hook-launcher:v1";
|
|
64
65
|
// Plugin-scoped Codex hooks intentionally mirror the setup-managed lifecycle
|
package/templates/AGENTS.md
CHANGED
|
@@ -157,6 +157,12 @@ When to use what:
|
|
|
157
157
|
- Use normal Codex repository inspection tools/subagents for repository lookup and implementation context.
|
|
158
158
|
- Use `omx sparkshell --tmux-pane` only as an explicit opt-in operator aid for shell-native tmux evidence or bounded verification; it does not replace raw evidence capture.
|
|
159
159
|
|
|
160
|
+
Supervisor tmux handoff safety:
|
|
161
|
+
- Never paste from tmux's implicit/current buffer. Load handoff text into a fresh named buffer with `tmux set-buffer -b <name> -- "$message"` or a temp-file-backed `tmux load-buffer -b <name> <file>`; never use `tmux load-buffer -- <message>`.
|
|
162
|
+
- Verify the named buffer with `tmux show-buffer -b <name>` before any paste. A failed load or mismatched buffer is a blocker; do not run `paste-buffer` or submit keys after it.
|
|
163
|
+
- Clear the pane composer with `tmux send-keys -t <pane> C-u` immediately before paste, then use bracketed paste (`tmux paste-buffer -t <pane> -b <name> -p -d`) and submit intentionally.
|
|
164
|
+
- Recapture the pane after paste/Enter and verify the intended turn was accepted rather than leaving stale draft text visible.
|
|
165
|
+
|
|
160
166
|
Leader vs worker: leaders choose mode, delegate bounded work, integrate, and own verification; workers execute their slice and escalate blockers, scope expansion, shared-file conflicts, or mode mismatch upward. Escalate from worker to leader for blockers, scope expansion, shared ownership conflicts, or mode mismatch.
|
|
161
167
|
|
|
162
168
|
Stop / escalate: stop when the task is verified complete, the user says stop/cancel, or no meaningful recovery path remains. Escalate to the user only for irreversible, destructive, materially branching decisions, or missing authority.
|