@qwen-code/qwen-code 0.20.2-headless-image-routing.0 → 0.20.2-jobbench-no-todo-write.0
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/chunks/{MaxSizedBox-CPK6I4JU.js → MaxSizedBox-HNWBEL5H.js} +10 -11
- package/chunks/{StandaloneSessionPicker-PUIA43XY.js → StandaloneSessionPicker-WBRBHD2M.js} +24 -25
- package/chunks/{acpAgent-ROZXDEW6.js → acpAgent-BBQZ33CA.js} +53 -54
- package/chunks/{agent-WAVPSQSS.js → agent-KTMY6SF3.js} +8 -9
- package/chunks/{agent-headless-74QWTN6L.js → agent-headless-HJ56ZZOW.js} +8 -9
- package/chunks/{bridge-A3IPRSLU.js → bridge-AMC5AD7W.js} +12 -13
- package/chunks/{build-GHIZ4MSZ.js → build-SSCNEHZZ.js} +1 -1
- package/chunks/{channel-worker-group-QZV2SP5U.js → channel-worker-group-LFBT7K64.js} +3 -3
- package/chunks/{channel-worker-manager-3GMAU45H.js → channel-worker-manager-3RUPERG2.js} +3 -3
- package/chunks/{channel-worker-supervisor-QCXSXCRY.js → channel-worker-supervisor-A3KVATD3.js} +2 -2
- package/chunks/{chunk-YBXY5Y3K.js → chunk-26CBI4DC.js} +25 -25
- package/chunks/{chunk-6YYPJBKS.js → chunk-32L4D2O2.js} +1 -1
- package/chunks/{chunk-5KDE7KYN.js → chunk-3BJDQVE6.js} +1 -1
- package/chunks/{chunk-MGHZQY43.js → chunk-3EHJ44GG.js} +1 -1
- package/chunks/{chunk-JIULOPXR.js → chunk-3F2JUWCH.js} +1 -1
- package/chunks/{chunk-NRRVUQS4.js → chunk-3G3UUMRS.js} +1 -1
- package/chunks/{chunk-2DGZGT4I.js → chunk-42W5BDEY.js} +3 -3
- package/chunks/{chunk-2QEYXQY4.js → chunk-45PO6ZIS.js} +3 -3
- package/chunks/{chunk-PJSM24XR.js → chunk-4MWNZNJ4.js} +4 -4
- package/chunks/{chunk-H4EI3IE7.js → chunk-4SCOLXTD.js} +4 -4
- package/chunks/{chunk-MYNMIELG.js → chunk-5WDRI7US.js} +2 -2
- package/chunks/{chunk-ZMBWA2ZY.js → chunk-5XORMWA2.js} +4 -4
- package/chunks/{chunk-GGMU7ESO.js → chunk-63DJBU32.js} +19 -53
- package/chunks/{chunk-SP5WRGVG.js → chunk-64EG42HV.js} +1 -1
- package/chunks/{chunk-VH7AN6R6.js → chunk-64XKYOXK.js} +1 -1
- package/chunks/{chunk-QIDWNN65.js → chunk-6FZYKBKV.js} +1 -1
- package/chunks/{chunk-STJNEKSB.js → chunk-6NRFYMKG.js} +6 -6
- package/chunks/{chunk-7LPBIM25.js → chunk-6S5HSCOI.js} +3 -3
- package/chunks/{chunk-MQGVHOSR.js → chunk-6VPLV3L3.js} +2 -2
- package/chunks/{chunk-FPUSU3FS.js → chunk-77OZOGPT.js} +1 -1
- package/chunks/{chunk-FKH6IJVL.js → chunk-7MWABCXU.js} +2 -2
- package/chunks/{chunk-2OYJGGJP.js → chunk-7PIL2BYF.js} +4 -4
- package/chunks/{chunk-WDXE6PYV.js → chunk-7SSWNGEJ.js} +2 -2
- package/chunks/{chunk-QJ5OOQAU.js → chunk-7TLUW4ZE.js} +3 -3
- package/chunks/{chunk-QBUDF33N.js → chunk-7VUQQBR7.js} +64 -1
- package/chunks/{chunk-WSJV2PV5.js → chunk-7ZD5EKXE.js} +1 -1
- package/chunks/{chunk-MR32FTT5.js → chunk-ACQJPDDS.js} +7 -7
- package/chunks/{chunk-M3FNCPFA.js → chunk-ACZIBDYD.js} +24 -24
- package/chunks/{chunk-DYV7CIWU.js → chunk-AHX6AKPD.js} +1 -1
- package/chunks/{chunk-XWGVNYYI.js → chunk-B2HSPMD4.js} +9 -9
- package/chunks/{chunk-PLVICOQK.js → chunk-B3I77W5J.js} +3 -3
- package/chunks/{chunk-GAQPY2C5.js → chunk-CGIDQG6J.js} +1 -1
- package/chunks/{chunk-VVPHBIAZ.js → chunk-CI3GWKGJ.js} +1 -1
- package/chunks/{chunk-VCJ5EJRK.js → chunk-CJQ3FZ2G.js} +2 -2
- package/chunks/{chunk-S6PGTUT3.js → chunk-CXIOPXRR.js} +3 -3
- package/chunks/{chunk-DNBEZRSH.js → chunk-GN45XAAU.js} +1 -1
- package/chunks/{chunk-RGQSYME5.js → chunk-GSX6P2JW.js} +1 -1
- package/chunks/{chunk-SVUKZKGO.js → chunk-H4A4A2SY.js} +4 -4
- package/chunks/{chunk-KBRGKSOR.js → chunk-HABKX6LY.js} +1 -1
- package/chunks/{chunk-7LGIFLJS.js → chunk-IWALV67J.js} +382 -930
- package/chunks/{chunk-X3WYTVQZ.js → chunk-JK26TQON.js} +2 -2
- package/chunks/{chunk-SOYT56ML.js → chunk-K7EUPLIP.js} +8 -8
- package/chunks/{chunk-D3VPXCQO.js → chunk-KBB5O3JO.js} +4 -4
- package/chunks/{chunk-ACW3VNUE.js → chunk-KQQ757OQ.js} +1 -1
- package/chunks/{chunk-VF4PO5FU.js → chunk-L6U47G5P.js} +5 -5
- package/chunks/{chunk-MBJGCTLS.js → chunk-LVA5OHQO.js} +1 -1
- package/chunks/{chunk-FFFM6NJV.js → chunk-NEEB7UEN.js} +2 -1
- package/chunks/{chunk-7UCSMQMH.js → chunk-O32RMIMO.js} +1 -1
- package/chunks/{chunk-7T6EFZMS.js → chunk-P2BQZ7H7.js} +1 -1
- package/chunks/{chunk-YTWAWLS6.js → chunk-PLQODS7F.js} +3 -3
- package/chunks/{chunk-CMX2PQVL.js → chunk-RHYFF54J.js} +9 -9
- package/chunks/{chunk-WP6LZ4MJ.js → chunk-SRPZG4ER.js} +1 -1
- package/chunks/{chunk-6IC65F7C.js → chunk-SVIMKSEI.js} +4 -4
- package/chunks/{chunk-HIMIYFCP.js → chunk-SXPSOMQ4.js} +2 -2
- package/chunks/{chunk-N6NZ332R.js → chunk-TDDFEPBX.js} +1 -1
- package/chunks/{chunk-Q6457W3A.js → chunk-UHGNAWHK.js} +2 -2
- package/chunks/{chunk-IZUKQEXY.js → chunk-UMCULC5M.js} +1 -1
- package/chunks/{chunk-CZOS5SHZ.js → chunk-UTGFTJ2H.js} +1 -1
- package/chunks/{chunk-Y6SYQRQQ.js → chunk-V7WNRZL7.js} +1 -1
- package/chunks/{chunk-MKCM6UYK.js → chunk-WSYKDFYR.js} +3 -3
- package/chunks/{chunk-IK2WIHHP.js → chunk-XAGLQITN.js} +1 -1
- package/chunks/{chunk-KIXDPYKU.js → chunk-ZKBNRL6O.js} +27 -27
- package/chunks/{chunk-KL6CQ75X.js → chunk-ZPWJZHJ2.js} +3 -3
- package/chunks/{chunk-3YIV2VCL.js → chunk-ZUTM4LHM.js} +1 -1
- package/chunks/{computer-use-3TVSA54L.js → computer-use-RZ3UUWYW.js} +8 -9
- package/chunks/{config-utils-FYTBZLCJ.js → config-utils-SQUBZEQM.js} +1 -1
- package/chunks/{contextCommand-RG2MM5PD.js → contextCommand-PW4GINQU.js} +10 -11
- package/chunks/{create-sub-session-KIVO6TT5.js → create-sub-session-EQG73FT6.js} +8 -9
- package/chunks/{daemon-status-provider-BJJTMIDV.js → daemon-status-provider-3IWTBWQ3.js} +16 -17
- package/chunks/{earlyInputCapture-NYQKIV4B.js → earlyInputCapture-TYNI3B6E.js} +8 -9
- package/chunks/{edit-IOTOMN4X.js → edit-XRSKQPHQ.js} +8 -9
- package/chunks/{enter-worktree-35GDGWMB.js → enter-worktree-WAHCWE6I.js} +8 -9
- package/chunks/{enterPlanMode-X4NEBGDH.js → enterPlanMode-QIOYLDCF.js} +8 -9
- package/chunks/{environment-KFFOVPWY.js → environment-T3FXCDJI.js} +10 -11
- package/chunks/{errors-IZ7R5OI4.js → errors-QAWTJTAW.js} +10 -11
- package/chunks/{exit-worktree-535TK24V.js → exit-worktree-RHVTLX6T.js} +8 -9
- package/chunks/{exitPlanMode-HZ5HJCOD.js → exitPlanMode-UATOE2GQ.js} +8 -9
- package/chunks/{fast-path-BSDRID75.js → fast-path-J3RHOYSZ.js} +3 -3
- package/chunks/{fast-path-settings-DAOVFADC.js → fast-path-settings-XB3CPUJT.js} +2 -2
- package/chunks/{gemini-UWO57GGI.js → gemini-P72OGOH6.js} +45 -46
- package/chunks/{geminiContentGenerator-TQ5ZCTB4.js → geminiContentGenerator-F6EG5FXF.js} +1 -1
- package/chunks/{glob-CPQ43UDE.js → glob-WHASQZRX.js} +8 -9
- package/chunks/{grep-OBXWZT5D.js → grep-LS7AADJ3.js} +8 -9
- package/chunks/{handleAutoUpdate-DG6VI5J6.js → handleAutoUpdate-V5A3JHOG.js} +12 -13
- package/chunks/{i18n-2YRBDZWT.js → i18n-IMVASWIF.js} +9 -10
- package/chunks/{initializer-IP2DDAGE.js → initializer-JJLF5JCJ.js} +14 -15
- package/chunks/{installationInfo-7GTMJJ2V.js → installationInfo-LAWMHQAG.js} +9 -10
- package/chunks/{list-L2PQSGVO.js → list-L2ECB6UM.js} +17 -18
- package/chunks/{loadedSettingsAdapter-MMXSQWO4.js → loadedSettingsAdapter-RLMZ4Z3E.js} +14 -15
- package/chunks/{managed-npm-update-75EPQN3U.js → managed-npm-update-L6UY7OM7.js} +9 -10
- package/chunks/{mcp-BKLURHSY.js → mcp-E4O7Z6FO.js} +14 -15
- package/chunks/{monitor-L7V4QSQ5.js → monitor-DXYFB5QD.js} +8 -9
- package/chunks/{nonInteractiveCli-5YG5J4C4.js → nonInteractiveCli-GU2UKULE.js} +42 -45
- package/chunks/{notebook-edit-7TYQDSDD.js → notebook-edit-KGD7YJEA.js} +8 -9
- package/chunks/{openaiContentGenerator-337EHHTE.js → openaiContentGenerator-C74A2XAU.js} +2 -2
- package/chunks/{pidfile-G7PQ2P5H.js → pidfile-IWQWZNZV.js} +8 -9
- package/chunks/{processUtils-CX44WAP2.js → processUtils-GUT5B4R6.js} +2 -2
- package/chunks/{qwenContentGenerator-SYWFK5OL.js → qwenContentGenerator-PT46FQPA.js} +9 -10
- package/chunks/{qwenOAuth2-BXYGPV5P.js → qwenOAuth2-S7DZHUUU.js} +4 -4
- package/chunks/{read-file-37YQVCEY.js → read-file-ZOCXW4AD.js} +1 -1
- package/chunks/{resumeHistoryUtils-W2C7GY6G.js → resumeHistoryUtils-TJWRDE2L.js} +12 -13
- package/chunks/{ripGrep-WL2NQQFB.js → ripGrep-OFKAW2VE.js} +8 -9
- package/chunks/{run-qwen-serve-SLAWXYTD.js → run-qwen-serve-QO4PT5NV.js} +43 -43
- package/chunks/{runtime-FL6GKWRC.js → runtime-EOTXBUM6.js} +16 -17
- package/chunks/{scheduler-AWSFTIJK.js → scheduler-MAIQ2PHR.js} +8 -9
- package/chunks/{serve-RL6OJAXK.js → serve-UB4CF67Q.js} +14 -15
- package/chunks/{server-ANUZOEU6.js → server-CBCC3XQC.js} +62 -63
- package/chunks/{session-QVFFZWY5.js → session-RQUEFQDL.js} +43 -44
- package/chunks/{settings-LCTEYRIB.js → settings-QHXCJDSR.js} +16 -17
- package/chunks/{shell-6I6RUFMO.js → shell-RPK7EAOC.js} +8 -9
- package/chunks/{skill-6H7VKWST.js → skill-WHSGTGKP.js} +2 -3
- package/chunks/{spawnChannel-3PKMXS5E.js → spawnChannel-IUP3ZNMT.js} +10 -11
- package/chunks/{src-RMIJ7356.js → src-F3HKX47D.js} +27 -28
- package/chunks/{standalone-update-HRFWNPD2.js → standalone-update-BKLONSVI.js} +10 -11
- package/chunks/{startInteractiveUI-A46LW75Y.js → startInteractiveUI-TNJ37X5W.js} +73 -74
- package/chunks/{team-create-EWJRLBNH.js → team-create-LUHJ7ZCC.js} +10 -11
- package/chunks/{team-plan-approval-VDU66ODQ.js → team-plan-approval-X3DYRL6L.js} +8 -9
- package/chunks/{theme-manager-7VBYGZY3.js → theme-manager-ALL7F4CJ.js} +8 -9
- package/chunks/{tool-search-54D47DON.js → tool-search-BAWOETUY.js} +1 -1
- package/chunks/{total-session-admission-S5A4LEAN.js → total-session-admission-PLONPNXI.js} +12 -13
- package/chunks/{trustedFolders-4MBS5K4P.js → trustedFolders-4UEOIKOF.js} +9 -10
- package/chunks/{update-relaunch-GX4HUHRX.js → update-relaunch-WDWABT5P.js} +5 -5
- package/chunks/{updateCheck-IYFPWHAG.js → updateCheck-PVROE4GR.js} +11 -12
- package/chunks/{useAutoAcceptIndicator-R4QRIXCB.js → useAutoAcceptIndicator-6BNLNN5S.js} +16 -17
- package/chunks/{validateNonInterActiveAuth-S4RK7CKV.js → validateNonInterActiveAuth-OKUE3JLF.js} +39 -40
- package/chunks/{version-OJJ2JHIP.js → version-GMUULLWB.js} +1 -1
- package/chunks/{web-fetch-BOUIZGFB.js → web-fetch-JBWTMPFN.js} +3 -3
- package/chunks/{web-search-4LAWHNNQ.js → web-search-27COJHJT.js} +3 -3
- package/chunks/{workflow-DLWGUSKG.js → workflow-5L37J7YF.js} +9 -10
- package/chunks/{workspace-providers-status-HC53BB36.js → workspace-providers-status-2U3IF4TX.js} +17 -18
- package/chunks/{workspace-registration-store-3BDRYY5Y.js → workspace-registration-store-TYPYXIP6.js} +1 -1
- package/chunks/{workspace-registry-K4KIR3YU.js → workspace-registry-DLQDDDIF.js} +12 -13
- package/chunks/{workspace-service-JONFMZJJ.js → workspace-service-7K3LF4QX.js} +19 -20
- package/chunks/{workspace-skills-status-TZ4GFSTK.js → workspace-skills-status-4DOZ3DBS.js} +15 -16
- package/chunks/{write-file-YLJZTILT.js → write-file-PTPXDKZ3.js} +8 -9
- package/cli.js +12 -12
- package/package.json +3 -3
- package/chunks/chunk-NABLFI57.js +0 -82
- package/chunks/todoWrite-KRAUN54W.js +0 -358
- package/chunks/{chunk-H24SOJIQ.js → chunk-D7WXIW7H.js} +3 -3
- package/chunks/{chunk-GHRSKGHF.js → chunk-GPMVHZP4.js} +0 -0
- package/chunks/{chunk-5G3ZVADU.js → chunk-NXE6SQIV.js} +3 -3
- package/chunks/{chunk-PEJWA3QQ.js → chunk-QZJY47IE.js} +5 -5
|
@@ -1,358 +0,0 @@
|
|
|
1
|
-
// Force strict mode and setup for ESM
|
|
2
|
-
"use strict";
|
|
3
|
-
import {
|
|
4
|
-
detectTodoChanges
|
|
5
|
-
} from "./chunk-QBUDF33N.js";
|
|
6
|
-
import {
|
|
7
|
-
atomicWriteFile
|
|
8
|
-
} from "./chunk-6X4GWOPW.js";
|
|
9
|
-
import {
|
|
10
|
-
BaseDeclarativeTool,
|
|
11
|
-
BaseToolInvocation,
|
|
12
|
-
ToolDisplayNames,
|
|
13
|
-
ToolNames
|
|
14
|
-
} from "./chunk-YM3SZTH4.js";
|
|
15
|
-
import {
|
|
16
|
-
Storage,
|
|
17
|
-
createDebugLogger
|
|
18
|
-
} from "./chunk-OQB4EXO4.js";
|
|
19
|
-
import "./chunk-THJNPLI4.js";
|
|
20
|
-
import {
|
|
21
|
-
init_esbuild_shims
|
|
22
|
-
} from "./chunk-5O2XNYP6.js";
|
|
23
|
-
import {
|
|
24
|
-
__name
|
|
25
|
-
} from "./chunk-J2S4EL5Y.js";
|
|
26
|
-
|
|
27
|
-
// packages/core/src/tools/todoWrite.ts
|
|
28
|
-
init_esbuild_shims();
|
|
29
|
-
import * as fs from "fs/promises";
|
|
30
|
-
import * as fsSync from "fs";
|
|
31
|
-
import * as path from "path";
|
|
32
|
-
var debugLogger = createDebugLogger("TODO_WRITE");
|
|
33
|
-
var todoWriteToolSchemaData = {
|
|
34
|
-
name: "todo_write",
|
|
35
|
-
description: "Creates and manages a concise, user-visible task list for complex or multi-step work.",
|
|
36
|
-
parametersJsonSchema: {
|
|
37
|
-
type: "object",
|
|
38
|
-
properties: {
|
|
39
|
-
todos: {
|
|
40
|
-
type: "array",
|
|
41
|
-
items: {
|
|
42
|
-
type: "object",
|
|
43
|
-
properties: {
|
|
44
|
-
content: {
|
|
45
|
-
type: "string",
|
|
46
|
-
minLength: 1
|
|
47
|
-
},
|
|
48
|
-
status: {
|
|
49
|
-
type: "string",
|
|
50
|
-
enum: ["pending", "in_progress", "completed"]
|
|
51
|
-
},
|
|
52
|
-
id: {
|
|
53
|
-
type: "string"
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
required: ["content", "status", "id"],
|
|
57
|
-
additionalProperties: false
|
|
58
|
-
},
|
|
59
|
-
description: "The updated todo list"
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
required: ["todos"],
|
|
63
|
-
$schema: "http://json-schema.org/draft-07/schema#"
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
var todoWriteToolDescription = `
|
|
67
|
-
Use this tool to create and manage a user-visible task list when explicit progress tracking improves clarity.
|
|
68
|
-
|
|
69
|
-
## When to Use This Tool
|
|
70
|
-
Use this tool for work that is complex, ambiguous, or multi-phase; has multiple independent outcomes or important dependencies; benefits from checkpoints; or when the user explicitly asks for a todo list.
|
|
71
|
-
|
|
72
|
-
Do not use it for simple or single-step work, purely conversational or informational requests, or tasks that can be answered or completed directly unless the user explicitly requests a todo list.
|
|
73
|
-
|
|
74
|
-
## Planning with Todos
|
|
75
|
-
|
|
76
|
-
Keep the list short and outcome-oriented. Use a small number of meaningful, logically ordered, verifiable steps. Do not create a separate todo for every error, file, command, or minor edit.
|
|
77
|
-
|
|
78
|
-
Keep at most one task in_progress. When a plan exists, keep its statuses current, mark finished work completed, revise the plan when the scope or approach changes, and remove items that are no longer relevant. Do not mark incomplete or blocked work completed.
|
|
79
|
-
`;
|
|
80
|
-
var TODO_SUBDIR = "todos";
|
|
81
|
-
function getTodoFilePath(sessionId) {
|
|
82
|
-
const todoDir = path.join(Storage.getRuntimeBaseDir(), TODO_SUBDIR);
|
|
83
|
-
const filename = `${sessionId || "default"}.json`;
|
|
84
|
-
return path.join(todoDir, filename);
|
|
85
|
-
}
|
|
86
|
-
__name(getTodoFilePath, "getTodoFilePath");
|
|
87
|
-
async function readTodosFromFile(sessionId) {
|
|
88
|
-
try {
|
|
89
|
-
const todoFilePath = getTodoFilePath(sessionId);
|
|
90
|
-
const content = await fs.readFile(todoFilePath, "utf-8");
|
|
91
|
-
const data = JSON.parse(content);
|
|
92
|
-
return Array.isArray(data.todos) ? data.todos : [];
|
|
93
|
-
} catch (err) {
|
|
94
|
-
const error = err;
|
|
95
|
-
if (!(error instanceof Error) || error.code !== "ENOENT") {
|
|
96
|
-
throw err;
|
|
97
|
-
}
|
|
98
|
-
return [];
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
__name(readTodosFromFile, "readTodosFromFile");
|
|
102
|
-
async function writeTodosToFile(todos, sessionId) {
|
|
103
|
-
const todoFilePath = getTodoFilePath(sessionId);
|
|
104
|
-
const todoDir = path.dirname(todoFilePath);
|
|
105
|
-
await fs.mkdir(todoDir, { recursive: true });
|
|
106
|
-
const data = {
|
|
107
|
-
todos,
|
|
108
|
-
sessionId: sessionId || "default"
|
|
109
|
-
};
|
|
110
|
-
await atomicWriteFile(todoFilePath, JSON.stringify(data, null, 2), {
|
|
111
|
-
encoding: "utf-8"
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
__name(writeTodosToFile, "writeTodosToFile");
|
|
115
|
-
function createBlockedTodoResult(message, systemMessage) {
|
|
116
|
-
return {
|
|
117
|
-
llmContent: `${message}
|
|
118
|
-
|
|
119
|
-
<system-reminder>
|
|
120
|
-
${systemMessage}
|
|
121
|
-
</system-reminder>`,
|
|
122
|
-
returnDisplay: message
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
|
-
__name(createBlockedTodoResult, "createBlockedTodoResult");
|
|
126
|
-
var TodoWriteToolInvocation = class extends BaseToolInvocation {
|
|
127
|
-
constructor(config, params, operationType = "update") {
|
|
128
|
-
super(params);
|
|
129
|
-
this.config = config;
|
|
130
|
-
this.operationType = operationType;
|
|
131
|
-
}
|
|
132
|
-
static {
|
|
133
|
-
__name(this, "TodoWriteToolInvocation");
|
|
134
|
-
}
|
|
135
|
-
operationType;
|
|
136
|
-
getDescription() {
|
|
137
|
-
return this.operationType === "create" ? "Create todos" : "Update todos";
|
|
138
|
-
}
|
|
139
|
-
async execute(_signal) {
|
|
140
|
-
const { todos, modified_by_user, modified_content } = this.params;
|
|
141
|
-
const sessionId = this.config.getSessionId();
|
|
142
|
-
try {
|
|
143
|
-
const oldTodos = await readTodosFromFile(sessionId);
|
|
144
|
-
let finalTodos;
|
|
145
|
-
if (modified_by_user && modified_content !== void 0) {
|
|
146
|
-
const data = JSON.parse(modified_content);
|
|
147
|
-
finalTodos = Array.isArray(data.todos) ? data.todos : [];
|
|
148
|
-
} else {
|
|
149
|
-
finalTodos = todos;
|
|
150
|
-
}
|
|
151
|
-
const changes = detectTodoChanges(oldTodos, finalTodos);
|
|
152
|
-
const oldTodosMap = new Map(oldTodos.map((t) => [t.id, t]));
|
|
153
|
-
const hookSystem = this.config.getHookSystem();
|
|
154
|
-
if (hookSystem && changes.created.length > 0) {
|
|
155
|
-
const createdResults = await Promise.all(
|
|
156
|
-
changes.created.map(
|
|
157
|
-
(todo) => hookSystem.fireTodoCreatedEvent(
|
|
158
|
-
todo.id,
|
|
159
|
-
todo.content,
|
|
160
|
-
todo.status,
|
|
161
|
-
finalTodos,
|
|
162
|
-
"validation" /* Validation */,
|
|
163
|
-
_signal
|
|
164
|
-
)
|
|
165
|
-
)
|
|
166
|
-
);
|
|
167
|
-
const blockedCreatedResult = createdResults.find(
|
|
168
|
-
(result) => result.finalOutput?.decision === "block"
|
|
169
|
-
);
|
|
170
|
-
if (blockedCreatedResult?.finalOutput) {
|
|
171
|
-
const reason = blockedCreatedResult.finalOutput.reason || "Hook blocked todo creation";
|
|
172
|
-
return createBlockedTodoResult(
|
|
173
|
-
`Todo creation blocked: ${reason}`,
|
|
174
|
-
`Todo list was not modified because a TodoCreated hook blocked the operation: ${reason}`
|
|
175
|
-
);
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
if (hookSystem && changes.completed.length > 0) {
|
|
179
|
-
const completedResults = await Promise.all(
|
|
180
|
-
changes.completed.map((todo) => {
|
|
181
|
-
const oldTodo = oldTodosMap.get(todo.id);
|
|
182
|
-
const previousStatus = oldTodo?.status ?? "pending";
|
|
183
|
-
return hookSystem.fireTodoCompletedEvent(
|
|
184
|
-
todo.id,
|
|
185
|
-
todo.content,
|
|
186
|
-
previousStatus,
|
|
187
|
-
finalTodos,
|
|
188
|
-
"validation" /* Validation */,
|
|
189
|
-
_signal
|
|
190
|
-
);
|
|
191
|
-
})
|
|
192
|
-
);
|
|
193
|
-
const blockedCompletedResult = completedResults.find(
|
|
194
|
-
(result) => result.finalOutput?.decision === "block"
|
|
195
|
-
);
|
|
196
|
-
if (blockedCompletedResult?.finalOutput) {
|
|
197
|
-
const reason = blockedCompletedResult.finalOutput.reason || "Hook blocked todo completion";
|
|
198
|
-
return createBlockedTodoResult(
|
|
199
|
-
`Todo completion blocked: ${reason}`,
|
|
200
|
-
`Todo list was not modified because a TodoCompleted hook blocked the operation: ${reason}`
|
|
201
|
-
);
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
await writeTodosToFile(finalTodos, sessionId);
|
|
205
|
-
let postWriteError;
|
|
206
|
-
try {
|
|
207
|
-
if (hookSystem && changes.created.length > 0) {
|
|
208
|
-
for (const todo of changes.created) {
|
|
209
|
-
await hookSystem.fireTodoCreatedEvent(
|
|
210
|
-
todo.id,
|
|
211
|
-
todo.content,
|
|
212
|
-
todo.status,
|
|
213
|
-
finalTodos,
|
|
214
|
-
"postWrite" /* PostWrite */,
|
|
215
|
-
_signal
|
|
216
|
-
);
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
if (hookSystem && changes.completed.length > 0) {
|
|
220
|
-
for (const todo of changes.completed) {
|
|
221
|
-
const oldTodo = oldTodosMap.get(todo.id);
|
|
222
|
-
const previousStatus = oldTodo?.status ?? "pending";
|
|
223
|
-
await hookSystem.fireTodoCompletedEvent(
|
|
224
|
-
todo.id,
|
|
225
|
-
todo.content,
|
|
226
|
-
previousStatus,
|
|
227
|
-
finalTodos,
|
|
228
|
-
"postWrite" /* PostWrite */,
|
|
229
|
-
_signal
|
|
230
|
-
);
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
} catch (error) {
|
|
234
|
-
postWriteError = error instanceof Error ? error : new Error(String(error));
|
|
235
|
-
debugLogger.error(
|
|
236
|
-
`[TodoWriteTool] Post-write hooks failed after todos were persisted: ${postWriteError.message}`
|
|
237
|
-
);
|
|
238
|
-
}
|
|
239
|
-
const todoResultDisplay = {
|
|
240
|
-
type: "todo_list",
|
|
241
|
-
todos: finalTodos,
|
|
242
|
-
changes
|
|
243
|
-
};
|
|
244
|
-
const todosJson = JSON.stringify(finalTodos);
|
|
245
|
-
let llmContent;
|
|
246
|
-
const postWriteReminder = postWriteError ? `
|
|
247
|
-
|
|
248
|
-
<system-reminder>
|
|
249
|
-
Todos were persisted successfully, but post-write hooks failed with error: ${postWriteError.message}. Do not tell the user the write failed; only handle any follow-up hook issues if needed.
|
|
250
|
-
</system-reminder>` : "";
|
|
251
|
-
if (finalTodos.length === 0) {
|
|
252
|
-
llmContent = `Todo list has been cleared.
|
|
253
|
-
|
|
254
|
-
<system-reminder>
|
|
255
|
-
Your todo list is now empty. DO NOT mention this explicitly to the user. You have no pending tasks in your todo list.
|
|
256
|
-
</system-reminder>${postWriteReminder}`;
|
|
257
|
-
} else {
|
|
258
|
-
llmContent = `Todos have been modified successfully. Ensure that you continue to use the todo list to track your progress. Please proceed with the current tasks if applicable
|
|
259
|
-
|
|
260
|
-
<system-reminder>
|
|
261
|
-
Your todo list has changed. DO NOT mention this explicitly to the user. Here are the latest contents of your todo list:
|
|
262
|
-
|
|
263
|
-
${todosJson}. Continue on with the tasks at hand if applicable.
|
|
264
|
-
</system-reminder>${postWriteReminder}`;
|
|
265
|
-
}
|
|
266
|
-
return {
|
|
267
|
-
llmContent,
|
|
268
|
-
returnDisplay: todoResultDisplay
|
|
269
|
-
};
|
|
270
|
-
} catch (error) {
|
|
271
|
-
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
272
|
-
debugLogger.error(
|
|
273
|
-
`[TodoWriteTool] Error executing todo_write: ${errorMessage}`
|
|
274
|
-
);
|
|
275
|
-
const errorLlmContent = `Failed to modify todos. An error occurred during the operation.
|
|
276
|
-
|
|
277
|
-
<system-reminder>
|
|
278
|
-
Todo list modification failed with error: ${errorMessage}. You may need to retry or handle this error appropriately.
|
|
279
|
-
</system-reminder>`;
|
|
280
|
-
return {
|
|
281
|
-
llmContent: errorLlmContent,
|
|
282
|
-
returnDisplay: `Error writing todos: ${errorMessage}`
|
|
283
|
-
};
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
};
|
|
287
|
-
async function readTodosForSession(sessionId) {
|
|
288
|
-
return readTodosFromFile(sessionId);
|
|
289
|
-
}
|
|
290
|
-
__name(readTodosForSession, "readTodosForSession");
|
|
291
|
-
async function listTodoSessions() {
|
|
292
|
-
try {
|
|
293
|
-
const todoDir = path.join(Storage.getRuntimeBaseDir(), TODO_SUBDIR);
|
|
294
|
-
const files = await fs.readdir(todoDir);
|
|
295
|
-
return files.filter((file) => file.endsWith(".json")).map((file) => file.replace(".json", ""));
|
|
296
|
-
} catch (err) {
|
|
297
|
-
const error = err;
|
|
298
|
-
if (!(error instanceof Error) || error.code !== "ENOENT") {
|
|
299
|
-
throw err;
|
|
300
|
-
}
|
|
301
|
-
return [];
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
__name(listTodoSessions, "listTodoSessions");
|
|
305
|
-
var TodoWriteTool = class _TodoWriteTool extends BaseDeclarativeTool {
|
|
306
|
-
constructor(config) {
|
|
307
|
-
super(
|
|
308
|
-
_TodoWriteTool.Name,
|
|
309
|
-
ToolDisplayNames.TODO_WRITE,
|
|
310
|
-
todoWriteToolDescription,
|
|
311
|
-
"think" /* Think */,
|
|
312
|
-
todoWriteToolSchemaData.parametersJsonSchema
|
|
313
|
-
);
|
|
314
|
-
this.config = config;
|
|
315
|
-
}
|
|
316
|
-
static {
|
|
317
|
-
__name(this, "TodoWriteTool");
|
|
318
|
-
}
|
|
319
|
-
static Name = ToolNames.TODO_WRITE;
|
|
320
|
-
validateToolParams(params) {
|
|
321
|
-
if (!Array.isArray(params.todos)) {
|
|
322
|
-
return 'Parameter "todos" must be an array.';
|
|
323
|
-
}
|
|
324
|
-
for (const todo of params.todos) {
|
|
325
|
-
if (!todo.id || typeof todo.id !== "string" || todo.id.trim() === "") {
|
|
326
|
-
return 'Each todo must have a non-empty "id" string.';
|
|
327
|
-
}
|
|
328
|
-
if (!todo.content || typeof todo.content !== "string" || todo.content.trim() === "") {
|
|
329
|
-
return 'Each todo must have a non-empty "content" string.';
|
|
330
|
-
}
|
|
331
|
-
if (!["pending", "in_progress", "completed"].includes(todo.status)) {
|
|
332
|
-
return 'Each todo must have a valid "status" (pending, in_progress, completed).';
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
const ids = params.todos.map((todo) => todo.id);
|
|
336
|
-
const uniqueIds = new Set(ids);
|
|
337
|
-
if (ids.length !== uniqueIds.size) {
|
|
338
|
-
return "Todo IDs must be unique within the array.";
|
|
339
|
-
}
|
|
340
|
-
return null;
|
|
341
|
-
}
|
|
342
|
-
createInvocation(params) {
|
|
343
|
-
const sessionId = this.config.getSessionId();
|
|
344
|
-
const todoFilePath = getTodoFilePath(sessionId);
|
|
345
|
-
const operationType = fsSync.existsSync(todoFilePath) ? "update" : "create";
|
|
346
|
-
return new TodoWriteToolInvocation(this.config, params, operationType);
|
|
347
|
-
}
|
|
348
|
-
};
|
|
349
|
-
export {
|
|
350
|
-
TodoWriteTool,
|
|
351
|
-
listTodoSessions,
|
|
352
|
-
readTodosForSession
|
|
353
|
-
};
|
|
354
|
-
/**
|
|
355
|
-
* @license
|
|
356
|
-
* Copyright 2025 Google LLC
|
|
357
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
358
|
-
*/
|
|
@@ -25,14 +25,14 @@ import {
|
|
|
25
25
|
import {
|
|
26
26
|
channelSelectionNames
|
|
27
27
|
} from "./chunk-TJTKSVIV.js";
|
|
28
|
+
import {
|
|
29
|
+
sanitizeLogText
|
|
30
|
+
} from "./chunk-RVLZCXEE.js";
|
|
28
31
|
import {
|
|
29
32
|
CHANNEL_WORKER_KILL_GRACE_MS,
|
|
30
33
|
CHANNEL_WORKER_STARTUP_TIMEOUT_MS,
|
|
31
34
|
CHANNEL_WORKER_STOP_GRACE_MS
|
|
32
35
|
} from "./chunk-5HBA2Z7V.js";
|
|
33
|
-
import {
|
|
34
|
-
sanitizeLogText
|
|
35
|
-
} from "./chunk-RVLZCXEE.js";
|
|
36
36
|
import {
|
|
37
37
|
init_esbuild_shims
|
|
38
38
|
} from "./chunk-5O2XNYP6.js";
|
|
File without changes
|
|
@@ -9,13 +9,13 @@ import {
|
|
|
9
9
|
import {
|
|
10
10
|
require_lib
|
|
11
11
|
} from "./chunk-WBL3FJEU.js";
|
|
12
|
+
import {
|
|
13
|
+
require_mime_db
|
|
14
|
+
} from "./chunk-T2NCM2ET.js";
|
|
12
15
|
import {
|
|
13
16
|
MAX_WORKSPACE_PATH_LENGTH,
|
|
14
17
|
translateAndCheckAbsoluteWorkspacePath
|
|
15
18
|
} from "./chunk-2RFKHEXL.js";
|
|
16
|
-
import {
|
|
17
|
-
require_mime_db
|
|
18
|
-
} from "./chunk-T2NCM2ET.js";
|
|
19
19
|
import {
|
|
20
20
|
writeStderrLine
|
|
21
21
|
} from "./chunk-OWAK7LMW.js";
|
|
@@ -4,17 +4,17 @@ import {
|
|
|
4
4
|
V1_INDICATOR_KEYS,
|
|
5
5
|
resolveEnvVarsInObject
|
|
6
6
|
} from "./chunk-GOXKNSDZ.js";
|
|
7
|
+
import {
|
|
8
|
+
DEFAULT_EXCLUDED_ENV_VARS,
|
|
9
|
+
HOME_ENV_BOOTSTRAP_KEYS,
|
|
10
|
+
PROJECT_ENV_HARDCODED_EXCLUSIONS
|
|
11
|
+
} from "./chunk-QRUIS3DN.js";
|
|
7
12
|
import {
|
|
8
13
|
SETTINGS_DIRECTORY_NAME,
|
|
9
14
|
getGlobalQwenDirLite,
|
|
10
15
|
getSystemDefaultsPath,
|
|
11
16
|
getSystemSettingsPath
|
|
12
17
|
} from "./chunk-IDS7MSUP.js";
|
|
13
|
-
import {
|
|
14
|
-
DEFAULT_EXCLUDED_ENV_VARS,
|
|
15
|
-
HOME_ENV_BOOTSTRAP_KEYS,
|
|
16
|
-
PROJECT_ENV_HARDCODED_EXCLUSIONS
|
|
17
|
-
} from "./chunk-QRUIS3DN.js";
|
|
18
18
|
import {
|
|
19
19
|
require_strip_json_comments
|
|
20
20
|
} from "./chunk-ALGGS7UH.js";
|