@openclaw/codex 2026.5.30-beta.1 → 2026.5.31-beta.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.
Files changed (25) hide show
  1. package/dist/{client-B08x7Y93.js → client-BnOmn0y-.js} +14 -6
  2. package/dist/{client-factory-bqIbmRDu.js → client-factory-B8dh39UW.js} +1 -1
  3. package/dist/{command-handlers-VSWuNdgc.js → command-handlers-BsK6kZJi.js} +263 -14
  4. package/dist/{compact-DJruF_vy.js → compact-BXLjhUHX.js} +3 -3
  5. package/dist/{computer-use-Cq-EEnLL.js → computer-use-D-0EFJBJ.js} +3 -4
  6. package/dist/{config--tW89bHH.js → config-AlzuNKCY.js} +14 -5
  7. package/dist/{conversation-binding-DzF_JII7.js → conversation-binding-KUDxop-C.js} +9 -9
  8. package/dist/doctor-contract-api.js +1 -1
  9. package/dist/harness.js +5 -5
  10. package/dist/index.js +14 -11
  11. package/dist/media-understanding-provider.js +8 -9
  12. package/dist/{models-DuyStYTT.js → models-mbjSisZL.js} +2 -2
  13. package/dist/{native-hook-relay-zY7m-pAu.js → native-hook-relay-DCxPRaBN.js} +7 -7
  14. package/dist/{notification-correlation-DR9cQN_M.js → notification-correlation-BykOI_jh.js} +2 -2
  15. package/dist/{protocol-validators-DtjYmUw_.js → protocol-validators-DIt7cXIp.js} +2 -2
  16. package/dist/provider.js +2 -2
  17. package/dist/{request-DGOj3AyX.js → request-DuFgTwRU.js} +3 -3
  18. package/dist/{run-attempt-lD4FLxNV.js → run-attempt-CgaY9r5u.js} +172 -61
  19. package/dist/{session-binding-BGOpicy0.js → session-binding-BXJAV_xy.js} +10 -8
  20. package/dist/{shared-client-2d0XB7wz.js → shared-client-DBlR-rV2.js} +2 -2
  21. package/dist/{side-question-BsyY3v3K.js → side-question-SjBLGANT.js} +9 -9
  22. package/dist/{thread-lifecycle-BR74qMaY.js → thread-lifecycle-Bnlv_Q8u.js} +49 -33
  23. package/npm-shrinkwrap.json +34 -34
  24. package/openclaw.plugin.json +1 -1
  25. package/package.json +6 -6
@@ -1,4 +1,4 @@
1
- import { l as resolveCodexAppServerRuntimeOptions } from "./config--tW89bHH.js";
1
+ import { d as resolveCodexAppServerRuntimeOptions } from "./config-AlzuNKCY.js";
2
2
  import { materializeWindowsSpawnProgram, resolveWindowsSpawnProgram } from "openclaw/plugin-sdk/windows-spawn";
3
3
  import { OPENCLAW_VERSION, embeddedAgentLog } from "openclaw/plugin-sdk/agent-harness-runtime";
4
4
  import { createInterface } from "node:readline";
@@ -120,11 +120,18 @@ function createWebSocketTransport(options) {
120
120
  const text = websocketFrameToText(data);
121
121
  stdout.write(text.endsWith("\n") ? text : `${text}\n`);
122
122
  });
