@mmmbuto/qwen-code-termux 0.16.1-termux → 0.18.0-termux
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/README.md +79 -109
- package/bundled/new-app/SKILL.md +22 -0
- package/bundled/qc-helper/SKILL.md +29 -24
- package/bundled/qc-helper/docs/_meta.ts +1 -0
- package/bundled/qc-helper/docs/configuration/_meta.ts +0 -3
- package/bundled/qc-helper/docs/configuration/settings.md +37 -31
- package/bundled/qc-helper/docs/configuration/themes.md +39 -0
- package/bundled/qc-helper/docs/features/_meta.ts +1 -3
- package/bundled/qc-helper/docs/features/approval-mode.md +35 -35
- package/bundled/qc-helper/docs/features/auto-mode.md +54 -9
- package/bundled/qc-helper/docs/features/channels/_meta.ts +1 -0
- package/bundled/qc-helper/docs/features/channels/feishu.md +170 -0
- package/bundled/qc-helper/docs/features/commands.md +115 -35
- package/bundled/qc-helper/docs/features/followup-suggestions.md +2 -2
- package/bundled/qc-helper/docs/features/headless.md +32 -0
- package/bundled/qc-helper/docs/features/markdown-rendering.md +21 -1
- package/bundled/qc-helper/docs/features/memory.md +22 -5
- package/bundled/qc-helper/docs/features/scheduled-tasks.md +1 -1
- package/bundled/qc-helper/docs/features/status-line.md +168 -32
- package/bundled/qc-helper/docs/features/sub-agents.md +60 -0
- package/bundled/qc-helper/docs/features/worktree.md +345 -0
- package/bundled/qc-helper/docs/overview.md +4 -4
- package/bundled/qc-helper/docs/quickstart.md +4 -4
- package/bundled/qc-helper/docs/qwen-serve-deploy-local.md +221 -0
- package/bundled/qc-helper/docs/qwen-serve.md +234 -24
- package/bundled/qc-helper/docs/reference/keyboard-shortcuts.md +16 -0
- package/bundled/qc-helper/docs/support/Uninstall.md +19 -1
- package/bundled/qc-helper/docs/support/troubleshooting.md +2 -1
- package/bundled/simplify/SKILL.md +123 -0
- package/chunks/agent-IDS4HMOX.js +56 -0
- package/chunks/agent-headless-5Q2EUSPS.js +50 -0
- package/chunks/{anthropicContentGenerator-SSGKR6DO.js → anthropicContentGenerator-2HBRNQ3B.js} +52 -9
- package/chunks/{askUserQuestion-PJWUUXKN.js → askUserQuestion-75TDJVK2.js} +45 -3
- package/chunks/{ca-UZ7BANMN.js → ca-BARBRL6N.js} +89 -5
- package/chunks/{chunk-GGNTZ2NH.js → chunk-2Y5SYSD3.js} +368 -597
- package/chunks/{chunk-2LA2TREA.js → chunk-3AA2DK35.js} +1448 -207
- package/chunks/{chunk-I2V5WXHJ.js → chunk-3AUHFMSK.js} +80 -38
- package/chunks/chunk-3DHXZ6EV.js +241 -0
- package/chunks/{chunk-PR4T27R7.js → chunk-3HTIVKZE.js} +42 -8
- package/chunks/chunk-3HX5LZ6R.js +1798 -0
- package/chunks/chunk-3PJXIDKI.js +2517 -0
- package/chunks/{chunk-MYAKAFEC.js → chunk-55ZMG67I.js} +7451 -3517
- package/chunks/{chunk-66CXYE4B.js → chunk-5IFG2VC4.js} +293 -242
- package/chunks/chunk-64WXLC72.js +98 -0
- package/chunks/{chunk-C6WMLUNB.js → chunk-72LDN5PP.js} +1 -1
- package/chunks/{chunk-F23NCRJ2.js → chunk-A7B4ISQP.js} +1 -1
- package/chunks/chunk-B7HXHOHU.js +393 -0
- package/chunks/{chunk-XEGHDASV.js → chunk-D3RHSPAS.js} +435 -540
- package/chunks/{chunk-XKS5KBFJ.js → chunk-EYENRK4D.js} +694 -384
- package/chunks/chunk-H6BD2ELD.js +36 -0
- package/chunks/{chunk-XP27SJMH.js → chunk-HR7SV7AY.js} +79 -48
- package/chunks/{chunk-D5NTAHYL.js → chunk-IDX6COTE.js} +7 -2
- package/chunks/{chunk-SHT4VJWU.js → chunk-IWKSG2AR.js} +2 -2
- package/chunks/chunk-J37FGIOA.js +1623 -0
- package/chunks/chunk-J5MDQKJL.js +2230 -0
- package/chunks/{chunk-USE2VQ5P.js → chunk-JTQAQBTV.js} +21 -0
- package/chunks/{chunk-NCTLV2NB.js → chunk-KQJMQJPI.js} +1 -1
- package/chunks/{chunk-5FBA5XC2.js → chunk-KRIHGKNA.js} +1 -1
- package/chunks/chunk-LD2XBG6Z.js +102 -0
- package/chunks/{chunk-MAY32HXD.js → chunk-M6VTDSVR.js} +3 -1
- package/chunks/chunk-MRO43B25.js +30 -0
- package/chunks/{chunk-N4WOREMD.js → chunk-NVFMZBX2.js} +43 -3
- package/chunks/chunk-OHEGWO4L.js +264 -0
- package/chunks/{chunk-K6O2NBMF.js → chunk-OQ7NJIY7.js} +4604 -6397
- package/chunks/chunk-QQDPRDVW.js +25 -0
- package/chunks/{chunk-KXZ4TJB4.js → chunk-SEGYWKIH.js} +1 -1
- package/chunks/chunk-SKBPNJEW.js +45 -0
- package/chunks/{chunk-4AOCVI6J.js → chunk-SNGELLWX.js} +52 -6
- package/chunks/{chunk-3OCRHZA3.js → chunk-TD4OPI4T.js} +56742 -44104
- package/chunks/{chunk-DQ4QTG7E.js → chunk-VV4F63BD.js} +11 -11
- package/chunks/chunk-XBY7E2FX.js +605 -0
- package/chunks/{chunk-JKMBWLFB.js → chunk-YILFYI5W.js} +48 -26
- package/chunks/chunk-YOGAOMYB.js +159 -0
- package/chunks/{chunk-QWSRH265.js → chunk-Z2Z3GUXZ.js} +777 -776
- package/chunks/{chunk-SDHRQFOS.js → chunk-ZTZ4DDQE.js} +2 -2
- package/chunks/computer-use-W2TYQNEE.js +825 -0
- package/chunks/contextCommand-6FGX3A7J.js +52 -0
- package/chunks/{cron-create-3ZBBN7WB.js → cron-create-APL5LU6I.js} +3 -3
- package/chunks/{cron-delete-NAGKKIIG.js → cron-delete-4SBJSCN4.js} +3 -3
- package/chunks/{cron-list-PAGRXNAI.js → cron-list-2AMGOMVO.js} +3 -3
- package/chunks/{de-V4IE2OOZ.js → de-YGKK2BC4.js} +89 -5
- package/chunks/{devtools-TWVXEJQB.js → devtools-FM6GJPYG.js} +2 -1
- package/chunks/{dist-4L54HRX2.js → dist-4LXD6L6X.js} +24 -5
- package/chunks/dist-H6ONXVLG.js +94146 -0
- package/chunks/{dist-XKWIWPWQ.js → dist-KAZ3SEBX.js} +1083 -3856
- package/chunks/{dist-BXDUQ2QY.js → dist-PK7DFCAW.js} +1 -1
- package/chunks/{edit-NVO3FOAK.js → edit-ZCEZC264.js} +30 -22
- package/chunks/{en-HGJ2SPLM.js → en-DHGYHIHX.js} +127 -6
- package/chunks/{enter-worktree-UEBG4WFC.js → enter-worktree-BBHCFCHG.js} +30 -20
- package/chunks/enterPlanMode-3M6KTD3B.js +158 -0
- package/chunks/{exit-worktree-UZ3MAQZN.js → exit-worktree-73YPIEQO.js} +27 -19
- package/chunks/exitPlanMode-TYZM6BAE.js +703 -0
- package/chunks/{fr-CJULI7ZX.js → fr-JXBKPJKQ.js} +89 -5
- package/chunks/{geminiContentGenerator-3UZFXGNT.js → geminiContentGenerator-7N2V3VW2.js} +8 -6
- package/chunks/{getMachineId-bsd-JXOSIJV2.js → getMachineId-bsd-4CASPIU4.js} +4 -4
- package/chunks/{getMachineId-darwin-TE4QRR42.js → getMachineId-darwin-HPQPEMZR.js} +4 -4
- package/chunks/{getMachineId-linux-S3OL52XK.js → getMachineId-linux-AUARKYHL.js} +3 -3
- package/chunks/{getMachineId-unsupported-DWUSBAPX.js → getMachineId-unsupported-S32ZDA2T.js} +3 -3
- package/chunks/{getMachineId-win-AAC5P3AP.js → getMachineId-win-4EFLHYIJ.js} +4 -4
- package/chunks/{glob-KNHSFFFG.js → glob-5XBCPQ2A.js} +27 -19
- package/chunks/{grep-LACWDZW4.js → grep-VIUU3A7X.js} +30 -19
- package/chunks/{ja-L7CHRQEW.js → ja-TGPZSP2B.js} +89 -5
- package/chunks/{keychain-token-storage-335UOLJ6.js → keychain-token-storage-6IU6ORQN.js} +3 -3
- package/chunks/{ls-AGXQOKSG.js → ls-JRGYIGLY.js} +4 -4
- package/chunks/{lsp-UDMUHNPA.js → lsp-SHMKFOAC.js} +3 -3
- package/chunks/{monitor-ETKWPJEH.js → monitor-6R4LIJL5.js} +40 -25
- package/chunks/{multipart-parser-3QWGTLK3.js → multipart-parser-AJ4WASWR.js} +2 -2
- package/chunks/{notebook-edit-QJJLPNYT.js → notebook-edit-5E7ULDVQ.js} +28 -20
- package/chunks/{openaiContentGenerator-CNNN424U.js → openaiContentGenerator-ZVHFKM3O.js} +17 -14
- package/chunks/{pt-M6JULLEQ.js → pt-TIBG6BIO.js} +89 -5
- package/chunks/{qwenContentGenerator-BOLCGK3R.js → qwenContentGenerator-B2VTVSPJ.js} +31 -23
- package/chunks/{qwenOAuth2-EEJGROP7.js → qwenOAuth2-2KCKWDCF.js} +6 -4
- package/chunks/read-file-GIT7BCDR.js +27 -0
- package/chunks/ripGrep-MWKFVYMS.js +48 -0
- package/chunks/{ru-QILM4HBC.js → ru-JBCHCK4L.js} +89 -5
- package/chunks/scheduler-5VOOYGBH.js +308 -0
- package/chunks/send-message-4QNWQJF4.js +244 -0
- package/chunks/{serve-OLSI7WSR.js → serve-MN6HZBWN.js} +14262 -7414
- package/chunks/shell-NQZQGFM2.js +56 -0
- package/chunks/{skill-D6YRHTTI.js → skill-WCFW4644.js} +145 -119
- package/chunks/{src-TMOD5X6F.js → src-7XL4G4DC.js} +88 -46
- package/chunks/{src-4QH4FZ6I.js → src-IHA6DTUV.js} +452 -62
- package/chunks/{syntheticOutput-5PVFDDJ4.js → syntheticOutput-YTYS2ZMQ.js} +4 -4
- package/chunks/task-create-MPORPYN6.js +19 -0
- package/chunks/task-list-R2YDYPZT.js +151 -0
- package/chunks/{task-stop-AJKPSR6R.js → task-stop-SYWJYBCM.js} +3 -3
- package/chunks/task-update-E4NSLKMQ.js +408 -0
- package/chunks/team-create-7R7KA5IP.js +314 -0
- package/chunks/team-delete-25OIWUPN.js +116 -0
- package/chunks/{todoWrite-VLAUG4CA.js → todoWrite-4YHMIF4X.js} +16 -5
- package/chunks/{tool-search-MZGHUUKD.js → tool-search-YBRVZCLI.js} +29 -11
- package/chunks/{tts-notification-K3X7X7MN.js → tts-notification-7SOEMQK4.js} +5 -4
- package/chunks/{web-fetch-OILB464A.js → web-fetch-MFIRHIHI.js} +5 -5
- package/chunks/workflow-5RIKVCIE.js +960 -0
- package/chunks/{write-file-BIQAA57V.js → write-file-DMQTJZOM.js} +32 -24
- package/chunks/{zh-PWL2NKY3.js → zh-7H5OQC4I.js} +135 -11
- package/chunks/{zh-TW-S3YGWICZ.js → zh-TW-P4IDHD3M.js} +128 -11
- package/cli.js +45402 -20570
- package/examples/agent/agents/diary.md +86 -0
- package/examples/agent/qwen-extension.json +5 -0
- package/examples/commands/commands/fs/grep-code.md +3 -0
- package/examples/commands/qwen-extension.json +5 -0
- package/examples/context/QWEN.md +8 -0
- package/examples/context/qwen-extension.json +5 -0
- package/examples/mcp-server/example.ts +60 -0
- package/examples/mcp-server/package.json +18 -0
- package/examples/mcp-server/qwen-extension.json +12 -0
- package/examples/mcp-server/tsconfig.json +13 -0
- package/examples/skills/qwen-extension.json +5 -0
- package/examples/skills/skills/synonyms/SKILL.md +48 -0
- package/examples/starter/QWEN.md +30 -0
- package/examples/starter/README.md +59 -0
- package/examples/starter/agents/diary.md +86 -0
- package/examples/starter/commands/writing/polish.md +13 -0
- package/examples/starter/example.ts +64 -0
- package/examples/starter/package.json +18 -0
- package/examples/starter/qwen-extension.json +12 -0
- package/examples/starter/skills/synonyms/SKILL.md +48 -0
- package/examples/starter/tsconfig.json +13 -0
- package/fzfWorker.js +1083 -0
- package/locales/ca.js +118 -5
- package/locales/de.js +117 -5
- package/locales/en.js +169 -7
- package/locales/fr.js +119 -5
- package/locales/ja.js +114 -5
- package/locales/pt.js +117 -5
- package/locales/ru.js +116 -5
- package/locales/zh-TW.js +161 -12
- package/locales/zh.js +169 -12
- package/package.json +4 -2
- package/scripts/postinstall.cjs +2 -1
- package/bundled/qc-helper/docs/features/checkpointing.md +0 -77
- package/chunks/agent-7ZN3CRHR.js +0 -48
- package/chunks/chunk-6PCB2DEF.js +0 -434
- package/chunks/chunk-EM6ETG2K.js +0 -60
- package/chunks/chunk-G7YTSRES.js +0 -150
- package/chunks/contextCommand-7IBASARL.js +0 -44
- package/chunks/exitPlanMode-PZAMWIRW.js +0 -227
- package/chunks/multipart-parser-IXGBIOIN.js +0 -384
- package/chunks/read-file-CCUEUFG2.js +0 -24
- package/chunks/ripGrep-TADOH2HK.js +0 -40
- package/chunks/send-message-YL44UZFC.js +0 -151
- package/chunks/shell-7KKKC5G7.js +0 -48
- package/chunks/src-IPWIHNMI.js +0 -1406
- package/chunks/undici-F6ZOXSS5.js +0 -8
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// Force strict mode and setup for ESM
|
|
2
|
+
"use strict";
|
|
3
|
+
import {
|
|
4
|
+
init_esbuild_shims
|
|
5
|
+
} from "./chunk-A4BMJM77.js";
|
|
6
|
+
|
|
7
|
+
// packages/core/src/plan-gate/types.ts
|
|
8
|
+
init_esbuild_shims();
|
|
9
|
+
var CAPPED_REVIEW_LIMIT = 5;
|
|
10
|
+
var MAX_AGENT_RETRIES = 3;
|
|
11
|
+
var CAP_ESCALATION_LABELS = {
|
|
12
|
+
CONTINUE: "Continue editing plan",
|
|
13
|
+
APPROVE: "Approve execution"
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export {
|
|
17
|
+
CAPPED_REVIEW_LIMIT,
|
|
18
|
+
MAX_AGENT_RETRIES,
|
|
19
|
+
CAP_ESCALATION_LABELS
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* @license
|
|
23
|
+
* Copyright 2025 Qwen
|
|
24
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
25
|
+
*/
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// Force strict mode and setup for ESM
|
|
2
|
+
"use strict";
|
|
3
|
+
import {
|
|
4
|
+
init_esbuild_shims
|
|
5
|
+
} from "./chunk-A4BMJM77.js";
|
|
6
|
+
import {
|
|
7
|
+
__name
|
|
8
|
+
} from "./chunk-J2S4EL5Y.js";
|
|
9
|
+
|
|
10
|
+
// packages/core/src/agents/runtime/agent-types.ts
|
|
11
|
+
init_esbuild_shims();
|
|
12
|
+
var AgentTerminateMode = /* @__PURE__ */ ((AgentTerminateMode2) => {
|
|
13
|
+
AgentTerminateMode2["ERROR"] = "ERROR";
|
|
14
|
+
AgentTerminateMode2["TIMEOUT"] = "TIMEOUT";
|
|
15
|
+
AgentTerminateMode2["GOAL"] = "GOAL";
|
|
16
|
+
AgentTerminateMode2["MAX_TURNS"] = "MAX_TURNS";
|
|
17
|
+
AgentTerminateMode2["CANCELLED"] = "CANCELLED";
|
|
18
|
+
AgentTerminateMode2["SHUTDOWN"] = "SHUTDOWN";
|
|
19
|
+
return AgentTerminateMode2;
|
|
20
|
+
})(AgentTerminateMode || {});
|
|
21
|
+
var AgentStatus = /* @__PURE__ */ ((AgentStatus2) => {
|
|
22
|
+
AgentStatus2["INITIALIZING"] = "initializing";
|
|
23
|
+
AgentStatus2["RUNNING"] = "running";
|
|
24
|
+
AgentStatus2["IDLE"] = "idle";
|
|
25
|
+
AgentStatus2["COMPLETED"] = "completed";
|
|
26
|
+
AgentStatus2["FAILED"] = "failed";
|
|
27
|
+
AgentStatus2["CANCELLED"] = "cancelled";
|
|
28
|
+
return AgentStatus2;
|
|
29
|
+
})(AgentStatus || {});
|
|
30
|
+
var isTerminalStatus = /* @__PURE__ */ __name((s) => s === "completed" /* COMPLETED */ || s === "failed" /* FAILED */ || s === "cancelled" /* CANCELLED */, "isTerminalStatus");
|
|
31
|
+
var isSuccessStatus = /* @__PURE__ */ __name((s) => s === "idle" /* IDLE */ || s === "completed" /* COMPLETED */, "isSuccessStatus");
|
|
32
|
+
var isSettledStatus = /* @__PURE__ */ __name((s) => s === "idle" /* IDLE */ || isTerminalStatus(s), "isSettledStatus");
|
|
33
|
+
|
|
34
|
+
export {
|
|
35
|
+
AgentTerminateMode,
|
|
36
|
+
AgentStatus,
|
|
37
|
+
isTerminalStatus,
|
|
38
|
+
isSuccessStatus,
|
|
39
|
+
isSettledStatus
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* @license
|
|
43
|
+
* Copyright 2025 Qwen
|
|
44
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
45
|
+
*/
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
import {
|
|
4
4
|
createDebugLogger
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-HR7SV7AY.js";
|
|
6
6
|
import {
|
|
7
7
|
init_esbuild_shims
|
|
8
8
|
} from "./chunk-A4BMJM77.js";
|
|
@@ -25,8 +25,10 @@ var HookEventName = /* @__PURE__ */ ((HookEventName2) => {
|
|
|
25
25
|
HookEventName2["PreToolUse"] = "PreToolUse";
|
|
26
26
|
HookEventName2["PostToolUse"] = "PostToolUse";
|
|
27
27
|
HookEventName2["PostToolUseFailure"] = "PostToolUseFailure";
|
|
28
|
+
HookEventName2["PostToolBatch"] = "PostToolBatch";
|
|
28
29
|
HookEventName2["Notification"] = "Notification";
|
|
29
30
|
HookEventName2["UserPromptSubmit"] = "UserPromptSubmit";
|
|
31
|
+
HookEventName2["UserPromptExpansion"] = "UserPromptExpansion";
|
|
30
32
|
HookEventName2["SessionStart"] = "SessionStart";
|
|
31
33
|
HookEventName2["Stop"] = "Stop";
|
|
32
34
|
HookEventName2["SubagentStart"] = "SubagentStart";
|
|
@@ -35,9 +37,11 @@ var HookEventName = /* @__PURE__ */ ((HookEventName2) => {
|
|
|
35
37
|
HookEventName2["PostCompact"] = "PostCompact";
|
|
36
38
|
HookEventName2["SessionEnd"] = "SessionEnd";
|
|
37
39
|
HookEventName2["PermissionRequest"] = "PermissionRequest";
|
|
40
|
+
HookEventName2["PermissionDenied"] = "PermissionDenied";
|
|
38
41
|
HookEventName2["StopFailure"] = "StopFailure";
|
|
39
42
|
HookEventName2["TodoCreated"] = "TodoCreated";
|
|
40
43
|
HookEventName2["TodoCompleted"] = "TodoCompleted";
|
|
44
|
+
HookEventName2["InstructionsLoaded"] = "InstructionsLoaded";
|
|
41
45
|
return HookEventName2;
|
|
42
46
|
})(HookEventName || {});
|
|
43
47
|
var HookPhase = /* @__PURE__ */ ((HookPhase2) => {
|
|
@@ -69,6 +73,11 @@ function getHookKey(hook) {
|
|
|
69
73
|
}
|
|
70
74
|
}
|
|
71
75
|
__name(getHookKey, "getHookKey");
|
|
76
|
+
var MAX_USER_PROMPT_EXPANSION_ADDITIONAL_CONTEXT_LENGTH = 1e4;
|
|
77
|
+
function sanitizeUserPromptExpansionAdditionalContext(raw) {
|
|
78
|
+
return raw.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").slice(0, MAX_USER_PROMPT_EXPANSION_ADDITIONAL_CONTEXT_LENGTH).replace(/&(?:a(?:mp?)?|lt?|gt?)?$/, "");
|
|
79
|
+
}
|
|
80
|
+
__name(sanitizeUserPromptExpansionAdditionalContext, "sanitizeUserPromptExpansionAdditionalContext");
|
|
72
81
|
function createHookOutput(eventName, data) {
|
|
73
82
|
switch (eventName) {
|
|
74
83
|
case "PreToolUse" /* PreToolUse */:
|
|
@@ -77,6 +86,10 @@ function createHookOutput(eventName, data) {
|
|
|
77
86
|
return new PostToolUseHookOutput(data);
|
|
78
87
|
case "PostToolUseFailure" /* PostToolUseFailure */:
|
|
79
88
|
return new PostToolUseFailureHookOutput(data);
|
|
89
|
+
case "UserPromptExpansion" /* UserPromptExpansion */:
|
|
90
|
+
return new UserPromptExpansionHookOutput(data);
|
|
91
|
+
case "PostToolBatch" /* PostToolBatch */:
|
|
92
|
+
return new PostToolBatchHookOutput(data);
|
|
80
93
|
case "Stop" /* Stop */:
|
|
81
94
|
case "SubagentStop" /* SubagentStop */:
|
|
82
95
|
return new StopHookOutput(data);
|
|
@@ -95,6 +108,7 @@ var DefaultHookOutput = class {
|
|
|
95
108
|
stopReason;
|
|
96
109
|
suppressOutput;
|
|
97
110
|
systemMessage;
|
|
111
|
+
terminalSequence;
|
|
98
112
|
decision;
|
|
99
113
|
reason;
|
|
100
114
|
hookSpecificOutput;
|
|
@@ -103,6 +117,7 @@ var DefaultHookOutput = class {
|
|
|
103
117
|
this.stopReason = data.stopReason;
|
|
104
118
|
this.suppressOutput = data.suppressOutput;
|
|
105
119
|
this.systemMessage = data.systemMessage;
|
|
120
|
+
this.terminalSequence = data.terminalSequence;
|
|
106
121
|
this.decision = data.decision;
|
|
107
122
|
this.reason = data.reason;
|
|
108
123
|
this.hookSpecificOutput = data.hookSpecificOutput;
|
|
@@ -125,15 +140,19 @@ var DefaultHookOutput = class {
|
|
|
125
140
|
getEffectiveReason() {
|
|
126
141
|
return this.stopReason || this.reason || "No reason provided";
|
|
127
142
|
}
|
|
143
|
+
getRawAdditionalContext() {
|
|
144
|
+
if (this.hookSpecificOutput && "additionalContext" in this.hookSpecificOutput) {
|
|
145
|
+
const context = this.hookSpecificOutput["additionalContext"];
|
|
146
|
+
return typeof context === "string" ? context : void 0;
|
|
147
|
+
}
|
|
148
|
+
return void 0;
|
|
149
|
+
}
|
|
128
150
|
/**
|
|
129
151
|
* Get sanitized additional context for adding to responses.
|
|
130
152
|
*/
|
|
131
153
|
getAdditionalContext() {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
if (typeof context !== "string") {
|
|
135
|
-
return void 0;
|
|
136
|
-
}
|
|
154
|
+
const context = this.getRawAdditionalContext();
|
|
155
|
+
if (context !== void 0) {
|
|
137
156
|
return context.replace(/</g, "<").replace(/>/g, ">");
|
|
138
157
|
}
|
|
139
158
|
return void 0;
|
|
@@ -247,6 +266,29 @@ var PostToolUseFailureHookOutput = class extends DefaultHookOutput {
|
|
|
247
266
|
return super.getAdditionalContext();
|
|
248
267
|
}
|
|
249
268
|
};
|
|
269
|
+
var UserPromptExpansionHookOutput = class extends DefaultHookOutput {
|
|
270
|
+
static {
|
|
271
|
+
__name(this, "UserPromptExpansionHookOutput");
|
|
272
|
+
}
|
|
273
|
+
getAdditionalContext() {
|
|
274
|
+
const raw = this.getRawAdditionalContext();
|
|
275
|
+
if (raw === void 0) {
|
|
276
|
+
return void 0;
|
|
277
|
+
}
|
|
278
|
+
return sanitizeUserPromptExpansionAdditionalContext(raw);
|
|
279
|
+
}
|
|
280
|
+
};
|
|
281
|
+
var PostToolBatchHookOutput = class extends DefaultHookOutput {
|
|
282
|
+
static {
|
|
283
|
+
__name(this, "PostToolBatchHookOutput");
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* Check if batch processing should stop after the resolved tool calls.
|
|
287
|
+
*/
|
|
288
|
+
shouldStopExecution() {
|
|
289
|
+
return super.shouldStopExecution() || this.isBlockingDecision();
|
|
290
|
+
}
|
|
291
|
+
};
|
|
250
292
|
var StopHookOutput = class extends DefaultHookOutput {
|
|
251
293
|
static {
|
|
252
294
|
__name(this, "StopHookOutput");
|
|
@@ -392,11 +434,15 @@ export {
|
|
|
392
434
|
HOOKS_CONFIG_FIELDS,
|
|
393
435
|
HookType,
|
|
394
436
|
getHookKey,
|
|
437
|
+
MAX_USER_PROMPT_EXPANSION_ADDITIONAL_CONTEXT_LENGTH,
|
|
438
|
+
sanitizeUserPromptExpansionAdditionalContext,
|
|
395
439
|
createHookOutput,
|
|
396
440
|
DefaultHookOutput,
|
|
397
441
|
PreToolUseHookOutput,
|
|
398
442
|
PostToolUseHookOutput,
|
|
399
443
|
PostToolUseFailureHookOutput,
|
|
444
|
+
UserPromptExpansionHookOutput,
|
|
445
|
+
PostToolBatchHookOutput,
|
|
400
446
|
StopHookOutput,
|
|
401
447
|
PermissionRequestHookOutput,
|
|
402
448
|
NotificationType,
|