@clawos-dev/clawd 0.2.133-beta.274.531e8dc → 0.2.133-beta.276.da37eee
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 +37 -8
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -35241,8 +35241,9 @@ var CodexAppServerClient = class {
|
|
|
35241
35241
|
notify(method, params) {
|
|
35242
35242
|
this.write({ jsonrpc: "2.0", method, params });
|
|
35243
35243
|
}
|
|
35244
|
+
// server-request 的响应也必须带 jsonrpc:'2.0',否则 codex app-server 忽略它 → 审批/问答永远卡住。
|
|
35244
35245
|
respond(id, result) {
|
|
35245
|
-
this.write({ id, result });
|
|
35246
|
+
this.write({ jsonrpc: "2.0", id, result });
|
|
35246
35247
|
}
|
|
35247
35248
|
onLine(line) {
|
|
35248
35249
|
const t = line.trim();
|
|
@@ -35424,6 +35425,7 @@ function createCodexSession(ctx, sink, deps = {}) {
|
|
|
35424
35425
|
const approvalIds = /* @__PURE__ */ new Map();
|
|
35425
35426
|
const pendingQuestions = /* @__PURE__ */ new Map();
|
|
35426
35427
|
let pendingSystemPrompt = ctx.toolSessionId ? void 0 : ctx.extraSystemPrompt;
|
|
35428
|
+
const effort = ctx.effort;
|
|
35427
35429
|
let exited = false;
|
|
35428
35430
|
const finish = (code) => {
|
|
35429
35431
|
if (exited) return;
|
|
@@ -35458,9 +35460,12 @@ function createCodexSession(ctx, sink, deps = {}) {
|
|
|
35458
35460
|
if (method === "tool/requestUserInput") {
|
|
35459
35461
|
const reqId = String(id);
|
|
35460
35462
|
approvalIds.set(reqId, id);
|
|
35461
|
-
const
|
|
35462
|
-
|
|
35463
|
-
|
|
35463
|
+
const qs = Array.isArray(p2.questions) ? p2.questions.map((q) => ({
|
|
35464
|
+
id: String(q.id ?? ""),
|
|
35465
|
+
question: String(q.question ?? "")
|
|
35466
|
+
})) : [];
|
|
35467
|
+
pendingQuestions.set(reqId, qs);
|
|
35468
|
+
const questions = qs.map(({ question }) => ({
|
|
35464
35469
|
question,
|
|
35465
35470
|
multiSelect: false,
|
|
35466
35471
|
options: []
|
|
@@ -35499,14 +35504,18 @@ ${text}` : text;
|
|
|
35499
35504
|
pendingSystemPrompt = void 0;
|
|
35500
35505
|
void ready.then(() => {
|
|
35501
35506
|
if (threadId)
|
|
35502
|
-
void client.request("turn/start", {
|
|
35507
|
+
void client.request("turn/start", {
|
|
35508
|
+
threadId,
|
|
35509
|
+
input: turnStartInput(body),
|
|
35510
|
+
...effort ? { reasoningEffort: effort } : {}
|
|
35511
|
+
}).catch((e) => sink.onError(`turn/start failed: ${e.message}`));
|
|
35503
35512
|
});
|
|
35504
35513
|
},
|
|
35505
35514
|
respondPermission(requestId, allow) {
|
|
35506
35515
|
const id = approvalIds.get(requestId);
|
|
35507
35516
|
if (id === void 0) return;
|
|
35508
35517
|
approvalIds.delete(requestId);
|
|
35509
|
-
client.respond(id, allow ? "accept" : "
|
|
35518
|
+
client.respond(id, { decision: allow ? "accept" : "decline" });
|
|
35510
35519
|
},
|
|
35511
35520
|
answerQuestion(requestId, answers) {
|
|
35512
35521
|
const id = approvalIds.get(requestId);
|
|
@@ -35514,7 +35523,9 @@ ${text}` : text;
|
|
|
35514
35523
|
approvalIds.delete(requestId);
|
|
35515
35524
|
const qs = pendingQuestions.get(requestId) ?? [];
|
|
35516
35525
|
pendingQuestions.delete(requestId);
|
|
35517
|
-
|
|
35526
|
+
const answerMap = {};
|
|
35527
|
+
for (const q of qs) answerMap[q.id] = { answers: [answers[q.question] ?? ""] };
|
|
35528
|
+
client.respond(id, { answers: answerMap });
|
|
35518
35529
|
},
|
|
35519
35530
|
interrupt() {
|
|
35520
35531
|
if (threadId && turnId) void client.request("turn/interrupt", { threadId, turnId }).catch(() => {
|
|
@@ -35529,7 +35540,16 @@ ${text}` : text;
|
|
|
35529
35540
|
|
|
35530
35541
|
// src/tools/codex.ts
|
|
35531
35542
|
var CODEX_MODELS = [
|
|
35532
|
-
{ id: "", label: "Default", description: "codex \u9ED8\u8BA4
|
|
35543
|
+
{ id: "", label: "Default", description: "codex config.toml \u9ED8\u8BA4", contextWindowSize: 258400, default: true },
|
|
35544
|
+
{ id: "gpt-5.5", label: "GPT-5.5", description: "Frontier model for complex coding", contextWindowSize: 258400 },
|
|
35545
|
+
{ id: "gpt-5.4", label: "GPT-5.4", contextWindowSize: 258400 },
|
|
35546
|
+
{ id: "gpt-5.4-mini", label: "GPT-5.4-Mini", contextWindowSize: 258400 }
|
|
35547
|
+
];
|
|
35548
|
+
var CODEX_EFFORTS = [
|
|
35549
|
+
{ value: "low", label: "Low", description: "Fast responses with lighter reasoning" },
|
|
35550
|
+
{ value: "medium", label: "Medium", description: "Balances speed and reasoning depth for everyday tasks" },
|
|
35551
|
+
{ value: "high", label: "High", description: "Greater reasoning depth for complex problems" },
|
|
35552
|
+
{ value: "xhigh", label: "Extra high", description: "Extra high reasoning depth for complex problems" }
|
|
35533
35553
|
];
|
|
35534
35554
|
var CODEX_APPROVAL_PRESETS = [
|
|
35535
35555
|
{ id: "untrusted", label: "Ask for approval", description: "\u51E0\u4E4E\u6BCF\u6761\u547D\u4EE4\u90FD\u95EE\u4F60\uFF08\u6700\u8C28\u614E\uFF09" },
|
|
@@ -35560,6 +35580,15 @@ var CODEX_CAPABILITIES = {
|
|
|
35560
35580
|
scope: "core",
|
|
35561
35581
|
options: CODEX_APPROVAL_PRESETS.map((m2) => ({ value: m2.id, label: m2.label, description: m2.description })),
|
|
35562
35582
|
default: "on-request"
|
|
35583
|
+
},
|
|
35584
|
+
{
|
|
35585
|
+
name: "effort",
|
|
35586
|
+
type: "select",
|
|
35587
|
+
label: "Reasoning effort",
|
|
35588
|
+
scope: "tool-specific",
|
|
35589
|
+
// 渲染在 Advanced 区(与 claude effort 一致)
|
|
35590
|
+
options: CODEX_EFFORTS,
|
|
35591
|
+
default: "medium"
|
|
35563
35592
|
}
|
|
35564
35593
|
]
|
|
35565
35594
|
};
|
package/package.json
CHANGED