123
+ const stdin = new Writable({ write(chunk, _encoding, callback) {
124
+ for (const frame of chunk.toString("utf8").split("\n")) sendFrame(frame);
125
+ callback();
126
+ } });
127
+ const closeSocket = () => {
128
+ if (socket.readyState === WebSocket.CLOSED || socket.readyState === WebSocket.CLOSING) return;
129
+ socket.close();
130
+ };
131
+ stdin.once("finish", closeSocket);
132
+ stdin.once("close", closeSocket);
123
133
  return {
124
- stdin: new Writable({ write(chunk, _encoding, callback) {
125
- for (const frame of chunk.toString("utf8").split("\n")) sendFrame(frame);
126
- callback();
127
- } }),
134
+ stdin,
128
135
  stdout,
129
136
  stderr,
130
137
  get killed() {
@@ -294,7 +301,8 @@ var CodexAppServerClient = class CodexAppServerClient {
294
301
  getServerVersion() {
295
302
  return this.serverVersion;
296
303
  }
297
- request(method, params, options) {
304
+ request(method, params, optionsInput) {
305
+ let options = optionsInput;
298
306
  options ??= {};
299
307
  if (this.closed) return Promise.reject(this.closeError ?? /* @__PURE__ */ new Error("codex app-server client is closed"));
300
308
  if (options.signal?.aborted) return Promise.reject(/* @__PURE__ */ new Error(`${method} aborted`));
@@ -1,7 +1,7 @@
1
1
  //#region extensions/codex/src/app-server/client-factory.ts
2
2
  let sharedClientModulePromise = null;
3
3
  const loadSharedClientModule = async () => {
4
- sharedClientModulePromise ??= import("./shared-client-2d0XB7wz.js").then((n) => n.s);
4
+ sharedClientModulePromise ??= import("./shared-client-DBlR-rV2.js").then((n) => n.s);
5
5
  return await sharedClientModulePromise;
6
6
  };
7
7
  const defaultCodexAppServerClientFactory = (startOptions, authProfileId, agentDir, config) => loadSharedClientModule().then(({ getSharedCodexAppServerClient }) => getSharedCodexAppServerClient({
@@ -1,16 +1,16 @@
1
- import { a as isCodexFastServiceTier, l as resolveCodexAppServerRuntimeOptions } from "./config--tW89bHH.js";
2
- import { n as listCodexAppServerModels, t as listAllCodexAppServerModels } from "./models-DuyStYTT.js";
3
- import { l as isJsonObject } from "./client-B08x7Y93.js";
4
- import { a as readCodexAppServerBinding, s as writeCodexAppServerBinding, t as clearCodexAppServerBinding } from "./session-binding-BGOpicy0.js";
5
- import { i as describeControlFailure, r as CODEX_CONTROL_METHODS, t as requestCodexAppServerJson } from "./request-DGOj3AyX.js";
6
- import { a as buildHelp, c as formatCodexStatus, d as formatModels, f as formatSkills, l as formatComputerUseStatus, m as readString$1, o as formatAccount, p as formatThreads, s as formatCodexDisplayText, u as formatList, v as summarizeCodexAccountUsage } from "./notification-correlation-DR9cQN_M.js";
1
+ import { d as resolveCodexAppServerRuntimeOptions, o as isCodexFastServiceTier } from "./config-AlzuNKCY.js";
2
+ import { n as listCodexAppServerModels, t as listAllCodexAppServerModels } from "./models-mbjSisZL.js";
3
+ import { l as isJsonObject } from "./client-BnOmn0y-.js";
4
+ import { a as readCodexAppServerBinding, s as writeCodexAppServerBinding, t as clearCodexAppServerBinding } from "./session-binding-BXJAV_xy.js";
5
+ import { i as describeControlFailure, r as CODEX_CONTROL_METHODS, t as requestCodexAppServerJson } from "./request-DuFgTwRU.js";
6
+ import { a as buildHelp, c as formatCodexStatus, d as formatModels, f as formatSkills, l as formatComputerUseStatus, m as readString$1, o as formatAccount, p as formatThreads, s as formatCodexDisplayText, u as formatList, v as summarizeCodexAccountUsage } from "./notification-correlation-BykOI_jh.js";
7
7
  import { n as resolveCodexNativeExecutionBlock, r as resolveCodexNativeSandboxBlock } from "./sandbox-guard-DMCJlzmz.js";
8
- import { _ as steerCodexConversationTurn, b as readCodexConversationBindingData, d as parseCodexFastModeArg, f as parseCodexPermissionsModeArg, g as setCodexConversationPermissions, h as setCodexConversationModel, m as setCodexConversationFastMode, o as formatCodexCliSessions, p as readCodexConversationActiveTurn, r as startCodexConversationThread, u as formatPermissionsMode, v as stopCodexConversationTurn, x as resolveCodexDefaultWorkspaceDir, y as createCodexCliNodeConversationBindingData } from "./conversation-binding-DzF_JII7.js";
9
- import { n as installCodexComputerUse, r as readCodexComputerUseStatus } from "./computer-use-Cq-EEnLL.js";
8
+ import { _ as steerCodexConversationTurn, b as readCodexConversationBindingData, d as parseCodexFastModeArg, f as parseCodexPermissionsModeArg, g as setCodexConversationPermissions, h as setCodexConversationModel, m as setCodexConversationFastMode, o as formatCodexCliSessions, p as readCodexConversationActiveTurn, r as startCodexConversationThread, u as formatPermissionsMode, v as stopCodexConversationTurn, x as resolveCodexDefaultWorkspaceDir, y as createCodexCliNodeConversationBindingData } from "./conversation-binding-KUDxop-C.js";
9
+ import { n as installCodexComputerUse, r as readCodexComputerUseStatus } from "./computer-use-D-0EFJBJ.js";
10
10
  import { n as rememberCodexRateLimits } from "./rate-limit-cache-N66I-Rd7.js";
11
+ import { parseStrictPositiveInteger } from "openclaw/plugin-sdk/number-runtime";
11
12
  import crypto from "node:crypto";
12
13
  import { normalizeOptionalString, normalizeUniqueStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
13
- import { parseStrictPositiveInteger } from "openclaw/plugin-sdk/number-runtime";
14
14
  import { ensureAuthProfileStore, findNormalizedProviderValue, resolveAgentDir, resolveAuthProfileEligibility, resolveAuthProfileOrder, resolveDefaultAgentDir, resolveProfileUnusableUntilForDisplay, resolveSessionAgentIds } from "openclaw/plugin-sdk/agent-runtime";
15
15
  //#region extensions/codex/src/command-account.ts
16
16
  const OPENAI_PROVIDER_ID = "openai";
@@ -115,7 +115,7 @@ function resolveActiveProfileId(params) {
115
115
  profileId,
116
116
  now: params.now
117
117
  }).eligible);
118
- const lastGood = [params.store.lastGood?.[OPENAI_PROVIDER_ID], params.store.lastGood?.[OPENAI_CODEX_PROVIDER_ID]].find((profileId) => !!profileId && params.order.includes(profileId) && isActiveProfileCandidate(params, profileId));
118
+ const lastGood = [params.store.lastGood?.[OPENAI_PROVIDER_ID], params.store.lastGood?.[OPENAI_CODEX_PROVIDER_ID]].find((profileId) => typeof profileId === "string" && params.order.includes(profileId) && isActiveProfileCandidate(params, profileId));
119
119
  if (lastGood) return lastGood;
120
120
  const mostRecent = params.order.map((profileId) => ({
121
121
  profileId,
@@ -307,9 +307,32 @@ function formatRelativeReset(untilMs, nowMs) {
307
307
  //#endregion
308
308
  //#region extensions/codex/src/command-plugins-management.ts
309
309
  const POLICY_REFRESH_HINT = "New Codex conversations pick this up automatically. Use /new or /reset to refresh the current one.";
310
+ function buildPickerPresentation$1(title, prompt, buttons) {
311
+ return {
312
+ title,
313
+ blocks: [{
314
+ type: "text",
315
+ text: prompt
316
+ }, {
317
+ type: "buttons",
318
+ buttons: buttons.map((button) => ({
319
+ label: button.label,
320
+ value: button.command
321
+ }))
322
+ }]
323
+ };
324
+ }
310
325
  async function handleCodexPluginsSubcommand(ctx, rest, io) {
311
326
  const [verb = "list", ...args] = rest;
312
327
  const normalized = verb.toLowerCase();
328
+ if (normalized === "menu") {
329
+ if (args.length > 0) return { text: "Usage: /codex plugins menu" };
330
+ return buildPluginsMenuReply();
331
+ }
332
+ if (normalized === "help") {
333
+ if (args.length > 0) return { text: "Usage: /codex plugins help" };
334
+ return { text: buildPluginsHelp() };
335
+ }
313
336
  if (normalized === "list") {
314
337
  if (args.length > 0) return { text: "Usage: /codex plugins list" };
315
338
  const current = await io.readConfig();
@@ -317,6 +340,7 @@ async function handleCodexPluginsSubcommand(ctx, rest, io) {
317
340
  }
318
341
  const target = args[0];
319
342
  if (normalized === "enable" || normalized === "disable") {
343
+ if (args.length === 0) return buildPluginNamePickerReply(normalized, await io.readConfig());
320
344
  if (!target || args.length > 1) return { text: `Usage: /codex plugins ${normalized} <name>` };
321
345
  if (!canMutateCodexPlugins(ctx)) return { text: `Only an owner or operator.admin gateway client can run /codex plugins ${normalized}.` };
322
346
  const wantEnabled = normalized === "enable";
@@ -333,6 +357,82 @@ async function handleCodexPluginsSubcommand(ctx, rest, io) {
333
357
  }
334
358
  return { text: `Unknown /codex plugins subcommand: ${formatCodexDisplayText(verb)}\n\n${buildPluginsHelp()}` };
335
359
  }
360
+ function buildPluginsMenuReply() {
361
+ return {
362
+ text: [
363
+ "Codex sub-plugins. Pick a sub-action or type:",
364
+ "",
365
+ " 1. /codex plugins list",
366
+ " 2. /codex plugins enable",
367
+ " 3. /codex plugins disable",
368
+ " 4. /codex plugins help",
369
+ "",
370
+ "Type '/codex' to go back to the main menu."
371
+ ].join("\n"),
372
+ presentation: buildPickerPresentation$1("Codex sub-plugins", "Pick a Codex sub-plugin action:", [
373
+ {
374
+ label: "list",
375
+ command: "/codex plugins list"
376
+ },
377
+ {
378
+ label: "enable",
379
+ command: "/codex plugins enable"
380
+ },
381
+ {
382
+ label: "disable",
383
+ command: "/codex plugins disable"
384
+ },
385
+ {
386
+ label: "help",
387
+ command: "/codex plugins help"
388
+ },
389
+ {
390
+ label: "back",
391
+ command: "/codex"
392
+ }
393
+ ])
394
+ };
395
+ }
396
+ function buildPluginNamePickerReply(verb, current) {
397
+ const globalEnabled = current.enabled === true;
398
+ const eligible = Object.entries(current.plugins ?? {}).toSorted(([left], [right]) => left.localeCompare(right)).filter(([, entry]) => {
399
+ const effectivelyEnabled = globalEnabled && entry.enabled !== false;
400
+ return verb === "disable" ? effectivelyEnabled : !effectivelyEnabled;
401
+ });
402
+ if (eligible.length === 0) return {
403
+ text: [
404
+ `No configured ${verb === "enable" ? "disabled" : "enabled"} Codex sub-plugins found.`,
405
+ "",
406
+ "Type '/codex plugins list' to inspect configured sub-plugins.",
407
+ "Type '/codex plugins menu' to go back to the plugins menu."
408
+ ].join("\n"),
409
+ presentation: buildPickerPresentation$1("Codex sub-plugins", "Pick another Codex sub-plugin action:", [{
410
+ label: "list",
411
+ command: "/codex plugins list"
412
+ }, {
413
+ label: "back",
414
+ command: "/codex plugins menu"
415
+ }])
416
+ };
417
+ const buttons = [...eligible.map(([key]) => ({
418
+ label: formatCodexDisplayText(key),
419
+ command: `/codex plugins ${verb} ${key}`
420
+ })), {
421
+ label: "back",
422
+ command: "/codex plugins menu"
423
+ }];
424
+ return {
425
+ text: [
426
+ `Codex sub-plugins to ${verb}. Pick one or type:`,
427
+ "",
428
+ ...eligible.map(([key], index) => ` ${index + 1}. /codex plugins ${verb} ${key}`),
429
+ "",
430
+ ...verb === "enable" && !globalEnabled ? ["Global codexPlugins.enabled is off; enabling one configured sub-plugin turns it on.", ""] : [],
431
+ "Type '/codex plugins menu' to go back to the plugins menu."
432
+ ].join("\n"),
433
+ presentation: buildPickerPresentation$1("Codex sub-plugins", `Pick a Codex sub-plugin to ${verb}:`, buttons)
434
+ };
435
+ }
336
436
  function canMutateCodexPlugins(ctx) {
337
437
  if (ctx.senderIsOwner === true) return true;
338
438
  return ctx.gatewayClientScopes?.includes("operator.admin") === true;
@@ -485,12 +585,152 @@ const lastCodexDiagnosticsUploadByThread = /* @__PURE__ */ new Map();
485
585
  const lastCodexDiagnosticsUploadByScope = /* @__PURE__ */ new Map();
486
586
  const pendingCodexDiagnosticsConfirmations = /* @__PURE__ */ new Map();
487
587
  const pendingCodexDiagnosticsConfirmationTokensByScope = /* @__PURE__ */ new Map();
588
+ function buildPickerPresentation(title, prompt, buttons) {
589
+ return {
590
+ title,
591
+ blocks: [{
592
+ type: "text",
593
+ text: prompt
594
+ }, {
595
+ type: "buttons",
596
+ buttons: buttons.map((button) => ({
597
+ label: button.label,
598
+ value: button.command
599
+ }))
600
+ }]
601
+ };
602
+ }
603
+ /**
604
+ * No-arg `/codex` picker. Core owns the native command tree; channels render
605
+ * the portable buttons as inline controls when their transport can.
606
+ */
607
+ function buildCodexSubcommandPickerReply() {
608
+ const verbs = [
609
+ {
610
+ label: "plugins",
611
+ command: "/codex plugins menu"
612
+ },
613
+ {
614
+ label: "permissions",
615
+ command: "/codex permissions menu"
616
+ },
617
+ {
618
+ label: "fast",
619
+ command: "/codex fast menu"
620
+ },
621
+ {
622
+ label: "computer-use",
623
+ command: "/codex computer-use menu"
624
+ },
625
+ {
626
+ label: "account",
627
+ command: "/codex account"
628
+ },
629
+ {
630
+ label: "help",
631
+ command: "/codex help"
632
+ }
633
+ ];
634
+ return {
635
+ text: [
636
+ "Codex commands. Pick a category or type:",
637
+ "",
638
+ ...verbs.map((v, i) => ` ${i + 1}. ${v.command}`),
639
+ "",
640
+ "Tap 'help' (or type /codex help) for the full list of typeable verbs",
641
+ "including threads, mcp, binding, detach, skills, resume, bind, steer,",
642
+ "model, diagnostics, compact, review, computer-use.",
643
+ "",
644
+ "Top-level shortcuts cover everyday operations: /status, /fast, /help, /stop, /models."
645
+ ].join("\n"),
646
+ presentation: buildPickerPresentation("Codex commands", "Pick a Codex subcommand:", verbs)
647
+ };
648
+ }
649
+ /** Sub-picker for `/codex fast menu` (on / off / status). */
650
+ function buildCodexFastMenuReply() {
651
+ const modes = [
652
+ "on",
653
+ "off",
654
+ "status"
655
+ ];
656
+ const buttons = [...modes.map((mode) => ({
657
+ label: mode,
658
+ command: `/codex fast ${mode}`
659
+ })), {
660
+ label: "back",
661
+ command: "/codex"
662
+ }];
663
+ return {
664
+ text: [
665
+ "Codex fast mode. Pick one or type /codex fast <mode>:",
666
+ "",
667
+ ...modes.map((m, i) => ` ${i + 1}. /codex fast ${m}`),
668
+ "",
669
+ "Type '/codex' to go back to the main menu."
670
+ ].join("\n"),
671
+ presentation: buildPickerPresentation("Codex fast mode", "Pick a Codex fast mode:", buttons)
672
+ };
673
+ }
674
+ /** Sub-picker for `/codex permissions menu` (default / yolo / status). */
675
+ function buildCodexPermissionsMenuReply() {
676
+ const modes = [
677
+ "default",
678
+ "yolo",
679
+ "status"
680
+ ];
681
+ const buttons = [...modes.map((mode) => ({
682
+ label: mode,
683
+ command: `/codex permissions ${mode}`
684
+ })), {
685
+ label: "back",
686
+ command: "/codex"
687
+ }];
688
+ return {
689
+ text: [
690
+ "Codex permissions. Pick one or type /codex permissions <mode>:",
691
+ "",
692
+ ...modes.map((m, i) => ` ${i + 1}. /codex permissions ${m}`),
693
+ "",
694
+ "Type '/codex' to go back to the main menu."
695
+ ].join("\n"),
696
+ presentation: buildPickerPresentation("Codex permissions", "Pick a Codex permissions mode:", buttons)
697
+ };
698
+ }
699
+ /** Sub-picker for `/codex computer-use menu` (status / install). */
700
+ function buildCodexComputerUseMenuReply() {
701
+ const actions = ["status", "install"];
702
+ const buttons = [...actions.map((action) => ({
703
+ label: action,
704
+ command: `/codex computer-use ${action}`
705
+ })), {
706
+ label: "back",
707
+ command: "/codex"
708
+ }];
709
+ return {
710
+ text: [
711
+ "Codex computer-use. Pick one or type /codex computer-use <action>:",
712
+ "",
713
+ ...actions.map((a, i) => ` ${i + 1}. /codex computer-use ${a}`),
714
+ "",
715
+ "Flag-driven invocations (--source, --marketplace-path, --marketplace) are not in the picker. Type '/codex computer-use' or read '/codex help' for the full surface.",
716
+ "",
717
+ "Type '/codex' to go back to the main menu."
718
+ ].join("\n"),
719
+ presentation: buildPickerPresentation("Codex computer-use", "Pick a Codex computer-use action:", buttons)
720
+ };
721
+ }
722
+ /** Returns true when the rest-args are exactly `["menu"]` (case-insensitive). */
723
+ function isMenuVerb(rest) {
724
+ return rest.length === 1 && (rest[0] ?? "").trim().toLowerCase() === "menu";
725
+ }
488
726
  async function handleCodexSubcommand(ctx, options) {
489
727
  const deps = {
490
728
  ...defaultCodexCommandDeps,
491
729
  ...options.deps
492
730
  };
493
- const [subcommand = "status", ...rest] = splitArgs(ctx.args);
731
+ const args = splitArgs(ctx.args);
732
+ if (args.length === 0) return buildCodexSubcommandPickerReply();
733
+ const [subcommand = "status", ...rest] = args;
494
734
  const normalized = subcommand.toLowerCase();
495
735
  if (normalized === "help") return { text: buildHelp() };
496
736
  const sandboxBlock = resolveCodexNativeCommandSandboxBlock(ctx, normalized, rest);
@@ -525,12 +765,21 @@ async function handleCodexSubcommand(ctx, options) {
525
765
  }
526
766
  if (normalized === "steer") return { text: await steerConversationTurn(deps, ctx, options.pluginConfig, rest.join(" ")) };
527
767
  if (normalized === "model") return { text: await setConversationModel(deps, ctx, options.pluginConfig, rest) };
528
- if (normalized === "fast") return { text: await setConversationFastMode(deps, ctx, options.pluginConfig, rest) };
529
- if (normalized === "permissions") return { text: await setConversationPermissions(deps, ctx, options.pluginConfig, rest) };
768
+ if (normalized === "fast") {
769
+ if (isMenuVerb(rest)) return buildCodexFastMenuReply();
770
+ return { text: await setConversationFastMode(deps, ctx, options.pluginConfig, rest) };
771
+ }
772
+ if (normalized === "permissions") {
773
+ if (isMenuVerb(rest)) return buildCodexPermissionsMenuReply();
774
+ return { text: await setConversationPermissions(deps, ctx, options.pluginConfig, rest) };
775
+ }
530
776
  if (normalized === "compact") return { text: await startThreadAction(deps, ctx, options.pluginConfig, CODEX_CONTROL_METHODS.compact, "compaction", rest) };
531
777
  if (normalized === "review") return { text: await startThreadAction(deps, ctx, options.pluginConfig, CODEX_CONTROL_METHODS.review, "review", rest) };
532
778
  if (normalized === "diagnostics") return await handleCodexDiagnosticsFeedback(deps, ctx, options.pluginConfig, rest.join(" "), "/codex diagnostics");
533
- if (normalized === "computer-use" || normalized === "computeruse") return { text: await handleComputerUseCommand(deps, options.pluginConfig, rest) };
779
+ if (normalized === "computer-use" || normalized === "computeruse") {
780
+ if (isMenuVerb(rest)) return buildCodexComputerUseMenuReply();
781
+ return { text: await handleComputerUseCommand(deps, options.pluginConfig, rest) };
782
+ }
534
783
  if (normalized === "mcp") {
535
784
  if (rest.length > 0) return { text: "Usage: /codex mcp" };
536
785
  return { text: formatList(await deps.codexControlRequest(options.pluginConfig, CODEX_CONTROL_METHODS.listMcpServers, { limit: 100 }), "MCP servers") };
@@ -1,7 +1,7 @@
1
- import { t as defaultCodexAppServerClientFactory } from "./client-factory-bqIbmRDu.js";
2
- import { l as resolveCodexAppServerRuntimeOptions } from "./config--tW89bHH.js";
3
- import { a as readCodexAppServerBinding } from "./session-binding-BGOpicy0.js";
1
+ import { d as resolveCodexAppServerRuntimeOptions } from "./config-AlzuNKCY.js";
2
+ import { a as readCodexAppServerBinding } from "./session-binding-BXJAV_xy.js";
4
3
  import { n as resolveCodexNativeExecutionBlock } from "./sandbox-guard-DMCJlzmz.js";
4
+ import { t as defaultCodexAppServerClientFactory } from "./client-factory-B8dh39UW.js";
5
5
  import { embeddedAgentLog } from "openclaw/plugin-sdk/agent-harness-runtime";
6
6
  //#region extensions/codex/src/app-server/compact.ts
7
7
  const warnedIgnoredCompactionOverrides = /* @__PURE__ */ new Set();
@@ -1,5 +1,5 @@
1
- import { l as resolveCodexAppServerRuntimeOptions, u as resolveCodexComputerUseConfig } from "./config--tW89bHH.js";
2
- import { i as describeControlFailure, t as requestCodexAppServerJson } from "./request-DGOj3AyX.js";
1
+ import { d as resolveCodexAppServerRuntimeOptions, f as resolveCodexComputerUseConfig } from "./config-AlzuNKCY.js";
2
+ import { i as describeControlFailure, t as requestCodexAppServerJson } from "./request-DuFgTwRU.js";
3
3
  import { existsSync } from "node:fs";
4
4
  //#region extensions/codex/src/app-server/computer-use.ts
5
5
  var CodexComputerUseSetupError = class extends Error {
@@ -237,13 +237,12 @@ function marketplaceDiscoveryWaitUntil(params) {
237
237
  async function delay(ms, signal) {
238
238
  if (signal?.aborted) throw abortError(signal);
239
239
  await new Promise((resolve, reject) => {
240
- let timer;
241
240
  const onAbort = () => {
242
241
  clearTimeout(timer);
243
242
  signal?.removeEventListener("abort", onAbort);
244
243
  reject(abortError(signal));
245
244
  };
246
- timer = setTimeout(() => {
245
+ const timer = setTimeout(() => {
247
246
  signal?.removeEventListener("abort", onAbort);
248
247
  resolve();
249
248
  }, ms);
@@ -1,3 +1,4 @@
1
+ import { resolvePositiveTimerTimeoutMs } from "openclaw/plugin-sdk/number-runtime";
1
2
  import { createHmac, randomBytes } from "node:crypto";
2
3
  import { readFileSync } from "node:fs";
3
4
  import { hostname } from "node:os";
@@ -12,7 +13,15 @@ const START_OPTIONS_KEY_SECRET = getStartOptionsKeySecret();
12
13
  const UNIX_CODEX_REQUIREMENTS_PATH = "/etc/codex/requirements.toml";
13
14
  const WINDOWS_CODEX_REQUIREMENTS_SUFFIX = "\\OpenAI\\Codex\\requirements.toml";
14
15
  const PLAIN_DECIMAL_NUMBER_RE = /^[+-]?(?:(?:\d+\.?\d*)|(?:\.\d+))$/;
16
+ const CODEX_PLUGINS_MARKETPLACE_NAMES = [
17
+ "openai-curated",
18
+ "openai-bundled",
19
+ "openai-primary-runtime"
20
+ ];
15
21
  const CODEX_PLUGINS_MARKETPLACE_NAME = "openai-curated";
22
+ function isCodexPluginsMarketplaceName(name) {
23
+ return name !== void 0 && CODEX_PLUGINS_MARKETPLACE_NAMES.includes(name);
24
+ }
16
25
  function shouldAutoApproveCodexAppServerApprovals(appServer) {
17
26
  return appServer.approvalPolicy === "never" && appServer.sandbox === "danger-full-access";
18
27
  }
@@ -42,7 +51,7 @@ const codexAppServerServiceTierSchema = z.preprocess((value) => value === null ?
42
51
  const codexAppServerExperimentalSchema = z.object({ sandboxExecServer: z.boolean().optional() }).strict();
43
52
  const codexPluginEntryConfigSchema = z.object({
44
53
  enabled: z.boolean().optional(),
45
- marketplaceName: z.literal(CODEX_PLUGINS_MARKETPLACE_NAME).optional(),
54
+ marketplaceName: z.enum(CODEX_PLUGINS_MARKETPLACE_NAMES).optional(),
46
55
  pluginName: z.string().trim().min(1).optional(),
47
56
  allow_destructive_actions: z.boolean().optional()
48
57
  }).strict();
@@ -121,10 +130,10 @@ function resolveCodexPluginsPolicy(pluginConfig) {
121
130
  enabled,
122
131
  allowDestructiveActions,
123
132
  pluginPolicies: Object.entries(config?.plugins ?? {}).flatMap(([configKey, entry]) => {
124
- if (entry.marketplaceName !== "openai-curated" || !entry.pluginName) return [];
133
+ if (!isCodexPluginsMarketplaceName(entry.marketplaceName) || !entry.pluginName) return [];
125
134
  return [{
126
135
  configKey,
127
- marketplaceName: CODEX_PLUGINS_MARKETPLACE_NAME,
136
+ marketplaceName: entry.marketplaceName,
128
137
  pluginName: entry.pluginName,
129
138
  enabled: enabled && entry.enabled !== false,
130
139
  allowDestructiveActions: entry.allow_destructive_actions ?? allowDestructiveActions
@@ -674,7 +683,7 @@ function isCodexFastServiceTier(value) {
674
683
  return normalizeCodexServiceTier(value) === "priority";
675
684
  }
676
685
  function normalizePositiveNumber(value, fallback) {
677
- return typeof value === "number" && Number.isFinite(value) && value > 0 ? value : fallback;
686
+ return resolvePositiveTimerTimeoutMs(value, fallback);
678
687
  }
679
688
  function normalizeHeaders(value) {
680
689
  if (!value || typeof value !== "object" || Array.isArray(value)) return {};
@@ -756,4 +765,4 @@ function splitShellWords(value) {
756
765
  return words;
757
766
  }
758
767
  //#endregion
759
- export { isCodexFastServiceTier as a, readCodexPluginConfig as c, resolveCodexPluginsPolicy as d, resolveOpenClawExecPolicyForCodexAppServer as f, isCodexAppServerApprovalPolicyAllowedByRequirements as i, resolveCodexAppServerRuntimeOptions as l, withMcpElicitationsApprovalPolicy as m, codexAppServerStartOptionsKey as n, isCodexSandboxExecServerEnabled as o, shouldAutoApproveCodexAppServerApprovals as p, codexSandboxPolicyForTurn as r, normalizeCodexServiceTier as s, CODEX_PLUGINS_MARKETPLACE_NAME as t, resolveCodexComputerUseConfig as u };
768
+ export { isCodexAppServerApprovalPolicyAllowedByRequirements as a, isCodexSandboxExecServerEnabled as c, resolveCodexAppServerRuntimeOptions as d, resolveCodexComputerUseConfig as f, withMcpElicitationsApprovalPolicy as g, shouldAutoApproveCodexAppServerApprovals as h, codexSandboxPolicyForTurn as i, normalizeCodexServiceTier as l, resolveOpenClawExecPolicyForCodexAppServer as m, CODEX_PLUGINS_MARKETPLACE_NAMES as n, isCodexFastServiceTier as o, resolveCodexPluginsPolicy as p, codexAppServerStartOptionsKey as r, isCodexPluginsMarketplaceName as s, CODEX_PLUGINS_MARKETPLACE_NAME as t, readCodexPluginConfig as u };
@@ -1,18 +1,18 @@
1
- import { a as isCodexFastServiceTier, f as resolveOpenClawExecPolicyForCodexAppServer, l as resolveCodexAppServerRuntimeOptions, r as codexSandboxPolicyForTurn } from "./config--tW89bHH.js";
2
- import { l as isJsonObject } from "./client-B08x7Y93.js";
3
- import { t as CODEX_NATIVE_PERSONALITY_NONE } from "./thread-lifecycle-BR74qMaY.js";
4
- import { a as readCodexAppServerBinding, i as normalizeCodexAppServerBindingModelProvider, r as isCodexAppServerNativeAuthProfile, s as writeCodexAppServerBinding, t as clearCodexAppServerBinding } from "./session-binding-BGOpicy0.js";
5
- import { r as CODEX_CONTROL_METHODS } from "./request-DGOj3AyX.js";
6
- import { i as readCodexNotificationTurnId, r as readCodexNotificationThreadId, s as formatCodexDisplayText } from "./notification-correlation-DR9cQN_M.js";
7
- import { a as releaseLeasedSharedCodexAppServerClient, f as resolveCodexAppServerAuthProfileIdForAgent, i as getLeasedSharedCodexAppServerClient } from "./shared-client-2d0XB7wz.js";
1
+ import { d as resolveCodexAppServerRuntimeOptions, i as codexSandboxPolicyForTurn, m as resolveOpenClawExecPolicyForCodexAppServer, o as isCodexFastServiceTier } from "./config-AlzuNKCY.js";
2
+ import { l as isJsonObject } from "./client-BnOmn0y-.js";
3
+ import { t as CODEX_NATIVE_PERSONALITY_NONE } from "./thread-lifecycle-Bnlv_Q8u.js";
4
+ import { a as readCodexAppServerBinding, i as normalizeCodexAppServerBindingModelProvider, r as isCodexAppServerNativeAuthProfile, s as writeCodexAppServerBinding, t as clearCodexAppServerBinding } from "./session-binding-BXJAV_xy.js";
5
+ import { r as CODEX_CONTROL_METHODS } from "./request-DuFgTwRU.js";
6
+ import { i as readCodexNotificationTurnId, r as readCodexNotificationThreadId, s as formatCodexDisplayText } from "./notification-correlation-BykOI_jh.js";
7
+ import { a as releaseLeasedSharedCodexAppServerClient, f as resolveCodexAppServerAuthProfileIdForAgent, i as getLeasedSharedCodexAppServerClient } from "./shared-client-DBlR-rV2.js";
8
8
  import { n as resolveCodexNativeExecutionBlock, r as resolveCodexNativeSandboxBlock } from "./sandbox-guard-DMCJlzmz.js";
9
+ import { resolveTimerTimeoutMs, timestampMsToIsoString } from "openclaw/plugin-sdk/number-runtime";
9
10
  import os from "node:os";
10
11
  import { loadExecApprovals } from "openclaw/plugin-sdk/exec-approvals-runtime";
11
12
  import { asOptionalRecord, isRecord, normalizeSingleOrTrimmedStringList } from "openclaw/plugin-sdk/string-coerce-runtime";
12
13
  import { materializeWindowsSpawnProgram, resolveWindowsSpawnProgram } from "openclaw/plugin-sdk/windows-spawn";
13
14
  import { formatErrorMessage, resolveSandboxContext } from "openclaw/plugin-sdk/agent-harness-runtime";
14
15
  import { spawn } from "node:child_process";
15
- import { timestampMsToIsoString } from "openclaw/plugin-sdk/number-runtime";
16
16
  import fs from "node:fs/promises";
17
17
  import path from "node:path";
18
18
  import { resolveSessionAgentIds as resolveSessionAgentIds$1 } from "openclaw/plugin-sdk/agent-runtime";
@@ -366,7 +366,7 @@ function createCodexConversationTurnCollector(threadId) {
366
366
  completed = true;
367
367
  reject(/* @__PURE__ */ new Error("codex app-server bound turn timed out"));
368
368
  clearWaitState();
369
- }, Math.max(100, params.timeoutMs));
369
+ }, resolveTimerTimeoutMs(params.timeoutMs, 100, 100));
370
370
  timeout.unref?.();
371
371
  });
372
372
  }
@@ -3,7 +3,7 @@ function asRecord(value) {
3
3
  return value && typeof value === "object" && !Array.isArray(value) ? value : null;
4
4
  }
5
5
  function hasRetiredDynamicToolsProfile(value) {
6
- return Object.prototype.hasOwnProperty.call(asRecord(value) ?? {}, "codexDynamicToolsProfile");
6
+ return Object.hasOwn(asRecord(value) ?? {}, "codexDynamicToolsProfile");
7
7
  }
8
8
  const legacyConfigRules = [{
9
9
  path: [
package/dist/harness.js CHANGED
@@ -28,31 +28,31 @@ function createCodexAppServerAgentHarness(options) {
28
28
  };
29
29
  },
30
30
  runAttempt: async (params) => {
31
- const { runCodexAppServerAttempt } = await import("./run-attempt-lD4FLxNV.js");
31
+ const { runCodexAppServerAttempt } = await import("./run-attempt-CgaY9r5u.js");
32
32
  return runCodexAppServerAttempt(params, {
33
33
  pluginConfig: options?.resolvePluginConfig?.() ?? options?.pluginConfig,
34
34
  nativeHookRelay: { enabled: true }
35
35
  });
36
36
  },
37
37
  runSideQuestion: async (params) => {
38
- const { runCodexAppServerSideQuestion } = await import("./side-question-BsyY3v3K.js");
38
+ const { runCodexAppServerSideQuestion } = await import("./side-question-SjBLGANT.js");
39
39
  return runCodexAppServerSideQuestion(params, {
40
40
  pluginConfig: options?.resolvePluginConfig?.() ?? options?.pluginConfig,
41
41
  nativeHookRelay: { enabled: true }
42
42
  });
43
43
  },
44
44
  compact: async (params) => {
45
- const { maybeCompactCodexAppServerSession } = await import("./compact-DJruF_vy.js");
45
+ const { maybeCompactCodexAppServerSession } = await import("./compact-BXLjhUHX.js");
46
46
  return maybeCompactCodexAppServerSession(params, { pluginConfig: options?.resolvePluginConfig?.() ?? options?.pluginConfig });
47
47
  },
48
48
  reset: async (params) => {
49
49
  if (params.sessionFile) {
50
- const { clearCodexAppServerBinding } = await import("./session-binding-BGOpicy0.js").then((n) => n.o);
50
+ const { clearCodexAppServerBinding } = await import("./session-binding-BXJAV_xy.js").then((n) => n.o);
51
51
  await clearCodexAppServerBinding(params.sessionFile);
52
52
  }
53
53
  },
54
54
  dispose: async () => {
55
- const { clearSharedCodexAppServerClientAndWait } = await import("./shared-client-2d0XB7wz.js").then((n) => n.s);
55
+ const { clearSharedCodexAppServerClientAndWait } = await import("./shared-client-DBlR-rV2.js").then((n) => n.s);
56
56
  await clearSharedCodexAppServerClientAndWait();
57
57
  }
58
58
  };
package/dist/index.js CHANGED
@@ -1,18 +1,18 @@
1
1
  import { createCodexAppServerAgentHarness } from "./harness.js";
2
- import { c as readCodexPluginConfig, l as resolveCodexAppServerRuntimeOptions, t as CODEX_PLUGINS_MARKETPLACE_NAME } from "./config--tW89bHH.js";
2
+ import { d as resolveCodexAppServerRuntimeOptions, s as isCodexPluginsMarketplaceName, t as CODEX_PLUGINS_MARKETPLACE_NAME, u as readCodexPluginConfig } from "./config-AlzuNKCY.js";
3
3
  import { buildCodexProvider } from "./provider.js";
4
- import { v as ensureCodexPluginActivation, x as defaultCodexAppInventoryCache, y as pluginReadParams } from "./thread-lifecycle-BR74qMaY.js";
4
+ import { v as ensureCodexPluginActivation, x as defaultCodexAppInventoryCache, y as pluginReadParams } from "./thread-lifecycle-Bnlv_Q8u.js";
5
5
  import { buildCodexMediaUnderstandingProvider } from "./media-understanding-provider.js";
6
- import { i as describeControlFailure, n as buildCodexPluginAppCacheKey, t as requestCodexAppServerJson } from "./request-DGOj3AyX.js";
7
- import { s as formatCodexDisplayText } from "./notification-correlation-DR9cQN_M.js";
8
- import { a as releaseLeasedSharedCodexAppServerClient, f as resolveCodexAppServerAuthProfileIdForAgent, i as getLeasedSharedCodexAppServerClient, n as clearSharedCodexAppServerClientIfCurrentAndWait, p as resolveCodexAppServerFallbackApiKeyCacheKey, u as resolveCodexAppServerAuthAccountCacheKey } from "./shared-client-2d0XB7wz.js";
9
- import { a as createCodexCliSessionNodeInvokePolicies, c as resolveCodexCliSessionForBindingOnNode, i as createCodexCliSessionNodeHostCommands, l as resumeCodexCliSessionOnNode, n as handleCodexConversationInboundClaim, s as listCodexCliSessionsOnNode, t as handleCodexConversationBindingResolved } from "./conversation-binding-DzF_JII7.js";
6
+ import { i as describeControlFailure, n as buildCodexPluginAppCacheKey, t as requestCodexAppServerJson } from "./request-DuFgTwRU.js";
7
+ import { s as formatCodexDisplayText } from "./notification-correlation-BykOI_jh.js";
8
+ import { a as releaseLeasedSharedCodexAppServerClient, f as resolveCodexAppServerAuthProfileIdForAgent, i as getLeasedSharedCodexAppServerClient, n as clearSharedCodexAppServerClientIfCurrentAndWait, p as resolveCodexAppServerFallbackApiKeyCacheKey, u as resolveCodexAppServerAuthAccountCacheKey } from "./shared-client-DBlR-rV2.js";
9
+ import { a as createCodexCliSessionNodeInvokePolicies, c as resolveCodexCliSessionForBindingOnNode, i as createCodexCliSessionNodeHostCommands, l as resumeCodexCliSessionOnNode, n as handleCodexConversationInboundClaim, s as listCodexCliSessionsOnNode, t as handleCodexConversationBindingResolved } from "./conversation-binding-KUDxop-C.js";
10
10
  import { mutateConfigFile } from "openclaw/plugin-sdk/config-mutation";
11
11
  import { resolveLivePluginConfigObject } from "openclaw/plugin-sdk/plugin-config-runtime";
12
12
  import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
13
+ import { parseStrictNonNegativeInteger } from "openclaw/plugin-sdk/number-runtime";
13
14
  import os from "node:os";
14
15
  import { asBoolean, isRecord, normalizeOptionalString, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
15
- import { parseStrictNonNegativeInteger } from "openclaw/plugin-sdk/number-runtime";
16
16
  import fs from "node:fs/promises";
17
17
  import path from "node:path";
18
18
  import { loadAuthProfileStoreWithoutExternalProfiles, resolveAgentConfig, resolveAgentWorkspaceDir, resolveDefaultAgentId } from "openclaw/plugin-sdk/agent-runtime";
@@ -48,7 +48,7 @@ async function handleCodexCommand(ctx, options = {}) {
48
48
  }
49
49
  }
50
50
  async function loadDefaultCodexSubcommandHandler() {
51
- const { handleCodexSubcommand } = await import("./command-handlers-VSWuNdgc.js");
51
+ const { handleCodexSubcommand } = await import("./command-handlers-BsK6kZJi.js");
52
52
  return handleCodexSubcommand;
53
53
  }
54
54
  //#endregion
@@ -1341,7 +1341,10 @@ async function requestTargetCodexAppServerJson(params) {
1341
1341
  function hasOpenAiCuratedMarketplace(response) {
1342
1342
  if (!response || typeof response !== "object" || !("marketplaces" in response)) return false;
1343
1343
  const marketplaces = response.marketplaces;
1344
- return Array.isArray(marketplaces) && marketplaces.some((marketplace) => marketplace && typeof marketplace === "object" && marketplace.name === "openai-curated");
1344
+ return Array.isArray(marketplaces) && marketplaces.some((marketplace) => {
1345
+ if (!marketplace || typeof marketplace !== "object") return false;
1346
+ return marketplace.name === "openai-curated";
1347
+ });
1345
1348
  }
1346
1349
  function targetCodexMarketplaceDiscoveryTimeoutMs(env = process.env) {
1347
1350
  const configured = parseStrictNonNegativeInteger(env[TARGET_CODEX_MARKETPLACE_DISCOVERY_TIMEOUT_ENV]);
@@ -1418,10 +1421,10 @@ function readCodexPluginPolicy(item) {
1418
1421
  const configKey = item.details?.configKey;
1419
1422
  const marketplaceName = item.details?.marketplaceName;
1420
1423
  const pluginName = item.details?.pluginName;
1421
- if (typeof configKey !== "string" || marketplaceName !== "openai-curated" || typeof pluginName !== "string") return;
1424
+ if (typeof configKey !== "string" || typeof marketplaceName !== "string" || !isCodexPluginsMarketplaceName(marketplaceName) || typeof pluginName !== "string") return;
1422
1425
  return {
1423
1426
  configKey,
1424
- marketplaceName: CODEX_PLUGINS_MARKETPLACE_NAME,
1427
+ marketplaceName,
1425
1428
  pluginName,
1426
1429
  enabled: true,
1427
1430
  allowDestructiveActions: true