snow-ai 0.5.11 → 0.5.12
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/bundle/cli.mjs +921 -483
- package/bundle/package.json +1 -1
- package/package.json +1 -1
package/bundle/cli.mjs
CHANGED
|
@@ -1263,7 +1263,7 @@ var require_react_development = __commonJS({
|
|
|
1263
1263
|
throw payload._result;
|
|
1264
1264
|
}
|
|
1265
1265
|
}
|
|
1266
|
-
function
|
|
1266
|
+
function lazy4(ctor2) {
|
|
1267
1267
|
var payload = {
|
|
1268
1268
|
// We use these fields to store the result.
|
|
1269
1269
|
_status: Uninitialized,
|
|
@@ -1421,7 +1421,7 @@ var require_react_development = __commonJS({
|
|
|
1421
1421
|
}
|
|
1422
1422
|
return dispatcher.useContext(Context);
|
|
1423
1423
|
}
|
|
1424
|
-
function
|
|
1424
|
+
function useState56(initialState) {
|
|
1425
1425
|
var dispatcher = resolveDispatcher();
|
|
1426
1426
|
return dispatcher.useState(initialState);
|
|
1427
1427
|
}
|
|
@@ -1433,7 +1433,7 @@ var require_react_development = __commonJS({
|
|
|
1433
1433
|
var dispatcher = resolveDispatcher();
|
|
1434
1434
|
return dispatcher.useRef(initialValue);
|
|
1435
1435
|
}
|
|
1436
|
-
function
|
|
1436
|
+
function useEffect50(create3, deps) {
|
|
1437
1437
|
var dispatcher = resolveDispatcher();
|
|
1438
1438
|
return dispatcher.useEffect(create3, deps);
|
|
1439
1439
|
}
|
|
@@ -1445,11 +1445,11 @@ var require_react_development = __commonJS({
|
|
|
1445
1445
|
var dispatcher = resolveDispatcher();
|
|
1446
1446
|
return dispatcher.useLayoutEffect(create3, deps);
|
|
1447
1447
|
}
|
|
1448
|
-
function
|
|
1448
|
+
function useCallback40(callback, deps) {
|
|
1449
1449
|
var dispatcher = resolveDispatcher();
|
|
1450
1450
|
return dispatcher.useCallback(callback, deps);
|
|
1451
1451
|
}
|
|
1452
|
-
function
|
|
1452
|
+
function useMemo28(create3, deps) {
|
|
1453
1453
|
var dispatcher = resolveDispatcher();
|
|
1454
1454
|
return dispatcher.useMemo(create3, deps);
|
|
1455
1455
|
}
|
|
@@ -2208,23 +2208,23 @@ var require_react_development = __commonJS({
|
|
|
2208
2208
|
exports2.createRef = createRef;
|
|
2209
2209
|
exports2.forwardRef = forwardRef3;
|
|
2210
2210
|
exports2.isValidElement = isValidElement2;
|
|
2211
|
-
exports2.lazy =
|
|
2211
|
+
exports2.lazy = lazy4;
|
|
2212
2212
|
exports2.memo = memo6;
|
|
2213
2213
|
exports2.startTransition = startTransition;
|
|
2214
2214
|
exports2.unstable_act = act;
|
|
2215
|
-
exports2.useCallback =
|
|
2215
|
+
exports2.useCallback = useCallback40;
|
|
2216
2216
|
exports2.useContext = useContext13;
|
|
2217
2217
|
exports2.useDebugValue = useDebugValue;
|
|
2218
2218
|
exports2.useDeferredValue = useDeferredValue;
|
|
2219
|
-
exports2.useEffect =
|
|
2219
|
+
exports2.useEffect = useEffect50;
|
|
2220
2220
|
exports2.useId = useId;
|
|
2221
2221
|
exports2.useImperativeHandle = useImperativeHandle2;
|
|
2222
2222
|
exports2.useInsertionEffect = useInsertionEffect;
|
|
2223
2223
|
exports2.useLayoutEffect = useLayoutEffect2;
|
|
2224
|
-
exports2.useMemo =
|
|
2224
|
+
exports2.useMemo = useMemo28;
|
|
2225
2225
|
exports2.useReducer = useReducer8;
|
|
2226
2226
|
exports2.useRef = useRef13;
|
|
2227
|
-
exports2.useState =
|
|
2227
|
+
exports2.useState = useState56;
|
|
2228
2228
|
exports2.useSyncExternalStore = useSyncExternalStore;
|
|
2229
2229
|
exports2.useTransition = useTransition;
|
|
2230
2230
|
exports2.version = ReactVersion;
|
|
@@ -9928,9 +9928,9 @@ var require_react_reconciler_development = __commonJS({
|
|
|
9928
9928
|
module2.exports = function $$$reconciler($$$hostConfig) {
|
|
9929
9929
|
var exports3 = {};
|
|
9930
9930
|
"use strict";
|
|
9931
|
-
var
|
|
9931
|
+
var React88 = require_react();
|
|
9932
9932
|
var Scheduler2 = require_scheduler();
|
|
9933
|
-
var ReactSharedInternals =
|
|
9933
|
+
var ReactSharedInternals = React88.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
9934
9934
|
var suppressWarning = false;
|
|
9935
9935
|
function setSuppressWarning(newSuppressWarning) {
|
|
9936
9936
|
{
|
|
@@ -45515,7 +45515,7 @@ var require_jsonfile = __commonJS({
|
|
|
45515
45515
|
callback(null, obj2);
|
|
45516
45516
|
});
|
|
45517
45517
|
}
|
|
45518
|
-
function
|
|
45518
|
+
function readFileSync20(file, options3) {
|
|
45519
45519
|
options3 = options3 || {};
|
|
45520
45520
|
if (typeof options3 === "string") {
|
|
45521
45521
|
options3 = { encoding: options3 };
|
|
@@ -45568,7 +45568,7 @@ var require_jsonfile = __commonJS({
|
|
|
45568
45568
|
}
|
|
45569
45569
|
fs40.writeFile(file, str2, options3, callback);
|
|
45570
45570
|
}
|
|
45571
|
-
function
|
|
45571
|
+
function writeFileSync14(file, obj2, options3) {
|
|
45572
45572
|
options3 = options3 || {};
|
|
45573
45573
|
var fs40 = options3.fs || _fs;
|
|
45574
45574
|
var str2 = stringify2(obj2, options3);
|
|
@@ -45581,9 +45581,9 @@ var require_jsonfile = __commonJS({
|
|
|
45581
45581
|
}
|
|
45582
45582
|
var jsonfile = {
|
|
45583
45583
|
readFile: readFile3,
|
|
45584
|
-
readFileSync:
|
|
45584
|
+
readFileSync: readFileSync20,
|
|
45585
45585
|
writeFile: writeFile4,
|
|
45586
|
-
writeFileSync:
|
|
45586
|
+
writeFileSync: writeFileSync14
|
|
45587
45587
|
};
|
|
45588
45588
|
module2.exports = jsonfile;
|
|
45589
45589
|
}
|
|
@@ -79585,10 +79585,21 @@ var init_en = __esm({
|
|
|
79585
79585
|
todo: "Search and select TODO comments from project files",
|
|
79586
79586
|
addDir: "Add working directory for multi-project context. Usage: /add-dir or /add-dir path",
|
|
79587
79587
|
reindex: "Rebuild codebase index, detect changed, deleted, new and modified files",
|
|
79588
|
+
permissions: "Manage always-approved tools permissions",
|
|
79588
79589
|
vulnerabilityHunting: "Toggle vulnerability hunting mode for security-focused code analysis",
|
|
79589
79590
|
quit: "Exit the application"
|
|
79590
79591
|
}
|
|
79591
79592
|
},
|
|
79593
|
+
permissionsPanel: {
|
|
79594
|
+
title: "Permissions",
|
|
79595
|
+
clearAll: "Clear All",
|
|
79596
|
+
noTools: "No tools are always approved",
|
|
79597
|
+
hint: "\u2191\u2193 navigate \u2022 Enter remove \u2022 ESC close",
|
|
79598
|
+
confirmDelete: "Delete allowed tool?",
|
|
79599
|
+
confirmClearAll: "Clear all permissions?",
|
|
79600
|
+
yes: "Yes",
|
|
79601
|
+
no: "No"
|
|
79602
|
+
},
|
|
79592
79603
|
profilePanel: {
|
|
79593
79604
|
title: "Select Profile",
|
|
79594
79605
|
scrollHint: "\u2191\u2193 to scroll",
|
|
@@ -80464,10 +80475,21 @@ var init_zh = __esm({
|
|
|
80464
80475
|
todo: "\u4ECE\u9879\u76EE\u6587\u4EF6\u641C\u7D22\u5E76\u9009\u62E9 TODO \u6CE8\u91CA",
|
|
80465
80476
|
addDir: "\u6DFB\u52A0\u5DE5\u4F5C\u76EE\u5F55\u4EE5\u652F\u6301\u591A\u9879\u76EE\u4E0A\u4E0B\u6587\u3002\u7528\u6CD5: /add-dir \u6216 /add-dir \u8DEF\u5F84",
|
|
80466
80477
|
reindex: "\u91CD\u5EFA\u4EE3\u7801\u5E93\u7D22\u5F15\uFF0C\u68C0\u6D4B\u53D8\u66F4\u3001\u5220\u9664\u3001\u65B0\u589E\u548C\u4FEE\u6539\u7684\u6587\u4EF6",
|
|
80478
|
+
permissions: "\u7BA1\u7406\u59CB\u7EC8\u6279\u51C6\u7684\u5DE5\u5177\u6743\u9650",
|
|
80467
80479
|
vulnerabilityHunting: "\u5207\u6362\u6F0F\u6D1E\u68C0\u67E5\u6A21\u5F0F\uFF0C\u8FDB\u884C\u5B89\u5168\u6027\u4EE3\u7801\u5206\u6790",
|
|
80468
80480
|
quit: "\u9000\u51FA\u5E94\u7528\u7A0B\u5E8F"
|
|
80469
80481
|
}
|
|
80470
80482
|
},
|
|
80483
|
+
permissionsPanel: {
|
|
80484
|
+
title: "\u6743\u9650",
|
|
80485
|
+
clearAll: "\u5168\u90E8\u6E05\u9664",
|
|
80486
|
+
noTools: "\u6682\u65E0\u59CB\u7EC8\u6279\u51C6\u7684\u5DE5\u5177",
|
|
80487
|
+
hint: "\u2191\u2193 \u5BFC\u822A \u2022 Enter \u79FB\u9664 \u2022 ESC \u5173\u95ED",
|
|
80488
|
+
confirmDelete: "\u5220\u9664\u5DF2\u6279\u51C6\u7684\u5DE5\u5177\uFF1F",
|
|
80489
|
+
confirmClearAll: "\u6E05\u9664\u5168\u90E8\u6743\u9650\uFF1F",
|
|
80490
|
+
yes: "\u662F",
|
|
80491
|
+
no: "\u5426"
|
|
80492
|
+
},
|
|
80471
80493
|
profilePanel: {
|
|
80472
80494
|
title: "\u9009\u62E9\u914D\u7F6E",
|
|
80473
80495
|
scrollHint: "\u2191\u2193 \u6EDA\u52A8",
|
|
@@ -81343,10 +81365,21 @@ var init_zh_TW = __esm({
|
|
|
81343
81365
|
todo: "\u5F9E\u5C08\u6848\u6A94\u6848\u641C\u5C0B\u4E26\u9078\u64C7 TODO \u8A3B\u91CB",
|
|
81344
81366
|
addDir: "\u65B0\u589E\u5DE5\u4F5C\u76EE\u9304\u4EE5\u652F\u63F4\u591A\u5C08\u6848\u4E0A\u4E0B\u6587\u3002\u7528\u6CD5: /add-dir \u6216 /add-dir \u8DEF\u5F91",
|
|
81345
81367
|
reindex: "\u91CD\u5EFA\u4EE3\u78BC\u5EAB\u7D22\u5F15\uFF0C\u6AA2\u6E2C\u8B8A\u66F4\u3001\u522A\u9664\u3001\u65B0\u589E\u548C\u4FEE\u6539\u7684\u6A94\u6848",
|
|
81368
|
+
permissions: "\u7BA1\u7406\u6C38\u9060\u5141\u8A31\u7684\u5DE5\u5177\u6B0A\u9650",
|
|
81346
81369
|
vulnerabilityHunting: "\u5207\u63DB\u6F0F\u6D1E\u6AA2\u67E5\u6A21\u5F0F\uFF0C\u9032\u884C\u5B89\u5168\u6027\u4EE3\u78BC\u5206\u6790",
|
|
81347
81370
|
quit: "\u9000\u51FA\u61C9\u7528\u7A0B\u5F0F"
|
|
81348
81371
|
}
|
|
81349
81372
|
},
|
|
81373
|
+
permissionsPanel: {
|
|
81374
|
+
title: "\u6B0A\u9650",
|
|
81375
|
+
clearAll: "\u5168\u90E8\u6E05\u9664",
|
|
81376
|
+
noTools: "\u76EE\u524D\u6C92\u6709\u5DE5\u5177\u88AB\u6C38\u9060\u5141\u8A31",
|
|
81377
|
+
hint: "\u2191\u2193 \u5C0E\u822A \u2022 Enter \u79FB\u9664 \u2022 ESC \u95DC\u9589",
|
|
81378
|
+
confirmDelete: "\u522A\u9664\u5DF2\u6279\u51C6\u7684\u5DE5\u5177\uFF1F",
|
|
81379
|
+
confirmClearAll: "\u6E05\u9664\u5168\u90E8\u6B0A\u9650\uFF1F",
|
|
81380
|
+
yes: "\u662F",
|
|
81381
|
+
no: "\u5426"
|
|
81382
|
+
},
|
|
81350
81383
|
profilePanel: {
|
|
81351
81384
|
title: "\u9078\u64C7\u8A2D\u5B9A\u6A94",
|
|
81352
81385
|
scrollHint: "\u2191\u2193 \u6372\u52D5",
|
|
@@ -82217,10 +82250,21 @@ var init_ja = __esm({
|
|
|
82217
82250
|
todo: "\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30D5\u30A1\u30A4\u30EB\u304B\u3089TODO\u30B3\u30E1\u30F3\u30C8\u3092\u691C\u7D22\u3057\u3066\u9078\u629E",
|
|
82218
82251
|
addDir: "\u30DE\u30EB\u30C1\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u306E\u305F\u3081\u306E\u4F5C\u696D\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u8FFD\u52A0\u3002\u4F7F\u7528\u65B9\u6CD5: /add-dir \u307E\u305F\u306F /add-dir \u30D1\u30B9",
|
|
82219
82252
|
reindex: "\u30B3\u30FC\u30C9\u30D9\u30FC\u30B9\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u3092\u518D\u69CB\u7BC9\u3001\u5909\u66F4\u3001\u524A\u9664\u3001\u65B0\u898F\u3001\u4FEE\u6B63\u3055\u308C\u305F\u30D5\u30A1\u30A4\u30EB\u3092\u691C\u51FA",
|
|
82253
|
+
permissions: "\u5E38\u306B\u627F\u8A8D\u3055\u308C\u308B\u30C4\u30FC\u30EB\u306E\u6A29\u9650\u3092\u7BA1\u7406",
|
|
82220
82254
|
vulnerabilityHunting: "\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u91CD\u8996\u306E\u30B3\u30FC\u30C9\u5206\u6790\u306E\u305F\u3081\u306E\u8106\u5F31\u6027\u30CF\u30F3\u30C6\u30A3\u30F3\u30B0\u30E2\u30FC\u30C9\u3092\u5207\u308A\u66FF\u3048",
|
|
82221
82255
|
quit: "\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u3092\u7D42\u4E86"
|
|
82222
82256
|
}
|
|
82223
82257
|
},
|
|
82258
|
+
permissionsPanel: {
|
|
82259
|
+
title: "\u6A29\u9650",
|
|
82260
|
+
clearAll: "\u3059\u3079\u3066\u30AF\u30EA\u30A2",
|
|
82261
|
+
noTools: "\u5E38\u306B\u627F\u8A8D\u3055\u308C\u3066\u3044\u308B\u30C4\u30FC\u30EB\u306F\u3042\u308A\u307E\u305B\u3093",
|
|
82262
|
+
hint: "\u2191\u2193\u3067\u79FB\u52D5 \u2022 Enter\u3067\u524A\u9664 \u2022 ESC\u3067\u9589\u3058\u308B",
|
|
82263
|
+
confirmDelete: "\u8A31\u53EF\u3055\u308C\u305F\u30C4\u30FC\u30EB\u3092\u524A\u9664\u3057\u307E\u3059\u304B\uFF1F",
|
|
82264
|
+
confirmClearAll: "\u3059\u3079\u3066\u306E\u6A29\u9650\u3092\u30AF\u30EA\u30A2\u3057\u307E\u3059\u304B\uFF1F",
|
|
82265
|
+
yes: "\u306F\u3044",
|
|
82266
|
+
no: "\u3044\u3044\u3048"
|
|
82267
|
+
},
|
|
82224
82268
|
profilePanel: {
|
|
82225
82269
|
title: "\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB\u9078\u629E",
|
|
82226
82270
|
scrollHint: "\u2191\u2193 \u3067\u30B9\u30AF\u30ED\u30FC\u30EB",
|
|
@@ -83091,10 +83135,21 @@ var init_ko = __esm({
|
|
|
83091
83135
|
todo: "\uD504\uB85C\uC81D\uD2B8 \uD30C\uC77C\uC5D0\uC11C TODO \uC8FC\uC11D \uAC80\uC0C9 \uBC0F \uC120\uD0DD",
|
|
83092
83136
|
addDir: "\uB2E4\uC911 \uD504\uB85C\uC81D\uD2B8 \uCEE8\uD14D\uC2A4\uD2B8\uB97C \uC704\uD55C \uC791\uC5C5 \uB514\uB809\uD130\uB9AC \uCD94\uAC00. \uC0AC\uC6A9\uBC95: /add-dir \uB610\uB294 /add-dir \uACBD\uB85C",
|
|
83093
83137
|
reindex: "\uCF54\uB4DC\uBCA0\uC774\uC2A4 \uC778\uB371\uC2A4 \uC7AC\uAD6C\uCD95, \uBCC0\uACBD\xB7\uC0AD\uC81C\xB7\uC2E0\uADDC\xB7\uC218\uC815\uB41C \uD30C\uC77C \uAC10\uC9C0",
|
|
83138
|
+
permissions: "\uD56D\uC0C1 \uC2B9\uC778\uB418\uB294 \uB3C4\uAD6C \uAD8C\uD55C \uAD00\uB9AC",
|
|
83094
83139
|
vulnerabilityHunting: "\uBCF4\uC548 \uC911\uC2EC \uCF54\uB4DC \uBD84\uC11D\uC744 \uC704\uD55C \uCDE8\uC57D\uC810 \uD5CC\uD305 \uBAA8\uB4DC \uC804\uD658",
|
|
83095
83140
|
quit: "\uC560\uD50C\uB9AC\uCF00\uC774\uC158 \uC885\uB8CC"
|
|
83096
83141
|
}
|
|
83097
83142
|
},
|
|
83143
|
+
permissionsPanel: {
|
|
83144
|
+
title: "\uAD8C\uD55C",
|
|
83145
|
+
clearAll: "\uBAA8\uB450 \uC9C0\uC6B0\uAE30",
|
|
83146
|
+
noTools: "\uD56D\uC0C1 \uC2B9\uC778\uB41C \uB3C4\uAD6C\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4",
|
|
83147
|
+
hint: "\u2191\u2193 \uC774\uB3D9 \u2022 Enter \uC81C\uAC70 \u2022 ESC \uB2EB\uAE30",
|
|
83148
|
+
confirmDelete: "\uD5C8\uC6A9\uB41C \uB3C4\uAD6C\uB97C \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",
|
|
83149
|
+
confirmClearAll: "\uBAA8\uB4E0 \uAD8C\uD55C\uC744 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",
|
|
83150
|
+
yes: "\uC608",
|
|
83151
|
+
no: "\uC544\uB2C8\uC624"
|
|
83152
|
+
},
|
|
83098
83153
|
profilePanel: {
|
|
83099
83154
|
title: "\uD504\uB85C\uD544 \uC120\uD0DD",
|
|
83100
83155
|
scrollHint: "\u2191\u2193 \uC2A4\uD06C\uB864",
|
|
@@ -83965,10 +84020,21 @@ var init_es = __esm({
|
|
|
83965
84020
|
todo: "Buscar y seleccionar comentarios TODO de archivos del proyecto",
|
|
83966
84021
|
addDir: "Agregar directorio de trabajo para contexto multi-proyecto. Uso: /add-dir o /add-dir ruta",
|
|
83967
84022
|
reindex: "Reconstruir \xEDndice de c\xF3digo, detectar archivos modificados, eliminados, nuevos y cambiados",
|
|
84023
|
+
permissions: "Administrar permisos de herramientas siempre aprobadas",
|
|
83968
84024
|
vulnerabilityHunting: "Alternar modo de b\xFAsqueda de vulnerabilidades para an\xE1lisis de c\xF3digo enfocado en seguridad",
|
|
83969
84025
|
quit: "Salir de la aplicaci\xF3n"
|
|
83970
84026
|
}
|
|
83971
84027
|
},
|
|
84028
|
+
permissionsPanel: {
|
|
84029
|
+
title: "Permisos",
|
|
84030
|
+
clearAll: "Borrar todo",
|
|
84031
|
+
noTools: "No hay herramientas siempre aprobadas",
|
|
84032
|
+
hint: "\u2191\u2193 navegar \u2022 Enter eliminar \u2022 ESC cerrar",
|
|
84033
|
+
confirmDelete: "\xBFEliminar herramienta permitida?",
|
|
84034
|
+
confirmClearAll: "\xBFBorrar todos los permisos?",
|
|
84035
|
+
yes: "S\xED",
|
|
84036
|
+
no: "No"
|
|
84037
|
+
},
|
|
83972
84038
|
profilePanel: {
|
|
83973
84039
|
title: "Seleccionar perfil",
|
|
83974
84040
|
scrollHint: "\u2191\u2193 para desplazarse",
|
|
@@ -85129,7 +85195,7 @@ var require_react_is_development = __commonJS({
|
|
|
85129
85195
|
var Portal = REACT_PORTAL_TYPE;
|
|
85130
85196
|
var Profiler = REACT_PROFILER_TYPE;
|
|
85131
85197
|
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
85132
|
-
var
|
|
85198
|
+
var Suspense7 = REACT_SUSPENSE_TYPE;
|
|
85133
85199
|
var hasWarnedAboutDeprecatedIsAsyncMode = false;
|
|
85134
85200
|
function isAsyncMode(object2) {
|
|
85135
85201
|
{
|
|
@@ -85188,7 +85254,7 @@ var require_react_is_development = __commonJS({
|
|
|
85188
85254
|
exports2.Portal = Portal;
|
|
85189
85255
|
exports2.Profiler = Profiler;
|
|
85190
85256
|
exports2.StrictMode = StrictMode;
|
|
85191
|
-
exports2.Suspense =
|
|
85257
|
+
exports2.Suspense = Suspense7;
|
|
85192
85258
|
exports2.isAsyncMode = isAsyncMode;
|
|
85193
85259
|
exports2.isConcurrentMode = isConcurrentMode;
|
|
85194
85260
|
exports2.isContextConsumer = isContextConsumer;
|
|
@@ -106361,7 +106427,7 @@ var require_doc = __commonJS({
|
|
|
106361
106427
|
type: "cursor",
|
|
106362
106428
|
placeholder: Symbol("cursor")
|
|
106363
106429
|
};
|
|
106364
|
-
function
|
|
106430
|
+
function join29(sep, arr) {
|
|
106365
106431
|
const res = [];
|
|
106366
106432
|
for (let i = 0; i < arr.length; i++) {
|
|
106367
106433
|
if (i !== 0) {
|
|
@@ -106391,7 +106457,7 @@ var require_doc = __commonJS({
|
|
|
106391
106457
|
}
|
|
106392
106458
|
module22.exports = {
|
|
106393
106459
|
concat: concat2,
|
|
106394
|
-
join:
|
|
106460
|
+
join: join29,
|
|
106395
106461
|
line,
|
|
106396
106462
|
softline,
|
|
106397
106463
|
hardline,
|
|
@@ -106583,7 +106649,7 @@ var require_doc = __commonJS({
|
|
|
106583
106649
|
var getLast = require_get_last();
|
|
106584
106650
|
var {
|
|
106585
106651
|
literalline,
|
|
106586
|
-
join:
|
|
106652
|
+
join: join29
|
|
106587
106653
|
} = require_doc_builders();
|
|
106588
106654
|
var isConcat = (doc) => Array.isArray(doc) || doc && doc.type === "concat";
|
|
106589
106655
|
var getDocParts = (doc) => {
|
|
@@ -106896,7 +106962,7 @@ var require_doc = __commonJS({
|
|
|
106896
106962
|
}
|
|
106897
106963
|
function replaceTextEndOfLine(text2) {
|
|
106898
106964
|
let replacement = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : literalline;
|
|
106899
|
-
return
|
|
106965
|
+
return join29(replacement, text2.split("\n")).parts;
|
|
106900
106966
|
}
|
|
106901
106967
|
function canBreakFn(doc) {
|
|
106902
106968
|
if (doc.type === "line") {
|
|
@@ -115866,7 +115932,7 @@ ${error.message}`;
|
|
|
115866
115932
|
value: true
|
|
115867
115933
|
});
|
|
115868
115934
|
exports22.readFile = readFile3;
|
|
115869
|
-
exports22.readFileSync =
|
|
115935
|
+
exports22.readFileSync = readFileSync20;
|
|
115870
115936
|
var _fs = _interopRequireDefault(__require("fs"));
|
|
115871
115937
|
function _interopRequireDefault(obj2) {
|
|
115872
115938
|
return obj2 && obj2.__esModule ? obj2 : {
|
|
@@ -115896,7 +115962,7 @@ ${error.message}`;
|
|
|
115896
115962
|
throw error;
|
|
115897
115963
|
}
|
|
115898
115964
|
}
|
|
115899
|
-
function
|
|
115965
|
+
function readFileSync20(filepath, options3 = {}) {
|
|
115900
115966
|
const throwNotFound = options3.throwNotFound === true;
|
|
115901
115967
|
try {
|
|
115902
115968
|
const content = _fs.default.readFileSync(filepath, "utf8");
|
|
@@ -116283,7 +116349,7 @@ ${error.message}`;
|
|
|
116283
116349
|
var path48 = __require("path");
|
|
116284
116350
|
var fs40 = __require("fs");
|
|
116285
116351
|
var exists = fs40.exists || path48.exists;
|
|
116286
|
-
var
|
|
116352
|
+
var existsSync25 = fs40.existsSync || path48.existsSync;
|
|
116287
116353
|
function splitPath(path210) {
|
|
116288
116354
|
var parts = path210.split(/(\/|\\)/);
|
|
116289
116355
|
if (!parts.length)
|
|
@@ -116308,7 +116374,7 @@ ${error.message}`;
|
|
|
116308
116374
|
if (parts.length === 0)
|
|
116309
116375
|
return null;
|
|
116310
116376
|
var p = parts.join("");
|
|
116311
|
-
var itdoes =
|
|
116377
|
+
var itdoes = existsSync25(path48.join(p, clue));
|
|
116312
116378
|
return itdoes ? p : testDir(parts.slice(0, -1));
|
|
116313
116379
|
}
|
|
116314
116380
|
return testDir(splitPath(currentFullPath));
|
|
@@ -217221,7 +217287,7 @@ var require_prettier = __commonJS({
|
|
|
217221
217287
|
tokenize: function tokenize5(value) {
|
|
217222
217288
|
return value.split("");
|
|
217223
217289
|
},
|
|
217224
|
-
join: function
|
|
217290
|
+
join: function join29(chars) {
|
|
217225
217291
|
return chars.join("");
|
|
217226
217292
|
}
|
|
217227
217293
|
};
|
|
@@ -223140,7 +223206,7 @@ ${frame}`;
|
|
|
223140
223206
|
breakParent,
|
|
223141
223207
|
indent,
|
|
223142
223208
|
lineSuffix,
|
|
223143
|
-
join:
|
|
223209
|
+
join: join29,
|
|
223144
223210
|
cursor: cursor4
|
|
223145
223211
|
}
|
|
223146
223212
|
} = require_doc();
|
|
@@ -223522,9 +223588,9 @@ ${frame}`;
|
|
|
223522
223588
|
return "";
|
|
223523
223589
|
}
|
|
223524
223590
|
if (sameIndent) {
|
|
223525
|
-
return
|
|
223591
|
+
return join29(hardline, parts);
|
|
223526
223592
|
}
|
|
223527
|
-
return indent([hardline,
|
|
223593
|
+
return indent([hardline, join29(hardline, parts)]);
|
|
223528
223594
|
}
|
|
223529
223595
|
function printCommentsSeparately(path48, options3, ignored) {
|
|
223530
223596
|
const value = path48.getValue();
|
|
@@ -231073,8 +231139,8 @@ ${error.message}`;
|
|
|
231073
231139
|
}
|
|
231074
231140
|
return x;
|
|
231075
231141
|
};
|
|
231076
|
-
var defaultReadPackageSync = function defaultReadPackageSync2(
|
|
231077
|
-
var body =
|
|
231142
|
+
var defaultReadPackageSync = function defaultReadPackageSync2(readFileSync20, pkgfile) {
|
|
231143
|
+
var body = readFileSync20(pkgfile);
|
|
231078
231144
|
try {
|
|
231079
231145
|
var pkg = JSON.parse(body);
|
|
231080
231146
|
return pkg;
|
|
@@ -231094,7 +231160,7 @@ ${error.message}`;
|
|
|
231094
231160
|
}
|
|
231095
231161
|
var opts = normalizeOptions(x, options3);
|
|
231096
231162
|
var isFile = opts.isFile || defaultIsFile;
|
|
231097
|
-
var
|
|
231163
|
+
var readFileSync20 = opts.readFileSync || fs40.readFileSync;
|
|
231098
231164
|
var isDirectory = opts.isDirectory || defaultIsDir;
|
|
231099
231165
|
var realpathSync = opts.realpathSync || defaultRealpathSync;
|
|
231100
231166
|
var readPackageSync2 = opts.readPackageSync || defaultReadPackageSync;
|
|
@@ -231156,7 +231222,7 @@ ${error.message}`;
|
|
|
231156
231222
|
if (!isFile(pkgfile)) {
|
|
231157
231223
|
return loadpkg(path48.dirname(dir));
|
|
231158
231224
|
}
|
|
231159
|
-
var pkg = readPackageSync2(
|
|
231225
|
+
var pkg = readPackageSync2(readFileSync20, pkgfile);
|
|
231160
231226
|
if (pkg && opts.packageFilter) {
|
|
231161
231227
|
pkg = opts.packageFilter(pkg, dir);
|
|
231162
231228
|
}
|
|
@@ -231169,7 +231235,7 @@ ${error.message}`;
|
|
|
231169
231235
|
var pkgfile = path48.join(maybeRealpathSync(realpathSync, x2, opts), "/package.json");
|
|
231170
231236
|
if (isFile(pkgfile)) {
|
|
231171
231237
|
try {
|
|
231172
|
-
var pkg = readPackageSync2(
|
|
231238
|
+
var pkg = readPackageSync2(readFileSync20, pkgfile);
|
|
231173
231239
|
} catch (e) {
|
|
231174
231240
|
}
|
|
231175
231241
|
if (pkg && opts.packageFilter) {
|
|
@@ -237869,7 +237935,7 @@ ${fromBody}`;
|
|
|
237869
237935
|
} = require_util15();
|
|
237870
237936
|
var {
|
|
237871
237937
|
builders: {
|
|
237872
|
-
join:
|
|
237938
|
+
join: join29,
|
|
237873
237939
|
hardline,
|
|
237874
237940
|
softline,
|
|
237875
237941
|
group: group2,
|
|
@@ -237982,7 +238048,7 @@ ${fromBody}`;
|
|
|
237982
238048
|
maxColumnWidths[index] = Math.max(maxColumnWidths[index], getStringWidth(cell));
|
|
237983
238049
|
}
|
|
237984
238050
|
}
|
|
237985
|
-
parts.push(lineSuffixBoundary, "`", indent([hardline,
|
|
238051
|
+
parts.push(lineSuffixBoundary, "`", indent([hardline, join29(hardline, table2.map((row) => join29(" | ", row.cells.map((cell, index) => row.hasLineBreak ? cell : cell + " ".repeat(maxColumnWidths[index] - getStringWidth(cell))))))]), hardline, "`");
|
|
237986
238052
|
return parts;
|
|
237987
238053
|
}
|
|
237988
238054
|
}
|
|
@@ -238126,7 +238192,7 @@ ${fromBody}`;
|
|
|
238126
238192
|
var {
|
|
238127
238193
|
builders: {
|
|
238128
238194
|
indent,
|
|
238129
|
-
join:
|
|
238195
|
+
join: join29,
|
|
238130
238196
|
hardline
|
|
238131
238197
|
}
|
|
238132
238198
|
} = require_doc();
|
|
@@ -238182,7 +238248,7 @@ ${fromBody}`;
|
|
|
238182
238248
|
parts.push(expressionDoc);
|
|
238183
238249
|
}
|
|
238184
238250
|
}
|
|
238185
|
-
return ["`", indent([hardline,
|
|
238251
|
+
return ["`", indent([hardline, join29(hardline, parts)]), hardline, "`"];
|
|
238186
238252
|
}
|
|
238187
238253
|
function printGraphqlComments(lines) {
|
|
238188
238254
|
const parts = [];
|
|
@@ -238199,7 +238265,7 @@ ${fromBody}`;
|
|
|
238199
238265
|
}
|
|
238200
238266
|
seenComment = true;
|
|
238201
238267
|
}
|
|
238202
|
-
return parts.length === 0 ? null :
|
|
238268
|
+
return parts.length === 0 ? null : join29(hardline, parts);
|
|
238203
238269
|
}
|
|
238204
238270
|
module22.exports = format4;
|
|
238205
238271
|
}
|
|
@@ -239859,7 +239925,7 @@ ${fromBody}`;
|
|
|
239859
239925
|
"use strict";
|
|
239860
239926
|
var {
|
|
239861
239927
|
builders: {
|
|
239862
|
-
join:
|
|
239928
|
+
join: join29,
|
|
239863
239929
|
line,
|
|
239864
239930
|
group: group2,
|
|
239865
239931
|
softline,
|
|
@@ -239876,7 +239942,7 @@ ${fromBody}`;
|
|
|
239876
239942
|
}
|
|
239877
239943
|
if (options3.__isVueForBindingLeft) {
|
|
239878
239944
|
return path48.call((functionDeclarationPath) => {
|
|
239879
|
-
const printed =
|
|
239945
|
+
const printed = join29([",", line], functionDeclarationPath.map(print, "params"));
|
|
239880
239946
|
const {
|
|
239881
239947
|
params
|
|
239882
239948
|
} = functionDeclarationPath.getValue();
|
|
@@ -239887,7 +239953,7 @@ ${fromBody}`;
|
|
|
239887
239953
|
}, "program", "body", 0);
|
|
239888
239954
|
}
|
|
239889
239955
|
if (options3.__isVueBindings) {
|
|
239890
|
-
return path48.call((functionDeclarationPath) =>
|
|
239956
|
+
return path48.call((functionDeclarationPath) => join29([",", line], functionDeclarationPath.map(print, "params")), "program", "body", 0);
|
|
239891
239957
|
}
|
|
239892
239958
|
}
|
|
239893
239959
|
function isVueEventBindingExpression(node) {
|
|
@@ -239923,7 +239989,7 @@ ${fromBody}`;
|
|
|
239923
239989
|
} = require_util15();
|
|
239924
239990
|
var {
|
|
239925
239991
|
builders: {
|
|
239926
|
-
join:
|
|
239992
|
+
join: join29,
|
|
239927
239993
|
line,
|
|
239928
239994
|
softline,
|
|
239929
239995
|
group: group2,
|
|
@@ -240005,7 +240071,7 @@ ${fromBody}`;
|
|
|
240005
240071
|
const shouldInline = shouldInlineLogicalExpression(node);
|
|
240006
240072
|
const lineBeforeOperator = (node.operator === "|>" || node.type === "NGPipeExpression" || node.operator === "|" && options3.parser === "__vue_expression") && !hasLeadingOwnLineComment(options3.originalText, node.right);
|
|
240007
240073
|
const operator = node.type === "NGPipeExpression" ? "|" : node.operator;
|
|
240008
|
-
const rightSuffix = node.type === "NGPipeExpression" && node.arguments.length > 0 ? group2(indent([line, ": ",
|
|
240074
|
+
const rightSuffix = node.type === "NGPipeExpression" && node.arguments.length > 0 ? group2(indent([line, ": ", join29([line, ": "], path48.map(print, "arguments").map((arg) => align(2, group2(arg))))])) : "";
|
|
240009
240075
|
let right;
|
|
240010
240076
|
if (shouldInline) {
|
|
240011
240077
|
right = [operator, " ", print("right"), rightSuffix];
|
|
@@ -240055,7 +240121,7 @@ ${fromBody}`;
|
|
|
240055
240121
|
"use strict";
|
|
240056
240122
|
var {
|
|
240057
240123
|
builders: {
|
|
240058
|
-
join:
|
|
240124
|
+
join: join29,
|
|
240059
240125
|
line,
|
|
240060
240126
|
group: group2
|
|
240061
240127
|
}
|
|
@@ -240079,7 +240145,7 @@ ${fromBody}`;
|
|
|
240079
240145
|
case "NGPipeExpression":
|
|
240080
240146
|
return printBinaryishExpression(path48, options3, print);
|
|
240081
240147
|
case "NGChainedExpression":
|
|
240082
|
-
return group2(
|
|
240148
|
+
return group2(join29([";", line], path48.map((childPath) => hasNgSideEffect(childPath) ? print() : ["(", print(), ")"], "expressions")));
|
|
240083
240149
|
case "NGEmptyExpression":
|
|
240084
240150
|
return "";
|
|
240085
240151
|
case "NGQuotedExpression":
|
|
@@ -240143,7 +240209,7 @@ ${fromBody}`;
|
|
|
240143
240209
|
fill,
|
|
240144
240210
|
ifBreak,
|
|
240145
240211
|
lineSuffixBoundary,
|
|
240146
|
-
join:
|
|
240212
|
+
join: join29
|
|
240147
240213
|
},
|
|
240148
240214
|
utils: {
|
|
240149
240215
|
willBreak
|
|
@@ -240481,9 +240547,9 @@ ${fromBody}`;
|
|
|
240481
240547
|
case "JSXIdentifier":
|
|
240482
240548
|
return String(node.name);
|
|
240483
240549
|
case "JSXNamespacedName":
|
|
240484
|
-
return
|
|
240550
|
+
return join29(":", [print("namespace"), print("name")]);
|
|
240485
240551
|
case "JSXMemberExpression":
|
|
240486
|
-
return
|
|
240552
|
+
return join29(".", [print("object"), print("property")]);
|
|
240487
240553
|
case "JSXSpreadAttribute":
|
|
240488
240554
|
return printJsxSpreadAttribute(path48, options3, print);
|
|
240489
240555
|
case "JSXSpreadChild": {
|
|
@@ -240690,7 +240756,7 @@ ${fromBody}`;
|
|
|
240690
240756
|
type: "cursor",
|
|
240691
240757
|
placeholder: Symbol("cursor")
|
|
240692
240758
|
};
|
|
240693
|
-
function
|
|
240759
|
+
function join29(sep, arr) {
|
|
240694
240760
|
const res = [];
|
|
240695
240761
|
for (let i = 0; i < arr.length; i++) {
|
|
240696
240762
|
if (i !== 0) {
|
|
@@ -240720,7 +240786,7 @@ ${fromBody}`;
|
|
|
240720
240786
|
}
|
|
240721
240787
|
module22.exports = {
|
|
240722
240788
|
concat: concat2,
|
|
240723
|
-
join:
|
|
240789
|
+
join: join29,
|
|
240724
240790
|
line,
|
|
240725
240791
|
softline,
|
|
240726
240792
|
hardline,
|
|
@@ -240753,7 +240819,7 @@ ${fromBody}`;
|
|
|
240753
240819
|
var getLast = require_get_last();
|
|
240754
240820
|
var {
|
|
240755
240821
|
literalline,
|
|
240756
|
-
join:
|
|
240822
|
+
join: join29
|
|
240757
240823
|
} = require_doc_builders();
|
|
240758
240824
|
var isConcat = (doc2) => Array.isArray(doc2) || doc2 && doc2.type === "concat";
|
|
240759
240825
|
var getDocParts = (doc2) => {
|
|
@@ -241065,7 +241131,7 @@ ${fromBody}`;
|
|
|
241065
241131
|
return mapDoc(doc2, (currentDoc) => typeof currentDoc === "string" && currentDoc.includes("\n") ? replaceTextEndOfLine(currentDoc) : currentDoc);
|
|
241066
241132
|
}
|
|
241067
241133
|
function replaceTextEndOfLine(text2, replacement = literalline) {
|
|
241068
|
-
return
|
|
241134
|
+
return join29(replacement, text2.split("\n")).parts;
|
|
241069
241135
|
}
|
|
241070
241136
|
function canBreakFn(doc2) {
|
|
241071
241137
|
if (doc2.type === "line") {
|
|
@@ -241103,7 +241169,7 @@ ${fromBody}`;
|
|
|
241103
241169
|
var {
|
|
241104
241170
|
builders: {
|
|
241105
241171
|
indent,
|
|
241106
|
-
join:
|
|
241172
|
+
join: join29,
|
|
241107
241173
|
line
|
|
241108
241174
|
}
|
|
241109
241175
|
} = require_doc();
|
|
@@ -241153,7 +241219,7 @@ ${fromBody}`;
|
|
|
241153
241219
|
if (!isNonEmptyArray(node.modifiers)) {
|
|
241154
241220
|
return "";
|
|
241155
241221
|
}
|
|
241156
|
-
return [
|
|
241222
|
+
return [join29(" ", path48.map(print, "modifiers")), " "];
|
|
241157
241223
|
}
|
|
241158
241224
|
function adjustClause(node, clause, forceSpace) {
|
|
241159
241225
|
if (node.type === "EmptyStatement") {
|
|
@@ -241536,7 +241602,7 @@ ${fromBody}`;
|
|
|
241536
241602
|
} = require_loc();
|
|
241537
241603
|
var {
|
|
241538
241604
|
builders: {
|
|
241539
|
-
join:
|
|
241605
|
+
join: join29,
|
|
241540
241606
|
hardline,
|
|
241541
241607
|
group: group2,
|
|
241542
241608
|
indent,
|
|
@@ -241680,7 +241746,7 @@ ${fromBody}`;
|
|
|
241680
241746
|
if (groups2.length === 0) {
|
|
241681
241747
|
return "";
|
|
241682
241748
|
}
|
|
241683
|
-
return indent(group2([hardline,
|
|
241749
|
+
return indent(group2([hardline, join29(hardline, groups2.map(printGroup))]));
|
|
241684
241750
|
}
|
|
241685
241751
|
const printedGroups = groups.map(printGroup);
|
|
241686
241752
|
const oneLine = printedGroups;
|
|
@@ -241720,7 +241786,7 @@ ${fromBody}`;
|
|
|
241720
241786
|
"use strict";
|
|
241721
241787
|
var {
|
|
241722
241788
|
builders: {
|
|
241723
|
-
join:
|
|
241789
|
+
join: join29,
|
|
241724
241790
|
group: group2
|
|
241725
241791
|
}
|
|
241726
241792
|
} = require_doc();
|
|
@@ -241753,7 +241819,7 @@ ${fromBody}`;
|
|
|
241753
241819
|
iterateCallArgumentsPath(path48, () => {
|
|
241754
241820
|
printed.push(print());
|
|
241755
241821
|
});
|
|
241756
|
-
return [isNew ? "new " : "", print("callee"), optional, printFunctionTypeParameters(path48, options3, print), "(",
|
|
241822
|
+
return [isNew ? "new " : "", print("callee"), optional, printFunctionTypeParameters(path48, options3, print), "(", join29(", ", printed), ")"];
|
|
241757
241823
|
}
|
|
241758
241824
|
const isIdentifierWithFlowAnnotation = (options3.parser === "babel" || options3.parser === "babel-flow") && node.callee && node.callee.type === "Identifier" && hasFlowAnnotationComment(node.callee.trailingComments);
|
|
241759
241825
|
if (isIdentifierWithFlowAnnotation) {
|
|
@@ -242235,7 +242301,7 @@ ${fromBody}`;
|
|
|
242235
242301
|
var {
|
|
242236
242302
|
builders: {
|
|
242237
242303
|
group: group2,
|
|
242238
|
-
join:
|
|
242304
|
+
join: join29,
|
|
242239
242305
|
line,
|
|
242240
242306
|
softline,
|
|
242241
242307
|
indent,
|
|
@@ -242336,10 +242402,10 @@ ${fromBody}`;
|
|
|
242336
242402
|
return printComments(typePath, printedType, options3);
|
|
242337
242403
|
}, "types");
|
|
242338
242404
|
if (shouldHug) {
|
|
242339
|
-
return
|
|
242405
|
+
return join29(" | ", printed);
|
|
242340
242406
|
}
|
|
242341
242407
|
const shouldAddStartLine = shouldIndent && !hasLeadingOwnLineComment(options3.originalText, node);
|
|
242342
|
-
const code2 = [ifBreak([shouldAddStartLine ? line : "", "| "]),
|
|
242408
|
+
const code2 = [ifBreak([shouldAddStartLine ? line : "", "| "]), join29([line, "| "], printed)];
|
|
242343
242409
|
if (pathNeedsParens(path48, options3)) {
|
|
242344
242410
|
return group2([indent(code2), softline]);
|
|
242345
242411
|
}
|
|
@@ -242414,7 +242480,7 @@ ${fromBody}`;
|
|
|
242414
242480
|
} = require_comments();
|
|
242415
242481
|
var {
|
|
242416
242482
|
builders: {
|
|
242417
|
-
join:
|
|
242483
|
+
join: join29,
|
|
242418
242484
|
line,
|
|
242419
242485
|
hardline,
|
|
242420
242486
|
softline,
|
|
@@ -242456,10 +242522,10 @@ ${fromBody}`;
|
|
|
242456
242522
|
const isArrowFunctionVariable = path48.match((node2) => !(node2[paramsKey].length === 1 && isObjectType(node2[paramsKey][0])), void 0, (node2, name) => name === "typeAnnotation", (node2) => node2.type === "Identifier", isArrowFunctionVariableDeclarator);
|
|
242457
242523
|
const shouldInline = node[paramsKey].length === 0 || !isArrowFunctionVariable && (isParameterInTestCall || node[paramsKey].length === 1 && (node[paramsKey][0].type === "NullableTypeAnnotation" || shouldHugType(node[paramsKey][0])));
|
|
242458
242524
|
if (shouldInline) {
|
|
242459
|
-
return ["<",
|
|
242525
|
+
return ["<", join29(", ", path48.map(print, paramsKey)), printDanglingCommentsForInline(path48, options3), ">"];
|
|
242460
242526
|
}
|
|
242461
242527
|
const trailingComma = node.type === "TSTypeParameterInstantiation" ? "" : getFunctionParameters(node).length === 1 && isTSXFile(options3) && !node[paramsKey][0].constraint && path48.getParentNode().type === "ArrowFunctionExpression" ? "," : shouldPrintComma(options3, "all") ? ifBreak(",") : "";
|
|
242462
|
-
return group2(["<", indent([softline,
|
|
242528
|
+
return group2(["<", indent([softline, join29([",", line], path48.map(print, paramsKey))]), trailingComma, softline, ">"], {
|
|
242463
242529
|
id: getTypeParametersGroupId(node)
|
|
242464
242530
|
});
|
|
242465
242531
|
}
|
|
@@ -242597,7 +242663,7 @@ ${fromBody}`;
|
|
|
242597
242663
|
indent,
|
|
242598
242664
|
ifBreak,
|
|
242599
242665
|
hardline,
|
|
242600
|
-
join:
|
|
242666
|
+
join: join29,
|
|
242601
242667
|
indentIfBreak
|
|
242602
242668
|
},
|
|
242603
242669
|
utils: {
|
|
@@ -242753,7 +242819,7 @@ ${fromBody}`;
|
|
|
242753
242819
|
if (tailNode.body.type === "SequenceExpression") {
|
|
242754
242820
|
bodyDoc = group2(["(", indent([softline, bodyDoc]), softline, ")"]);
|
|
242755
242821
|
}
|
|
242756
|
-
return group2([group2(indent([isCallee || isAssignmentRhs ? softline : "", group2(
|
|
242822
|
+
return group2([group2(indent([isCallee || isAssignmentRhs ? softline : "", group2(join29([" =>", line], signatures), {
|
|
242757
242823
|
shouldBreak
|
|
242758
242824
|
})]), {
|
|
242759
242825
|
id: groupId,
|
|
@@ -242905,7 +242971,7 @@ ${fromBody}`;
|
|
|
242905
242971
|
builders: {
|
|
242906
242972
|
line,
|
|
242907
242973
|
hardline,
|
|
242908
|
-
join:
|
|
242974
|
+
join: join29,
|
|
242909
242975
|
breakParent,
|
|
242910
242976
|
group: group2
|
|
242911
242977
|
}
|
|
@@ -242919,10 +242985,10 @@ ${fromBody}`;
|
|
|
242919
242985
|
} = require_utils72();
|
|
242920
242986
|
function printClassMemberDecorators(path48, options3, print) {
|
|
242921
242987
|
const node = path48.getValue();
|
|
242922
|
-
return group2([
|
|
242988
|
+
return group2([join29(line, path48.map(print, "decorators")), hasNewlineBetweenOrAfterDecorators(node, options3) ? hardline : line]);
|
|
242923
242989
|
}
|
|
242924
242990
|
function printDecoratorsBeforeExport(path48, options3, print) {
|
|
242925
|
-
return [
|
|
242991
|
+
return [join29(hardline, path48.map(print, "declaration", "decorators")), hardline];
|
|
242926
242992
|
}
|
|
242927
242993
|
function printDecorators(path48, options3, print) {
|
|
242928
242994
|
const node = path48.getValue();
|
|
@@ -242933,7 +242999,7 @@ ${fromBody}`;
|
|
|
242933
242999
|
return;
|
|
242934
243000
|
}
|
|
242935
243001
|
const shouldBreak = node.type === "ClassExpression" || node.type === "ClassDeclaration" || hasNewlineBetweenOrAfterDecorators(node, options3);
|
|
242936
|
-
return [getParentExportDeclaration(path48) ? hardline : shouldBreak ? breakParent : "",
|
|
243002
|
+
return [getParentExportDeclaration(path48) ? hardline : shouldBreak ? breakParent : "", join29(line, path48.map(print, "decorators")), line];
|
|
242937
243003
|
}
|
|
242938
243004
|
function hasNewlineBetweenOrAfterDecorators(node, options3) {
|
|
242939
243005
|
return node.decorators.some((decorator) => hasNewline(options3.originalText, locEnd(decorator)));
|
|
@@ -242966,7 +243032,7 @@ ${fromBody}`;
|
|
|
242966
243032
|
} = require_comments();
|
|
242967
243033
|
var {
|
|
242968
243034
|
builders: {
|
|
242969
|
-
join:
|
|
243035
|
+
join: join29,
|
|
242970
243036
|
line,
|
|
242971
243037
|
hardline,
|
|
242972
243038
|
softline,
|
|
@@ -243066,7 +243132,7 @@ ${fromBody}`;
|
|
|
243066
243132
|
}) => marker === listName);
|
|
243067
243133
|
return [shouldIndentOnlyHeritageClauses(node) ? ifBreak(" ", line, {
|
|
243068
243134
|
groupId: getTypeParametersGroupId(node.typeParameters)
|
|
243069
|
-
}) : line, printedLeadingComments, printedLeadingComments && hardline, listName, group2(indent([line,
|
|
243135
|
+
}) : line, printedLeadingComments, printedLeadingComments && hardline, listName, group2(indent([line, join29([",", line], path48.map(print, listName))]))];
|
|
243070
243136
|
}
|
|
243071
243137
|
function printSuperClass(path48, options3, print) {
|
|
243072
243138
|
const printed = print("superClass");
|
|
@@ -243153,7 +243219,7 @@ ${fromBody}`;
|
|
|
243153
243219
|
} = require_util15();
|
|
243154
243220
|
var {
|
|
243155
243221
|
builders: {
|
|
243156
|
-
join:
|
|
243222
|
+
join: join29,
|
|
243157
243223
|
line,
|
|
243158
243224
|
group: group2,
|
|
243159
243225
|
indent,
|
|
@@ -243190,7 +243256,7 @@ ${fromBody}`;
|
|
|
243190
243256
|
if (isNonEmptyArray(node.extends)) {
|
|
243191
243257
|
extendsParts.push(shouldIndentOnlyHeritageClauses ? ifBreak(" ", line, {
|
|
243192
243258
|
groupId: getTypeParametersGroupId(node.typeParameters)
|
|
243193
|
-
}) : line, "extends ", (node.extends.length === 1 ? identity4 : indent)(
|
|
243259
|
+
}) : line, "extends ", (node.extends.length === 1 ? identity4 : indent)(join29([",", line], path48.map(print, "extends"))));
|
|
243194
243260
|
}
|
|
243195
243261
|
if (node.id && hasComment(node.id, CommentCheckFlags.Trailing) || isNonEmptyArray(node.extends)) {
|
|
243196
243262
|
if (shouldIndentOnlyHeritageClauses) {
|
|
@@ -243220,7 +243286,7 @@ ${fromBody}`;
|
|
|
243220
243286
|
softline,
|
|
243221
243287
|
group: group2,
|
|
243222
243288
|
indent,
|
|
243223
|
-
join:
|
|
243289
|
+
join: join29,
|
|
243224
243290
|
line,
|
|
243225
243291
|
ifBreak,
|
|
243226
243292
|
hardline
|
|
@@ -243361,14 +243427,14 @@ ${fromBody}`;
|
|
|
243361
243427
|
throw new Error(`Unknown specifier type ${JSON.stringify(specifierType)}`);
|
|
243362
243428
|
}
|
|
243363
243429
|
}, "specifiers");
|
|
243364
|
-
parts.push(
|
|
243430
|
+
parts.push(join29(", ", standaloneSpecifiers));
|
|
243365
243431
|
if (groupedSpecifiers.length > 0) {
|
|
243366
243432
|
if (standaloneSpecifiers.length > 0) {
|
|
243367
243433
|
parts.push(", ");
|
|
243368
243434
|
}
|
|
243369
243435
|
const canBreak = groupedSpecifiers.length > 1 || standaloneSpecifiers.length > 0 || node.specifiers.some((node2) => hasComment(node2));
|
|
243370
243436
|
if (canBreak) {
|
|
243371
|
-
parts.push(group2(["{", indent([options3.bracketSpacing ? line : softline,
|
|
243437
|
+
parts.push(group2(["{", indent([options3.bracketSpacing ? line : softline, join29([",", line], groupedSpecifiers)]), ifBreak(shouldPrintComma(options3) ? "," : ""), options3.bracketSpacing ? line : softline, "}"]));
|
|
243372
243438
|
} else {
|
|
243373
243439
|
parts.push(["{", options3.bracketSpacing ? " " : "", ...groupedSpecifiers, options3.bracketSpacing ? " " : "", "}"]);
|
|
243374
243440
|
}
|
|
@@ -243393,7 +243459,7 @@ ${fromBody}`;
|
|
|
243393
243459
|
function printImportAssertions(path48, options3, print) {
|
|
243394
243460
|
const node = path48.getNode();
|
|
243395
243461
|
if (isNonEmptyArray(node.assertions)) {
|
|
243396
|
-
return [" assert {", options3.bracketSpacing ? " " : "",
|
|
243462
|
+
return [" assert {", options3.bracketSpacing ? " " : "", join29(", ", path48.map(print, "assertions")), options3.bracketSpacing ? " " : "", "}"];
|
|
243397
243463
|
}
|
|
243398
243464
|
return "";
|
|
243399
243465
|
}
|
|
@@ -244304,7 +244370,7 @@ ${fromBody}`;
|
|
|
244304
244370
|
} = require_util15();
|
|
244305
244371
|
var {
|
|
244306
244372
|
builders: {
|
|
244307
|
-
join:
|
|
244373
|
+
join: join29,
|
|
244308
244374
|
line,
|
|
244309
244375
|
hardline,
|
|
244310
244376
|
softline,
|
|
@@ -244412,7 +244478,7 @@ ${fromBody}`;
|
|
|
244412
244478
|
case "TSTypeAliasDeclaration":
|
|
244413
244479
|
return printTypeAlias(path48, options3, print);
|
|
244414
244480
|
case "TSQualifiedName":
|
|
244415
|
-
return
|
|
244481
|
+
return join29(".", [print("left"), print("right")]);
|
|
244416
244482
|
case "TSAbstractMethodDefinition":
|
|
244417
244483
|
case "TSDeclareMethod":
|
|
244418
244484
|
return printClassMethod(path48, options3, print);
|
|
@@ -244491,7 +244557,7 @@ ${fromBody}`;
|
|
|
244491
244557
|
case "TSIndexSignature": {
|
|
244492
244558
|
const parent = path48.getParentNode();
|
|
244493
244559
|
const trailingComma = node.parameters.length > 1 ? ifBreak(shouldPrintComma(options3) ? "," : "") : "";
|
|
244494
|
-
const parametersGroup = group2([indent([softline,
|
|
244560
|
+
const parametersGroup = group2([indent([softline, join29([", ", softline], path48.map(print, "parameters"))]), trailingComma, softline]);
|
|
244495
244561
|
return [node.export ? "export " : "", node.accessibility ? [node.accessibility, " "] : "", node.static ? "static " : "", node.readonly ? "readonly " : "", node.declare ? "declare " : "", "[", node.parameters ? parametersGroup : "", node.typeAnnotation ? "]: " : "]", node.typeAnnotation ? print("typeAnnotation") : "", parent.type === "ClassBody" ? semi : ""];
|
|
244496
244562
|
}
|
|
244497
244563
|
case "TSTypePredicate":
|
|
@@ -244663,7 +244729,7 @@ ${fromBody}`;
|
|
|
244663
244729
|
} = require_util15();
|
|
244664
244730
|
var {
|
|
244665
244731
|
builders: {
|
|
244666
|
-
join:
|
|
244732
|
+
join: join29,
|
|
244667
244733
|
hardline
|
|
244668
244734
|
},
|
|
244669
244735
|
utils: {
|
|
@@ -244705,7 +244771,7 @@ ${fromBody}`;
|
|
|
244705
244771
|
}
|
|
244706
244772
|
function printIndentableBlockComment(comment2) {
|
|
244707
244773
|
const lines = comment2.value.split("\n");
|
|
244708
|
-
return ["/*",
|
|
244774
|
+
return ["/*", join29(hardline, lines.map((line, index) => index === 0 ? line.trimEnd() : " " + (index < lines.length - 1 ? line.trim() : line.trimStart()))), "*/"];
|
|
244709
244775
|
}
|
|
244710
244776
|
module22.exports = {
|
|
244711
244777
|
printComment
|
|
@@ -244798,7 +244864,7 @@ ${fromBody}`;
|
|
|
244798
244864
|
} = require_util15();
|
|
244799
244865
|
var {
|
|
244800
244866
|
builders: {
|
|
244801
|
-
join:
|
|
244867
|
+
join: join29,
|
|
244802
244868
|
line,
|
|
244803
244869
|
hardline,
|
|
244804
244870
|
softline,
|
|
@@ -245145,7 +245211,7 @@ ${fromBody}`;
|
|
|
245145
245211
|
}, "expressions");
|
|
245146
245212
|
return group2(parts2);
|
|
245147
245213
|
}
|
|
245148
|
-
return group2(
|
|
245214
|
+
return group2(join29([",", line], path48.map(print, "expressions")));
|
|
245149
245215
|
}
|
|
245150
245216
|
case "ThisExpression":
|
|
245151
245217
|
return "this";
|
|
@@ -245268,7 +245334,7 @@ ${fromBody}`;
|
|
|
245268
245334
|
}
|
|
245269
245335
|
return ["catch ", print("body")];
|
|
245270
245336
|
case "SwitchStatement":
|
|
245271
|
-
return [group2(["switch (", indent([softline, print("discriminant")]), softline, ")"]), " {", node.cases.length > 0 ? indent([hardline,
|
|
245337
|
+
return [group2(["switch (", indent([softline, print("discriminant")]), softline, ")"]), " {", node.cases.length > 0 ? indent([hardline, join29(hardline, path48.map((casePath, index, cases) => {
|
|
245272
245338
|
const caseNode = casePath.getValue();
|
|
245273
245339
|
return [print(), index !== cases.length - 1 && isNextLineEmpty(caseNode, options3) ? hardline : ""];
|
|
245274
245340
|
}, "cases"))]) : "", hardline, "}"];
|
|
@@ -245369,7 +245435,7 @@ ${fromBody}`;
|
|
|
245369
245435
|
builders: {
|
|
245370
245436
|
hardline,
|
|
245371
245437
|
indent,
|
|
245372
|
-
join:
|
|
245438
|
+
join: join29
|
|
245373
245439
|
}
|
|
245374
245440
|
} = require_doc();
|
|
245375
245441
|
var preprocess = require_print_preprocess();
|
|
@@ -245383,10 +245449,10 @@ ${fromBody}`;
|
|
|
245383
245449
|
return "[]";
|
|
245384
245450
|
}
|
|
245385
245451
|
const printed = path48.map(() => path48.getValue() === null ? "null" : print(), "elements");
|
|
245386
|
-
return ["[", indent([hardline,
|
|
245452
|
+
return ["[", indent([hardline, join29([",", hardline], printed)]), hardline, "]"];
|
|
245387
245453
|
}
|
|
245388
245454
|
case "ObjectExpression":
|
|
245389
|
-
return node.properties.length === 0 ? "{}" : ["{", indent([hardline,
|
|
245455
|
+
return node.properties.length === 0 ? "{}" : ["{", indent([hardline, join29([",", hardline], path48.map(print, "properties"))]), hardline, "}"];
|
|
245390
245456
|
case "ObjectProperty":
|
|
245391
245457
|
return [print("key"), ": ", print("value")];
|
|
245392
245458
|
case "UnaryExpression":
|
|
@@ -246672,7 +246738,7 @@ ${fromBody}`;
|
|
|
246672
246738
|
} = require_util15();
|
|
246673
246739
|
var {
|
|
246674
246740
|
builders: {
|
|
246675
|
-
join:
|
|
246741
|
+
join: join29,
|
|
246676
246742
|
line,
|
|
246677
246743
|
hardline,
|
|
246678
246744
|
softline,
|
|
@@ -246815,10 +246881,10 @@ ${fromBody}`;
|
|
|
246815
246881
|
}
|
|
246816
246882
|
parts.push(print());
|
|
246817
246883
|
}, "nodes");
|
|
246818
|
-
return group2(indent(
|
|
246884
|
+
return group2(indent(join29(line, parts)));
|
|
246819
246885
|
}
|
|
246820
246886
|
case "media-query": {
|
|
246821
|
-
return [
|
|
246887
|
+
return [join29(" ", path48.map(print, "nodes")), isLastNode(path48, node) ? "" : ","];
|
|
246822
246888
|
}
|
|
246823
246889
|
case "media-type": {
|
|
246824
246890
|
return adjustNumbers(adjustStrings(node.value, options3));
|
|
@@ -246848,7 +246914,7 @@ ${fromBody}`;
|
|
|
246848
246914
|
return node.value;
|
|
246849
246915
|
}
|
|
246850
246916
|
case "selector-root": {
|
|
246851
|
-
return group2([insideAtRuleNode(path48, "custom-selector") ? [getAncestorNode(path48, "css-atrule").customSelector, line] : "",
|
|
246917
|
+
return group2([insideAtRuleNode(path48, "custom-selector") ? [getAncestorNode(path48, "css-atrule").customSelector, line] : "", join29([",", insideAtRuleNode(path48, ["extend", "custom-selector", "nest"]) ? line : hardline], path48.map(print, "nodes"))]);
|
|
246852
246918
|
}
|
|
246853
246919
|
case "selector-selector": {
|
|
246854
246920
|
return group2(indent(path48.map(print, "nodes")));
|
|
@@ -246889,7 +246955,7 @@ ${fromBody}`;
|
|
|
246889
246955
|
return [node.namespace ? [node.namespace === true ? "" : node.namespace.trim(), "|"] : "", node.value];
|
|
246890
246956
|
}
|
|
246891
246957
|
case "selector-pseudo": {
|
|
246892
|
-
return [maybeToLowerCase(node.value), isNonEmptyArray(node.nodes) ? group2(["(", indent([softline,
|
|
246958
|
+
return [maybeToLowerCase(node.value), isNonEmptyArray(node.nodes) ? group2(["(", indent([softline, join29([",", line], path48.map(print, "nodes"))]), softline, ")"]) : ""];
|
|
246893
246959
|
}
|
|
246894
246960
|
case "selector-nesting": {
|
|
246895
246961
|
return node.value;
|
|
@@ -247085,7 +247151,7 @@ ${fromBody}`;
|
|
|
247085
247151
|
case "value-paren_group": {
|
|
247086
247152
|
const parentNode = path48.getParentNode();
|
|
247087
247153
|
if (parentNode && isURLFunctionNode(parentNode) && (node.groups.length === 1 || node.groups.length > 0 && node.groups[0].type === "value-comma_group" && node.groups[0].groups.length > 0 && node.groups[0].groups[0].type === "value-word" && node.groups[0].groups[0].value.startsWith("data:"))) {
|
|
247088
|
-
return [node.open ? print("open") : "",
|
|
247154
|
+
return [node.open ? print("open") : "", join29(",", path48.map(print, "groups")), node.close ? print("close") : ""];
|
|
247089
247155
|
}
|
|
247090
247156
|
if (!node.open) {
|
|
247091
247157
|
const printed2 = path48.map(print, "groups");
|
|
@@ -247105,7 +247171,7 @@ ${fromBody}`;
|
|
|
247105
247171
|
const isConfiguration = isConfigurationNode(node, parentNode);
|
|
247106
247172
|
const shouldBreak = isConfiguration || isSCSSMapItem && !isKey;
|
|
247107
247173
|
const shouldDedent = isConfiguration || isKey;
|
|
247108
|
-
const printed = group2([node.open ? print("open") : "", indent([softline,
|
|
247174
|
+
const printed = group2([node.open ? print("open") : "", indent([softline, join29([line], path48.map((childPath, index) => {
|
|
247109
247175
|
const child = childPath.getValue();
|
|
247110
247176
|
const isLast = index === node.groups.length - 1;
|
|
247111
247177
|
let printed2 = [print(), isLast ? "" : ","];
|
|
@@ -247477,7 +247543,7 @@ ${fromBody}`;
|
|
|
247477
247543
|
hardline,
|
|
247478
247544
|
ifBreak,
|
|
247479
247545
|
indent,
|
|
247480
|
-
join:
|
|
247546
|
+
join: join29,
|
|
247481
247547
|
line,
|
|
247482
247548
|
softline
|
|
247483
247549
|
},
|
|
@@ -247569,7 +247635,7 @@ ${fromBody}`;
|
|
|
247569
247635
|
return path48.map(print2, "parts");
|
|
247570
247636
|
}
|
|
247571
247637
|
case "Hash": {
|
|
247572
|
-
return
|
|
247638
|
+
return join29(line, path48.map(print2, "pairs"));
|
|
247573
247639
|
}
|
|
247574
247640
|
case "HashPair": {
|
|
247575
247641
|
return [node.key, "=", print2("value")];
|
|
@@ -247805,7 +247871,7 @@ ${fromBody}`;
|
|
|
247805
247871
|
if (isNonEmptyArray(node.program.blockParams)) {
|
|
247806
247872
|
parts.push(printBlockParams(node.program));
|
|
247807
247873
|
}
|
|
247808
|
-
return group2([printOpeningBlockOpeningMustache(node), printPath(path48, print2), parts.length > 0 ? indent([line,
|
|
247874
|
+
return group2([printOpeningBlockOpeningMustache(node), printPath(path48, print2), parts.length > 0 ? indent([line, join29(line, parts)]) : "", softline, printOpeningBlockClosingMustache(node)]);
|
|
247809
247875
|
}
|
|
247810
247876
|
function printElseBlock(node, options3) {
|
|
247811
247877
|
return [options3.htmlWhitespaceSensitivity === "ignore" ? hardline : "", printInverseBlockOpeningMustache(node), "else", printInverseBlockClosingMustache(node)];
|
|
@@ -247856,7 +247922,7 @@ ${fromBody}`;
|
|
|
247856
247922
|
return "";
|
|
247857
247923
|
}
|
|
247858
247924
|
function getTextValueParts(value) {
|
|
247859
|
-
return getDocParts(
|
|
247925
|
+
return getDocParts(join29(line, splitByHtmlWhitespace(value)));
|
|
247860
247926
|
}
|
|
247861
247927
|
function splitByHtmlWhitespace(string) {
|
|
247862
247928
|
return string.split(/[\t\n\f\r ]+/);
|
|
@@ -247940,7 +248006,7 @@ ${fromBody}`;
|
|
|
247940
248006
|
if (parts.length === 0) {
|
|
247941
248007
|
return "";
|
|
247942
248008
|
}
|
|
247943
|
-
return
|
|
248009
|
+
return join29(line, parts);
|
|
247944
248010
|
}
|
|
247945
248011
|
function printBlockParams(node) {
|
|
247946
248012
|
return ["as |", node.blockParams.join(" "), "|"];
|
|
@@ -248037,7 +248103,7 @@ ${fromBody}`;
|
|
|
248037
248103
|
"use strict";
|
|
248038
248104
|
var {
|
|
248039
248105
|
builders: {
|
|
248040
|
-
join:
|
|
248106
|
+
join: join29,
|
|
248041
248107
|
hardline,
|
|
248042
248108
|
line,
|
|
248043
248109
|
softline,
|
|
@@ -248082,16 +248148,16 @@ ${fromBody}`;
|
|
|
248082
248148
|
case "OperationDefinition": {
|
|
248083
248149
|
const hasOperation = options3.originalText[locStart(node)] !== "{";
|
|
248084
248150
|
const hasName2 = Boolean(node.name);
|
|
248085
|
-
return [hasOperation ? node.operation : "", hasOperation && hasName2 ? [" ", print("name")] : "", hasOperation && !hasName2 && isNonEmptyArray(node.variableDefinitions) ? " " : "", isNonEmptyArray(node.variableDefinitions) ? group2(["(", indent([softline,
|
|
248151
|
+
return [hasOperation ? node.operation : "", hasOperation && hasName2 ? [" ", print("name")] : "", hasOperation && !hasName2 && isNonEmptyArray(node.variableDefinitions) ? " " : "", isNonEmptyArray(node.variableDefinitions) ? group2(["(", indent([softline, join29([ifBreak("", ", "), softline], path48.map(print, "variableDefinitions"))]), softline, ")"]) : "", printDirectives(path48, print, node), node.selectionSet ? !hasOperation && !hasName2 ? "" : " " : "", print("selectionSet")];
|
|
248086
248152
|
}
|
|
248087
248153
|
case "FragmentDefinition": {
|
|
248088
|
-
return ["fragment ", print("name"), isNonEmptyArray(node.variableDefinitions) ? group2(["(", indent([softline,
|
|
248154
|
+
return ["fragment ", print("name"), isNonEmptyArray(node.variableDefinitions) ? group2(["(", indent([softline, join29([ifBreak("", ", "), softline], path48.map(print, "variableDefinitions"))]), softline, ")"]) : "", " on ", print("typeCondition"), printDirectives(path48, print, node), " ", print("selectionSet")];
|
|
248089
248155
|
}
|
|
248090
248156
|
case "SelectionSet": {
|
|
248091
|
-
return ["{", indent([hardline,
|
|
248157
|
+
return ["{", indent([hardline, join29(hardline, printSequence(path48, options3, print, "selections"))]), hardline, "}"];
|
|
248092
248158
|
}
|
|
248093
248159
|
case "Field": {
|
|
248094
|
-
return group2([node.alias ? [print("alias"), ": "] : "", print("name"), node.arguments.length > 0 ? group2(["(", indent([softline,
|
|
248160
|
+
return group2([node.alias ? [print("alias"), ": "] : "", print("name"), node.arguments.length > 0 ? group2(["(", indent([softline, join29([ifBreak("", ", "), softline], printSequence(path48, options3, print, "arguments"))]), softline, ")"]) : "", printDirectives(path48, print, node), node.selectionSet ? " " : "", print("selectionSet")]);
|
|
248095
248161
|
}
|
|
248096
248162
|
case "Name": {
|
|
248097
248163
|
return node.value;
|
|
@@ -248105,7 +248171,7 @@ ${fromBody}`;
|
|
|
248105
248171
|
if (lines.every((line2) => line2 === "")) {
|
|
248106
248172
|
lines.length = 0;
|
|
248107
248173
|
}
|
|
248108
|
-
return
|
|
248174
|
+
return join29(hardline, ['"""', ...lines, '"""']);
|
|
248109
248175
|
}
|
|
248110
248176
|
return ['"', node.value.replace(/["\\]/g, "\\$&").replace(/\n/g, "\\n"), '"'];
|
|
248111
248177
|
}
|
|
@@ -248124,17 +248190,17 @@ ${fromBody}`;
|
|
|
248124
248190
|
return ["$", print("name")];
|
|
248125
248191
|
}
|
|
248126
248192
|
case "ListValue": {
|
|
248127
|
-
return group2(["[", indent([softline,
|
|
248193
|
+
return group2(["[", indent([softline, join29([ifBreak("", ", "), softline], path48.map(print, "values"))]), softline, "]"]);
|
|
248128
248194
|
}
|
|
248129
248195
|
case "ObjectValue": {
|
|
248130
|
-
return group2(["{", options3.bracketSpacing && node.fields.length > 0 ? " " : "", indent([softline,
|
|
248196
|
+
return group2(["{", options3.bracketSpacing && node.fields.length > 0 ? " " : "", indent([softline, join29([ifBreak("", ", "), softline], path48.map(print, "fields"))]), softline, ifBreak("", options3.bracketSpacing && node.fields.length > 0 ? " " : ""), "}"]);
|
|
248131
248197
|
}
|
|
248132
248198
|
case "ObjectField":
|
|
248133
248199
|
case "Argument": {
|
|
248134
248200
|
return [print("name"), ": ", print("value")];
|
|
248135
248201
|
}
|
|
248136
248202
|
case "Directive": {
|
|
248137
|
-
return ["@", print("name"), node.arguments.length > 0 ? group2(["(", indent([softline,
|
|
248203
|
+
return ["@", print("name"), node.arguments.length > 0 ? group2(["(", indent([softline, join29([ifBreak("", ", "), softline], printSequence(path48, options3, print, "arguments"))]), softline, ")"]) : ""];
|
|
248138
248204
|
}
|
|
248139
248205
|
case "NamedType": {
|
|
248140
248206
|
return print("name");
|
|
@@ -248144,17 +248210,17 @@ ${fromBody}`;
|
|
|
248144
248210
|
}
|
|
248145
248211
|
case "ObjectTypeExtension":
|
|
248146
248212
|
case "ObjectTypeDefinition": {
|
|
248147
|
-
return [print("description"), node.description ? hardline : "", node.kind === "ObjectTypeExtension" ? "extend " : "", "type ", print("name"), node.interfaces.length > 0 ? [" implements ", ...printInterfaces(path48, options3, print)] : "", printDirectives(path48, print, node), node.fields.length > 0 ? [" {", indent([hardline,
|
|
248213
|
+
return [print("description"), node.description ? hardline : "", node.kind === "ObjectTypeExtension" ? "extend " : "", "type ", print("name"), node.interfaces.length > 0 ? [" implements ", ...printInterfaces(path48, options3, print)] : "", printDirectives(path48, print, node), node.fields.length > 0 ? [" {", indent([hardline, join29(hardline, printSequence(path48, options3, print, "fields"))]), hardline, "}"] : ""];
|
|
248148
248214
|
}
|
|
248149
248215
|
case "FieldDefinition": {
|
|
248150
|
-
return [print("description"), node.description ? hardline : "", print("name"), node.arguments.length > 0 ? group2(["(", indent([softline,
|
|
248216
|
+
return [print("description"), node.description ? hardline : "", print("name"), node.arguments.length > 0 ? group2(["(", indent([softline, join29([ifBreak("", ", "), softline], printSequence(path48, options3, print, "arguments"))]), softline, ")"]) : "", ": ", print("type"), printDirectives(path48, print, node)];
|
|
248151
248217
|
}
|
|
248152
248218
|
case "DirectiveDefinition": {
|
|
248153
|
-
return [print("description"), node.description ? hardline : "", "directive ", "@", print("name"), node.arguments.length > 0 ? group2(["(", indent([softline,
|
|
248219
|
+
return [print("description"), node.description ? hardline : "", "directive ", "@", print("name"), node.arguments.length > 0 ? group2(["(", indent([softline, join29([ifBreak("", ", "), softline], printSequence(path48, options3, print, "arguments"))]), softline, ")"]) : "", node.repeatable ? " repeatable" : "", " on ", join29(" | ", path48.map(print, "locations"))];
|
|
248154
248220
|
}
|
|
248155
248221
|
case "EnumTypeExtension":
|
|
248156
248222
|
case "EnumTypeDefinition": {
|
|
248157
|
-
return [print("description"), node.description ? hardline : "", node.kind === "EnumTypeExtension" ? "extend " : "", "enum ", print("name"), printDirectives(path48, print, node), node.values.length > 0 ? [" {", indent([hardline,
|
|
248223
|
+
return [print("description"), node.description ? hardline : "", node.kind === "EnumTypeExtension" ? "extend " : "", "enum ", print("name"), printDirectives(path48, print, node), node.values.length > 0 ? [" {", indent([hardline, join29(hardline, printSequence(path48, options3, print, "values"))]), hardline, "}"] : ""];
|
|
248158
248224
|
}
|
|
248159
248225
|
case "EnumValueDefinition": {
|
|
248160
248226
|
return [print("description"), node.description ? hardline : "", print("name"), printDirectives(path48, print, node)];
|
|
@@ -248164,20 +248230,20 @@ ${fromBody}`;
|
|
|
248164
248230
|
}
|
|
248165
248231
|
case "InputObjectTypeExtension":
|
|
248166
248232
|
case "InputObjectTypeDefinition": {
|
|
248167
|
-
return [print("description"), node.description ? hardline : "", node.kind === "InputObjectTypeExtension" ? "extend " : "", "input ", print("name"), printDirectives(path48, print, node), node.fields.length > 0 ? [" {", indent([hardline,
|
|
248233
|
+
return [print("description"), node.description ? hardline : "", node.kind === "InputObjectTypeExtension" ? "extend " : "", "input ", print("name"), printDirectives(path48, print, node), node.fields.length > 0 ? [" {", indent([hardline, join29(hardline, printSequence(path48, options3, print, "fields"))]), hardline, "}"] : ""];
|
|
248168
248234
|
}
|
|
248169
248235
|
case "SchemaExtension": {
|
|
248170
|
-
return ["extend schema", printDirectives(path48, print, node), ...node.operationTypes.length > 0 ? [" {", indent([hardline,
|
|
248236
|
+
return ["extend schema", printDirectives(path48, print, node), ...node.operationTypes.length > 0 ? [" {", indent([hardline, join29(hardline, printSequence(path48, options3, print, "operationTypes"))]), hardline, "}"] : []];
|
|
248171
248237
|
}
|
|
248172
248238
|
case "SchemaDefinition": {
|
|
248173
|
-
return [print("description"), node.description ? hardline : "", "schema", printDirectives(path48, print, node), " {", node.operationTypes.length > 0 ? indent([hardline,
|
|
248239
|
+
return [print("description"), node.description ? hardline : "", "schema", printDirectives(path48, print, node), " {", node.operationTypes.length > 0 ? indent([hardline, join29(hardline, printSequence(path48, options3, print, "operationTypes"))]) : "", hardline, "}"];
|
|
248174
248240
|
}
|
|
248175
248241
|
case "OperationTypeDefinition": {
|
|
248176
248242
|
return [print("operation"), ": ", print("type")];
|
|
248177
248243
|
}
|
|
248178
248244
|
case "InterfaceTypeExtension":
|
|
248179
248245
|
case "InterfaceTypeDefinition": {
|
|
248180
|
-
return [print("description"), node.description ? hardline : "", node.kind === "InterfaceTypeExtension" ? "extend " : "", "interface ", print("name"), node.interfaces.length > 0 ? [" implements ", ...printInterfaces(path48, options3, print)] : "", printDirectives(path48, print, node), node.fields.length > 0 ? [" {", indent([hardline,
|
|
248246
|
+
return [print("description"), node.description ? hardline : "", node.kind === "InterfaceTypeExtension" ? "extend " : "", "interface ", print("name"), node.interfaces.length > 0 ? [" implements ", ...printInterfaces(path48, options3, print)] : "", printDirectives(path48, print, node), node.fields.length > 0 ? [" {", indent([hardline, join29(hardline, printSequence(path48, options3, print, "fields"))]), hardline, "}"] : ""];
|
|
248181
248247
|
}
|
|
248182
248248
|
case "FragmentSpread": {
|
|
248183
248249
|
return ["...", print("name"), printDirectives(path48, print, node)];
|
|
@@ -248187,7 +248253,7 @@ ${fromBody}`;
|
|
|
248187
248253
|
}
|
|
248188
248254
|
case "UnionTypeExtension":
|
|
248189
248255
|
case "UnionTypeDefinition": {
|
|
248190
|
-
return group2([print("description"), node.description ? hardline : "", group2([node.kind === "UnionTypeExtension" ? "extend " : "", "union ", print("name"), printDirectives(path48, print, node), node.types.length > 0 ? [" =", ifBreak("", " "), indent([ifBreak([line, " "]),
|
|
248256
|
+
return group2([print("description"), node.description ? hardline : "", group2([node.kind === "UnionTypeExtension" ? "extend " : "", "union ", print("name"), printDirectives(path48, print, node), node.types.length > 0 ? [" =", ifBreak("", " "), indent([ifBreak([line, " "]), join29([line, "| "], path48.map(print, "types"))])] : ""])]);
|
|
248191
248257
|
}
|
|
248192
248258
|
case "ScalarTypeExtension":
|
|
248193
248259
|
case "ScalarTypeDefinition": {
|
|
@@ -248207,7 +248273,7 @@ ${fromBody}`;
|
|
|
248207
248273
|
if (node.directives.length === 0) {
|
|
248208
248274
|
return "";
|
|
248209
248275
|
}
|
|
248210
|
-
const printed =
|
|
248276
|
+
const printed = join29(line, path48.map(print, "directives"));
|
|
248211
248277
|
if (node.kind === "FragmentDefinition" || node.kind === "OperationDefinition") {
|
|
248212
248278
|
return group2([line, printed]);
|
|
248213
248279
|
}
|
|
@@ -248843,7 +248909,7 @@ ${extracted.content}`;
|
|
|
248843
248909
|
var {
|
|
248844
248910
|
builders: {
|
|
248845
248911
|
breakParent,
|
|
248846
|
-
join:
|
|
248912
|
+
join: join29,
|
|
248847
248913
|
line,
|
|
248848
248914
|
literalline,
|
|
248849
248915
|
markAsRoot,
|
|
@@ -249144,9 +249210,9 @@ ${extracted.content}`;
|
|
|
249144
249210
|
function printTableContents(isCompact) {
|
|
249145
249211
|
const parts = [printRow(contents[0], isCompact), printAlign(isCompact)];
|
|
249146
249212
|
if (contents.length > 1) {
|
|
249147
|
-
parts.push(
|
|
249213
|
+
parts.push(join29(hardlineWithoutBreakParent, contents.slice(1).map((rowContents) => printRow(rowContents, isCompact))));
|
|
249148
249214
|
}
|
|
249149
|
-
return
|
|
249215
|
+
return join29(hardlineWithoutBreakParent, parts);
|
|
249150
249216
|
}
|
|
249151
249217
|
function printAlign(isCompact) {
|
|
249152
249218
|
const align2 = columnMaxWidths.map((width, index) => {
|
|
@@ -249597,7 +249663,7 @@ ${extracted.content}`;
|
|
|
249597
249663
|
builders: {
|
|
249598
249664
|
line,
|
|
249599
249665
|
hardline,
|
|
249600
|
-
join:
|
|
249666
|
+
join: join29
|
|
249601
249667
|
},
|
|
249602
249668
|
utils: {
|
|
249603
249669
|
getDocParts,
|
|
@@ -249951,7 +250017,7 @@ ${extracted.content}`;
|
|
|
249951
250017
|
return tagName === "script" && attributeName === "setup" || tagName === "style" && attributeName === "vars";
|
|
249952
250018
|
}
|
|
249953
250019
|
function getTextValueParts(node, value = node.value) {
|
|
249954
|
-
return node.parent.isWhitespaceSensitive ? node.parent.isIndentationSensitive ? replaceTextEndOfLine(value) : replaceTextEndOfLine(dedentString(htmlTrimPreserveIndentation(value)), hardline) : getDocParts(
|
|
250020
|
+
return node.parent.isWhitespaceSensitive ? node.parent.isIndentationSensitive ? replaceTextEndOfLine(value) : replaceTextEndOfLine(dedentString(htmlTrimPreserveIndentation(value)), hardline) : getDocParts(join29(line, splitByHtmlWhitespace(value)));
|
|
249955
250021
|
}
|
|
249956
250022
|
function isVueScriptTag(node, options3) {
|
|
249957
250023
|
return isVueSfcBlock(node, options3) && node.name === "script";
|
|
@@ -251246,7 +251312,7 @@ ${extracted.content}`;
|
|
|
251246
251312
|
var {
|
|
251247
251313
|
builders: {
|
|
251248
251314
|
indent,
|
|
251249
|
-
join:
|
|
251315
|
+
join: join29,
|
|
251250
251316
|
line,
|
|
251251
251317
|
softline,
|
|
251252
251318
|
hardline
|
|
@@ -251360,7 +251426,7 @@ ${extracted.content}`;
|
|
|
251360
251426
|
const forceNotToBreakAttrContent = node.type === "element" && node.fullName === "script" && node.attrs.length === 1 && node.attrs[0].fullName === "src" && node.children.length === 0;
|
|
251361
251427
|
const shouldPrintAttributePerLine = options3.singleAttributePerLine && node.attrs.length > 1 && !isVueSfcBlock(node, options3);
|
|
251362
251428
|
const attributeLine = shouldPrintAttributePerLine ? hardline : line;
|
|
251363
|
-
const parts = [indent([forceNotToBreakAttrContent ? " " : line,
|
|
251429
|
+
const parts = [indent([forceNotToBreakAttrContent ? " " : line, join29(attributeLine, printedAttributes)])];
|
|
251364
251430
|
if (node.firstChild && needsToBorrowParentOpeningTagEndMarker(node.firstChild) || node.isSelfClosing && needsToBorrowLastChildClosingTagEndMarker(node.parent) || forceNotToBreakAttrContent) {
|
|
251365
251431
|
parts.push(node.isSelfClosing ? " " : "");
|
|
251366
251432
|
} else {
|
|
@@ -251594,7 +251660,7 @@ ${extracted.content}`;
|
|
|
251594
251660
|
var {
|
|
251595
251661
|
builders: {
|
|
251596
251662
|
ifBreak,
|
|
251597
|
-
join:
|
|
251663
|
+
join: join29,
|
|
251598
251664
|
line
|
|
251599
251665
|
}
|
|
251600
251666
|
} = require_doc();
|
|
@@ -251629,7 +251695,7 @@ ${extracted.content}`;
|
|
|
251629
251695
|
return index === -1 ? descriptor.length : index;
|
|
251630
251696
|
});
|
|
251631
251697
|
const maxDescriptorLeftLength = getMax(descriptorLeftLengths);
|
|
251632
|
-
return
|
|
251698
|
+
return join29([",", line], urls.map((url, index) => {
|
|
251633
251699
|
const parts = [url];
|
|
251634
251700
|
const descriptor = descriptors[index];
|
|
251635
251701
|
if (descriptor) {
|
|
@@ -252803,7 +252869,7 @@ ${text2}`;
|
|
|
252803
252869
|
line,
|
|
252804
252870
|
softline,
|
|
252805
252871
|
hardline,
|
|
252806
|
-
join:
|
|
252872
|
+
join: join29
|
|
252807
252873
|
}
|
|
252808
252874
|
} = require_doc();
|
|
252809
252875
|
var {
|
|
@@ -252826,7 +252892,7 @@ ${text2}`;
|
|
|
252826
252892
|
}
|
|
252827
252893
|
const lastItem = getLast(node.children);
|
|
252828
252894
|
const isLastItemEmptyMappingItem = lastItem && lastItem.type === "flowMappingItem" && isEmptyNode(lastItem.key) && isEmptyNode(lastItem.value);
|
|
252829
|
-
return [openMarker, alignWithSpaces(options3.tabWidth, [bracketSpacing, printChildren(path48, print, options3), options3.trailingComma === "none" ? "" : ifBreak(","), hasEndComments(node) ? [hardline,
|
|
252895
|
+
return [openMarker, alignWithSpaces(options3.tabWidth, [bracketSpacing, printChildren(path48, print, options3), options3.trailingComma === "none" ? "" : ifBreak(","), hasEndComments(node) ? [hardline, join29(hardline, path48.map(print, "endComments"))] : ""]), isLastItemEmptyMappingItem ? "" : bracketSpacing, closeMarker];
|
|
252830
252896
|
}
|
|
252831
252897
|
function printChildren(path48, print, options3) {
|
|
252832
252898
|
const node = path48.getValue();
|
|
@@ -252848,7 +252914,7 @@ ${text2}`;
|
|
|
252848
252914
|
group: group2,
|
|
252849
252915
|
hardline,
|
|
252850
252916
|
ifBreak,
|
|
252851
|
-
join:
|
|
252917
|
+
join: join29,
|
|
252852
252918
|
line
|
|
252853
252919
|
}
|
|
252854
252920
|
} = require_doc();
|
|
@@ -252890,7 +252956,7 @@ ${text2}`;
|
|
|
252890
252956
|
return [": ", alignWithSpaces(2, printedValue)];
|
|
252891
252957
|
}
|
|
252892
252958
|
if (hasLeadingComments(value) || !isInlineNode(key.content)) {
|
|
252893
|
-
return ["? ", alignWithSpaces(2, printedKey), hardline,
|
|
252959
|
+
return ["? ", alignWithSpaces(2, printedKey), hardline, join29("", path48.map(print, "value", "leadingComments").map((comment2) => [comment2, hardline])), ": ", alignWithSpaces(2, printedValue)];
|
|
252894
252960
|
}
|
|
252895
252961
|
if (isSingleLineNode(key.content) && !hasLeadingComments(key.content) && !hasMiddleComments(key.content) && !hasTrailingComment(key.content) && !hasEndComments(key) && !hasLeadingComments(value.content) && !hasMiddleComments(value.content) && !hasEndComments(value) && isAbsolutelyPrintedAsSingleLineNode(value.content, options3)) {
|
|
252896
252962
|
return [printedKey, spaceBeforeColon, ": ", printedValue];
|
|
@@ -252974,7 +253040,7 @@ ${text2}`;
|
|
|
252974
253040
|
dedentToRoot,
|
|
252975
253041
|
fill,
|
|
252976
253042
|
hardline,
|
|
252977
|
-
join:
|
|
253043
|
+
join: join29,
|
|
252978
253044
|
line,
|
|
252979
253045
|
literalline,
|
|
252980
253046
|
markAsRoot
|
|
@@ -253017,7 +253083,7 @@ ${text2}`;
|
|
|
253017
253083
|
if (index === 0) {
|
|
253018
253084
|
contentsParts.push(hardline);
|
|
253019
253085
|
}
|
|
253020
|
-
contentsParts.push(fill(getDocParts(
|
|
253086
|
+
contentsParts.push(fill(getDocParts(join29(line, lineWords))));
|
|
253021
253087
|
if (index !== lineContents.length - 1) {
|
|
253022
253088
|
contentsParts.push(lineWords.length === 0 ? hardline : markAsRoot(literalline));
|
|
253023
253089
|
} else if (node.chomping === "keep" && isLastDescendant) {
|
|
@@ -253043,7 +253109,7 @@ ${text2}`;
|
|
|
253043
253109
|
fill,
|
|
253044
253110
|
group: group2,
|
|
253045
253111
|
hardline,
|
|
253046
|
-
join:
|
|
253112
|
+
join: join29,
|
|
253047
253113
|
line,
|
|
253048
253114
|
lineSuffix,
|
|
253049
253115
|
literalline
|
|
@@ -253092,7 +253158,7 @@ ${text2}`;
|
|
|
253092
253158
|
const node = path48.getValue();
|
|
253093
253159
|
const parts = [];
|
|
253094
253160
|
if (node.type !== "mappingValue" && hasLeadingComments(node)) {
|
|
253095
|
-
parts.push([
|
|
253161
|
+
parts.push([join29(hardline, path48.map(print, "leadingComments")), hardline]);
|
|
253096
253162
|
}
|
|
253097
253163
|
const {
|
|
253098
253164
|
tag: tag2,
|
|
@@ -253119,7 +253185,7 @@ ${text2}`;
|
|
|
253119
253185
|
}
|
|
253120
253186
|
}
|
|
253121
253187
|
if (hasMiddleComments(node)) {
|
|
253122
|
-
parts.push([node.middleComments.length === 1 ? "" : hardline,
|
|
253188
|
+
parts.push([node.middleComments.length === 1 ? "" : hardline, join29(hardline, path48.map(print, "middleComments")), hardline]);
|
|
253123
253189
|
}
|
|
253124
253190
|
const parentNode = path48.getParentNode();
|
|
253125
253191
|
if (hasPrettierIgnore(path48)) {
|
|
@@ -253131,7 +253197,7 @@ ${text2}`;
|
|
|
253131
253197
|
parts.push(lineSuffix([node.type === "mappingValue" && !node.content ? "" : " ", parentNode.type === "mappingKey" && path48.getParentNode(2).type === "mapping" && isInlineNode(node) ? "" : breakParent, print("trailingComment")]));
|
|
253132
253198
|
}
|
|
253133
253199
|
if (shouldPrintEndComments(node)) {
|
|
253134
|
-
parts.push(alignWithSpaces(node.type === "sequenceItem" ? 2 : 0, [hardline,
|
|
253200
|
+
parts.push(alignWithSpaces(node.type === "sequenceItem" ? 2 : 0, [hardline, join29(hardline, path48.map((path210) => [isPreviousLineEmpty(options3.originalText, path210.getValue(), locStart) ? hardline : "", print()], "endComments"))]));
|
|
253135
253201
|
}
|
|
253136
253202
|
parts.push(nextEmptyLine);
|
|
253137
253203
|
return parts;
|
|
@@ -253181,10 +253247,10 @@ ${text2}`;
|
|
|
253181
253247
|
if (shouldPrintDocumentBody(node)) {
|
|
253182
253248
|
parts.push(print("body"));
|
|
253183
253249
|
}
|
|
253184
|
-
return
|
|
253250
|
+
return join29(hardline, parts);
|
|
253185
253251
|
}
|
|
253186
253252
|
case "documentHead":
|
|
253187
|
-
return
|
|
253253
|
+
return join29(hardline, [...path48.map(print, "children"), ...path48.map(print, "endComments")]);
|
|
253188
253254
|
case "documentBody": {
|
|
253189
253255
|
const {
|
|
253190
253256
|
children,
|
|
@@ -253201,10 +253267,10 @@ ${text2}`;
|
|
|
253201
253267
|
separator = hardline;
|
|
253202
253268
|
}
|
|
253203
253269
|
}
|
|
253204
|
-
return [
|
|
253270
|
+
return [join29(hardline, path48.map(print, "children")), separator, join29(hardline, path48.map(print, "endComments"))];
|
|
253205
253271
|
}
|
|
253206
253272
|
case "directive":
|
|
253207
|
-
return ["%",
|
|
253273
|
+
return ["%", join29(" ", [node.name, ...node.parameters])];
|
|
253208
253274
|
case "comment":
|
|
253209
253275
|
return ["#", node.value];
|
|
253210
253276
|
case "alias":
|
|
@@ -253239,7 +253305,7 @@ ${text2}`;
|
|
|
253239
253305
|
}
|
|
253240
253306
|
case "mapping":
|
|
253241
253307
|
case "sequence":
|
|
253242
|
-
return
|
|
253308
|
+
return join29(hardline, path48.map(print, "children"));
|
|
253243
253309
|
case "sequenceItem":
|
|
253244
253310
|
return ["- ", alignWithSpaces(2, node.content ? print("content") : "")];
|
|
253245
253311
|
case "mappingKey":
|
|
@@ -253276,7 +253342,7 @@ ${text2}`;
|
|
|
253276
253342
|
}
|
|
253277
253343
|
function printFlowScalarContent(nodeType, content, options3) {
|
|
253278
253344
|
const lineContents = getFlowScalarLineContents(nodeType, content, options3);
|
|
253279
|
-
return
|
|
253345
|
+
return join29(hardline, lineContents.map((lineContentWords) => fill(getDocParts(join29(line, lineContentWords)))));
|
|
253280
253346
|
}
|
|
253281
253347
|
function clean(node, newNode) {
|
|
253282
253348
|
if (isNode5(newNode)) {
|
|
@@ -263409,7 +263475,7 @@ var require_BufferList = __commonJS({
|
|
|
263409
263475
|
this.head = this.tail = null;
|
|
263410
263476
|
this.length = 0;
|
|
263411
263477
|
};
|
|
263412
|
-
BufferList.prototype.join = function
|
|
263478
|
+
BufferList.prototype.join = function join29(s) {
|
|
263413
263479
|
if (this.length === 0) return "";
|
|
263414
263480
|
var p = this.head;
|
|
263415
263481
|
var ret2 = "" + p.data;
|
|
@@ -317457,7 +317523,7 @@ var require_xlsx = __commonJS({
|
|
|
317457
317523
|
if (DBF_SUPPORTED_VERSIONS.indexOf(n[0]) > -1 && n[2] <= 12 && n[3] <= 31) return DBF.to_workbook(d, o);
|
|
317458
317524
|
return read_prn(data, d, o, str2);
|
|
317459
317525
|
}
|
|
317460
|
-
function
|
|
317526
|
+
function readFileSync20(filename, opts) {
|
|
317461
317527
|
var o = opts || {};
|
|
317462
317528
|
o.type = "file";
|
|
317463
317529
|
return readSync(filename, o);
|
|
@@ -317692,7 +317758,7 @@ var require_xlsx = __commonJS({
|
|
|
317692
317758
|
if (ext.match(/^\.[a-z]+$/)) o.bookType = ext.slice(1);
|
|
317693
317759
|
o.bookType = _BT[o.bookType] || o.bookType;
|
|
317694
317760
|
}
|
|
317695
|
-
function
|
|
317761
|
+
function writeFileSync14(wb, filename, opts) {
|
|
317696
317762
|
var o = opts || {};
|
|
317697
317763
|
o.type = "file";
|
|
317698
317764
|
o.file = filename;
|
|
@@ -318293,11 +318359,11 @@ var require_xlsx = __commonJS({
|
|
|
318293
318359
|
if (typeof parse_xlscfb !== "undefined") XLSX3.parse_xlscfb = parse_xlscfb;
|
|
318294
318360
|
XLSX3.parse_zip = parse_zip;
|
|
318295
318361
|
XLSX3.read = readSync;
|
|
318296
|
-
XLSX3.readFile =
|
|
318297
|
-
XLSX3.readFileSync =
|
|
318362
|
+
XLSX3.readFile = readFileSync20;
|
|
318363
|
+
XLSX3.readFileSync = readFileSync20;
|
|
318298
318364
|
XLSX3.write = writeSync;
|
|
318299
|
-
XLSX3.writeFile =
|
|
318300
|
-
XLSX3.writeFileSync =
|
|
318365
|
+
XLSX3.writeFile = writeFileSync14;
|
|
318366
|
+
XLSX3.writeFileSync = writeFileSync14;
|
|
318301
318367
|
XLSX3.writeFileAsync = writeFileAsync;
|
|
318302
318368
|
XLSX3.utils = utils2;
|
|
318303
318369
|
XLSX3.writeXLSX = writeSyncXLSX;
|
|
@@ -320026,7 +320092,7 @@ var init_pdf = __esm({
|
|
|
320026
320092
|
var defineProperty = Object.defineProperty;
|
|
320027
320093
|
var stringSlice = uncurryThis("".slice);
|
|
320028
320094
|
var replace2 = uncurryThis("".replace);
|
|
320029
|
-
var
|
|
320095
|
+
var join29 = uncurryThis([].join);
|
|
320030
320096
|
var CONFIGURABLE_LENGTH = DESCRIPTORS && !fails(function() {
|
|
320031
320097
|
return defineProperty(function() {
|
|
320032
320098
|
}, "length", { value: 8 }).length !== 8;
|
|
@@ -320053,7 +320119,7 @@ var init_pdf = __esm({
|
|
|
320053
320119
|
}
|
|
320054
320120
|
var state = enforceInternalState(value);
|
|
320055
320121
|
if (!hasOwn(state, "source")) {
|
|
320056
|
-
state.source =
|
|
320122
|
+
state.source = join29(TEMPLATE, typeof name == "string" ? name : "");
|
|
320057
320123
|
}
|
|
320058
320124
|
return value;
|
|
320059
320125
|
};
|
|
@@ -405024,7 +405090,7 @@ var require_util12 = __commonJS({
|
|
|
405024
405090
|
return path48;
|
|
405025
405091
|
}
|
|
405026
405092
|
exports2.normalize = normalize5;
|
|
405027
|
-
function
|
|
405093
|
+
function join29(aRoot, aPath) {
|
|
405028
405094
|
if (aRoot === "") {
|
|
405029
405095
|
aRoot = ".";
|
|
405030
405096
|
}
|
|
@@ -405056,7 +405122,7 @@ var require_util12 = __commonJS({
|
|
|
405056
405122
|
}
|
|
405057
405123
|
return joined;
|
|
405058
405124
|
}
|
|
405059
|
-
exports2.join =
|
|
405125
|
+
exports2.join = join29;
|
|
405060
405126
|
exports2.isAbsolute = function(aPath) {
|
|
405061
405127
|
return aPath.charAt(0) === "/" || urlRegexp.test(aPath);
|
|
405062
405128
|
};
|
|
@@ -405229,7 +405295,7 @@ var require_util12 = __commonJS({
|
|
|
405229
405295
|
parsed.path = parsed.path.substring(0, index + 1);
|
|
405230
405296
|
}
|
|
405231
405297
|
}
|
|
405232
|
-
sourceURL =
|
|
405298
|
+
sourceURL = join29(urlGenerate(parsed), sourceURL);
|
|
405233
405299
|
}
|
|
405234
405300
|
return normalize5(sourceURL);
|
|
405235
405301
|
}
|
|
@@ -407031,7 +407097,7 @@ var require_escodegen = __commonJS({
|
|
|
407031
407097
|
function noEmptySpace() {
|
|
407032
407098
|
return space ? space : " ";
|
|
407033
407099
|
}
|
|
407034
|
-
function
|
|
407100
|
+
function join29(left, right) {
|
|
407035
407101
|
var leftSource, rightSource, leftCharCode, rightCharCode;
|
|
407036
407102
|
leftSource = toSourceNodeWhenNeeded(left).toString();
|
|
407037
407103
|
if (leftSource.length === 0) {
|
|
@@ -407362,8 +407428,8 @@ var require_escodegen = __commonJS({
|
|
|
407362
407428
|
} else {
|
|
407363
407429
|
result2.push(that.generateExpression(stmt.left, Precedence.Call, E_TTT));
|
|
407364
407430
|
}
|
|
407365
|
-
result2 =
|
|
407366
|
-
result2 = [
|
|
407431
|
+
result2 = join29(result2, operator);
|
|
407432
|
+
result2 = [join29(
|
|
407367
407433
|
result2,
|
|
407368
407434
|
that.generateExpression(stmt.right, Precedence.Assignment, E_TTT)
|
|
407369
407435
|
), ")"];
|
|
@@ -407506,11 +407572,11 @@ var require_escodegen = __commonJS({
|
|
|
407506
407572
|
var result2, fragment;
|
|
407507
407573
|
result2 = ["class"];
|
|
407508
407574
|
if (stmt.id) {
|
|
407509
|
-
result2 =
|
|
407575
|
+
result2 = join29(result2, this.generateExpression(stmt.id, Precedence.Sequence, E_TTT));
|
|
407510
407576
|
}
|
|
407511
407577
|
if (stmt.superClass) {
|
|
407512
|
-
fragment =
|
|
407513
|
-
result2 =
|
|
407578
|
+
fragment = join29("extends", this.generateExpression(stmt.superClass, Precedence.Unary, E_TTT));
|
|
407579
|
+
result2 = join29(result2, fragment);
|
|
407514
407580
|
}
|
|
407515
407581
|
result2.push(space);
|
|
407516
407582
|
result2.push(this.generateStatement(stmt.body, S_TFFT));
|
|
@@ -407523,9 +407589,9 @@ var require_escodegen = __commonJS({
|
|
|
407523
407589
|
return escapeDirective(stmt.directive) + this.semicolon(flags);
|
|
407524
407590
|
},
|
|
407525
407591
|
DoWhileStatement: function(stmt, flags) {
|
|
407526
|
-
var result2 =
|
|
407592
|
+
var result2 = join29("do", this.maybeBlock(stmt.body, S_TFFF));
|
|
407527
407593
|
result2 = this.maybeBlockSuffix(stmt.body, result2);
|
|
407528
|
-
return
|
|
407594
|
+
return join29(result2, [
|
|
407529
407595
|
"while" + space + "(",
|
|
407530
407596
|
this.generateExpression(stmt.test, Precedence.Sequence, E_TTT),
|
|
407531
407597
|
")" + this.semicolon(flags)
|
|
@@ -407561,11 +407627,11 @@ var require_escodegen = __commonJS({
|
|
|
407561
407627
|
ExportDefaultDeclaration: function(stmt, flags) {
|
|
407562
407628
|
var result2 = ["export"], bodyFlags;
|
|
407563
407629
|
bodyFlags = flags & F_SEMICOLON_OPT ? S_TFFT : S_TFFF;
|
|
407564
|
-
result2 =
|
|
407630
|
+
result2 = join29(result2, "default");
|
|
407565
407631
|
if (isStatement(stmt.declaration)) {
|
|
407566
|
-
result2 =
|
|
407632
|
+
result2 = join29(result2, this.generateStatement(stmt.declaration, bodyFlags));
|
|
407567
407633
|
} else {
|
|
407568
|
-
result2 =
|
|
407634
|
+
result2 = join29(result2, this.generateExpression(stmt.declaration, Precedence.Assignment, E_TTT) + this.semicolon(flags));
|
|
407569
407635
|
}
|
|
407570
407636
|
return result2;
|
|
407571
407637
|
},
|
|
@@ -407573,15 +407639,15 @@ var require_escodegen = __commonJS({
|
|
|
407573
407639
|
var result2 = ["export"], bodyFlags, that = this;
|
|
407574
407640
|
bodyFlags = flags & F_SEMICOLON_OPT ? S_TFFT : S_TFFF;
|
|
407575
407641
|
if (stmt.declaration) {
|
|
407576
|
-
return
|
|
407642
|
+
return join29(result2, this.generateStatement(stmt.declaration, bodyFlags));
|
|
407577
407643
|
}
|
|
407578
407644
|
if (stmt.specifiers) {
|
|
407579
407645
|
if (stmt.specifiers.length === 0) {
|
|
407580
|
-
result2 =
|
|
407646
|
+
result2 = join29(result2, "{" + space + "}");
|
|
407581
407647
|
} else if (stmt.specifiers[0].type === Syntax.ExportBatchSpecifier) {
|
|
407582
|
-
result2 =
|
|
407648
|
+
result2 = join29(result2, this.generateExpression(stmt.specifiers[0], Precedence.Sequence, E_TTT));
|
|
407583
407649
|
} else {
|
|
407584
|
-
result2 =
|
|
407650
|
+
result2 = join29(result2, "{");
|
|
407585
407651
|
withIndent(function(indent2) {
|
|
407586
407652
|
var i, iz;
|
|
407587
407653
|
result2.push(newline3);
|
|
@@ -407599,7 +407665,7 @@ var require_escodegen = __commonJS({
|
|
|
407599
407665
|
result2.push(base + "}");
|
|
407600
407666
|
}
|
|
407601
407667
|
if (stmt.source) {
|
|
407602
|
-
result2 =
|
|
407668
|
+
result2 = join29(result2, [
|
|
407603
407669
|
"from" + space,
|
|
407604
407670
|
// ModuleSpecifier
|
|
407605
407671
|
this.generateExpression(stmt.source, Precedence.Sequence, E_TTT),
|
|
@@ -407687,7 +407753,7 @@ var require_escodegen = __commonJS({
|
|
|
407687
407753
|
];
|
|
407688
407754
|
cursor4 = 0;
|
|
407689
407755
|
if (stmt.specifiers[cursor4].type === Syntax.ImportDefaultSpecifier) {
|
|
407690
|
-
result2 =
|
|
407756
|
+
result2 = join29(result2, [
|
|
407691
407757
|
this.generateExpression(stmt.specifiers[cursor4], Precedence.Sequence, E_TTT)
|
|
407692
407758
|
]);
|
|
407693
407759
|
++cursor4;
|
|
@@ -407697,7 +407763,7 @@ var require_escodegen = __commonJS({
|
|
|
407697
407763
|
result2.push(",");
|
|
407698
407764
|
}
|
|
407699
407765
|
if (stmt.specifiers[cursor4].type === Syntax.ImportNamespaceSpecifier) {
|
|
407700
|
-
result2 =
|
|
407766
|
+
result2 = join29(result2, [
|
|
407701
407767
|
space,
|
|
407702
407768
|
this.generateExpression(stmt.specifiers[cursor4], Precedence.Sequence, E_TTT)
|
|
407703
407769
|
]);
|
|
@@ -407726,7 +407792,7 @@ var require_escodegen = __commonJS({
|
|
|
407726
407792
|
}
|
|
407727
407793
|
}
|
|
407728
407794
|
}
|
|
407729
|
-
result2 =
|
|
407795
|
+
result2 = join29(result2, [
|
|
407730
407796
|
"from" + space,
|
|
407731
407797
|
// ModuleSpecifier
|
|
407732
407798
|
this.generateExpression(stmt.source, Precedence.Sequence, E_TTT),
|
|
@@ -407780,7 +407846,7 @@ var require_escodegen = __commonJS({
|
|
|
407780
407846
|
return result2;
|
|
407781
407847
|
},
|
|
407782
407848
|
ThrowStatement: function(stmt, flags) {
|
|
407783
|
-
return [
|
|
407849
|
+
return [join29(
|
|
407784
407850
|
"throw",
|
|
407785
407851
|
this.generateExpression(stmt.argument, Precedence.Sequence, E_TTT)
|
|
407786
407852
|
), this.semicolon(flags)];
|
|
@@ -407791,7 +407857,7 @@ var require_escodegen = __commonJS({
|
|
|
407791
407857
|
result2 = this.maybeBlockSuffix(stmt.block, result2);
|
|
407792
407858
|
if (stmt.handlers) {
|
|
407793
407859
|
for (i = 0, iz = stmt.handlers.length; i < iz; ++i) {
|
|
407794
|
-
result2 =
|
|
407860
|
+
result2 = join29(result2, this.generateStatement(stmt.handlers[i], S_TFFF));
|
|
407795
407861
|
if (stmt.finalizer || i + 1 !== iz) {
|
|
407796
407862
|
result2 = this.maybeBlockSuffix(stmt.handlers[i].body, result2);
|
|
407797
407863
|
}
|
|
@@ -407799,7 +407865,7 @@ var require_escodegen = __commonJS({
|
|
|
407799
407865
|
} else {
|
|
407800
407866
|
guardedHandlers = stmt.guardedHandlers || [];
|
|
407801
407867
|
for (i = 0, iz = guardedHandlers.length; i < iz; ++i) {
|
|
407802
|
-
result2 =
|
|
407868
|
+
result2 = join29(result2, this.generateStatement(guardedHandlers[i], S_TFFF));
|
|
407803
407869
|
if (stmt.finalizer || i + 1 !== iz) {
|
|
407804
407870
|
result2 = this.maybeBlockSuffix(guardedHandlers[i].body, result2);
|
|
407805
407871
|
}
|
|
@@ -407807,13 +407873,13 @@ var require_escodegen = __commonJS({
|
|
|
407807
407873
|
if (stmt.handler) {
|
|
407808
407874
|
if (Array.isArray(stmt.handler)) {
|
|
407809
407875
|
for (i = 0, iz = stmt.handler.length; i < iz; ++i) {
|
|
407810
|
-
result2 =
|
|
407876
|
+
result2 = join29(result2, this.generateStatement(stmt.handler[i], S_TFFF));
|
|
407811
407877
|
if (stmt.finalizer || i + 1 !== iz) {
|
|
407812
407878
|
result2 = this.maybeBlockSuffix(stmt.handler[i].body, result2);
|
|
407813
407879
|
}
|
|
407814
407880
|
}
|
|
407815
407881
|
} else {
|
|
407816
|
-
result2 =
|
|
407882
|
+
result2 = join29(result2, this.generateStatement(stmt.handler, S_TFFF));
|
|
407817
407883
|
if (stmt.finalizer) {
|
|
407818
407884
|
result2 = this.maybeBlockSuffix(stmt.handler.body, result2);
|
|
407819
407885
|
}
|
|
@@ -407821,7 +407887,7 @@ var require_escodegen = __commonJS({
|
|
|
407821
407887
|
}
|
|
407822
407888
|
}
|
|
407823
407889
|
if (stmt.finalizer) {
|
|
407824
|
-
result2 =
|
|
407890
|
+
result2 = join29(result2, ["finally", this.maybeBlock(stmt.finalizer, S_TFFF)]);
|
|
407825
407891
|
}
|
|
407826
407892
|
return result2;
|
|
407827
407893
|
},
|
|
@@ -407855,7 +407921,7 @@ var require_escodegen = __commonJS({
|
|
|
407855
407921
|
withIndent(function() {
|
|
407856
407922
|
if (stmt.test) {
|
|
407857
407923
|
result2 = [
|
|
407858
|
-
|
|
407924
|
+
join29("case", that.generateExpression(stmt.test, Precedence.Sequence, E_TTT)),
|
|
407859
407925
|
":"
|
|
407860
407926
|
];
|
|
407861
407927
|
} else {
|
|
@@ -407903,9 +407969,9 @@ var require_escodegen = __commonJS({
|
|
|
407903
407969
|
result2.push(this.maybeBlock(stmt.consequent, S_TFFF));
|
|
407904
407970
|
result2 = this.maybeBlockSuffix(stmt.consequent, result2);
|
|
407905
407971
|
if (stmt.alternate.type === Syntax.IfStatement) {
|
|
407906
|
-
result2 =
|
|
407972
|
+
result2 = join29(result2, ["else ", this.generateStatement(stmt.alternate, bodyFlags)]);
|
|
407907
407973
|
} else {
|
|
407908
|
-
result2 =
|
|
407974
|
+
result2 = join29(result2, join29("else", this.maybeBlock(stmt.alternate, bodyFlags)));
|
|
407909
407975
|
}
|
|
407910
407976
|
} else {
|
|
407911
407977
|
result2.push(this.maybeBlock(stmt.consequent, bodyFlags));
|
|
@@ -408006,7 +408072,7 @@ var require_escodegen = __commonJS({
|
|
|
408006
408072
|
},
|
|
408007
408073
|
ReturnStatement: function(stmt, flags) {
|
|
408008
408074
|
if (stmt.argument) {
|
|
408009
|
-
return [
|
|
408075
|
+
return [join29(
|
|
408010
408076
|
"return",
|
|
408011
408077
|
this.generateExpression(stmt.argument, Precedence.Sequence, E_TTT)
|
|
408012
408078
|
), this.semicolon(flags)];
|
|
@@ -408095,14 +408161,14 @@ var require_escodegen = __commonJS({
|
|
|
408095
408161
|
if (leftSource.charCodeAt(leftSource.length - 1) === 47 && esutils.code.isIdentifierPartES5(expr.operator.charCodeAt(0))) {
|
|
408096
408162
|
result2 = [fragment, noEmptySpace(), expr.operator];
|
|
408097
408163
|
} else {
|
|
408098
|
-
result2 =
|
|
408164
|
+
result2 = join29(fragment, expr.operator);
|
|
408099
408165
|
}
|
|
408100
408166
|
fragment = this.generateExpression(expr.right, rightPrecedence, flags);
|
|
408101
408167
|
if (expr.operator === "/" && fragment.toString().charAt(0) === "/" || expr.operator.slice(-1) === "<" && fragment.toString().slice(0, 3) === "!--") {
|
|
408102
408168
|
result2.push(noEmptySpace());
|
|
408103
408169
|
result2.push(fragment);
|
|
408104
408170
|
} else {
|
|
408105
|
-
result2 =
|
|
408171
|
+
result2 = join29(result2, fragment);
|
|
408106
408172
|
}
|
|
408107
408173
|
if (expr.operator === "in" && !(flags & F_ALLOW_IN)) {
|
|
408108
408174
|
return ["(", result2, ")"];
|
|
@@ -408142,7 +408208,7 @@ var require_escodegen = __commonJS({
|
|
|
408142
408208
|
var result2, length, i, iz, itemFlags;
|
|
408143
408209
|
length = expr["arguments"].length;
|
|
408144
408210
|
itemFlags = flags & F_ALLOW_UNPARATH_NEW && !parentheses && length === 0 ? E_TFT : E_TFF;
|
|
408145
|
-
result2 =
|
|
408211
|
+
result2 = join29(
|
|
408146
408212
|
"new",
|
|
408147
408213
|
this.generateExpression(expr.callee, Precedence.New, itemFlags)
|
|
408148
408214
|
);
|
|
@@ -408192,11 +408258,11 @@ var require_escodegen = __commonJS({
|
|
|
408192
408258
|
var result2, fragment, rightCharCode, leftSource, leftCharCode;
|
|
408193
408259
|
fragment = this.generateExpression(expr.argument, Precedence.Unary, E_TTT);
|
|
408194
408260
|
if (space === "") {
|
|
408195
|
-
result2 =
|
|
408261
|
+
result2 = join29(expr.operator, fragment);
|
|
408196
408262
|
} else {
|
|
408197
408263
|
result2 = [expr.operator];
|
|
408198
408264
|
if (expr.operator.length > 2) {
|
|
408199
|
-
result2 =
|
|
408265
|
+
result2 = join29(result2, fragment);
|
|
408200
408266
|
} else {
|
|
408201
408267
|
leftSource = toSourceNodeWhenNeeded(result2).toString();
|
|
408202
408268
|
leftCharCode = leftSource.charCodeAt(leftSource.length - 1);
|
|
@@ -408219,7 +408285,7 @@ var require_escodegen = __commonJS({
|
|
|
408219
408285
|
result2 = "yield";
|
|
408220
408286
|
}
|
|
408221
408287
|
if (expr.argument) {
|
|
408222
|
-
result2 =
|
|
408288
|
+
result2 = join29(
|
|
408223
408289
|
result2,
|
|
408224
408290
|
this.generateExpression(expr.argument, Precedence.Yield, E_TTT)
|
|
408225
408291
|
);
|
|
@@ -408227,7 +408293,7 @@ var require_escodegen = __commonJS({
|
|
|
408227
408293
|
return parenthesize(result2, Precedence.Yield, precedence);
|
|
408228
408294
|
},
|
|
408229
408295
|
AwaitExpression: function(expr, precedence, flags) {
|
|
408230
|
-
var result2 =
|
|
408296
|
+
var result2 = join29(
|
|
408231
408297
|
expr.all ? "await*" : "await",
|
|
408232
408298
|
this.generateExpression(expr.argument, Precedence.Await, E_TTT)
|
|
408233
408299
|
);
|
|
@@ -408310,11 +408376,11 @@ var require_escodegen = __commonJS({
|
|
|
408310
408376
|
var result2, fragment;
|
|
408311
408377
|
result2 = ["class"];
|
|
408312
408378
|
if (expr.id) {
|
|
408313
|
-
result2 =
|
|
408379
|
+
result2 = join29(result2, this.generateExpression(expr.id, Precedence.Sequence, E_TTT));
|
|
408314
408380
|
}
|
|
408315
408381
|
if (expr.superClass) {
|
|
408316
|
-
fragment =
|
|
408317
|
-
result2 =
|
|
408382
|
+
fragment = join29("extends", this.generateExpression(expr.superClass, Precedence.Unary, E_TTT));
|
|
408383
|
+
result2 = join29(result2, fragment);
|
|
408318
408384
|
}
|
|
408319
408385
|
result2.push(space);
|
|
408320
408386
|
result2.push(this.generateStatement(expr.body, S_TFFT));
|
|
@@ -408329,7 +408395,7 @@ var require_escodegen = __commonJS({
|
|
|
408329
408395
|
}
|
|
408330
408396
|
if (expr.kind === "get" || expr.kind === "set") {
|
|
408331
408397
|
fragment = [
|
|
408332
|
-
|
|
408398
|
+
join29(expr.kind, this.generatePropertyKey(expr.key, expr.computed)),
|
|
408333
408399
|
this.generateFunctionBody(expr.value)
|
|
408334
408400
|
];
|
|
408335
408401
|
} else {
|
|
@@ -408339,7 +408405,7 @@ var require_escodegen = __commonJS({
|
|
|
408339
408405
|
this.generateFunctionBody(expr.value)
|
|
408340
408406
|
];
|
|
408341
408407
|
}
|
|
408342
|
-
return
|
|
408408
|
+
return join29(result2, fragment);
|
|
408343
408409
|
},
|
|
408344
408410
|
Property: function(expr, precedence, flags) {
|
|
408345
408411
|
if (expr.kind === "get" || expr.kind === "set") {
|
|
@@ -408534,7 +408600,7 @@ var require_escodegen = __commonJS({
|
|
|
408534
408600
|
for (i = 0, iz = expr.blocks.length; i < iz; ++i) {
|
|
408535
408601
|
fragment = that.generateExpression(expr.blocks[i], Precedence.Sequence, E_TTT);
|
|
408536
408602
|
if (i > 0 || extra.moz.comprehensionExpressionStartsWithAssignment) {
|
|
408537
|
-
result2 =
|
|
408603
|
+
result2 = join29(result2, fragment);
|
|
408538
408604
|
} else {
|
|
408539
408605
|
result2.push(fragment);
|
|
408540
408606
|
}
|
|
@@ -408542,13 +408608,13 @@ var require_escodegen = __commonJS({
|
|
|
408542
408608
|
});
|
|
408543
408609
|
}
|
|
408544
408610
|
if (expr.filter) {
|
|
408545
|
-
result2 =
|
|
408611
|
+
result2 = join29(result2, "if" + space);
|
|
408546
408612
|
fragment = this.generateExpression(expr.filter, Precedence.Sequence, E_TTT);
|
|
408547
|
-
result2 =
|
|
408613
|
+
result2 = join29(result2, ["(", fragment, ")"]);
|
|
408548
408614
|
}
|
|
408549
408615
|
if (!extra.moz.comprehensionExpressionStartsWithAssignment) {
|
|
408550
408616
|
fragment = this.generateExpression(expr.body, Precedence.Assignment, E_TTT);
|
|
408551
|
-
result2 =
|
|
408617
|
+
result2 = join29(result2, fragment);
|
|
408552
408618
|
}
|
|
408553
408619
|
result2.push(expr.type === Syntax.GeneratorExpression ? ")" : "]");
|
|
408554
408620
|
return result2;
|
|
@@ -408564,8 +408630,8 @@ var require_escodegen = __commonJS({
|
|
|
408564
408630
|
} else {
|
|
408565
408631
|
fragment = this.generateExpression(expr.left, Precedence.Call, E_TTT);
|
|
408566
408632
|
}
|
|
408567
|
-
fragment =
|
|
408568
|
-
fragment =
|
|
408633
|
+
fragment = join29(fragment, expr.of ? "of" : "in");
|
|
408634
|
+
fragment = join29(fragment, this.generateExpression(expr.right, Precedence.Sequence, E_TTT));
|
|
408569
408635
|
return ["for" + space + "(", fragment, ")"];
|
|
408570
408636
|
},
|
|
408571
408637
|
SpreadElement: function(expr, precedence, flags) {
|
|
@@ -444771,6 +444837,10 @@ function useCommandPanel(buffer, isProcessing = false) {
|
|
|
444771
444837
|
name: "reindex",
|
|
444772
444838
|
description: t.commandPanel.commands.reindex
|
|
444773
444839
|
},
|
|
444840
|
+
{
|
|
444841
|
+
name: "permissions",
|
|
444842
|
+
description: t.commandPanel.commands.permissions || "Manage tool permissions"
|
|
444843
|
+
},
|
|
444774
444844
|
{
|
|
444775
444845
|
name: "vulnerability-hunting",
|
|
444776
444846
|
description: t.commandPanel.commands.vulnerabilityHunting || "Toggle vulnerability hunting mode"
|
|
@@ -447128,7 +447198,7 @@ var init_FileList = __esm({
|
|
|
447128
447198
|
const [isLoading, setIsLoading] = (0, import_react88.useState)(false);
|
|
447129
447199
|
const [searchDepth, setSearchDepth] = (0, import_react88.useState)(5);
|
|
447130
447200
|
const [isIncreasingDepth, setIsIncreasingDepth] = (0, import_react88.useState)(false);
|
|
447131
|
-
const [
|
|
447201
|
+
const [hasMoreDepth, setHasMoreDepth] = (0, import_react88.useState)(true);
|
|
447132
447202
|
const { columns: terminalWidth } = useTerminalSize();
|
|
447133
447203
|
const MAX_DISPLAY_ITEMS = 5;
|
|
447134
447204
|
const effectiveMaxItems = (0, import_react88.useMemo)(() => {
|
|
@@ -447231,9 +447301,10 @@ var init_FileList = __esm({
|
|
|
447231
447301
|
break;
|
|
447232
447302
|
}
|
|
447233
447303
|
}
|
|
447304
|
+
const hitDepthLimit = globalMaxDepth >= searchDepth - 1;
|
|
447234
447305
|
setIsLoading(true);
|
|
447235
447306
|
setFiles(allFiles);
|
|
447236
|
-
|
|
447307
|
+
setHasMoreDepth(hitDepthLimit);
|
|
447237
447308
|
setIsLoading(false);
|
|
447238
447309
|
}, [searchDepth]);
|
|
447239
447310
|
const searchFileContent = (0, import_react88.useCallback)(async (query2) => {
|
|
@@ -447375,16 +447446,13 @@ var init_FileList = __esm({
|
|
|
447375
447446
|
return a.name.localeCompare(b.name);
|
|
447376
447447
|
});
|
|
447377
447448
|
setAllFilteredFiles(filtered);
|
|
447378
|
-
if (filtered.length === 0 && query.trim().length > 0 &&
|
|
447379
|
-
setIsIncreasingDepth(true);
|
|
447449
|
+
if (filtered.length === 0 && query.trim().length > 0 && hasMoreDepth) {
|
|
447380
447450
|
const newDepth = searchDepth + 5;
|
|
447381
447451
|
setSearchDepth(newDepth);
|
|
447452
|
+
setIsIncreasingDepth(true);
|
|
447382
447453
|
setTimeout(() => {
|
|
447383
|
-
|
|
447384
|
-
|
|
447385
|
-
setIsIncreasingDepth(false);
|
|
447386
|
-
}, 500);
|
|
447387
|
-
}, 100);
|
|
447454
|
+
setIsIncreasingDepth(false);
|
|
447455
|
+
}, 300);
|
|
447388
447456
|
}
|
|
447389
447457
|
}
|
|
447390
447458
|
};
|
|
@@ -447400,7 +447468,7 @@ var init_FileList = __esm({
|
|
|
447400
447468
|
searchFileContent,
|
|
447401
447469
|
searchDepth,
|
|
447402
447470
|
loadFiles,
|
|
447403
|
-
|
|
447471
|
+
hasMoreDepth
|
|
447404
447472
|
]);
|
|
447405
447473
|
const filteredFiles = (0, import_react88.useMemo)(() => {
|
|
447406
447474
|
if (allFilteredFiles.length <= effectiveMaxItems) {
|
|
@@ -448944,6 +449012,8 @@ function ToolConfirmation({ toolName, toolArguments, allTools, onConfirm, onHook
|
|
|
448944
449012
|
const [hasSelected, setHasSelected] = (0, import_react98.useState)(false);
|
|
448945
449013
|
const [showRejectInput, setShowRejectInput] = (0, import_react98.useState)(false);
|
|
448946
449014
|
const [rejectReason, setRejectReason] = (0, import_react98.useState)("");
|
|
449015
|
+
const [menuKey, setMenuKey] = (0, import_react98.useState)(0);
|
|
449016
|
+
const [initialMenuIndex, setInitialMenuIndex] = (0, import_react98.useState)(0);
|
|
448947
449017
|
const sensitiveCommandCheck = (0, import_react98.useMemo)(() => {
|
|
448948
449018
|
if (toolName !== "terminal-execute" || !toolArguments) {
|
|
448949
449019
|
return { isSensitive: false };
|
|
@@ -449138,6 +449208,15 @@ Output: ${combinedOutput}`);
|
|
|
449138
449208
|
});
|
|
449139
449209
|
return baseItems;
|
|
449140
449210
|
}, [sensitiveCommandCheck.isSensitive, t]);
|
|
449211
|
+
use_input_default((_input, key) => {
|
|
449212
|
+
if (showRejectInput && key.escape) {
|
|
449213
|
+
setShowRejectInput(false);
|
|
449214
|
+
setRejectReason("");
|
|
449215
|
+
const idx2 = items.findIndex((i) => i.value === "reject_with_reply");
|
|
449216
|
+
setInitialMenuIndex(idx2 >= 0 ? idx2 : 0);
|
|
449217
|
+
setMenuKey((k) => k + 1);
|
|
449218
|
+
}
|
|
449219
|
+
});
|
|
449141
449220
|
const handleSelect = (item) => {
|
|
449142
449221
|
if (!hasSelected) {
|
|
449143
449222
|
if (item.value === "reject_with_reply") {
|
|
@@ -449277,7 +449356,7 @@ Output: ${combinedOutput}`);
|
|
|
449277
449356
|
{ marginBottom: 1 },
|
|
449278
449357
|
import_react98.default.createElement(Text, { dimColor: true }, t.toolConfirmation.selectAction)
|
|
449279
449358
|
),
|
|
449280
|
-
!hasSelected && !showRejectInput && import_react98.default.createElement(SelectInput_default, { items, onSelect: handleSelect }),
|
|
449359
|
+
!hasSelected && !showRejectInput && import_react98.default.createElement(SelectInput_default, { key: menuKey, items, onSelect: handleSelect, initialIndex: initialMenuIndex }),
|
|
449281
449360
|
showRejectInput && !hasSelected && import_react98.default.createElement(
|
|
449282
449361
|
Box_default,
|
|
449283
449362
|
{ flexDirection: "column" },
|
|
@@ -469289,7 +469368,7 @@ var require_core6 = __commonJS({
|
|
|
469289
469368
|
return match2 && match2.index === 0;
|
|
469290
469369
|
}
|
|
469291
469370
|
var BACKREF_RE = /\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;
|
|
469292
|
-
function
|
|
469371
|
+
function join29(regexps, separator = "|") {
|
|
469293
469372
|
let numCaptures = 0;
|
|
469294
469373
|
return regexps.map((regex2) => {
|
|
469295
469374
|
numCaptures += 1;
|
|
@@ -469593,7 +469672,7 @@ var require_core6 = __commonJS({
|
|
|
469593
469672
|
this.exec = () => null;
|
|
469594
469673
|
}
|
|
469595
469674
|
const terminators = this.regexes.map((el) => el[1]);
|
|
469596
|
-
this.matcherRe = langRe(
|
|
469675
|
+
this.matcherRe = langRe(join29(terminators), true);
|
|
469597
469676
|
this.lastIndex = 0;
|
|
469598
469677
|
}
|
|
469599
469678
|
/** @param {string} s */
|
|
@@ -527483,11 +527562,103 @@ var init_useSessionSave = __esm({
|
|
|
527483
527562
|
}
|
|
527484
527563
|
});
|
|
527485
527564
|
|
|
527565
|
+
// dist/utils/config/permissionsConfig.js
|
|
527566
|
+
import { join as join22 } from "path";
|
|
527567
|
+
import { readFileSync as readFileSync17, writeFileSync as writeFileSync11, existsSync as existsSync22, mkdirSync as mkdirSync11 } from "fs";
|
|
527568
|
+
function getSnowDirPath2(workingDirectory) {
|
|
527569
|
+
return join22(workingDirectory, SNOW_DIR3);
|
|
527570
|
+
}
|
|
527571
|
+
function getPermissionsFilePath(workingDirectory) {
|
|
527572
|
+
return join22(getSnowDirPath2(workingDirectory), PERMISSIONS_FILE);
|
|
527573
|
+
}
|
|
527574
|
+
function ensureConfigDirectory7(workingDirectory) {
|
|
527575
|
+
const snowDir = getSnowDirPath2(workingDirectory);
|
|
527576
|
+
if (!existsSync22(snowDir)) {
|
|
527577
|
+
mkdirSync11(snowDir, { recursive: true });
|
|
527578
|
+
}
|
|
527579
|
+
}
|
|
527580
|
+
function loadPermissionsConfig(workingDirectory) {
|
|
527581
|
+
ensureConfigDirectory7(workingDirectory);
|
|
527582
|
+
const configPath = getPermissionsFilePath(workingDirectory);
|
|
527583
|
+
if (!existsSync22(configPath)) {
|
|
527584
|
+
return { ...DEFAULT_CONFIG5 };
|
|
527585
|
+
}
|
|
527586
|
+
try {
|
|
527587
|
+
const configData = readFileSync17(configPath, "utf-8");
|
|
527588
|
+
const config3 = JSON.parse(configData);
|
|
527589
|
+
return {
|
|
527590
|
+
alwaysApprovedTools: Array.isArray(config3.alwaysApprovedTools) ? config3.alwaysApprovedTools : []
|
|
527591
|
+
};
|
|
527592
|
+
} catch (error) {
|
|
527593
|
+
console.error("Failed to load permissions config:", error);
|
|
527594
|
+
return { ...DEFAULT_CONFIG5 };
|
|
527595
|
+
}
|
|
527596
|
+
}
|
|
527597
|
+
function savePermissionsConfig(workingDirectory, config3) {
|
|
527598
|
+
ensureConfigDirectory7(workingDirectory);
|
|
527599
|
+
const configPath = getPermissionsFilePath(workingDirectory);
|
|
527600
|
+
try {
|
|
527601
|
+
const configData = JSON.stringify(config3, null, 2);
|
|
527602
|
+
writeFileSync11(configPath, configData, "utf-8");
|
|
527603
|
+
} catch (error) {
|
|
527604
|
+
console.error("Failed to save permissions config:", error);
|
|
527605
|
+
throw error;
|
|
527606
|
+
}
|
|
527607
|
+
}
|
|
527608
|
+
function addToolToPermissions(workingDirectory, toolName) {
|
|
527609
|
+
const config3 = loadPermissionsConfig(workingDirectory);
|
|
527610
|
+
if (!config3.alwaysApprovedTools.includes(toolName)) {
|
|
527611
|
+
config3.alwaysApprovedTools.push(toolName);
|
|
527612
|
+
savePermissionsConfig(workingDirectory, config3);
|
|
527613
|
+
}
|
|
527614
|
+
}
|
|
527615
|
+
function addMultipleToolsToPermissions(workingDirectory, toolNames) {
|
|
527616
|
+
const config3 = loadPermissionsConfig(workingDirectory);
|
|
527617
|
+
let modified = false;
|
|
527618
|
+
for (const toolName of toolNames) {
|
|
527619
|
+
if (!config3.alwaysApprovedTools.includes(toolName)) {
|
|
527620
|
+
config3.alwaysApprovedTools.push(toolName);
|
|
527621
|
+
modified = true;
|
|
527622
|
+
}
|
|
527623
|
+
}
|
|
527624
|
+
if (modified) {
|
|
527625
|
+
savePermissionsConfig(workingDirectory, config3);
|
|
527626
|
+
}
|
|
527627
|
+
}
|
|
527628
|
+
function removeToolFromPermissions(workingDirectory, toolName) {
|
|
527629
|
+
const config3 = loadPermissionsConfig(workingDirectory);
|
|
527630
|
+
const index = config3.alwaysApprovedTools.indexOf(toolName);
|
|
527631
|
+
if (index !== -1) {
|
|
527632
|
+
config3.alwaysApprovedTools.splice(index, 1);
|
|
527633
|
+
savePermissionsConfig(workingDirectory, config3);
|
|
527634
|
+
}
|
|
527635
|
+
}
|
|
527636
|
+
function clearAllPermissions(workingDirectory) {
|
|
527637
|
+
savePermissionsConfig(workingDirectory, { alwaysApprovedTools: [] });
|
|
527638
|
+
}
|
|
527639
|
+
var SNOW_DIR3, PERMISSIONS_FILE, DEFAULT_CONFIG5;
|
|
527640
|
+
var init_permissionsConfig = __esm({
|
|
527641
|
+
"dist/utils/config/permissionsConfig.js"() {
|
|
527642
|
+
"use strict";
|
|
527643
|
+
SNOW_DIR3 = ".snow";
|
|
527644
|
+
PERMISSIONS_FILE = "permissions.json";
|
|
527645
|
+
DEFAULT_CONFIG5 = {
|
|
527646
|
+
alwaysApprovedTools: []
|
|
527647
|
+
};
|
|
527648
|
+
}
|
|
527649
|
+
});
|
|
527650
|
+
|
|
527486
527651
|
// dist/hooks/conversation/useToolConfirmation.js
|
|
527487
|
-
function useToolConfirmation() {
|
|
527652
|
+
function useToolConfirmation(workingDirectory) {
|
|
527488
527653
|
const [pendingToolConfirmation, setPendingToolConfirmation] = (0, import_react120.useState)(null);
|
|
527489
527654
|
const alwaysApprovedToolsRef = (0, import_react120.useRef)(/* @__PURE__ */ new Set());
|
|
527490
527655
|
const [alwaysApprovedTools, setAlwaysApprovedTools] = (0, import_react120.useState)(/* @__PURE__ */ new Set());
|
|
527656
|
+
(0, import_react120.useEffect)(() => {
|
|
527657
|
+
const config3 = loadPermissionsConfig(workingDirectory);
|
|
527658
|
+
const loadedTools = new Set(config3.alwaysApprovedTools);
|
|
527659
|
+
alwaysApprovedToolsRef.current = loadedTools;
|
|
527660
|
+
setAlwaysApprovedTools(loadedTools);
|
|
527661
|
+
}, [workingDirectory]);
|
|
527491
527662
|
const requestToolConfirmation = async (toolCall, batchToolNames, allTools) => {
|
|
527492
527663
|
return new Promise((resolve10) => {
|
|
527493
527664
|
setPendingToolConfirmation({
|
|
@@ -527502,23 +527673,41 @@ function useToolConfirmation() {
|
|
|
527502
527673
|
});
|
|
527503
527674
|
};
|
|
527504
527675
|
const isToolAutoApproved = (0, import_react120.useCallback)((toolName) => {
|
|
527505
|
-
return alwaysApprovedToolsRef.current.has(toolName) || toolName.startsWith("todo-") || toolName.startsWith("subagent-");
|
|
527676
|
+
return alwaysApprovedToolsRef.current.has(toolName) || toolName.startsWith("todo-") || toolName.startsWith("subagent-") || toolName === "askuser-ask_question";
|
|
527506
527677
|
}, []);
|
|
527507
527678
|
const addToAlwaysApproved = (0, import_react120.useCallback)((toolName) => {
|
|
527508
527679
|
alwaysApprovedToolsRef.current.add(toolName);
|
|
527509
527680
|
setAlwaysApprovedTools((prev) => /* @__PURE__ */ new Set([...prev, toolName]));
|
|
527510
|
-
|
|
527681
|
+
addToolToPermissions(workingDirectory, toolName);
|
|
527682
|
+
}, [workingDirectory]);
|
|
527511
527683
|
const addMultipleToAlwaysApproved = (0, import_react120.useCallback)((toolNames) => {
|
|
527512
527684
|
toolNames.forEach((name) => alwaysApprovedToolsRef.current.add(name));
|
|
527513
527685
|
setAlwaysApprovedTools((prev) => /* @__PURE__ */ new Set([...prev, ...toolNames]));
|
|
527514
|
-
|
|
527686
|
+
addMultipleToolsToPermissions(workingDirectory, toolNames);
|
|
527687
|
+
}, [workingDirectory]);
|
|
527688
|
+
const removeFromAlwaysApproved = (0, import_react120.useCallback)((toolName) => {
|
|
527689
|
+
alwaysApprovedToolsRef.current.delete(toolName);
|
|
527690
|
+
setAlwaysApprovedTools((prev) => {
|
|
527691
|
+
const next = new Set(prev);
|
|
527692
|
+
next.delete(toolName);
|
|
527693
|
+
return next;
|
|
527694
|
+
});
|
|
527695
|
+
removeToolFromPermissions(workingDirectory, toolName);
|
|
527696
|
+
}, [workingDirectory]);
|
|
527697
|
+
const clearAllAlwaysApproved = (0, import_react120.useCallback)(() => {
|
|
527698
|
+
alwaysApprovedToolsRef.current.clear();
|
|
527699
|
+
setAlwaysApprovedTools(/* @__PURE__ */ new Set());
|
|
527700
|
+
clearAllPermissions(workingDirectory);
|
|
527701
|
+
}, [workingDirectory]);
|
|
527515
527702
|
return {
|
|
527516
527703
|
pendingToolConfirmation,
|
|
527517
527704
|
alwaysApprovedTools,
|
|
527518
527705
|
requestToolConfirmation,
|
|
527519
527706
|
isToolAutoApproved,
|
|
527520
527707
|
addToAlwaysApproved,
|
|
527521
|
-
addMultipleToAlwaysApproved
|
|
527708
|
+
addMultipleToAlwaysApproved,
|
|
527709
|
+
removeFromAlwaysApproved,
|
|
527710
|
+
clearAllAlwaysApproved
|
|
527522
527711
|
};
|
|
527523
527712
|
}
|
|
527524
527713
|
var import_react120;
|
|
@@ -527526,6 +527715,7 @@ var init_useToolConfirmation = __esm({
|
|
|
527526
527715
|
"dist/hooks/conversation/useToolConfirmation.js"() {
|
|
527527
527716
|
"use strict";
|
|
527528
527717
|
import_react120 = __toESM(require_react(), 1);
|
|
527718
|
+
init_permissionsConfig();
|
|
527529
527719
|
}
|
|
527530
527720
|
});
|
|
527531
527721
|
|
|
@@ -528842,6 +529032,14 @@ Output: ${combinedOutput}`;
|
|
|
528842
529032
|
commandName
|
|
528843
529033
|
};
|
|
528844
529034
|
options3.setMessages((prev) => [...prev, commandMessage]);
|
|
529035
|
+
} else if (result2.success && result2.action === "showPermissionsPanel") {
|
|
529036
|
+
options3.setShowPermissionsPanel(true);
|
|
529037
|
+
const commandMessage = {
|
|
529038
|
+
role: "command",
|
|
529039
|
+
content: "",
|
|
529040
|
+
commandName
|
|
529041
|
+
};
|
|
529042
|
+
options3.setMessages((prev) => [...prev, commandMessage]);
|
|
528845
529043
|
} else if (result2.success && result2.action === "executeCustomCommand" && result2.prompt) {
|
|
528846
529044
|
const commandMessage = {
|
|
528847
529045
|
role: "command",
|
|
@@ -529396,6 +529594,7 @@ async function handleConversationWithTools(options3) {
|
|
|
529396
529594
|
}
|
|
529397
529595
|
}
|
|
529398
529596
|
}
|
|
529597
|
+
setStreamTokenCount(0);
|
|
529399
529598
|
if (controller.signal.aborted) {
|
|
529400
529599
|
freeEncoder();
|
|
529401
529600
|
break;
|
|
@@ -534624,6 +534823,218 @@ var init_reindexCodebase = __esm({
|
|
|
534624
534823
|
}
|
|
534625
534824
|
});
|
|
534626
534825
|
|
|
534826
|
+
// dist/ui/components/panels/PermissionsPanel.js
|
|
534827
|
+
var PermissionsPanel_exports = {};
|
|
534828
|
+
__export(PermissionsPanel_exports, {
|
|
534829
|
+
default: () => PermissionsPanel
|
|
534830
|
+
});
|
|
534831
|
+
function PermissionsPanel({ alwaysApprovedTools, onRemoveTool, onClearAll, onClose }) {
|
|
534832
|
+
const { t } = useI18n();
|
|
534833
|
+
const { theme: theme14 } = useTheme();
|
|
534834
|
+
const messages = t.permissionsPanel ?? {};
|
|
534835
|
+
const tools = (0, import_react127.useMemo)(() => Array.from(alwaysApprovedTools).sort((a, b) => a.localeCompare(b)), [alwaysApprovedTools]);
|
|
534836
|
+
const [selectedIndex, setSelectedIndex] = (0, import_react127.useState)(0);
|
|
534837
|
+
const [confirmTarget, setConfirmTarget] = (0, import_react127.useState)(null);
|
|
534838
|
+
const [confirmOption, setConfirmOption] = (0, import_react127.useState)(0);
|
|
534839
|
+
const hasTools = tools.length > 0;
|
|
534840
|
+
const clearAllIndex = hasTools ? tools.length : -1;
|
|
534841
|
+
const optionCount = hasTools ? tools.length + 1 : 0;
|
|
534842
|
+
(0, import_react127.useEffect)(() => {
|
|
534843
|
+
if (optionCount === 0) {
|
|
534844
|
+
setSelectedIndex(0);
|
|
534845
|
+
return;
|
|
534846
|
+
}
|
|
534847
|
+
if (selectedIndex >= optionCount) {
|
|
534848
|
+
setSelectedIndex(optionCount - 1);
|
|
534849
|
+
}
|
|
534850
|
+
}, [optionCount, selectedIndex]);
|
|
534851
|
+
(0, import_react127.useEffect)(() => {
|
|
534852
|
+
setConfirmTarget(null);
|
|
534853
|
+
setConfirmOption(0);
|
|
534854
|
+
}, [alwaysApprovedTools]);
|
|
534855
|
+
const handleInput = (0, import_react127.useCallback)((_3, key) => {
|
|
534856
|
+
if (confirmTarget !== null) {
|
|
534857
|
+
if (key.escape) {
|
|
534858
|
+
setConfirmTarget(null);
|
|
534859
|
+
setConfirmOption(0);
|
|
534860
|
+
return;
|
|
534861
|
+
}
|
|
534862
|
+
if (key.upArrow || key.downArrow) {
|
|
534863
|
+
setConfirmOption((prev) => prev === 0 ? 1 : 0);
|
|
534864
|
+
return;
|
|
534865
|
+
}
|
|
534866
|
+
if (key.return) {
|
|
534867
|
+
if (confirmOption === 0) {
|
|
534868
|
+
if (confirmTarget === "clearAll") {
|
|
534869
|
+
onClearAll();
|
|
534870
|
+
setSelectedIndex(0);
|
|
534871
|
+
} else {
|
|
534872
|
+
const tool = tools[confirmTarget];
|
|
534873
|
+
if (tool) {
|
|
534874
|
+
onRemoveTool(tool);
|
|
534875
|
+
if (confirmTarget >= tools.length - 1) {
|
|
534876
|
+
setSelectedIndex(Math.max(0, confirmTarget - 1));
|
|
534877
|
+
}
|
|
534878
|
+
}
|
|
534879
|
+
}
|
|
534880
|
+
}
|
|
534881
|
+
setConfirmTarget(null);
|
|
534882
|
+
setConfirmOption(0);
|
|
534883
|
+
return;
|
|
534884
|
+
}
|
|
534885
|
+
return;
|
|
534886
|
+
}
|
|
534887
|
+
if (key.escape) {
|
|
534888
|
+
onClose();
|
|
534889
|
+
return;
|
|
534890
|
+
}
|
|
534891
|
+
if (optionCount === 0) {
|
|
534892
|
+
return;
|
|
534893
|
+
}
|
|
534894
|
+
if (key.upArrow) {
|
|
534895
|
+
setSelectedIndex((prev) => prev === 0 ? optionCount - 1 : prev - 1);
|
|
534896
|
+
return;
|
|
534897
|
+
}
|
|
534898
|
+
if (key.downArrow) {
|
|
534899
|
+
setSelectedIndex((prev) => prev === optionCount - 1 ? 0 : prev + 1);
|
|
534900
|
+
return;
|
|
534901
|
+
}
|
|
534902
|
+
if (key.return) {
|
|
534903
|
+
if (selectedIndex === clearAllIndex) {
|
|
534904
|
+
setConfirmTarget("clearAll");
|
|
534905
|
+
} else {
|
|
534906
|
+
setConfirmTarget(selectedIndex);
|
|
534907
|
+
}
|
|
534908
|
+
setConfirmOption(0);
|
|
534909
|
+
}
|
|
534910
|
+
}, [
|
|
534911
|
+
optionCount,
|
|
534912
|
+
selectedIndex,
|
|
534913
|
+
clearAllIndex,
|
|
534914
|
+
onClose,
|
|
534915
|
+
onClearAll,
|
|
534916
|
+
onRemoveTool,
|
|
534917
|
+
tools,
|
|
534918
|
+
confirmTarget,
|
|
534919
|
+
confirmOption
|
|
534920
|
+
]);
|
|
534921
|
+
use_input_default(handleInput);
|
|
534922
|
+
const getConfirmingToolName = () => {
|
|
534923
|
+
if (confirmTarget === "clearAll") {
|
|
534924
|
+
return "";
|
|
534925
|
+
}
|
|
534926
|
+
if (typeof confirmTarget === "number") {
|
|
534927
|
+
return tools[confirmTarget] ?? "";
|
|
534928
|
+
}
|
|
534929
|
+
return "";
|
|
534930
|
+
};
|
|
534931
|
+
if (confirmTarget !== null) {
|
|
534932
|
+
const isConfirmingClearAll = confirmTarget === "clearAll";
|
|
534933
|
+
const toolName = getConfirmingToolName();
|
|
534934
|
+
return import_react127.default.createElement(
|
|
534935
|
+
Box_default,
|
|
534936
|
+
{ flexDirection: "column", borderStyle: "round", borderColor: "red", paddingX: 2, paddingY: 1 },
|
|
534937
|
+
import_react127.default.createElement(Text, { color: "red", bold: true }, isConfirmingClearAll ? messages.confirmClearAll ?? "Clear all permissions?" : messages.confirmDelete ?? "Delete allowed tool?"),
|
|
534938
|
+
!isConfirmingClearAll && toolName && import_react127.default.createElement(
|
|
534939
|
+
Box_default,
|
|
534940
|
+
{ marginTop: 1, flexDirection: "column" },
|
|
534941
|
+
import_react127.default.createElement(
|
|
534942
|
+
Text,
|
|
534943
|
+
{ color: "white", bold: true },
|
|
534944
|
+
" ",
|
|
534945
|
+
toolName
|
|
534946
|
+
)
|
|
534947
|
+
),
|
|
534948
|
+
import_react127.default.createElement(
|
|
534949
|
+
Box_default,
|
|
534950
|
+
{ marginTop: 1, flexDirection: "column" },
|
|
534951
|
+
import_react127.default.createElement(
|
|
534952
|
+
Text,
|
|
534953
|
+
{ color: confirmOption === 0 ? theme14.colors.menuSelected : theme14.colors.menuNormal, bold: confirmOption === 0 },
|
|
534954
|
+
confirmOption === 0 ? "\u276F " : " ",
|
|
534955
|
+
messages.yes ?? "Yes"
|
|
534956
|
+
),
|
|
534957
|
+
import_react127.default.createElement(
|
|
534958
|
+
Text,
|
|
534959
|
+
{ color: confirmOption === 1 ? theme14.colors.menuSelected : theme14.colors.menuNormal, bold: confirmOption === 1 },
|
|
534960
|
+
confirmOption === 1 ? "\u276F " : " ",
|
|
534961
|
+
messages.no ?? "No"
|
|
534962
|
+
)
|
|
534963
|
+
)
|
|
534964
|
+
);
|
|
534965
|
+
}
|
|
534966
|
+
return import_react127.default.createElement(
|
|
534967
|
+
Box_default,
|
|
534968
|
+
{ flexDirection: "column", borderStyle: "round", borderColor: "cyan", paddingX: 2, paddingY: 1 },
|
|
534969
|
+
import_react127.default.createElement(Text, { color: "cyan", bold: true }, messages.title ?? "Permissions"),
|
|
534970
|
+
hasTools ? import_react127.default.createElement(
|
|
534971
|
+
Box_default,
|
|
534972
|
+
{ flexDirection: "column", marginTop: 1 },
|
|
534973
|
+
tools.map((tool, index) => {
|
|
534974
|
+
const isSelected = index === selectedIndex;
|
|
534975
|
+
return import_react127.default.createElement(
|
|
534976
|
+
Text,
|
|
534977
|
+
{ key: tool, color: isSelected ? theme14.colors.menuSelected : theme14.colors.menuNormal, bold: isSelected },
|
|
534978
|
+
isSelected ? "\u276F " : " ",
|
|
534979
|
+
tool
|
|
534980
|
+
);
|
|
534981
|
+
}),
|
|
534982
|
+
import_react127.default.createElement(
|
|
534983
|
+
Box_default,
|
|
534984
|
+
{ marginTop: 1 },
|
|
534985
|
+
import_react127.default.createElement(
|
|
534986
|
+
Text,
|
|
534987
|
+
{ color: selectedIndex === clearAllIndex ? theme14.colors.warning : theme14.colors.menuSecondary, bold: selectedIndex === clearAllIndex },
|
|
534988
|
+
selectedIndex === clearAllIndex ? "\u276F " : " ",
|
|
534989
|
+
messages.clearAll ?? "Clear All"
|
|
534990
|
+
)
|
|
534991
|
+
)
|
|
534992
|
+
) : import_react127.default.createElement(
|
|
534993
|
+
Box_default,
|
|
534994
|
+
{ marginTop: 1 },
|
|
534995
|
+
import_react127.default.createElement(Text, { color: "gray", dimColor: true }, messages.noTools ?? "No tools are always approved")
|
|
534996
|
+
),
|
|
534997
|
+
import_react127.default.createElement(
|
|
534998
|
+
Box_default,
|
|
534999
|
+
{ marginTop: 1 },
|
|
535000
|
+
import_react127.default.createElement(Text, { color: "gray", dimColor: true }, messages.hint ?? "\u2191\u2193 navigate \u2022 Enter remove \u2022 ESC close")
|
|
535001
|
+
)
|
|
535002
|
+
);
|
|
535003
|
+
}
|
|
535004
|
+
var import_react127;
|
|
535005
|
+
var init_PermissionsPanel = __esm({
|
|
535006
|
+
async "dist/ui/components/panels/PermissionsPanel.js"() {
|
|
535007
|
+
"use strict";
|
|
535008
|
+
import_react127 = __toESM(require_react(), 1);
|
|
535009
|
+
await init_build2();
|
|
535010
|
+
init_i18n();
|
|
535011
|
+
init_ThemeContext();
|
|
535012
|
+
}
|
|
535013
|
+
});
|
|
535014
|
+
|
|
535015
|
+
// dist/utils/commands/permissions.js
|
|
535016
|
+
var permissions_exports = {};
|
|
535017
|
+
__export(permissions_exports, {
|
|
535018
|
+
default: () => permissions_default
|
|
535019
|
+
});
|
|
535020
|
+
var permissions_default;
|
|
535021
|
+
var init_permissions = __esm({
|
|
535022
|
+
"dist/utils/commands/permissions.js"() {
|
|
535023
|
+
"use strict";
|
|
535024
|
+
init_commandExecutor();
|
|
535025
|
+
registerCommand("permissions", {
|
|
535026
|
+
execute: () => {
|
|
535027
|
+
return {
|
|
535028
|
+
success: true,
|
|
535029
|
+
action: "showPermissionsPanel",
|
|
535030
|
+
message: "Opening permissions panel"
|
|
535031
|
+
};
|
|
535032
|
+
}
|
|
535033
|
+
});
|
|
535034
|
+
permissions_default = {};
|
|
535035
|
+
}
|
|
535036
|
+
});
|
|
535037
|
+
|
|
534627
535038
|
// dist/ui/pages/ChatScreen.js
|
|
534628
535039
|
var ChatScreen_exports = {};
|
|
534629
535040
|
__export(ChatScreen_exports, {
|
|
@@ -534633,20 +535044,20 @@ function ChatScreen({ autoResume, enableYolo }) {
|
|
|
534633
535044
|
const { t } = useI18n();
|
|
534634
535045
|
const { theme: theme14 } = useTheme();
|
|
534635
535046
|
const { exit } = use_app_default();
|
|
534636
|
-
const [messages, setMessages] = (0,
|
|
534637
|
-
const [isSaving] = (0,
|
|
534638
|
-
const [pendingMessages, setPendingMessages] = (0,
|
|
534639
|
-
const pendingMessagesRef = (0,
|
|
534640
|
-
const hasAttemptedAutoVscodeConnect = (0,
|
|
534641
|
-
const userInterruptedRef = (0,
|
|
534642
|
-
const [remountKey, setRemountKey] = (0,
|
|
534643
|
-
const [currentContextPercentage, setCurrentContextPercentage] = (0,
|
|
534644
|
-
const currentContextPercentageRef = (0,
|
|
534645
|
-
const [isExecutingTerminalCommand, setIsExecutingTerminalCommand] = (0,
|
|
534646
|
-
(0,
|
|
535047
|
+
const [messages, setMessages] = (0, import_react128.useState)([]);
|
|
535048
|
+
const [isSaving] = (0, import_react128.useState)(false);
|
|
535049
|
+
const [pendingMessages, setPendingMessages] = (0, import_react128.useState)([]);
|
|
535050
|
+
const pendingMessagesRef = (0, import_react128.useRef)([]);
|
|
535051
|
+
const hasAttemptedAutoVscodeConnect = (0, import_react128.useRef)(false);
|
|
535052
|
+
const userInterruptedRef = (0, import_react128.useRef)(false);
|
|
535053
|
+
const [remountKey, setRemountKey] = (0, import_react128.useState)(0);
|
|
535054
|
+
const [currentContextPercentage, setCurrentContextPercentage] = (0, import_react128.useState)(0);
|
|
535055
|
+
const currentContextPercentageRef = (0, import_react128.useRef)(0);
|
|
535056
|
+
const [isExecutingTerminalCommand, setIsExecutingTerminalCommand] = (0, import_react128.useState)(false);
|
|
535057
|
+
(0, import_react128.useEffect)(() => {
|
|
534647
535058
|
currentContextPercentageRef.current = currentContextPercentage;
|
|
534648
535059
|
}, [currentContextPercentage]);
|
|
534649
|
-
const [yoloMode, setYoloMode] = (0,
|
|
535060
|
+
const [yoloMode, setYoloMode] = (0, import_react128.useState)(() => {
|
|
534650
535061
|
if (enableYolo !== void 0) {
|
|
534651
535062
|
return enableYolo;
|
|
534652
535063
|
}
|
|
@@ -534657,7 +535068,7 @@ function ChatScreen({ autoResume, enableYolo }) {
|
|
|
534657
535068
|
return false;
|
|
534658
535069
|
}
|
|
534659
535070
|
});
|
|
534660
|
-
const [planMode, setPlanMode] = (0,
|
|
535071
|
+
const [planMode, setPlanMode] = (0, import_react128.useState)(() => {
|
|
534661
535072
|
try {
|
|
534662
535073
|
const saved = localStorage.getItem("snow-plan-mode");
|
|
534663
535074
|
return saved === "true";
|
|
@@ -534665,7 +535076,7 @@ function ChatScreen({ autoResume, enableYolo }) {
|
|
|
534665
535076
|
return false;
|
|
534666
535077
|
}
|
|
534667
535078
|
});
|
|
534668
|
-
const [vulnerabilityHuntingMode, setVulnerabilityHuntingMode] = (0,
|
|
535079
|
+
const [vulnerabilityHuntingMode, setVulnerabilityHuntingMode] = (0, import_react128.useState)(() => {
|
|
534669
535080
|
try {
|
|
534670
535081
|
const saved = localStorage.getItem("snow-vulnerability-hunting-mode");
|
|
534671
535082
|
return saved === "true";
|
|
@@ -534673,27 +535084,28 @@ function ChatScreen({ autoResume, enableYolo }) {
|
|
|
534673
535084
|
return false;
|
|
534674
535085
|
}
|
|
534675
535086
|
});
|
|
534676
|
-
const [simpleMode, setSimpleMode2] = (0,
|
|
535087
|
+
const [simpleMode, setSimpleMode2] = (0, import_react128.useState)(() => {
|
|
534677
535088
|
return getSimpleMode();
|
|
534678
535089
|
});
|
|
534679
|
-
const [showThinking, _setShowThinking] = (0,
|
|
535090
|
+
const [showThinking, _setShowThinking] = (0, import_react128.useState)(() => {
|
|
534680
535091
|
const config3 = getOpenAiConfig();
|
|
534681
535092
|
return config3.showThinking !== false;
|
|
534682
535093
|
});
|
|
534683
|
-
const [isCompressing, setIsCompressing] = (0,
|
|
534684
|
-
const [compressionError, setCompressionError] = (0,
|
|
534685
|
-
const [
|
|
534686
|
-
const [
|
|
534687
|
-
const [
|
|
535094
|
+
const [isCompressing, setIsCompressing] = (0, import_react128.useState)(false);
|
|
535095
|
+
const [compressionError, setCompressionError] = (0, import_react128.useState)(null);
|
|
535096
|
+
const [showPermissionsPanel, setShowPermissionsPanel] = (0, import_react128.useState)(false);
|
|
535097
|
+
const [restoreInputContent, setRestoreInputContent] = (0, import_react128.useState)(null);
|
|
535098
|
+
const [bashSensitiveCommand, setBashSensitiveCommand] = (0, import_react128.useState)(null);
|
|
535099
|
+
const [hookError, setHookError] = (0, import_react128.useState)(null);
|
|
534688
535100
|
const { columns: terminalWidth, rows: terminalHeight } = useTerminalSize();
|
|
534689
535101
|
const { stdout } = use_stdout_default();
|
|
534690
535102
|
const workingDirectory = process.cwd();
|
|
534691
|
-
const isInitialMount = (0,
|
|
534692
|
-
const [codebaseIndexing, setCodebaseIndexing] = (0,
|
|
534693
|
-
const [codebaseProgress, setCodebaseProgress] = (0,
|
|
534694
|
-
const [watcherEnabled, setWatcherEnabled] = (0,
|
|
534695
|
-
const [fileUpdateNotification, setFileUpdateNotification] = (0,
|
|
534696
|
-
const codebaseAgentRef = (0,
|
|
535103
|
+
const isInitialMount = (0, import_react128.useRef)(true);
|
|
535104
|
+
const [codebaseIndexing, setCodebaseIndexing] = (0, import_react128.useState)(false);
|
|
535105
|
+
const [codebaseProgress, setCodebaseProgress] = (0, import_react128.useState)(null);
|
|
535106
|
+
const [watcherEnabled, setWatcherEnabled] = (0, import_react128.useState)(false);
|
|
535107
|
+
const [fileUpdateNotification, setFileUpdateNotification] = (0, import_react128.useState)(null);
|
|
535108
|
+
const codebaseAgentRef = (0, import_react128.useRef)(null);
|
|
534697
535109
|
const streamingState = useStreamingState();
|
|
534698
535110
|
const vscodeState = useVSCodeState();
|
|
534699
535111
|
const snapshotState = useSnapshotState(messages.length);
|
|
@@ -534702,11 +535114,11 @@ function ChatScreen({ autoResume, enableYolo }) {
|
|
|
534702
535114
|
const panelState = usePanelState();
|
|
534703
535115
|
const { hasFocus } = useTerminalFocus();
|
|
534704
535116
|
const { saveMessage, clearSavedMessages, initializeFromSession } = useSessionSave();
|
|
534705
|
-
(0,
|
|
535117
|
+
(0, import_react128.useEffect)(() => {
|
|
534706
535118
|
pendingMessagesRef.current = pendingMessages;
|
|
534707
535119
|
}, [pendingMessages]);
|
|
534708
|
-
const [commandsLoaded, setCommandsLoaded] = (0,
|
|
534709
|
-
(0,
|
|
535120
|
+
const [commandsLoaded, setCommandsLoaded] = (0, import_react128.useState)(false);
|
|
535121
|
+
(0, import_react128.useEffect)(() => {
|
|
534710
535122
|
Promise.all([
|
|
534711
535123
|
Promise.resolve().then(() => (init_clear(), clear_exports)),
|
|
534712
535124
|
Promise.resolve().then(() => (init_resume(), resume_exports)),
|
|
@@ -534728,7 +535140,8 @@ function ChatScreen({ autoResume, enableYolo }) {
|
|
|
534728
535140
|
Promise.resolve().then(() => (init_skills(), skills_exports)),
|
|
534729
535141
|
Promise.resolve().then(() => (init_quit(), quit_exports)),
|
|
534730
535142
|
Promise.resolve().then(() => (init_reindex(), reindex_exports)),
|
|
534731
|
-
Promise.resolve().then(() => (init_addDir(), addDir_exports))
|
|
535143
|
+
Promise.resolve().then(() => (init_addDir(), addDir_exports)),
|
|
535144
|
+
Promise.resolve().then(() => (init_permissions(), permissions_exports))
|
|
534732
535145
|
]).then(async () => {
|
|
534733
535146
|
await registerCustomCommands(workingDirectory);
|
|
534734
535147
|
setCommandsLoaded(true);
|
|
@@ -534737,7 +535150,7 @@ function ChatScreen({ autoResume, enableYolo }) {
|
|
|
534737
535150
|
setCommandsLoaded(true);
|
|
534738
535151
|
});
|
|
534739
535152
|
}, []);
|
|
534740
|
-
(0,
|
|
535153
|
+
(0, import_react128.useEffect)(() => {
|
|
534741
535154
|
const startCodebaseIndexing = async () => {
|
|
534742
535155
|
try {
|
|
534743
535156
|
const config3 = loadCodebaseConfig();
|
|
@@ -534859,7 +535272,7 @@ function ChatScreen({ autoResume, enableYolo }) {
|
|
|
534859
535272
|
}
|
|
534860
535273
|
};
|
|
534861
535274
|
}, []);
|
|
534862
|
-
(0,
|
|
535275
|
+
(0, import_react128.useEffect)(() => {
|
|
534863
535276
|
global.__stopCodebaseIndexing = async () => {
|
|
534864
535277
|
if (codebaseAgentRef.current) {
|
|
534865
535278
|
await codebaseAgentRef.current.stop();
|
|
@@ -534870,25 +535283,25 @@ function ChatScreen({ autoResume, enableYolo }) {
|
|
|
534870
535283
|
delete global.__stopCodebaseIndexing;
|
|
534871
535284
|
};
|
|
534872
535285
|
}, []);
|
|
534873
|
-
(0,
|
|
535286
|
+
(0, import_react128.useEffect)(() => {
|
|
534874
535287
|
try {
|
|
534875
535288
|
localStorage.setItem("snow-yolo-mode", String(yoloMode));
|
|
534876
535289
|
} catch {
|
|
534877
535290
|
}
|
|
534878
535291
|
}, [yoloMode]);
|
|
534879
|
-
(0,
|
|
535292
|
+
(0, import_react128.useEffect)(() => {
|
|
534880
535293
|
try {
|
|
534881
535294
|
localStorage.setItem("snow-plan-mode", String(planMode));
|
|
534882
535295
|
} catch {
|
|
534883
535296
|
}
|
|
534884
535297
|
}, [planMode]);
|
|
534885
|
-
(0,
|
|
535298
|
+
(0, import_react128.useEffect)(() => {
|
|
534886
535299
|
try {
|
|
534887
535300
|
localStorage.setItem("snow-vulnerability-hunting-mode", String(vulnerabilityHuntingMode));
|
|
534888
535301
|
} catch {
|
|
534889
535302
|
}
|
|
534890
535303
|
}, [vulnerabilityHuntingMode]);
|
|
534891
|
-
(0,
|
|
535304
|
+
(0, import_react128.useEffect)(() => {
|
|
534892
535305
|
const interval = setInterval(() => {
|
|
534893
535306
|
const currentSimpleMode = getSimpleMode();
|
|
534894
535307
|
if (currentSimpleMode !== simpleMode) {
|
|
@@ -534897,7 +535310,7 @@ function ChatScreen({ autoResume, enableYolo }) {
|
|
|
534897
535310
|
}, 1e3);
|
|
534898
535311
|
return () => clearInterval(interval);
|
|
534899
535312
|
}, [simpleMode]);
|
|
534900
|
-
(0,
|
|
535313
|
+
(0, import_react128.useEffect)(() => {
|
|
534901
535314
|
if (restoreInputContent !== null) {
|
|
534902
535315
|
const timer2 = setTimeout(() => {
|
|
534903
535316
|
setRestoreInputContent(null);
|
|
@@ -534906,7 +535319,7 @@ function ChatScreen({ autoResume, enableYolo }) {
|
|
|
534906
535319
|
}
|
|
534907
535320
|
return void 0;
|
|
534908
535321
|
}, [restoreInputContent]);
|
|
534909
|
-
(0,
|
|
535322
|
+
(0, import_react128.useEffect)(() => {
|
|
534910
535323
|
if (!autoResume) {
|
|
534911
535324
|
sessionManager.clearCurrentSession();
|
|
534912
535325
|
return;
|
|
@@ -534931,7 +535344,7 @@ function ChatScreen({ autoResume, enableYolo }) {
|
|
|
534931
535344
|
};
|
|
534932
535345
|
resumeSession();
|
|
534933
535346
|
}, [autoResume, initializeFromSession]);
|
|
534934
|
-
(0,
|
|
535347
|
+
(0, import_react128.useEffect)(() => {
|
|
534935
535348
|
if (isInitialMount.current) {
|
|
534936
535349
|
isInitialMount.current = false;
|
|
534937
535350
|
return;
|
|
@@ -534944,7 +535357,7 @@ function ChatScreen({ autoResume, enableYolo }) {
|
|
|
534944
535357
|
clearTimeout(handler);
|
|
534945
535358
|
};
|
|
534946
535359
|
}, [terminalWidth]);
|
|
534947
|
-
(0,
|
|
535360
|
+
(0, import_react128.useEffect)(() => {
|
|
534948
535361
|
if (remountKey === 0)
|
|
534949
535362
|
return;
|
|
534950
535363
|
const reloadMessages = async () => {
|
|
@@ -534956,8 +535369,8 @@ function ChatScreen({ autoResume, enableYolo }) {
|
|
|
534956
535369
|
};
|
|
534957
535370
|
reloadMessages();
|
|
534958
535371
|
}, [remountKey]);
|
|
534959
|
-
const { pendingToolConfirmation, requestToolConfirmation, isToolAutoApproved, addMultipleToAlwaysApproved } = useToolConfirmation();
|
|
534960
|
-
const [pendingUserQuestion, setPendingUserQuestion] = (0,
|
|
535372
|
+
const { pendingToolConfirmation, alwaysApprovedTools, requestToolConfirmation, isToolAutoApproved, addMultipleToAlwaysApproved, removeFromAlwaysApproved, clearAllAlwaysApproved } = useToolConfirmation(workingDirectory);
|
|
535373
|
+
const [pendingUserQuestion, setPendingUserQuestion] = (0, import_react128.useState)(null);
|
|
534961
535374
|
const requestUserQuestion = async (question, options3, toolCall) => {
|
|
534962
535375
|
return new Promise((resolve10) => {
|
|
534963
535376
|
setPendingUserQuestion({
|
|
@@ -535092,6 +535505,7 @@ function ChatScreen({ autoResume, enableYolo }) {
|
|
|
535092
535505
|
setShowCustomCommandConfig: panelState.setShowCustomCommandConfig,
|
|
535093
535506
|
setShowSkillsCreation: panelState.setShowSkillsCreation,
|
|
535094
535507
|
setShowWorkingDirPanel: panelState.setShowWorkingDirPanel,
|
|
535508
|
+
setShowPermissionsPanel,
|
|
535095
535509
|
setYoloMode,
|
|
535096
535510
|
setPlanMode,
|
|
535097
535511
|
setVulnerabilityHuntingMode,
|
|
@@ -535103,7 +535517,7 @@ function ChatScreen({ autoResume, enableYolo }) {
|
|
|
535103
535517
|
onQuit: handleQuit,
|
|
535104
535518
|
onReindexCodebase: handleReindexCodebase
|
|
535105
535519
|
});
|
|
535106
|
-
(0,
|
|
535520
|
+
(0, import_react128.useEffect)(() => {
|
|
535107
535521
|
if (!commandsLoaded) {
|
|
535108
535522
|
return;
|
|
535109
535523
|
}
|
|
@@ -535132,7 +535546,7 @@ function ChatScreen({ autoResume, enableYolo }) {
|
|
|
535132
535546
|
}, 0);
|
|
535133
535547
|
return () => clearTimeout(timer2);
|
|
535134
535548
|
}, [commandsLoaded]);
|
|
535135
|
-
(0,
|
|
535549
|
+
(0, import_react128.useEffect)(() => {
|
|
535136
535550
|
if (!streamingState.isStreaming && pendingMessages.length > 0) {
|
|
535137
535551
|
const timer2 = setTimeout(() => {
|
|
535138
535552
|
processPendingMessages();
|
|
@@ -535141,7 +535555,7 @@ function ChatScreen({ autoResume, enableYolo }) {
|
|
|
535141
535555
|
}
|
|
535142
535556
|
return void 0;
|
|
535143
535557
|
}, [streamingState.isStreaming, pendingMessages.length]);
|
|
535144
|
-
(0,
|
|
535558
|
+
(0, import_react128.useEffect)(() => {
|
|
535145
535559
|
const handleSearchEvent = (event) => {
|
|
535146
535560
|
if (event.type === "search-complete") {
|
|
535147
535561
|
streamingState.setCodebaseSearchStatus({
|
|
@@ -535178,6 +535592,9 @@ function ChatScreen({ autoResume, enableYolo }) {
|
|
|
535178
535592
|
};
|
|
535179
535593
|
}, [streamingState]);
|
|
535180
535594
|
use_input_default((input2, key) => {
|
|
535595
|
+
if (pendingToolConfirmation) {
|
|
535596
|
+
return;
|
|
535597
|
+
}
|
|
535181
535598
|
if (bashSensitiveCommand) {
|
|
535182
535599
|
if (input2.toLowerCase() === "y") {
|
|
535183
535600
|
bashSensitiveCommand.resolve(true);
|
|
@@ -535264,67 +535681,67 @@ function ChatScreen({ autoResume, enableYolo }) {
|
|
|
535264
535681
|
}
|
|
535265
535682
|
};
|
|
535266
535683
|
if (terminalHeight < MIN_TERMINAL_HEIGHT) {
|
|
535267
|
-
return
|
|
535684
|
+
return import_react128.default.createElement(
|
|
535268
535685
|
Box_default,
|
|
535269
535686
|
{ flexDirection: "column", padding: 2 },
|
|
535270
|
-
|
|
535687
|
+
import_react128.default.createElement(
|
|
535271
535688
|
Box_default,
|
|
535272
535689
|
{ borderStyle: "round", borderColor: "red", padding: 1 },
|
|
535273
|
-
|
|
535690
|
+
import_react128.default.createElement(Text, { color: "red", bold: true }, t.chatScreen.terminalTooSmall)
|
|
535274
535691
|
),
|
|
535275
|
-
|
|
535692
|
+
import_react128.default.createElement(
|
|
535276
535693
|
Box_default,
|
|
535277
535694
|
{ marginTop: 1 },
|
|
535278
|
-
|
|
535695
|
+
import_react128.default.createElement(Text, { color: "yellow" }, t.chatScreen.terminalResizePrompt.replace("{current}", terminalHeight.toString()).replace("{required}", MIN_TERMINAL_HEIGHT.toString()))
|
|
535279
535696
|
),
|
|
535280
|
-
|
|
535697
|
+
import_react128.default.createElement(
|
|
535281
535698
|
Box_default,
|
|
535282
535699
|
{ marginTop: 1 },
|
|
535283
|
-
|
|
535700
|
+
import_react128.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, t.chatScreen.terminalMinHeight)
|
|
535284
535701
|
)
|
|
535285
535702
|
);
|
|
535286
535703
|
}
|
|
535287
|
-
return
|
|
535704
|
+
return import_react128.default.createElement(
|
|
535288
535705
|
Box_default,
|
|
535289
535706
|
{ flexDirection: "column", height: "100%", width: terminalWidth },
|
|
535290
|
-
|
|
535291
|
-
|
|
535707
|
+
import_react128.default.createElement(Static, { key: remountKey, items: [
|
|
535708
|
+
import_react128.default.createElement(ChatHeader, { key: "header", terminalWidth, simpleMode, workingDirectory }),
|
|
535292
535709
|
...messages.filter((m) => !m.streaming).map((message, index, filteredMessages) => {
|
|
535293
535710
|
const isLastMessage = index === filteredMessages.length - 1;
|
|
535294
|
-
return
|
|
535711
|
+
return import_react128.default.createElement(MessageRenderer, { key: `msg-${index}`, message, index, isLastMessage, filteredMessages, terminalWidth, showThinking });
|
|
535295
535712
|
})
|
|
535296
535713
|
] }, (item) => item),
|
|
535297
|
-
|
|
535298
|
-
|
|
535714
|
+
import_react128.default.createElement(LoadingIndicator, { isStreaming: streamingState.isStreaming, isSaving, hasPendingToolConfirmation: !!pendingToolConfirmation, hasPendingUserQuestion: !!pendingUserQuestion, terminalWidth, animationFrame: streamingState.animationFrame, retryStatus: streamingState.retryStatus, codebaseSearchStatus: streamingState.codebaseSearchStatus, isReasoning: streamingState.isReasoning, streamTokenCount: streamingState.streamTokenCount, elapsedSeconds: streamingState.elapsedSeconds, currentModel: streamingState.currentModel }),
|
|
535715
|
+
import_react128.default.createElement(
|
|
535299
535716
|
Box_default,
|
|
535300
535717
|
{ paddingX: 1, width: terminalWidth },
|
|
535301
|
-
|
|
535718
|
+
import_react128.default.createElement(PendingMessages, { pendingMessages })
|
|
535302
535719
|
),
|
|
535303
|
-
hookError &&
|
|
535720
|
+
hookError && import_react128.default.createElement(
|
|
535304
535721
|
Box_default,
|
|
535305
535722
|
{ paddingX: 1, width: terminalWidth, marginBottom: 1 },
|
|
535306
|
-
|
|
535723
|
+
import_react128.default.createElement(HookErrorDisplay, { details: hookError })
|
|
535307
535724
|
),
|
|
535308
|
-
pendingToolConfirmation &&
|
|
535725
|
+
pendingToolConfirmation && import_react128.default.createElement(ToolConfirmation, { toolName: pendingToolConfirmation.batchToolNames || pendingToolConfirmation.tool.function.name, toolArguments: !pendingToolConfirmation.allTools ? pendingToolConfirmation.tool.function.arguments : void 0, allTools: pendingToolConfirmation.allTools, onConfirm: pendingToolConfirmation.resolve, onHookError: (error) => {
|
|
535309
535726
|
setHookError(error);
|
|
535310
535727
|
} }),
|
|
535311
|
-
bashSensitiveCommand &&
|
|
535728
|
+
bashSensitiveCommand && import_react128.default.createElement(
|
|
535312
535729
|
Box_default,
|
|
535313
535730
|
{ paddingX: 1, width: terminalWidth },
|
|
535314
|
-
|
|
535731
|
+
import_react128.default.createElement(BashCommandConfirmation, { command: bashSensitiveCommand.command, onConfirm: bashSensitiveCommand.resolve, terminalWidth })
|
|
535315
535732
|
),
|
|
535316
|
-
bashMode.state.isExecuting && bashMode.state.currentCommand &&
|
|
535733
|
+
bashMode.state.isExecuting && bashMode.state.currentCommand && import_react128.default.createElement(
|
|
535317
535734
|
Box_default,
|
|
535318
535735
|
{ paddingX: 1, width: terminalWidth },
|
|
535319
|
-
|
|
535736
|
+
import_react128.default.createElement(BashCommandExecutionStatus, { command: bashMode.state.currentCommand, timeout: bashMode.state.currentTimeout || 3e4, terminalWidth })
|
|
535320
535737
|
),
|
|
535321
|
-
terminalExecutionState.state.isExecuting && terminalExecutionState.state.command &&
|
|
535738
|
+
terminalExecutionState.state.isExecuting && terminalExecutionState.state.command && import_react128.default.createElement(
|
|
535322
535739
|
Box_default,
|
|
535323
535740
|
{ paddingX: 1, width: terminalWidth },
|
|
535324
|
-
|
|
535741
|
+
import_react128.default.createElement(BashCommandExecutionStatus, { command: terminalExecutionState.state.command, timeout: terminalExecutionState.state.timeout || 3e4, terminalWidth })
|
|
535325
535742
|
),
|
|
535326
|
-
pendingUserQuestion &&
|
|
535327
|
-
|
|
535743
|
+
pendingUserQuestion && import_react128.default.createElement(AskUserQuestion, { question: pendingUserQuestion.question, options: pendingUserQuestion.options, onAnswer: handleUserQuestionAnswer }),
|
|
535744
|
+
import_react128.default.createElement(PanelsManager, { terminalWidth, workingDirectory, showSessionPanel: panelState.showSessionPanel, showMcpPanel: panelState.showMcpPanel, showUsagePanel: panelState.showUsagePanel, showHelpPanel: panelState.showHelpPanel, showCustomCommandConfig: panelState.showCustomCommandConfig, showSkillsCreation: panelState.showSkillsCreation, showWorkingDirPanel: panelState.showWorkingDirPanel, setShowSessionPanel: panelState.setShowSessionPanel, setShowCustomCommandConfig: panelState.setShowCustomCommandConfig, setShowSkillsCreation: panelState.setShowSkillsCreation, setShowWorkingDirPanel: panelState.setShowWorkingDirPanel, handleSessionPanelSelect, onCustomCommandSave: async (name, command, type, location) => {
|
|
535328
535745
|
await saveCustomCommand(name, command, type, void 0, location, workingDirectory);
|
|
535329
535746
|
await registerCustomCommands(workingDirectory);
|
|
535330
535747
|
panelState.setShowCustomCommandConfig(false);
|
|
@@ -535370,8 +535787,26 @@ You can now edit these files to customize your skill.`,
|
|
|
535370
535787
|
setMessages((prev) => [...prev, errorMessage]);
|
|
535371
535788
|
}
|
|
535372
535789
|
} }),
|
|
535373
|
-
|
|
535374
|
-
|
|
535790
|
+
showPermissionsPanel && import_react128.default.createElement(
|
|
535791
|
+
Box_default,
|
|
535792
|
+
{ paddingX: 1, flexDirection: "column", width: terminalWidth },
|
|
535793
|
+
import_react128.default.createElement(
|
|
535794
|
+
import_react128.Suspense,
|
|
535795
|
+
{ fallback: import_react128.default.createElement(
|
|
535796
|
+
Box_default,
|
|
535797
|
+
null,
|
|
535798
|
+
import_react128.default.createElement(
|
|
535799
|
+
Text,
|
|
535800
|
+
null,
|
|
535801
|
+
import_react128.default.createElement(build_default, { type: "dots" }),
|
|
535802
|
+
" Loading..."
|
|
535803
|
+
)
|
|
535804
|
+
) },
|
|
535805
|
+
import_react128.default.createElement(PermissionsPanel2, { alwaysApprovedTools, onRemoveTool: removeFromAlwaysApproved, onClearAll: clearAllAlwaysApproved, onClose: () => setShowPermissionsPanel(false) })
|
|
535806
|
+
)
|
|
535807
|
+
),
|
|
535808
|
+
snapshotState.pendingRollback && import_react128.default.createElement(FileRollbackConfirmation, { fileCount: snapshotState.pendingRollback.fileCount, filePaths: snapshotState.pendingRollback.filePaths || [], onConfirm: handleRollbackConfirm }),
|
|
535809
|
+
!pendingToolConfirmation && !pendingUserQuestion && !bashSensitiveCommand && !isCompressing && !(panelState.showSessionPanel || panelState.showMcpPanel || panelState.showUsagePanel || panelState.showHelpPanel || panelState.showCustomCommandConfig || panelState.showSkillsCreation || panelState.showWorkingDirPanel || showPermissionsPanel) && !snapshotState.pendingRollback && import_react128.default.createElement(ChatFooter, { onSubmit: handleMessageSubmit, onCommand: handleCommandExecution, onHistorySelect: handleHistorySelect, onSwitchProfile: handleSwitchProfile, handleProfileSelect, handleHistorySelect, disabled: !!pendingToolConfirmation || !!bashSensitiveCommand || isExecutingTerminalCommand, isProcessing: streamingState.isStreaming || isSaving || bashMode.state.isExecuting, chatHistory: messages, yoloMode, setYoloMode, planMode, setPlanMode, vulnerabilityHuntingMode, setVulnerabilityHuntingMode, contextUsage: streamingState.contextUsage ? {
|
|
535375
535810
|
inputTokens: streamingState.contextUsage.prompt_tokens,
|
|
535376
535811
|
maxContextTokens: getOpenAiConfig().maxContextTokens || 4e3,
|
|
535377
535812
|
cacheCreationTokens: streamingState.contextUsage.cache_creation_input_tokens,
|
|
@@ -535386,12 +535821,13 @@ You can now edit these files to customize your skill.`,
|
|
|
535386
535821
|
}, profileSearchQuery: panelState.profileSearchQuery, setProfileSearchQuery: panelState.setProfileSearchQuery, vscodeConnectionStatus: vscodeState.vscodeConnectionStatus, editorContext: vscodeState.editorContext, codebaseIndexing, codebaseProgress, watcherEnabled, fileUpdateNotification, currentProfileName: panelState.currentProfileName, isCompressing, compressionError })
|
|
535387
535822
|
);
|
|
535388
535823
|
}
|
|
535389
|
-
var
|
|
535824
|
+
var import_react128, PermissionsPanel2;
|
|
535390
535825
|
var init_ChatScreen = __esm({
|
|
535391
535826
|
async "dist/ui/pages/ChatScreen.js"() {
|
|
535392
535827
|
"use strict";
|
|
535393
|
-
|
|
535828
|
+
import_react128 = __toESM(require_react(), 1);
|
|
535394
535829
|
await init_build2();
|
|
535830
|
+
await init_build3();
|
|
535395
535831
|
init_ansi_escapes();
|
|
535396
535832
|
init_I18nContext();
|
|
535397
535833
|
init_ThemeContext();
|
|
@@ -535432,6 +535868,7 @@ var init_ChatScreen = __esm({
|
|
|
535432
535868
|
init_codebaseConfig();
|
|
535433
535869
|
init_codebaseSearchEvents();
|
|
535434
535870
|
init_logger();
|
|
535871
|
+
PermissionsPanel2 = (0, import_react128.lazy)(() => init_PermissionsPanel().then(() => PermissionsPanel_exports));
|
|
535435
535872
|
}
|
|
535436
535873
|
});
|
|
535437
535874
|
|
|
@@ -535645,16 +536082,17 @@ ${warningColor}\u26A0 Tool Confirmation Required${resetColor} ${sensitiveCheck.i
|
|
|
535645
536082
|
});
|
|
535646
536083
|
}
|
|
535647
536084
|
function HeadlessModeScreen({ prompt, onComplete }) {
|
|
535648
|
-
const [messages, setMessages] = (0,
|
|
535649
|
-
const [isComplete, setIsComplete] = (0,
|
|
535650
|
-
const [lastDisplayedIndex, setLastDisplayedIndex] = (0,
|
|
535651
|
-
const [isWaitingForInput, setIsWaitingForInput] = (0,
|
|
536085
|
+
const [messages, setMessages] = (0, import_react129.useState)([]);
|
|
536086
|
+
const [isComplete, setIsComplete] = (0, import_react129.useState)(false);
|
|
536087
|
+
const [lastDisplayedIndex, setLastDisplayedIndex] = (0, import_react129.useState)(-1);
|
|
536088
|
+
const [isWaitingForInput, setIsWaitingForInput] = (0, import_react129.useState)(false);
|
|
535652
536089
|
const { stdout } = use_stdout_default();
|
|
536090
|
+
const workingDirectory = process.cwd();
|
|
535653
536091
|
const streamingState = useStreamingState();
|
|
535654
536092
|
const vscodeState = useVSCodeState();
|
|
535655
536093
|
const { saveMessage } = useSessionSave();
|
|
535656
|
-
const { isToolAutoApproved, addMultipleToAlwaysApproved } = useToolConfirmation();
|
|
535657
|
-
(0,
|
|
536094
|
+
const { isToolAutoApproved, addMultipleToAlwaysApproved } = useToolConfirmation(workingDirectory);
|
|
536095
|
+
(0, import_react129.useEffect)(() => {
|
|
535658
536096
|
const lastMessage = messages[messages.length - 1];
|
|
535659
536097
|
const currentIndex = messages.length - 1;
|
|
535660
536098
|
if (!lastMessage || currentIndex <= lastDisplayedIndex)
|
|
@@ -535706,7 +536144,7 @@ function HeadlessModeScreen({ prompt, onComplete }) {
|
|
|
535706
536144
|
}
|
|
535707
536145
|
}
|
|
535708
536146
|
}, [messages, lastDisplayedIndex]);
|
|
535709
|
-
(0,
|
|
536147
|
+
(0, import_react129.useEffect)(() => {
|
|
535710
536148
|
if (isWaitingForInput)
|
|
535711
536149
|
return;
|
|
535712
536150
|
if (streamingState.isStreaming) {
|
|
@@ -535823,19 +536261,19 @@ function HeadlessModeScreen({ prompt, onComplete }) {
|
|
|
535823
536261
|
}, 1e3);
|
|
535824
536262
|
}
|
|
535825
536263
|
};
|
|
535826
|
-
(0,
|
|
536264
|
+
(0, import_react129.useEffect)(() => {
|
|
535827
536265
|
processMessage();
|
|
535828
536266
|
}, []);
|
|
535829
536267
|
if (isComplete) {
|
|
535830
536268
|
return null;
|
|
535831
536269
|
}
|
|
535832
|
-
return
|
|
536270
|
+
return import_react129.default.createElement(import_react129.default.Fragment, null);
|
|
535833
536271
|
}
|
|
535834
|
-
var
|
|
536272
|
+
var import_react129, import_cli_highlight3, getTheme, getAnsiColor;
|
|
535835
536273
|
var init_HeadlessModeScreen = __esm({
|
|
535836
536274
|
async "dist/ui/pages/HeadlessModeScreen.js"() {
|
|
535837
536275
|
"use strict";
|
|
535838
|
-
|
|
536276
|
+
import_react129 = __toESM(require_react(), 1);
|
|
535839
536277
|
await init_build2();
|
|
535840
536278
|
init_ansi_escapes();
|
|
535841
536279
|
import_cli_highlight3 = __toESM(require_dist14(), 1);
|
|
@@ -536106,18 +536544,18 @@ function TaskManagerScreen({ onBack, onResumeTask }) {
|
|
|
536106
536544
|
var _a21;
|
|
536107
536545
|
const { theme: theme14 } = useTheme();
|
|
536108
536546
|
const { t } = useI18n();
|
|
536109
|
-
const [tasks, setTasks] = (0,
|
|
536110
|
-
const [selectedIndex, setSelectedIndex] = (0,
|
|
536111
|
-
const [scrollOffset, setScrollOffset] = (0,
|
|
536112
|
-
const [markedTasks, setMarkedTasks] = (0,
|
|
536113
|
-
const [isLoading, setIsLoading] = (0,
|
|
536114
|
-
const [viewMode, setViewMode] = (0,
|
|
536115
|
-
const [detailTask, setDetailTask] = (0,
|
|
536116
|
-
const [pendingAction, setPendingAction] = (0,
|
|
536117
|
-
const [rejectInputMode, setRejectInputMode] = (0,
|
|
536118
|
-
const [rejectReason, setRejectReason] = (0,
|
|
536547
|
+
const [tasks, setTasks] = (0, import_react130.useState)([]);
|
|
536548
|
+
const [selectedIndex, setSelectedIndex] = (0, import_react130.useState)(0);
|
|
536549
|
+
const [scrollOffset, setScrollOffset] = (0, import_react130.useState)(0);
|
|
536550
|
+
const [markedTasks, setMarkedTasks] = (0, import_react130.useState)(/* @__PURE__ */ new Set());
|
|
536551
|
+
const [isLoading, setIsLoading] = (0, import_react130.useState)(true);
|
|
536552
|
+
const [viewMode, setViewMode] = (0, import_react130.useState)("list");
|
|
536553
|
+
const [detailTask, setDetailTask] = (0, import_react130.useState)(null);
|
|
536554
|
+
const [pendingAction, setPendingAction] = (0, import_react130.useState)(null);
|
|
536555
|
+
const [rejectInputMode, setRejectInputMode] = (0, import_react130.useState)(false);
|
|
536556
|
+
const [rejectReason, setRejectReason] = (0, import_react130.useState)("");
|
|
536119
536557
|
const VISIBLE_ITEMS = 5;
|
|
536120
|
-
const loadTasks = (0,
|
|
536558
|
+
const loadTasks = (0, import_react130.useCallback)(async () => {
|
|
536121
536559
|
setIsLoading(true);
|
|
536122
536560
|
try {
|
|
536123
536561
|
const taskList = await taskManager.listTasks();
|
|
@@ -536129,10 +536567,10 @@ function TaskManagerScreen({ onBack, onResumeTask }) {
|
|
|
536129
536567
|
setIsLoading(false);
|
|
536130
536568
|
}
|
|
536131
536569
|
}, []);
|
|
536132
|
-
(0,
|
|
536570
|
+
(0, import_react130.useEffect)(() => {
|
|
536133
536571
|
void loadTasks();
|
|
536134
536572
|
}, [loadTasks]);
|
|
536135
|
-
(0,
|
|
536573
|
+
(0, import_react130.useEffect)(() => {
|
|
536136
536574
|
if (pendingAction) {
|
|
536137
536575
|
const timer2 = setTimeout(() => {
|
|
536138
536576
|
setPendingAction(null);
|
|
@@ -536141,7 +536579,7 @@ function TaskManagerScreen({ onBack, onResumeTask }) {
|
|
|
536141
536579
|
}
|
|
536142
536580
|
return void 0;
|
|
536143
536581
|
}, [pendingAction]);
|
|
536144
|
-
const handleDeleteTask = (0,
|
|
536582
|
+
const handleDeleteTask = (0, import_react130.useCallback)(async (taskId) => {
|
|
536145
536583
|
if (!taskId)
|
|
536146
536584
|
return;
|
|
536147
536585
|
const success = await taskManager.deleteTask(taskId);
|
|
@@ -536336,7 +536774,7 @@ function TaskManagerScreen({ onBack, onResumeTask }) {
|
|
|
536336
536774
|
return;
|
|
536337
536775
|
}
|
|
536338
536776
|
});
|
|
536339
|
-
const getStatusColor = (0,
|
|
536777
|
+
const getStatusColor = (0, import_react130.useCallback)((status) => {
|
|
536340
536778
|
switch (status) {
|
|
536341
536779
|
case "pending":
|
|
536342
536780
|
return "yellow";
|
|
@@ -536352,7 +536790,7 @@ function TaskManagerScreen({ onBack, onResumeTask }) {
|
|
|
536352
536790
|
return "gray";
|
|
536353
536791
|
}
|
|
536354
536792
|
}, []);
|
|
536355
|
-
const getStatusIcon = (0,
|
|
536793
|
+
const getStatusIcon = (0, import_react130.useCallback)((status) => {
|
|
536356
536794
|
switch (status) {
|
|
536357
536795
|
case "pending":
|
|
536358
536796
|
return "\u25CB";
|
|
@@ -536368,7 +536806,7 @@ function TaskManagerScreen({ onBack, onResumeTask }) {
|
|
|
536368
536806
|
return "?";
|
|
536369
536807
|
}
|
|
536370
536808
|
}, []);
|
|
536371
|
-
const formatDate = (0,
|
|
536809
|
+
const formatDate = (0, import_react130.useCallback)((timestamp) => {
|
|
536372
536810
|
const date = new Date(timestamp);
|
|
536373
536811
|
const now = /* @__PURE__ */ new Date();
|
|
536374
536812
|
const diffMs = now.getTime() - date.getTime();
|
|
@@ -536386,24 +536824,24 @@ function TaskManagerScreen({ onBack, onResumeTask }) {
|
|
|
536386
536824
|
return date.toLocaleDateString("en-US", { month: "short", day: "numeric" });
|
|
536387
536825
|
}, []);
|
|
536388
536826
|
if (isLoading) {
|
|
536389
|
-
return
|
|
536827
|
+
return import_react130.default.createElement(
|
|
536390
536828
|
Box_default,
|
|
536391
536829
|
{ flexDirection: "column", paddingX: 1 },
|
|
536392
|
-
|
|
536830
|
+
import_react130.default.createElement(
|
|
536393
536831
|
Box_default,
|
|
536394
536832
|
{ borderStyle: "round", borderColor: theme14.colors.menuInfo, paddingX: 1 },
|
|
536395
|
-
|
|
536833
|
+
import_react130.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, t.taskManager.loadingTasks)
|
|
536396
536834
|
)
|
|
536397
536835
|
);
|
|
536398
536836
|
}
|
|
536399
536837
|
if (tasks.length === 0) {
|
|
536400
|
-
return
|
|
536838
|
+
return import_react130.default.createElement(
|
|
536401
536839
|
Box_default,
|
|
536402
536840
|
{ flexDirection: "column", paddingX: 1 },
|
|
536403
|
-
|
|
536841
|
+
import_react130.default.createElement(
|
|
536404
536842
|
Box_default,
|
|
536405
536843
|
{ borderStyle: "round", borderColor: theme14.colors.warning, paddingX: 1 },
|
|
536406
|
-
|
|
536844
|
+
import_react130.default.createElement(
|
|
536407
536845
|
Text,
|
|
536408
536846
|
{ color: theme14.colors.menuSecondary, dimColor: true },
|
|
536409
536847
|
t.taskManager.noTasksFound,
|
|
@@ -536417,32 +536855,32 @@ function TaskManagerScreen({ onBack, onResumeTask }) {
|
|
|
536417
536855
|
);
|
|
536418
536856
|
}
|
|
536419
536857
|
if (viewMode === "detail" && detailTask) {
|
|
536420
|
-
return
|
|
536858
|
+
return import_react130.default.createElement(
|
|
536421
536859
|
Box_default,
|
|
536422
536860
|
{ flexDirection: "column", paddingX: 1 },
|
|
536423
|
-
|
|
536861
|
+
import_react130.default.createElement(
|
|
536424
536862
|
Box_default,
|
|
536425
536863
|
{ borderStyle: "round", borderColor: theme14.colors.menuInfo, paddingX: 1, flexDirection: "column" },
|
|
536426
|
-
|
|
536864
|
+
import_react130.default.createElement(
|
|
536427
536865
|
Box_default,
|
|
536428
536866
|
{ flexDirection: "column", marginBottom: 1 },
|
|
536429
|
-
|
|
536430
|
-
|
|
536867
|
+
import_react130.default.createElement(Text, { color: theme14.colors.menuInfo, bold: true }, t.taskManager.taskDetailsTitle),
|
|
536868
|
+
import_react130.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, detailTask.status === "paused" ? t.taskManager.backToList : `${t.taskManager.continueHint} \u2022 ${t.taskManager.backToList}`)
|
|
536431
536869
|
),
|
|
536432
|
-
|
|
536870
|
+
import_react130.default.createElement(
|
|
536433
536871
|
Box_default,
|
|
536434
536872
|
{ flexDirection: "column", gap: 1 },
|
|
536435
|
-
|
|
536873
|
+
import_react130.default.createElement(
|
|
536436
536874
|
Box_default,
|
|
536437
536875
|
{ flexDirection: "column" },
|
|
536438
|
-
|
|
536439
|
-
|
|
536876
|
+
import_react130.default.createElement(Text, { color: theme14.colors.menuSecondary }, t.taskManager.titleLabel),
|
|
536877
|
+
import_react130.default.createElement(Text, null, detailTask.title || t.taskManager.untitled)
|
|
536440
536878
|
),
|
|
536441
|
-
|
|
536879
|
+
import_react130.default.createElement(
|
|
536442
536880
|
Box_default,
|
|
536443
536881
|
{ flexDirection: "column" },
|
|
536444
|
-
|
|
536445
|
-
|
|
536882
|
+
import_react130.default.createElement(Text, { color: theme14.colors.menuSecondary }, t.taskManager.statusLabel),
|
|
536883
|
+
import_react130.default.createElement(
|
|
536446
536884
|
Text,
|
|
536447
536885
|
{ color: getStatusColor(detailTask.status) },
|
|
536448
536886
|
getStatusIcon(detailTask.status),
|
|
@@ -536450,64 +536888,64 @@ function TaskManagerScreen({ onBack, onResumeTask }) {
|
|
|
536450
536888
|
detailTask.status
|
|
536451
536889
|
)
|
|
536452
536890
|
),
|
|
536453
|
-
|
|
536891
|
+
import_react130.default.createElement(
|
|
536454
536892
|
Box_default,
|
|
536455
536893
|
{ flexDirection: "column" },
|
|
536456
|
-
|
|
536457
|
-
|
|
536894
|
+
import_react130.default.createElement(Text, { color: theme14.colors.menuSecondary }, t.taskManager.createdLabel),
|
|
536895
|
+
import_react130.default.createElement(Text, null, new Date(detailTask.createdAt).toLocaleString())
|
|
536458
536896
|
),
|
|
536459
|
-
|
|
536897
|
+
import_react130.default.createElement(
|
|
536460
536898
|
Box_default,
|
|
536461
536899
|
{ flexDirection: "column" },
|
|
536462
|
-
|
|
536463
|
-
|
|
536900
|
+
import_react130.default.createElement(Text, { color: theme14.colors.menuSecondary }, t.taskManager.updatedLabel),
|
|
536901
|
+
import_react130.default.createElement(Text, null, new Date(detailTask.updatedAt).toLocaleString())
|
|
536464
536902
|
),
|
|
536465
|
-
|
|
536903
|
+
import_react130.default.createElement(
|
|
536466
536904
|
Box_default,
|
|
536467
536905
|
{ flexDirection: "column" },
|
|
536468
|
-
|
|
536906
|
+
import_react130.default.createElement(Text, { color: theme14.colors.menuSecondary }, t.taskManager.messagesLabel.replace("{count}", String(detailTask.messages.length)))
|
|
536469
536907
|
),
|
|
536470
|
-
detailTask.status === "paused" && ((_a21 = detailTask.pausedInfo) == null ? void 0 : _a21.sensitiveCommand) &&
|
|
536908
|
+
detailTask.status === "paused" && ((_a21 = detailTask.pausedInfo) == null ? void 0 : _a21.sensitiveCommand) && import_react130.default.createElement(
|
|
536471
536909
|
Box_default,
|
|
536472
536910
|
{ flexDirection: "column", marginTop: 1 },
|
|
536473
|
-
|
|
536911
|
+
import_react130.default.createElement(
|
|
536474
536912
|
Box_default,
|
|
536475
536913
|
{ flexDirection: "column", borderStyle: "round", borderColor: "yellow", paddingX: 1, paddingY: 1 },
|
|
536476
|
-
|
|
536477
|
-
|
|
536914
|
+
import_react130.default.createElement(Text, { color: "yellow", bold: true }, t.taskManager.sensitiveCommandDetected),
|
|
536915
|
+
import_react130.default.createElement(
|
|
536478
536916
|
Box_default,
|
|
536479
536917
|
{ marginTop: 1 },
|
|
536480
|
-
|
|
536918
|
+
import_react130.default.createElement(
|
|
536481
536919
|
Text,
|
|
536482
536920
|
null,
|
|
536483
|
-
|
|
536484
|
-
|
|
536921
|
+
import_react130.default.createElement(Text, { bold: true }, t.taskManager.commandLabel),
|
|
536922
|
+
import_react130.default.createElement(Text, { color: "yellow" }, detailTask.pausedInfo.sensitiveCommand.command)
|
|
536485
536923
|
)
|
|
536486
536924
|
),
|
|
536487
|
-
detailTask.pausedInfo.sensitiveCommand.description &&
|
|
536488
|
-
!rejectInputMode ?
|
|
536925
|
+
detailTask.pausedInfo.sensitiveCommand.description && import_react130.default.createElement(Text, { dimColor: true }, detailTask.pausedInfo.sensitiveCommand.description),
|
|
536926
|
+
!rejectInputMode ? import_react130.default.createElement(
|
|
536489
536927
|
Box_default,
|
|
536490
536928
|
{ marginTop: 1, paddingTop: 1, borderStyle: "single", borderTop: true, borderBottom: false, borderLeft: false, borderRight: false, borderColor: "gray", flexDirection: "column" },
|
|
536491
|
-
|
|
536492
|
-
) :
|
|
536929
|
+
import_react130.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, t.taskManager.approveRejectHint)
|
|
536930
|
+
) : import_react130.default.createElement(
|
|
536493
536931
|
Box_default,
|
|
536494
536932
|
{ marginTop: 1, paddingTop: 1, borderStyle: "single", borderTop: true, borderBottom: false, borderLeft: false, borderRight: false, borderColor: "gray", flexDirection: "column" },
|
|
536495
|
-
|
|
536496
|
-
|
|
536933
|
+
import_react130.default.createElement(Text, { color: "yellow", bold: true }, t.taskManager.enterRejectionReason),
|
|
536934
|
+
import_react130.default.createElement(
|
|
536497
536935
|
Text,
|
|
536498
536936
|
null,
|
|
536499
536937
|
rejectReason,
|
|
536500
|
-
|
|
536938
|
+
import_react130.default.createElement(Text, { color: theme14.colors.menuInfo }, "\u2588")
|
|
536501
536939
|
),
|
|
536502
|
-
|
|
536940
|
+
import_react130.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, t.taskManager.submitCancelHint)
|
|
536503
536941
|
)
|
|
536504
536942
|
)
|
|
536505
536943
|
)
|
|
536506
536944
|
),
|
|
536507
|
-
(pendingAction == null ? void 0 : pendingAction.type) === "continue" && pendingAction.taskId === detailTask.id &&
|
|
536945
|
+
(pendingAction == null ? void 0 : pendingAction.type) === "continue" && pendingAction.taskId === detailTask.id && import_react130.default.createElement(
|
|
536508
536946
|
Box_default,
|
|
536509
536947
|
{ marginTop: 1 },
|
|
536510
|
-
|
|
536948
|
+
import_react130.default.createElement(Alert, { variant: "warning" }, detailTask.status !== "completed" ? t.taskManager.taskNotCompleted : t.taskManager.confirmConvertToSession)
|
|
536511
536949
|
)
|
|
536512
536950
|
)
|
|
536513
536951
|
);
|
|
@@ -536516,21 +536954,21 @@ function TaskManagerScreen({ onBack, onResumeTask }) {
|
|
|
536516
536954
|
const hasMore = tasks.length > scrollOffset + VISIBLE_ITEMS;
|
|
536517
536955
|
const hasPrevious = scrollOffset > 0;
|
|
536518
536956
|
const currentTask = tasks[selectedIndex];
|
|
536519
|
-
return
|
|
536957
|
+
return import_react130.default.createElement(
|
|
536520
536958
|
Box_default,
|
|
536521
536959
|
{ flexDirection: "column", paddingX: 1 },
|
|
536522
|
-
|
|
536960
|
+
import_react130.default.createElement(
|
|
536523
536961
|
Box_default,
|
|
536524
536962
|
{ borderStyle: "round", borderColor: theme14.colors.menuInfo, paddingX: 1, flexDirection: "column" },
|
|
536525
|
-
|
|
536963
|
+
import_react130.default.createElement(
|
|
536526
536964
|
Box_default,
|
|
536527
536965
|
{ flexDirection: "column" },
|
|
536528
|
-
|
|
536966
|
+
import_react130.default.createElement(
|
|
536529
536967
|
Text,
|
|
536530
536968
|
{ color: theme14.colors.menuInfo, dimColor: true },
|
|
536531
536969
|
t.taskManager.tasksCount.replace("{current}", String(selectedIndex + 1)).replace("{total}", String(tasks.length)),
|
|
536532
536970
|
currentTask && ` \u2022 ${t.taskManager.messagesCount.replace("{count}", String(currentTask.messageCount))}`,
|
|
536533
|
-
markedTasks.size > 0 &&
|
|
536971
|
+
markedTasks.size > 0 && import_react130.default.createElement(
|
|
536534
536972
|
Text,
|
|
536535
536973
|
{ color: theme14.colors.warning },
|
|
536536
536974
|
" ",
|
|
@@ -536539,9 +536977,9 @@ function TaskManagerScreen({ onBack, onResumeTask }) {
|
|
|
536539
536977
|
t.taskManager.markedCount.replace("{count}", String(markedTasks.size))
|
|
536540
536978
|
)
|
|
536541
536979
|
),
|
|
536542
|
-
|
|
536980
|
+
import_react130.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, t.taskManager.navigationHint)
|
|
536543
536981
|
),
|
|
536544
|
-
hasPrevious &&
|
|
536982
|
+
hasPrevious && import_react130.default.createElement(
|
|
536545
536983
|
Text,
|
|
536546
536984
|
{ color: theme14.colors.menuSecondary, dimColor: true },
|
|
536547
536985
|
" ",
|
|
@@ -536554,24 +536992,24 @@ function TaskManagerScreen({ onBack, onResumeTask }) {
|
|
|
536554
536992
|
const cleanTitle = (task.title || t.taskManager.untitled).replace(/[\r\n\t]+/g, " ");
|
|
536555
536993
|
const timeStr = formatDate(task.updatedAt);
|
|
536556
536994
|
const truncatedTitle = cleanTitle.length > 50 ? cleanTitle.slice(0, 47) + "..." : cleanTitle;
|
|
536557
|
-
return
|
|
536995
|
+
return import_react130.default.createElement(
|
|
536558
536996
|
Text,
|
|
536559
536997
|
{ key: task.id },
|
|
536560
|
-
|
|
536998
|
+
import_react130.default.createElement(
|
|
536561
536999
|
Text,
|
|
536562
537000
|
{ color: isSelected ? theme14.colors.menuSelected : "white" },
|
|
536563
537001
|
isSelected ? "\u276F " : " ",
|
|
536564
|
-
isMarked &&
|
|
537002
|
+
isMarked && import_react130.default.createElement(
|
|
536565
537003
|
Text,
|
|
536566
537004
|
{ color: theme14.colors.warning, bold: true },
|
|
536567
537005
|
"\u25CF",
|
|
536568
537006
|
" "
|
|
536569
537007
|
),
|
|
536570
|
-
|
|
537008
|
+
import_react130.default.createElement(Text, { color: getStatusColor(task.status) }, getStatusIcon(task.status)),
|
|
536571
537009
|
" ",
|
|
536572
537010
|
truncatedTitle
|
|
536573
537011
|
),
|
|
536574
|
-
|
|
537012
|
+
import_react130.default.createElement(
|
|
536575
537013
|
Text,
|
|
536576
537014
|
{ color: theme14.colors.menuSecondary, dimColor: true },
|
|
536577
537015
|
" ",
|
|
@@ -536580,25 +537018,25 @@ function TaskManagerScreen({ onBack, onResumeTask }) {
|
|
|
536580
537018
|
)
|
|
536581
537019
|
);
|
|
536582
537020
|
}),
|
|
536583
|
-
hasMore &&
|
|
537021
|
+
hasMore && import_react130.default.createElement(
|
|
536584
537022
|
Text,
|
|
536585
537023
|
{ color: theme14.colors.menuSecondary, dimColor: true },
|
|
536586
537024
|
" ",
|
|
536587
537025
|
t.taskManager.moreBelow.replace("{count}", String(tasks.length - scrollOffset - VISIBLE_ITEMS))
|
|
536588
537026
|
)
|
|
536589
537027
|
),
|
|
536590
|
-
(pendingAction == null ? void 0 : pendingAction.type) === "delete" &&
|
|
537028
|
+
(pendingAction == null ? void 0 : pendingAction.type) === "delete" && import_react130.default.createElement(
|
|
536591
537029
|
Box_default,
|
|
536592
537030
|
{ marginTop: 1 },
|
|
536593
|
-
|
|
537031
|
+
import_react130.default.createElement(Alert, { variant: "warning" }, pendingAction.taskId ? t.taskManager.deleteConfirm : t.taskManager.deleteMultipleConfirm.replace("{count}", String(markedTasks.size)))
|
|
536594
537032
|
)
|
|
536595
537033
|
);
|
|
536596
537034
|
}
|
|
536597
|
-
var
|
|
537035
|
+
var import_react130;
|
|
536598
537036
|
var init_TaskManagerScreen = __esm({
|
|
536599
537037
|
async "dist/ui/pages/TaskManagerScreen.js"() {
|
|
536600
537038
|
"use strict";
|
|
536601
|
-
|
|
537039
|
+
import_react130 = __toESM(require_react(), 1);
|
|
536602
537040
|
await init_build2();
|
|
536603
537041
|
await init_build4();
|
|
536604
537042
|
init_ThemeContext();
|
|
@@ -536613,8 +537051,8 @@ __export(MCPConfigScreen_exports, {
|
|
|
536613
537051
|
default: () => MCPConfigScreen
|
|
536614
537052
|
});
|
|
536615
537053
|
import { spawn as spawn6, execSync as execSync5 } from "child_process";
|
|
536616
|
-
import { writeFileSync as
|
|
536617
|
-
import { join as
|
|
537054
|
+
import { writeFileSync as writeFileSync12, readFileSync as readFileSync18, existsSync as existsSync23 } from "fs";
|
|
537055
|
+
import { join as join26 } from "path";
|
|
536618
537056
|
import { homedir as homedir16, platform as platform4 } from "os";
|
|
536619
537057
|
function checkCommandExists2(command) {
|
|
536620
537058
|
if (platform4() === "win32") {
|
|
@@ -536666,10 +537104,10 @@ function getSystemEditor() {
|
|
|
536666
537104
|
}
|
|
536667
537105
|
function MCPConfigScreen({ onBack }) {
|
|
536668
537106
|
const { exit } = use_app_default();
|
|
536669
|
-
(0,
|
|
537107
|
+
(0, import_react131.useEffect)(() => {
|
|
536670
537108
|
const openEditor = async () => {
|
|
536671
537109
|
const config3 = getMCPConfig();
|
|
536672
|
-
|
|
537110
|
+
writeFileSync12(MCP_CONFIG_FILE2, JSON.stringify(config3, null, 2), "utf8");
|
|
536673
537111
|
const editor = getSystemEditor();
|
|
536674
537112
|
if (!editor) {
|
|
536675
537113
|
console.error("No text editor found! Please set the EDITOR or VISUAL environment variable.");
|
|
@@ -536701,9 +537139,9 @@ function MCPConfigScreen({ onBack }) {
|
|
|
536701
537139
|
stdio: "inherit"
|
|
536702
537140
|
});
|
|
536703
537141
|
child.on("close", () => {
|
|
536704
|
-
if (
|
|
537142
|
+
if (existsSync23(MCP_CONFIG_FILE2)) {
|
|
536705
537143
|
try {
|
|
536706
|
-
const editedContent =
|
|
537144
|
+
const editedContent = readFileSync18(MCP_CONFIG_FILE2, "utf8");
|
|
536707
537145
|
const parsedConfig = JSON.parse(editedContent);
|
|
536708
537146
|
const validationErrors = validateMCPConfig(parsedConfig);
|
|
536709
537147
|
if (validationErrors.length === 0) {
|
|
@@ -536726,16 +537164,16 @@ function MCPConfigScreen({ onBack }) {
|
|
|
536726
537164
|
}, [exit, onBack]);
|
|
536727
537165
|
return null;
|
|
536728
537166
|
}
|
|
536729
|
-
var
|
|
537167
|
+
var import_react131, CONFIG_DIR8, MCP_CONFIG_FILE2;
|
|
536730
537168
|
var init_MCPConfigScreen = __esm({
|
|
536731
537169
|
async "dist/ui/pages/MCPConfigScreen.js"() {
|
|
536732
537170
|
"use strict";
|
|
536733
|
-
|
|
537171
|
+
import_react131 = __toESM(require_react(), 1);
|
|
536734
537172
|
await init_build2();
|
|
536735
537173
|
init_apiConfig();
|
|
536736
537174
|
init_processManager();
|
|
536737
|
-
CONFIG_DIR8 =
|
|
536738
|
-
MCP_CONFIG_FILE2 =
|
|
537175
|
+
CONFIG_DIR8 = join26(homedir16(), ".snow");
|
|
537176
|
+
MCP_CONFIG_FILE2 = join26(CONFIG_DIR8, "mcp-config.json");
|
|
536739
537177
|
}
|
|
536740
537178
|
});
|
|
536741
537179
|
|
|
@@ -536745,9 +537183,9 @@ __export(app_exports, {
|
|
|
536745
537183
|
default: () => App2
|
|
536746
537184
|
});
|
|
536747
537185
|
function ShowTaskListWrapper() {
|
|
536748
|
-
const [currentView, setCurrentView] = (0,
|
|
536749
|
-
const [chatScreenKey, setChatScreenKey] = (0,
|
|
536750
|
-
const [exitNotification, setExitNotification] = (0,
|
|
537186
|
+
const [currentView, setCurrentView] = (0, import_react132.useState)("tasks");
|
|
537187
|
+
const [chatScreenKey, setChatScreenKey] = (0, import_react132.useState)(0);
|
|
537188
|
+
const [exitNotification, setExitNotification] = (0, import_react132.useState)({
|
|
536751
537189
|
show: false,
|
|
536752
537190
|
message: ""
|
|
536753
537191
|
});
|
|
@@ -536756,44 +537194,44 @@ function ShowTaskListWrapper() {
|
|
|
536756
537194
|
useGlobalExit(setExitNotification);
|
|
536757
537195
|
const renderView = () => {
|
|
536758
537196
|
if (currentView === "chat") {
|
|
536759
|
-
return
|
|
536760
|
-
|
|
537197
|
+
return import_react132.default.createElement(
|
|
537198
|
+
import_react132.Suspense,
|
|
536761
537199
|
{ fallback: loadingFallback },
|
|
536762
|
-
|
|
537200
|
+
import_react132.default.createElement(ChatScreen2, { key: chatScreenKey, autoResume: true, enableYolo: false })
|
|
536763
537201
|
);
|
|
536764
537202
|
}
|
|
536765
|
-
return
|
|
536766
|
-
|
|
537203
|
+
return import_react132.default.createElement(
|
|
537204
|
+
import_react132.Suspense,
|
|
536767
537205
|
{ fallback: loadingFallback },
|
|
536768
|
-
|
|
537206
|
+
import_react132.default.createElement(TaskManagerScreen2, { onBack: () => gracefulExit(), onResumeTask: () => {
|
|
536769
537207
|
setCurrentView("chat");
|
|
536770
537208
|
setChatScreenKey((prev) => prev + 1);
|
|
536771
537209
|
} })
|
|
536772
537210
|
);
|
|
536773
537211
|
};
|
|
536774
|
-
return
|
|
537212
|
+
return import_react132.default.createElement(
|
|
536775
537213
|
Box_default,
|
|
536776
537214
|
{ flexDirection: "column", width: terminalWidth },
|
|
536777
537215
|
renderView(),
|
|
536778
|
-
exitNotification.show &&
|
|
537216
|
+
exitNotification.show && import_react132.default.createElement(
|
|
536779
537217
|
Box_default,
|
|
536780
537218
|
{ paddingX: 1, flexShrink: 0 },
|
|
536781
|
-
|
|
537219
|
+
import_react132.default.createElement(Alert, { variant: "warning" }, exitNotification.message)
|
|
536782
537220
|
)
|
|
536783
537221
|
);
|
|
536784
537222
|
}
|
|
536785
537223
|
function AppContent({ version: version2, skipWelcome, autoResume, enableYolo }) {
|
|
536786
|
-
const [currentView, setCurrentView] = (0,
|
|
536787
|
-
const [chatScreenKey, setChatScreenKey] = (0,
|
|
536788
|
-
const [welcomeMenuIndex, setWelcomeMenuIndex] = (0,
|
|
536789
|
-
const [shouldAutoResume, setShouldAutoResume] = (0,
|
|
536790
|
-
const [exitNotification, setExitNotification] = (0,
|
|
537224
|
+
const [currentView, setCurrentView] = (0, import_react132.useState)(skipWelcome ? "chat" : "welcome");
|
|
537225
|
+
const [chatScreenKey, setChatScreenKey] = (0, import_react132.useState)(0);
|
|
537226
|
+
const [welcomeMenuIndex, setWelcomeMenuIndex] = (0, import_react132.useState)(0);
|
|
537227
|
+
const [shouldAutoResume, setShouldAutoResume] = (0, import_react132.useState)(false);
|
|
537228
|
+
const [exitNotification, setExitNotification] = (0, import_react132.useState)({
|
|
536791
537229
|
show: false,
|
|
536792
537230
|
message: ""
|
|
536793
537231
|
});
|
|
536794
537232
|
const { columns: terminalWidth } = useTerminalSize();
|
|
536795
537233
|
useGlobalExit(setExitNotification);
|
|
536796
|
-
(0,
|
|
537234
|
+
(0, import_react132.useEffect)(() => {
|
|
536797
537235
|
const unsubscribe = onNavigate((event) => {
|
|
536798
537236
|
if (event.destination === "welcome" && currentView === "chat") {
|
|
536799
537237
|
setChatScreenKey((prev) => prev + 1);
|
|
@@ -536821,113 +537259,113 @@ function AppContent({ version: version2, skipWelcome, autoResume, enableYolo })
|
|
|
536821
537259
|
const loadingFallback = null;
|
|
536822
537260
|
switch (currentView) {
|
|
536823
537261
|
case "welcome":
|
|
536824
|
-
return
|
|
536825
|
-
|
|
537262
|
+
return import_react132.default.createElement(
|
|
537263
|
+
import_react132.Suspense,
|
|
536826
537264
|
{ fallback: loadingFallback },
|
|
536827
|
-
|
|
537265
|
+
import_react132.default.createElement(WelcomeScreen2, { version: version2, onMenuSelect: handleMenuSelect, defaultMenuIndex: welcomeMenuIndex, onMenuSelectionPersist: setWelcomeMenuIndex })
|
|
536828
537266
|
);
|
|
536829
537267
|
case "chat":
|
|
536830
|
-
return
|
|
536831
|
-
|
|
537268
|
+
return import_react132.default.createElement(
|
|
537269
|
+
import_react132.Suspense,
|
|
536832
537270
|
{ fallback: loadingFallback },
|
|
536833
|
-
|
|
537271
|
+
import_react132.default.createElement(ChatScreen2, { key: chatScreenKey, autoResume: autoResume || shouldAutoResume, enableYolo })
|
|
536834
537272
|
);
|
|
536835
537273
|
case "settings":
|
|
536836
|
-
return
|
|
537274
|
+
return import_react132.default.createElement(
|
|
536837
537275
|
Box_default,
|
|
536838
537276
|
{ flexDirection: "column" },
|
|
536839
|
-
|
|
536840
|
-
|
|
537277
|
+
import_react132.default.createElement(Text, { color: "blue" }, "Settings"),
|
|
537278
|
+
import_react132.default.createElement(Text, { color: "gray" }, "Settings interface would be implemented here")
|
|
536841
537279
|
);
|
|
536842
537280
|
case "mcp":
|
|
536843
|
-
return
|
|
536844
|
-
|
|
537281
|
+
return import_react132.default.createElement(
|
|
537282
|
+
import_react132.Suspense,
|
|
536845
537283
|
{ fallback: loadingFallback },
|
|
536846
|
-
|
|
537284
|
+
import_react132.default.createElement(MCPConfigScreen2, { onBack: () => setCurrentView("welcome"), onSave: () => setCurrentView("welcome") })
|
|
536847
537285
|
);
|
|
536848
537286
|
case "systemprompt":
|
|
536849
|
-
return
|
|
536850
|
-
|
|
537287
|
+
return import_react132.default.createElement(
|
|
537288
|
+
import_react132.Suspense,
|
|
536851
537289
|
{ fallback: loadingFallback },
|
|
536852
|
-
|
|
537290
|
+
import_react132.default.createElement(SystemPromptConfigScreen3, { onBack: () => setCurrentView("welcome") })
|
|
536853
537291
|
);
|
|
536854
537292
|
case "customheaders":
|
|
536855
|
-
return
|
|
536856
|
-
|
|
537293
|
+
return import_react132.default.createElement(
|
|
537294
|
+
import_react132.Suspense,
|
|
536857
537295
|
{ fallback: loadingFallback },
|
|
536858
|
-
|
|
537296
|
+
import_react132.default.createElement(CustomHeadersScreen3, { onBack: () => setCurrentView("welcome") })
|
|
536859
537297
|
);
|
|
536860
537298
|
case "tasks":
|
|
536861
|
-
return
|
|
536862
|
-
|
|
537299
|
+
return import_react132.default.createElement(
|
|
537300
|
+
import_react132.Suspense,
|
|
536863
537301
|
{ fallback: loadingFallback },
|
|
536864
|
-
|
|
537302
|
+
import_react132.default.createElement(TaskManagerScreen2, { onBack: () => setCurrentView("welcome"), onResumeTask: () => {
|
|
536865
537303
|
setCurrentView("chat");
|
|
536866
537304
|
setChatScreenKey((prev) => prev + 1);
|
|
536867
537305
|
} })
|
|
536868
537306
|
);
|
|
536869
537307
|
default:
|
|
536870
|
-
return
|
|
536871
|
-
|
|
537308
|
+
return import_react132.default.createElement(
|
|
537309
|
+
import_react132.Suspense,
|
|
536872
537310
|
{ fallback: loadingFallback },
|
|
536873
|
-
|
|
537311
|
+
import_react132.default.createElement(WelcomeScreen2, { version: version2, onMenuSelect: handleMenuSelect, defaultMenuIndex: welcomeMenuIndex, onMenuSelectionPersist: setWelcomeMenuIndex })
|
|
536874
537312
|
);
|
|
536875
537313
|
}
|
|
536876
537314
|
};
|
|
536877
|
-
return
|
|
537315
|
+
return import_react132.default.createElement(
|
|
536878
537316
|
Box_default,
|
|
536879
537317
|
{ flexDirection: "column", width: terminalWidth },
|
|
536880
537318
|
renderView(),
|
|
536881
|
-
exitNotification.show &&
|
|
537319
|
+
exitNotification.show && import_react132.default.createElement(
|
|
536882
537320
|
Box_default,
|
|
536883
537321
|
{ paddingX: 1, flexShrink: 0 },
|
|
536884
|
-
|
|
537322
|
+
import_react132.default.createElement(Alert, { variant: "warning" }, exitNotification.message)
|
|
536885
537323
|
)
|
|
536886
537324
|
);
|
|
536887
537325
|
}
|
|
536888
537326
|
function App2({ version: version2, skipWelcome, autoResume, headlessPrompt, showTaskList, enableYolo }) {
|
|
536889
537327
|
if (headlessPrompt) {
|
|
536890
537328
|
const loadingFallback = null;
|
|
536891
|
-
return
|
|
537329
|
+
return import_react132.default.createElement(
|
|
536892
537330
|
I18nProvider,
|
|
536893
537331
|
null,
|
|
536894
|
-
|
|
537332
|
+
import_react132.default.createElement(
|
|
536895
537333
|
ThemeProvider,
|
|
536896
537334
|
null,
|
|
536897
|
-
|
|
536898
|
-
|
|
537335
|
+
import_react132.default.createElement(
|
|
537336
|
+
import_react132.Suspense,
|
|
536899
537337
|
{ fallback: loadingFallback },
|
|
536900
|
-
|
|
537338
|
+
import_react132.default.createElement(HeadlessModeScreen2, { prompt: headlessPrompt, onComplete: () => gracefulExit() })
|
|
536901
537339
|
)
|
|
536902
537340
|
)
|
|
536903
537341
|
);
|
|
536904
537342
|
}
|
|
536905
537343
|
if (showTaskList) {
|
|
536906
|
-
return
|
|
537344
|
+
return import_react132.default.createElement(
|
|
536907
537345
|
I18nProvider,
|
|
536908
537346
|
null,
|
|
536909
|
-
|
|
537347
|
+
import_react132.default.createElement(
|
|
536910
537348
|
ThemeProvider,
|
|
536911
537349
|
null,
|
|
536912
|
-
|
|
537350
|
+
import_react132.default.createElement(ShowTaskListWrapper, null)
|
|
536913
537351
|
)
|
|
536914
537352
|
);
|
|
536915
537353
|
}
|
|
536916
|
-
return
|
|
537354
|
+
return import_react132.default.createElement(
|
|
536917
537355
|
I18nProvider,
|
|
536918
537356
|
null,
|
|
536919
|
-
|
|
537357
|
+
import_react132.default.createElement(
|
|
536920
537358
|
ThemeProvider,
|
|
536921
537359
|
null,
|
|
536922
|
-
|
|
537360
|
+
import_react132.default.createElement(AppContent, { version: version2, skipWelcome, autoResume, enableYolo })
|
|
536923
537361
|
)
|
|
536924
537362
|
);
|
|
536925
537363
|
}
|
|
536926
|
-
var
|
|
537364
|
+
var import_react132, WelcomeScreen2, ChatScreen2, HeadlessModeScreen2, TaskManagerScreen2, MCPConfigScreen2, SystemPromptConfigScreen3, CustomHeadersScreen3;
|
|
536927
537365
|
var init_app = __esm({
|
|
536928
537366
|
async "dist/app.js"() {
|
|
536929
537367
|
"use strict";
|
|
536930
|
-
|
|
537368
|
+
import_react132 = __toESM(require_react(), 1);
|
|
536931
537369
|
await init_build2();
|
|
536932
537370
|
await init_build4();
|
|
536933
537371
|
await init_useGlobalExit();
|
|
@@ -536937,13 +537375,13 @@ var init_app = __esm({
|
|
|
536937
537375
|
init_ThemeContext();
|
|
536938
537376
|
init_processManager();
|
|
536939
537377
|
init_apiConfig();
|
|
536940
|
-
WelcomeScreen2 =
|
|
536941
|
-
ChatScreen2 =
|
|
536942
|
-
HeadlessModeScreen2 =
|
|
536943
|
-
TaskManagerScreen2 =
|
|
536944
|
-
MCPConfigScreen2 =
|
|
536945
|
-
SystemPromptConfigScreen3 =
|
|
536946
|
-
CustomHeadersScreen3 =
|
|
537378
|
+
WelcomeScreen2 = import_react132.default.lazy(() => init_WelcomeScreen().then(() => WelcomeScreen_exports));
|
|
537379
|
+
ChatScreen2 = import_react132.default.lazy(() => init_ChatScreen().then(() => ChatScreen_exports));
|
|
537380
|
+
HeadlessModeScreen2 = import_react132.default.lazy(() => init_HeadlessModeScreen().then(() => HeadlessModeScreen_exports));
|
|
537381
|
+
TaskManagerScreen2 = import_react132.default.lazy(() => init_TaskManagerScreen().then(() => TaskManagerScreen_exports));
|
|
537382
|
+
MCPConfigScreen2 = import_react132.default.lazy(() => init_MCPConfigScreen().then(() => MCPConfigScreen_exports));
|
|
537383
|
+
SystemPromptConfigScreen3 = import_react132.default.lazy(() => init_SystemPromptConfigScreen().then(() => SystemPromptConfigScreen_exports));
|
|
537384
|
+
CustomHeadersScreen3 = import_react132.default.lazy(() => init_CustomHeadersScreen().then(() => CustomHeadersScreen_exports));
|
|
536947
537385
|
}
|
|
536948
537386
|
});
|
|
536949
537387
|
|
|
@@ -536954,17 +537392,17 @@ __export(taskExecutor_exports, {
|
|
|
536954
537392
|
executeTaskInBackground: () => executeTaskInBackground
|
|
536955
537393
|
});
|
|
536956
537394
|
import { spawn as spawn7 } from "child_process";
|
|
536957
|
-
import { writeFileSync as
|
|
536958
|
-
import { join as
|
|
537395
|
+
import { writeFileSync as writeFileSync13, appendFileSync, existsSync as existsSync24, mkdirSync as mkdirSync12 } from "fs";
|
|
537396
|
+
import { join as join27 } from "path";
|
|
536959
537397
|
import { homedir as homedir17 } from "os";
|
|
536960
537398
|
function ensureLogDir() {
|
|
536961
|
-
if (!
|
|
536962
|
-
|
|
537399
|
+
if (!existsSync24(TASK_LOG_DIR)) {
|
|
537400
|
+
mkdirSync12(TASK_LOG_DIR, { recursive: true });
|
|
536963
537401
|
}
|
|
536964
537402
|
}
|
|
536965
537403
|
function getLogPath(taskId) {
|
|
536966
537404
|
ensureLogDir();
|
|
536967
|
-
return
|
|
537405
|
+
return join27(TASK_LOG_DIR, `${taskId}.log`);
|
|
536968
537406
|
}
|
|
536969
537407
|
function writeLog(taskId, message) {
|
|
536970
537408
|
try {
|
|
@@ -536979,7 +537417,7 @@ async function executeTaskInBackground(taskId, prompt) {
|
|
|
536979
537417
|
const cliPath = process.argv[1] || "";
|
|
536980
537418
|
const logPath = getLogPath(taskId);
|
|
536981
537419
|
ensureLogDir();
|
|
536982
|
-
|
|
537420
|
+
writeFileSync13(logPath, `Task ${taskId} execution log
|
|
536983
537421
|
`, "utf-8");
|
|
536984
537422
|
writeLog(taskId, `Starting background task with prompt: ${prompt.slice(0, 100)}...`);
|
|
536985
537423
|
writeLog(taskId, `CLI path: ${cliPath}`);
|
|
@@ -537243,12 +537681,12 @@ var init_taskExecutor = __esm({
|
|
|
537243
537681
|
"dist/utils/task/taskExecutor.js"() {
|
|
537244
537682
|
"use strict";
|
|
537245
537683
|
init_taskManager();
|
|
537246
|
-
TASK_LOG_DIR =
|
|
537684
|
+
TASK_LOG_DIR = join27(homedir17(), ".snow", "task-logs");
|
|
537247
537685
|
}
|
|
537248
537686
|
});
|
|
537249
537687
|
|
|
537250
537688
|
// dist/cli.js
|
|
537251
|
-
var
|
|
537689
|
+
var import_react133 = __toESM(require_react(), 1);
|
|
537252
537690
|
await init_build2();
|
|
537253
537691
|
await init_build3();
|
|
537254
537692
|
|
|
@@ -538031,8 +538469,8 @@ var meow_default = meow;
|
|
|
538031
538469
|
|
|
538032
538470
|
// dist/cli.js
|
|
538033
538471
|
import { execSync as execSync6 } from "child_process";
|
|
538034
|
-
import { readFileSync as
|
|
538035
|
-
import { join as
|
|
538472
|
+
import { readFileSync as readFileSync19 } from "fs";
|
|
538473
|
+
import { join as join28 } from "path";
|
|
538036
538474
|
import { fileURLToPath as fileURLToPath6 } from "url";
|
|
538037
538475
|
process.env["FORCE_COLOR"] = "3";
|
|
538038
538476
|
var MIN_NODE_VERSION = 16;
|
|
@@ -538068,7 +538506,7 @@ if (!isQuickCommand) {
|
|
|
538068
538506
|
process.stdout.write("\u280B Loading...\r");
|
|
538069
538507
|
}
|
|
538070
538508
|
var __dirname2 = fileURLToPath6(new URL(".", import.meta.url));
|
|
538071
|
-
var packageJson = JSON.parse(
|
|
538509
|
+
var packageJson = JSON.parse(readFileSync19(join28(__dirname2, "../package.json"), "utf-8"));
|
|
538072
538510
|
var VERSION2 = packageJson.version;
|
|
538073
538511
|
async function loadDependencies() {
|
|
538074
538512
|
await Promise.resolve().then(() => (init_utils(), utils_exports));
|
|
@@ -538203,9 +538641,9 @@ if (cli.flags.taskExecute) {
|
|
|
538203
538641
|
process.exit(0);
|
|
538204
538642
|
}
|
|
538205
538643
|
var Startup = ({ version: version2, skipWelcome, autoResume, headlessPrompt, showTaskList, isDevMode: isDevMode2, enableYolo }) => {
|
|
538206
|
-
const [appReady, setAppReady] =
|
|
538207
|
-
const [AppComponent, setAppComponent] =
|
|
538208
|
-
|
|
538644
|
+
const [appReady, setAppReady] = import_react133.default.useState(false);
|
|
538645
|
+
const [AppComponent, setAppComponent] = import_react133.default.useState(null);
|
|
538646
|
+
import_react133.default.useEffect(() => {
|
|
538209
538647
|
let mounted = true;
|
|
538210
538648
|
const init = async () => {
|
|
538211
538649
|
const deps = await loadDependencies();
|
|
@@ -538250,22 +538688,22 @@ var Startup = ({ version: version2, skipWelcome, autoResume, headlessPrompt, sho
|
|
|
538250
538688
|
};
|
|
538251
538689
|
}, [version2, isDevMode2]);
|
|
538252
538690
|
if (!appReady || !AppComponent) {
|
|
538253
|
-
return
|
|
538691
|
+
return import_react133.default.createElement(
|
|
538254
538692
|
Box_default,
|
|
538255
538693
|
{ flexDirection: "column" },
|
|
538256
|
-
|
|
538694
|
+
import_react133.default.createElement(
|
|
538257
538695
|
Box_default,
|
|
538258
538696
|
null,
|
|
538259
|
-
|
|
538697
|
+
import_react133.default.createElement(
|
|
538260
538698
|
Text,
|
|
538261
538699
|
{ color: "cyan" },
|
|
538262
|
-
|
|
538700
|
+
import_react133.default.createElement(build_default, { type: "dots" })
|
|
538263
538701
|
),
|
|
538264
|
-
|
|
538702
|
+
import_react133.default.createElement(Text, null, " Loading...")
|
|
538265
538703
|
)
|
|
538266
538704
|
);
|
|
538267
538705
|
}
|
|
538268
|
-
return
|
|
538706
|
+
return import_react133.default.createElement(AppComponent, { version: version2, skipWelcome, autoResume, headlessPrompt, showTaskList, enableYolo });
|
|
538269
538707
|
};
|
|
538270
538708
|
process.stdout.write("\x1B[?2004l");
|
|
538271
538709
|
process.stdout.write("\x1B[2K\r");
|
|
@@ -538310,7 +538748,7 @@ process.on("SIGTERM", async () => {
|
|
|
538310
538748
|
await cleanupAsync();
|
|
538311
538749
|
process.exit(0);
|
|
538312
538750
|
});
|
|
538313
|
-
render_default(
|
|
538751
|
+
render_default(import_react133.default.createElement(Startup, { version: VERSION2, skipWelcome: Boolean(cli.flags.c || cli.flags.yolo || cli.flags.cYolo), autoResume: Boolean(cli.flags.c || cli.flags.cYolo), headlessPrompt: cli.flags.ask, showTaskList: cli.flags.taskList, isDevMode: cli.flags.dev, enableYolo: Boolean(cli.flags.yolo || cli.flags.cYolo) }), {
|
|
538314
538752
|
exitOnCtrlC: false,
|
|
538315
538753
|
patchConsole: true
|
|
538316
538754
|
});
|