@clawos-dev/clawd 0.2.278 → 0.2.279

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.
@@ -3227,8 +3227,8 @@ var require_utils = __commonJS({
3227
3227
  }
3228
3228
  return ind;
3229
3229
  }
3230
- function removeDotSegments(path4) {
3231
- let input = path4;
3230
+ function removeDotSegments(path2) {
3231
+ let input = path2;
3232
3232
  const output = [];
3233
3233
  let nextSlash = -1;
3234
3234
  let len = 0;
@@ -3480,8 +3480,8 @@ var require_schemes = __commonJS({
3480
3480
  wsComponent.secure = void 0;
3481
3481
  }
3482
3482
  if (wsComponent.resourceName) {
3483
- const [path4, query] = wsComponent.resourceName.split("?");
3484
- wsComponent.path = path4 && path4 !== "/" ? path4 : void 0;
3483
+ const [path2, query] = wsComponent.resourceName.split("?");
3484
+ wsComponent.path = path2 && path2 !== "/" ? path2 : void 0;
3485
3485
  wsComponent.query = query;
3486
3486
  wsComponent.resourceName = void 0;
3487
3487
  }
@@ -6874,12 +6874,12 @@ var require_dist = __commonJS({
6874
6874
  throw new Error(`Unknown format "${name}"`);
6875
6875
  return f;
6876
6876
  };
6877
- function addFormats(ajv, list, fs6, exportName) {
6877
+ function addFormats(ajv, list, fs4, exportName) {
6878
6878
  var _a;
6879
6879
  var _b;
6880
6880
  (_a = (_b = ajv.opts.code).formats) !== null && _a !== void 0 ? _a : _b.formats = (0, codegen_1._)`require("ajv-formats/dist/formats").${exportName}`;
6881
6881
  for (const f of list)
6882
- ajv.addFormat(f, fs6[f]);
6882
+ ajv.addFormat(f, fs4[f]);
6883
6883
  }
6884
6884
  module2.exports = exports2 = formatsPlugin;
6885
6885
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -6895,7 +6895,7 @@ __export(mcp_server_exports, {
6895
6895
  handlePersonaDispatchToolCall: () => handlePersonaDispatchToolCall
6896
6896
  });
6897
6897
  module.exports = __toCommonJS(mcp_server_exports);
6898
- var import_node_fs5 = __toESM(require("fs"), 1);
6898
+ var import_node_fs3 = __toESM(require("fs"), 1);
6899
6899
 
6900
6900
  // ../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/external.js
6901
6901
  var external_exports = {};
@@ -7375,8 +7375,8 @@ function getErrorMap() {
7375
7375
 
7376
7376
  // ../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js
7377
7377
  var makeIssue = (params) => {
7378
- const { data, path: path4, errorMaps, issueData } = params;
7379
- const fullPath = [...path4, ...issueData.path || []];
7378
+ const { data, path: path2, errorMaps, issueData } = params;
7379
+ const fullPath = [...path2, ...issueData.path || []];
7380
7380
  const fullIssue = {
7381
7381
  ...issueData,
7382
7382
  path: fullPath
@@ -7492,11 +7492,11 @@ var errorUtil;
7492
7492
 
7493
7493
  // ../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.js
7494
7494
  var ParseInputLazyPath = class {
7495
- constructor(parent, value, path4, key) {
7495
+ constructor(parent, value, path2, key) {
7496
7496
  this._cachedPath = [];
7497
7497
  this.parent = parent;
7498
7498
  this.data = value;
7499
- this._path = path4;
7499
+ this._path = path2;
7500
7500
  this._key = key;
7501
7501
  }
7502
7502
  get path() {
@@ -11133,10 +11133,10 @@ function assignProp(target, prop, value) {
11133
11133
  configurable: true
11134
11134
  });
11135
11135
  }
11136
- function getElementAtPath(obj, path4) {
11137
- if (!path4)
11136
+ function getElementAtPath(obj, path2) {
11137
+ if (!path2)
11138
11138
  return obj;
11139
- return path4.reduce((acc, key) => acc?.[key], obj);
11139
+ return path2.reduce((acc, key) => acc?.[key], obj);
11140
11140
  }
11141
11141
  function promiseAllObject(promisesObj) {
11142
11142
  const keys = Object.keys(promisesObj);
@@ -11456,11 +11456,11 @@ function aborted(x, startIndex = 0) {
11456
11456
  }
11457
11457
  return false;
11458
11458
  }
11459
- function prefixIssues(path4, issues) {
11459
+ function prefixIssues(path2, issues) {
11460
11460
  return issues.map((iss) => {
11461
11461
  var _a;
11462
11462
  (_a = iss).path ?? (_a.path = []);
11463
- iss.path.unshift(path4);
11463
+ iss.path.unshift(path2);
11464
11464
  return iss;
11465
11465
  });
11466
11466
  }
@@ -21959,12 +21959,22 @@ var sessionMetaShape = {
21959
21959
  contextWindowSize: external_exports.number().int().positive().optional()
21960
21960
  };
21961
21961
  var SessionMetaSchema = external_exports.object(sessionMetaShape);
21962
+ var SelectOptionSchema = external_exports.object({
21963
+ value: external_exports.string(),
21964
+ label: external_exports.string(),
21965
+ description: external_exports.string().optional()
21966
+ });
21962
21967
  var ModelInfoSchema = external_exports.object({
21963
21968
  id: external_exports.string().min(1),
21964
21969
  label: external_exports.string().min(1),
21965
21970
  description: external_exports.string().optional(),
21966
21971
  contextWindowSize: external_exports.number().int().positive(),
21967
- default: external_exports.boolean().optional()
21972
+ default: external_exports.boolean().optional(),
21973
+ // 该模型支持的 reasoning effort 档位(codex:per-model,gpt-5.6 系有 max/ultra、5.5 只有四档)。
21974
+ // 缺省 = 该 tool 的 effort 与模型无关(claude 即此情形),消费方回落到 configSchema 里
21975
+ // name==='effort' 那条字段的 options。
21976
+ efforts: external_exports.array(SelectOptionSchema).optional(),
21977
+ defaultEffort: external_exports.string().optional()
21968
21978
  });
21969
21979
  var ModeInfoSchema = external_exports.object({
21970
21980
  id: external_exports.string().min(1),
@@ -21976,13 +21986,7 @@ var ConfigFieldSchemaSchema = external_exports.object({
21976
21986
  type: external_exports.enum(["string", "select", "toggle"]),
21977
21987
  label: external_exports.string().min(1),
21978
21988
  description: external_exports.string().optional(),
21979
- options: external_exports.array(
21980
- external_exports.object({
21981
- value: external_exports.string(),
21982
- label: external_exports.string(),
21983
- description: external_exports.string().optional()
21984
- })
21985
- ).optional(),
21989
+ options: external_exports.array(SelectOptionSchema).optional(),
21986
21990
  default: external_exports.unknown().optional(),
21987
21991
  scope: external_exports.enum(["core", "tool-specific"])
21988
21992
  });
@@ -23528,11 +23532,11 @@ Diff.prototype = {
23528
23532
  }
23529
23533
  }
23530
23534
  },
23531
- addToPath: function addToPath(path4, added, removed, oldPosInc, options) {
23532
- var last = path4.lastComponent;
23535
+ addToPath: function addToPath(path2, added, removed, oldPosInc, options) {
23536
+ var last = path2.lastComponent;
23533
23537
  if (last && !options.oneChangePerToken && last.added === added && last.removed === removed) {
23534
23538
  return {
23535
- oldPos: path4.oldPos + oldPosInc,
23539
+ oldPos: path2.oldPos + oldPosInc,
23536
23540
  lastComponent: {
23537
23541
  count: last.count + 1,
23538
23542
  added,
@@ -23542,7 +23546,7 @@ Diff.prototype = {
23542
23546
  };
23543
23547
  } else {
23544
23548
  return {
23545
- oldPos: path4.oldPos + oldPosInc,
23549
+ oldPos: path2.oldPos + oldPosInc,
23546
23550
  lastComponent: {
23547
23551
  count: 1,
23548
23552
  added,
@@ -24037,80 +24041,6 @@ var CLAUDE_CAPABILITIES = {
24037
24041
  ]
24038
24042
  };
24039
24043
 
24040
- // src/tools/codex.ts
24041
- var import_node_child_process5 = require("child_process");
24042
- var import_node_fs4 = __toESM(require("fs"), 1);
24043
-
24044
- // src/tools/codex-session.ts
24045
- var import_node_child_process4 = require("child_process");
24046
- var import_node_path3 = __toESM(require("path"), 1);
24047
-
24048
- // src/tools/codex-app-server-client.ts
24049
- var import_node_readline = require("readline");
24050
-
24051
- // src/tools/codex-mcp-config.ts
24052
- var import_node_fs3 = __toESM(require("fs"), 1);
24053
- var import_node_path2 = __toESM(require("path"), 1);
24054
-
24055
- // src/tools/codex-features.ts
24056
- var import_node_child_process3 = require("child_process");
24057
-
24058
- // src/tools/codex.ts
24059
- var CODEX_MODEL_IDS = ["gpt-5.5", "gpt-5.4", "gpt-5.4-mini"];
24060
- var CODEX_MODELS = [
24061
- { id: "", label: "Default", description: "codex config.toml \u9ED8\u8BA4", contextWindowSize: 258400, default: true },
24062
- { id: "gpt-5.5", label: "GPT-5.5", description: "Frontier model for complex coding", contextWindowSize: 258400 },
24063
- { id: "gpt-5.4", label: "GPT-5.4", contextWindowSize: 258400 },
24064
- { id: "gpt-5.4-mini", label: "GPT-5.4-Mini", contextWindowSize: 258400 }
24065
- ];
24066
- var CODEX_EFFORTS = [
24067
- { value: "low", label: "Low", description: "Fast responses with lighter reasoning" },
24068
- { value: "medium", label: "Medium", description: "Balances speed and reasoning depth for everyday tasks" },
24069
- { value: "high", label: "High", description: "Greater reasoning depth for complex problems" },
24070
- { value: "xhigh", label: "Extra high", description: "Extra high reasoning depth for complex problems" }
24071
- ];
24072
- var CODEX_APPROVAL_PRESETS = [
24073
- { id: "untrusted", label: "Ask for approval", description: "\u51E0\u4E4E\u6BCF\u6761\u547D\u4EE4\u90FD\u95EE\u4F60\uFF08\u6700\u8C28\u614E\uFF09" },
24074
- { id: "on-request", label: "Approve for me", description: "\u6A21\u578B\u81EA\u5DF1\u5224\u65AD\uFF0C\u53EA\u5BF9\u9AD8\u98CE\u9669\u64CD\u4F5C\u95EE\u4F60\uFF08\u9ED8\u8BA4\uFF09" },
24075
- { id: "never", label: "Full Access", description: "\u4ECE\u4E0D\u8BE2\u95EE\uFF0C\u81EA\u4E3B\u6267\u884C" }
24076
- ];
24077
- var CODEX_CAPABILITIES = {
24078
- tool: "codex",
24079
- toolSessionIdLabel: "Codex Thread ID",
24080
- models: CODEX_MODELS,
24081
- permissionModes: CODEX_APPROVAL_PRESETS,
24082
- // codex 不支持这些 clawd 功能(rewind 无 file-snapshot / 无子 agent / 无 TUI pty /
24083
- // 无 observe 推送 / 无文件分享 / fork 是 claude jsonl 专用);UI 据此 gate 入口。
24084
- features: { rewind: false, subagents: false, tui: false, observe: false, fileSharing: false, fork: false },
24085
- configSchema: [
24086
- {
24087
- name: "model",
24088
- type: "select",
24089
- label: "Model",
24090
- scope: "core",
24091
- options: CODEX_MODELS.map((m) => ({ value: m.id, label: m.label, description: m.description })),
24092
- default: ""
24093
- },
24094
- {
24095
- name: "permissionMode",
24096
- type: "select",
24097
- label: "Approval",
24098
- scope: "core",
24099
- options: CODEX_APPROVAL_PRESETS.map((m) => ({ value: m.id, label: m.label, description: m.description })),
24100
- default: "on-request"
24101
- },
24102
- {
24103
- name: "effort",
24104
- type: "select",
24105
- label: "Reasoning effort",
24106
- scope: "tool-specific",
24107
- // 渲染在 Advanced 区(与 claude effort 一致)
24108
- options: CODEX_EFFORTS,
24109
- default: "medium"
24110
- }
24111
- ]
24112
- };
24113
-
24114
24044
  // src/dispatch/mcp-server.ts
24115
24045
  var DISPATCH_LOG = process.env.CLAWD_DISPATCH_LOG;
24116
24046
  function log(msg, info) {
@@ -24118,7 +24048,7 @@ function log(msg, info) {
24118
24048
  `;
24119
24049
  if (DISPATCH_LOG) {
24120
24050
  try {
24121
- import_node_fs5.default.appendFileSync(DISPATCH_LOG, line);
24051
+ import_node_fs3.default.appendFileSync(DISPATCH_LOG, line);
24122
24052
  return;
24123
24053
  } catch {
24124
24054
  }
@@ -24355,11 +24285,13 @@ async function main() {
24355
24285
  targetDeviceId: external_exports.string().optional().describe(
24356
24286
  "contact deviceId of the remote device when delegating cross-device (omit for a local persona)"
24357
24287
  ),
24358
- // T-20: dispatch model override. Enum 走 MCP tool JSON schema 硬约束,
24359
- // caller LLM 只能从可选值挑,避免瞎填历史模型名。claude / codex 两表 union——
24360
- // 精确校验(按 target persona tool 选表)在 daemon handler 层做(fail-fast)。
24361
- model: external_exports.enum([...CLAUDE_MODEL_IDS, ...CODEX_MODEL_IDS]).optional().describe(
24362
- "override the target persona's default model. Omit to use the persona default. Claude personas: " + CLAUDE_MODEL_IDS.join(" / ") + ". Codex personas: " + CODEX_MODEL_IDS.join(" / ") + "."
24288
+ // T-20: dispatch model override
24289
+ // 2026-08-03 起不再用 enum 硬约束:codex 的模型表已运行时化(随安装的 codex 版本变),
24290
+ // 没有编译期常量可枚举——硬 enum 的前提正是一张静态表,而静态表会过期并拒掉 UI
24291
+ // 明明能选到的新模型。精确校验下沉到 daemon handler(按 target persona tool 查运行时
24292
+ // capabilities,fail-fast 且错误消息列出 allowed 值,caller 据此自我纠正)。
24293
+ model: external_exports.string().optional().describe(
24294
+ "override the target persona's default model. Omit to use the persona default. Claude personas: " + CLAUDE_MODEL_IDS.join(" / ") + ". Codex personas: model ids vary by installed codex version \u2014 omit unless you know the exact id (invalid values are rejected with the allowed list)."
24363
24295
  ),
24364
24296
  // butler 顶部入口 (spec 2026-07-27):butler 给新 worker session 起 label 用。
24365
24297
  // Sidebar 直接显示这个 label(否则兜底 cwd-basename 都是 persona 目录名,同一