@openclaw/codex 2026.8.1-beta.2 → 2026.8.1-beta.3

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 (59) hide show
  1. package/dist/api.js +147 -0
  2. package/dist/app-server-policy-bg5QPSVP.js +25 -0
  3. package/dist/{attempt-client-cleanup-DMLXUfa8.js → attempt-client-cleanup-URjUlCHg.js} +1 -1
  4. package/dist/{binding-connection-I5Bo-AsX.js → binding-connection-DAvZwp96.js} +15 -3
  5. package/dist/{bounded-turn-qgZmzy_4.js → bounded-turn-4BjrZEwW.js} +22 -16
  6. package/dist/{capabilities-CybGI1oz.js → capabilities-CH3K57v4.js} +1 -1
  7. package/dist/cli-metadata.js +1 -1
  8. package/dist/{command-formatters-B1AEz8ZA.js → command-formatters-D0nZ3qtd.js} +2 -2
  9. package/dist/{command-handlers-Db8pu_ds.js → command-handlers-DC86lgT4.js} +39 -22
  10. package/dist/command-rpc-xUIIonsO.js +90 -0
  11. package/dist/{compact-LspQaGfl.js → compact-COqgBRny.js} +35 -29
  12. package/dist/{session-binding-DPxIvMgE.js → config-CpNeo5AE.js} +28 -888
  13. package/dist/context-compaction-activity-BOeJf7yo.js +58 -0
  14. package/dist/doctor-contract-api.js +15 -14
  15. package/dist/{dynamic-tools-BVdyWkUD.js → dynamic-tools-fJZhl4CE.js} +1284 -651
  16. package/dist/{effective-mcp-catalog-DIIhAtOZ.js → effective-mcp-catalog-4YKn51aG.js} +2 -2
  17. package/dist/elicitation-input-DMkeki8d.js +71 -0
  18. package/dist/{event-projector-usage-e5huIQWu.js → event-projector-usage-CLwNEJqW.js} +16 -16
  19. package/dist/harness-DoKQcF8n.js +258 -0
  20. package/dist/harness.js +2 -226
  21. package/dist/index.js +171 -48
  22. package/dist/{isolated-completion-C58NbL40.js → isolated-completion-DPMtlH9r.js} +3 -3
  23. package/dist/managed-binary-By4FZC6i.js +212 -0
  24. package/dist/media-understanding-provider.js +2 -2
  25. package/dist/model-catalog-CmGoqVKB.js +48 -0
  26. package/dist/{models-BFlpn1Ex.js → models-CZw1wClT.js} +2 -2
  27. package/dist/{native-subagent-monitor-DyTGmTUx.js → native-subagent-monitor-GGq3RnOo.js} +185 -71
  28. package/dist/node-exec-server.runtime-Bsu1LdFZ.js +192 -0
  29. package/dist/{plugin-app-cache-key-C3H2CVp6.js → plugin-app-cache-key-DMNQ8Zi8.js} +15 -3
  30. package/dist/plugin-approval-roundtrip-C75Yiiwc.js +95 -0
  31. package/dist/{plugin-marketplace-discovery-CzrGJdCR.js → plugin-marketplace-discovery-CSWDkMrP.js} +40 -26
  32. package/dist/{plugin-metadata-cache-CNJPj4_b.js → plugin-metadata-cache-BXH5NF-4.js} +8 -5
  33. package/dist/{protocol-validators-B4F7L8Rf.js → protocol-validators-VAVyEnDp.js} +55 -2
  34. package/dist/{rate-limits-DZXmOL8-.js → rate-limits-BI1dMHDG.js} +1 -1
  35. package/dist/{request-BRl5_UfX.js → request-DSK0W6YI.js} +2 -2
  36. package/dist/{run-attempt-P8BdxC1I.js → run-attempt-BV3HzuCf.js} +1098 -666
  37. package/dist/{runtime-artifact-BVSPdd6g.js → runtime-artifact-BvyT1uyd.js} +4 -7
  38. package/dist/{sandbox-guard-Cmwc9eIk.js → sandbox-guard-C1qEeZ5C.js} +25 -19
  39. package/dist/session-binding-BTrLf9Qm.js +874 -0
  40. package/dist/{session-catalog-xwNi_SDM.js → session-catalog-ezP_UcRM.js} +1541 -1296
  41. package/dist/session-catalog-home-id-BNwAJ9D7.js +18 -0
  42. package/dist/{session-cli-7hgXZDV7.js → session-cli-B1hKvfkI.js} +20 -7
  43. package/dist/{session-retirement-DoMMJFKm.js → session-retirement-CE4iMiLh.js} +3 -3
  44. package/dist/{session-upstream-marker-CrIFX06J.js → session-upstream-marker-D_2npHlA.js} +1 -1
  45. package/dist/{settled-turn-finalizer-BRWBO4MO.js → settled-turn-finalizer-Dx1onIqg.js} +23 -19
  46. package/dist/{shared-client-kIBbGjk4.js → shared-client-Dw-rzii0.js} +755 -273
  47. package/dist/{side-question-9HAL26l9.js → side-question-DbXkJZzg.js} +52 -30
  48. package/dist/{thread-lifecycle-Bu1BTDXr.js → thread-lifecycle-DKdrnTMX.js} +310 -92
  49. package/dist/{thread-ownership-6kOQHlyC.js → thread-ownership-i2NBwDUL.js} +2 -2
  50. package/dist/{thread-resume-CPrJNQVM.js → thread-resume-CdJk2Ehf.js} +3 -3
  51. package/dist/{transcript-mirror-B9gGgnJS.js → transcript-mirror-BU0_LKAL.js} +46 -28
  52. package/dist/{transport-stdio-DIImwDVS.js → transport-stdio-DhoGy33Z.js} +2 -2
  53. package/dist/{upstream-prompt-provenance-ClRBije0.js → upstream-prompt-provenance-CFmsKwr9.js} +12 -14
  54. package/dist/{upstream-session-fork-CE-_LdnP.js → upstream-session-fork-BDVJCLAD.js} +12 -6
  55. package/dist/{usage-CHlV0e-o.js → usage-9dKJCgcy.js} +3 -3
  56. package/dist/{web-search-provider.runtime-DRw2Vl42.js → web-search-provider.runtime-DCdx4DGu.js} +3 -3
  57. package/openclaw.plugin.json +31 -1
  58. package/package.json +6 -5
  59. package/dist/app-server-policy-zcBDc1JU.js +0 -49
