@clawos-dev/clawd 0.2.133-beta.273.33dfd46 → 0.2.133-beta.275.ba80f7e
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/dist/cli.cjs +45 -19
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -35347,11 +35347,11 @@ function itemCompleted(item) {
|
|
|
35347
35347
|
}
|
|
35348
35348
|
function tokenUsage(usage) {
|
|
35349
35349
|
if (!usage) return [];
|
|
35350
|
-
const
|
|
35351
|
-
if (!
|
|
35352
|
-
const i = num(
|
|
35350
|
+
const last = rec(usage.last);
|
|
35351
|
+
if (!last) return [];
|
|
35352
|
+
const i = num(last.inputTokens), o = num(last.outputTokens);
|
|
35353
35353
|
const patch = {};
|
|
35354
|
-
if (i !== void 0 && o !== void 0) patch.contextUsage = { inputTokens: i, outputTokens: o
|
|
35354
|
+
if (i !== void 0 && o !== void 0) patch.contextUsage = { inputTokens: i, outputTokens: o };
|
|
35355
35355
|
const w2 = num(usage.modelContextWindow);
|
|
35356
35356
|
if (w2 !== void 0) patch.contextWindowSize = w2;
|
|
35357
35357
|
return Object.keys(patch).length ? [{ kind: "meta_update", patch }] : [];
|
|
@@ -35373,17 +35373,20 @@ function num(v2) {
|
|
|
35373
35373
|
// src/tools/codex-app-server-params.ts
|
|
35374
35374
|
function resolveSandbox(ctx) {
|
|
35375
35375
|
if (ctx.personaMode === "guest") throw new Error("codex \u6682\u4E0D\u652F\u6301 guest persona session\uFF1B\u8BF7\u7528 claude \u6216 owner");
|
|
35376
|
-
|
|
35376
|
+
return "danger-full-access";
|
|
35377
|
+
}
|
|
35378
|
+
function resolveApprovalPolicy(ctx) {
|
|
35377
35379
|
const m2 = ctx.permissionMode ?? "";
|
|
35378
|
-
if (m2 === ""
|
|
35379
|
-
|
|
35380
|
-
throw new Error(`unknown codex sandbox/permissionMode: ${m2}`);
|
|
35380
|
+
if (m2 === "untrusted" || m2 === "on-failure" || m2 === "on-request" || m2 === "never") return m2;
|
|
35381
|
+
return "on-request";
|
|
35381
35382
|
}
|
|
35382
35383
|
function threadStartParams(ctx) {
|
|
35383
35384
|
return {
|
|
35384
35385
|
cwd: ctx.cwd,
|
|
35385
35386
|
sandbox: resolveSandbox(ctx),
|
|
35386
|
-
|
|
35387
|
+
// persona 侧
|
|
35388
|
+
approvalPolicy: resolveApprovalPolicy(ctx),
|
|
35389
|
+
// 会话设置侧
|
|
35387
35390
|
approvalsReviewer: "user",
|
|
35388
35391
|
...ctx.model ? { model: ctx.model } : {}
|
|
35389
35392
|
};
|
|
@@ -35421,6 +35424,7 @@ function createCodexSession(ctx, sink, deps = {}) {
|
|
|
35421
35424
|
const approvalIds = /* @__PURE__ */ new Map();
|
|
35422
35425
|
const pendingQuestions = /* @__PURE__ */ new Map();
|
|
35423
35426
|
let pendingSystemPrompt = ctx.toolSessionId ? void 0 : ctx.extraSystemPrompt;
|
|
35427
|
+
const effort = ctx.effort;
|
|
35424
35428
|
let exited = false;
|
|
35425
35429
|
const finish = (code) => {
|
|
35426
35430
|
if (exited) return;
|
|
@@ -35496,7 +35500,11 @@ ${text}` : text;
|
|
|
35496
35500
|
pendingSystemPrompt = void 0;
|
|
35497
35501
|
void ready.then(() => {
|
|
35498
35502
|
if (threadId)
|
|
35499
|
-
void client.request("turn/start", {
|
|
35503
|
+
void client.request("turn/start", {
|
|
35504
|
+
threadId,
|
|
35505
|
+
input: turnStartInput(body),
|
|
35506
|
+
...effort ? { reasoningEffort: effort } : {}
|
|
35507
|
+
}).catch((e) => sink.onError(`turn/start failed: ${e.message}`));
|
|
35500
35508
|
});
|
|
35501
35509
|
},
|
|
35502
35510
|
respondPermission(requestId, allow) {
|
|
@@ -35526,18 +35534,27 @@ ${text}` : text;
|
|
|
35526
35534
|
|
|
35527
35535
|
// src/tools/codex.ts
|
|
35528
35536
|
var CODEX_MODELS = [
|
|
35529
|
-
{ id: "", label: "Default", description: "codex \u9ED8\u8BA4
|
|
35537
|
+
{ id: "", label: "Default", description: "codex config.toml \u9ED8\u8BA4", contextWindowSize: 258400, default: true },
|
|
35538
|
+
{ id: "gpt-5.5", label: "GPT-5.5", description: "Frontier model for complex coding", contextWindowSize: 258400 },
|
|
35539
|
+
{ id: "gpt-5.4", label: "GPT-5.4", contextWindowSize: 258400 },
|
|
35540
|
+
{ id: "gpt-5.4-mini", label: "GPT-5.4-Mini", contextWindowSize: 258400 }
|
|
35541
|
+
];
|
|
35542
|
+
var CODEX_EFFORTS = [
|
|
35543
|
+
{ value: "low", label: "Low", description: "Fast responses with lighter reasoning" },
|
|
35544
|
+
{ value: "medium", label: "Medium", description: "Balances speed and reasoning depth for everyday tasks" },
|
|
35545
|
+
{ value: "high", label: "High", description: "Greater reasoning depth for complex problems" },
|
|
35546
|
+
{ value: "xhigh", label: "Extra high", description: "Extra high reasoning depth for complex problems" }
|
|
35530
35547
|
];
|
|
35531
|
-
var
|
|
35532
|
-
{ id: "
|
|
35533
|
-
{ id: "
|
|
35534
|
-
{ id: "
|
|
35548
|
+
var CODEX_APPROVAL_PRESETS = [
|
|
35549
|
+
{ id: "untrusted", label: "Ask for approval", description: "\u51E0\u4E4E\u6BCF\u6761\u547D\u4EE4\u90FD\u95EE\u4F60\uFF08\u6700\u8C28\u614E\uFF09" },
|
|
35550
|
+
{ 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" },
|
|
35551
|
+
{ id: "never", label: "Full Access", description: "\u4ECE\u4E0D\u8BE2\u95EE\uFF0C\u81EA\u4E3B\u6267\u884C" }
|
|
35535
35552
|
];
|
|
35536
35553
|
var CODEX_CAPABILITIES = {
|
|
35537
35554
|
tool: "codex",
|
|
35538
35555
|
toolSessionIdLabel: "Codex Thread ID",
|
|
35539
35556
|
models: CODEX_MODELS,
|
|
35540
|
-
permissionModes:
|
|
35557
|
+
permissionModes: CODEX_APPROVAL_PRESETS,
|
|
35541
35558
|
// codex 不支持这些 clawd 功能(rewind 无 file-snapshot / 无子 agent / 无 TUI pty /
|
|
35542
35559
|
// 无 observe 推送 / 无文件分享);UI 据此 gate 入口。
|
|
35543
35560
|
features: { rewind: false, subagents: false, tui: false, observe: false, fileSharing: false },
|
|
@@ -35553,10 +35570,19 @@ var CODEX_CAPABILITIES = {
|
|
|
35553
35570
|
{
|
|
35554
35571
|
name: "permissionMode",
|
|
35555
35572
|
type: "select",
|
|
35556
|
-
label: "
|
|
35573
|
+
label: "Approval",
|
|
35557
35574
|
scope: "core",
|
|
35558
|
-
options:
|
|
35559
|
-
default: "
|
|
35575
|
+
options: CODEX_APPROVAL_PRESETS.map((m2) => ({ value: m2.id, label: m2.label, description: m2.description })),
|
|
35576
|
+
default: "on-request"
|
|
35577
|
+
},
|
|
35578
|
+
{
|
|
35579
|
+
name: "effort",
|
|
35580
|
+
type: "select",
|
|
35581
|
+
label: "Reasoning effort",
|
|
35582
|
+
scope: "tool-specific",
|
|
35583
|
+
// 渲染在 Advanced 区(与 claude effort 一致)
|
|
35584
|
+
options: CODEX_EFFORTS,
|
|
35585
|
+
default: "medium"
|
|
35560
35586
|
}
|
|
35561
35587
|
]
|
|
35562
35588
|
};
|
package/package.json
CHANGED