oh-my-codex 0.18.0 → 0.18.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.
- package/Cargo.lock +6 -6
- package/Cargo.toml +1 -1
- package/README.md +43 -19
- package/crates/omx-api/src/lib.rs +66 -9
- package/crates/omx-sparkshell/src/exec.rs +125 -3
- package/crates/omx-sparkshell/src/main.rs +126 -36
- package/crates/omx-sparkshell/tests/execution.rs +225 -1
- package/dist/cli/__tests__/codex-plugin-layout.test.js +15 -7
- package/dist/cli/__tests__/codex-plugin-layout.test.js.map +1 -1
- package/dist/cli/__tests__/doctor-warning-copy.test.js +76 -3
- package/dist/cli/__tests__/doctor-warning-copy.test.js.map +1 -1
- package/dist/cli/__tests__/index.test.js +49 -1
- package/dist/cli/__tests__/index.test.js.map +1 -1
- package/dist/cli/__tests__/install-docs-contract.test.d.ts +2 -0
- package/dist/cli/__tests__/install-docs-contract.test.d.ts.map +1 -0
- package/dist/cli/__tests__/install-docs-contract.test.js +55 -0
- package/dist/cli/__tests__/install-docs-contract.test.js.map +1 -0
- package/dist/cli/__tests__/launch-fallback.test.js +115 -0
- package/dist/cli/__tests__/launch-fallback.test.js.map +1 -1
- package/dist/cli/__tests__/question.test.js +27 -41
- package/dist/cli/__tests__/question.test.js.map +1 -1
- package/dist/cli/__tests__/setup-install-mode.test.js +94 -35
- package/dist/cli/__tests__/setup-install-mode.test.js.map +1 -1
- package/dist/cli/__tests__/sparkshell-cli.test.js +20 -1
- package/dist/cli/__tests__/sparkshell-cli.test.js.map +1 -1
- package/dist/cli/__tests__/sparkshell-packaging.test.js +1 -0
- package/dist/cli/__tests__/sparkshell-packaging.test.js.map +1 -1
- package/dist/cli/__tests__/ultragoal.test.js +227 -4
- package/dist/cli/__tests__/ultragoal.test.js.map +1 -1
- package/dist/cli/__tests__/update.test.js +72 -1
- package/dist/cli/__tests__/update.test.js.map +1 -1
- package/dist/cli/codex-feature-probe.d.ts +5 -0
- package/dist/cli/codex-feature-probe.d.ts.map +1 -1
- package/dist/cli/codex-feature-probe.js +13 -7
- package/dist/cli/codex-feature-probe.js.map +1 -1
- package/dist/cli/doctor.d.ts +7 -0
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +119 -10
- package/dist/cli/doctor.js.map +1 -1
- package/dist/cli/index.d.ts +3 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +345 -90
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/plugin-marketplace.d.ts +2 -0
- package/dist/cli/plugin-marketplace.d.ts.map +1 -1
- package/dist/cli/plugin-marketplace.js +15 -1
- package/dist/cli/plugin-marketplace.js.map +1 -1
- package/dist/cli/setup.d.ts.map +1 -1
- package/dist/cli/setup.js +71 -11
- package/dist/cli/setup.js.map +1 -1
- package/dist/cli/sparkshell.d.ts +7 -1
- package/dist/cli/sparkshell.d.ts.map +1 -1
- package/dist/cli/sparkshell.js +13 -3
- package/dist/cli/sparkshell.js.map +1 -1
- package/dist/cli/ultragoal.d.ts +1 -1
- package/dist/cli/ultragoal.d.ts.map +1 -1
- package/dist/cli/ultragoal.js +184 -10
- package/dist/cli/ultragoal.js.map +1 -1
- package/dist/cli/update.d.ts +2 -0
- package/dist/cli/update.d.ts.map +1 -1
- package/dist/cli/update.js +14 -3
- package/dist/cli/update.js.map +1 -1
- package/dist/compat/__tests__/doctor-contract.test.js +3 -0
- package/dist/compat/__tests__/doctor-contract.test.js.map +1 -1
- package/dist/config/__tests__/codex-feature-flags.test.js +11 -1
- package/dist/config/__tests__/codex-feature-flags.test.js.map +1 -1
- package/dist/config/__tests__/codex-hooks.test.js +19 -8
- package/dist/config/__tests__/codex-hooks.test.js.map +1 -1
- package/dist/config/__tests__/commit-lore-guard.test.d.ts +2 -0
- package/dist/config/__tests__/commit-lore-guard.test.d.ts.map +1 -0
- package/dist/config/__tests__/commit-lore-guard.test.js +20 -0
- package/dist/config/__tests__/commit-lore-guard.test.js.map +1 -0
- package/dist/config/codex-feature-flags.d.ts +4 -0
- package/dist/config/codex-feature-flags.d.ts.map +1 -1
- package/dist/config/codex-feature-flags.js +4 -0
- package/dist/config/codex-feature-flags.js.map +1 -1
- package/dist/config/codex-hooks.js +6 -6
- package/dist/config/codex-hooks.js.map +1 -1
- package/dist/config/commit-lore-guard.d.ts +1 -0
- package/dist/config/commit-lore-guard.d.ts.map +1 -1
- package/dist/config/commit-lore-guard.js +29 -3
- package/dist/config/commit-lore-guard.js.map +1 -1
- package/dist/config/generator.d.ts +3 -1
- package/dist/config/generator.d.ts.map +1 -1
- package/dist/config/generator.js +24 -10
- package/dist/config/generator.js.map +1 -1
- package/dist/goal-workflows/codex-goal-snapshot.d.ts +1 -0
- package/dist/goal-workflows/codex-goal-snapshot.d.ts.map +1 -1
- package/dist/goal-workflows/codex-goal-snapshot.js +5 -1
- package/dist/goal-workflows/codex-goal-snapshot.js.map +1 -1
- package/dist/hooks/__tests__/autopilot-skill-contract.test.js +10 -6
- package/dist/hooks/__tests__/autopilot-skill-contract.test.js.map +1 -1
- package/dist/hooks/__tests__/consensus-execution-handoff.test.d.ts +1 -1
- package/dist/hooks/__tests__/consensus-execution-handoff.test.js +13 -11
- package/dist/hooks/__tests__/consensus-execution-handoff.test.js.map +1 -1
- package/dist/hooks/__tests__/deep-interview-contract.test.js +4 -3
- package/dist/hooks/__tests__/deep-interview-contract.test.js.map +1 -1
- package/dist/hooks/__tests__/keyword-detector.test.js +4 -3
- package/dist/hooks/__tests__/keyword-detector.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-team-tmux-guard.test.js +33 -0
- package/dist/hooks/__tests__/notify-hook-team-tmux-guard.test.js.map +1 -1
- package/dist/hooks/extensibility/__tests__/dispatcher.test.js +26 -3
- package/dist/hooks/extensibility/__tests__/dispatcher.test.js.map +1 -1
- package/dist/hooks/extensibility/dispatcher.d.ts.map +1 -1
- package/dist/hooks/extensibility/dispatcher.js +29 -14
- package/dist/hooks/extensibility/dispatcher.js.map +1 -1
- package/dist/hooks/keyword-detector.d.ts.map +1 -1
- package/dist/hooks/keyword-detector.js +8 -3
- package/dist/hooks/keyword-detector.js.map +1 -1
- package/dist/hooks/prompt-guidance-contract.d.ts.map +1 -1
- package/dist/hooks/prompt-guidance-contract.js +3 -2
- package/dist/hooks/prompt-guidance-contract.js.map +1 -1
- package/dist/hud/__tests__/hud-tmux-injection.test.js +14 -8
- package/dist/hud/__tests__/hud-tmux-injection.test.js.map +1 -1
- package/dist/hud/__tests__/reconcile.test.js +2 -2
- package/dist/hud/__tests__/reconcile.test.js.map +1 -1
- package/dist/hud/__tests__/resource-leak-watch.test.d.ts +2 -0
- package/dist/hud/__tests__/resource-leak-watch.test.d.ts.map +1 -0
- package/dist/hud/__tests__/resource-leak-watch.test.js +28 -0
- package/dist/hud/__tests__/resource-leak-watch.test.js.map +1 -0
- package/dist/hud/index.d.ts +1 -1
- package/dist/hud/index.d.ts.map +1 -1
- package/dist/hud/index.js +10 -4
- package/dist/hud/index.js.map +1 -1
- package/dist/hud/tmux.js +2 -2
- package/dist/hud/tmux.js.map +1 -1
- package/dist/notifications/__tests__/http-client-resource.test.d.ts +2 -0
- package/dist/notifications/__tests__/http-client-resource.test.d.ts.map +1 -0
- package/dist/notifications/__tests__/http-client-resource.test.js +41 -0
- package/dist/notifications/__tests__/http-client-resource.test.js.map +1 -0
- package/dist/notifications/__tests__/verbosity.test.js +20 -0
- package/dist/notifications/__tests__/verbosity.test.js.map +1 -1
- package/dist/notifications/config.d.ts.map +1 -1
- package/dist/notifications/config.js +6 -3
- package/dist/notifications/config.js.map +1 -1
- package/dist/notifications/http-client.d.ts.map +1 -1
- package/dist/notifications/http-client.js +78 -27
- package/dist/notifications/http-client.js.map +1 -1
- package/dist/notifications/types.d.ts +2 -0
- package/dist/notifications/types.d.ts.map +1 -1
- package/dist/openclaw/__tests__/dispatcher.test.js +49 -1
- package/dist/openclaw/__tests__/dispatcher.test.js.map +1 -1
- package/dist/openclaw/dispatcher.d.ts +7 -4
- package/dist/openclaw/dispatcher.d.ts.map +1 -1
- package/dist/openclaw/dispatcher.js +32 -69
- package/dist/openclaw/dispatcher.js.map +1 -1
- package/dist/pipeline/__tests__/orchestrator.test.js +65 -3
- package/dist/pipeline/__tests__/orchestrator.test.js.map +1 -1
- package/dist/pipeline/__tests__/stages.test.js +50 -5
- package/dist/pipeline/__tests__/stages.test.js.map +1 -1
- package/dist/pipeline/index.d.ts +8 -2
- package/dist/pipeline/index.d.ts.map +1 -1
- package/dist/pipeline/index.js +5 -2
- package/dist/pipeline/index.js.map +1 -1
- package/dist/pipeline/orchestrator.d.ts +5 -4
- package/dist/pipeline/orchestrator.d.ts.map +1 -1
- package/dist/pipeline/orchestrator.js +56 -15
- package/dist/pipeline/orchestrator.js.map +1 -1
- package/dist/pipeline/stages/code-review.d.ts +2 -2
- package/dist/pipeline/stages/code-review.d.ts.map +1 -1
- package/dist/pipeline/stages/code-review.js +5 -3
- package/dist/pipeline/stages/code-review.js.map +1 -1
- package/dist/pipeline/stages/deep-interview.d.ts +15 -0
- package/dist/pipeline/stages/deep-interview.d.ts.map +1 -0
- package/dist/pipeline/stages/deep-interview.js +32 -0
- package/dist/pipeline/stages/deep-interview.js.map +1 -0
- package/dist/pipeline/stages/ralph-verify.d.ts +5 -5
- package/dist/pipeline/stages/ralph-verify.d.ts.map +1 -1
- package/dist/pipeline/stages/ralph-verify.js +2 -2
- package/dist/pipeline/stages/ralph-verify.js.map +1 -1
- package/dist/pipeline/stages/ultragoal.d.ts +19 -0
- package/dist/pipeline/stages/ultragoal.d.ts.map +1 -0
- package/dist/pipeline/stages/ultragoal.js +38 -0
- package/dist/pipeline/stages/ultragoal.js.map +1 -0
- package/dist/pipeline/stages/ultraqa.d.ts +30 -0
- package/dist/pipeline/stages/ultraqa.d.ts.map +1 -0
- package/dist/pipeline/stages/ultraqa.js +46 -0
- package/dist/pipeline/stages/ultraqa.js.map +1 -0
- package/dist/pipeline/types.d.ts +8 -6
- package/dist/pipeline/types.d.ts.map +1 -1
- package/dist/pipeline/types.js +2 -2
- package/dist/scripts/__tests__/codex-native-hook.test.js +705 -45
- package/dist/scripts/__tests__/codex-native-hook.test.js.map +1 -1
- package/dist/scripts/__tests__/smoke-packed-install.test.js +23 -1
- package/dist/scripts/__tests__/smoke-packed-install.test.js.map +1 -1
- package/dist/scripts/__tests__/verify-native-agents.test.js +16 -1
- package/dist/scripts/__tests__/verify-native-agents.test.js.map +1 -1
- package/dist/scripts/cleanup-explore-harness.js +1 -0
- package/dist/scripts/cleanup-explore-harness.js.map +1 -1
- package/dist/scripts/codex-native-hook.d.ts.map +1 -1
- package/dist/scripts/codex-native-hook.js +158 -10
- package/dist/scripts/codex-native-hook.js.map +1 -1
- package/dist/scripts/codex-native-pre-post.d.ts.map +1 -1
- package/dist/scripts/codex-native-pre-post.js +9 -1
- package/dist/scripts/codex-native-pre-post.js.map +1 -1
- package/dist/scripts/notify-hook/process-runner.d.ts.map +1 -1
- package/dist/scripts/notify-hook/process-runner.js +39 -17
- package/dist/scripts/notify-hook/process-runner.js.map +1 -1
- package/dist/scripts/notify-hook/team-dispatch.d.ts.map +1 -1
- package/dist/scripts/notify-hook/team-dispatch.js +9 -5
- package/dist/scripts/notify-hook/team-dispatch.js.map +1 -1
- package/dist/scripts/notify-hook/team-tmux-guard.d.ts +1 -1
- package/dist/scripts/notify-hook/team-tmux-guard.d.ts.map +1 -1
- package/dist/scripts/notify-hook/team-tmux-guard.js +7 -1
- package/dist/scripts/notify-hook/team-tmux-guard.js.map +1 -1
- package/dist/scripts/smoke-packed-install.d.ts +3 -0
- package/dist/scripts/smoke-packed-install.d.ts.map +1 -1
- package/dist/scripts/smoke-packed-install.js +99 -1
- package/dist/scripts/smoke-packed-install.js.map +1 -1
- package/dist/scripts/sync-plugin-mirror.js +2 -2
- package/dist/scripts/sync-plugin-mirror.js.map +1 -1
- package/dist/scripts/verify-native-agents.js +2 -2
- package/dist/scripts/verify-native-agents.js.map +1 -1
- package/dist/sidecar/__tests__/resource-leak-watch.test.d.ts +2 -0
- package/dist/sidecar/__tests__/resource-leak-watch.test.d.ts.map +1 -0
- package/dist/sidecar/__tests__/resource-leak-watch.test.js +38 -0
- package/dist/sidecar/__tests__/resource-leak-watch.test.js.map +1 -0
- package/dist/sidecar/index.d.ts +1 -1
- package/dist/sidecar/index.d.ts.map +1 -1
- package/dist/sidecar/index.js +29 -12
- package/dist/sidecar/index.js.map +1 -1
- package/dist/state/__tests__/operations-ralph-phase.test.js +88 -1
- package/dist/state/__tests__/operations-ralph-phase.test.js.map +1 -1
- package/dist/state/operations.d.ts.map +1 -1
- package/dist/state/operations.js +11 -0
- package/dist/state/operations.js.map +1 -1
- package/dist/team/__tests__/tmux-session.test.js +111 -3
- package/dist/team/__tests__/tmux-session.test.js.map +1 -1
- package/dist/team/tmux-session.d.ts.map +1 -1
- package/dist/team/tmux-session.js +39 -18
- package/dist/team/tmux-session.js.map +1 -1
- package/dist/ultragoal/__tests__/artifacts.test.js +714 -10
- package/dist/ultragoal/__tests__/artifacts.test.js.map +1 -1
- package/dist/ultragoal/__tests__/docs-contract.test.js +57 -1
- package/dist/ultragoal/__tests__/docs-contract.test.js.map +1 -1
- package/dist/ultragoal/__tests__/steering-fixtures.d.ts +68 -0
- package/dist/ultragoal/__tests__/steering-fixtures.d.ts.map +1 -0
- package/dist/ultragoal/__tests__/steering-fixtures.js +259 -0
- package/dist/ultragoal/__tests__/steering-fixtures.js.map +1 -0
- package/dist/ultragoal/__tests__/steering-fixtures.test.d.ts +2 -0
- package/dist/ultragoal/__tests__/steering-fixtures.test.d.ts.map +1 -0
- package/dist/ultragoal/__tests__/steering-fixtures.test.js +65 -0
- package/dist/ultragoal/__tests__/steering-fixtures.test.js.map +1 -0
- package/dist/ultragoal/artifacts.d.ts +97 -2
- package/dist/ultragoal/artifacts.d.ts.map +1 -1
- package/dist/ultragoal/artifacts.js +811 -256
- package/dist/ultragoal/artifacts.js.map +1 -1
- package/dist/utils/__tests__/sleep-resource.test.d.ts +2 -0
- package/dist/utils/__tests__/sleep-resource.test.d.ts.map +1 -0
- package/dist/utils/__tests__/sleep-resource.test.js +39 -0
- package/dist/utils/__tests__/sleep-resource.test.js.map +1 -0
- package/dist/utils/sleep.d.ts.map +1 -1
- package/dist/utils/sleep.js +17 -6
- package/dist/utils/sleep.js.map +1 -1
- package/package.json +2 -1
- package/plugins/oh-my-codex/.codex-plugin/plugin.json +4 -3
- package/plugins/oh-my-codex/hooks/codex-native-hook.mjs +56 -0
- package/plugins/oh-my-codex/hooks/hooks.json +77 -0
- package/plugins/oh-my-codex/skills/autopilot/SKILL.md +77 -47
- package/plugins/oh-my-codex/skills/cancel/SKILL.md +2 -2
- package/plugins/oh-my-codex/skills/deep-interview/SKILL.md +8 -8
- package/plugins/oh-my-codex/skills/omx-setup/SKILL.md +1 -1
- package/plugins/oh-my-codex/skills/pipeline/SKILL.md +22 -11
- package/plugins/oh-my-codex/skills/plan/SKILL.md +8 -8
- package/plugins/oh-my-codex/skills/ralph/SKILL.md +7 -0
- package/plugins/oh-my-codex/skills/ralplan/SKILL.md +4 -4
- package/plugins/oh-my-codex/skills/team/SKILL.md +1 -1
- package/plugins/oh-my-codex/skills/ultragoal/SKILL.md +38 -4
- package/plugins/oh-my-codex/skills/ultrawork/SKILL.md +1 -1
- package/prompts/planner.md +1 -1
- package/skills/autopilot/SKILL.md +77 -47
- package/skills/cancel/SKILL.md +2 -2
- package/skills/deep-interview/SKILL.md +8 -8
- package/skills/omx-setup/SKILL.md +1 -1
- package/skills/pipeline/SKILL.md +22 -11
- package/skills/plan/SKILL.md +8 -8
- package/skills/ralph/SKILL.md +7 -0
- package/skills/ralplan/SKILL.md +4 -4
- package/skills/team/SKILL.md +1 -1
- package/skills/ultragoal/SKILL.md +38 -4
- package/skills/ultrawork/SKILL.md +1 -1
- package/src/scripts/__tests__/codex-native-hook.test.ts +867 -81
- package/src/scripts/__tests__/smoke-packed-install.test.ts +31 -0
- package/src/scripts/__tests__/verify-native-agents.test.ts +21 -1
- package/src/scripts/cleanup-explore-harness.ts +1 -0
- package/src/scripts/codex-native-hook.ts +156 -10
- package/src/scripts/codex-native-pre-post.ts +16 -1
- package/src/scripts/notify-hook/process-runner.ts +40 -16
- package/src/scripts/notify-hook/team-dispatch.ts +9 -5
- package/src/scripts/notify-hook/team-tmux-guard.ts +7 -0
- package/src/scripts/smoke-packed-install.ts +105 -0
- package/src/scripts/sync-plugin-mirror.ts +3 -3
- package/src/scripts/verify-native-agents.ts +2 -2
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
mkdtempSync,
|
|
3
|
+
realpathSync,
|
|
3
4
|
rmSync,
|
|
4
5
|
} from 'node:fs';
|
|
5
6
|
import { mkdirSync } from 'node:fs';
|
|
@@ -24,6 +25,16 @@ export const PACKED_INSTALL_SMOKE_CORE_COMMANDS = [
|
|
|
24
25
|
['sparkshell', '--help'],
|
|
25
26
|
] as const;
|
|
26
27
|
|
|
28
|
+
export const PACKED_INSTALL_NATIVE_HOOK_SMOKE_EVENTS = [
|
|
29
|
+
'SessionStart',
|
|
30
|
+
'PreToolUse',
|
|
31
|
+
'PostToolUse',
|
|
32
|
+
'UserPromptSubmit',
|
|
33
|
+
'PreCompact',
|
|
34
|
+
'PostCompact',
|
|
35
|
+
'Stop',
|
|
36
|
+
] as const;
|
|
37
|
+
|
|
27
38
|
function usage(): string {
|
|
28
39
|
return [
|
|
29
40
|
'Usage: node scripts/smoke-packed-install.mjs',
|
|
@@ -112,6 +123,99 @@ function npmBinName(name: string): string {
|
|
|
112
123
|
return process.platform === 'win32' ? `${name}.cmd` : name;
|
|
113
124
|
}
|
|
114
125
|
|
|
126
|
+
function resolveGlobalNodeModules(prefixDir: string): string {
|
|
127
|
+
const result = run('npm', ['root', '-g', '--prefix', prefixDir], { cwd: prefixDir });
|
|
128
|
+
const root = String(result.stdout || '').trim();
|
|
129
|
+
if (!root) throw new Error('npm root -g did not return a node_modules directory');
|
|
130
|
+
return root;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export function validateHookStdout(eventName: string, stdout: string): void {
|
|
134
|
+
const trimmed = stdout.trim();
|
|
135
|
+
if (!trimmed) return;
|
|
136
|
+
try {
|
|
137
|
+
JSON.parse(trimmed);
|
|
138
|
+
} catch (error) {
|
|
139
|
+
throw new Error(
|
|
140
|
+
`native hook ${eventName} emitted invalid JSON stdout: ${error instanceof Error ? error.message : String(error)}`,
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export function buildNativeHookSmokePayload(
|
|
146
|
+
eventName: typeof PACKED_INSTALL_NATIVE_HOOK_SMOKE_EVENTS[number],
|
|
147
|
+
smokeCwd: string,
|
|
148
|
+
): Record<string, unknown> {
|
|
149
|
+
const base = {
|
|
150
|
+
hook_event_name: eventName,
|
|
151
|
+
session_id: `packed-install-smoke-${eventName}`,
|
|
152
|
+
cwd: smokeCwd,
|
|
153
|
+
};
|
|
154
|
+
switch (eventName) {
|
|
155
|
+
case 'SessionStart':
|
|
156
|
+
return {
|
|
157
|
+
...base,
|
|
158
|
+
transcript_path: join(smokeCwd, 'nonexistent-transcript.jsonl'),
|
|
159
|
+
};
|
|
160
|
+
case 'PreToolUse':
|
|
161
|
+
return {
|
|
162
|
+
...base,
|
|
163
|
+
tool_name: 'Bash',
|
|
164
|
+
tool_use_id: 'packed-install-smoke-tool',
|
|
165
|
+
tool_input: { command: 'echo packed install smoke' },
|
|
166
|
+
};
|
|
167
|
+
case 'PostToolUse':
|
|
168
|
+
return {
|
|
169
|
+
...base,
|
|
170
|
+
tool_name: 'Bash',
|
|
171
|
+
tool_use_id: 'packed-install-smoke-tool',
|
|
172
|
+
tool_input: { command: 'echo packed install smoke' },
|
|
173
|
+
tool_response: {
|
|
174
|
+
exit_code: 0,
|
|
175
|
+
stdout: 'packed install smoke\n',
|
|
176
|
+
stderr: '',
|
|
177
|
+
},
|
|
178
|
+
};
|
|
179
|
+
case 'UserPromptSubmit':
|
|
180
|
+
return {
|
|
181
|
+
...base,
|
|
182
|
+
transcript_path: join(smokeCwd, 'nonexistent-transcript.jsonl'),
|
|
183
|
+
prompt: 'packed install native hook smoke test',
|
|
184
|
+
};
|
|
185
|
+
case 'PreCompact':
|
|
186
|
+
case 'PostCompact':
|
|
187
|
+
case 'Stop':
|
|
188
|
+
return base;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
function smokeInstalledNativeHookDist(prefixDir: string): void {
|
|
193
|
+
const globalNodeModules = resolveGlobalNodeModules(prefixDir);
|
|
194
|
+
const packageRoot = join(globalNodeModules, 'oh-my-codex');
|
|
195
|
+
const hookScript = join(packageRoot, 'dist', 'scripts', 'codex-native-hook.js');
|
|
196
|
+
const smokeCwd = mkdtempSync(join(tmpdir(), 'omx-packed-hook-smoke-'));
|
|
197
|
+
try {
|
|
198
|
+
for (const eventName of PACKED_INSTALL_NATIVE_HOOK_SMOKE_EVENTS) {
|
|
199
|
+
const payload = buildNativeHookSmokePayload(eventName, smokeCwd);
|
|
200
|
+
const result = run(process.execPath, [realpathSync(hookScript)], {
|
|
201
|
+
cwd: smokeCwd,
|
|
202
|
+
env: {
|
|
203
|
+
...process.env,
|
|
204
|
+
OMX_NATIVE_HOOK_DOCTOR_SMOKE: '1',
|
|
205
|
+
OMX_ROOT: join(smokeCwd, '.omx-packed-hook-root'),
|
|
206
|
+
OMX_SESSION_ID: `packed-install-smoke-${eventName}`,
|
|
207
|
+
OMX_SOURCE_CWD: smokeCwd,
|
|
208
|
+
OMX_STARTUP_CWD: smokeCwd,
|
|
209
|
+
},
|
|
210
|
+
input: JSON.stringify(payload),
|
|
211
|
+
});
|
|
212
|
+
validateHookStdout(eventName, result.stdout as string);
|
|
213
|
+
}
|
|
214
|
+
} finally {
|
|
215
|
+
rmSync(smokeCwd, { recursive: true, force: true });
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
115
219
|
export function parseNpmPackJsonOutput(stdout: string): Array<{ filename: string }> {
|
|
116
220
|
const start = stdout.lastIndexOf('\n[');
|
|
117
221
|
const jsonText = (start >= 0 ? stdout.slice(start + 1) : stdout).trim();
|
|
@@ -147,6 +251,7 @@ async function main(): Promise<void> {
|
|
|
147
251
|
for (const argv of PACKED_INSTALL_SMOKE_CORE_COMMANDS) {
|
|
148
252
|
run(omxPath, argv, { cwd: repoRoot });
|
|
149
253
|
}
|
|
254
|
+
smokeInstalledNativeHookDist(prefixDir);
|
|
150
255
|
|
|
151
256
|
console.log('packed install smoke: PASS');
|
|
152
257
|
} finally {
|
|
@@ -55,7 +55,6 @@ const PLUGIN_NAME = "oh-my-codex";
|
|
|
55
55
|
const SETUP_OWNED_PLUGIN_MANIFEST_FIELDS = [
|
|
56
56
|
"agents",
|
|
57
57
|
"prompts",
|
|
58
|
-
"hooks",
|
|
59
58
|
] as const;
|
|
60
59
|
|
|
61
60
|
async function readJsonFile<T>(path: string): Promise<T> {
|
|
@@ -199,13 +198,14 @@ async function assertPluginManifestPolicy(
|
|
|
199
198
|
const pkg = await readJsonFile<PackageJson>(join(root, "package.json"));
|
|
200
199
|
const expectedFields: Pick<
|
|
201
200
|
PluginManifest,
|
|
202
|
-
"name" | "version" | "skills" | "mcpServers" | "apps"
|
|
201
|
+
"name" | "version" | "skills" | "mcpServers" | "apps" | "hooks"
|
|
203
202
|
> = {
|
|
204
203
|
name: PLUGIN_NAME,
|
|
205
204
|
version: pkg.version,
|
|
206
205
|
skills: "./skills/",
|
|
207
206
|
mcpServers: "./.mcp.json",
|
|
208
207
|
apps: "./.app.json",
|
|
208
|
+
hooks: "./hooks/hooks.json",
|
|
209
209
|
};
|
|
210
210
|
|
|
211
211
|
for (const [field, expectedValue] of Object.entries(expectedFields)) {
|
|
@@ -229,7 +229,7 @@ async function assertPluginManifestPolicy(
|
|
|
229
229
|
"plugin_bundle_metadata_out_of_sync",
|
|
230
230
|
"kind=plugin-manifest",
|
|
231
231
|
`field=${field}`,
|
|
232
|
-
"message=setup-owned agents/prompts
|
|
232
|
+
"message=setup-owned agents/prompts must not be plugin-scoped",
|
|
233
233
|
].join("\n"),
|
|
234
234
|
);
|
|
235
235
|
}
|
|
@@ -199,11 +199,11 @@ export async function verifyNativeAgents(
|
|
|
199
199
|
? await readPluginManifest(root)
|
|
200
200
|
: options.pluginManifest;
|
|
201
201
|
if (pluginManifest) {
|
|
202
|
-
for (const field of ["agents", "prompts"
|
|
202
|
+
for (const field of ["agents", "prompts"]) {
|
|
203
203
|
if (pluginManifest[field] !== undefined) {
|
|
204
204
|
throw errorBlock("native_agent_plugin_boundary_violation", {
|
|
205
205
|
field,
|
|
206
|
-
message: "native agents/prompts
|
|
206
|
+
message: "native agents/prompts are setup-owned, not plugin-scoped",
|
|
207
207
|
});
|
|
208
208
|
}
|
|
209
209
|
}
|