@@ -0,0 +1,58 @@
1
+ import { embeddedAgentLog, formatErrorMessage } from "openclaw/plugin-sdk/agent-harness-runtime";
2
+ import { appendSessionTranscriptMessageByIdentity, publishSessionTranscriptUpdateByIdentity } from "openclaw/plugin-sdk/session-transcript-runtime";
3
+ //#region extensions/codex/src/app-server/context-compaction-activity.ts
4
+ const CONTEXT_COMPACTION_CUSTOM_TYPE = "openclaw.context-compaction";
5
+ async function persistCodexContextCompactionActivity(params) {
6
+ const target = params.sessionTarget;
7
+ if (!target?.sessionId || !target.sessionKey || !target.storePath) return;
8
+ const activityId = `codex-context-compaction:${params.threadId}:${params.turnId}:${params.itemId}`;
9
+ const message = {
10
+ role: "custom",
11
+ customType: CONTEXT_COMPACTION_CUSTOM_TYPE,
12
+ content: "Context compacted",
13
+ display: true,
14
+ excludeFromContext: true,
15
+ details: {
16
+ kind: "context_compaction",
17
+ backend: "codex-app-server",
18
+ threadId: params.threadId,
19
+ turnId: params.turnId,
20
+ itemId: params.itemId,
21
+ ...params.runId ? { runId: params.runId } : {}
22
+ },
23
+ ...params.runId ? { __openclaw: { runId: params.runId } } : {},
24
+ timestamp: params.timestamp,
25
+ idempotencyKey: activityId
26
+ };
27
+ try {
28
+ const appended = await appendSessionTranscriptMessageByIdentity({
29
+ agentId: target.agentId,
30
+ sessionId: target.sessionId,
31
+ sessionKey: target.sessionKey,
32
+ storePath: target.storePath,
33
+ config: params.config,
34
+ cwd: params.cwd,
35
+ eventId: activityId,
36
+ message
37
+ });
38
+ if (!appended?.appended) return;
39
+ await publishSessionTranscriptUpdateByIdentity({
40
+ agentId: target.agentId,
41
+ sessionId: target.sessionId,
42
+ sessionKey: target.sessionKey,
43
+ storePath: target.storePath,
44
+ update: {
45
+ message: appended.message,
46
+ messageId: appended.messageId,
47
+ ...params.runId ? { runId: params.runId } : {}
48
+ }
49
+ });
50
+ } catch (error) {
51
+ embeddedAgentLog.warn("failed to persist codex context compaction activity", {
52
+ error: formatErrorMessage(error),
53
+ itemId: params.itemId
54
+ });
55
+ }
56
+ }
57
+ //#endregion
58
+ export { persistCodexContextCompactionActivity as t };
@@ -3,8 +3,10 @@ import { asNullableRecord, isRecord } from "openclaw/plugin-sdk/string-coerce-ru
3
3
  import fs from "node:fs/promises";
4
4
  import path from "node:path";
