oh-my-codex 0.14.0 → 0.14.2
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 +5 -5
- package/Cargo.toml +1 -1
- package/README.md +14 -8
- package/crates/omx-explore/src/main.rs +94 -1
- package/crates/omx-sparkshell/src/codex_bridge.rs +59 -12
- package/crates/omx-sparkshell/tests/execution.rs +48 -0
- package/dist/cli/__tests__/explore.test.js +33 -1
- package/dist/cli/__tests__/explore.test.js.map +1 -1
- package/dist/cli/__tests__/index.test.js +11 -2
- package/dist/cli/__tests__/index.test.js.map +1 -1
- package/dist/cli/__tests__/package-bin-contract.test.js +5 -0
- package/dist/cli/__tests__/package-bin-contract.test.js.map +1 -1
- package/dist/cli/__tests__/question.test.js +139 -25
- package/dist/cli/__tests__/question.test.js.map +1 -1
- package/dist/cli/__tests__/session-scoped-runtime.test.js +30 -0
- package/dist/cli/__tests__/session-scoped-runtime.test.js.map +1 -1
- package/dist/cli/__tests__/setup-agents-overwrite.test.js +32 -7
- package/dist/cli/__tests__/setup-agents-overwrite.test.js.map +1 -1
- package/dist/cli/__tests__/setup-refresh.test.js +8 -6
- package/dist/cli/__tests__/setup-refresh.test.js.map +1 -1
- package/dist/cli/__tests__/sparkshell-cli.test.js +23 -0
- package/dist/cli/__tests__/sparkshell-cli.test.js.map +1 -1
- package/dist/cli/__tests__/uninstall.test.js +65 -5
- package/dist/cli/__tests__/uninstall.test.js.map +1 -1
- package/dist/cli/__tests__/update.test.js +360 -26
- package/dist/cli/__tests__/update.test.js.map +1 -1
- package/dist/cli/explore.d.ts.map +1 -1
- package/dist/cli/explore.js +18 -3
- package/dist/cli/explore.js.map +1 -1
- package/dist/cli/index.d.ts +2 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +7 -2
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/setup.d.ts.map +1 -1
- package/dist/cli/setup.js +25 -3
- package/dist/cli/setup.js.map +1 -1
- package/dist/cli/sparkshell.d.ts.map +1 -1
- package/dist/cli/sparkshell.js +11 -1
- package/dist/cli/sparkshell.js.map +1 -1
- package/dist/cli/team.d.ts.map +1 -1
- package/dist/cli/team.js +159 -394
- package/dist/cli/team.js.map +1 -1
- package/dist/cli/uninstall.d.ts.map +1 -1
- package/dist/cli/uninstall.js +3 -1
- package/dist/cli/uninstall.js.map +1 -1
- package/dist/cli/update.d.ts +37 -9
- package/dist/cli/update.d.ts.map +1 -1
- package/dist/cli/update.js +204 -26
- package/dist/cli/update.js.map +1 -1
- package/dist/config/__tests__/generator-idempotent.test.js +51 -14
- package/dist/config/__tests__/generator-idempotent.test.js.map +1 -1
- package/dist/config/__tests__/generator-notify.test.js +35 -10
- package/dist/config/__tests__/generator-notify.test.js.map +1 -1
- package/dist/config/generator.d.ts +1 -0
- package/dist/config/generator.d.ts.map +1 -1
- package/dist/config/generator.js +61 -7
- package/dist/config/generator.js.map +1 -1
- package/dist/hooks/__tests__/code-review-skill-contract.test.d.ts +2 -0
- package/dist/hooks/__tests__/code-review-skill-contract.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/code-review-skill-contract.test.js +56 -0
- package/dist/hooks/__tests__/code-review-skill-contract.test.js.map +1 -0
- package/dist/hooks/__tests__/deep-interview-contract.test.js +31 -0
- package/dist/hooks/__tests__/deep-interview-contract.test.js.map +1 -1
- package/dist/hooks/__tests__/explicit-terminal-stop-docs-contract.test.d.ts +2 -0
- package/dist/hooks/__tests__/explicit-terminal-stop-docs-contract.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/explicit-terminal-stop-docs-contract.test.js +43 -0
- package/dist/hooks/__tests__/explicit-terminal-stop-docs-contract.test.js.map +1 -0
- package/dist/hooks/__tests__/explicit-terminal-stop-model-docs-contract.test.d.ts +2 -0
- package/dist/hooks/__tests__/explicit-terminal-stop-model-docs-contract.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/explicit-terminal-stop-model-docs-contract.test.js +38 -0
- package/dist/hooks/__tests__/explicit-terminal-stop-model-docs-contract.test.js.map +1 -0
- package/dist/hooks/__tests__/keyword-detector.test.js +108 -0
- package/dist/hooks/__tests__/keyword-detector.test.js.map +1 -1
- package/dist/hooks/__tests__/prompt-guidance-test-helpers.d.ts.map +1 -1
- package/dist/hooks/__tests__/prompt-guidance-test-helpers.js +16 -1
- package/dist/hooks/__tests__/prompt-guidance-test-helpers.js.map +1 -1
- package/dist/hooks/keyword-detector.d.ts.map +1 -1
- package/dist/hooks/keyword-detector.js +34 -8
- package/dist/hooks/keyword-detector.js.map +1 -1
- package/dist/mcp/__tests__/bootstrap.test.js +7 -25
- package/dist/mcp/__tests__/bootstrap.test.js.map +1 -1
- package/dist/mcp/__tests__/server-lifecycle.test.js +60 -0
- package/dist/mcp/__tests__/server-lifecycle.test.js.map +1 -1
- package/dist/mcp/__tests__/state-server.test.js +177 -0
- package/dist/mcp/__tests__/state-server.test.js.map +1 -1
- package/dist/mcp/bootstrap.d.ts.map +1 -1
- package/dist/mcp/bootstrap.js +36 -18
- package/dist/mcp/bootstrap.js.map +1 -1
- package/dist/mcp/state-server.d.ts +17 -0
- package/dist/mcp/state-server.d.ts.map +1 -1
- package/dist/mcp/state-server.js +55 -1
- package/dist/mcp/state-server.js.map +1 -1
- package/dist/notifications/__tests__/index.test.js +0 -3
- package/dist/notifications/__tests__/index.test.js.map +1 -1
- package/dist/notifications/__tests__/session-status.test.js +90 -0
- package/dist/notifications/__tests__/session-status.test.js.map +1 -1
- package/dist/notifications/session-status.d.ts +2 -0
- package/dist/notifications/session-status.d.ts.map +1 -1
- package/dist/notifications/session-status.js +19 -4
- package/dist/notifications/session-status.js.map +1 -1
- package/dist/question/__tests__/deep-interview.test.js +44 -0
- package/dist/question/__tests__/deep-interview.test.js.map +1 -1
- package/dist/question/__tests__/renderer.test.js +192 -12
- package/dist/question/__tests__/renderer.test.js.map +1 -1
- package/dist/question/__tests__/state.test.js +21 -1
- package/dist/question/__tests__/state.test.js.map +1 -1
- package/dist/question/deep-interview.d.ts +3 -0
- package/dist/question/deep-interview.d.ts.map +1 -1
- package/dist/question/deep-interview.js +18 -1
- package/dist/question/deep-interview.js.map +1 -1
- package/dist/question/renderer.d.ts +4 -2
- package/dist/question/renderer.d.ts.map +1 -1
- package/dist/question/renderer.js +87 -18
- package/dist/question/renderer.js.map +1 -1
- package/dist/runtime/__tests__/run-outcome.test.js +38 -0
- package/dist/runtime/__tests__/run-outcome.test.js.map +1 -1
- package/dist/runtime/__tests__/run-state.test.d.ts +2 -0
- package/dist/runtime/__tests__/run-state.test.d.ts.map +1 -0
- package/dist/runtime/__tests__/run-state.test.js +37 -0
- package/dist/runtime/__tests__/run-state.test.js.map +1 -0
- package/dist/runtime/run-loop.d.ts +5 -1
- package/dist/runtime/run-loop.d.ts.map +1 -1
- package/dist/runtime/run-loop.js +8 -3
- package/dist/runtime/run-loop.js.map +1 -1
- package/dist/runtime/run-outcome.d.ts +18 -0
- package/dist/runtime/run-outcome.d.ts.map +1 -1
- package/dist/runtime/run-outcome.js +156 -7
- package/dist/runtime/run-outcome.js.map +1 -1
- package/dist/runtime/run-state.d.ts +5 -1
- package/dist/runtime/run-state.d.ts.map +1 -1
- package/dist/runtime/run-state.js +13 -3
- package/dist/runtime/run-state.js.map +1 -1
- package/dist/runtime/terminal-lifecycle.d.ts +11 -0
- package/dist/runtime/terminal-lifecycle.d.ts.map +1 -0
- package/dist/runtime/terminal-lifecycle.js +52 -0
- package/dist/runtime/terminal-lifecycle.js.map +1 -0
- package/dist/scripts/__tests__/codex-native-hook.test.js +370 -56
- package/dist/scripts/__tests__/codex-native-hook.test.js.map +1 -1
- package/dist/scripts/__tests__/postinstall.test.d.ts +2 -0
- package/dist/scripts/__tests__/postinstall.test.d.ts.map +1 -0
- package/dist/scripts/__tests__/postinstall.test.js +178 -0
- package/dist/scripts/__tests__/postinstall.test.js.map +1 -0
- package/dist/scripts/codex-native-hook.d.ts +1 -0
- package/dist/scripts/codex-native-hook.d.ts.map +1 -1
- package/dist/scripts/codex-native-hook.js +115 -56
- package/dist/scripts/codex-native-hook.js.map +1 -1
- package/dist/scripts/postinstall.d.ts +22 -0
- package/dist/scripts/postinstall.d.ts.map +1 -0
- package/dist/scripts/postinstall.js +105 -0
- package/dist/scripts/postinstall.js.map +1 -0
- package/dist/state/__tests__/operations.test.js +60 -0
- package/dist/state/__tests__/operations.test.js.map +1 -1
- package/dist/state/operations.d.ts.map +1 -1
- package/dist/state/operations.js +18 -1
- package/dist/state/operations.js.map +1 -1
- package/dist/team/__tests__/role-router.test.js +6 -0
- package/dist/team/__tests__/role-router.test.js.map +1 -1
- package/dist/team/__tests__/runtime.test.js +108 -2
- package/dist/team/__tests__/runtime.test.js.map +1 -1
- package/dist/team/runtime.d.ts.map +1 -1
- package/dist/team/runtime.js +18 -4
- package/dist/team/runtime.js.map +1 -1
- package/dist/utils/__tests__/dep-versions.test.js +25 -8
- package/dist/utils/__tests__/dep-versions.test.js.map +1 -1
- package/dist/utils/__tests__/paths.test.js +45 -0
- package/dist/utils/__tests__/paths.test.js.map +1 -1
- package/dist/utils/paths.d.ts +2 -0
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js +22 -7
- package/dist/utils/paths.js.map +1 -1
- package/dist/verification/__tests__/ci-rust-gates.test.js +1 -1
- package/dist/verification/__tests__/ci-rust-gates.test.js.map +1 -1
- package/package.json +3 -2
- package/prompts/architect.md +4 -0
- package/prompts/code-reviewer.md +3 -0
- package/skills/code-review/SKILL.md +94 -28
- package/skills/deep-interview/SKILL.md +91 -0
- package/src/scripts/__tests__/codex-native-hook.test.ts +468 -64
- package/src/scripts/__tests__/postinstall.test.ts +210 -0
- package/src/scripts/codex-native-hook.ts +136 -53
- package/src/scripts/postinstall-bootstrap.js +23 -0
- package/src/scripts/postinstall.ts +161 -0
- package/templates/AGENTS.md +1 -1
- package/templates/model-instructions/explore-lightweight-AGENTS.md +11 -0
- package/templates/model-instructions/sparkshell-lightweight-AGENTS.md +10 -0
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { readFile } from "node:fs/promises";
|
|
2
|
+
import { join, resolve } from "node:path";
|
|
3
|
+
import { pathToFileURL } from "node:url";
|
|
4
|
+
import {
|
|
5
|
+
isInstallVersionBump,
|
|
6
|
+
readUserInstallStamp,
|
|
7
|
+
type UserInstallStamp,
|
|
8
|
+
writeUserInstallStamp,
|
|
9
|
+
} from "../cli/update.js";
|
|
10
|
+
import { setup } from "../cli/setup.js";
|
|
11
|
+
import { getPackageRoot } from "../utils/package.js";
|
|
12
|
+
|
|
13
|
+
type PostinstallStatus =
|
|
14
|
+
| "noop-local"
|
|
15
|
+
| "noop-same-version"
|
|
16
|
+
| "noop-missing-version"
|
|
17
|
+
| "hinted"
|
|
18
|
+
| "setup-ran"
|
|
19
|
+
| "setup-failed";
|
|
20
|
+
|
|
21
|
+
export interface PostinstallResult {
|
|
22
|
+
status: PostinstallStatus;
|
|
23
|
+
version: string | null;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
interface PostinstallDependencies {
|
|
27
|
+
env: NodeJS.ProcessEnv;
|
|
28
|
+
getCurrentVersion: () => Promise<string | null>;
|
|
29
|
+
isInteractive: () => boolean;
|
|
30
|
+
log: (message: string) => void;
|
|
31
|
+
readStamp: () => Promise<UserInstallStamp | null>;
|
|
32
|
+
runSetup: typeof setup;
|
|
33
|
+
warn: (message: string) => void;
|
|
34
|
+
writeStamp: (stamp: UserInstallStamp) => Promise<void>;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function stripLeadingV(version: string): string {
|
|
38
|
+
return version.trim().replace(/^v/i, "");
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function isTruthyEnv(value: string | undefined): boolean {
|
|
42
|
+
return value === "1" || value === "true";
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export function isGlobalInstallLifecycle(env: NodeJS.ProcessEnv = process.env): boolean {
|
|
46
|
+
return isTruthyEnv(env.npm_config_global) || env.npm_config_location === "global";
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function resolveInstallRoot(env: NodeJS.ProcessEnv): string {
|
|
50
|
+
const installPrefix = env.npm_config_prefix?.trim() || env.npm_config_local_prefix?.trim();
|
|
51
|
+
return installPrefix ? resolve(installPrefix) : process.cwd();
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
async function runSetupFromInstallRoot(
|
|
55
|
+
runSetup: typeof setup,
|
|
56
|
+
installRoot: string,
|
|
57
|
+
): Promise<void> {
|
|
58
|
+
const previousCwd = process.cwd();
|
|
59
|
+
if (previousCwd === installRoot) {
|
|
60
|
+
await runSetup();
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
process.chdir(installRoot);
|
|
65
|
+
try {
|
|
66
|
+
await runSetup();
|
|
67
|
+
} finally {
|
|
68
|
+
process.chdir(previousCwd);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
async function getCurrentVersion(): Promise<string | null> {
|
|
73
|
+
try {
|
|
74
|
+
const packageJsonPath = join(getPackageRoot(), "package.json");
|
|
75
|
+
const content = await readFile(packageJsonPath, "utf-8");
|
|
76
|
+
const parsed = JSON.parse(content) as { version?: string };
|
|
77
|
+
return typeof parsed.version === "string" ? parsed.version : null;
|
|
78
|
+
} catch {
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const defaultDependencies: PostinstallDependencies = {
|
|
84
|
+
env: process.env,
|
|
85
|
+
getCurrentVersion,
|
|
86
|
+
isInteractive: () => Boolean(process.stdin.isTTY && process.stdout.isTTY),
|
|
87
|
+
log: (message) => console.log(message),
|
|
88
|
+
readStamp: () => readUserInstallStamp(),
|
|
89
|
+
runSetup: setup,
|
|
90
|
+
warn: (message) => console.warn(message),
|
|
91
|
+
writeStamp: (stamp) => writeUserInstallStamp(stamp),
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
export async function runPostinstall(
|
|
95
|
+
dependencies: Partial<PostinstallDependencies> = {},
|
|
96
|
+
): Promise<PostinstallResult> {
|
|
97
|
+
const resolved = { ...defaultDependencies, ...dependencies };
|
|
98
|
+
const { env } = resolved;
|
|
99
|
+
|
|
100
|
+
if (!isGlobalInstallLifecycle(env)) {
|
|
101
|
+
return { status: "noop-local", version: null };
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
const currentVersion = await resolved.getCurrentVersion();
|
|
105
|
+
if (!currentVersion) {
|
|
106
|
+
return { status: "noop-missing-version", version: null };
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
const currentStampVersion = stripLeadingV(currentVersion);
|
|
110
|
+
const existingStamp = await resolved.readStamp();
|
|
111
|
+
if (!isInstallVersionBump(currentVersion, existingStamp)) {
|
|
112
|
+
return { status: "noop-same-version", version: currentStampVersion };
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
await resolved.writeStamp({
|
|
116
|
+
installed_version: currentStampVersion,
|
|
117
|
+
...(typeof existingStamp?.setup_completed_version === "string"
|
|
118
|
+
? { setup_completed_version: existingStamp.setup_completed_version }
|
|
119
|
+
: {}),
|
|
120
|
+
updated_at: new Date().toISOString(),
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
if (!resolved.isInteractive()) {
|
|
124
|
+
resolved.log(
|
|
125
|
+
`[omx] Installed oh-my-codex v${currentStampVersion}. Run \`omx setup\` (interactive) or \`omx update\` when you're ready.`,
|
|
126
|
+
);
|
|
127
|
+
return { status: "hinted", version: currentStampVersion };
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
resolved.log(
|
|
131
|
+
`[omx] Detected oh-my-codex v${currentStampVersion} install/update. Launching interactive setup...`,
|
|
132
|
+
);
|
|
133
|
+
|
|
134
|
+
try {
|
|
135
|
+
await runSetupFromInstallRoot(resolved.runSetup, resolveInstallRoot(env));
|
|
136
|
+
await resolved.writeStamp({
|
|
137
|
+
installed_version: currentStampVersion,
|
|
138
|
+
setup_completed_version: currentStampVersion,
|
|
139
|
+
updated_at: new Date().toISOString(),
|
|
140
|
+
});
|
|
141
|
+
resolved.log(`[omx] Setup refresh completed for v${currentStampVersion}.`);
|
|
142
|
+
return { status: "setup-ran", version: currentStampVersion };
|
|
143
|
+
} catch (error) {
|
|
144
|
+
resolved.warn(
|
|
145
|
+
`[omx] Postinstall setup skipped after a non-fatal error: ${error instanceof Error ? error.message : String(error)}`,
|
|
146
|
+
);
|
|
147
|
+
return { status: "setup-failed", version: currentStampVersion };
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export async function main(): Promise<void> {
|
|
152
|
+
await runPostinstall();
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
|
|
156
|
+
main().catch((error) => {
|
|
157
|
+
console.warn(
|
|
158
|
+
`[omx] Postinstall setup skipped after a non-fatal error: ${error instanceof Error ? error.message : String(error)}`,
|
|
159
|
+
);
|
|
160
|
+
});
|
|
161
|
+
}
|
package/templates/AGENTS.md
CHANGED
|
@@ -234,7 +234,7 @@ Runtime availability gate:
|
|
|
234
234
|
- Treat `autopilot`, `ralph`, `ultrawork`, `ultraqa`, `team`/`swarm`, and `ecomode` as **OMX runtime workflows**, not generic prompt aliases.
|
|
235
235
|
- Auto-activate runtime workflows only when the current session is actually running under OMX CLI/runtime (for example, launched via `omx`, with OMX session overlay/runtime state available, or when the user explicitly asks to run `omx ...` in the shell).
|
|
236
236
|
- In Codex App or plain Codex sessions without OMX runtime, do **not** treat those keywords alone as activation. Explain that they require OMX CLI runtime support, and continue with the nearest App-safe surface (`deep-interview`, `ralplan`, `plan`, or native subagents) unless the user explicitly wants you to launch OMX from the shell.
|
|
237
|
-
- When deep-interview is active in OMX CLI/runtime, ask interview rounds via `omx question`; do not substitute `request_user_input` or ad hoc plain-text questioning, and respect Stop-hook blocking while a deep-interview question obligation is pending.
|
|
237
|
+
- When deep-interview is active in OMX CLI/runtime, ask interview rounds via `omx question`; after launching `omx question` in a background terminal, wait for that terminal to finish and read the JSON answer before continuing; do not substitute `request_user_input` or ad hoc plain-text questioning, and respect Stop-hook blocking while a deep-interview question obligation is pending.
|
|
238
238
|
|
|
239
239
|
<triage_routing>
|
|
240
240
|
## Triage: advisory prompt-routing context
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# OMX Explore Lightweight Instructions
|
|
2
|
+
|
|
3
|
+
You are executing the `omx explore` command path.
|
|
4
|
+
|
|
5
|
+
Constraints:
|
|
6
|
+
- keep output concise and repository-focused
|
|
7
|
+
- read-only only
|
|
8
|
+
- prefer direct file/symbol/pattern lookup over orchestration
|
|
9
|
+
- do not use multi-agent workflows
|
|
10
|
+
- do not expand into planning/execution mode behavior
|
|
11
|
+
- return only the minimal answer needed for the explore request
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# OMX SparkShell Lightweight Instructions
|
|
2
|
+
|
|
3
|
+
You are executing the `omx sparkshell` summary path.
|
|
4
|
+
|
|
5
|
+
Constraints:
|
|
6
|
+
- summarize command output cheaply and concisely
|
|
7
|
+
- do not broaden into repo planning or orchestration behavior
|
|
8
|
+
- preserve important failures and warnings
|
|
9
|
+
- prefer short factual summaries over long prose
|
|
10
|
+
- do not suggest edits or implementation plans unless explicitly required by the command output
|