sneakoscope 10.3.9 → 10.4.0
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/README.md +6 -6
- package/config/skills-hash-ledger.v1.json +2 -1
- package/crates/sks-core/Cargo.lock +1 -1
- package/crates/sks-core/Cargo.toml +1 -1
- package/dist/bin/fast-inline.js +1 -2
- package/dist/cli/codex-app-command.js +1 -1
- package/dist/cli/feature-commands.js +1 -2
- package/dist/cli/global-mode-router.js +0 -16
- package/dist/commands/codex-native.js +1 -7
- package/dist/commands/codex.js +5 -6
- package/dist/commands/doctor-console.js +1 -11
- package/dist/commands/doctor-helpers.js +2 -20
- package/dist/commands/doctor.js +0 -5
- package/dist/config/skills-manifest.json +5 -4
- package/dist/core/agent-bridge/async-command.js +5 -3
- package/dist/core/agents/agent-effort-policy.js +4 -7
- package/dist/core/agents/agent-orchestrator.js +0 -1
- package/dist/core/agents/agent-roster.js +2 -4
- package/dist/core/agents/native-worker-backend-router.js +7 -15
- package/dist/core/code-structure.js +0 -1
- package/dist/core/codex/codex-cli-update.js +10 -168
- package/dist/core/codex/codex-permission-profiles.js +0 -39
- package/dist/core/codex-app/codex-agent-role-sync.js +1 -35
- package/dist/core/codex-app/codex-app-execution-profile.js +2 -5
- package/dist/core/codex-app/codex-model-catalog.js +0 -3
- package/dist/core/codex-app/openrouter-provider.js +0 -1
- package/dist/core/codex-app.js +10 -46
- package/dist/core/codex-compat/codex-compat-report.js +4 -6
- package/dist/core/codex-compat/codex-hook-output-builders.js +3 -0
- package/dist/core/codex-compat/codex-runtime-contract.js +4 -44
- package/dist/core/codex-compat/codex-version-policy.js +29 -67
- package/dist/core/codex-compat/codex-version.js +1 -4
- package/dist/core/codex-control/codex-current-app-capability.js +7 -66
- package/dist/core/codex-control/codex-current-capability.js +32 -140
- package/dist/core/codex-control/codex-sdk-config-policy.js +2 -1
- package/dist/core/codex-exec-output-schema.js +7 -119
- package/dist/core/codex-lb/codex-lb-env.js +0 -19
- package/dist/core/codex-lb/combined-catalog/builder.js +2 -2
- package/dist/core/codex-lb/combined-catalog/latest-generation.js +53 -0
- package/dist/core/codex-lb/desktop-controller-v3/live-probes.js +2 -3
- package/dist/core/codex-lb/desktop-controller-v3/preflight-probes.js +2 -3
- package/dist/core/codex-lb/desktop-controller-v3/probe-route.js +23 -0
- package/dist/core/codex-model-guard.js +0 -9
- package/dist/core/codex-native/codex-native-feature-broker.js +18 -99
- package/dist/core/codex-native/codex-native-feature-matrix.js +2 -12
- package/dist/core/codex-native/codex-native-harness-compat.js +1 -4
- package/dist/core/codex-native/codex-native-invocation-router.js +2 -10
- package/dist/core/codex-native/core-skill-manifest.js +1 -1
- package/dist/core/codex-plugins/codex-plugin-json.js +20 -89
- package/dist/core/codex-plugins/codex-plugin-repair.js +0 -4
- package/dist/core/commands/mad-sks-command.js +2 -10
- package/dist/core/commands/naruto-command.js +2 -2
- package/dist/core/commands/qa-loop-command.js +1 -1
- package/dist/core/doctor/codex-current-app-doctor.js +0 -9
- package/dist/core/doctor/doctor-codex-startup-repair.js +9 -5
- package/dist/core/doctor/doctor-readiness-matrix.js +0 -6
- package/dist/core/doctor/retired-managed-residue-artifacts.js +2 -1
- package/dist/core/doctor/retired-managed-residue-runtime.js +27 -0
- package/dist/core/doctor/stale-subagent-default.js +30 -0
- package/dist/core/harness-conflicts.js +1 -1
- package/dist/core/harness-guard.js +123 -22
- package/dist/core/hooks-runtime/exclusive-gui-surface-gate.js +155 -0
- package/dist/core/hooks-runtime/global-role-pin-refresh.js +25 -0
- package/dist/core/hooks-runtime/hook-context.js +3 -1
- package/dist/core/hooks-runtime/hook-io.js +3 -3
- package/dist/core/hooks-runtime/jev-spawn-routing.js +10 -7
- package/dist/core/hooks-runtime/managed-guidance-preflight.js +20 -2
- package/dist/core/hooks-runtime/official-subagent-lifecycle.js +24 -10
- package/dist/core/hooks-runtime/parent-orchestration-gate.js +14 -27
- package/dist/core/hooks-runtime/payload-signals.js +1 -1
- package/dist/core/hooks-runtime/shell-tool-name.js +1 -0
- package/dist/core/hooks-runtime/spawn-role-pin-heal.js +15 -0
- package/dist/core/hooks-runtime/spawn-tool-name.js +7 -0
- package/dist/core/hooks-runtime/subagent-context.js +10 -0
- package/dist/core/hooks-runtime/subagent-spawn-policy.js +7 -4
- package/dist/core/hooks-runtime/subagent-stop-hook.js +2 -0
- package/dist/core/hooks-runtime.js +30 -18
- package/dist/core/image-ux-review.js +2 -4
- package/dist/core/init/skills.js +1 -1
- package/dist/core/init.js +2 -1
- package/dist/core/loops/loop-concurrency-budget.js +0 -22
- package/dist/core/loops/loop-gate-selector.js +1 -1
- package/dist/core/loops/loop-worker-runtime.js +3 -9
- package/dist/core/mad-sks/sql-plane/operation-store.js +5 -1
- package/dist/core/managed-assets/managed-assets-manifest.js +1 -1
- package/dist/core/naruto/naruto-loop-mesh.js +1 -5
- package/dist/core/naruto/naruto-loop-worker-router.js +0 -7
- package/dist/core/pipeline-internals/runtime-core.js +2 -3
- package/dist/core/pipeline.js +1 -5
- package/dist/core/proof/evidence-collector.js +0 -2
- package/dist/core/provider/model-router.js +12 -20
- package/dist/core/qa-loop.js +1 -4
- package/dist/core/recallpulse/policy.js +3 -3
- package/dist/core/recallpulse.js +1 -1
- package/dist/core/release/canonical-test-proof.js +0 -1
- package/dist/core/release/gate-affected-globs.js +0 -1
- package/dist/core/release/release-authorization-snapshot.js +2 -2
- package/dist/core/release/release-gate-contract.js +0 -1
- package/dist/core/release/release-real-contract.js +0 -1
- package/dist/core/release/runtime-script-pack-closure.js +3 -5
- package/dist/core/research/mock-result.js +3 -3
- package/dist/core/research/research-adversarial-review.js +12 -12
- package/dist/core/research/research-claim-synthesizer.js +5 -5
- package/dist/core/research/research-falsification-runner.js +5 -5
- package/dist/core/research/research-plan-markdown.js +1 -1
- package/dist/core/research/research-super-search.js +2 -2
- package/dist/core/research/research-synthesis-writer.js +4 -4
- package/dist/core/research.js +7 -8
- package/dist/core/routes.js +7 -5
- package/dist/core/safety/ssot-authority-inventory.js +0 -1
- package/dist/core/subagents/agent-catalog.js +3 -0
- package/dist/core/subagents/child-thread-activity.js +37 -0
- package/dist/core/subagents/exclusive-surface-rule.js +3 -0
- package/dist/core/subagents/exclusive-tool-surface.js +19 -0
- package/dist/core/subagents/model-policy.js +8 -11
- package/dist/core/subagents/model-tiers.js +99 -22
- package/dist/core/subagents/naruto-help-contract.js +8 -8
- package/dist/core/subagents/naruto-host-credentials.js +3 -3
- package/dist/core/subagents/official-subagent-config.js +11 -5
- package/dist/core/subagents/official-subagent-prompt.js +3 -1
- package/dist/core/subagents/official-subagent-runner.js +5 -10
- package/dist/core/subagents/role-model-pins.js +84 -0
- package/dist/core/subagents/subagent-evidence.js +5 -3
- package/dist/core/subagents/wave-lifecycle.js +10 -28
- package/dist/core/triwiki/context-graph/compiler/cache-key.js +0 -1
- package/dist/core/triwiki/context-graph/extractors/topology/gates.js +1 -2
- package/dist/core/triwiki/triwiki-module-card.js +0 -1
- package/dist/core/version-manager.js +0 -6
- package/dist/core/version.js +1 -1
- package/dist/native/sks-menubar/Sources/SettingsViewController.swift +1 -1
- package/dist/scripts/codex-app-handoff-check.js +0 -1
- package/dist/scripts/codex-app-handoff-launch-check.js +0 -1
- package/dist/scripts/codex-current-app-server-v2-check.js +13 -5
- package/dist/scripts/codex-current-binary-identity-check.js +1 -1
- package/dist/scripts/codex-current-capability-check.js +4 -9
- package/dist/scripts/codex-native-agent-role-content-check.js +2 -2
- package/dist/scripts/codex-native-gate-lib.js +15 -101
- package/dist/scripts/codex-native-runtime-e2e-fixture.js +2 -14
- package/dist/scripts/codex-plugin-app-template-policy-check.js +0 -1
- package/dist/scripts/codex-sdk-backend-router-check.js +4 -5
- package/dist/scripts/context-graph-check.js +1 -1
- package/dist/scripts/docs-truthfulness-check.js +0 -1
- package/dist/scripts/mcp-plugin-inventory-check.js +0 -1
- package/dist/scripts/packlist-performance-check.js +1 -1
- package/dist/scripts/pipeline-codex-native-doctor-mad-routing-real-blackbox.js +0 -2
- package/dist/scripts/pipeline-codex-native-image-routing-real-blackbox.js +0 -1
- package/dist/scripts/pipeline-codex-native-loop-routing-real-blackbox.js +1 -22
- package/dist/scripts/pipeline-codex-native-qa-routing-real-blackbox.js +0 -1
- package/dist/scripts/pipeline-codex-native-research-routing-real-blackbox.js +0 -1
- package/dist/scripts/release-metadata-check.js +4 -20
- package/dist/scripts/release-parallel-speed-budget-check.js +1 -1
- package/dist/scripts/release-real-check.js +0 -1
- package/dist/scripts/runtime-domain-gate-lib.js +2 -6
- package/dist/scripts/typed-routing-gate-lib.js +16 -51
- package/package.json +3 -6
- package/release-gates.v2.json +2 -39
- package/runtime-required-scripts.json +0 -5
- package/dist/core/architecture-hardening/contracts/contracts.js +0 -253
- package/dist/core/architecture-hardening/state/state-service.js +0 -191
- package/dist/core/codex-app/codex-agent-type-probe.js +0 -228
- package/dist/core/codex-app/codex-desktop-routing-ownership.js +0 -90
- package/dist/core/codex-app/codex-models-cache.js +0 -153
- package/dist/core/codex-app/mcp-manager.js +0 -71
- package/dist/core/codex-app/multi-provider-router-support.js +0 -25
- package/dist/core/codex-app/role-model-catalog-priority.js +0 -61
- package/dist/core/codex-compat/codex-capability-matrix.js +0 -208
- package/dist/core/codex-compat/codex-hook-output-normalizer.js +0 -45
- package/dist/core/codex-control/codex-current-collab-agent-real-probe.js +0 -65
- package/dist/core/codex-control/codex-current-core-capability.js +0 -163
- package/dist/core/codex-control/codex-current-core-native-exec.js +0 -25
- package/dist/core/codex-control/codex-current-core-probe-runner.js +0 -191
- package/dist/core/codex-control/codex-current-core-real-probes.js +0 -88
- package/dist/core/codex-control/codex-current-doctor-real-probe.js +0 -69
- package/dist/core/codex-control/codex-current-feature-capability.js +0 -124
- package/dist/core/codex-control/codex-current-feature-probes.js +0 -190
- package/dist/core/codex-control/codex-current-image-path-real-probe.js +0 -114
- package/dist/core/codex-control/codex-current-plugin-real-probes.js +0 -118
- package/dist/core/codex-control/codex-current-rich-schema-real-probe.js +0 -42
- package/dist/core/codex-control/codex-current-sandbox-real-probe.js +0 -104
- package/dist/core/codex-control/codex-current-usage-parser.js +0 -80
- package/dist/core/codex-control/codex-current-web-search-probe.js +0 -90
- package/dist/core/codex-control/codex-tool-schema-fixtures.js +0 -56
- package/dist/core/codex-lb/probes/cli-image-tool-probe.js +0 -203
- package/dist/core/codex-lb-circuit.js +0 -126
- package/dist/core/codex-native/codex-native-pattern-analysis.js +0 -66
- package/dist/core/codex-native/codex-native-reference-cache.js +0 -95
- package/dist/core/codex-native/codex-native-reference-evidence.js +0 -1
- package/dist/core/codex-native/codex-native-reference-source.js +0 -146
- package/dist/core/codex-native/codex-native-rename-map.js +0 -24
- package/dist/core/config/managed-config-merge.js +0 -153
- package/dist/core/evidence/v2/evidence-key.js +0 -132
- package/dist/core/observability/architecture-hardening/safe-projection.js +0 -65
- package/dist/core/pipeline/active-context.js +0 -1
- package/dist/core/pipeline/agent-stage-policy.js +0 -1
- package/dist/core/pipeline/pipeline-plan-writer.js +0 -1
- package/dist/core/pipeline/plan-schema.js +0 -1
- package/dist/core/pipeline/prompt-context-answer.js +0 -1
- package/dist/core/pipeline/prompt-context-computer-use.js +0 -1
- package/dist/core/pipeline/prompt-context-dfix.js +0 -1
- package/dist/core/pipeline/prompt-context.js +0 -1
- package/dist/core/pipeline/route-prep-db.js +0 -1
- package/dist/core/pipeline/route-prep-gx.js +0 -1
- package/dist/core/pipeline/route-prep-image-ux.js +0 -1
- package/dist/core/pipeline/route-prep-ppt.js +0 -1
- package/dist/core/pipeline/route-prep-qa.js +0 -1
- package/dist/core/pipeline/route-prep-research.js +0 -1
- package/dist/core/pipeline/route-prep.js +0 -1
- package/dist/core/pipeline/stage-policy.js +0 -1
- package/dist/core/pipeline/stop-gate-context7.js +0 -1
- package/dist/core/pipeline/stop-gate-proof.js +0 -1
- package/dist/core/pipeline/stop-gate-subagents.js +0 -1
- package/dist/core/pipeline/stop-gate.js +0 -1
- package/dist/core/pipeline/validation.js +0 -1
- package/dist/core/providers/openrouter/openrouter-request-cache.js +0 -73
- package/dist/core/providers/openrouter/openrouter-stream.js +0 -201
- package/dist/core/routes/model-mode-router.js +0 -33
- package/dist/core/runtime/progress-recovery/progress-recovery.js +0 -89
- package/dist/core/source-intelligence/codex-history-search.js +0 -70
- package/dist/core/stop-gate/stop-gate-writer.js +0 -139
- package/dist/core/subagents/terminology.js +0 -20
- package/dist/scripts/codex-agent-type-routing-check.js +0 -3
- package/dist/scripts/codex-current-core-real-probes-check.js +0 -49
- package/dist/scripts/managed-config-merge-check.js +0 -23
- package/infra-harness-gates.json +0 -4
- package/schemas/codex-release-manifest.schema.json +0 -44
- package/schemas/doctor-status-v2.schema.json +0 -42
|
@@ -10,8 +10,6 @@ const CODEX_CLI_UPDATE_JSON_OUTPUT_LIMIT_BYTES = 60 * 1024;
|
|
|
10
10
|
const CODEX_CLI_UPDATE_RAW_OUTPUT_LIMIT_BYTES = 20 * 1024;
|
|
11
11
|
const CODEX_CLI_UPDATE_ARRAY_LIMIT = 12;
|
|
12
12
|
const CODEX_CLI_UPDATE_ARRAY_ITEM_LIMIT_BYTES = 768;
|
|
13
|
-
const CODEX_STANDALONE_INSTALLER_URL = 'https://chatgpt.com/codex/install.sh';
|
|
14
|
-
const CODEX_STANDALONE_INSTALLER_PS1_URL = 'https://chatgpt.com/codex/install.ps1';
|
|
15
13
|
export function codexCliUpdateConsoleLines(result) {
|
|
16
14
|
return [
|
|
17
15
|
`Codex CLI update: ${safeUpdateText(result.status, 64)}${result.after_version ? ` (${safeUpdateText(result.before_version || 'unknown', 128)} -> ${safeUpdateText(result.after_version, 128)})` : ''}`,
|
|
@@ -180,15 +178,7 @@ export async function updateCodexCliNow(opts = {}) {
|
|
|
180
178
|
const capabilityOutput = `${capability.stdout || ''}${capability.stderr || ''}`.trim();
|
|
181
179
|
const nativeSelfUpdateSupported = capability.code === 0
|
|
182
180
|
&& /Usage:\s+codex\s+update\b/i.test(capabilityOutput);
|
|
183
|
-
|
|
184
|
-
? {
|
|
185
|
-
method: 'native-self-update',
|
|
186
|
-
command: 'codex update',
|
|
187
|
-
executable: before.path,
|
|
188
|
-
args: ['update']
|
|
189
|
-
}
|
|
190
|
-
: await detectCodexCliUpdatePlan({ before, env, deps, run });
|
|
191
|
-
if (!updatePlan) {
|
|
181
|
+
if (!nativeSelfUpdateSupported) {
|
|
192
182
|
return updateResult({
|
|
193
183
|
ok: false,
|
|
194
184
|
status: 'failed',
|
|
@@ -200,18 +190,17 @@ export async function updateCodexCliNow(opts = {}) {
|
|
|
200
190
|
updateMethod: 'unknown',
|
|
201
191
|
blockers: ['codex_cli_update_method_unverified'],
|
|
202
192
|
guidance: [
|
|
203
|
-
'The selected Codex CLI
|
|
204
|
-
'Reinstall Codex with
|
|
193
|
+
'The selected Codex CLI does not advertise native self-update (codex update).',
|
|
194
|
+
'Reinstall or update Codex with its official installer, then retry.'
|
|
205
195
|
]
|
|
206
196
|
});
|
|
207
197
|
}
|
|
208
|
-
const
|
|
209
|
-
|
|
210
|
-
:
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
}).catch((err) => failedProcessResult(err));
|
|
198
|
+
const updatePlan = { method: 'native-self-update', command: 'codex update' };
|
|
199
|
+
const result = await run(before.path, ['update'], {
|
|
200
|
+
timeoutMs: 180_000,
|
|
201
|
+
maxOutputBytes: 128 * 1024,
|
|
202
|
+
env
|
|
203
|
+
}).catch((err) => failedProcessResult(err));
|
|
215
204
|
const rawOutput = `${result.stdout || ''}${result.stderr || ''}`.trim();
|
|
216
205
|
if (result.code !== 0) {
|
|
217
206
|
return updateResult({
|
|
@@ -223,7 +212,7 @@ export async function updateCodexCliNow(opts = {}) {
|
|
|
223
212
|
updateStatus: null,
|
|
224
213
|
command: updatePlan.command,
|
|
225
214
|
updateMethod: updatePlan.method,
|
|
226
|
-
blockers: [
|
|
215
|
+
blockers: ['codex_cli_self_update_failed'],
|
|
227
216
|
guidance: [`Run the detected updater in a terminal to review its output: ${updatePlan.command}`]
|
|
228
217
|
});
|
|
229
218
|
}
|
|
@@ -365,153 +354,6 @@ export function compareCodexCliVersions(left, right) {
|
|
|
365
354
|
return -1;
|
|
366
355
|
return aPre.localeCompare(bPre, undefined, { numeric: true });
|
|
367
356
|
}
|
|
368
|
-
async function detectCodexCliUpdatePlan(input) {
|
|
369
|
-
const selectedPath = path.resolve(input.before.path);
|
|
370
|
-
const selectedRealPath = await realPathOrResolved(selectedPath);
|
|
371
|
-
const codexHome = await realPathOrResolved(input.env.CODEX_HOME || path.join(input.env.HOME || os.homedir(), '.codex'));
|
|
372
|
-
const standaloneRoot = await realPathOrResolved(path.join(codexHome, 'packages', 'standalone'));
|
|
373
|
-
if (isWithin(selectedRealPath, standaloneRoot)) {
|
|
374
|
-
return {
|
|
375
|
-
method: 'standalone-installer',
|
|
376
|
-
command: process.platform === 'win32'
|
|
377
|
-
? `powershell -NoProfile -Command "irm ${CODEX_STANDALONE_INSTALLER_PS1_URL} | iex"`
|
|
378
|
-
: `curl -fsSL ${CODEX_STANDALONE_INSTALLER_URL} | CODEX_NON_INTERACTIVE=1 sh`,
|
|
379
|
-
executable: '',
|
|
380
|
-
args: []
|
|
381
|
-
};
|
|
382
|
-
}
|
|
383
|
-
const brew = await resolveUpdateExecutable('brew', input.env, input.deps);
|
|
384
|
-
if (brew) {
|
|
385
|
-
const caskPrefixResult = await input.run(brew, ['--prefix', '--cask', 'codex'], {
|
|
386
|
-
timeoutMs: 10_000,
|
|
387
|
-
maxOutputBytes: 16 * 1024,
|
|
388
|
-
env: input.env
|
|
389
|
-
}).catch((err) => failedProcessResult(err));
|
|
390
|
-
const caskPrefix = caskPrefixResult.code === 0
|
|
391
|
-
? String(caskPrefixResult.stdout || '').trim().split(/\r?\n/).find(Boolean) || ''
|
|
392
|
-
: '';
|
|
393
|
-
if (caskPrefix && isWithin(selectedRealPath, await realPathOrResolved(caskPrefix))) {
|
|
394
|
-
return {
|
|
395
|
-
method: 'homebrew-cask',
|
|
396
|
-
command: 'brew upgrade --cask codex',
|
|
397
|
-
executable: brew,
|
|
398
|
-
args: ['upgrade', '--cask', 'codex']
|
|
399
|
-
};
|
|
400
|
-
}
|
|
401
|
-
}
|
|
402
|
-
const npm = await resolveUpdateExecutable('npm', input.env, input.deps);
|
|
403
|
-
if (npm) {
|
|
404
|
-
const [rootResult, prefixResult] = await Promise.all([
|
|
405
|
-
input.run(npm, ['root', '-g'], {
|
|
406
|
-
timeoutMs: 10_000,
|
|
407
|
-
maxOutputBytes: 16 * 1024,
|
|
408
|
-
env: input.env
|
|
409
|
-
}).catch((err) => failedProcessResult(err)),
|
|
410
|
-
input.run(npm, ['prefix', '-g'], {
|
|
411
|
-
timeoutMs: 10_000,
|
|
412
|
-
maxOutputBytes: 16 * 1024,
|
|
413
|
-
env: input.env
|
|
414
|
-
}).catch((err) => failedProcessResult(err))
|
|
415
|
-
]);
|
|
416
|
-
const npmRoot = rootResult.code === 0
|
|
417
|
-
? String(rootResult.stdout || '').trim().split(/\r?\n/).find(Boolean) || ''
|
|
418
|
-
: '';
|
|
419
|
-
const npmPrefix = prefixResult.code === 0
|
|
420
|
-
? String(prefixResult.stdout || '').trim().split(/\r?\n/).find(Boolean) || ''
|
|
421
|
-
: '';
|
|
422
|
-
const packageDir = npmRoot ? await realPathOrResolved(path.resolve(npmRoot, '@openai', 'codex')) : '';
|
|
423
|
-
const npmBinCandidates = npmPrefix
|
|
424
|
-
? process.platform === 'win32'
|
|
425
|
-
? ['codex.cmd', 'codex.exe', 'codex'].map((name) => path.resolve(npmPrefix, name))
|
|
426
|
-
: [path.resolve(npmPrefix, 'bin', 'codex')]
|
|
427
|
-
: [];
|
|
428
|
-
const packageInstalled = Boolean(packageDir) && await exists(packageDir);
|
|
429
|
-
if (packageInstalled && (isWithin(selectedRealPath, packageDir)
|
|
430
|
-
|| npmBinCandidates.includes(selectedPath))) {
|
|
431
|
-
return {
|
|
432
|
-
method: 'npm-global',
|
|
433
|
-
command: 'npm install -g @openai/codex@latest',
|
|
434
|
-
executable: npm,
|
|
435
|
-
args: ['install', '-g', '@openai/codex@latest']
|
|
436
|
-
};
|
|
437
|
-
}
|
|
438
|
-
}
|
|
439
|
-
return null;
|
|
440
|
-
}
|
|
441
|
-
async function runStandaloneInstallerUpdate(input) {
|
|
442
|
-
if (process.platform === 'win32') {
|
|
443
|
-
const powershell = await resolveUpdateExecutable('pwsh', input.env, input.deps)
|
|
444
|
-
|| await resolveUpdateExecutable('powershell', input.env, input.deps);
|
|
445
|
-
if (!powershell)
|
|
446
|
-
return failedProcessResult(new Error('codex_cli_standalone_update_prerequisite_missing'));
|
|
447
|
-
const codexHome = path.resolve(input.env.CODEX_HOME || path.join(input.env.HOME || os.homedir(), '.codex'));
|
|
448
|
-
return input.run(powershell, [
|
|
449
|
-
'-NoProfile',
|
|
450
|
-
'-NonInteractive',
|
|
451
|
-
'-ExecutionPolicy',
|
|
452
|
-
'Bypass',
|
|
453
|
-
'-Command',
|
|
454
|
-
`$ErrorActionPreference='Stop'; Invoke-RestMethod '${CODEX_STANDALONE_INSTALLER_PS1_URL}' | Invoke-Expression`
|
|
455
|
-
], {
|
|
456
|
-
timeoutMs: 180_000,
|
|
457
|
-
maxOutputBytes: 128 * 1024,
|
|
458
|
-
env: {
|
|
459
|
-
...input.env,
|
|
460
|
-
CODEX_HOME: codexHome,
|
|
461
|
-
CODEX_INSTALL_DIR: path.dirname(input.before.path),
|
|
462
|
-
CODEX_NON_INTERACTIVE: '1'
|
|
463
|
-
}
|
|
464
|
-
}).catch((err) => failedProcessResult(err));
|
|
465
|
-
}
|
|
466
|
-
const curl = await resolveUpdateExecutable('curl', input.env, input.deps);
|
|
467
|
-
const shell = await resolveUpdateExecutable('sh', input.env, input.deps);
|
|
468
|
-
if (!curl || !shell) {
|
|
469
|
-
return failedProcessResult(new Error('codex_cli_standalone_update_prerequisite_missing'));
|
|
470
|
-
}
|
|
471
|
-
const download = await input.run(curl, ['-fsSL', CODEX_STANDALONE_INSTALLER_URL], {
|
|
472
|
-
timeoutMs: 30_000,
|
|
473
|
-
maxOutputBytes: 512 * 1024,
|
|
474
|
-
env: input.env
|
|
475
|
-
}).catch((err) => failedProcessResult(err));
|
|
476
|
-
const installer = String(download.stdout || '');
|
|
477
|
-
if (download.code !== 0 || !/^#!\/bin\/sh\s*$/m.test(installer) || !installer.includes('CODEX_NON_INTERACTIVE')) {
|
|
478
|
-
return {
|
|
479
|
-
...download,
|
|
480
|
-
code: download.code === 0 ? 1 : download.code,
|
|
481
|
-
stderr: String(download.stderr || 'codex_cli_standalone_installer_download_untrusted')
|
|
482
|
-
};
|
|
483
|
-
}
|
|
484
|
-
const codexHome = path.resolve(input.env.CODEX_HOME || path.join(input.env.HOME || os.homedir(), '.codex'));
|
|
485
|
-
return input.run(shell, ['-s', '--'], {
|
|
486
|
-
timeoutMs: 180_000,
|
|
487
|
-
maxOutputBytes: 128 * 1024,
|
|
488
|
-
input: installer,
|
|
489
|
-
env: {
|
|
490
|
-
...input.env,
|
|
491
|
-
CODEX_HOME: codexHome,
|
|
492
|
-
CODEX_INSTALL_DIR: path.dirname(input.before.path),
|
|
493
|
-
CODEX_NON_INTERACTIVE: '1'
|
|
494
|
-
}
|
|
495
|
-
}).catch((err) => failedProcessResult(err));
|
|
496
|
-
}
|
|
497
|
-
async function resolveUpdateExecutable(command, env, deps) {
|
|
498
|
-
return deps.whichImpl
|
|
499
|
-
? deps.whichImpl(command).catch(() => null)
|
|
500
|
-
: resolveOperatorExecutable(command, env);
|
|
501
|
-
}
|
|
502
|
-
function updateFailureBlocker(method) {
|
|
503
|
-
if (method === 'native-self-update')
|
|
504
|
-
return 'codex_cli_self_update_failed';
|
|
505
|
-
if (method === 'standalone-installer')
|
|
506
|
-
return 'codex_cli_standalone_update_failed';
|
|
507
|
-
if (method === 'homebrew-cask')
|
|
508
|
-
return 'codex_cli_homebrew_cask_update_failed';
|
|
509
|
-
return 'codex_cli_npm_global_update_failed';
|
|
510
|
-
}
|
|
511
|
-
async function realPathOrResolved(value) {
|
|
512
|
-
const resolved = path.resolve(value);
|
|
513
|
-
return fsp.realpath(resolved).catch(() => resolved);
|
|
514
|
-
}
|
|
515
357
|
async function operatorCodexCandidates(explicitBin, env) {
|
|
516
358
|
const candidates = [];
|
|
517
359
|
const seen = new Set();
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import path from 'node:path';
|
|
2
|
-
import { nowIso, readText, writeJsonAtomic } from '../fsx.js';
|
|
3
|
-
export const CODEX_PERMISSION_PROFILES_SCHEMA = 'sks.codex-permission-profiles.v1';
|
|
4
1
|
export const SKS_CODEX_PERMISSION_PROFILES = {
|
|
5
2
|
'sks-safe': {
|
|
6
3
|
name: 'sks-safe',
|
|
@@ -52,39 +49,3 @@ export function selectSksCodexPermissionProfile(input = {}) {
|
|
|
52
49
|
return SKS_CODEX_PERMISSION_PROFILES['sks-fast'];
|
|
53
50
|
return SKS_CODEX_PERMISSION_PROFILES['sks-safe'];
|
|
54
51
|
}
|
|
55
|
-
export async function inventoryCodexPermissionProfiles(root, opts = {}) {
|
|
56
|
-
const codexHome = opts.codexHome || process.env.CODEX_HOME || path.join(process.env.HOME || '', '.codex');
|
|
57
|
-
const configPath = path.join(codexHome, 'config.toml');
|
|
58
|
-
const text = await readText(configPath, '');
|
|
59
|
-
const customProfiles = extractProfileNames(String(text));
|
|
60
|
-
const sksProfiles = Object.values(SKS_CODEX_PERMISSION_PROFILES);
|
|
61
|
-
const profileNames = new Set(customProfiles);
|
|
62
|
-
const missing = sksProfiles.filter((profile) => !profileNames.has(profile.name)).map((profile) => profile.name);
|
|
63
|
-
const report = {
|
|
64
|
-
schema: CODEX_PERMISSION_PROFILES_SCHEMA,
|
|
65
|
-
generated_at: nowIso(),
|
|
66
|
-
ok: true,
|
|
67
|
-
root: path.resolve(root),
|
|
68
|
-
codex_home: codexHome,
|
|
69
|
-
config_path: configPath,
|
|
70
|
-
codex_config_profile_field: 'codex_config_profile',
|
|
71
|
-
codex_permission_profile_field: 'codex_permission_profile',
|
|
72
|
-
sks_profiles: sksProfiles,
|
|
73
|
-
custom_profiles: customProfiles,
|
|
74
|
-
missing_sks_named_profiles: missing,
|
|
75
|
-
blockers: [],
|
|
76
|
-
warnings: missing.length ? ['sks_permission_profiles_not_all_declared_in_codex_config'] : []
|
|
77
|
-
};
|
|
78
|
-
if (opts.writeReport !== false) {
|
|
79
|
-
await writeJsonAtomic(path.join(root, '.sneakoscope', 'reports', 'codex-permission-profiles.json'), report);
|
|
80
|
-
}
|
|
81
|
-
return report;
|
|
82
|
-
}
|
|
83
|
-
function extractProfileNames(text) {
|
|
84
|
-
const names = new Set();
|
|
85
|
-
for (const match of text.matchAll(/^\s*\[(?:permissions_profiles|permission_profiles|profiles)\.([A-Za-z0-9_.:-]+)\]\s*$/gm)) {
|
|
86
|
-
if (match[1])
|
|
87
|
-
names.add(match[1]);
|
|
88
|
-
}
|
|
89
|
-
return [...names].sort();
|
|
90
|
-
}
|
|
@@ -3,12 +3,10 @@ import os from 'node:os';
|
|
|
3
3
|
import { nowIso, writeJsonAtomic } from '../fsx.js';
|
|
4
4
|
import { repairAgentRoleConfigs } from '../agents/agent-role-config.js';
|
|
5
5
|
import { MANAGED_OFFICIAL_SUBAGENT_ROLES } from '../managed-assets/managed-assets-manifest.js';
|
|
6
|
-
import { agentRolePayloadFor, probeCodexAgentTypeSupport } from './codex-agent-type-probe.js';
|
|
7
6
|
import { messageOf } from '../errors/message.js';
|
|
8
7
|
const OFFICIAL_ROLES = MANAGED_OFFICIAL_SUBAGENT_ROLES.map((role) => role.codex_name);
|
|
9
8
|
export async function syncCodexAgentRoles(input) {
|
|
10
9
|
const root = path.resolve(input.root);
|
|
11
|
-
const env = input.env || process.env;
|
|
12
10
|
const codexHome = input.codexHome || process.env.CODEX_HOME || path.join(os.homedir(), '.codex');
|
|
13
11
|
const baseRepair = await repairAgentRoleConfigs({
|
|
14
12
|
root,
|
|
@@ -16,49 +14,17 @@ export async function syncCodexAgentRoles(input) {
|
|
|
16
14
|
codexHome,
|
|
17
15
|
reportPath: path.join(root, '.sneakoscope', 'reports', 'agent-role-config-repair.json')
|
|
18
16
|
}).catch((err) => ({ ok: false, blockers: [messageOf(err)] }));
|
|
19
|
-
const agentTypeProbe = input.agentTypeSupported === undefined
|
|
20
|
-
? await probeCodexAgentTypeSupport(root, { env }).catch((err) => ({
|
|
21
|
-
schema: 'sks.codex-agent-type-probe.v1',
|
|
22
|
-
generated_at: nowIso(),
|
|
23
|
-
ok: false,
|
|
24
|
-
supported: false,
|
|
25
|
-
source: 'unknown',
|
|
26
|
-
spawn_tool_name: 'unknown',
|
|
27
|
-
schema_path: null,
|
|
28
|
-
evidence: [],
|
|
29
|
-
blockers: [messageOf(err)],
|
|
30
|
-
warnings: ['agent_type_probe_failed_message_role_fallback']
|
|
31
|
-
}))
|
|
32
|
-
: {
|
|
33
|
-
schema: 'sks.codex-agent-type-probe.v1',
|
|
34
|
-
generated_at: nowIso(),
|
|
35
|
-
ok: true,
|
|
36
|
-
supported: input.agentTypeSupported,
|
|
37
|
-
source: 'fixture',
|
|
38
|
-
spawn_tool_name: input.agentTypeSupported ? 'spawn_agent' : 'unknown',
|
|
39
|
-
schema_path: input.agentTypeSupported ? 'input.agentTypeSupported' : null,
|
|
40
|
-
evidence: [`input.agentTypeSupported=${input.agentTypeSupported}`],
|
|
41
|
-
blockers: [],
|
|
42
|
-
warnings: []
|
|
43
|
-
};
|
|
44
|
-
const rolePayloads = Object.fromEntries(OFFICIAL_ROLES.map((role) => [role, agentRolePayloadFor(role, agentTypeProbe)]));
|
|
45
17
|
const created = stringList(baseRepair, 'created');
|
|
46
18
|
const updated = stringList(baseRepair, 'repaired');
|
|
47
19
|
const report = {
|
|
48
20
|
schema: 'sks.codex-agent-role-sync.v1',
|
|
49
21
|
generated_at: nowIso(),
|
|
50
|
-
ok: recordOk(baseRepair) !== false
|
|
22
|
+
ok: recordOk(baseRepair) !== false,
|
|
51
23
|
apply: input.apply === true,
|
|
52
|
-
agent_type_supported: agentTypeProbe.supported,
|
|
53
|
-
fallback: agentTypeProbe.supported ? 'agent_type' : 'message-role',
|
|
54
|
-
strategy: agentTypeProbe.supported ? 'agent_type' : 'message-role',
|
|
55
|
-
probe_artifact_path: '.sneakoscope/reports/codex-agent-type-probe.json',
|
|
56
24
|
clobbered_user_roles: false,
|
|
57
25
|
codex_home: codexHome,
|
|
58
26
|
official_roles: [...OFFICIAL_ROLES],
|
|
59
27
|
directive_roles: [],
|
|
60
|
-
role_payloads: rolePayloads,
|
|
61
|
-
agent_type_probe: agentTypeProbe,
|
|
62
28
|
created,
|
|
63
29
|
updated,
|
|
64
30
|
base_repair: baseRepair,
|
|
@@ -12,19 +12,17 @@ export async function resolveCodexAppExecutionProfile(input = { root: process.cw
|
|
|
12
12
|
? modeFromNative(nativeMatrix)
|
|
13
13
|
: !matrix?.codex_cli.available
|
|
14
14
|
? 'degraded-no-app'
|
|
15
|
-
: matrix.app_features.app_handoff_ready
|
|
15
|
+
: matrix.app_features.app_handoff_ready
|
|
16
16
|
? 'codex-app-native'
|
|
17
17
|
: matrix.codex_cli.available
|
|
18
18
|
? 'codex-cli-headless'
|
|
19
19
|
: 'sks-loop-headless';
|
|
20
|
-
const agentRoleStrategy = nativeMatrix?.invocation_defaults.loop_worker_role_strategy || (matrix?.app_features.agent_type_supported ? 'agent_type' : 'message-role');
|
|
21
20
|
const hookApprovalState = hookApprovalStateFrom(nativeMatrix) || matrix?.app_features.hook_approval_state || 'unknown';
|
|
22
21
|
const profile = {
|
|
23
22
|
schema: 'sks.codex-app-execution-profile.v1',
|
|
24
23
|
generated_at: nowIso(),
|
|
25
24
|
ok: mode !== 'degraded-no-app',
|
|
26
25
|
mode,
|
|
27
|
-
agent_role_strategy: agentRoleStrategy,
|
|
28
26
|
hooks_assumed_running: false,
|
|
29
27
|
hooks_approval_required: hookApprovalState !== 'approved',
|
|
30
28
|
hook_approval_state: hookApprovalState,
|
|
@@ -34,7 +32,6 @@ export async function resolveCodexAppExecutionProfile(input = { root: process.cw
|
|
|
34
32
|
loop_mesh_app_profile_available: true,
|
|
35
33
|
artifact_path: '.sneakoscope/reports/codex-app-execution-profile.json',
|
|
36
34
|
matrix_artifact_path: nativeMatrix ? '.sneakoscope/reports/codex-native-feature-matrix.json' : '.sneakoscope/reports/codex-app-harness-matrix.json',
|
|
37
|
-
agent_type_probe_artifact_path: '.sneakoscope/reports/codex-agent-type-probe.json',
|
|
38
35
|
hook_approval_probe_artifact_path: '.sneakoscope/reports/codex-hook-approval-probe.json',
|
|
39
36
|
blockers: mode === 'degraded-no-app' ? ['codex_cli_missing'] : [],
|
|
40
37
|
warnings: nativeMatrix?.warnings || matrix?.warnings || []
|
|
@@ -45,7 +42,7 @@ export async function resolveCodexAppExecutionProfile(input = { root: process.cw
|
|
|
45
42
|
function modeFromNative(matrix) {
|
|
46
43
|
if (!matrix.codex_cli.available)
|
|
47
44
|
return 'degraded-no-app';
|
|
48
|
-
if (matrix.features.app_handoff.ok
|
|
45
|
+
if (matrix.features.app_handoff.ok)
|
|
49
46
|
return 'codex-app-native';
|
|
50
47
|
return 'codex-cli-headless';
|
|
51
48
|
}
|
|
@@ -14,9 +14,6 @@ export function codexHomePath(input = {}) {
|
|
|
14
14
|
export function codexUserConfigPath(input = {}) {
|
|
15
15
|
return path.join(codexHomePath(input), 'config.toml');
|
|
16
16
|
}
|
|
17
|
-
export function defaultOpenCodexCatalogPath(input = {}) {
|
|
18
|
-
return path.join(codexHomePath(input), 'opencodex-catalog.json');
|
|
19
|
-
}
|
|
20
17
|
export async function readConfiguredCodexModelRoutingContext(input = {}) {
|
|
21
18
|
const configPath = input.configPath || codexUserConfigPath(input);
|
|
22
19
|
let config = '';
|
package/dist/core/codex-app.js
CHANGED
|
@@ -14,7 +14,6 @@ export const CODEX_APP_DOCS_URL = 'https://developers.openai.com/codex/app/featu
|
|
|
14
14
|
export const CODEX_CHANGELOG_URL = 'https://developers.openai.com/codex/changelog';
|
|
15
15
|
export const CODEX_ACCESS_TOKENS_DOCS_URL = 'https://developers.openai.com/codex/enterprise/access-tokens';
|
|
16
16
|
export const CODEX_CHROME_EXTENSION_SETUP_DOCS_URL = CODEX_CHROME_EXTENSION_DOC_URL;
|
|
17
|
-
export const CODEX_REMOTE_CONTROL_MIN_VERSION = '0.130.0';
|
|
18
17
|
const REQUIRED_CODEX_APP_FEATURE_FLAGS = [
|
|
19
18
|
'codex_git_commit',
|
|
20
19
|
'hooks',
|
|
@@ -325,27 +324,17 @@ export async function codexRemoteControlStatus(opts = {}) {
|
|
|
325
324
|
return codexRemoteControlStatusFromInfo(codex);
|
|
326
325
|
}
|
|
327
326
|
export function codexRemoteControlStatusFromInfo(codex = {}) {
|
|
328
|
-
const
|
|
329
|
-
const versionKnown = Boolean(current);
|
|
330
|
-
const supported = Boolean(codex.bin && current && compareVersions(current, CODEX_REMOTE_CONTROL_MIN_VERSION) >= 0);
|
|
327
|
+
const present = Boolean(codex.bin);
|
|
331
328
|
return {
|
|
332
|
-
ok:
|
|
333
|
-
min_version: CODEX_REMOTE_CONTROL_MIN_VERSION,
|
|
329
|
+
ok: present,
|
|
334
330
|
docs_url: CODEX_CHANGELOG_URL,
|
|
335
331
|
codex_cli: {
|
|
336
|
-
ok:
|
|
332
|
+
ok: present,
|
|
337
333
|
bin: codex.bin || null,
|
|
338
|
-
version: codex.version || null
|
|
339
|
-
version_number: current
|
|
334
|
+
version: codex.version || null
|
|
340
335
|
},
|
|
341
336
|
command: codex.bin ? `${codex.bin} remote-control` : 'codex remote-control',
|
|
342
|
-
reason:
|
|
343
|
-
? 'available'
|
|
344
|
-
: !codex.bin
|
|
345
|
-
? 'codex_cli_missing'
|
|
346
|
-
: versionKnown
|
|
347
|
-
? `requires_codex_cli_${CODEX_REMOTE_CONTROL_MIN_VERSION}_or_newer`
|
|
348
|
-
: 'codex_cli_version_unknown'
|
|
337
|
+
reason: present ? 'available' : 'codex_cli_missing'
|
|
349
338
|
};
|
|
350
339
|
}
|
|
351
340
|
export function parseProcessRows(text = '') {
|
|
@@ -413,13 +402,12 @@ export function formatCodexRemoteControlStatus(status) {
|
|
|
413
402
|
'Codex remote-control',
|
|
414
403
|
'',
|
|
415
404
|
`Codex CLI: ${status.codex_cli.ok ? 'ok' : 'missing'}${status.codex_cli.version ? ` ${status.codex_cli.version}` : ''}`,
|
|
416
|
-
`Minimum: ${status.min_version}`,
|
|
417
405
|
`Ready: ${status.ok ? 'yes' : 'no'}`,
|
|
418
406
|
`Command: ${status.command}`,
|
|
419
407
|
'',
|
|
420
408
|
status.ok
|
|
421
409
|
? 'Run: sks codex-app remote-control -- <codex remote-control args>'
|
|
422
|
-
: remoteControlGuidance(
|
|
410
|
+
: remoteControlGuidance()
|
|
423
411
|
];
|
|
424
412
|
return lines.filter(Boolean).join('\n');
|
|
425
413
|
}
|
|
@@ -487,10 +475,6 @@ export function codexAppGuidance({ appInstalled, codex, mcpList, featureList, re
|
|
|
487
475
|
lines.push('Install Codex CLI too: npm i -g @openai/codex, or set SKS_CODEX_BIN.');
|
|
488
476
|
if (remoteControl?.ok) {
|
|
489
477
|
lines.push('Codex remote-control is available for headless remotely controllable app-server sessions: sks codex-app remote-control.');
|
|
490
|
-
lines.push('Codex CLI 0.130.0+ app-server threads can pick up config changes without restarting the app-server; restart older CLI/TUI sessions if they were launched before config changes.');
|
|
491
|
-
}
|
|
492
|
-
else if (codex?.bin) {
|
|
493
|
-
lines.push(remoteControlGuidance(remoteControl || codexRemoteControlStatusFromInfo(codex)));
|
|
494
478
|
}
|
|
495
479
|
if (mcpList?.checked && !mcpList.ok) {
|
|
496
480
|
lines.push(`Codex MCP/config check failed: ${summarizeCodexMcpError(mcpList.stderr || mcpList.stdout)}`);
|
|
@@ -594,7 +578,7 @@ export function formatCodexAppStatus(status, { includeRaw = false } = {}) {
|
|
|
594
578
|
'',
|
|
595
579
|
`Codex App: ${status.app.installed ? 'ok' : 'missing'}${status.app.path ? ` ${status.app.path}` : ''}`,
|
|
596
580
|
`Codex CLI: ${status.codex_cli.ok ? 'ok' : 'missing'}${status.codex_cli.version ? ` ${status.codex_cli.version}` : ''}`,
|
|
597
|
-
`Remote Ctrl: ${status.remote_control?.ok ? 'ok' : 'missing'}
|
|
581
|
+
`Remote Ctrl: ${status.remote_control?.ok ? 'ok' : 'missing'}`,
|
|
598
582
|
`App Flags: ${status.features?.required_flags_ok ? 'ok' : `missing ${missingRequiredFeatureFlags(status.features?.required_flags).join(', ') || 'required flags'}`}`,
|
|
599
583
|
`Fast UI: ${status.features?.fast_mode_config?.ok ? 'ok' : `locked ${(status.features?.fast_mode_config?.blockers || []).join(', ') || 'config'}`}`,
|
|
600
584
|
`SKS Menu: ${sksNativeMenuSummary(status.app?.sks_menu)}`,
|
|
@@ -680,8 +664,7 @@ export function codexGitActionReadiness({ requiredFeatureFlags = {}, remoteContr
|
|
|
680
664
|
commit_push: ok,
|
|
681
665
|
pull_request: ok,
|
|
682
666
|
required_flags: ['codex_git_commit', 'hooks'],
|
|
683
|
-
required_capabilities: ['codex_cli_remote_control']
|
|
684
|
-
remote_control_min_version: CODEX_REMOTE_CONTROL_MIN_VERSION
|
|
667
|
+
required_capabilities: ['codex_cli_remote_control']
|
|
685
668
|
};
|
|
686
669
|
}
|
|
687
670
|
async function codexDefaultPluginStatus(opts = {}) {
|
|
@@ -1046,25 +1029,6 @@ function tomlTable(text = '', table = '') {
|
|
|
1046
1029
|
const re = new RegExp(`(?:^|\\n)\\[${escapeRegExp(table)}\\]([\\s\\S]*?)(?=\\n\\[[^\\]]+\\]|\\s*$)`);
|
|
1047
1030
|
return String(text || '').match(re)?.[1] || '';
|
|
1048
1031
|
}
|
|
1049
|
-
function remoteControlGuidance(
|
|
1050
|
-
|
|
1051
|
-
return 'Codex remote-control needs a Codex CLI that exposes the app-server entrypoint. Install the official latest stable release: npm i -g @openai/codex@latest';
|
|
1052
|
-
if (status.reason === 'codex_cli_version_unknown')
|
|
1053
|
-
return 'Codex remote-control needs a Codex CLI that exposes the app-server entrypoint, but the installed CLI version could not be parsed. Check: codex --version';
|
|
1054
|
-
return 'The installed Codex CLI does not expose remote-control. Update to the official latest stable release: npm i -g @openai/codex@latest';
|
|
1055
|
-
}
|
|
1056
|
-
function codexCliVersionNumber(versionText = '') {
|
|
1057
|
-
const match = String(versionText || '').match(/(\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?)/);
|
|
1058
|
-
return match ? match[1] : null;
|
|
1059
|
-
}
|
|
1060
|
-
function compareVersions(a, b) {
|
|
1061
|
-
const pa = String(a || '').split(/[.-]/).map((x) => Number.parseInt(x, 10) || 0);
|
|
1062
|
-
const pb = String(b || '').split(/[.-]/).map((x) => Number.parseInt(x, 10) || 0);
|
|
1063
|
-
for (let i = 0; i < Math.max(pa.length, pb.length, 3); i++) {
|
|
1064
|
-
if ((pa[i] || 0) > (pb[i] || 0))
|
|
1065
|
-
return 1;
|
|
1066
|
-
if ((pa[i] || 0) < (pb[i] || 0))
|
|
1067
|
-
return -1;
|
|
1068
|
-
}
|
|
1069
|
-
return 0;
|
|
1032
|
+
function remoteControlGuidance() {
|
|
1033
|
+
return 'Codex remote-control needs the Codex CLI. Install the official latest stable release: npm i -g @openai/codex@latest';
|
|
1070
1034
|
}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { projectRoot } from '../fsx.js';
|
|
2
2
|
import { detectCodexCurrentCapability } from '../codex-control/codex-current-capability.js';
|
|
3
3
|
import { codexVersionReport } from './codex-version.js';
|
|
4
|
-
import { CODEX_COMPAT_SCHEMA, CODEX_HOOK_SCHEMA_BASELINE_TAG
|
|
4
|
+
import { CODEX_COMPAT_SCHEMA, CODEX_HOOK_SCHEMA_BASELINE_TAG } from './codex-version-policy.js';
|
|
5
5
|
import { CURRENT_CODEX_RUNTIME_CONTRACT } from './codex-runtime-contract.js';
|
|
6
6
|
import { codexSchemaSnapshotReport } from './codex-schema-snapshot.js';
|
|
7
7
|
import { codexHookWarningCheck } from './codex-hook-warning-detector.js';
|
|
8
8
|
export async function codexCompatibilityReport(opts = {}) {
|
|
9
9
|
const root = opts.root || await projectRoot();
|
|
10
|
-
const
|
|
11
|
-
const version = await codexVersionReport({ ...opts, requiredBaseline });
|
|
10
|
+
const version = await codexVersionReport(opts);
|
|
12
11
|
const releaseContract = {
|
|
13
12
|
ok: true,
|
|
14
13
|
dependency_source: CURRENT_CODEX_RUNTIME_CONTRACT.dependencySource,
|
|
@@ -18,13 +17,12 @@ export async function codexCompatibilityReport(opts = {}) {
|
|
|
18
17
|
const hooks = await codexHookWarningCheck(root, { recordWrongness: false });
|
|
19
18
|
const current = await detectCodexCurrentCapability({
|
|
20
19
|
root,
|
|
21
|
-
codexBin: opts.codexBin || null
|
|
22
|
-
requireReal: opts.requireReal === true
|
|
20
|
+
codexBin: opts.codexBin || null
|
|
23
21
|
});
|
|
24
22
|
const ok = Boolean(version.policy.ok && snapshot.ok && hooks.ok && current.ok);
|
|
25
23
|
return {
|
|
26
24
|
schema: CODEX_COMPAT_SCHEMA,
|
|
27
|
-
|
|
25
|
+
min_version: CURRENT_CODEX_RUNTIME_CONTRACT.minVersion,
|
|
28
26
|
release_contract: releaseContract,
|
|
29
27
|
detected: version.detected,
|
|
30
28
|
current_capability: current,
|
|
@@ -44,6 +44,9 @@ export function buildPermissionRequestAllow(options = {}) {
|
|
|
44
44
|
}
|
|
45
45
|
}, options.systemMessage);
|
|
46
46
|
}
|
|
47
|
+
export function buildPermissionRequestNoDecision(options = {}) {
|
|
48
|
+
return withOptionalSystemMessage({ continue: true }, options.systemMessage);
|
|
49
|
+
}
|
|
47
50
|
export function buildPermissionRequestDeny(message, options = {}) {
|
|
48
51
|
const trimmed = requiredReason(message, 'PermissionRequest deny requires a non-empty message');
|
|
49
52
|
return withOptionalSystemMessage({
|
|
@@ -1,56 +1,16 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import { packageRoot } from '../fsx.js';
|
|
4
|
-
export const CODEX_RUNTIME_CONTRACT_SCHEMA = 'sks.codex-runtime-contract.
|
|
4
|
+
export const CODEX_RUNTIME_CONTRACT_SCHEMA = 'sks.codex-runtime-contract.v3';
|
|
5
|
+
export const CODEX_MIN_VERSION = '0.153.4';
|
|
5
6
|
const sdkVersion = codexSdkDependencyVersion();
|
|
6
7
|
export const CURRENT_CODEX_RUNTIME_CONTRACT = {
|
|
7
8
|
schema: CODEX_RUNTIME_CONTRACT_SCHEMA,
|
|
8
9
|
targetTag: `rust-v${sdkVersion}`,
|
|
9
|
-
requiredCliVersion: sdkVersion,
|
|
10
|
-
preferredCliVersion: sdkVersion,
|
|
11
10
|
sdkVersion,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
protocolMode: 'app-server-v2',
|
|
15
|
-
dependencySource: 'package.json#dependencies.@openai/codex-sdk',
|
|
16
|
-
featurePolicies: {
|
|
17
|
-
multiAgentMode: 'delegate',
|
|
18
|
-
multiAgentV2: 'delegate',
|
|
19
|
-
agentsMaxConcurrentThreads: 'delegate',
|
|
20
|
-
indexedWebSearch: 'probe',
|
|
21
|
-
currentTimeRead: 'wrap',
|
|
22
|
-
threadListSearchRead: 'probe',
|
|
23
|
-
pluginCatalogRefresh: 'probe',
|
|
24
|
-
terminalSubagentErrorPropagation: 'probe',
|
|
25
|
-
execMcpTransientRecovery: 'probe',
|
|
26
|
-
remoteNativeEnvironment: 'probe',
|
|
27
|
-
rolloutTokenBudget: 'probe',
|
|
28
|
-
mcpStartupToolTimeouts: 'wrap',
|
|
29
|
-
gpt56TerraLunaSolRouting: 'delegate',
|
|
30
|
-
mcpPaginatedDiscovery: 'wrap',
|
|
31
|
-
portableAgentPlugins: 'delegate',
|
|
32
|
-
automaticApprovalReview: 'delegate'
|
|
33
|
-
},
|
|
34
|
-
requiredRealProbes: [
|
|
35
|
-
'runtime_identity',
|
|
36
|
-
'protocol_schema_generation',
|
|
37
|
-
'multi_agent_mode_schema',
|
|
38
|
-
'indexed_web_search_schema',
|
|
39
|
-
'current_time_read_schema',
|
|
40
|
-
'thread_list_search_schema',
|
|
41
|
-
'terminal_error_schema',
|
|
42
|
-
'rollout_budget_schema'
|
|
43
|
-
],
|
|
44
|
-
supportedPlatforms: [
|
|
45
|
-
'darwin-arm64',
|
|
46
|
-
'darwin-x64',
|
|
47
|
-
'linux-arm64',
|
|
48
|
-
'linux-x64',
|
|
49
|
-
'win32-arm64',
|
|
50
|
-
'win32-x64'
|
|
51
|
-
]
|
|
11
|
+
minVersion: CODEX_MIN_VERSION,
|
|
12
|
+
dependencySource: 'package.json#dependencies.@openai/codex-sdk'
|
|
52
13
|
};
|
|
53
|
-
export const NARUTO_REQUIRED_CODEX_VERSION = CURRENT_CODEX_RUNTIME_CONTRACT.narutoCapabilityFloorVersion;
|
|
54
14
|
export function codexSdkDependencyVersion(root = packageRoot()) {
|
|
55
15
|
const packagePath = path.join(root, 'package.json');
|
|
56
16
|
const pkg = JSON.parse(fs.readFileSync(packagePath, 'utf8'));
|