5
5
  import { isDeepStrictEqual } from "node:util";
6
- import { canonicalPathFromExistingAncestor, isPathInside, pathExists } from "openclaw/plugin-sdk/security-runtime";
7
6
  import { listAgentIds, resolveAgentDir, resolveSessionAgentIds } from "openclaw/plugin-sdk/agent-scope-runtime";
7
+ import { pathExists } from "openclaw/plugin-sdk/security-runtime";
8
+ import { normalizeAgentId } from "openclaw/plugin-sdk/routing";
9
+ import { canonicalPathFromExistingAncestor, isPathInside } from "openclaw/plugin-sdk/file-access-runtime";
8
10
  import { withFileLock } from "openclaw/plugin-sdk/file-lock";
9
11
  import { archiveLegacyStateSource, legacyStateFileExists } from "openclaw/plugin-sdk/runtime-doctor-migrations";
10
12
  //#region extensions/codex/src/migration/session-binding-sidecars.ts
@@ -242,24 +244,23 @@ async function resolveLegacySessionFileLocator(sessionsDir, entry, sessionId) {
242
244
  if (!isPathInside(canonicalBase, canonicalCandidate)) throw new Error("legacy session file locator escapes its session directory");
243
245
  return candidate;
244
246
  }
245
- function resolveLegacyBindingOwnerAgentId(params) {
247
+ function tryResolveLegacyBindingOwnerAgentId(params) {
246
248
  if (params.sessionKey.trim().toLowerCase().startsWith("agent:")) return resolveSessionAgentIds({
247
249
  sessionKey: params.sessionKey,
248
250
  config: params.config
249
251
  }).sessionAgentId;
250
252
  const storeAgentId = params.storeAgentIds?.size === 1 ? [...params.storeAgentIds][0] : void 0;
251
- return resolveSessionAgentIds({
252
- sessionKey: params.sessionKey,
253
- config: params.config,
254
- ...storeAgentId ? { agentId: storeAgentId } : {}
255
- }).sessionAgentId;
256
- }
257
- function tryResolveLegacyBindingOwnerAgentId(params) {
258
- try {
259
- return resolveLegacyBindingOwnerAgentId(params);
253
+ const configuredAgentId = params.config.agents?.defaults?.systemAgent?.agentId?.trim();
254
+ const systemAgentId = !storeAgentId && configuredAgentId ? normalizeAgentId(configuredAgentId) : void 0;
255
+ const fallbackAgentIds = systemAgentId && listAgentIds(params.config).includes(systemAgentId) ? [void 0, systemAgentId] : [void 0];
256
+ for (const fallbackAgentId of fallbackAgentIds) try {
257
+ return resolveSessionAgentIds({
258
+ sessionKey: params.sessionKey,
259
+ config: params.config,
260
+ ...storeAgentId ? { agentId: storeAgentId } : fallbackAgentId ? { fallbackAgentId } : {}
261
+ }).sessionAgentId;
260
262
  } catch (error) {
261
- if (error.code === "AGENT_SELECTION_REQUIRED") return;
262
- throw error;
263
+ if (error.code !== "AGENT_SELECTION_REQUIRED") throw error;
263
264
  }
264
265
  }
265
266
  function copyBindingForSession(stored, sessionId) {
@@ -292,7 +293,7 @@ async function migrateSource(source, candidates, params, store) {
292
293
  return await withFileLock(source.sidecarPath, LEGACY_BINDING_LOCK_OPTIONS, async () => {
293
294
  const [contents, stat] = await Promise.all([fs.readFile(source.sidecarPath, "utf8"), fs.stat(source.sidecarPath)]);
294
295
  const raw = JSON.parse(contents);
295
- const [{ bindingStoreKey, createStoredCodexAppServerBinding, normalizeStoredCodexAppServerBindingFingerprints, readStoredCodexAppServerBinding }, { legacyCodexConversationBindingId }] = await Promise.all([import("./session-binding-DPxIvMgE.js").then((n) => n.f), import("./conversation-binding-data-CW2GuupV.js").then((n) => n.t)]);
296
+ const [{ bindingStoreKey, createStoredCodexAppServerBinding, normalizeStoredCodexAppServerBindingFingerprints, readStoredCodexAppServerBinding }, { legacyCodexConversationBindingId }] = await Promise.all([import("./session-binding-BTrLf9Qm.js").then((n) => n.f), import("./conversation-binding-data-CW2GuupV.js").then((n) => n.t)]);
296
297
  const agentId = owner?.agentId ?? (source.agentIds.size === 1 ? [...source.agentIds][0] : void 0);
297
298
  const baseStored = createStoredCodexAppServerBinding(raw, {
298
299
  now: stat.mtime.toISOString(),