snow-ai 0.8.2 → 0.8.3
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 +714 -523
- package/bundle/package.json +1 -1
- package/package.json +1 -1
package/bundle/cli.mjs
CHANGED
|
@@ -46136,7 +46136,8 @@ var init_en = __esm({
|
|
|
46136
46136
|
valueLabel: "Value:",
|
|
46137
46137
|
headerKeyPlaceholder: "Header key (e.g., X-API-Key)",
|
|
46138
46138
|
headerValuePlaceholder: "Header value",
|
|
46139
|
-
headerEditingHint: "\u2191\u2193: Navigate fields | Enter: Edit | Ctrl+S: Save | ESC: Cancel"
|
|
46139
|
+
headerEditingHint: "\u2191\u2193: Navigate fields | Enter: Edit | Ctrl+S: Save | ESC: Cancel",
|
|
46140
|
+
placeholderHint: "Values support {{placeholder}} syntax, resolved by plugins in ~/.snow/plugin/custom_headers/"
|
|
46140
46141
|
},
|
|
46141
46142
|
subAgentConfig: {
|
|
46142
46143
|
title: "Sub-Agent Configuration",
|
|
@@ -48275,7 +48276,8 @@ var init_zh = __esm({
|
|
|
48275
48276
|
valueLabel: "\u503C:",
|
|
48276
48277
|
headerKeyPlaceholder: "\u8BF7\u6C42\u5934\u952E (\u4F8B\u5982, X-API-Key)",
|
|
48277
48278
|
headerValuePlaceholder: "\u8BF7\u6C42\u5934\u503C",
|
|
48278
|
-
headerEditingHint: "\u2191\u2193: \u5BFC\u822A\u5B57\u6BB5 | Enter: \u7F16\u8F91 | Ctrl+S: \u4FDD\u5B58 | ESC: \u53D6\u6D88"
|
|
48279
|
+
headerEditingHint: "\u2191\u2193: \u5BFC\u822A\u5B57\u6BB5 | Enter: \u7F16\u8F91 | Ctrl+S: \u4FDD\u5B58 | ESC: \u53D6\u6D88",
|
|
48280
|
+
placeholderHint: "\u503C\u652F\u6301 {{\u5360\u4F4D\u7B26}} \u8BED\u6CD5,\u7531 ~/.snow/plugin/custom_headers/ \u4E2D\u7684\u63D2\u4EF6\u52A8\u6001\u89E3\u6790"
|
|
48279
48281
|
},
|
|
48280
48282
|
subAgentConfig: {
|
|
48281
48283
|
title: "\u5B50\u4EE3\u7406\u914D\u7F6E",
|
|
@@ -50412,7 +50414,8 @@ var init_zh_TW = __esm({
|
|
|
50412
50414
|
valueLabel: "\u503C:",
|
|
50413
50415
|
headerKeyPlaceholder: "\u8ACB\u6C42\u982D\u9375 (\u4F8B\u5982, X-API-Key)",
|
|
50414
50416
|
headerValuePlaceholder: "\u8ACB\u6C42\u982D\u503C",
|
|
50415
|
-
headerEditingHint: "\u2191\u2193: \u5C0E\u822A\u6B04\u4F4D | Enter: \u7DE8\u8F2F | Ctrl+S: \u5132\u5B58 | ESC: \u53D6\u6D88"
|
|
50417
|
+
headerEditingHint: "\u2191\u2193: \u5C0E\u822A\u6B04\u4F4D | Enter: \u7DE8\u8F2F | Ctrl+S: \u5132\u5B58 | ESC: \u53D6\u6D88",
|
|
50418
|
+
placeholderHint: "\u503C\u652F\u63F4 {{\u5360\u4F4D\u7B26}} \u8A9E\u6CD5,\u7531 ~/.snow/plugin/custom_headers/ \u4E2D\u7684\u5916\u639B\u52D5\u614B\u89E3\u6790"
|
|
50416
50419
|
},
|
|
50417
50420
|
subAgentConfig: {
|
|
50418
50421
|
title: "\u5B50\u4EE3\u7406\u914D\u7F6E",
|
|
@@ -131056,6 +131059,152 @@ var init_logger = __esm({
|
|
|
131056
131059
|
}
|
|
131057
131060
|
});
|
|
131058
131061
|
|
|
131062
|
+
// dist/utils/plugins/customHeaders/index.js
|
|
131063
|
+
import { existsSync as existsSync3, readdirSync } from "node:fs";
|
|
131064
|
+
import { extname, join as join2 } from "node:path";
|
|
131065
|
+
import { pathToFileURL } from "node:url";
|
|
131066
|
+
function isCustomHeaderPlugin(candidate) {
|
|
131067
|
+
if (typeof candidate !== "object" || candidate === null)
|
|
131068
|
+
return false;
|
|
131069
|
+
const c = candidate;
|
|
131070
|
+
return typeof c.id === "string" && c.id.length > 0 && typeof c.resolve === "function";
|
|
131071
|
+
}
|
|
131072
|
+
function isPluginEnabled(plugin) {
|
|
131073
|
+
return plugin.enable !== false;
|
|
131074
|
+
}
|
|
131075
|
+
function collectFromModule(mod) {
|
|
131076
|
+
const candidates = [];
|
|
131077
|
+
const pushOne = (val) => {
|
|
131078
|
+
if (Array.isArray(val))
|
|
131079
|
+
candidates.push(...val);
|
|
131080
|
+
else if (val !== void 0 && val !== null)
|
|
131081
|
+
candidates.push(val);
|
|
131082
|
+
};
|
|
131083
|
+
pushOne(mod.default);
|
|
131084
|
+
pushOne(mod.customHeaderPlugin);
|
|
131085
|
+
pushOne(mod.customHeaderPlugins);
|
|
131086
|
+
return candidates.filter(isCustomHeaderPlugin);
|
|
131087
|
+
}
|
|
131088
|
+
async function loadExternalPlugins() {
|
|
131089
|
+
if (!existsSync3(CUSTOM_HEADERS_PLUGIN_DIR))
|
|
131090
|
+
return;
|
|
131091
|
+
let entries;
|
|
131092
|
+
try {
|
|
131093
|
+
entries = readdirSync(CUSTOM_HEADERS_PLUGIN_DIR, { withFileTypes: true });
|
|
131094
|
+
} catch (error42) {
|
|
131095
|
+
logger.warn("Failed to read custom header plugin directory", {
|
|
131096
|
+
directory: CUSTOM_HEADERS_PLUGIN_DIR,
|
|
131097
|
+
error: error42
|
|
131098
|
+
});
|
|
131099
|
+
return;
|
|
131100
|
+
}
|
|
131101
|
+
const files = entries.filter((e) => e.isFile() && SUPPORTED_PLUGIN_EXTENSIONS.has(extname(e.name).toLowerCase())).sort((a, b) => a.name.localeCompare(b.name));
|
|
131102
|
+
for (const file2 of files) {
|
|
131103
|
+
const modulePath = join2(CUSTOM_HEADERS_PLUGIN_DIR, file2.name);
|
|
131104
|
+
try {
|
|
131105
|
+
const moduleUrl = pathToFileURL(modulePath).href;
|
|
131106
|
+
const mod = await import(moduleUrl);
|
|
131107
|
+
const plugins = collectFromModule(mod);
|
|
131108
|
+
if (plugins.length === 0) {
|
|
131109
|
+
logger.warn(`[custom-headers] plugin "${file2.name}" did not export a valid CustomHeaderPlugin`);
|
|
131110
|
+
continue;
|
|
131111
|
+
}
|
|
131112
|
+
for (const plugin of plugins) {
|
|
131113
|
+
if (!isPluginEnabled(plugin))
|
|
131114
|
+
continue;
|
|
131115
|
+
PLUGINS.push(plugin);
|
|
131116
|
+
}
|
|
131117
|
+
} catch (error42) {
|
|
131118
|
+
logger.warn(`[custom-headers] failed to load plugin "${file2.name}":`, { error: error42 });
|
|
131119
|
+
}
|
|
131120
|
+
}
|
|
131121
|
+
}
|
|
131122
|
+
function ensureCustomHeaderPluginsLoaded() {
|
|
131123
|
+
if (externalLoaded)
|
|
131124
|
+
return Promise.resolve();
|
|
131125
|
+
if (externalLoadPromise)
|
|
131126
|
+
return externalLoadPromise;
|
|
131127
|
+
externalLoadPromise = loadExternalPlugins().then(() => {
|
|
131128
|
+
externalLoaded = true;
|
|
131129
|
+
});
|
|
131130
|
+
return externalLoadPromise;
|
|
131131
|
+
}
|
|
131132
|
+
function listCustomHeaderPlugins() {
|
|
131133
|
+
return PLUGINS;
|
|
131134
|
+
}
|
|
131135
|
+
function extractPlaceholders(headers) {
|
|
131136
|
+
var _a20;
|
|
131137
|
+
const names = /* @__PURE__ */ new Set();
|
|
131138
|
+
for (const value of Object.values(headers)) {
|
|
131139
|
+
if (typeof value !== "string")
|
|
131140
|
+
continue;
|
|
131141
|
+
for (const match of value.matchAll(PLACEHOLDER_PATTERN)) {
|
|
131142
|
+
const name = (_a20 = match[1]) == null ? void 0 : _a20.trim();
|
|
131143
|
+
if (name)
|
|
131144
|
+
names.add(name);
|
|
131145
|
+
}
|
|
131146
|
+
}
|
|
131147
|
+
return Array.from(names);
|
|
131148
|
+
}
|
|
131149
|
+
async function resolveCustomHeaderPlaceholders(headers, contextOverride) {
|
|
131150
|
+
const placeholders = extractPlaceholders(headers);
|
|
131151
|
+
if (placeholders.length === 0) {
|
|
131152
|
+
return headers;
|
|
131153
|
+
}
|
|
131154
|
+
await ensureCustomHeaderPluginsLoaded();
|
|
131155
|
+
const plugins = listCustomHeaderPlugins();
|
|
131156
|
+
if (plugins.length === 0) {
|
|
131157
|
+
return headers;
|
|
131158
|
+
}
|
|
131159
|
+
const context3 = {
|
|
131160
|
+
cwd: process.cwd(),
|
|
131161
|
+
platform: process.platform,
|
|
131162
|
+
...contextOverride
|
|
131163
|
+
};
|
|
131164
|
+
const resolved = {};
|
|
131165
|
+
for (const plugin of plugins) {
|
|
131166
|
+
try {
|
|
131167
|
+
const result3 = await plugin.resolve(placeholders, context3);
|
|
131168
|
+
if (result3 && typeof result3 === "object") {
|
|
131169
|
+
for (const [key, value] of Object.entries(result3)) {
|
|
131170
|
+
if (typeof value === "string" && value.length > 0 && !(key in resolved)) {
|
|
131171
|
+
resolved[key] = value;
|
|
131172
|
+
}
|
|
131173
|
+
}
|
|
131174
|
+
}
|
|
131175
|
+
} catch (error42) {
|
|
131176
|
+
logger.warn("Custom header plugin resolve failed", {
|
|
131177
|
+
pluginId: plugin.id,
|
|
131178
|
+
error: error42
|
|
131179
|
+
});
|
|
131180
|
+
}
|
|
131181
|
+
}
|
|
131182
|
+
if (Object.keys(resolved).length === 0) {
|
|
131183
|
+
return headers;
|
|
131184
|
+
}
|
|
131185
|
+
const result2 = {};
|
|
131186
|
+
for (const [headerKey, headerValue] of Object.entries(headers)) {
|
|
131187
|
+
result2[headerKey] = headerValue.replace(PLACEHOLDER_PATTERN, (match, name) => {
|
|
131188
|
+
const trimmed = name.trim();
|
|
131189
|
+
return trimmed in resolved ? resolved[trimmed] : match;
|
|
131190
|
+
});
|
|
131191
|
+
}
|
|
131192
|
+
return result2;
|
|
131193
|
+
}
|
|
131194
|
+
var SUPPORTED_PLUGIN_EXTENSIONS, PLACEHOLDER_PATTERN, PLUGINS, externalLoadPromise, externalLoaded;
|
|
131195
|
+
var init_customHeaders = __esm({
|
|
131196
|
+
"dist/utils/plugins/customHeaders/index.js"() {
|
|
131197
|
+
"use strict";
|
|
131198
|
+
init_apiConfig();
|
|
131199
|
+
init_logger();
|
|
131200
|
+
SUPPORTED_PLUGIN_EXTENSIONS = /* @__PURE__ */ new Set([".js", ".mjs", ".cjs"]);
|
|
131201
|
+
PLACEHOLDER_PATTERN = /\{\{([^}]+)\}\}/g;
|
|
131202
|
+
PLUGINS = [];
|
|
131203
|
+
externalLoadPromise = null;
|
|
131204
|
+
externalLoaded = false;
|
|
131205
|
+
}
|
|
131206
|
+
});
|
|
131207
|
+
|
|
131059
131208
|
// dist/utils/config/codebaseConfig.js
|
|
131060
131209
|
var codebaseConfig_exports = {};
|
|
131061
131210
|
__export(codebaseConfig_exports, {
|
|
@@ -133229,16 +133378,16 @@ var init_streamGuards = __esm({
|
|
|
133229
133378
|
|
|
133230
133379
|
// dist/utils/config/proxyConfig.js
|
|
133231
133380
|
import { homedir as homedir3 } from "os";
|
|
133232
|
-
import { join as
|
|
133233
|
-
import { readFileSync as readFileSync5, writeFileSync as writeFileSync2, existsSync as
|
|
133381
|
+
import { join as join3 } from "path";
|
|
133382
|
+
import { readFileSync as readFileSync5, writeFileSync as writeFileSync2, existsSync as existsSync4, mkdirSync as mkdirSync2 } from "fs";
|
|
133234
133383
|
function ensureConfigDirectory2() {
|
|
133235
|
-
if (!
|
|
133384
|
+
if (!existsSync4(CONFIG_DIR2)) {
|
|
133236
133385
|
mkdirSync2(CONFIG_DIR2, { recursive: true });
|
|
133237
133386
|
}
|
|
133238
133387
|
}
|
|
133239
133388
|
function loadProxyConfig() {
|
|
133240
133389
|
ensureConfigDirectory2();
|
|
133241
|
-
if (!
|
|
133390
|
+
if (!existsSync4(PROXY_CONFIG_FILE)) {
|
|
133242
133391
|
saveProxyConfig(DEFAULT_PROXY_CONFIG);
|
|
133243
133392
|
return DEFAULT_PROXY_CONFIG;
|
|
133244
133393
|
}
|
|
@@ -133291,8 +133440,8 @@ var init_proxyConfig = __esm({
|
|
|
133291
133440
|
browserDebugPort: 9222,
|
|
133292
133441
|
searchEngine: "duckduckgo"
|
|
133293
133442
|
};
|
|
133294
|
-
CONFIG_DIR2 =
|
|
133295
|
-
PROXY_CONFIG_FILE =
|
|
133443
|
+
CONFIG_DIR2 = join3(homedir3(), ".snow");
|
|
133444
|
+
PROXY_CONFIG_FILE = join3(CONFIG_DIR2, "proxy-config.json");
|
|
133296
133445
|
}
|
|
133297
133446
|
});
|
|
133298
133447
|
|
|
@@ -156006,7 +156155,7 @@ var init_usageLogger = __esm({
|
|
|
156006
156155
|
|
|
156007
156156
|
// dist/utils/core/version.js
|
|
156008
156157
|
import { readFileSync as readFileSync6 } from "fs";
|
|
156009
|
-
import { join as
|
|
156158
|
+
import { join as join4, dirname as dirname2 } from "path";
|
|
156010
156159
|
import { fileURLToPath as fileURLToPath5 } from "url";
|
|
156011
156160
|
function getPackageVersion() {
|
|
156012
156161
|
if (cachedVersion) {
|
|
@@ -156014,7 +156163,7 @@ function getPackageVersion() {
|
|
|
156014
156163
|
}
|
|
156015
156164
|
try {
|
|
156016
156165
|
const currentDir = dirname2(fileURLToPath5(import.meta.url));
|
|
156017
|
-
const packageJsonPath =
|
|
156166
|
+
const packageJsonPath = join4(currentDir, "../package.json");
|
|
156018
156167
|
const packageJson2 = JSON.parse(readFileSync6(packageJsonPath, "utf-8"));
|
|
156019
156168
|
cachedVersion = packageJson2.version || "1.0.0";
|
|
156020
156169
|
return cachedVersion;
|
|
@@ -156439,7 +156588,8 @@ async function* createStreamingChatCompletion(options3, abortSignal, onRetry) {
|
|
|
156439
156588
|
}
|
|
156440
156589
|
recordChatContent(telemetry.span, "request", requestBody, telemetry.metricAttributes);
|
|
156441
156590
|
const url2 = resolveApiEndpoint(config3.baseUrl, "chat", config3.baseUrlMode);
|
|
156442
|
-
const
|
|
156591
|
+
const rawCustomHeaders = options3.customHeaders || getCustomHeadersForConfig(config3);
|
|
156592
|
+
const customHeaders = await resolveCustomHeaderPlaceholders(rawCustomHeaders);
|
|
156443
156593
|
const fetchOptions = addProxyToFetchOptions(url2, {
|
|
156444
156594
|
method: "POST",
|
|
156445
156595
|
headers: {
|
|
@@ -156612,6 +156762,7 @@ var init_chat = __esm({
|
|
|
156612
156762
|
"dist/api/chat.js"() {
|
|
156613
156763
|
"use strict";
|
|
156614
156764
|
init_apiConfig();
|
|
156765
|
+
init_customHeaders();
|
|
156615
156766
|
init_systemPrompt();
|
|
156616
156767
|
init_retryUtils();
|
|
156617
156768
|
init_streamGuards();
|
|
@@ -156987,7 +157138,8 @@ async function* createStreamingResponse(options3, abortSignal, onRetry) {
|
|
|
156987
157138
|
};
|
|
156988
157139
|
recordChatContent(telemetry.span, "request", requestPayload, telemetry.metricAttributes);
|
|
156989
157140
|
const url2 = resolveApiEndpoint(config3.baseUrl, "responses", config3.baseUrlMode);
|
|
156990
|
-
const
|
|
157141
|
+
const rawCustomHeaders = options3.customHeaders || getCustomHeadersForConfig(config3);
|
|
157142
|
+
const customHeaders = await resolveCustomHeaderPlaceholders(rawCustomHeaders);
|
|
156991
157143
|
const fetchOptions = addProxyToFetchOptions(url2, {
|
|
156992
157144
|
method: "POST",
|
|
156993
157145
|
headers: {
|
|
@@ -157173,6 +157325,7 @@ var init_responses = __esm({
|
|
|
157173
157325
|
"dist/api/responses.js"() {
|
|
157174
157326
|
"use strict";
|
|
157175
157327
|
init_apiConfig();
|
|
157328
|
+
init_customHeaders();
|
|
157176
157329
|
init_systemPrompt();
|
|
157177
157330
|
init_retryUtils();
|
|
157178
157331
|
init_streamGuards();
|
|
@@ -157463,7 +157616,8 @@ async function* createStreamingGeminiCompletion(options3, abortSignal, onRetry)
|
|
|
157463
157616
|
const modelName = effectiveModel.startsWith("models/") ? effectiveModel : `models/${effectiveModel}`;
|
|
157464
157617
|
const baseUrl = config3.baseUrl && config3.baseUrl !== "https://api.openai.com/v1" ? config3.baseUrl : "https://generativelanguage.googleapis.com/v1beta";
|
|
157465
157618
|
const url2 = resolveApiEndpoint(baseUrl, "geminiStreamGenerateContent", config3.baseUrlMode, { modelName });
|
|
157466
|
-
const
|
|
157619
|
+
const rawCustomHeaders = options3.customHeaders || getCustomHeadersForConfig(config3);
|
|
157620
|
+
const customHeaders = await resolveCustomHeaderPlaceholders(rawCustomHeaders);
|
|
157467
157621
|
const fetchOptions = addProxyToFetchOptions(url2, {
|
|
157468
157622
|
method: "POST",
|
|
157469
157623
|
headers: {
|
|
@@ -157681,6 +157835,7 @@ var init_gemini = __esm({
|
|
|
157681
157835
|
"dist/api/gemini.js"() {
|
|
157682
157836
|
"use strict";
|
|
157683
157837
|
init_apiConfig();
|
|
157838
|
+
init_customHeaders();
|
|
157684
157839
|
init_systemPrompt();
|
|
157685
157840
|
init_retryUtils();
|
|
157686
157841
|
init_streamGuards();
|
|
@@ -157701,11 +157856,11 @@ __export(devMode_exports, {
|
|
|
157701
157856
|
isDevMode: () => isDevMode
|
|
157702
157857
|
});
|
|
157703
157858
|
import { createHash, randomUUID } from "crypto";
|
|
157704
|
-
import { existsSync as
|
|
157859
|
+
import { existsSync as existsSync5, mkdirSync as mkdirSync3, readFileSync as readFileSync7, writeFileSync as writeFileSync3 } from "fs";
|
|
157705
157860
|
import { homedir as homedir4 } from "os";
|
|
157706
|
-
import { join as
|
|
157861
|
+
import { join as join5 } from "path";
|
|
157707
157862
|
function ensureSnowDir() {
|
|
157708
|
-
if (!
|
|
157863
|
+
if (!existsSync5(SNOW_DIR)) {
|
|
157709
157864
|
mkdirSync3(SNOW_DIR, { recursive: true });
|
|
157710
157865
|
}
|
|
157711
157866
|
}
|
|
@@ -157716,7 +157871,7 @@ function generateDevUserId() {
|
|
|
157716
157871
|
}
|
|
157717
157872
|
function getDevUserId() {
|
|
157718
157873
|
ensureSnowDir();
|
|
157719
|
-
if (
|
|
157874
|
+
if (existsSync5(DEV_USER_ID_FILE)) {
|
|
157720
157875
|
const userId2 = readFileSync7(DEV_USER_ID_FILE, "utf-8").trim();
|
|
157721
157876
|
if (userId2) {
|
|
157722
157877
|
return userId2;
|
|
@@ -157736,8 +157891,8 @@ var SNOW_DIR, DEV_USER_ID_FILE;
|
|
|
157736
157891
|
var init_devMode = __esm({
|
|
157737
157892
|
"dist/utils/core/devMode.js"() {
|
|
157738
157893
|
"use strict";
|
|
157739
|
-
SNOW_DIR =
|
|
157740
|
-
DEV_USER_ID_FILE =
|
|
157894
|
+
SNOW_DIR = join5(homedir4(), ".snow");
|
|
157895
|
+
DEV_USER_ID_FILE = join5(SNOW_DIR, "dev-user-id");
|
|
157741
157896
|
}
|
|
157742
157897
|
});
|
|
157743
157898
|
|
|
@@ -158181,7 +158336,8 @@ async function* createStreamingAnthropicCompletion(options3, abortSignal, onRetr
|
|
|
158181
158336
|
}
|
|
158182
158337
|
}
|
|
158183
158338
|
recordChatContent(telemetry.span, "request", requestBody, telemetry.metricAttributes);
|
|
158184
|
-
const
|
|
158339
|
+
const rawCustomHeaders = options3.customHeaders || getCustomHeadersForConfig(config3);
|
|
158340
|
+
const customHeaders = await resolveCustomHeaderPlaceholders(rawCustomHeaders);
|
|
158185
158341
|
const headers = {
|
|
158186
158342
|
"Content-Type": "application/json",
|
|
158187
158343
|
"x-api-key": config3.apiKey,
|
|
@@ -158399,6 +158555,7 @@ var init_anthropic = __esm({
|
|
|
158399
158555
|
"dist/api/anthropic.js"() {
|
|
158400
158556
|
"use strict";
|
|
158401
158557
|
init_apiConfig();
|
|
158558
|
+
init_customHeaders();
|
|
158402
158559
|
init_systemPrompt();
|
|
158403
158560
|
init_retryUtils();
|
|
158404
158561
|
init_streamGuards();
|
|
@@ -159690,30 +159847,30 @@ Now produce the compressed terminal result:`;
|
|
|
159690
159847
|
|
|
159691
159848
|
// dist/utils/config/hooksConfig.js
|
|
159692
159849
|
import { homedir as homedir5 } from "os";
|
|
159693
|
-
import { join as
|
|
159694
|
-
import { existsSync as
|
|
159850
|
+
import { join as join7 } from "path";
|
|
159851
|
+
import { existsSync as existsSync7, mkdirSync as mkdirSync4, readFileSync as readFileSync8, writeFileSync as writeFileSync4, readdirSync as readdirSync2, unlinkSync } from "fs";
|
|
159695
159852
|
function getGlobalHooksDir() {
|
|
159696
|
-
return
|
|
159853
|
+
return join7(homedir5(), ".snow", "hooks");
|
|
159697
159854
|
}
|
|
159698
159855
|
function getProjectHooksDir() {
|
|
159699
|
-
return
|
|
159856
|
+
return join7(process.cwd(), ".snow", "hooks");
|
|
159700
159857
|
}
|
|
159701
159858
|
function getHooksDir(scope) {
|
|
159702
159859
|
return scope === "global" ? getGlobalHooksDir() : getProjectHooksDir();
|
|
159703
159860
|
}
|
|
159704
159861
|
function ensureHooksDirectory(scope) {
|
|
159705
159862
|
const hooksDir = getHooksDir(scope);
|
|
159706
|
-
if (!
|
|
159863
|
+
if (!existsSync7(hooksDir)) {
|
|
159707
159864
|
mkdirSync4(hooksDir, { recursive: true });
|
|
159708
159865
|
}
|
|
159709
159866
|
}
|
|
159710
159867
|
function getHookFilePath(hookType, scope) {
|
|
159711
|
-
return
|
|
159868
|
+
return join7(getHooksDir(scope), `${hookType}.json`);
|
|
159712
159869
|
}
|
|
159713
159870
|
function loadHookConfig(hookType, scope) {
|
|
159714
159871
|
ensureHooksDirectory(scope);
|
|
159715
159872
|
const filePath = getHookFilePath(hookType, scope);
|
|
159716
|
-
if (!
|
|
159873
|
+
if (!existsSync7(filePath)) {
|
|
159717
159874
|
return [];
|
|
159718
159875
|
}
|
|
159719
159876
|
try {
|
|
@@ -159773,7 +159930,7 @@ function saveHookConfig(hookType, scope, rules) {
|
|
|
159773
159930
|
}
|
|
159774
159931
|
function deleteHookConfig(hookType, scope) {
|
|
159775
159932
|
const filePath = getHookFilePath(hookType, scope);
|
|
159776
|
-
if (
|
|
159933
|
+
if (existsSync7(filePath)) {
|
|
159777
159934
|
unlinkSync(filePath);
|
|
159778
159935
|
}
|
|
159779
159936
|
}
|
|
@@ -159781,7 +159938,7 @@ function listConfiguredHooks(scope) {
|
|
|
159781
159938
|
ensureHooksDirectory(scope);
|
|
159782
159939
|
const hooksDir = getHooksDir(scope);
|
|
159783
159940
|
try {
|
|
159784
|
-
const files =
|
|
159941
|
+
const files = readdirSync2(hooksDir);
|
|
159785
159942
|
return files.filter((file2) => file2.endsWith(".json")).map((file2) => file2.replace(".json", ""));
|
|
159786
159943
|
} catch (error42) {
|
|
159787
159944
|
return [];
|
|
@@ -160480,8 +160637,8 @@ __export(configManager_exports, {
|
|
|
160480
160637
|
switchProfile: () => switchProfile
|
|
160481
160638
|
});
|
|
160482
160639
|
import { homedir as homedir6 } from "os";
|
|
160483
|
-
import { join as
|
|
160484
|
-
import { readFileSync as readFileSync9, writeFileSync as writeFileSync5, existsSync as
|
|
160640
|
+
import { join as join8 } from "path";
|
|
160641
|
+
import { readFileSync as readFileSync9, writeFileSync as writeFileSync5, existsSync as existsSync8, mkdirSync as mkdirSync5, readdirSync as readdirSync3, unlinkSync as unlinkSync2 } from "fs";
|
|
160485
160642
|
function clearAllAgentCaches() {
|
|
160486
160643
|
codebaseReviewAgent.clearCache();
|
|
160487
160644
|
reviewAgent.clearCache();
|
|
@@ -160490,16 +160647,16 @@ function clearAllAgentCaches() {
|
|
|
160490
160647
|
unifiedHooksExecutor.clearCache();
|
|
160491
160648
|
}
|
|
160492
160649
|
function ensureProfilesDirectory() {
|
|
160493
|
-
if (!
|
|
160650
|
+
if (!existsSync8(CONFIG_DIR3)) {
|
|
160494
160651
|
mkdirSync5(CONFIG_DIR3, { recursive: true });
|
|
160495
160652
|
}
|
|
160496
|
-
if (!
|
|
160653
|
+
if (!existsSync8(PROFILES_DIR)) {
|
|
160497
160654
|
mkdirSync5(PROFILES_DIR, { recursive: true });
|
|
160498
160655
|
}
|
|
160499
160656
|
}
|
|
160500
160657
|
function getActiveProfileName2() {
|
|
160501
160658
|
ensureProfilesDirectory();
|
|
160502
|
-
if (!
|
|
160659
|
+
if (!existsSync8(ACTIVE_PROFILE_FILE) && existsSync8(LEGACY_ACTIVE_PROFILE_FILE)) {
|
|
160503
160660
|
try {
|
|
160504
160661
|
const legacyProfileName = readFileSync9(LEGACY_ACTIVE_PROFILE_FILE, "utf8").trim();
|
|
160505
160662
|
const profileName = legacyProfileName || "default";
|
|
@@ -160509,7 +160666,7 @@ function getActiveProfileName2() {
|
|
|
160509
160666
|
} catch {
|
|
160510
160667
|
}
|
|
160511
160668
|
}
|
|
160512
|
-
if (!
|
|
160669
|
+
if (!existsSync8(ACTIVE_PROFILE_FILE)) {
|
|
160513
160670
|
return "default";
|
|
160514
160671
|
}
|
|
160515
160672
|
try {
|
|
@@ -160533,15 +160690,15 @@ function setActiveProfileFromImport(profileName) {
|
|
|
160533
160690
|
setActiveProfileName(profileName);
|
|
160534
160691
|
}
|
|
160535
160692
|
function getProfilePath(profileName) {
|
|
160536
|
-
return
|
|
160693
|
+
return join8(PROFILES_DIR, `${profileName}.json`);
|
|
160537
160694
|
}
|
|
160538
160695
|
function migrateLegacyConfig() {
|
|
160539
160696
|
ensureProfilesDirectory();
|
|
160540
160697
|
const defaultProfilePath = getProfilePath("default");
|
|
160541
|
-
if (
|
|
160698
|
+
if (existsSync8(defaultProfilePath)) {
|
|
160542
160699
|
return;
|
|
160543
160700
|
}
|
|
160544
|
-
if (
|
|
160701
|
+
if (existsSync8(LEGACY_CONFIG_FILE)) {
|
|
160545
160702
|
try {
|
|
160546
160703
|
const legacyConfig = readFileSync9(LEGACY_CONFIG_FILE, "utf8");
|
|
160547
160704
|
writeFileSync5(defaultProfilePath, legacyConfig, "utf8");
|
|
@@ -160567,7 +160724,7 @@ function loadProfile(profileName) {
|
|
|
160567
160724
|
ensureProfilesDirectory();
|
|
160568
160725
|
migrateLegacyConfig();
|
|
160569
160726
|
const profilePath = getProfilePath(profileName);
|
|
160570
|
-
if (!
|
|
160727
|
+
if (!existsSync8(profilePath)) {
|
|
160571
160728
|
return void 0;
|
|
160572
160729
|
}
|
|
160573
160730
|
try {
|
|
@@ -160609,7 +160766,7 @@ function getAllProfiles() {
|
|
|
160609
160766
|
const activeProfile = getActiveProfileName2();
|
|
160610
160767
|
const profiles = [];
|
|
160611
160768
|
try {
|
|
160612
|
-
const files =
|
|
160769
|
+
const files = readdirSync3(PROFILES_DIR);
|
|
160613
160770
|
for (const file2 of files) {
|
|
160614
160771
|
if (file2.endsWith(".json")) {
|
|
160615
160772
|
const profileName = file2.replace(".json", "");
|
|
@@ -160648,7 +160805,7 @@ function switchProfile(profileName) {
|
|
|
160648
160805
|
const profileConfigAny = profileConfig;
|
|
160649
160806
|
if (profileConfigAny.proxy !== void 0) {
|
|
160650
160807
|
try {
|
|
160651
|
-
const proxyConfigPath =
|
|
160808
|
+
const proxyConfigPath = join8(CONFIG_DIR3, "proxy-config.json");
|
|
160652
160809
|
const proxyConfig = {
|
|
160653
160810
|
enabled: profileConfigAny.proxy.enabled ?? false,
|
|
160654
160811
|
port: profileConfigAny.proxy.port ?? 7890,
|
|
@@ -160682,7 +160839,7 @@ function createProfile(profileName, config3) {
|
|
|
160682
160839
|
throw new Error("Invalid profile name");
|
|
160683
160840
|
}
|
|
160684
160841
|
const profilePath = getProfilePath(profileName);
|
|
160685
|
-
if (
|
|
160842
|
+
if (existsSync8(profilePath)) {
|
|
160686
160843
|
throw new Error(`Profile "${profileName}" already exists`);
|
|
160687
160844
|
}
|
|
160688
160845
|
const profileConfig = config3 || loadConfig();
|
|
@@ -160694,7 +160851,7 @@ function deleteProfile(profileName) {
|
|
|
160694
160851
|
throw new Error("Cannot delete the default profile");
|
|
160695
160852
|
}
|
|
160696
160853
|
const profilePath = getProfilePath(profileName);
|
|
160697
|
-
if (!
|
|
160854
|
+
if (!existsSync8(profilePath)) {
|
|
160698
160855
|
throw new Error(`Profile "${profileName}" not found`);
|
|
160699
160856
|
}
|
|
160700
160857
|
if (getActiveProfileName2() === profileName) {
|
|
@@ -160716,10 +160873,10 @@ function renameProfile(oldName, newName) {
|
|
|
160716
160873
|
}
|
|
160717
160874
|
const oldPath = getProfilePath(oldName);
|
|
160718
160875
|
const newPath = getProfilePath(newName);
|
|
160719
|
-
if (!
|
|
160876
|
+
if (!existsSync8(oldPath)) {
|
|
160720
160877
|
throw new Error(`Profile "${oldName}" not found`);
|
|
160721
160878
|
}
|
|
160722
|
-
if (
|
|
160879
|
+
if (existsSync8(newPath)) {
|
|
160723
160880
|
throw new Error(`Profile "${newName}" already exists`);
|
|
160724
160881
|
}
|
|
160725
160882
|
try {
|
|
@@ -160763,17 +160920,18 @@ var init_configManager = __esm({
|
|
|
160763
160920
|
init_summaryAgent();
|
|
160764
160921
|
init_bashOutputSummaryAgent();
|
|
160765
160922
|
init_unifiedHooksExecutor();
|
|
160766
|
-
CONFIG_DIR3 =
|
|
160767
|
-
PROFILES_DIR =
|
|
160768
|
-
ACTIVE_PROFILE_FILE =
|
|
160769
|
-
LEGACY_ACTIVE_PROFILE_FILE =
|
|
160770
|
-
LEGACY_CONFIG_FILE =
|
|
160923
|
+
CONFIG_DIR3 = join8(homedir6(), ".snow");
|
|
160924
|
+
PROFILES_DIR = join8(CONFIG_DIR3, "profiles");
|
|
160925
|
+
ACTIVE_PROFILE_FILE = join8(CONFIG_DIR3, "active-profile.json");
|
|
160926
|
+
LEGACY_ACTIVE_PROFILE_FILE = join8(CONFIG_DIR3, "active-profile.txt");
|
|
160927
|
+
LEGACY_CONFIG_FILE = join8(CONFIG_DIR3, "config.json");
|
|
160771
160928
|
}
|
|
160772
160929
|
});
|
|
160773
160930
|
|
|
160774
160931
|
// dist/utils/config/apiConfig.js
|
|
160775
160932
|
var apiConfig_exports = {};
|
|
160776
160933
|
__export(apiConfig_exports, {
|
|
160934
|
+
CUSTOM_HEADERS_PLUGIN_DIR: () => CUSTOM_HEADERS_PLUGIN_DIR,
|
|
160777
160935
|
DEFAULT_AUTO_COMPRESS_THRESHOLD: () => DEFAULT_AUTO_COMPRESS_THRESHOLD,
|
|
160778
160936
|
DEFAULT_CONFIG: () => DEFAULT_CONFIG4,
|
|
160779
160937
|
DEFAULT_STREAM_IDLE_TIMEOUT_SEC: () => DEFAULT_STREAM_IDLE_TIMEOUT_SEC,
|
|
@@ -160809,8 +160967,8 @@ __export(apiConfig_exports, {
|
|
|
160809
160967
|
validateMCPConfig: () => validateMCPConfig
|
|
160810
160968
|
});
|
|
160811
160969
|
import { homedir as homedir7 } from "os";
|
|
160812
|
-
import { join as
|
|
160813
|
-
import { readFileSync as readFileSync10, writeFileSync as writeFileSync6, existsSync as
|
|
160970
|
+
import { join as join9 } from "path";
|
|
160971
|
+
import { readFileSync as readFileSync10, writeFileSync as writeFileSync6, existsSync as existsSync9, mkdirSync as mkdirSync6, unlinkSync as unlinkSync3 } from "fs";
|
|
160814
160972
|
function normalizeStreamIdleTimeoutSec2(value) {
|
|
160815
160973
|
if (typeof value !== "number" || !Number.isInteger(value) || value <= 0) {
|
|
160816
160974
|
return DEFAULT_STREAM_IDLE_TIMEOUT_SEC;
|
|
@@ -160824,11 +160982,11 @@ function normalizeBaseUrlMode(value) {
|
|
|
160824
160982
|
return "auto";
|
|
160825
160983
|
}
|
|
160826
160984
|
function getGlobalMCPConfigFilePath() {
|
|
160827
|
-
return
|
|
160985
|
+
return join9(CONFIG_DIR4, "settings.json");
|
|
160828
160986
|
}
|
|
160829
160987
|
function migrateProxyConfigToNewFile(legacyProxy) {
|
|
160830
160988
|
try {
|
|
160831
|
-
if (!
|
|
160989
|
+
if (!existsSync9(PROXY_CONFIG_FILE2)) {
|
|
160832
160990
|
const proxyConfig = {
|
|
160833
160991
|
enabled: legacyProxy.enabled ?? false,
|
|
160834
160992
|
port: legacyProxy.port ?? 7890,
|
|
@@ -160850,7 +161008,7 @@ function normalizeRequestMethod2(method) {
|
|
|
160850
161008
|
return DEFAULT_CONFIG4.snowcfg.requestMethod;
|
|
160851
161009
|
}
|
|
160852
161010
|
function ensureConfigDirectory3() {
|
|
160853
|
-
if (!
|
|
161011
|
+
if (!existsSync9(CONFIG_DIR4)) {
|
|
160854
161012
|
mkdirSync6(CONFIG_DIR4, { recursive: true });
|
|
160855
161013
|
}
|
|
160856
161014
|
}
|
|
@@ -160864,7 +161022,7 @@ function loadConfig() {
|
|
|
160864
161022
|
return configCache;
|
|
160865
161023
|
}
|
|
160866
161024
|
ensureConfigDirectory3();
|
|
160867
|
-
if (!
|
|
161025
|
+
if (!existsSync9(CONFIG_FILE)) {
|
|
160868
161026
|
saveConfig(DEFAULT_CONFIG4);
|
|
160869
161027
|
configCache = DEFAULT_CONFIG4;
|
|
160870
161028
|
return DEFAULT_CONFIG4;
|
|
@@ -161095,7 +161253,7 @@ function validateMCPConfig(config3) {
|
|
|
161095
161253
|
return errors;
|
|
161096
161254
|
}
|
|
161097
161255
|
function migrateSystemPromptFromTxt() {
|
|
161098
|
-
if (!
|
|
161256
|
+
if (!existsSync9(SYSTEM_PROMPT_FILE)) {
|
|
161099
161257
|
return;
|
|
161100
161258
|
}
|
|
161101
161259
|
try {
|
|
@@ -161122,10 +161280,10 @@ function migrateSystemPromptFromTxt() {
|
|
|
161122
161280
|
}
|
|
161123
161281
|
function getSystemPromptConfig() {
|
|
161124
161282
|
ensureConfigDirectory3();
|
|
161125
|
-
if (
|
|
161283
|
+
if (existsSync9(SYSTEM_PROMPT_FILE) && !existsSync9(SYSTEM_PROMPT_JSON_FILE)) {
|
|
161126
161284
|
migrateSystemPromptFromTxt();
|
|
161127
161285
|
}
|
|
161128
|
-
if (!
|
|
161286
|
+
if (!existsSync9(SYSTEM_PROMPT_JSON_FILE)) {
|
|
161129
161287
|
return void 0;
|
|
161130
161288
|
}
|
|
161131
161289
|
try {
|
|
@@ -161223,7 +161381,7 @@ function saveCustomHeaders(headers) {
|
|
|
161223
161381
|
}
|
|
161224
161382
|
function getCustomHeadersConfig() {
|
|
161225
161383
|
ensureConfigDirectory3();
|
|
161226
|
-
if (!
|
|
161384
|
+
if (!existsSync9(CUSTOM_HEADERS_FILE)) {
|
|
161227
161385
|
return null;
|
|
161228
161386
|
}
|
|
161229
161387
|
try {
|
|
@@ -161267,7 +161425,7 @@ function saveCustomHeadersConfig(config3) {
|
|
|
161267
161425
|
throw new Error(`Failed to save custom headers config: ${error42}`);
|
|
161268
161426
|
}
|
|
161269
161427
|
}
|
|
161270
|
-
var DEFAULT_STREAM_IDLE_TIMEOUT_SEC, DEFAULT_AUTO_COMPRESS_THRESHOLD, DEFAULT_TOOL_RESULT_TOKEN_LIMIT_PERCENT, MAX_TOOL_RESULT_TOKEN_LIMIT_PERCENT, MIN_TOOL_RESULT_TOKEN_LIMIT_PERCENT, DEFAULT_CONFIG4, DEFAULT_MCP_CONFIG, CONFIG_DIR4, PROXY_CONFIG_FILE2, SYSTEM_PROMPT_FILE, SYSTEM_PROMPT_JSON_FILE, CUSTOM_HEADERS_FILE, STATUSLINE_HOOKS_DIR, SEARCH_ENGINES_DIR, CONFIG_FILE, configCache;
|
|
161428
|
+
var DEFAULT_STREAM_IDLE_TIMEOUT_SEC, DEFAULT_AUTO_COMPRESS_THRESHOLD, DEFAULT_TOOL_RESULT_TOKEN_LIMIT_PERCENT, MAX_TOOL_RESULT_TOKEN_LIMIT_PERCENT, MIN_TOOL_RESULT_TOKEN_LIMIT_PERCENT, DEFAULT_CONFIG4, DEFAULT_MCP_CONFIG, CONFIG_DIR4, PROXY_CONFIG_FILE2, SYSTEM_PROMPT_FILE, SYSTEM_PROMPT_JSON_FILE, CUSTOM_HEADERS_FILE, STATUSLINE_HOOKS_DIR, SEARCH_ENGINES_DIR, CUSTOM_HEADERS_PLUGIN_DIR, CONFIG_FILE, configCache;
|
|
161271
161429
|
var init_apiConfig = __esm({
|
|
161272
161430
|
"dist/utils/config/apiConfig.js"() {
|
|
161273
161431
|
"use strict";
|
|
@@ -161301,14 +161459,15 @@ var init_apiConfig = __esm({
|
|
|
161301
161459
|
DEFAULT_MCP_CONFIG = {
|
|
161302
161460
|
mcpServers: {}
|
|
161303
161461
|
};
|
|
161304
|
-
CONFIG_DIR4 =
|
|
161305
|
-
PROXY_CONFIG_FILE2 =
|
|
161306
|
-
SYSTEM_PROMPT_FILE =
|
|
161307
|
-
SYSTEM_PROMPT_JSON_FILE =
|
|
161308
|
-
CUSTOM_HEADERS_FILE =
|
|
161309
|
-
STATUSLINE_HOOKS_DIR =
|
|
161310
|
-
SEARCH_ENGINES_DIR =
|
|
161311
|
-
|
|
161462
|
+
CONFIG_DIR4 = join9(homedir7(), ".snow");
|
|
161463
|
+
PROXY_CONFIG_FILE2 = join9(CONFIG_DIR4, "proxy-config.json");
|
|
161464
|
+
SYSTEM_PROMPT_FILE = join9(CONFIG_DIR4, "system-prompt.txt");
|
|
161465
|
+
SYSTEM_PROMPT_JSON_FILE = join9(CONFIG_DIR4, "system-prompt.json");
|
|
161466
|
+
CUSTOM_HEADERS_FILE = join9(CONFIG_DIR4, "custom-headers.json");
|
|
161467
|
+
STATUSLINE_HOOKS_DIR = join9(CONFIG_DIR4, "plugin", "statusline");
|
|
161468
|
+
SEARCH_ENGINES_DIR = join9(CONFIG_DIR4, "plugin", "search_engines");
|
|
161469
|
+
CUSTOM_HEADERS_PLUGIN_DIR = join9(CONFIG_DIR4, "plugin", "custom_headers");
|
|
161470
|
+
CONFIG_FILE = join9(CONFIG_DIR4, "config.json");
|
|
161312
161471
|
configCache = null;
|
|
161313
161472
|
}
|
|
161314
161473
|
});
|
|
@@ -166306,7 +166465,7 @@ var require_doc = __commonJS({
|
|
|
166306
166465
|
type: "cursor",
|
|
166307
166466
|
placeholder: Symbol("cursor")
|
|
166308
166467
|
};
|
|
166309
|
-
function
|
|
166468
|
+
function join50(sep, arr) {
|
|
166310
166469
|
const res = [];
|
|
166311
166470
|
for (let i = 0; i < arr.length; i++) {
|
|
166312
166471
|
if (i !== 0) {
|
|
@@ -166336,7 +166495,7 @@ var require_doc = __commonJS({
|
|
|
166336
166495
|
}
|
|
166337
166496
|
module22.exports = {
|
|
166338
166497
|
concat: concat2,
|
|
166339
|
-
join:
|
|
166498
|
+
join: join50,
|
|
166340
166499
|
line,
|
|
166341
166500
|
softline,
|
|
166342
166501
|
hardline,
|
|
@@ -166528,7 +166687,7 @@ var require_doc = __commonJS({
|
|
|
166528
166687
|
var getLast = require_get_last();
|
|
166529
166688
|
var {
|
|
166530
166689
|
literalline,
|
|
166531
|
-
join:
|
|
166690
|
+
join: join50
|
|
166532
166691
|
} = require_doc_builders();
|
|
166533
166692
|
var isConcat = (doc) => Array.isArray(doc) || doc && doc.type === "concat";
|
|
166534
166693
|
var getDocParts = (doc) => {
|
|
@@ -166841,7 +167000,7 @@ var require_doc = __commonJS({
|
|
|
166841
167000
|
}
|
|
166842
167001
|
function replaceTextEndOfLine(text2) {
|
|
166843
167002
|
let replacement = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : literalline;
|
|
166844
|
-
return
|
|
167003
|
+
return join50(replacement, text2.split("\n")).parts;
|
|
166845
167004
|
}
|
|
166846
167005
|
function canBreakFn(doc) {
|
|
166847
167006
|
if (doc.type === "line") {
|
|
@@ -176228,7 +176387,7 @@ ${error42.message}`;
|
|
|
176228
176387
|
var path68 = __require("path");
|
|
176229
176388
|
var fs61 = __require("fs");
|
|
176230
176389
|
var exists = fs61.exists || path68.exists;
|
|
176231
|
-
var
|
|
176390
|
+
var existsSync44 = fs61.existsSync || path68.existsSync;
|
|
176232
176391
|
function splitPath(path210) {
|
|
176233
176392
|
var parts = path210.split(/(\/|\\)/);
|
|
176234
176393
|
if (!parts.length)
|
|
@@ -176253,7 +176412,7 @@ ${error42.message}`;
|
|
|
176253
176412
|
if (parts.length === 0)
|
|
176254
176413
|
return null;
|
|
176255
176414
|
var p = parts.join("");
|
|
176256
|
-
var itdoes =
|
|
176415
|
+
var itdoes = existsSync44(path68.join(p, clue));
|
|
176257
176416
|
return itdoes ? p : testDir(parts.slice(0, -1));
|
|
176258
176417
|
}
|
|
176259
176418
|
return testDir(splitPath(currentFullPath));
|
|
@@ -277166,7 +277325,7 @@ var require_prettier = __commonJS({
|
|
|
277166
277325
|
tokenize: function tokenize4(value) {
|
|
277167
277326
|
return value.split("");
|
|
277168
277327
|
},
|
|
277169
|
-
join: function
|
|
277328
|
+
join: function join50(chars) {
|
|
277170
277329
|
return chars.join("");
|
|
277171
277330
|
}
|
|
277172
277331
|
};
|
|
@@ -283085,7 +283244,7 @@ ${frame}`;
|
|
|
283085
283244
|
breakParent,
|
|
283086
283245
|
indent,
|
|
283087
283246
|
lineSuffix,
|
|
283088
|
-
join:
|
|
283247
|
+
join: join50,
|
|
283089
283248
|
cursor: cursor4
|
|
283090
283249
|
}
|
|
283091
283250
|
} = require_doc();
|
|
@@ -283467,9 +283626,9 @@ ${frame}`;
|
|
|
283467
283626
|
return "";
|
|
283468
283627
|
}
|
|
283469
283628
|
if (sameIndent) {
|
|
283470
|
-
return
|
|
283629
|
+
return join50(hardline, parts);
|
|
283471
283630
|
}
|
|
283472
|
-
return indent([hardline,
|
|
283631
|
+
return indent([hardline, join50(hardline, parts)]);
|
|
283473
283632
|
}
|
|
283474
283633
|
function printCommentsSeparately(path68, options3, ignored) {
|
|
283475
283634
|
const value = path68.getValue();
|
|
@@ -297814,7 +297973,7 @@ ${fromBody}`;
|
|
|
297814
297973
|
} = require_util18();
|
|
297815
297974
|
var {
|
|
297816
297975
|
builders: {
|
|
297817
|
-
join:
|
|
297976
|
+
join: join50,
|
|
297818
297977
|
hardline,
|
|
297819
297978
|
softline,
|
|
297820
297979
|
group: group2,
|
|
@@ -297927,7 +298086,7 @@ ${fromBody}`;
|
|
|
297927
298086
|
maxColumnWidths[index] = Math.max(maxColumnWidths[index], getStringWidth(cell));
|
|
297928
298087
|
}
|
|
297929
298088
|
}
|
|
297930
|
-
parts.push(lineSuffixBoundary, "`", indent([hardline,
|
|
298089
|
+
parts.push(lineSuffixBoundary, "`", indent([hardline, join50(hardline, table.map((row) => join50(" | ", row.cells.map((cell, index) => row.hasLineBreak ? cell : cell + " ".repeat(maxColumnWidths[index] - getStringWidth(cell))))))]), hardline, "`");
|
|
297931
298090
|
return parts;
|
|
297932
298091
|
}
|
|
297933
298092
|
}
|
|
@@ -298071,7 +298230,7 @@ ${fromBody}`;
|
|
|
298071
298230
|
var {
|
|
298072
298231
|
builders: {
|
|
298073
298232
|
indent,
|
|
298074
|
-
join:
|
|
298233
|
+
join: join50,
|
|
298075
298234
|
hardline
|
|
298076
298235
|
}
|
|
298077
298236
|
} = require_doc();
|
|
@@ -298127,7 +298286,7 @@ ${fromBody}`;
|
|
|
298127
298286
|
parts.push(expressionDoc);
|
|
298128
298287
|
}
|
|
298129
298288
|
}
|
|
298130
|
-
return ["`", indent([hardline,
|
|
298289
|
+
return ["`", indent([hardline, join50(hardline, parts)]), hardline, "`"];
|
|
298131
298290
|
}
|
|
298132
298291
|
function printGraphqlComments(lines) {
|
|
298133
298292
|
const parts = [];
|
|
@@ -298144,7 +298303,7 @@ ${fromBody}`;
|
|
|
298144
298303
|
}
|
|
298145
298304
|
seenComment = true;
|
|
298146
298305
|
}
|
|
298147
|
-
return parts.length === 0 ? null :
|
|
298306
|
+
return parts.length === 0 ? null : join50(hardline, parts);
|
|
298148
298307
|
}
|
|
298149
298308
|
module22.exports = format5;
|
|
298150
298309
|
}
|
|
@@ -299804,7 +299963,7 @@ ${fromBody}`;
|
|
|
299804
299963
|
"use strict";
|
|
299805
299964
|
var {
|
|
299806
299965
|
builders: {
|
|
299807
|
-
join:
|
|
299966
|
+
join: join50,
|
|
299808
299967
|
line,
|
|
299809
299968
|
group: group2,
|
|
299810
299969
|
softline,
|
|
@@ -299821,7 +299980,7 @@ ${fromBody}`;
|
|
|
299821
299980
|
}
|
|
299822
299981
|
if (options3.__isVueForBindingLeft) {
|
|
299823
299982
|
return path68.call((functionDeclarationPath) => {
|
|
299824
|
-
const printed =
|
|
299983
|
+
const printed = join50([",", line], functionDeclarationPath.map(print, "params"));
|
|
299825
299984
|
const {
|
|
299826
299985
|
params
|
|
299827
299986
|
} = functionDeclarationPath.getValue();
|
|
@@ -299832,7 +299991,7 @@ ${fromBody}`;
|
|
|
299832
299991
|
}, "program", "body", 0);
|
|
299833
299992
|
}
|
|
299834
299993
|
if (options3.__isVueBindings) {
|
|
299835
|
-
return path68.call((functionDeclarationPath) =>
|
|
299994
|
+
return path68.call((functionDeclarationPath) => join50([",", line], functionDeclarationPath.map(print, "params")), "program", "body", 0);
|
|
299836
299995
|
}
|
|
299837
299996
|
}
|
|
299838
299997
|
function isVueEventBindingExpression(node) {
|
|
@@ -299868,7 +300027,7 @@ ${fromBody}`;
|
|
|
299868
300027
|
} = require_util18();
|
|
299869
300028
|
var {
|
|
299870
300029
|
builders: {
|
|
299871
|
-
join:
|
|
300030
|
+
join: join50,
|
|
299872
300031
|
line,
|
|
299873
300032
|
softline,
|
|
299874
300033
|
group: group2,
|
|
@@ -299950,7 +300109,7 @@ ${fromBody}`;
|
|
|
299950
300109
|
const shouldInline = shouldInlineLogicalExpression(node);
|
|
299951
300110
|
const lineBeforeOperator = (node.operator === "|>" || node.type === "NGPipeExpression" || node.operator === "|" && options3.parser === "__vue_expression") && !hasLeadingOwnLineComment(options3.originalText, node.right);
|
|
299952
300111
|
const operator = node.type === "NGPipeExpression" ? "|" : node.operator;
|
|
299953
|
-
const rightSuffix = node.type === "NGPipeExpression" && node.arguments.length > 0 ? group2(indent([line, ": ",
|
|
300112
|
+
const rightSuffix = node.type === "NGPipeExpression" && node.arguments.length > 0 ? group2(indent([line, ": ", join50([line, ": "], path68.map(print, "arguments").map((arg) => align(2, group2(arg))))])) : "";
|
|
299954
300113
|
let right;
|
|
299955
300114
|
if (shouldInline) {
|
|
299956
300115
|
right = [operator, " ", print("right"), rightSuffix];
|
|
@@ -300000,7 +300159,7 @@ ${fromBody}`;
|
|
|
300000
300159
|
"use strict";
|
|
300001
300160
|
var {
|
|
300002
300161
|
builders: {
|
|
300003
|
-
join:
|
|
300162
|
+
join: join50,
|
|
300004
300163
|
line,
|
|
300005
300164
|
group: group2
|
|
300006
300165
|
}
|
|
@@ -300024,7 +300183,7 @@ ${fromBody}`;
|
|
|
300024
300183
|
case "NGPipeExpression":
|
|
300025
300184
|
return printBinaryishExpression(path68, options3, print);
|
|
300026
300185
|
case "NGChainedExpression":
|
|
300027
|
-
return group2(
|
|
300186
|
+
return group2(join50([";", line], path68.map((childPath) => hasNgSideEffect(childPath) ? print() : ["(", print(), ")"], "expressions")));
|
|
300028
300187
|
case "NGEmptyExpression":
|
|
300029
300188
|
return "";
|
|
300030
300189
|
case "NGQuotedExpression":
|
|
@@ -300088,7 +300247,7 @@ ${fromBody}`;
|
|
|
300088
300247
|
fill,
|
|
300089
300248
|
ifBreak,
|
|
300090
300249
|
lineSuffixBoundary,
|
|
300091
|
-
join:
|
|
300250
|
+
join: join50
|
|
300092
300251
|
},
|
|
300093
300252
|
utils: {
|
|
300094
300253
|
willBreak
|
|
@@ -300426,9 +300585,9 @@ ${fromBody}`;
|
|
|
300426
300585
|
case "JSXIdentifier":
|
|
300427
300586
|
return String(node.name);
|
|
300428
300587
|
case "JSXNamespacedName":
|
|
300429
|
-
return
|
|
300588
|
+
return join50(":", [print("namespace"), print("name")]);
|
|
300430
300589
|
case "JSXMemberExpression":
|
|
300431
|
-
return
|
|
300590
|
+
return join50(".", [print("object"), print("property")]);
|
|
300432
300591
|
case "JSXSpreadAttribute":
|
|
300433
300592
|
return printJsxSpreadAttribute(path68, options3, print);
|
|
300434
300593
|
case "JSXSpreadChild": {
|
|
@@ -300635,7 +300794,7 @@ ${fromBody}`;
|
|
|
300635
300794
|
type: "cursor",
|
|
300636
300795
|
placeholder: Symbol("cursor")
|
|
300637
300796
|
};
|
|
300638
|
-
function
|
|
300797
|
+
function join50(sep, arr) {
|
|
300639
300798
|
const res = [];
|
|
300640
300799
|
for (let i = 0; i < arr.length; i++) {
|
|
300641
300800
|
if (i !== 0) {
|
|
@@ -300665,7 +300824,7 @@ ${fromBody}`;
|
|
|
300665
300824
|
}
|
|
300666
300825
|
module22.exports = {
|
|
300667
300826
|
concat: concat2,
|
|
300668
|
-
join:
|
|
300827
|
+
join: join50,
|
|
300669
300828
|
line,
|
|
300670
300829
|
softline,
|
|
300671
300830
|
hardline,
|
|
@@ -300698,7 +300857,7 @@ ${fromBody}`;
|
|
|
300698
300857
|
var getLast = require_get_last();
|
|
300699
300858
|
var {
|
|
300700
300859
|
literalline,
|
|
300701
|
-
join:
|
|
300860
|
+
join: join50
|
|
300702
300861
|
} = require_doc_builders();
|
|
300703
300862
|
var isConcat = (doc2) => Array.isArray(doc2) || doc2 && doc2.type === "concat";
|
|
300704
300863
|
var getDocParts = (doc2) => {
|
|
@@ -301010,7 +301169,7 @@ ${fromBody}`;
|
|
|
301010
301169
|
return mapDoc(doc2, (currentDoc) => typeof currentDoc === "string" && currentDoc.includes("\n") ? replaceTextEndOfLine(currentDoc) : currentDoc);
|
|
301011
301170
|
}
|
|
301012
301171
|
function replaceTextEndOfLine(text2, replacement = literalline) {
|
|
301013
|
-
return
|
|
301172
|
+
return join50(replacement, text2.split("\n")).parts;
|
|
301014
301173
|
}
|
|
301015
301174
|
function canBreakFn(doc2) {
|
|
301016
301175
|
if (doc2.type === "line") {
|
|
@@ -301048,7 +301207,7 @@ ${fromBody}`;
|
|
|
301048
301207
|
var {
|
|
301049
301208
|
builders: {
|
|
301050
301209
|
indent,
|
|
301051
|
-
join:
|
|
301210
|
+
join: join50,
|
|
301052
301211
|
line
|
|
301053
301212
|
}
|
|
301054
301213
|
} = require_doc();
|
|
@@ -301098,7 +301257,7 @@ ${fromBody}`;
|
|
|
301098
301257
|
if (!isNonEmptyArray(node.modifiers)) {
|
|
301099
301258
|
return "";
|
|
301100
301259
|
}
|
|
301101
|
-
return [
|
|
301260
|
+
return [join50(" ", path68.map(print, "modifiers")), " "];
|
|
301102
301261
|
}
|
|
301103
301262
|
function adjustClause(node, clause, forceSpace) {
|
|
301104
301263
|
if (node.type === "EmptyStatement") {
|
|
@@ -301481,7 +301640,7 @@ ${fromBody}`;
|
|
|
301481
301640
|
} = require_loc();
|
|
301482
301641
|
var {
|
|
301483
301642
|
builders: {
|
|
301484
|
-
join:
|
|
301643
|
+
join: join50,
|
|
301485
301644
|
hardline,
|
|
301486
301645
|
group: group2,
|
|
301487
301646
|
indent,
|
|
@@ -301625,7 +301784,7 @@ ${fromBody}`;
|
|
|
301625
301784
|
if (groups2.length === 0) {
|
|
301626
301785
|
return "";
|
|
301627
301786
|
}
|
|
301628
|
-
return indent(group2([hardline,
|
|
301787
|
+
return indent(group2([hardline, join50(hardline, groups2.map(printGroup))]));
|
|
301629
301788
|
}
|
|
301630
301789
|
const printedGroups = groups.map(printGroup);
|
|
301631
301790
|
const oneLine = printedGroups;
|
|
@@ -301665,7 +301824,7 @@ ${fromBody}`;
|
|
|
301665
301824
|
"use strict";
|
|
301666
301825
|
var {
|
|
301667
301826
|
builders: {
|
|
301668
|
-
join:
|
|
301827
|
+
join: join50,
|
|
301669
301828
|
group: group2
|
|
301670
301829
|
}
|
|
301671
301830
|
} = require_doc();
|
|
@@ -301698,7 +301857,7 @@ ${fromBody}`;
|
|
|
301698
301857
|
iterateCallArgumentsPath(path68, () => {
|
|
301699
301858
|
printed.push(print());
|
|
301700
301859
|
});
|
|
301701
|
-
return [isNew ? "new " : "", print("callee"), optional2, printFunctionTypeParameters(path68, options3, print), "(",
|
|
301860
|
+
return [isNew ? "new " : "", print("callee"), optional2, printFunctionTypeParameters(path68, options3, print), "(", join50(", ", printed), ")"];
|
|
301702
301861
|
}
|
|
301703
301862
|
const isIdentifierWithFlowAnnotation = (options3.parser === "babel" || options3.parser === "babel-flow") && node.callee && node.callee.type === "Identifier" && hasFlowAnnotationComment(node.callee.trailingComments);
|
|
301704
301863
|
if (isIdentifierWithFlowAnnotation) {
|
|
@@ -302180,7 +302339,7 @@ ${fromBody}`;
|
|
|
302180
302339
|
var {
|
|
302181
302340
|
builders: {
|
|
302182
302341
|
group: group2,
|
|
302183
|
-
join:
|
|
302342
|
+
join: join50,
|
|
302184
302343
|
line,
|
|
302185
302344
|
softline,
|
|
302186
302345
|
indent,
|
|
@@ -302281,10 +302440,10 @@ ${fromBody}`;
|
|
|
302281
302440
|
return printComments(typePath, printedType, options3);
|
|
302282
302441
|
}, "types");
|
|
302283
302442
|
if (shouldHug) {
|
|
302284
|
-
return
|
|
302443
|
+
return join50(" | ", printed);
|
|
302285
302444
|
}
|
|
302286
302445
|
const shouldAddStartLine = shouldIndent && !hasLeadingOwnLineComment(options3.originalText, node);
|
|
302287
|
-
const code = [ifBreak([shouldAddStartLine ? line : "", "| "]),
|
|
302446
|
+
const code = [ifBreak([shouldAddStartLine ? line : "", "| "]), join50([line, "| "], printed)];
|
|
302288
302447
|
if (pathNeedsParens(path68, options3)) {
|
|
302289
302448
|
return group2([indent(code), softline]);
|
|
302290
302449
|
}
|
|
@@ -302359,7 +302518,7 @@ ${fromBody}`;
|
|
|
302359
302518
|
} = require_comments();
|
|
302360
302519
|
var {
|
|
302361
302520
|
builders: {
|
|
302362
|
-
join:
|
|
302521
|
+
join: join50,
|
|
302363
302522
|
line,
|
|
302364
302523
|
hardline,
|
|
302365
302524
|
softline,
|
|
@@ -302401,10 +302560,10 @@ ${fromBody}`;
|
|
|
302401
302560
|
const isArrowFunctionVariable = path68.match((node2) => !(node2[paramsKey].length === 1 && isObjectType(node2[paramsKey][0])), void 0, (node2, name) => name === "typeAnnotation", (node2) => node2.type === "Identifier", isArrowFunctionVariableDeclarator);
|
|
302402
302561
|
const shouldInline = node[paramsKey].length === 0 || !isArrowFunctionVariable && (isParameterInTestCall || node[paramsKey].length === 1 && (node[paramsKey][0].type === "NullableTypeAnnotation" || shouldHugType(node[paramsKey][0])));
|
|
302403
302562
|
if (shouldInline) {
|
|
302404
|
-
return ["<",
|
|
302563
|
+
return ["<", join50(", ", path68.map(print, paramsKey)), printDanglingCommentsForInline(path68, options3), ">"];
|
|
302405
302564
|
}
|
|
302406
302565
|
const trailingComma = node.type === "TSTypeParameterInstantiation" ? "" : getFunctionParameters(node).length === 1 && isTSXFile(options3) && !node[paramsKey][0].constraint && path68.getParentNode().type === "ArrowFunctionExpression" ? "," : shouldPrintComma(options3, "all") ? ifBreak(",") : "";
|
|
302407
|
-
return group2(["<", indent([softline,
|
|
302566
|
+
return group2(["<", indent([softline, join50([",", line], path68.map(print, paramsKey))]), trailingComma, softline, ">"], {
|
|
302408
302567
|
id: getTypeParametersGroupId(node)
|
|
302409
302568
|
});
|
|
302410
302569
|
}
|
|
@@ -302542,7 +302701,7 @@ ${fromBody}`;
|
|
|
302542
302701
|
indent,
|
|
302543
302702
|
ifBreak,
|
|
302544
302703
|
hardline,
|
|
302545
|
-
join:
|
|
302704
|
+
join: join50,
|
|
302546
302705
|
indentIfBreak
|
|
302547
302706
|
},
|
|
302548
302707
|
utils: {
|
|
@@ -302698,7 +302857,7 @@ ${fromBody}`;
|
|
|
302698
302857
|
if (tailNode.body.type === "SequenceExpression") {
|
|
302699
302858
|
bodyDoc = group2(["(", indent([softline, bodyDoc]), softline, ")"]);
|
|
302700
302859
|
}
|
|
302701
|
-
return group2([group2(indent([isCallee || isAssignmentRhs ? softline : "", group2(
|
|
302860
|
+
return group2([group2(indent([isCallee || isAssignmentRhs ? softline : "", group2(join50([" =>", line], signatures), {
|
|
302702
302861
|
shouldBreak
|
|
302703
302862
|
})]), {
|
|
302704
302863
|
id: groupId,
|
|
@@ -302850,7 +303009,7 @@ ${fromBody}`;
|
|
|
302850
303009
|
builders: {
|
|
302851
303010
|
line,
|
|
302852
303011
|
hardline,
|
|
302853
|
-
join:
|
|
303012
|
+
join: join50,
|
|
302854
303013
|
breakParent,
|
|
302855
303014
|
group: group2
|
|
302856
303015
|
}
|
|
@@ -302864,10 +303023,10 @@ ${fromBody}`;
|
|
|
302864
303023
|
} = require_utils72();
|
|
302865
303024
|
function printClassMemberDecorators(path68, options3, print) {
|
|
302866
303025
|
const node = path68.getValue();
|
|
302867
|
-
return group2([
|
|
303026
|
+
return group2([join50(line, path68.map(print, "decorators")), hasNewlineBetweenOrAfterDecorators(node, options3) ? hardline : line]);
|
|
302868
303027
|
}
|
|
302869
303028
|
function printDecoratorsBeforeExport(path68, options3, print) {
|
|
302870
|
-
return [
|
|
303029
|
+
return [join50(hardline, path68.map(print, "declaration", "decorators")), hardline];
|
|
302871
303030
|
}
|
|
302872
303031
|
function printDecorators(path68, options3, print) {
|
|
302873
303032
|
const node = path68.getValue();
|
|
@@ -302878,7 +303037,7 @@ ${fromBody}`;
|
|
|
302878
303037
|
return;
|
|
302879
303038
|
}
|
|
302880
303039
|
const shouldBreak = node.type === "ClassExpression" || node.type === "ClassDeclaration" || hasNewlineBetweenOrAfterDecorators(node, options3);
|
|
302881
|
-
return [getParentExportDeclaration(path68) ? hardline : shouldBreak ? breakParent : "",
|
|
303040
|
+
return [getParentExportDeclaration(path68) ? hardline : shouldBreak ? breakParent : "", join50(line, path68.map(print, "decorators")), line];
|
|
302882
303041
|
}
|
|
302883
303042
|
function hasNewlineBetweenOrAfterDecorators(node, options3) {
|
|
302884
303043
|
return node.decorators.some((decorator) => hasNewline(options3.originalText, locEnd(decorator)));
|
|
@@ -302911,7 +303070,7 @@ ${fromBody}`;
|
|
|
302911
303070
|
} = require_comments();
|
|
302912
303071
|
var {
|
|
302913
303072
|
builders: {
|
|
302914
|
-
join:
|
|
303073
|
+
join: join50,
|
|
302915
303074
|
line,
|
|
302916
303075
|
hardline,
|
|
302917
303076
|
softline,
|
|
@@ -303011,7 +303170,7 @@ ${fromBody}`;
|
|
|
303011
303170
|
}) => marker === listName);
|
|
303012
303171
|
return [shouldIndentOnlyHeritageClauses(node) ? ifBreak(" ", line, {
|
|
303013
303172
|
groupId: getTypeParametersGroupId(node.typeParameters)
|
|
303014
|
-
}) : line, printedLeadingComments, printedLeadingComments && hardline, listName, group2(indent([line,
|
|
303173
|
+
}) : line, printedLeadingComments, printedLeadingComments && hardline, listName, group2(indent([line, join50([",", line], path68.map(print, listName))]))];
|
|
303015
303174
|
}
|
|
303016
303175
|
function printSuperClass(path68, options3, print) {
|
|
303017
303176
|
const printed = print("superClass");
|
|
@@ -303098,7 +303257,7 @@ ${fromBody}`;
|
|
|
303098
303257
|
} = require_util18();
|
|
303099
303258
|
var {
|
|
303100
303259
|
builders: {
|
|
303101
|
-
join:
|
|
303260
|
+
join: join50,
|
|
303102
303261
|
line,
|
|
303103
303262
|
group: group2,
|
|
303104
303263
|
indent,
|
|
@@ -303135,7 +303294,7 @@ ${fromBody}`;
|
|
|
303135
303294
|
if (isNonEmptyArray(node.extends)) {
|
|
303136
303295
|
extendsParts.push(shouldIndentOnlyHeritageClauses ? ifBreak(" ", line, {
|
|
303137
303296
|
groupId: getTypeParametersGroupId(node.typeParameters)
|
|
303138
|
-
}) : line, "extends ", (node.extends.length === 1 ? identity4 : indent)(
|
|
303297
|
+
}) : line, "extends ", (node.extends.length === 1 ? identity4 : indent)(join50([",", line], path68.map(print, "extends"))));
|
|
303139
303298
|
}
|
|
303140
303299
|
if (node.id && hasComment(node.id, CommentCheckFlags.Trailing) || isNonEmptyArray(node.extends)) {
|
|
303141
303300
|
if (shouldIndentOnlyHeritageClauses) {
|
|
@@ -303165,7 +303324,7 @@ ${fromBody}`;
|
|
|
303165
303324
|
softline,
|
|
303166
303325
|
group: group2,
|
|
303167
303326
|
indent,
|
|
303168
|
-
join:
|
|
303327
|
+
join: join50,
|
|
303169
303328
|
line,
|
|
303170
303329
|
ifBreak,
|
|
303171
303330
|
hardline
|
|
@@ -303306,14 +303465,14 @@ ${fromBody}`;
|
|
|
303306
303465
|
throw new Error(`Unknown specifier type ${JSON.stringify(specifierType)}`);
|
|
303307
303466
|
}
|
|
303308
303467
|
}, "specifiers");
|
|
303309
|
-
parts.push(
|
|
303468
|
+
parts.push(join50(", ", standaloneSpecifiers));
|
|
303310
303469
|
if (groupedSpecifiers.length > 0) {
|
|
303311
303470
|
if (standaloneSpecifiers.length > 0) {
|
|
303312
303471
|
parts.push(", ");
|
|
303313
303472
|
}
|
|
303314
303473
|
const canBreak = groupedSpecifiers.length > 1 || standaloneSpecifiers.length > 0 || node.specifiers.some((node2) => hasComment(node2));
|
|
303315
303474
|
if (canBreak) {
|
|
303316
|
-
parts.push(group2(["{", indent([options3.bracketSpacing ? line : softline,
|
|
303475
|
+
parts.push(group2(["{", indent([options3.bracketSpacing ? line : softline, join50([",", line], groupedSpecifiers)]), ifBreak(shouldPrintComma(options3) ? "," : ""), options3.bracketSpacing ? line : softline, "}"]));
|
|
303317
303476
|
} else {
|
|
303318
303477
|
parts.push(["{", options3.bracketSpacing ? " " : "", ...groupedSpecifiers, options3.bracketSpacing ? " " : "", "}"]);
|
|
303319
303478
|
}
|
|
@@ -303338,7 +303497,7 @@ ${fromBody}`;
|
|
|
303338
303497
|
function printImportAssertions(path68, options3, print) {
|
|
303339
303498
|
const node = path68.getNode();
|
|
303340
303499
|
if (isNonEmptyArray(node.assertions)) {
|
|
303341
|
-
return [" assert {", options3.bracketSpacing ? " " : "",
|
|
303500
|
+
return [" assert {", options3.bracketSpacing ? " " : "", join50(", ", path68.map(print, "assertions")), options3.bracketSpacing ? " " : "", "}"];
|
|
303342
303501
|
}
|
|
303343
303502
|
return "";
|
|
303344
303503
|
}
|
|
@@ -304249,7 +304408,7 @@ ${fromBody}`;
|
|
|
304249
304408
|
} = require_util18();
|
|
304250
304409
|
var {
|
|
304251
304410
|
builders: {
|
|
304252
|
-
join:
|
|
304411
|
+
join: join50,
|
|
304253
304412
|
line,
|
|
304254
304413
|
hardline,
|
|
304255
304414
|
softline,
|
|
@@ -304357,7 +304516,7 @@ ${fromBody}`;
|
|
|
304357
304516
|
case "TSTypeAliasDeclaration":
|
|
304358
304517
|
return printTypeAlias(path68, options3, print);
|
|
304359
304518
|
case "TSQualifiedName":
|
|
304360
|
-
return
|
|
304519
|
+
return join50(".", [print("left"), print("right")]);
|
|
304361
304520
|
case "TSAbstractMethodDefinition":
|
|
304362
304521
|
case "TSDeclareMethod":
|
|
304363
304522
|
return printClassMethod(path68, options3, print);
|
|
@@ -304436,7 +304595,7 @@ ${fromBody}`;
|
|
|
304436
304595
|
case "TSIndexSignature": {
|
|
304437
304596
|
const parent = path68.getParentNode();
|
|
304438
304597
|
const trailingComma = node.parameters.length > 1 ? ifBreak(shouldPrintComma(options3) ? "," : "") : "";
|
|
304439
|
-
const parametersGroup = group2([indent([softline,
|
|
304598
|
+
const parametersGroup = group2([indent([softline, join50([", ", softline], path68.map(print, "parameters"))]), trailingComma, softline]);
|
|
304440
304599
|
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 : ""];
|
|
304441
304600
|
}
|
|
304442
304601
|
case "TSTypePredicate":
|
|
@@ -304608,7 +304767,7 @@ ${fromBody}`;
|
|
|
304608
304767
|
} = require_util18();
|
|
304609
304768
|
var {
|
|
304610
304769
|
builders: {
|
|
304611
|
-
join:
|
|
304770
|
+
join: join50,
|
|
304612
304771
|
hardline
|
|
304613
304772
|
},
|
|
304614
304773
|
utils: {
|
|
@@ -304650,7 +304809,7 @@ ${fromBody}`;
|
|
|
304650
304809
|
}
|
|
304651
304810
|
function printIndentableBlockComment(comment) {
|
|
304652
304811
|
const lines = comment.value.split("\n");
|
|
304653
|
-
return ["/*",
|
|
304812
|
+
return ["/*", join50(hardline, lines.map((line, index) => index === 0 ? line.trimEnd() : " " + (index < lines.length - 1 ? line.trim() : line.trimStart()))), "*/"];
|
|
304654
304813
|
}
|
|
304655
304814
|
module22.exports = {
|
|
304656
304815
|
printComment
|
|
@@ -304743,7 +304902,7 @@ ${fromBody}`;
|
|
|
304743
304902
|
} = require_util18();
|
|
304744
304903
|
var {
|
|
304745
304904
|
builders: {
|
|
304746
|
-
join:
|
|
304905
|
+
join: join50,
|
|
304747
304906
|
line,
|
|
304748
304907
|
hardline,
|
|
304749
304908
|
softline,
|
|
@@ -305090,7 +305249,7 @@ ${fromBody}`;
|
|
|
305090
305249
|
}, "expressions");
|
|
305091
305250
|
return group2(parts2);
|
|
305092
305251
|
}
|
|
305093
|
-
return group2(
|
|
305252
|
+
return group2(join50([",", line], path68.map(print, "expressions")));
|
|
305094
305253
|
}
|
|
305095
305254
|
case "ThisExpression":
|
|
305096
305255
|
return "this";
|
|
@@ -305213,7 +305372,7 @@ ${fromBody}`;
|
|
|
305213
305372
|
}
|
|
305214
305373
|
return ["catch ", print("body")];
|
|
305215
305374
|
case "SwitchStatement":
|
|
305216
|
-
return [group2(["switch (", indent([softline, print("discriminant")]), softline, ")"]), " {", node.cases.length > 0 ? indent([hardline,
|
|
305375
|
+
return [group2(["switch (", indent([softline, print("discriminant")]), softline, ")"]), " {", node.cases.length > 0 ? indent([hardline, join50(hardline, path68.map((casePath, index, cases) => {
|
|
305217
305376
|
const caseNode = casePath.getValue();
|
|
305218
305377
|
return [print(), index !== cases.length - 1 && isNextLineEmpty(caseNode, options3) ? hardline : ""];
|
|
305219
305378
|
}, "cases"))]) : "", hardline, "}"];
|
|
@@ -305314,7 +305473,7 @@ ${fromBody}`;
|
|
|
305314
305473
|
builders: {
|
|
305315
305474
|
hardline,
|
|
305316
305475
|
indent,
|
|
305317
|
-
join:
|
|
305476
|
+
join: join50
|
|
305318
305477
|
}
|
|
305319
305478
|
} = require_doc();
|
|
305320
305479
|
var preprocess2 = require_print_preprocess();
|
|
@@ -305328,10 +305487,10 @@ ${fromBody}`;
|
|
|
305328
305487
|
return "[]";
|
|
305329
305488
|
}
|
|
305330
305489
|
const printed = path68.map(() => path68.getValue() === null ? "null" : print(), "elements");
|
|
305331
|
-
return ["[", indent([hardline,
|
|
305490
|
+
return ["[", indent([hardline, join50([",", hardline], printed)]), hardline, "]"];
|
|
305332
305491
|
}
|
|
305333
305492
|
case "ObjectExpression":
|
|
305334
|
-
return node.properties.length === 0 ? "{}" : ["{", indent([hardline,
|
|
305493
|
+
return node.properties.length === 0 ? "{}" : ["{", indent([hardline, join50([",", hardline], path68.map(print, "properties"))]), hardline, "}"];
|
|
305335
305494
|
case "ObjectProperty":
|
|
305336
305495
|
return [print("key"), ": ", print("value")];
|
|
305337
305496
|
case "UnaryExpression":
|
|
@@ -306617,7 +306776,7 @@ ${fromBody}`;
|
|
|
306617
306776
|
} = require_util18();
|
|
306618
306777
|
var {
|
|
306619
306778
|
builders: {
|
|
306620
|
-
join:
|
|
306779
|
+
join: join50,
|
|
306621
306780
|
line,
|
|
306622
306781
|
hardline,
|
|
306623
306782
|
softline,
|
|
@@ -306760,10 +306919,10 @@ ${fromBody}`;
|
|
|
306760
306919
|
}
|
|
306761
306920
|
parts.push(print());
|
|
306762
306921
|
}, "nodes");
|
|
306763
|
-
return group2(indent(
|
|
306922
|
+
return group2(indent(join50(line, parts)));
|
|
306764
306923
|
}
|
|
306765
306924
|
case "media-query": {
|
|
306766
|
-
return [
|
|
306925
|
+
return [join50(" ", path68.map(print, "nodes")), isLastNode(path68, node) ? "" : ","];
|
|
306767
306926
|
}
|
|
306768
306927
|
case "media-type": {
|
|
306769
306928
|
return adjustNumbers(adjustStrings(node.value, options3));
|
|
@@ -306793,7 +306952,7 @@ ${fromBody}`;
|
|
|
306793
306952
|
return node.value;
|
|
306794
306953
|
}
|
|
306795
306954
|
case "selector-root": {
|
|
306796
|
-
return group2([insideAtRuleNode(path68, "custom-selector") ? [getAncestorNode(path68, "css-atrule").customSelector, line] : "",
|
|
306955
|
+
return group2([insideAtRuleNode(path68, "custom-selector") ? [getAncestorNode(path68, "css-atrule").customSelector, line] : "", join50([",", insideAtRuleNode(path68, ["extend", "custom-selector", "nest"]) ? line : hardline], path68.map(print, "nodes"))]);
|
|
306797
306956
|
}
|
|
306798
306957
|
case "selector-selector": {
|
|
306799
306958
|
return group2(indent(path68.map(print, "nodes")));
|
|
@@ -306834,7 +306993,7 @@ ${fromBody}`;
|
|
|
306834
306993
|
return [node.namespace ? [node.namespace === true ? "" : node.namespace.trim(), "|"] : "", node.value];
|
|
306835
306994
|
}
|
|
306836
306995
|
case "selector-pseudo": {
|
|
306837
|
-
return [maybeToLowerCase(node.value), isNonEmptyArray(node.nodes) ? group2(["(", indent([softline,
|
|
306996
|
+
return [maybeToLowerCase(node.value), isNonEmptyArray(node.nodes) ? group2(["(", indent([softline, join50([",", line], path68.map(print, "nodes"))]), softline, ")"]) : ""];
|
|
306838
306997
|
}
|
|
306839
306998
|
case "selector-nesting": {
|
|
306840
306999
|
return node.value;
|
|
@@ -307030,7 +307189,7 @@ ${fromBody}`;
|
|
|
307030
307189
|
case "value-paren_group": {
|
|
307031
307190
|
const parentNode = path68.getParentNode();
|
|
307032
307191
|
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:"))) {
|
|
307033
|
-
return [node.open ? print("open") : "",
|
|
307192
|
+
return [node.open ? print("open") : "", join50(",", path68.map(print, "groups")), node.close ? print("close") : ""];
|
|
307034
307193
|
}
|
|
307035
307194
|
if (!node.open) {
|
|
307036
307195
|
const printed2 = path68.map(print, "groups");
|
|
@@ -307050,7 +307209,7 @@ ${fromBody}`;
|
|
|
307050
307209
|
const isConfiguration = isConfigurationNode(node, parentNode);
|
|
307051
307210
|
const shouldBreak = isConfiguration || isSCSSMapItem && !isKey;
|
|
307052
307211
|
const shouldDedent = isConfiguration || isKey;
|
|
307053
|
-
const printed = group2([node.open ? print("open") : "", indent([softline,
|
|
307212
|
+
const printed = group2([node.open ? print("open") : "", indent([softline, join50([line], path68.map((childPath, index) => {
|
|
307054
307213
|
const child = childPath.getValue();
|
|
307055
307214
|
const isLast = index === node.groups.length - 1;
|
|
307056
307215
|
let printed2 = [print(), isLast ? "" : ","];
|
|
@@ -307422,7 +307581,7 @@ ${fromBody}`;
|
|
|
307422
307581
|
hardline,
|
|
307423
307582
|
ifBreak,
|
|
307424
307583
|
indent,
|
|
307425
|
-
join:
|
|
307584
|
+
join: join50,
|
|
307426
307585
|
line,
|
|
307427
307586
|
softline
|
|
307428
307587
|
},
|
|
@@ -307514,7 +307673,7 @@ ${fromBody}`;
|
|
|
307514
307673
|
return path68.map(print2, "parts");
|
|
307515
307674
|
}
|
|
307516
307675
|
case "Hash": {
|
|
307517
|
-
return
|
|
307676
|
+
return join50(line, path68.map(print2, "pairs"));
|
|
307518
307677
|
}
|
|
307519
307678
|
case "HashPair": {
|
|
307520
307679
|
return [node.key, "=", print2("value")];
|
|
@@ -307750,7 +307909,7 @@ ${fromBody}`;
|
|
|
307750
307909
|
if (isNonEmptyArray(node.program.blockParams)) {
|
|
307751
307910
|
parts.push(printBlockParams(node.program));
|
|
307752
307911
|
}
|
|
307753
|
-
return group2([printOpeningBlockOpeningMustache(node), printPath(path68, print2), parts.length > 0 ? indent([line,
|
|
307912
|
+
return group2([printOpeningBlockOpeningMustache(node), printPath(path68, print2), parts.length > 0 ? indent([line, join50(line, parts)]) : "", softline, printOpeningBlockClosingMustache(node)]);
|
|
307754
307913
|
}
|
|
307755
307914
|
function printElseBlock(node, options3) {
|
|
307756
307915
|
return [options3.htmlWhitespaceSensitivity === "ignore" ? hardline : "", printInverseBlockOpeningMustache(node), "else", printInverseBlockClosingMustache(node)];
|
|
@@ -307801,7 +307960,7 @@ ${fromBody}`;
|
|
|
307801
307960
|
return "";
|
|
307802
307961
|
}
|
|
307803
307962
|
function getTextValueParts(value) {
|
|
307804
|
-
return getDocParts(
|
|
307963
|
+
return getDocParts(join50(line, splitByHtmlWhitespace(value)));
|
|
307805
307964
|
}
|
|
307806
307965
|
function splitByHtmlWhitespace(string4) {
|
|
307807
307966
|
return string4.split(/[\t\n\f\r ]+/);
|
|
@@ -307885,7 +308044,7 @@ ${fromBody}`;
|
|
|
307885
308044
|
if (parts.length === 0) {
|
|
307886
308045
|
return "";
|
|
307887
308046
|
}
|
|
307888
|
-
return
|
|
308047
|
+
return join50(line, parts);
|
|
307889
308048
|
}
|
|
307890
308049
|
function printBlockParams(node) {
|
|
307891
308050
|
return ["as |", node.blockParams.join(" "), "|"];
|
|
@@ -307982,7 +308141,7 @@ ${fromBody}`;
|
|
|
307982
308141
|
"use strict";
|
|
307983
308142
|
var {
|
|
307984
308143
|
builders: {
|
|
307985
|
-
join:
|
|
308144
|
+
join: join50,
|
|
307986
308145
|
hardline,
|
|
307987
308146
|
line,
|
|
307988
308147
|
softline,
|
|
@@ -308027,16 +308186,16 @@ ${fromBody}`;
|
|
|
308027
308186
|
case "OperationDefinition": {
|
|
308028
308187
|
const hasOperation = options3.originalText[locStart(node)] !== "{";
|
|
308029
308188
|
const hasName2 = Boolean(node.name);
|
|
308030
|
-
return [hasOperation ? node.operation : "", hasOperation && hasName2 ? [" ", print("name")] : "", hasOperation && !hasName2 && isNonEmptyArray(node.variableDefinitions) ? " " : "", isNonEmptyArray(node.variableDefinitions) ? group2(["(", indent([softline,
|
|
308189
|
+
return [hasOperation ? node.operation : "", hasOperation && hasName2 ? [" ", print("name")] : "", hasOperation && !hasName2 && isNonEmptyArray(node.variableDefinitions) ? " " : "", isNonEmptyArray(node.variableDefinitions) ? group2(["(", indent([softline, join50([ifBreak("", ", "), softline], path68.map(print, "variableDefinitions"))]), softline, ")"]) : "", printDirectives(path68, print, node), node.selectionSet ? !hasOperation && !hasName2 ? "" : " " : "", print("selectionSet")];
|
|
308031
308190
|
}
|
|
308032
308191
|
case "FragmentDefinition": {
|
|
308033
|
-
return ["fragment ", print("name"), isNonEmptyArray(node.variableDefinitions) ? group2(["(", indent([softline,
|
|
308192
|
+
return ["fragment ", print("name"), isNonEmptyArray(node.variableDefinitions) ? group2(["(", indent([softline, join50([ifBreak("", ", "), softline], path68.map(print, "variableDefinitions"))]), softline, ")"]) : "", " on ", print("typeCondition"), printDirectives(path68, print, node), " ", print("selectionSet")];
|
|
308034
308193
|
}
|
|
308035
308194
|
case "SelectionSet": {
|
|
308036
|
-
return ["{", indent([hardline,
|
|
308195
|
+
return ["{", indent([hardline, join50(hardline, printSequence(path68, options3, print, "selections"))]), hardline, "}"];
|
|
308037
308196
|
}
|
|
308038
308197
|
case "Field": {
|
|
308039
|
-
return group2([node.alias ? [print("alias"), ": "] : "", print("name"), node.arguments.length > 0 ? group2(["(", indent([softline,
|
|
308198
|
+
return group2([node.alias ? [print("alias"), ": "] : "", print("name"), node.arguments.length > 0 ? group2(["(", indent([softline, join50([ifBreak("", ", "), softline], printSequence(path68, options3, print, "arguments"))]), softline, ")"]) : "", printDirectives(path68, print, node), node.selectionSet ? " " : "", print("selectionSet")]);
|
|
308040
308199
|
}
|
|
308041
308200
|
case "Name": {
|
|
308042
308201
|
return node.value;
|
|
@@ -308050,7 +308209,7 @@ ${fromBody}`;
|
|
|
308050
308209
|
if (lines.every((line2) => line2 === "")) {
|
|
308051
308210
|
lines.length = 0;
|
|
308052
308211
|
}
|
|
308053
|
-
return
|
|
308212
|
+
return join50(hardline, ['"""', ...lines, '"""']);
|
|
308054
308213
|
}
|
|
308055
308214
|
return ['"', node.value.replace(/["\\]/g, "\\$&").replace(/\n/g, "\\n"), '"'];
|
|
308056
308215
|
}
|
|
@@ -308069,17 +308228,17 @@ ${fromBody}`;
|
|
|
308069
308228
|
return ["$", print("name")];
|
|
308070
308229
|
}
|
|
308071
308230
|
case "ListValue": {
|
|
308072
|
-
return group2(["[", indent([softline,
|
|
308231
|
+
return group2(["[", indent([softline, join50([ifBreak("", ", "), softline], path68.map(print, "values"))]), softline, "]"]);
|
|
308073
308232
|
}
|
|
308074
308233
|
case "ObjectValue": {
|
|
308075
|
-
return group2(["{", options3.bracketSpacing && node.fields.length > 0 ? " " : "", indent([softline,
|
|
308234
|
+
return group2(["{", options3.bracketSpacing && node.fields.length > 0 ? " " : "", indent([softline, join50([ifBreak("", ", "), softline], path68.map(print, "fields"))]), softline, ifBreak("", options3.bracketSpacing && node.fields.length > 0 ? " " : ""), "}"]);
|
|
308076
308235
|
}
|
|
308077
308236
|
case "ObjectField":
|
|
308078
308237
|
case "Argument": {
|
|
308079
308238
|
return [print("name"), ": ", print("value")];
|
|
308080
308239
|
}
|
|
308081
308240
|
case "Directive": {
|
|
308082
|
-
return ["@", print("name"), node.arguments.length > 0 ? group2(["(", indent([softline,
|
|
308241
|
+
return ["@", print("name"), node.arguments.length > 0 ? group2(["(", indent([softline, join50([ifBreak("", ", "), softline], printSequence(path68, options3, print, "arguments"))]), softline, ")"]) : ""];
|
|
308083
308242
|
}
|
|
308084
308243
|
case "NamedType": {
|
|
308085
308244
|
return print("name");
|
|
@@ -308089,17 +308248,17 @@ ${fromBody}`;
|
|
|
308089
308248
|
}
|
|
308090
308249
|
case "ObjectTypeExtension":
|
|
308091
308250
|
case "ObjectTypeDefinition": {
|
|
308092
|
-
return [print("description"), node.description ? hardline : "", node.kind === "ObjectTypeExtension" ? "extend " : "", "type ", print("name"), node.interfaces.length > 0 ? [" implements ", ...printInterfaces(path68, options3, print)] : "", printDirectives(path68, print, node), node.fields.length > 0 ? [" {", indent([hardline,
|
|
308251
|
+
return [print("description"), node.description ? hardline : "", node.kind === "ObjectTypeExtension" ? "extend " : "", "type ", print("name"), node.interfaces.length > 0 ? [" implements ", ...printInterfaces(path68, options3, print)] : "", printDirectives(path68, print, node), node.fields.length > 0 ? [" {", indent([hardline, join50(hardline, printSequence(path68, options3, print, "fields"))]), hardline, "}"] : ""];
|
|
308093
308252
|
}
|
|
308094
308253
|
case "FieldDefinition": {
|
|
308095
|
-
return [print("description"), node.description ? hardline : "", print("name"), node.arguments.length > 0 ? group2(["(", indent([softline,
|
|
308254
|
+
return [print("description"), node.description ? hardline : "", print("name"), node.arguments.length > 0 ? group2(["(", indent([softline, join50([ifBreak("", ", "), softline], printSequence(path68, options3, print, "arguments"))]), softline, ")"]) : "", ": ", print("type"), printDirectives(path68, print, node)];
|
|
308096
308255
|
}
|
|
308097
308256
|
case "DirectiveDefinition": {
|
|
308098
|
-
return [print("description"), node.description ? hardline : "", "directive ", "@", print("name"), node.arguments.length > 0 ? group2(["(", indent([softline,
|
|
308257
|
+
return [print("description"), node.description ? hardline : "", "directive ", "@", print("name"), node.arguments.length > 0 ? group2(["(", indent([softline, join50([ifBreak("", ", "), softline], printSequence(path68, options3, print, "arguments"))]), softline, ")"]) : "", node.repeatable ? " repeatable" : "", " on ", join50(" | ", path68.map(print, "locations"))];
|
|
308099
308258
|
}
|
|
308100
308259
|
case "EnumTypeExtension":
|
|
308101
308260
|
case "EnumTypeDefinition": {
|
|
308102
|
-
return [print("description"), node.description ? hardline : "", node.kind === "EnumTypeExtension" ? "extend " : "", "enum ", print("name"), printDirectives(path68, print, node), node.values.length > 0 ? [" {", indent([hardline,
|
|
308261
|
+
return [print("description"), node.description ? hardline : "", node.kind === "EnumTypeExtension" ? "extend " : "", "enum ", print("name"), printDirectives(path68, print, node), node.values.length > 0 ? [" {", indent([hardline, join50(hardline, printSequence(path68, options3, print, "values"))]), hardline, "}"] : ""];
|
|
308103
308262
|
}
|
|
308104
308263
|
case "EnumValueDefinition": {
|
|
308105
308264
|
return [print("description"), node.description ? hardline : "", print("name"), printDirectives(path68, print, node)];
|
|
@@ -308109,20 +308268,20 @@ ${fromBody}`;
|
|
|
308109
308268
|
}
|
|
308110
308269
|
case "InputObjectTypeExtension":
|
|
308111
308270
|
case "InputObjectTypeDefinition": {
|
|
308112
|
-
return [print("description"), node.description ? hardline : "", node.kind === "InputObjectTypeExtension" ? "extend " : "", "input ", print("name"), printDirectives(path68, print, node), node.fields.length > 0 ? [" {", indent([hardline,
|
|
308271
|
+
return [print("description"), node.description ? hardline : "", node.kind === "InputObjectTypeExtension" ? "extend " : "", "input ", print("name"), printDirectives(path68, print, node), node.fields.length > 0 ? [" {", indent([hardline, join50(hardline, printSequence(path68, options3, print, "fields"))]), hardline, "}"] : ""];
|
|
308113
308272
|
}
|
|
308114
308273
|
case "SchemaExtension": {
|
|
308115
|
-
return ["extend schema", printDirectives(path68, print, node), ...node.operationTypes.length > 0 ? [" {", indent([hardline,
|
|
308274
|
+
return ["extend schema", printDirectives(path68, print, node), ...node.operationTypes.length > 0 ? [" {", indent([hardline, join50(hardline, printSequence(path68, options3, print, "operationTypes"))]), hardline, "}"] : []];
|
|
308116
308275
|
}
|
|
308117
308276
|
case "SchemaDefinition": {
|
|
308118
|
-
return [print("description"), node.description ? hardline : "", "schema", printDirectives(path68, print, node), " {", node.operationTypes.length > 0 ? indent([hardline,
|
|
308277
|
+
return [print("description"), node.description ? hardline : "", "schema", printDirectives(path68, print, node), " {", node.operationTypes.length > 0 ? indent([hardline, join50(hardline, printSequence(path68, options3, print, "operationTypes"))]) : "", hardline, "}"];
|
|
308119
308278
|
}
|
|
308120
308279
|
case "OperationTypeDefinition": {
|
|
308121
308280
|
return [print("operation"), ": ", print("type")];
|
|
308122
308281
|
}
|
|
308123
308282
|
case "InterfaceTypeExtension":
|
|
308124
308283
|
case "InterfaceTypeDefinition": {
|
|
308125
|
-
return [print("description"), node.description ? hardline : "", node.kind === "InterfaceTypeExtension" ? "extend " : "", "interface ", print("name"), node.interfaces.length > 0 ? [" implements ", ...printInterfaces(path68, options3, print)] : "", printDirectives(path68, print, node), node.fields.length > 0 ? [" {", indent([hardline,
|
|
308284
|
+
return [print("description"), node.description ? hardline : "", node.kind === "InterfaceTypeExtension" ? "extend " : "", "interface ", print("name"), node.interfaces.length > 0 ? [" implements ", ...printInterfaces(path68, options3, print)] : "", printDirectives(path68, print, node), node.fields.length > 0 ? [" {", indent([hardline, join50(hardline, printSequence(path68, options3, print, "fields"))]), hardline, "}"] : ""];
|
|
308126
308285
|
}
|
|
308127
308286
|
case "FragmentSpread": {
|
|
308128
308287
|
return ["...", print("name"), printDirectives(path68, print, node)];
|
|
@@ -308132,7 +308291,7 @@ ${fromBody}`;
|
|
|
308132
308291
|
}
|
|
308133
308292
|
case "UnionTypeExtension":
|
|
308134
308293
|
case "UnionTypeDefinition": {
|
|
308135
|
-
return group2([print("description"), node.description ? hardline : "", group2([node.kind === "UnionTypeExtension" ? "extend " : "", "union ", print("name"), printDirectives(path68, print, node), node.types.length > 0 ? [" =", ifBreak("", " "), indent([ifBreak([line, " "]),
|
|
308294
|
+
return group2([print("description"), node.description ? hardline : "", group2([node.kind === "UnionTypeExtension" ? "extend " : "", "union ", print("name"), printDirectives(path68, print, node), node.types.length > 0 ? [" =", ifBreak("", " "), indent([ifBreak([line, " "]), join50([line, "| "], path68.map(print, "types"))])] : ""])]);
|
|
308136
308295
|
}
|
|
308137
308296
|
case "ScalarTypeExtension":
|
|
308138
308297
|
case "ScalarTypeDefinition": {
|
|
@@ -308152,7 +308311,7 @@ ${fromBody}`;
|
|
|
308152
308311
|
if (node.directives.length === 0) {
|
|
308153
308312
|
return "";
|
|
308154
308313
|
}
|
|
308155
|
-
const printed =
|
|
308314
|
+
const printed = join50(line, path68.map(print, "directives"));
|
|
308156
308315
|
if (node.kind === "FragmentDefinition" || node.kind === "OperationDefinition") {
|
|
308157
308316
|
return group2([line, printed]);
|
|
308158
308317
|
}
|
|
@@ -308788,7 +308947,7 @@ ${extracted.content}`;
|
|
|
308788
308947
|
var {
|
|
308789
308948
|
builders: {
|
|
308790
308949
|
breakParent,
|
|
308791
|
-
join:
|
|
308950
|
+
join: join50,
|
|
308792
308951
|
line,
|
|
308793
308952
|
literalline,
|
|
308794
308953
|
markAsRoot,
|
|
@@ -309089,9 +309248,9 @@ ${extracted.content}`;
|
|
|
309089
309248
|
function printTableContents(isCompact) {
|
|
309090
309249
|
const parts = [printRow(contents[0], isCompact), printAlign(isCompact)];
|
|
309091
309250
|
if (contents.length > 1) {
|
|
309092
|
-
parts.push(
|
|
309251
|
+
parts.push(join50(hardlineWithoutBreakParent, contents.slice(1).map((rowContents) => printRow(rowContents, isCompact))));
|
|
309093
309252
|
}
|
|
309094
|
-
return
|
|
309253
|
+
return join50(hardlineWithoutBreakParent, parts);
|
|
309095
309254
|
}
|
|
309096
309255
|
function printAlign(isCompact) {
|
|
309097
309256
|
const align2 = columnMaxWidths.map((width, index) => {
|
|
@@ -309542,7 +309701,7 @@ ${extracted.content}`;
|
|
|
309542
309701
|
builders: {
|
|
309543
309702
|
line,
|
|
309544
309703
|
hardline,
|
|
309545
|
-
join:
|
|
309704
|
+
join: join50
|
|
309546
309705
|
},
|
|
309547
309706
|
utils: {
|
|
309548
309707
|
getDocParts,
|
|
@@ -309896,7 +310055,7 @@ ${extracted.content}`;
|
|
|
309896
310055
|
return tagName === "script" && attributeName === "setup" || tagName === "style" && attributeName === "vars";
|
|
309897
310056
|
}
|
|
309898
310057
|
function getTextValueParts(node, value = node.value) {
|
|
309899
|
-
return node.parent.isWhitespaceSensitive ? node.parent.isIndentationSensitive ? replaceTextEndOfLine(value) : replaceTextEndOfLine(dedentString(htmlTrimPreserveIndentation(value)), hardline) : getDocParts(
|
|
310058
|
+
return node.parent.isWhitespaceSensitive ? node.parent.isIndentationSensitive ? replaceTextEndOfLine(value) : replaceTextEndOfLine(dedentString(htmlTrimPreserveIndentation(value)), hardline) : getDocParts(join50(line, splitByHtmlWhitespace(value)));
|
|
309900
310059
|
}
|
|
309901
310060
|
function isVueScriptTag(node, options3) {
|
|
309902
310061
|
return isVueSfcBlock(node, options3) && node.name === "script";
|
|
@@ -311191,7 +311350,7 @@ ${extracted.content}`;
|
|
|
311191
311350
|
var {
|
|
311192
311351
|
builders: {
|
|
311193
311352
|
indent,
|
|
311194
|
-
join:
|
|
311353
|
+
join: join50,
|
|
311195
311354
|
line,
|
|
311196
311355
|
softline,
|
|
311197
311356
|
hardline
|
|
@@ -311305,7 +311464,7 @@ ${extracted.content}`;
|
|
|
311305
311464
|
const forceNotToBreakAttrContent = node.type === "element" && node.fullName === "script" && node.attrs.length === 1 && node.attrs[0].fullName === "src" && node.children.length === 0;
|
|
311306
311465
|
const shouldPrintAttributePerLine = options3.singleAttributePerLine && node.attrs.length > 1 && !isVueSfcBlock(node, options3);
|
|
311307
311466
|
const attributeLine = shouldPrintAttributePerLine ? hardline : line;
|
|
311308
|
-
const parts = [indent([forceNotToBreakAttrContent ? " " : line,
|
|
311467
|
+
const parts = [indent([forceNotToBreakAttrContent ? " " : line, join50(attributeLine, printedAttributes)])];
|
|
311309
311468
|
if (node.firstChild && needsToBorrowParentOpeningTagEndMarker(node.firstChild) || node.isSelfClosing && needsToBorrowLastChildClosingTagEndMarker(node.parent) || forceNotToBreakAttrContent) {
|
|
311310
311469
|
parts.push(node.isSelfClosing ? " " : "");
|
|
311311
311470
|
} else {
|
|
@@ -311539,7 +311698,7 @@ ${extracted.content}`;
|
|
|
311539
311698
|
var {
|
|
311540
311699
|
builders: {
|
|
311541
311700
|
ifBreak,
|
|
311542
|
-
join:
|
|
311701
|
+
join: join50,
|
|
311543
311702
|
line
|
|
311544
311703
|
}
|
|
311545
311704
|
} = require_doc();
|
|
@@ -311574,7 +311733,7 @@ ${extracted.content}`;
|
|
|
311574
311733
|
return index === -1 ? descriptor.length : index;
|
|
311575
311734
|
});
|
|
311576
311735
|
const maxDescriptorLeftLength = getMax(descriptorLeftLengths);
|
|
311577
|
-
return
|
|
311736
|
+
return join50([",", line], urls.map((url2, index) => {
|
|
311578
311737
|
const parts = [url2];
|
|
311579
311738
|
const descriptor = descriptors[index];
|
|
311580
311739
|
if (descriptor) {
|
|
@@ -312748,7 +312907,7 @@ ${text2}`;
|
|
|
312748
312907
|
line,
|
|
312749
312908
|
softline,
|
|
312750
312909
|
hardline,
|
|
312751
|
-
join:
|
|
312910
|
+
join: join50
|
|
312752
312911
|
}
|
|
312753
312912
|
} = require_doc();
|
|
312754
312913
|
var {
|
|
@@ -312771,7 +312930,7 @@ ${text2}`;
|
|
|
312771
312930
|
}
|
|
312772
312931
|
const lastItem = getLast(node.children);
|
|
312773
312932
|
const isLastItemEmptyMappingItem = lastItem && lastItem.type === "flowMappingItem" && isEmptyNode(lastItem.key) && isEmptyNode(lastItem.value);
|
|
312774
|
-
return [openMarker, alignWithSpaces(options3.tabWidth, [bracketSpacing, printChildren(path68, print, options3), options3.trailingComma === "none" ? "" : ifBreak(","), hasEndComments(node) ? [hardline,
|
|
312933
|
+
return [openMarker, alignWithSpaces(options3.tabWidth, [bracketSpacing, printChildren(path68, print, options3), options3.trailingComma === "none" ? "" : ifBreak(","), hasEndComments(node) ? [hardline, join50(hardline, path68.map(print, "endComments"))] : ""]), isLastItemEmptyMappingItem ? "" : bracketSpacing, closeMarker];
|
|
312775
312934
|
}
|
|
312776
312935
|
function printChildren(path68, print, options3) {
|
|
312777
312936
|
const node = path68.getValue();
|
|
@@ -312793,7 +312952,7 @@ ${text2}`;
|
|
|
312793
312952
|
group: group2,
|
|
312794
312953
|
hardline,
|
|
312795
312954
|
ifBreak,
|
|
312796
|
-
join:
|
|
312955
|
+
join: join50,
|
|
312797
312956
|
line
|
|
312798
312957
|
}
|
|
312799
312958
|
} = require_doc();
|
|
@@ -312835,7 +312994,7 @@ ${text2}`;
|
|
|
312835
312994
|
return [": ", alignWithSpaces(2, printedValue)];
|
|
312836
312995
|
}
|
|
312837
312996
|
if (hasLeadingComments(value) || !isInlineNode(key.content)) {
|
|
312838
|
-
return ["? ", alignWithSpaces(2, printedKey), hardline,
|
|
312997
|
+
return ["? ", alignWithSpaces(2, printedKey), hardline, join50("", path68.map(print, "value", "leadingComments").map((comment) => [comment, hardline])), ": ", alignWithSpaces(2, printedValue)];
|
|
312839
312998
|
}
|
|
312840
312999
|
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)) {
|
|
312841
313000
|
return [printedKey, spaceBeforeColon, ": ", printedValue];
|
|
@@ -312919,7 +313078,7 @@ ${text2}`;
|
|
|
312919
313078
|
dedentToRoot,
|
|
312920
313079
|
fill,
|
|
312921
313080
|
hardline,
|
|
312922
|
-
join:
|
|
313081
|
+
join: join50,
|
|
312923
313082
|
line,
|
|
312924
313083
|
literalline,
|
|
312925
313084
|
markAsRoot
|
|
@@ -312962,7 +313121,7 @@ ${text2}`;
|
|
|
312962
313121
|
if (index === 0) {
|
|
312963
313122
|
contentsParts.push(hardline);
|
|
312964
313123
|
}
|
|
312965
|
-
contentsParts.push(fill(getDocParts(
|
|
313124
|
+
contentsParts.push(fill(getDocParts(join50(line, lineWords))));
|
|
312966
313125
|
if (index !== lineContents.length - 1) {
|
|
312967
313126
|
contentsParts.push(lineWords.length === 0 ? hardline : markAsRoot(literalline));
|
|
312968
313127
|
} else if (node.chomping === "keep" && isLastDescendant) {
|
|
@@ -312988,7 +313147,7 @@ ${text2}`;
|
|
|
312988
313147
|
fill,
|
|
312989
313148
|
group: group2,
|
|
312990
313149
|
hardline,
|
|
312991
|
-
join:
|
|
313150
|
+
join: join50,
|
|
312992
313151
|
line,
|
|
312993
313152
|
lineSuffix,
|
|
312994
313153
|
literalline
|
|
@@ -313037,7 +313196,7 @@ ${text2}`;
|
|
|
313037
313196
|
const node = path68.getValue();
|
|
313038
313197
|
const parts = [];
|
|
313039
313198
|
if (node.type !== "mappingValue" && hasLeadingComments(node)) {
|
|
313040
|
-
parts.push([
|
|
313199
|
+
parts.push([join50(hardline, path68.map(print, "leadingComments")), hardline]);
|
|
313041
313200
|
}
|
|
313042
313201
|
const {
|
|
313043
313202
|
tag: tag2,
|
|
@@ -313064,7 +313223,7 @@ ${text2}`;
|
|
|
313064
313223
|
}
|
|
313065
313224
|
}
|
|
313066
313225
|
if (hasMiddleComments(node)) {
|
|
313067
|
-
parts.push([node.middleComments.length === 1 ? "" : hardline,
|
|
313226
|
+
parts.push([node.middleComments.length === 1 ? "" : hardline, join50(hardline, path68.map(print, "middleComments")), hardline]);
|
|
313068
313227
|
}
|
|
313069
313228
|
const parentNode = path68.getParentNode();
|
|
313070
313229
|
if (hasPrettierIgnore(path68)) {
|
|
@@ -313076,7 +313235,7 @@ ${text2}`;
|
|
|
313076
313235
|
parts.push(lineSuffix([node.type === "mappingValue" && !node.content ? "" : " ", parentNode.type === "mappingKey" && path68.getParentNode(2).type === "mapping" && isInlineNode(node) ? "" : breakParent, print("trailingComment")]));
|
|
313077
313236
|
}
|
|
313078
313237
|
if (shouldPrintEndComments(node)) {
|
|
313079
|
-
parts.push(alignWithSpaces(node.type === "sequenceItem" ? 2 : 0, [hardline,
|
|
313238
|
+
parts.push(alignWithSpaces(node.type === "sequenceItem" ? 2 : 0, [hardline, join50(hardline, path68.map((path210) => [isPreviousLineEmpty(options3.originalText, path210.getValue(), locStart) ? hardline : "", print()], "endComments"))]));
|
|
313080
313239
|
}
|
|
313081
313240
|
parts.push(nextEmptyLine);
|
|
313082
313241
|
return parts;
|
|
@@ -313126,10 +313285,10 @@ ${text2}`;
|
|
|
313126
313285
|
if (shouldPrintDocumentBody(node)) {
|
|
313127
313286
|
parts.push(print("body"));
|
|
313128
313287
|
}
|
|
313129
|
-
return
|
|
313288
|
+
return join50(hardline, parts);
|
|
313130
313289
|
}
|
|
313131
313290
|
case "documentHead":
|
|
313132
|
-
return
|
|
313291
|
+
return join50(hardline, [...path68.map(print, "children"), ...path68.map(print, "endComments")]);
|
|
313133
313292
|
case "documentBody": {
|
|
313134
313293
|
const {
|
|
313135
313294
|
children,
|
|
@@ -313146,10 +313305,10 @@ ${text2}`;
|
|
|
313146
313305
|
separator = hardline;
|
|
313147
313306
|
}
|
|
313148
313307
|
}
|
|
313149
|
-
return [
|
|
313308
|
+
return [join50(hardline, path68.map(print, "children")), separator, join50(hardline, path68.map(print, "endComments"))];
|
|
313150
313309
|
}
|
|
313151
313310
|
case "directive":
|
|
313152
|
-
return ["%",
|
|
313311
|
+
return ["%", join50(" ", [node.name, ...node.parameters])];
|
|
313153
313312
|
case "comment":
|
|
313154
313313
|
return ["#", node.value];
|
|
313155
313314
|
case "alias":
|
|
@@ -313184,7 +313343,7 @@ ${text2}`;
|
|
|
313184
313343
|
}
|
|
313185
313344
|
case "mapping":
|
|
313186
313345
|
case "sequence":
|
|
313187
|
-
return
|
|
313346
|
+
return join50(hardline, path68.map(print, "children"));
|
|
313188
313347
|
case "sequenceItem":
|
|
313189
313348
|
return ["- ", alignWithSpaces(2, node.content ? print("content") : "")];
|
|
313190
313349
|
case "mappingKey":
|
|
@@ -313221,7 +313380,7 @@ ${text2}`;
|
|
|
313221
313380
|
}
|
|
313222
313381
|
function printFlowScalarContent(nodeType, content, options3) {
|
|
313223
313382
|
const lineContents = getFlowScalarLineContents(nodeType, content, options3);
|
|
313224
|
-
return
|
|
313383
|
+
return join50(hardline, lineContents.map((lineContentWords) => fill(getDocParts(join50(line, lineContentWords)))));
|
|
313225
313384
|
}
|
|
313226
313385
|
function clean(node, newNode) {
|
|
313227
313386
|
if (isNode5(newNode)) {
|
|
@@ -333357,7 +333516,7 @@ var require_BufferList = __commonJS({
|
|
|
333357
333516
|
this.head = this.tail = null;
|
|
333358
333517
|
this.length = 0;
|
|
333359
333518
|
};
|
|
333360
|
-
BufferList.prototype.join = function
|
|
333519
|
+
BufferList.prototype.join = function join50(s) {
|
|
333361
333520
|
if (this.length === 0) return "";
|
|
333362
333521
|
var p = this.head;
|
|
333363
333522
|
var ret2 = "" + p.data;
|
|
@@ -389974,7 +390133,7 @@ var init_pdf = __esm({
|
|
|
389974
390133
|
var defineProperty = Object.defineProperty;
|
|
389975
390134
|
var stringSlice = uncurryThis("".slice);
|
|
389976
390135
|
var replace = uncurryThis("".replace);
|
|
389977
|
-
var
|
|
390136
|
+
var join50 = uncurryThis([].join);
|
|
389978
390137
|
var CONFIGURABLE_LENGTH = DESCRIPTORS && !fails(function() {
|
|
389979
390138
|
return defineProperty(function() {
|
|
389980
390139
|
}, "length", { value: 8 }).length !== 8;
|
|
@@ -390001,7 +390160,7 @@ var init_pdf = __esm({
|
|
|
390001
390160
|
}
|
|
390002
390161
|
var state = enforceInternalState(value);
|
|
390003
390162
|
if (!hasOwn2(state, "source")) {
|
|
390004
|
-
state.source =
|
|
390163
|
+
state.source = join50(TEMPLATE, typeof name == "string" ? name : "");
|
|
390005
390164
|
}
|
|
390006
390165
|
return value;
|
|
390007
390166
|
};
|
|
@@ -421462,7 +421621,7 @@ __export(filesystem_exports, {
|
|
|
421462
421621
|
});
|
|
421463
421622
|
import { promises as fs23 } from "fs";
|
|
421464
421623
|
import * as path23 from "path";
|
|
421465
|
-
var resolve5, dirname5, isAbsolute5,
|
|
421624
|
+
var resolve5, dirname5, isAbsolute5, extname4, FilesystemMCPService, filesystemService, mcpTools;
|
|
421466
421625
|
var init_filesystem = __esm({
|
|
421467
421626
|
"dist/mcp/filesystem.js"() {
|
|
421468
421627
|
"use strict";
|
|
@@ -421478,7 +421637,7 @@ var init_filesystem = __esm({
|
|
|
421478
421637
|
init_read_tools_utils();
|
|
421479
421638
|
init_notebookManager();
|
|
421480
421639
|
init_encoding_utils();
|
|
421481
|
-
({ resolve: resolve5, dirname: dirname5, isAbsolute: isAbsolute5, extname:
|
|
421640
|
+
({ resolve: resolve5, dirname: dirname5, isAbsolute: isAbsolute5, extname: extname4 } = path23);
|
|
421482
421641
|
FilesystemMCPService = class {
|
|
421483
421642
|
constructor(basePath = process.cwd()) {
|
|
421484
421643
|
Object.defineProperty(this, "basePath", {
|
|
@@ -421601,7 +421760,7 @@ var init_filesystem = __esm({
|
|
|
421601
421760
|
* @returns True if the file is an image
|
|
421602
421761
|
*/
|
|
421603
421762
|
isImageFile(filePath) {
|
|
421604
|
-
const ext =
|
|
421763
|
+
const ext = extname4(filePath).toLowerCase();
|
|
421605
421764
|
return ext in IMAGE_MIME_TYPES;
|
|
421606
421765
|
}
|
|
421607
421766
|
/**
|
|
@@ -421610,7 +421769,7 @@ var init_filesystem = __esm({
|
|
|
421610
421769
|
* @returns True if the file is an Office document
|
|
421611
421770
|
*/
|
|
421612
421771
|
isOfficeFile(filePath) {
|
|
421613
|
-
const ext =
|
|
421772
|
+
const ext = extname4(filePath).toLowerCase();
|
|
421614
421773
|
return ext in OFFICE_FILE_TYPES;
|
|
421615
421774
|
}
|
|
421616
421775
|
/**
|
|
@@ -421619,7 +421778,7 @@ var init_filesystem = __esm({
|
|
|
421619
421778
|
* @returns MIME type or undefined if not an image
|
|
421620
421779
|
*/
|
|
421621
421780
|
getImageMimeType(filePath) {
|
|
421622
|
-
const ext =
|
|
421781
|
+
const ext = extname4(filePath).toLowerCase();
|
|
421623
421782
|
return IMAGE_MIME_TYPES[ext];
|
|
421624
421783
|
}
|
|
421625
421784
|
/**
|
|
@@ -421634,7 +421793,7 @@ var init_filesystem = __esm({
|
|
|
421634
421793
|
if (!mimeType) {
|
|
421635
421794
|
return null;
|
|
421636
421795
|
}
|
|
421637
|
-
const ext =
|
|
421796
|
+
const ext = extname4(fullPath).toLowerCase();
|
|
421638
421797
|
if (ext === ".svg") {
|
|
421639
421798
|
try {
|
|
421640
421799
|
const sharp = (await import("sharp")).default;
|
|
@@ -475954,7 +476113,7 @@ var require_util15 = __commonJS({
|
|
|
475954
476113
|
return path68;
|
|
475955
476114
|
}
|
|
475956
476115
|
exports2.normalize = normalize3;
|
|
475957
|
-
function
|
|
476116
|
+
function join50(aRoot, aPath) {
|
|
475958
476117
|
if (aRoot === "") {
|
|
475959
476118
|
aRoot = ".";
|
|
475960
476119
|
}
|
|
@@ -475986,7 +476145,7 @@ var require_util15 = __commonJS({
|
|
|
475986
476145
|
}
|
|
475987
476146
|
return joined;
|
|
475988
476147
|
}
|
|
475989
|
-
exports2.join =
|
|
476148
|
+
exports2.join = join50;
|
|
475990
476149
|
exports2.isAbsolute = function(aPath) {
|
|
475991
476150
|
return aPath.charAt(0) === "/" || urlRegexp.test(aPath);
|
|
475992
476151
|
};
|
|
@@ -476159,7 +476318,7 @@ var require_util15 = __commonJS({
|
|
|
476159
476318
|
parsed.path = parsed.path.substring(0, index + 1);
|
|
476160
476319
|
}
|
|
476161
476320
|
}
|
|
476162
|
-
sourceURL =
|
|
476321
|
+
sourceURL = join50(urlGenerate(parsed), sourceURL);
|
|
476163
476322
|
}
|
|
476164
476323
|
return normalize3(sourceURL);
|
|
476165
476324
|
}
|
|
@@ -477961,7 +478120,7 @@ var require_escodegen = __commonJS({
|
|
|
477961
478120
|
function noEmptySpace() {
|
|
477962
478121
|
return space ? space : " ";
|
|
477963
478122
|
}
|
|
477964
|
-
function
|
|
478123
|
+
function join50(left, right) {
|
|
477965
478124
|
var leftSource, rightSource, leftCharCode, rightCharCode;
|
|
477966
478125
|
leftSource = toSourceNodeWhenNeeded(left).toString();
|
|
477967
478126
|
if (leftSource.length === 0) {
|
|
@@ -478292,8 +478451,8 @@ var require_escodegen = __commonJS({
|
|
|
478292
478451
|
} else {
|
|
478293
478452
|
result2.push(that.generateExpression(stmt.left, Precedence.Call, E_TTT));
|
|
478294
478453
|
}
|
|
478295
|
-
result2 =
|
|
478296
|
-
result2 = [
|
|
478454
|
+
result2 = join50(result2, operator);
|
|
478455
|
+
result2 = [join50(
|
|
478297
478456
|
result2,
|
|
478298
478457
|
that.generateExpression(stmt.right, Precedence.Assignment, E_TTT)
|
|
478299
478458
|
), ")"];
|
|
@@ -478436,11 +478595,11 @@ var require_escodegen = __commonJS({
|
|
|
478436
478595
|
var result2, fragment;
|
|
478437
478596
|
result2 = ["class"];
|
|
478438
478597
|
if (stmt.id) {
|
|
478439
|
-
result2 =
|
|
478598
|
+
result2 = join50(result2, this.generateExpression(stmt.id, Precedence.Sequence, E_TTT));
|
|
478440
478599
|
}
|
|
478441
478600
|
if (stmt.superClass) {
|
|
478442
|
-
fragment =
|
|
478443
|
-
result2 =
|
|
478601
|
+
fragment = join50("extends", this.generateExpression(stmt.superClass, Precedence.Unary, E_TTT));
|
|
478602
|
+
result2 = join50(result2, fragment);
|
|
478444
478603
|
}
|
|
478445
478604
|
result2.push(space);
|
|
478446
478605
|
result2.push(this.generateStatement(stmt.body, S_TFFT));
|
|
@@ -478453,9 +478612,9 @@ var require_escodegen = __commonJS({
|
|
|
478453
478612
|
return escapeDirective(stmt.directive) + this.semicolon(flags);
|
|
478454
478613
|
},
|
|
478455
478614
|
DoWhileStatement: function(stmt, flags) {
|
|
478456
|
-
var result2 =
|
|
478615
|
+
var result2 = join50("do", this.maybeBlock(stmt.body, S_TFFF));
|
|
478457
478616
|
result2 = this.maybeBlockSuffix(stmt.body, result2);
|
|
478458
|
-
return
|
|
478617
|
+
return join50(result2, [
|
|
478459
478618
|
"while" + space + "(",
|
|
478460
478619
|
this.generateExpression(stmt.test, Precedence.Sequence, E_TTT),
|
|
478461
478620
|
")" + this.semicolon(flags)
|
|
@@ -478491,11 +478650,11 @@ var require_escodegen = __commonJS({
|
|
|
478491
478650
|
ExportDefaultDeclaration: function(stmt, flags) {
|
|
478492
478651
|
var result2 = ["export"], bodyFlags;
|
|
478493
478652
|
bodyFlags = flags & F_SEMICOLON_OPT ? S_TFFT : S_TFFF;
|
|
478494
|
-
result2 =
|
|
478653
|
+
result2 = join50(result2, "default");
|
|
478495
478654
|
if (isStatement(stmt.declaration)) {
|
|
478496
|
-
result2 =
|
|
478655
|
+
result2 = join50(result2, this.generateStatement(stmt.declaration, bodyFlags));
|
|
478497
478656
|
} else {
|
|
478498
|
-
result2 =
|
|
478657
|
+
result2 = join50(result2, this.generateExpression(stmt.declaration, Precedence.Assignment, E_TTT) + this.semicolon(flags));
|
|
478499
478658
|
}
|
|
478500
478659
|
return result2;
|
|
478501
478660
|
},
|
|
@@ -478503,15 +478662,15 @@ var require_escodegen = __commonJS({
|
|
|
478503
478662
|
var result2 = ["export"], bodyFlags, that = this;
|
|
478504
478663
|
bodyFlags = flags & F_SEMICOLON_OPT ? S_TFFT : S_TFFF;
|
|
478505
478664
|
if (stmt.declaration) {
|
|
478506
|
-
return
|
|
478665
|
+
return join50(result2, this.generateStatement(stmt.declaration, bodyFlags));
|
|
478507
478666
|
}
|
|
478508
478667
|
if (stmt.specifiers) {
|
|
478509
478668
|
if (stmt.specifiers.length === 0) {
|
|
478510
|
-
result2 =
|
|
478669
|
+
result2 = join50(result2, "{" + space + "}");
|
|
478511
478670
|
} else if (stmt.specifiers[0].type === Syntax.ExportBatchSpecifier) {
|
|
478512
|
-
result2 =
|
|
478671
|
+
result2 = join50(result2, this.generateExpression(stmt.specifiers[0], Precedence.Sequence, E_TTT));
|
|
478513
478672
|
} else {
|
|
478514
|
-
result2 =
|
|
478673
|
+
result2 = join50(result2, "{");
|
|
478515
478674
|
withIndent(function(indent2) {
|
|
478516
478675
|
var i, iz;
|
|
478517
478676
|
result2.push(newline2);
|
|
@@ -478529,7 +478688,7 @@ var require_escodegen = __commonJS({
|
|
|
478529
478688
|
result2.push(base + "}");
|
|
478530
478689
|
}
|
|
478531
478690
|
if (stmt.source) {
|
|
478532
|
-
result2 =
|
|
478691
|
+
result2 = join50(result2, [
|
|
478533
478692
|
"from" + space,
|
|
478534
478693
|
// ModuleSpecifier
|
|
478535
478694
|
this.generateExpression(stmt.source, Precedence.Sequence, E_TTT),
|
|
@@ -478617,7 +478776,7 @@ var require_escodegen = __commonJS({
|
|
|
478617
478776
|
];
|
|
478618
478777
|
cursor4 = 0;
|
|
478619
478778
|
if (stmt.specifiers[cursor4].type === Syntax.ImportDefaultSpecifier) {
|
|
478620
|
-
result2 =
|
|
478779
|
+
result2 = join50(result2, [
|
|
478621
478780
|
this.generateExpression(stmt.specifiers[cursor4], Precedence.Sequence, E_TTT)
|
|
478622
478781
|
]);
|
|
478623
478782
|
++cursor4;
|
|
@@ -478627,7 +478786,7 @@ var require_escodegen = __commonJS({
|
|
|
478627
478786
|
result2.push(",");
|
|
478628
478787
|
}
|
|
478629
478788
|
if (stmt.specifiers[cursor4].type === Syntax.ImportNamespaceSpecifier) {
|
|
478630
|
-
result2 =
|
|
478789
|
+
result2 = join50(result2, [
|
|
478631
478790
|
space,
|
|
478632
478791
|
this.generateExpression(stmt.specifiers[cursor4], Precedence.Sequence, E_TTT)
|
|
478633
478792
|
]);
|
|
@@ -478656,7 +478815,7 @@ var require_escodegen = __commonJS({
|
|
|
478656
478815
|
}
|
|
478657
478816
|
}
|
|
478658
478817
|
}
|
|
478659
|
-
result2 =
|
|
478818
|
+
result2 = join50(result2, [
|
|
478660
478819
|
"from" + space,
|
|
478661
478820
|
// ModuleSpecifier
|
|
478662
478821
|
this.generateExpression(stmt.source, Precedence.Sequence, E_TTT),
|
|
@@ -478710,7 +478869,7 @@ var require_escodegen = __commonJS({
|
|
|
478710
478869
|
return result2;
|
|
478711
478870
|
},
|
|
478712
478871
|
ThrowStatement: function(stmt, flags) {
|
|
478713
|
-
return [
|
|
478872
|
+
return [join50(
|
|
478714
478873
|
"throw",
|
|
478715
478874
|
this.generateExpression(stmt.argument, Precedence.Sequence, E_TTT)
|
|
478716
478875
|
), this.semicolon(flags)];
|
|
@@ -478721,7 +478880,7 @@ var require_escodegen = __commonJS({
|
|
|
478721
478880
|
result2 = this.maybeBlockSuffix(stmt.block, result2);
|
|
478722
478881
|
if (stmt.handlers) {
|
|
478723
478882
|
for (i = 0, iz = stmt.handlers.length; i < iz; ++i) {
|
|
478724
|
-
result2 =
|
|
478883
|
+
result2 = join50(result2, this.generateStatement(stmt.handlers[i], S_TFFF));
|
|
478725
478884
|
if (stmt.finalizer || i + 1 !== iz) {
|
|
478726
478885
|
result2 = this.maybeBlockSuffix(stmt.handlers[i].body, result2);
|
|
478727
478886
|
}
|
|
@@ -478729,7 +478888,7 @@ var require_escodegen = __commonJS({
|
|
|
478729
478888
|
} else {
|
|
478730
478889
|
guardedHandlers = stmt.guardedHandlers || [];
|
|
478731
478890
|
for (i = 0, iz = guardedHandlers.length; i < iz; ++i) {
|
|
478732
|
-
result2 =
|
|
478891
|
+
result2 = join50(result2, this.generateStatement(guardedHandlers[i], S_TFFF));
|
|
478733
478892
|
if (stmt.finalizer || i + 1 !== iz) {
|
|
478734
478893
|
result2 = this.maybeBlockSuffix(guardedHandlers[i].body, result2);
|
|
478735
478894
|
}
|
|
@@ -478737,13 +478896,13 @@ var require_escodegen = __commonJS({
|
|
|
478737
478896
|
if (stmt.handler) {
|
|
478738
478897
|
if (Array.isArray(stmt.handler)) {
|
|
478739
478898
|
for (i = 0, iz = stmt.handler.length; i < iz; ++i) {
|
|
478740
|
-
result2 =
|
|
478899
|
+
result2 = join50(result2, this.generateStatement(stmt.handler[i], S_TFFF));
|
|
478741
478900
|
if (stmt.finalizer || i + 1 !== iz) {
|
|
478742
478901
|
result2 = this.maybeBlockSuffix(stmt.handler[i].body, result2);
|
|
478743
478902
|
}
|
|
478744
478903
|
}
|
|
478745
478904
|
} else {
|
|
478746
|
-
result2 =
|
|
478905
|
+
result2 = join50(result2, this.generateStatement(stmt.handler, S_TFFF));
|
|
478747
478906
|
if (stmt.finalizer) {
|
|
478748
478907
|
result2 = this.maybeBlockSuffix(stmt.handler.body, result2);
|
|
478749
478908
|
}
|
|
@@ -478751,7 +478910,7 @@ var require_escodegen = __commonJS({
|
|
|
478751
478910
|
}
|
|
478752
478911
|
}
|
|
478753
478912
|
if (stmt.finalizer) {
|
|
478754
|
-
result2 =
|
|
478913
|
+
result2 = join50(result2, ["finally", this.maybeBlock(stmt.finalizer, S_TFFF)]);
|
|
478755
478914
|
}
|
|
478756
478915
|
return result2;
|
|
478757
478916
|
},
|
|
@@ -478785,7 +478944,7 @@ var require_escodegen = __commonJS({
|
|
|
478785
478944
|
withIndent(function() {
|
|
478786
478945
|
if (stmt.test) {
|
|
478787
478946
|
result2 = [
|
|
478788
|
-
|
|
478947
|
+
join50("case", that.generateExpression(stmt.test, Precedence.Sequence, E_TTT)),
|
|
478789
478948
|
":"
|
|
478790
478949
|
];
|
|
478791
478950
|
} else {
|
|
@@ -478833,9 +478992,9 @@ var require_escodegen = __commonJS({
|
|
|
478833
478992
|
result2.push(this.maybeBlock(stmt.consequent, S_TFFF));
|
|
478834
478993
|
result2 = this.maybeBlockSuffix(stmt.consequent, result2);
|
|
478835
478994
|
if (stmt.alternate.type === Syntax.IfStatement) {
|
|
478836
|
-
result2 =
|
|
478995
|
+
result2 = join50(result2, ["else ", this.generateStatement(stmt.alternate, bodyFlags)]);
|
|
478837
478996
|
} else {
|
|
478838
|
-
result2 =
|
|
478997
|
+
result2 = join50(result2, join50("else", this.maybeBlock(stmt.alternate, bodyFlags)));
|
|
478839
478998
|
}
|
|
478840
478999
|
} else {
|
|
478841
479000
|
result2.push(this.maybeBlock(stmt.consequent, bodyFlags));
|
|
@@ -478936,7 +479095,7 @@ var require_escodegen = __commonJS({
|
|
|
478936
479095
|
},
|
|
478937
479096
|
ReturnStatement: function(stmt, flags) {
|
|
478938
479097
|
if (stmt.argument) {
|
|
478939
|
-
return [
|
|
479098
|
+
return [join50(
|
|
478940
479099
|
"return",
|
|
478941
479100
|
this.generateExpression(stmt.argument, Precedence.Sequence, E_TTT)
|
|
478942
479101
|
), this.semicolon(flags)];
|
|
@@ -479025,14 +479184,14 @@ var require_escodegen = __commonJS({
|
|
|
479025
479184
|
if (leftSource.charCodeAt(leftSource.length - 1) === 47 && esutils.code.isIdentifierPartES5(expr.operator.charCodeAt(0))) {
|
|
479026
479185
|
result2 = [fragment, noEmptySpace(), expr.operator];
|
|
479027
479186
|
} else {
|
|
479028
|
-
result2 =
|
|
479187
|
+
result2 = join50(fragment, expr.operator);
|
|
479029
479188
|
}
|
|
479030
479189
|
fragment = this.generateExpression(expr.right, rightPrecedence, flags);
|
|
479031
479190
|
if (expr.operator === "/" && fragment.toString().charAt(0) === "/" || expr.operator.slice(-1) === "<" && fragment.toString().slice(0, 3) === "!--") {
|
|
479032
479191
|
result2.push(noEmptySpace());
|
|
479033
479192
|
result2.push(fragment);
|
|
479034
479193
|
} else {
|
|
479035
|
-
result2 =
|
|
479194
|
+
result2 = join50(result2, fragment);
|
|
479036
479195
|
}
|
|
479037
479196
|
if (expr.operator === "in" && !(flags & F_ALLOW_IN)) {
|
|
479038
479197
|
return ["(", result2, ")"];
|
|
@@ -479072,7 +479231,7 @@ var require_escodegen = __commonJS({
|
|
|
479072
479231
|
var result2, length, i, iz, itemFlags;
|
|
479073
479232
|
length = expr["arguments"].length;
|
|
479074
479233
|
itemFlags = flags & F_ALLOW_UNPARATH_NEW && !parentheses && length === 0 ? E_TFT : E_TFF;
|
|
479075
|
-
result2 =
|
|
479234
|
+
result2 = join50(
|
|
479076
479235
|
"new",
|
|
479077
479236
|
this.generateExpression(expr.callee, Precedence.New, itemFlags)
|
|
479078
479237
|
);
|
|
@@ -479122,11 +479281,11 @@ var require_escodegen = __commonJS({
|
|
|
479122
479281
|
var result2, fragment, rightCharCode, leftSource, leftCharCode;
|
|
479123
479282
|
fragment = this.generateExpression(expr.argument, Precedence.Unary, E_TTT);
|
|
479124
479283
|
if (space === "") {
|
|
479125
|
-
result2 =
|
|
479284
|
+
result2 = join50(expr.operator, fragment);
|
|
479126
479285
|
} else {
|
|
479127
479286
|
result2 = [expr.operator];
|
|
479128
479287
|
if (expr.operator.length > 2) {
|
|
479129
|
-
result2 =
|
|
479288
|
+
result2 = join50(result2, fragment);
|
|
479130
479289
|
} else {
|
|
479131
479290
|
leftSource = toSourceNodeWhenNeeded(result2).toString();
|
|
479132
479291
|
leftCharCode = leftSource.charCodeAt(leftSource.length - 1);
|
|
@@ -479149,7 +479308,7 @@ var require_escodegen = __commonJS({
|
|
|
479149
479308
|
result2 = "yield";
|
|
479150
479309
|
}
|
|
479151
479310
|
if (expr.argument) {
|
|
479152
|
-
result2 =
|
|
479311
|
+
result2 = join50(
|
|
479153
479312
|
result2,
|
|
479154
479313
|
this.generateExpression(expr.argument, Precedence.Yield, E_TTT)
|
|
479155
479314
|
);
|
|
@@ -479157,7 +479316,7 @@ var require_escodegen = __commonJS({
|
|
|
479157
479316
|
return parenthesize(result2, Precedence.Yield, precedence);
|
|
479158
479317
|
},
|
|
479159
479318
|
AwaitExpression: function(expr, precedence, flags) {
|
|
479160
|
-
var result2 =
|
|
479319
|
+
var result2 = join50(
|
|
479161
479320
|
expr.all ? "await*" : "await",
|
|
479162
479321
|
this.generateExpression(expr.argument, Precedence.Await, E_TTT)
|
|
479163
479322
|
);
|
|
@@ -479240,11 +479399,11 @@ var require_escodegen = __commonJS({
|
|
|
479240
479399
|
var result2, fragment;
|
|
479241
479400
|
result2 = ["class"];
|
|
479242
479401
|
if (expr.id) {
|
|
479243
|
-
result2 =
|
|
479402
|
+
result2 = join50(result2, this.generateExpression(expr.id, Precedence.Sequence, E_TTT));
|
|
479244
479403
|
}
|
|
479245
479404
|
if (expr.superClass) {
|
|
479246
|
-
fragment =
|
|
479247
|
-
result2 =
|
|
479405
|
+
fragment = join50("extends", this.generateExpression(expr.superClass, Precedence.Unary, E_TTT));
|
|
479406
|
+
result2 = join50(result2, fragment);
|
|
479248
479407
|
}
|
|
479249
479408
|
result2.push(space);
|
|
479250
479409
|
result2.push(this.generateStatement(expr.body, S_TFFT));
|
|
@@ -479259,7 +479418,7 @@ var require_escodegen = __commonJS({
|
|
|
479259
479418
|
}
|
|
479260
479419
|
if (expr.kind === "get" || expr.kind === "set") {
|
|
479261
479420
|
fragment = [
|
|
479262
|
-
|
|
479421
|
+
join50(expr.kind, this.generatePropertyKey(expr.key, expr.computed)),
|
|
479263
479422
|
this.generateFunctionBody(expr.value)
|
|
479264
479423
|
];
|
|
479265
479424
|
} else {
|
|
@@ -479269,7 +479428,7 @@ var require_escodegen = __commonJS({
|
|
|
479269
479428
|
this.generateFunctionBody(expr.value)
|
|
479270
479429
|
];
|
|
479271
479430
|
}
|
|
479272
|
-
return
|
|
479431
|
+
return join50(result2, fragment);
|
|
479273
479432
|
},
|
|
479274
479433
|
Property: function(expr, precedence, flags) {
|
|
479275
479434
|
if (expr.kind === "get" || expr.kind === "set") {
|
|
@@ -479464,7 +479623,7 @@ var require_escodegen = __commonJS({
|
|
|
479464
479623
|
for (i = 0, iz = expr.blocks.length; i < iz; ++i) {
|
|
479465
479624
|
fragment = that.generateExpression(expr.blocks[i], Precedence.Sequence, E_TTT);
|
|
479466
479625
|
if (i > 0 || extra.moz.comprehensionExpressionStartsWithAssignment) {
|
|
479467
|
-
result2 =
|
|
479626
|
+
result2 = join50(result2, fragment);
|
|
479468
479627
|
} else {
|
|
479469
479628
|
result2.push(fragment);
|
|
479470
479629
|
}
|
|
@@ -479472,13 +479631,13 @@ var require_escodegen = __commonJS({
|
|
|
479472
479631
|
});
|
|
479473
479632
|
}
|
|
479474
479633
|
if (expr.filter) {
|
|
479475
|
-
result2 =
|
|
479634
|
+
result2 = join50(result2, "if" + space);
|
|
479476
479635
|
fragment = this.generateExpression(expr.filter, Precedence.Sequence, E_TTT);
|
|
479477
|
-
result2 =
|
|
479636
|
+
result2 = join50(result2, ["(", fragment, ")"]);
|
|
479478
479637
|
}
|
|
479479
479638
|
if (!extra.moz.comprehensionExpressionStartsWithAssignment) {
|
|
479480
479639
|
fragment = this.generateExpression(expr.body, Precedence.Assignment, E_TTT);
|
|
479481
|
-
result2 =
|
|
479640
|
+
result2 = join50(result2, fragment);
|
|
479482
479641
|
}
|
|
479483
479642
|
result2.push(expr.type === Syntax.GeneratorExpression ? ")" : "]");
|
|
479484
479643
|
return result2;
|
|
@@ -479494,8 +479653,8 @@ var require_escodegen = __commonJS({
|
|
|
479494
479653
|
} else {
|
|
479495
479654
|
fragment = this.generateExpression(expr.left, Precedence.Call, E_TTT);
|
|
479496
479655
|
}
|
|
479497
|
-
fragment =
|
|
479498
|
-
fragment =
|
|
479656
|
+
fragment = join50(fragment, expr.of ? "of" : "in");
|
|
479657
|
+
fragment = join50(fragment, this.generateExpression(expr.right, Precedence.Sequence, E_TTT));
|
|
479499
479658
|
return ["for" + space + "(", fragment, ")"];
|
|
479500
479659
|
},
|
|
479501
479660
|
SpreadElement: function(expr, precedence, flags) {
|
|
@@ -495324,7 +495483,7 @@ var init_fileUtil = __esm({
|
|
|
495324
495483
|
// node_modules/@puppeteer/browsers/lib/esm/install.js
|
|
495325
495484
|
import assert3 from "node:assert";
|
|
495326
495485
|
import { spawnSync as spawnSync6 } from "node:child_process";
|
|
495327
|
-
import { existsSync as
|
|
495486
|
+
import { existsSync as existsSync12, readFileSync as readFileSync13 } from "node:fs";
|
|
495328
495487
|
import { mkdir as mkdir2, unlink } from "node:fs/promises";
|
|
495329
495488
|
import os16 from "node:os";
|
|
495330
495489
|
import path34 from "node:path";
|
|
@@ -495455,9 +495614,9 @@ var init_PipeTransport = __esm({
|
|
|
495455
495614
|
});
|
|
495456
495615
|
|
|
495457
495616
|
// node_modules/puppeteer-core/lib/esm/puppeteer/node/BrowserLauncher.js
|
|
495458
|
-
import { existsSync as
|
|
495617
|
+
import { existsSync as existsSync13 } from "node:fs";
|
|
495459
495618
|
import { tmpdir as tmpdir2 } from "node:os";
|
|
495460
|
-
import { join as
|
|
495619
|
+
import { join as join15 } from "node:path";
|
|
495461
495620
|
var BrowserLauncher;
|
|
495462
495621
|
var init_BrowserLauncher = __esm({
|
|
495463
495622
|
"node_modules/puppeteer-core/lib/esm/puppeteer/node/BrowserLauncher.js"() {
|
|
@@ -495499,7 +495658,7 @@ var init_BrowserLauncher = __esm({
|
|
|
495499
495658
|
...options3,
|
|
495500
495659
|
protocol
|
|
495501
495660
|
});
|
|
495502
|
-
if (!
|
|
495661
|
+
if (!existsSync13(launchArgs.executablePath)) {
|
|
495503
495662
|
throw new Error(`Browser was not found at the configured executablePath (${launchArgs.executablePath})`);
|
|
495504
495663
|
}
|
|
495505
495664
|
const usePipe = launchArgs.args.includes("--remote-debugging-pipe");
|
|
@@ -495575,7 +495734,7 @@ var init_BrowserLauncher = __esm({
|
|
|
495575
495734
|
if (logs.includes("Failed to create a ProcessSingleton for your profile directory") || // On Windows we will not get logs due to the singleton process
|
|
495576
495735
|
// handover. See
|
|
495577
495736
|
// https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/process_singleton_win.cc;l=46;drc=fc7952f0422b5073515a205a04ec9c3a1ae81658
|
|
495578
|
-
process.platform === "win32" &&
|
|
495737
|
+
process.platform === "win32" && existsSync13(join15(launchArgs.userDataDir, "lockfile"))) {
|
|
495579
495738
|
throw new Error(`The browser is already running for ${launchArgs.userDataDir}. Use a different \`userDataDir\` or stop the running browser first.`);
|
|
495580
495739
|
}
|
|
495581
495740
|
if (logs.includes("Missing X server") && options3.headless === false) {
|
|
@@ -495704,7 +495863,7 @@ var init_BrowserLauncher = __esm({
|
|
|
495704
495863
|
* @internal
|
|
495705
495864
|
*/
|
|
495706
495865
|
getProfilePath() {
|
|
495707
|
-
return
|
|
495866
|
+
return join15(this.puppeteer.configuration.temporaryDirectory ?? tmpdir2(), `puppeteer_dev_${this.browser}_profile-`);
|
|
495708
495867
|
}
|
|
495709
495868
|
/**
|
|
495710
495869
|
* @internal
|
|
@@ -495713,7 +495872,7 @@ var init_BrowserLauncher = __esm({
|
|
|
495713
495872
|
var _a20, _b14;
|
|
495714
495873
|
let executablePath2 = this.puppeteer.configuration.executablePath;
|
|
495715
495874
|
if (executablePath2) {
|
|
495716
|
-
if (validatePath && !
|
|
495875
|
+
if (validatePath && !existsSync13(executablePath2)) {
|
|
495717
495876
|
throw new Error(`Tried to find the browser at the configured path (${executablePath2}), but no executable was found.`);
|
|
495718
495877
|
}
|
|
495719
495878
|
return executablePath2;
|
|
@@ -495736,7 +495895,7 @@ var init_BrowserLauncher = __esm({
|
|
|
495736
495895
|
browser: browserType,
|
|
495737
495896
|
buildId: this.puppeteer.browserVersion
|
|
495738
495897
|
});
|
|
495739
|
-
if (validatePath && !
|
|
495898
|
+
if (validatePath && !existsSync13(executablePath2)) {
|
|
495740
495899
|
const configVersion = (_b14 = (_a20 = this.puppeteer.configuration) == null ? void 0 : _a20[this.browser]) == null ? void 0 : _b14.version;
|
|
495741
495900
|
if (configVersion) {
|
|
495742
495901
|
throw new Error(`Tried to find the browser at the configured path (${executablePath2}) for version ${configVersion}, but no executable was found.`);
|
|
@@ -496762,12 +496921,12 @@ var init_puppeteer_core = __esm({
|
|
|
496762
496921
|
|
|
496763
496922
|
// dist/mcp/utils/websearch/browser.utils.js
|
|
496764
496923
|
import { execSync as execSync3, spawn as spawn7 } from "node:child_process";
|
|
496765
|
-
import { existsSync as
|
|
496924
|
+
import { existsSync as existsSync14, readFileSync as readFileSync14 } from "node:fs";
|
|
496766
496925
|
import { platform as platform2 } from "node:os";
|
|
496767
496926
|
import { request as request3 } from "node:http";
|
|
496768
496927
|
function isWSL() {
|
|
496769
496928
|
try {
|
|
496770
|
-
if (
|
|
496929
|
+
if (existsSync14("/proc/version")) {
|
|
496771
496930
|
const version4 = readFileSync14("/proc/version", "utf8").toLowerCase();
|
|
496772
496931
|
return version4.includes("microsoft") || version4.includes("wsl");
|
|
496773
496932
|
}
|
|
@@ -496786,7 +496945,7 @@ function findWindowsBrowserInWSL() {
|
|
|
496786
496945
|
"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"
|
|
496787
496946
|
];
|
|
496788
496947
|
for (const path68 of windowsPaths) {
|
|
496789
|
-
if (
|
|
496948
|
+
if (existsSync14(path68)) {
|
|
496790
496949
|
return path68;
|
|
496791
496950
|
}
|
|
496792
496951
|
}
|
|
@@ -496890,7 +497049,7 @@ function findBrowserExecutable() {
|
|
|
496890
497049
|
}
|
|
496891
497050
|
}
|
|
496892
497051
|
for (const path68 of paths) {
|
|
496893
|
-
if (path68 &&
|
|
497052
|
+
if (path68 && existsSync14(path68)) {
|
|
496894
497053
|
return path68;
|
|
496895
497054
|
}
|
|
496896
497055
|
}
|
|
@@ -497101,9 +497260,9 @@ var init_bing_engine = __esm({
|
|
|
497101
497260
|
});
|
|
497102
497261
|
|
|
497103
497262
|
// dist/mcp/engines/websearch/index.js
|
|
497104
|
-
import { existsSync as
|
|
497105
|
-
import { extname as
|
|
497106
|
-
import { pathToFileURL } from "node:url";
|
|
497263
|
+
import { existsSync as existsSync15, readdirSync as readdirSync4 } from "node:fs";
|
|
497264
|
+
import { extname as extname6, join as join16 } from "node:path";
|
|
497265
|
+
import { pathToFileURL as pathToFileURL2 } from "node:url";
|
|
497107
497266
|
function isSearchEngine(candidate) {
|
|
497108
497267
|
if (typeof candidate !== "object" || candidate === null)
|
|
497109
497268
|
return false;
|
|
@@ -497113,7 +497272,7 @@ function isSearchEngine(candidate) {
|
|
|
497113
497272
|
function isEngineEnabled(engine) {
|
|
497114
497273
|
return engine.enable !== false;
|
|
497115
497274
|
}
|
|
497116
|
-
function
|
|
497275
|
+
function collectFromModule2(mod) {
|
|
497117
497276
|
const candidates = [];
|
|
497118
497277
|
const pushOne = (val) => {
|
|
497119
497278
|
if (Array.isArray(val))
|
|
@@ -497127,22 +497286,22 @@ function collectFromModule(mod) {
|
|
|
497127
497286
|
return candidates.filter(isSearchEngine);
|
|
497128
497287
|
}
|
|
497129
497288
|
async function loadExternalEngines() {
|
|
497130
|
-
if (!
|
|
497289
|
+
if (!existsSync15(SEARCH_ENGINES_DIR))
|
|
497131
497290
|
return;
|
|
497132
497291
|
let entries;
|
|
497133
497292
|
try {
|
|
497134
|
-
entries =
|
|
497293
|
+
entries = readdirSync4(SEARCH_ENGINES_DIR, { withFileTypes: true });
|
|
497135
497294
|
} catch (error42) {
|
|
497136
497295
|
console.warn("[websearch] failed to read plugin dir", error42);
|
|
497137
497296
|
return;
|
|
497138
497297
|
}
|
|
497139
|
-
const files = entries.filter((e) => e.isFile() && SUPPORTED_SEARCH_ENGINE_EXTENSIONS.has(
|
|
497298
|
+
const files = entries.filter((e) => e.isFile() && SUPPORTED_SEARCH_ENGINE_EXTENSIONS.has(extname6(e.name).toLowerCase())).sort((a, b) => a.name.localeCompare(b.name));
|
|
497140
497299
|
for (const file2 of files) {
|
|
497141
|
-
const modulePath =
|
|
497300
|
+
const modulePath = join16(SEARCH_ENGINES_DIR, file2.name);
|
|
497142
497301
|
try {
|
|
497143
|
-
const moduleUrl =
|
|
497302
|
+
const moduleUrl = pathToFileURL2(modulePath).href;
|
|
497144
497303
|
const mod = await import(moduleUrl);
|
|
497145
|
-
const engines2 =
|
|
497304
|
+
const engines2 = collectFromModule2(mod);
|
|
497146
497305
|
if (engines2.length === 0) {
|
|
497147
497306
|
console.warn(`[websearch] plugin "${file2.name}" did not export a valid SearchEngine`);
|
|
497148
497307
|
continue;
|
|
@@ -497160,14 +497319,14 @@ async function loadExternalEngines() {
|
|
|
497160
497319
|
}
|
|
497161
497320
|
}
|
|
497162
497321
|
function ensureSearchEnginesLoaded() {
|
|
497163
|
-
if (
|
|
497322
|
+
if (externalLoaded2)
|
|
497164
497323
|
return Promise.resolve();
|
|
497165
|
-
if (
|
|
497166
|
-
return
|
|
497167
|
-
|
|
497168
|
-
|
|
497324
|
+
if (externalLoadPromise2)
|
|
497325
|
+
return externalLoadPromise2;
|
|
497326
|
+
externalLoadPromise2 = loadExternalEngines().then(() => {
|
|
497327
|
+
externalLoaded2 = true;
|
|
497169
497328
|
});
|
|
497170
|
-
return
|
|
497329
|
+
return externalLoadPromise2;
|
|
497171
497330
|
}
|
|
497172
497331
|
function getSearchEngine(id) {
|
|
497173
497332
|
if (id && ENGINES.has(id)) {
|
|
@@ -497182,7 +497341,7 @@ async function listSearchEnginesAsync() {
|
|
|
497182
497341
|
await ensureSearchEnginesLoaded();
|
|
497183
497342
|
return listSearchEngines();
|
|
497184
497343
|
}
|
|
497185
|
-
var DEFAULT_SEARCH_ENGINE, SUPPORTED_SEARCH_ENGINE_EXTENSIONS, BUILT_IN_ENGINES, ENGINES,
|
|
497344
|
+
var DEFAULT_SEARCH_ENGINE, SUPPORTED_SEARCH_ENGINE_EXTENSIONS, BUILT_IN_ENGINES, ENGINES, externalLoadPromise2, externalLoaded2;
|
|
497186
497345
|
var init_websearch = __esm({
|
|
497187
497346
|
"dist/mcp/engines/websearch/index.js"() {
|
|
497188
497347
|
"use strict";
|
|
@@ -497196,8 +497355,8 @@ var init_websearch = __esm({
|
|
|
497196
497355
|
new BingEngine()
|
|
497197
497356
|
];
|
|
497198
497357
|
ENGINES = new Map(BUILT_IN_ENGINES.filter(isEngineEnabled).map((e) => [e.id, e]));
|
|
497199
|
-
|
|
497200
|
-
|
|
497358
|
+
externalLoadPromise2 = null;
|
|
497359
|
+
externalLoaded2 = false;
|
|
497201
497360
|
}
|
|
497202
497361
|
});
|
|
497203
497362
|
|
|
@@ -497954,9 +498113,9 @@ __export(websearch_exports, {
|
|
|
497954
498113
|
mcpTools: () => mcpTools4,
|
|
497955
498114
|
webSearchService: () => webSearchService
|
|
497956
498115
|
});
|
|
497957
|
-
import { existsSync as
|
|
498116
|
+
import { existsSync as existsSync16 } from "node:fs";
|
|
497958
498117
|
import { tmpdir as tmpdir3 } from "node:os";
|
|
497959
|
-
import { extname as
|
|
498118
|
+
import { extname as extname7, join as join17 } from "node:path";
|
|
497960
498119
|
var WebSearchService, webSearchService, mcpTools4;
|
|
497961
498120
|
var init_websearch2 = __esm({
|
|
497962
498121
|
"dist/mcp/websearch.js"() {
|
|
@@ -498015,7 +498174,7 @@ var init_websearch2 = __esm({
|
|
|
498015
498174
|
this.maxResults = maxResults;
|
|
498016
498175
|
this.isWSLMode = isWSL();
|
|
498017
498176
|
if (process.platform === "win32" && !this.isWSLMode) {
|
|
498018
|
-
this.userDataDir =
|
|
498177
|
+
this.userDataDir = join17(tmpdir3(), `snow-cli-puppeteer-profile-${process.pid}`);
|
|
498019
498178
|
}
|
|
498020
498179
|
}
|
|
498021
498180
|
/**
|
|
@@ -498052,7 +498211,7 @@ var init_websearch2 = __esm({
|
|
|
498052
498211
|
let wsEndpoint = await getRunningBrowserWSEndpoint(debugPort);
|
|
498053
498212
|
if (!wsEndpoint) {
|
|
498054
498213
|
let browserPath = proxyConfig.browserPath;
|
|
498055
|
-
if (!browserPath || !
|
|
498214
|
+
if (!browserPath || !existsSync16(browserPath)) {
|
|
498056
498215
|
browserPath = findWindowsBrowserInWSL();
|
|
498057
498216
|
}
|
|
498058
498217
|
if (!browserPath) {
|
|
@@ -498078,7 +498237,7 @@ var init_websearch2 = __esm({
|
|
|
498078
498237
|
*/
|
|
498079
498238
|
async launchBrowserDirect(proxyConfig) {
|
|
498080
498239
|
if (!this.executablePath) {
|
|
498081
|
-
if (proxyConfig.browserPath &&
|
|
498240
|
+
if (proxyConfig.browserPath && existsSync16(proxyConfig.browserPath)) {
|
|
498082
498241
|
this.executablePath = proxyConfig.browserPath;
|
|
498083
498242
|
} else {
|
|
498084
498243
|
this.executablePath = findBrowserExecutable();
|
|
@@ -498188,7 +498347,7 @@ var init_websearch2 = __esm({
|
|
|
498188
498347
|
getImageMimeTypeFromUrl(url2) {
|
|
498189
498348
|
try {
|
|
498190
498349
|
const pathname = new URL(url2).pathname;
|
|
498191
|
-
const ext =
|
|
498350
|
+
const ext = extname7(pathname).toLowerCase();
|
|
498192
498351
|
return IMAGE_MIME_TYPES[ext];
|
|
498193
498352
|
} catch {
|
|
498194
498353
|
return void 0;
|
|
@@ -505961,7 +506120,7 @@ ${plan}`);
|
|
|
505961
506120
|
|
|
505962
506121
|
// dist/utils/execution/agentChildProcess.js
|
|
505963
506122
|
import { fork } from "node:child_process";
|
|
505964
|
-
import { existsSync as
|
|
506123
|
+
import { existsSync as existsSync18 } from "node:fs";
|
|
505965
506124
|
import { resolve as resolve9 } from "node:path";
|
|
505966
506125
|
function buildChildPayloadWithConversationContext(payload) {
|
|
505967
506126
|
const conversationContext = getConversationContext();
|
|
@@ -505972,11 +506131,11 @@ function buildChildPayloadWithConversationContext(payload) {
|
|
|
505972
506131
|
}
|
|
505973
506132
|
function getCliEntryPath() {
|
|
505974
506133
|
const argvEntry = process.argv[1];
|
|
505975
|
-
if (argvEntry &&
|
|
506134
|
+
if (argvEntry && existsSync18(argvEntry)) {
|
|
505976
506135
|
return argvEntry;
|
|
505977
506136
|
}
|
|
505978
506137
|
const fallback = resolve9(process.cwd(), "dist/cli.js");
|
|
505979
|
-
if (
|
|
506138
|
+
if (existsSync18(fallback)) {
|
|
505980
506139
|
return fallback;
|
|
505981
506140
|
}
|
|
505982
506141
|
throw new Error("Unable to locate Snow CLI entrypoint for child-process agent execution");
|
|
@@ -507484,8 +507643,8 @@ __export(subAgentConfig_exports, {
|
|
|
507484
507643
|
updateSubAgent: () => updateSubAgent,
|
|
507485
507644
|
validateSubAgent: () => validateSubAgent
|
|
507486
507645
|
});
|
|
507487
|
-
import { existsSync as
|
|
507488
|
-
import { join as
|
|
507646
|
+
import { existsSync as existsSync19, readFileSync as readFileSync16, writeFileSync as writeFileSync9, mkdirSync as mkdirSync9 } from "fs";
|
|
507647
|
+
import { join as join19 } from "path";
|
|
507489
507648
|
import { homedir as homedir9 } from "os";
|
|
507490
507649
|
function getBuiltinAgents() {
|
|
507491
507650
|
return getAllBuiltinAgentDefinitions().map((def2) => ({
|
|
@@ -507496,7 +507655,7 @@ function getBuiltinAgents() {
|
|
|
507496
507655
|
}));
|
|
507497
507656
|
}
|
|
507498
507657
|
function ensureConfigDirectory4() {
|
|
507499
|
-
if (!
|
|
507658
|
+
if (!existsSync19(CONFIG_DIR5)) {
|
|
507500
507659
|
mkdirSync9(CONFIG_DIR5, { recursive: true });
|
|
507501
507660
|
}
|
|
507502
507661
|
}
|
|
@@ -507506,7 +507665,7 @@ function generateId() {
|
|
|
507506
507665
|
function getUserSubAgents() {
|
|
507507
507666
|
try {
|
|
507508
507667
|
ensureConfigDirectory4();
|
|
507509
|
-
if (!
|
|
507668
|
+
if (!existsSync19(SUB_AGENTS_CONFIG_FILE)) {
|
|
507510
507669
|
return [];
|
|
507511
507670
|
}
|
|
507512
507671
|
const configData = readFileSync16(SUB_AGENTS_CONFIG_FILE, "utf8");
|
|
@@ -507651,8 +507810,8 @@ var init_subAgentConfig = __esm({
|
|
|
507651
507810
|
"dist/utils/config/subAgentConfig.js"() {
|
|
507652
507811
|
"use strict";
|
|
507653
507812
|
init_subagents();
|
|
507654
|
-
CONFIG_DIR5 =
|
|
507655
|
-
SUB_AGENTS_CONFIG_FILE =
|
|
507813
|
+
CONFIG_DIR5 = join19(homedir9(), ".snow");
|
|
507814
|
+
SUB_AGENTS_CONFIG_FILE = join19(CONFIG_DIR5, "sub-agents.json");
|
|
507656
507815
|
}
|
|
507657
507816
|
});
|
|
507658
507817
|
|
|
@@ -507830,20 +507989,20 @@ __export(teamConfig_exports, {
|
|
|
507830
507989
|
updateMember: () => updateMember,
|
|
507831
507990
|
updateTeam: () => updateTeam
|
|
507832
507991
|
});
|
|
507833
|
-
import { existsSync as
|
|
507834
|
-
import { join as
|
|
507992
|
+
import { existsSync as existsSync20, mkdirSync as mkdirSync10, readFileSync as readFileSync17, writeFileSync as writeFileSync10 } from "fs";
|
|
507993
|
+
import { join as join20 } from "path";
|
|
507835
507994
|
import { homedir as homedir10 } from "os";
|
|
507836
507995
|
import { randomUUID as randomUUID5 } from "crypto";
|
|
507837
507996
|
function ensureDir3(dir) {
|
|
507838
|
-
if (!
|
|
507997
|
+
if (!existsSync20(dir)) {
|
|
507839
507998
|
mkdirSync10(dir, { recursive: true });
|
|
507840
507999
|
}
|
|
507841
508000
|
}
|
|
507842
508001
|
function getTeamDir(teamName) {
|
|
507843
|
-
return
|
|
508002
|
+
return join20(TEAMS_DIR, teamName);
|
|
507844
508003
|
}
|
|
507845
508004
|
function getTeamConfigPath(teamName) {
|
|
507846
|
-
return
|
|
508005
|
+
return join20(getTeamDir(teamName), "config.json");
|
|
507847
508006
|
}
|
|
507848
508007
|
function createTeam(teamName, leadInstanceId) {
|
|
507849
508008
|
const existing = getTeam(teamName);
|
|
@@ -507864,7 +508023,7 @@ function createTeam(teamName, leadInstanceId) {
|
|
|
507864
508023
|
}
|
|
507865
508024
|
function getTeam(teamName) {
|
|
507866
508025
|
const configPath = getTeamConfigPath(teamName);
|
|
507867
|
-
if (!
|
|
508026
|
+
if (!existsSync20(configPath)) {
|
|
507868
508027
|
return null;
|
|
507869
508028
|
}
|
|
507870
508029
|
try {
|
|
@@ -507876,8 +508035,8 @@ function getTeam(teamName) {
|
|
|
507876
508035
|
function getActiveTeam() {
|
|
507877
508036
|
ensureDir3(TEAMS_DIR);
|
|
507878
508037
|
try {
|
|
507879
|
-
const { readdirSync:
|
|
507880
|
-
const entries =
|
|
508038
|
+
const { readdirSync: readdirSync11 } = __require("fs");
|
|
508039
|
+
const entries = readdirSync11(TEAMS_DIR, { withFileTypes: true });
|
|
507881
508040
|
for (const entry of entries) {
|
|
507882
508041
|
if (entry.isDirectory()) {
|
|
507883
508042
|
const team = getTeam(entry.name);
|
|
@@ -507968,7 +508127,7 @@ function disbandTeam(teamName) {
|
|
|
507968
508127
|
}
|
|
507969
508128
|
function deleteTeamData(teamName) {
|
|
507970
508129
|
const teamDir = getTeamDir(teamName);
|
|
507971
|
-
if (!
|
|
508130
|
+
if (!existsSync20(teamDir))
|
|
507972
508131
|
return false;
|
|
507973
508132
|
try {
|
|
507974
508133
|
const { rmSync: rmSync2 } = __require("fs");
|
|
@@ -507982,8 +508141,8 @@ var SNOW_DIR2, TEAMS_DIR;
|
|
|
507982
508141
|
var init_teamConfig = __esm({
|
|
507983
508142
|
"dist/utils/team/teamConfig.js"() {
|
|
507984
508143
|
"use strict";
|
|
507985
|
-
SNOW_DIR2 =
|
|
507986
|
-
TEAMS_DIR =
|
|
508144
|
+
SNOW_DIR2 = join20(homedir10(), ".snow");
|
|
508145
|
+
TEAMS_DIR = join20(SNOW_DIR2, "teams");
|
|
507987
508146
|
}
|
|
507988
508147
|
});
|
|
507989
508148
|
|
|
@@ -508001,21 +508160,21 @@ __export(teamTaskList_exports, {
|
|
|
508001
508160
|
listTasks: () => listTasks,
|
|
508002
508161
|
updateTaskStatus: () => updateTaskStatus
|
|
508003
508162
|
});
|
|
508004
|
-
import { existsSync as
|
|
508005
|
-
import { join as
|
|
508163
|
+
import { existsSync as existsSync21, mkdirSync as mkdirSync11, readFileSync as readFileSync18, writeFileSync as writeFileSync11, renameSync } from "fs";
|
|
508164
|
+
import { join as join21, dirname as dirname7 } from "path";
|
|
508006
508165
|
import { homedir as homedir11 } from "os";
|
|
508007
508166
|
import { randomUUID as randomUUID6 } from "crypto";
|
|
508008
508167
|
function getTaskListPath(teamName) {
|
|
508009
|
-
return
|
|
508168
|
+
return join21(TEAMS_DIR2, teamName, "tasks.json");
|
|
508010
508169
|
}
|
|
508011
508170
|
function ensureDir4(dir) {
|
|
508012
|
-
if (!
|
|
508171
|
+
if (!existsSync21(dir)) {
|
|
508013
508172
|
mkdirSync11(dir, { recursive: true });
|
|
508014
508173
|
}
|
|
508015
508174
|
}
|
|
508016
508175
|
function readTaskList(teamName) {
|
|
508017
508176
|
const filePath = getTaskListPath(teamName);
|
|
508018
|
-
if (!
|
|
508177
|
+
if (!existsSync21(filePath)) {
|
|
508019
508178
|
return { tasks: [], updatedAt: (/* @__PURE__ */ new Date()).toISOString() };
|
|
508020
508179
|
}
|
|
508021
508180
|
try {
|
|
@@ -508135,7 +508294,7 @@ function getTasksByAssignee(teamName, assigneeId) {
|
|
|
508135
508294
|
}
|
|
508136
508295
|
function clearTasks(teamName) {
|
|
508137
508296
|
const filePath = getTaskListPath(teamName);
|
|
508138
|
-
if (
|
|
508297
|
+
if (existsSync21(filePath)) {
|
|
508139
508298
|
writeTaskList(teamName, { tasks: [], updatedAt: (/* @__PURE__ */ new Date()).toISOString() });
|
|
508140
508299
|
}
|
|
508141
508300
|
}
|
|
@@ -508143,8 +508302,8 @@ var SNOW_DIR3, TEAMS_DIR2;
|
|
|
508143
508302
|
var init_teamTaskList = __esm({
|
|
508144
508303
|
"dist/utils/team/teamTaskList.js"() {
|
|
508145
508304
|
"use strict";
|
|
508146
|
-
SNOW_DIR3 =
|
|
508147
|
-
TEAMS_DIR2 =
|
|
508305
|
+
SNOW_DIR3 = join21(homedir11(), ".snow");
|
|
508306
|
+
TEAMS_DIR2 = join21(SNOW_DIR3, "teams");
|
|
508148
508307
|
}
|
|
508149
508308
|
});
|
|
508150
508309
|
|
|
@@ -508173,8 +508332,8 @@ __export(teamWorktree_exports, {
|
|
|
508173
508332
|
validateTeamWorktreeName: () => validateTeamWorktreeName
|
|
508174
508333
|
});
|
|
508175
508334
|
import { execSync as execSync4 } from "child_process";
|
|
508176
|
-
import { existsSync as
|
|
508177
|
-
import { join as
|
|
508335
|
+
import { existsSync as existsSync22 } from "fs";
|
|
508336
|
+
import { join as join22, resolve as resolve10, relative as relative6, isAbsolute as isAbsolute7 } from "path";
|
|
508178
508337
|
import { mkdirSync as mkdirSync12, rmSync } from "fs";
|
|
508179
508338
|
function sanitizeName(name) {
|
|
508180
508339
|
return name.normalize("NFKC").replace(/[^\p{L}\p{N}_-]/gu, "_").replace(/_+/g, "_").replace(/^_+|_+$/g, "").toLowerCase();
|
|
@@ -508192,19 +508351,19 @@ function getWorktreeBase() {
|
|
|
508192
508351
|
function getWorktreePath(teamName, memberName) {
|
|
508193
508352
|
const sanitizedTeamName = validateTeamWorktreeName(teamName, "team name");
|
|
508194
508353
|
const sanitizedMemberName = validateTeamWorktreeName(memberName, "teammate name");
|
|
508195
|
-
return
|
|
508354
|
+
return join22(WORKTREE_BASE, sanitizedTeamName, sanitizedMemberName);
|
|
508196
508355
|
}
|
|
508197
508356
|
async function createTeamWorktree(teamName, memberName) {
|
|
508198
508357
|
var _a20;
|
|
508199
508358
|
const sanitizedTeamName = validateTeamWorktreeName(teamName, "team name");
|
|
508200
508359
|
const sanitizedMemberName = validateTeamWorktreeName(memberName, "teammate name");
|
|
508201
|
-
const worktreePath =
|
|
508360
|
+
const worktreePath = join22(WORKTREE_BASE, sanitizedTeamName, sanitizedMemberName);
|
|
508202
508361
|
const branchName = `snow-team/${sanitizedTeamName}/${sanitizedMemberName}`;
|
|
508203
|
-
if (
|
|
508362
|
+
if (existsSync22(worktreePath)) {
|
|
508204
508363
|
return worktreePath;
|
|
508205
508364
|
}
|
|
508206
|
-
const parentDir =
|
|
508207
|
-
if (!
|
|
508365
|
+
const parentDir = join22(worktreePath, "..");
|
|
508366
|
+
if (!existsSync22(parentDir)) {
|
|
508208
508367
|
mkdirSync12(parentDir, { recursive: true });
|
|
508209
508368
|
}
|
|
508210
508369
|
try {
|
|
@@ -508229,7 +508388,7 @@ async function createTeamWorktree(teamName, memberName) {
|
|
|
508229
508388
|
return worktreePath;
|
|
508230
508389
|
}
|
|
508231
508390
|
async function removeTeamWorktree(worktreePath) {
|
|
508232
|
-
if (!
|
|
508391
|
+
if (!existsSync22(worktreePath))
|
|
508233
508392
|
return;
|
|
508234
508393
|
try {
|
|
508235
508394
|
execSync4(`git worktree remove "${worktreePath}" --force`, {
|
|
@@ -508255,15 +508414,15 @@ async function removeWorktreeBranch(teamName, memberName) {
|
|
|
508255
508414
|
}
|
|
508256
508415
|
}
|
|
508257
508416
|
async function cleanupTeamWorktrees(teamName) {
|
|
508258
|
-
const teamDir =
|
|
508259
|
-
if (!
|
|
508417
|
+
const teamDir = join22(WORKTREE_BASE, sanitizeName(teamName));
|
|
508418
|
+
if (!existsSync22(teamDir))
|
|
508260
508419
|
return;
|
|
508261
508420
|
try {
|
|
508262
|
-
const { readdirSync:
|
|
508263
|
-
const entries =
|
|
508421
|
+
const { readdirSync: readdirSync11 } = __require("fs");
|
|
508422
|
+
const entries = readdirSync11(teamDir, { withFileTypes: true });
|
|
508264
508423
|
for (const entry of entries) {
|
|
508265
508424
|
if (entry.isDirectory()) {
|
|
508266
|
-
const worktreePath =
|
|
508425
|
+
const worktreePath = join22(teamDir, entry.name);
|
|
508267
508426
|
await removeTeamWorktree(worktreePath);
|
|
508268
508427
|
await removeWorktreeBranch(teamName, entry.name);
|
|
508269
508428
|
}
|
|
@@ -508274,13 +508433,13 @@ async function cleanupTeamWorktrees(teamName) {
|
|
|
508274
508433
|
}
|
|
508275
508434
|
}
|
|
508276
508435
|
function listTeamWorktrees(teamName) {
|
|
508277
|
-
const teamDir =
|
|
508278
|
-
if (!
|
|
508436
|
+
const teamDir = join22(WORKTREE_BASE, sanitizeName(teamName));
|
|
508437
|
+
if (!existsSync22(teamDir))
|
|
508279
508438
|
return [];
|
|
508280
508439
|
try {
|
|
508281
|
-
const { readdirSync:
|
|
508282
|
-
const entries =
|
|
508283
|
-
return entries.filter((e) => e.isDirectory()).map((e) =>
|
|
508440
|
+
const { readdirSync: readdirSync11 } = __require("fs");
|
|
508441
|
+
const entries = readdirSync11(teamDir, { withFileTypes: true });
|
|
508442
|
+
return entries.filter((e) => e.isDirectory()).map((e) => join22(teamDir, e.name));
|
|
508284
508443
|
} catch {
|
|
508285
508444
|
return [];
|
|
508286
508445
|
}
|
|
@@ -508580,7 +508739,7 @@ var WORKTREE_BASE;
|
|
|
508580
508739
|
var init_teamWorktree = __esm({
|
|
508581
508740
|
"dist/utils/team/teamWorktree.js"() {
|
|
508582
508741
|
"use strict";
|
|
508583
|
-
WORKTREE_BASE =
|
|
508742
|
+
WORKTREE_BASE = join22(process.cwd(), ".snow", "worktrees");
|
|
508584
508743
|
}
|
|
508585
508744
|
});
|
|
508586
508745
|
|
|
@@ -510079,7 +510238,7 @@ var init_teamSnapshot = __esm({
|
|
|
510079
510238
|
});
|
|
510080
510239
|
|
|
510081
510240
|
// dist/mcp/team.js
|
|
510082
|
-
import { existsSync as
|
|
510241
|
+
import { existsSync as existsSync24, readFileSync as readFileSync20, writeFileSync as writeFileSync13 } from "fs";
|
|
510083
510242
|
function getTeamMCPTools() {
|
|
510084
510243
|
return teamService.getTools();
|
|
510085
510244
|
}
|
|
@@ -510561,7 +510720,7 @@ var init_team = __esm({
|
|
|
510561
510720
|
error: `Member "${targetName}" not found in team.`
|
|
510562
510721
|
};
|
|
510563
510722
|
}
|
|
510564
|
-
if (member.worktreePath &&
|
|
510723
|
+
if (member.worktreePath && existsSync24(member.worktreePath)) {
|
|
510565
510724
|
autoCommitWorktreeChanges(member.worktreePath, member.name);
|
|
510566
510725
|
}
|
|
510567
510726
|
const result2 = mergeTeammateBranch(team.name, member.name, strategy);
|
|
@@ -510632,7 +510791,7 @@ var init_team = __esm({
|
|
|
510632
510791
|
const strategy = args2["strategy"] || "manual";
|
|
510633
510792
|
const results = [];
|
|
510634
510793
|
for (const member of team.members) {
|
|
510635
|
-
if (member.worktreePath &&
|
|
510794
|
+
if (member.worktreePath && existsSync24(member.worktreePath)) {
|
|
510636
510795
|
autoCommitWorktreeChanges(member.worktreePath, member.name);
|
|
510637
510796
|
}
|
|
510638
510797
|
const diff2 = getTeammateDiffSummary(team.name, member.name);
|
|
@@ -514486,14 +514645,14 @@ __export(skills_exports, {
|
|
|
514486
514645
|
listAvailableSkills: () => listAvailableSkills,
|
|
514487
514646
|
mcpTools: () => mcpTools11
|
|
514488
514647
|
});
|
|
514489
|
-
import { dirname as dirname8, join as
|
|
514490
|
-
import { existsSync as
|
|
514648
|
+
import { dirname as dirname8, join as join24, relative as relative7 } from "path";
|
|
514649
|
+
import { existsSync as existsSync25 } from "fs";
|
|
514491
514650
|
import { readFile } from "fs/promises";
|
|
514492
514651
|
import { homedir as homedir13 } from "os";
|
|
514493
514652
|
async function readSkillFile(skillPath) {
|
|
514494
514653
|
try {
|
|
514495
|
-
const skillFile =
|
|
514496
|
-
if (!
|
|
514654
|
+
const skillFile = join24(skillPath, "SKILL.md");
|
|
514655
|
+
if (!existsSync25(skillFile)) {
|
|
514497
514656
|
return null;
|
|
514498
514657
|
}
|
|
514499
514658
|
const fileContent = await readFile(skillFile, "utf-8");
|
|
@@ -514533,11 +514692,11 @@ function normalizeSkillId(skillId) {
|
|
|
514533
514692
|
return skillId.replace(/\\/g, "/").replace(/^\.\/+/, "");
|
|
514534
514693
|
}
|
|
514535
514694
|
async function loadSkillsFromDirectory(skills, baseSkillsDir, location, source2 = "snow") {
|
|
514536
|
-
if (!
|
|
514695
|
+
if (!existsSync25(baseSkillsDir)) {
|
|
514537
514696
|
return;
|
|
514538
514697
|
}
|
|
514539
514698
|
try {
|
|
514540
|
-
const { readdirSync:
|
|
514699
|
+
const { readdirSync: readdirSync11 } = await import("fs");
|
|
514541
514700
|
const pendingDirs = [baseSkillsDir];
|
|
514542
514701
|
while (pendingDirs.length > 0) {
|
|
514543
514702
|
const currentDir = pendingDirs.pop();
|
|
@@ -514545,7 +514704,7 @@ async function loadSkillsFromDirectory(skills, baseSkillsDir, location, source2
|
|
|
514545
514704
|
continue;
|
|
514546
514705
|
let entries;
|
|
514547
514706
|
try {
|
|
514548
|
-
entries =
|
|
514707
|
+
entries = readdirSync11(currentDir, { withFileTypes: true });
|
|
514549
514708
|
} catch {
|
|
514550
514709
|
continue;
|
|
514551
514710
|
}
|
|
@@ -514554,13 +514713,13 @@ async function loadSkillsFromDirectory(skills, baseSkillsDir, location, source2
|
|
|
514554
514713
|
if (entry.name === "templates" || entry.name === "examples" || entry.name === "node_modules" || entry.name.startsWith(".")) {
|
|
514555
514714
|
continue;
|
|
514556
514715
|
}
|
|
514557
|
-
pendingDirs.push(
|
|
514716
|
+
pendingDirs.push(join24(currentDir, entry.name));
|
|
514558
514717
|
continue;
|
|
514559
514718
|
}
|
|
514560
514719
|
if (!entry.isFile() || entry.name !== "SKILL.md") {
|
|
514561
514720
|
continue;
|
|
514562
514721
|
}
|
|
514563
|
-
const skillFile =
|
|
514722
|
+
const skillFile = join24(currentDir, entry.name);
|
|
514564
514723
|
const skillDir = dirname8(skillFile);
|
|
514565
514724
|
const rawSkillId = relative7(baseSkillsDir, skillDir);
|
|
514566
514725
|
const skillId = normalizeSkillId(rawSkillId);
|
|
@@ -514591,10 +514750,10 @@ async function loadSkillsFromDirectory(skills, baseSkillsDir, location, source2
|
|
|
514591
514750
|
async function loadAvailableSkills(projectRoot) {
|
|
514592
514751
|
const skills = /* @__PURE__ */ new Map();
|
|
514593
514752
|
const home = homedir13();
|
|
514594
|
-
const globalAgentsSkillsDir =
|
|
514595
|
-
const globalSnowSkillsDir =
|
|
514596
|
-
const projectAgentsSkillsDir = projectRoot ?
|
|
514597
|
-
const projectSnowSkillsDir = projectRoot ?
|
|
514753
|
+
const globalAgentsSkillsDir = join24(home, ".agents", "skills");
|
|
514754
|
+
const globalSnowSkillsDir = join24(home, ".snow", "skills");
|
|
514755
|
+
const projectAgentsSkillsDir = projectRoot ? join24(projectRoot, ".agents", "skills") : null;
|
|
514756
|
+
const projectSnowSkillsDir = projectRoot ? join24(projectRoot, ".snow", "skills") : null;
|
|
514598
514757
|
await loadSkillsFromDirectory(skills, globalAgentsSkillsDir, "global", "agents");
|
|
514599
514758
|
await loadSkillsFromDirectory(skills, globalSnowSkillsDir, "global", "snow");
|
|
514600
514759
|
if (projectAgentsSkillsDir) {
|
|
@@ -514675,8 +514834,8 @@ async function getMCPTools2(projectRoot) {
|
|
|
514675
514834
|
}
|
|
514676
514835
|
async function generateSkillTree(skillPath) {
|
|
514677
514836
|
try {
|
|
514678
|
-
const { readdirSync:
|
|
514679
|
-
const entries =
|
|
514837
|
+
const { readdirSync: readdirSync11 } = await import("fs");
|
|
514838
|
+
const entries = readdirSync11(skillPath, { withFileTypes: true });
|
|
514680
514839
|
const lines = [];
|
|
514681
514840
|
const sortedEntries = entries.sort((a, b) => {
|
|
514682
514841
|
if (a.isDirectory() && !b.isDirectory())
|
|
@@ -514695,8 +514854,8 @@ async function generateSkillTree(skillPath) {
|
|
|
514695
514854
|
if (entry.isDirectory()) {
|
|
514696
514855
|
lines.push(`${prefix} ${entry.name}/`);
|
|
514697
514856
|
try {
|
|
514698
|
-
const subPath =
|
|
514699
|
-
const subEntries =
|
|
514857
|
+
const subPath = join24(skillPath, entry.name);
|
|
514858
|
+
const subEntries = readdirSync11(subPath, { withFileTypes: true });
|
|
514700
514859
|
const sortedSubEntries = subEntries.sort((a, b) => a.name.localeCompare(b.name));
|
|
514701
514860
|
for (let j = 0; j < sortedSubEntries.length; j++) {
|
|
514702
514861
|
const subEntry = sortedSubEntries[j];
|
|
@@ -518996,12 +519155,12 @@ var init_LSPClient = __esm({
|
|
|
518996
519155
|
|
|
518997
519156
|
// dist/mcp/lsp/LSPServerRegistry.js
|
|
518998
519157
|
import { exec as exec6 } from "child_process";
|
|
518999
|
-
import { existsSync as
|
|
519158
|
+
import { existsSync as existsSync26, mkdirSync as mkdirSync14, readFileSync as readFileSync21, writeFileSync as writeFileSync14 } from "fs";
|
|
519000
519159
|
import { homedir as homedir14 } from "os";
|
|
519001
|
-
import { join as
|
|
519160
|
+
import { join as join26 } from "path";
|
|
519002
519161
|
import { promisify } from "util";
|
|
519003
519162
|
function ensureConfigDirectory5() {
|
|
519004
|
-
if (!
|
|
519163
|
+
if (!existsSync26(CONFIG_DIR6)) {
|
|
519005
519164
|
mkdirSync14(CONFIG_DIR6, { recursive: true });
|
|
519006
519165
|
}
|
|
519007
519166
|
}
|
|
@@ -519075,7 +519234,7 @@ function getDefaultConfigFile() {
|
|
|
519075
519234
|
}
|
|
519076
519235
|
function loadServersFromDisk() {
|
|
519077
519236
|
ensureConfigDirectory5();
|
|
519078
|
-
if (!
|
|
519237
|
+
if (!existsSync26(LSP_CONFIG_FILE)) {
|
|
519079
519238
|
try {
|
|
519080
519239
|
writeFileSync14(LSP_CONFIG_FILE, JSON.stringify(getDefaultConfigFile(), null, 2), "utf8");
|
|
519081
519240
|
} catch (error42) {
|
|
@@ -519098,8 +519257,8 @@ var init_LSPServerRegistry = __esm({
|
|
|
519098
519257
|
"dist/mcp/lsp/LSPServerRegistry.js"() {
|
|
519099
519258
|
"use strict";
|
|
519100
519259
|
execAsync = promisify(exec6);
|
|
519101
|
-
CONFIG_DIR6 =
|
|
519102
|
-
LSP_CONFIG_FILE =
|
|
519260
|
+
CONFIG_DIR6 = join26(homedir14(), ".snow");
|
|
519261
|
+
LSP_CONFIG_FILE = join26(CONFIG_DIR6, "lsp-config.json");
|
|
519103
519262
|
DEFAULT_LSP_SERVERS = {
|
|
519104
519263
|
typescript: {
|
|
519105
519264
|
command: "typescript-language-server",
|
|
@@ -521450,7 +521609,7 @@ __export(roleSubagent_exports, {
|
|
|
521450
521609
|
import fs41 from "fs/promises";
|
|
521451
521610
|
import path49 from "path";
|
|
521452
521611
|
import { homedir as homedir15 } from "os";
|
|
521453
|
-
import { existsSync as
|
|
521612
|
+
import { existsSync as existsSync27, readdirSync as readdirSync5, readFileSync as readFileSync22 } from "fs";
|
|
521454
521613
|
function getRoleSubagentDirectory(location, projectRoot) {
|
|
521455
521614
|
if (location === "global") {
|
|
521456
521615
|
return path49.join(homedir15(), ".snow");
|
|
@@ -521469,12 +521628,12 @@ function getRoleSubagentFilePath(agentName, location, projectRoot) {
|
|
|
521469
521628
|
return path49.join(dir, buildRoleSubagentFilename(agentName));
|
|
521470
521629
|
}
|
|
521471
521630
|
function checkRoleSubagentExists(agentName, location, projectRoot) {
|
|
521472
|
-
return
|
|
521631
|
+
return existsSync27(getRoleSubagentFilePath(agentName, location, projectRoot));
|
|
521473
521632
|
}
|
|
521474
521633
|
async function createRoleSubagentFile(agentName, location, projectRoot) {
|
|
521475
521634
|
try {
|
|
521476
521635
|
const filePath = getRoleSubagentFilePath(agentName, location, projectRoot);
|
|
521477
|
-
if (
|
|
521636
|
+
if (existsSync27(filePath)) {
|
|
521478
521637
|
return {
|
|
521479
521638
|
success: false,
|
|
521480
521639
|
path: filePath,
|
|
@@ -521496,7 +521655,7 @@ async function createRoleSubagentFile(agentName, location, projectRoot) {
|
|
|
521496
521655
|
async function deleteRoleSubagentFile(agentName, location, projectRoot) {
|
|
521497
521656
|
try {
|
|
521498
521657
|
const filePath = getRoleSubagentFilePath(agentName, location, projectRoot);
|
|
521499
|
-
if (!
|
|
521658
|
+
if (!existsSync27(filePath)) {
|
|
521500
521659
|
return {
|
|
521501
521660
|
success: false,
|
|
521502
521661
|
path: filePath,
|
|
@@ -521516,10 +521675,10 @@ async function deleteRoleSubagentFile(agentName, location, projectRoot) {
|
|
|
521516
521675
|
function listRoleSubagents(location, projectRoot) {
|
|
521517
521676
|
const dir = getRoleSubagentDirectory(location, projectRoot);
|
|
521518
521677
|
const items = [];
|
|
521519
|
-
if (!
|
|
521678
|
+
if (!existsSync27(dir))
|
|
521520
521679
|
return items;
|
|
521521
521680
|
try {
|
|
521522
|
-
const files =
|
|
521681
|
+
const files = readdirSync5(dir);
|
|
521523
521682
|
const allAgents = getSubAgents();
|
|
521524
521683
|
const agentNameMap = /* @__PURE__ */ new Map();
|
|
521525
521684
|
for (const agent of allAgents) {
|
|
@@ -521545,7 +521704,7 @@ function listRoleSubagents(location, projectRoot) {
|
|
|
521545
521704
|
function loadSubAgentCustomRole(agentName, projectRoot) {
|
|
521546
521705
|
if (projectRoot) {
|
|
521547
521706
|
const projectPath = getRoleSubagentFilePath(agentName, "project", projectRoot);
|
|
521548
|
-
if (
|
|
521707
|
+
if (existsSync27(projectPath)) {
|
|
521549
521708
|
try {
|
|
521550
521709
|
const content = readFileSync22(projectPath, "utf-8").trim();
|
|
521551
521710
|
if (content)
|
|
@@ -521555,7 +521714,7 @@ function loadSubAgentCustomRole(agentName, projectRoot) {
|
|
|
521555
521714
|
}
|
|
521556
521715
|
}
|
|
521557
521716
|
const globalPath = getRoleSubagentFilePath(agentName, "global");
|
|
521558
|
-
if (
|
|
521717
|
+
if (existsSync27(globalPath)) {
|
|
521559
521718
|
try {
|
|
521560
521719
|
const content = readFileSync22(globalPath, "utf-8").trim();
|
|
521561
521720
|
if (content)
|
|
@@ -530112,9 +530271,9 @@ var init_types6 = __esm({
|
|
|
530112
530271
|
|
|
530113
530272
|
// dist/buddy/companion.js
|
|
530114
530273
|
import { randomUUID as randomUUID7 } from "crypto";
|
|
530115
|
-
import { existsSync as
|
|
530274
|
+
import { existsSync as existsSync29, mkdirSync as mkdirSync16, readFileSync as readFileSync24, writeFileSync as writeFileSync16 } from "fs";
|
|
530116
530275
|
import { homedir as homedir16 } from "os";
|
|
530117
|
-
import { join as
|
|
530276
|
+
import { join as join29 } from "path";
|
|
530118
530277
|
function mulberry32(seed) {
|
|
530119
530278
|
let value = seed >>> 0;
|
|
530120
530279
|
return () => {
|
|
@@ -530134,7 +530293,7 @@ function hashString(value) {
|
|
|
530134
530293
|
return hash >>> 0;
|
|
530135
530294
|
}
|
|
530136
530295
|
function ensureBuddyDirectory() {
|
|
530137
|
-
if (!
|
|
530296
|
+
if (!existsSync29(CONFIG_DIR7)) {
|
|
530138
530297
|
mkdirSync16(CONFIG_DIR7, { recursive: true });
|
|
530139
530298
|
}
|
|
530140
530299
|
}
|
|
@@ -530186,7 +530345,7 @@ function isStoredCompanion(value) {
|
|
|
530186
530345
|
}
|
|
530187
530346
|
function readBuddyStateFile() {
|
|
530188
530347
|
ensureBuddyDirectory();
|
|
530189
|
-
if (!
|
|
530348
|
+
if (!existsSync29(BUDDY_STATE_FILE)) {
|
|
530190
530349
|
return { version: BUDDY_STATE_VERSION };
|
|
530191
530350
|
}
|
|
530192
530351
|
try {
|
|
@@ -530353,8 +530512,8 @@ var init_companion = __esm({
|
|
|
530353
530512
|
init_types6();
|
|
530354
530513
|
SALT = "snow-cli-buddy-v1";
|
|
530355
530514
|
BUDDY_STATE_VERSION = 1;
|
|
530356
|
-
CONFIG_DIR7 =
|
|
530357
|
-
BUDDY_STATE_FILE =
|
|
530515
|
+
CONFIG_DIR7 = join29(homedir16(), ".snow");
|
|
530516
|
+
BUDDY_STATE_FILE = join29(CONFIG_DIR7, "buddy.json");
|
|
530358
530517
|
RARITY_WEIGHTS = [
|
|
530359
530518
|
["common", 60],
|
|
530360
530519
|
["uncommon", 25],
|
|
@@ -534287,9 +534446,9 @@ __export(custom_exports, {
|
|
|
534287
534446
|
saveCustomCommand: () => saveCustomCommand
|
|
534288
534447
|
});
|
|
534289
534448
|
import { homedir as homedir17 } from "os";
|
|
534290
|
-
import { dirname as dirname11, join as
|
|
534449
|
+
import { dirname as dirname11, join as join32 } from "path";
|
|
534291
534450
|
import { readdir as readdir4, readFile as readFile2, writeFile, mkdir as mkdir3, unlink as unlink3 } from "fs/promises";
|
|
534292
|
-
import { existsSync as
|
|
534451
|
+
import { existsSync as existsSync30 } from "fs";
|
|
534293
534452
|
function isRecord3(value) {
|
|
534294
534453
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
534295
534454
|
}
|
|
@@ -534335,13 +534494,13 @@ function getCommandJsonFilePath(commandsDir, name) {
|
|
|
534335
534494
|
throw new Error(`Invalid command name: "${name}"`);
|
|
534336
534495
|
}
|
|
534337
534496
|
if (!namespacePath) {
|
|
534338
|
-
return
|
|
534497
|
+
return join32(commandsDir, `${commandName}.json`);
|
|
534339
534498
|
}
|
|
534340
534499
|
const segments = assertValidNamespacePath(namespacePath);
|
|
534341
|
-
return
|
|
534500
|
+
return join32(commandsDir, ...segments, `${commandName}.json`);
|
|
534342
534501
|
}
|
|
534343
534502
|
async function listJsonCommandsRecursively(dir, prefixPath) {
|
|
534344
|
-
if (!
|
|
534503
|
+
if (!existsSync30(dir)) {
|
|
534345
534504
|
return [];
|
|
534346
534505
|
}
|
|
534347
534506
|
let entries = [];
|
|
@@ -534359,7 +534518,7 @@ async function listJsonCommandsRecursively(dir, prefixPath) {
|
|
|
534359
534518
|
});
|
|
534360
534519
|
const results = [];
|
|
534361
534520
|
for (const entry of entries) {
|
|
534362
|
-
const entryPath =
|
|
534521
|
+
const entryPath = join32(dir, entry.name);
|
|
534363
534522
|
if (entry.isDirectory()) {
|
|
534364
534523
|
const childPrefix = prefixPath ? `${prefixPath}/${entry.name}` : entry.name;
|
|
534365
534524
|
results.push(...await listJsonCommandsRecursively(entryPath, childPrefix));
|
|
@@ -534414,14 +534573,14 @@ async function loadCommandsFromDir(dir, defaultLocation) {
|
|
|
534414
534573
|
}
|
|
534415
534574
|
function getCustomCommandsDir(location, projectRoot) {
|
|
534416
534575
|
if (location === "global") {
|
|
534417
|
-
return
|
|
534576
|
+
return join32(homedir17(), ".snow", "commands");
|
|
534418
534577
|
}
|
|
534419
534578
|
const root2 = projectRoot || process.cwd();
|
|
534420
|
-
return
|
|
534579
|
+
return join32(root2, ".snow", "commands");
|
|
534421
534580
|
}
|
|
534422
534581
|
async function ensureCommandsDir(location = "global", projectRoot) {
|
|
534423
534582
|
const dir = getCustomCommandsDir(location, projectRoot);
|
|
534424
|
-
if (!
|
|
534583
|
+
if (!existsSync30(dir)) {
|
|
534425
534584
|
await mkdir3(dir, { recursive: true });
|
|
534426
534585
|
}
|
|
534427
534586
|
}
|
|
@@ -534457,7 +534616,7 @@ function checkCommandExists(name, location, projectRoot) {
|
|
|
534457
534616
|
const dir = getCustomCommandsDir(location, projectRoot);
|
|
534458
534617
|
try {
|
|
534459
534618
|
const filePath = getCommandJsonFilePath(dir, name);
|
|
534460
|
-
return
|
|
534619
|
+
return existsSync30(filePath);
|
|
534461
534620
|
} catch {
|
|
534462
534621
|
return false;
|
|
534463
534622
|
}
|
|
@@ -542605,8 +542764,10 @@ async function maskPrivacyText(text2, config3, abortSignal) {
|
|
|
542605
542764
|
if (abortSignal == null ? void 0 : abortSignal.aborted) {
|
|
542606
542765
|
return text2;
|
|
542607
542766
|
}
|
|
542608
|
-
|
|
542609
|
-
|
|
542767
|
+
if (typeof data.masked_text === "string") {
|
|
542768
|
+
return data.masked_text;
|
|
542769
|
+
}
|
|
542770
|
+
return maskWithLocalFallback(text2);
|
|
542610
542771
|
} catch (error42) {
|
|
542611
542772
|
const errorName = error42 instanceof Error ? error42.name : void 0;
|
|
542612
542773
|
if ((abortSignal == null ? void 0 : abortSignal.aborted) || errorName === "AbortError") {
|
|
@@ -544206,16 +544367,16 @@ footer.export-footer {
|
|
|
544206
544367
|
|
|
544207
544368
|
// dist/utils/config/themeConfig.js
|
|
544208
544369
|
import { homedir as homedir19 } from "os";
|
|
544209
|
-
import { join as
|
|
544210
|
-
import { existsSync as
|
|
544370
|
+
import { join as join35 } from "path";
|
|
544371
|
+
import { existsSync as existsSync31, mkdirSync as mkdirSync17, readFileSync as readFileSync26, writeFileSync as writeFileSync17 } from "fs";
|
|
544211
544372
|
function ensureConfigDirectory6() {
|
|
544212
|
-
if (!
|
|
544373
|
+
if (!existsSync31(CONFIG_DIR8)) {
|
|
544213
544374
|
mkdirSync17(CONFIG_DIR8, { recursive: true });
|
|
544214
544375
|
}
|
|
544215
544376
|
}
|
|
544216
544377
|
function loadThemeConfig() {
|
|
544217
544378
|
ensureConfigDirectory6();
|
|
544218
|
-
if (!
|
|
544379
|
+
if (!existsSync31(THEME_CONFIG_FILE)) {
|
|
544219
544380
|
saveThemeConfig(DEFAULT_CONFIG5);
|
|
544220
544381
|
return DEFAULT_CONFIG5;
|
|
544221
544382
|
}
|
|
@@ -544271,8 +544432,8 @@ var CONFIG_DIR8, THEME_CONFIG_FILE, DEFAULT_CONFIG5;
|
|
|
544271
544432
|
var init_themeConfig = __esm({
|
|
544272
544433
|
"dist/utils/config/themeConfig.js"() {
|
|
544273
544434
|
"use strict";
|
|
544274
|
-
CONFIG_DIR8 =
|
|
544275
|
-
THEME_CONFIG_FILE =
|
|
544435
|
+
CONFIG_DIR8 = join35(homedir19(), ".snow");
|
|
544436
|
+
THEME_CONFIG_FILE = join35(CONFIG_DIR8, "theme.json");
|
|
544276
544437
|
DEFAULT_CONFIG5 = {
|
|
544277
544438
|
theme: "tiffany",
|
|
544278
544439
|
simpleMode: true,
|
|
@@ -547186,17 +547347,17 @@ __export(taskExecutor_exports, {
|
|
|
547186
547347
|
executeTaskInBackground: () => executeTaskInBackground
|
|
547187
547348
|
});
|
|
547188
547349
|
import { spawn as spawn10 } from "child_process";
|
|
547189
|
-
import { writeFileSync as writeFileSync18, appendFileSync, existsSync as
|
|
547190
|
-
import { join as
|
|
547350
|
+
import { writeFileSync as writeFileSync18, appendFileSync, existsSync as existsSync32, mkdirSync as mkdirSync18 } from "fs";
|
|
547351
|
+
import { join as join36 } from "path";
|
|
547191
547352
|
import { homedir as homedir20 } from "os";
|
|
547192
547353
|
function ensureLogDir() {
|
|
547193
|
-
if (!
|
|
547354
|
+
if (!existsSync32(TASK_LOG_DIR)) {
|
|
547194
547355
|
mkdirSync18(TASK_LOG_DIR, { recursive: true });
|
|
547195
547356
|
}
|
|
547196
547357
|
}
|
|
547197
547358
|
function getLogPath(taskId) {
|
|
547198
547359
|
ensureLogDir();
|
|
547199
|
-
return
|
|
547360
|
+
return join36(TASK_LOG_DIR, `${taskId}.log`);
|
|
547200
547361
|
}
|
|
547201
547362
|
function writeLog(taskId, message) {
|
|
547202
547363
|
try {
|
|
@@ -547500,7 +547661,7 @@ var init_taskExecutor = __esm({
|
|
|
547500
547661
|
"use strict";
|
|
547501
547662
|
init_notification();
|
|
547502
547663
|
init_taskManager();
|
|
547503
|
-
TASK_LOG_DIR =
|
|
547664
|
+
TASK_LOG_DIR = join36(homedir20(), ".snow", "task-logs");
|
|
547504
547665
|
}
|
|
547505
547666
|
});
|
|
547506
547667
|
|
|
@@ -547514,24 +547675,24 @@ __export(loopManager_exports, {
|
|
|
547514
547675
|
});
|
|
547515
547676
|
import { spawn as spawn11 } from "child_process";
|
|
547516
547677
|
import { randomUUID as randomUUID9 } from "crypto";
|
|
547517
|
-
import { existsSync as
|
|
547678
|
+
import { existsSync as existsSync33, mkdirSync as mkdirSync19, readdirSync as readdirSync6, readFileSync as readFileSync27, unlinkSync as unlinkSync5, writeFileSync as writeFileSync19 } from "fs";
|
|
547518
547679
|
import { homedir as homedir21 } from "os";
|
|
547519
|
-
import { join as
|
|
547680
|
+
import { join as join37 } from "path";
|
|
547520
547681
|
function ensureLoopDaemonDirs() {
|
|
547521
|
-
if (!
|
|
547682
|
+
if (!existsSync33(LOOP_DAEMON_DIR)) {
|
|
547522
547683
|
mkdirSync19(LOOP_DAEMON_DIR, { recursive: true });
|
|
547523
547684
|
}
|
|
547524
|
-
if (!
|
|
547685
|
+
if (!existsSync33(LOOP_DAEMON_LOG_DIR)) {
|
|
547525
547686
|
mkdirSync19(LOOP_DAEMON_LOG_DIR, { recursive: true });
|
|
547526
547687
|
}
|
|
547527
547688
|
}
|
|
547528
547689
|
function getLoopDaemonFilePath(loopId) {
|
|
547529
547690
|
ensureLoopDaemonDirs();
|
|
547530
|
-
return
|
|
547691
|
+
return join37(LOOP_DAEMON_DIR, `${loopId}.json`);
|
|
547531
547692
|
}
|
|
547532
547693
|
function getLoopDaemonLogPath(loopId) {
|
|
547533
547694
|
ensureLoopDaemonDirs();
|
|
547534
|
-
return
|
|
547695
|
+
return join37(LOOP_DAEMON_LOG_DIR, `${loopId}.log`);
|
|
547535
547696
|
}
|
|
547536
547697
|
function isProcessAlive2(pid) {
|
|
547537
547698
|
if (!pid) {
|
|
@@ -547771,8 +547932,8 @@ var init_loopManager = __esm({
|
|
|
547771
547932
|
DEFAULT_INTERVAL_MS = 10 * 60 * 1e3;
|
|
547772
547933
|
MAX_ACTIVE_LOOPS = 50;
|
|
547773
547934
|
ACTIVE_TASK_STATUSES = /* @__PURE__ */ new Set(["pending", "running", "paused"]);
|
|
547774
|
-
LOOP_DAEMON_DIR =
|
|
547775
|
-
LOOP_DAEMON_LOG_DIR =
|
|
547935
|
+
LOOP_DAEMON_DIR = join37(homedir21(), ".snow", "loop-daemons");
|
|
547936
|
+
LOOP_DAEMON_LOG_DIR = join37(homedir21(), ".snow", "loop-logs");
|
|
547776
547937
|
LoopManager = class {
|
|
547777
547938
|
constructor() {
|
|
547778
547939
|
Object.defineProperty(this, "loops", {
|
|
@@ -547929,7 +548090,7 @@ var init_loopManager = __esm({
|
|
|
547929
548090
|
}
|
|
547930
548091
|
async listDaemonLoops() {
|
|
547931
548092
|
ensureLoopDaemonDirs();
|
|
547932
|
-
return
|
|
548093
|
+
return readdirSync6(LOOP_DAEMON_DIR).filter((file2) => file2.endsWith(".json")).map((file2) => readLoopDaemonState(join37(LOOP_DAEMON_DIR, file2))).filter((state) => Boolean(state)).map((state) => ({
|
|
547933
548094
|
id: state.id,
|
|
547934
548095
|
prompt: state.prompt,
|
|
547935
548096
|
intervalMs: state.intervalMs,
|
|
@@ -547951,7 +548112,7 @@ var init_loopManager = __esm({
|
|
|
547951
548112
|
}
|
|
547952
548113
|
async cancelDaemonLoop(loopId) {
|
|
547953
548114
|
const filePath = getLoopDaemonFilePath(loopId);
|
|
547954
|
-
if (!
|
|
548115
|
+
if (!existsSync33(filePath)) {
|
|
547955
548116
|
return null;
|
|
547956
548117
|
}
|
|
547957
548118
|
const state = readLoopDaemonState(filePath);
|
|
@@ -549071,7 +549232,7 @@ __export(role_exports, {
|
|
|
549071
549232
|
import fs50 from "fs/promises";
|
|
549072
549233
|
import path58 from "path";
|
|
549073
549234
|
import { homedir as homedir22 } from "os";
|
|
549074
|
-
import { existsSync as
|
|
549235
|
+
import { existsSync as existsSync34, readdirSync as readdirSync7 } from "fs";
|
|
549075
549236
|
import crypto7 from "crypto";
|
|
549076
549237
|
function settingsScope(location) {
|
|
549077
549238
|
return location === "global" ? "global" : "project";
|
|
@@ -549106,7 +549267,7 @@ function getRoleFilePath(location, projectRoot) {
|
|
|
549106
549267
|
}
|
|
549107
549268
|
function checkRoleExists(location, projectRoot) {
|
|
549108
549269
|
const roleFilePath = getRoleFilePath(location, projectRoot);
|
|
549109
|
-
return
|
|
549270
|
+
return existsSync34(roleFilePath);
|
|
549110
549271
|
}
|
|
549111
549272
|
async function createRoleFile(location, projectRoot) {
|
|
549112
549273
|
try {
|
|
@@ -549131,7 +549292,7 @@ async function createRoleFile(location, projectRoot) {
|
|
|
549131
549292
|
async function deleteRoleFile(location, projectRoot) {
|
|
549132
549293
|
try {
|
|
549133
549294
|
const roleFilePath = getRoleFilePath(location, projectRoot);
|
|
549134
|
-
if (!
|
|
549295
|
+
if (!existsSync34(roleFilePath)) {
|
|
549135
549296
|
return {
|
|
549136
549297
|
success: false,
|
|
549137
549298
|
path: roleFilePath,
|
|
@@ -549167,11 +549328,11 @@ function parseRoleFilename(filename) {
|
|
|
549167
549328
|
function listRoles(location, projectRoot) {
|
|
549168
549329
|
const dir = getRoleDirectory(location, projectRoot);
|
|
549169
549330
|
const roles = [];
|
|
549170
|
-
if (!
|
|
549331
|
+
if (!existsSync34(dir)) {
|
|
549171
549332
|
return roles;
|
|
549172
549333
|
}
|
|
549173
549334
|
try {
|
|
549174
|
-
const files =
|
|
549335
|
+
const files = readdirSync7(dir);
|
|
549175
549336
|
const scanned = [];
|
|
549176
549337
|
for (const file2 of files) {
|
|
549177
549338
|
if (file2 === "ROLE.md" || /^ROLE-[a-f0-9]+\.md$/i.test(file2)) {
|
|
@@ -549443,9 +549604,9 @@ __export(skills_exports2, {
|
|
|
549443
549604
|
validateSkillName: () => validateSkillName
|
|
549444
549605
|
});
|
|
549445
549606
|
import { homedir as homedir23 } from "os";
|
|
549446
|
-
import { join as
|
|
549607
|
+
import { join as join38 } from "path";
|
|
549447
549608
|
import { mkdir as mkdir4, writeFile as writeFile4 } from "fs/promises";
|
|
549448
|
-
import { existsSync as
|
|
549609
|
+
import { existsSync as existsSync35 } from "fs";
|
|
549449
549610
|
function validateSkillId(name) {
|
|
549450
549611
|
if (!name || name.trim().length === 0) {
|
|
549451
549612
|
return { valid: false, error: "Skill name cannot be empty" };
|
|
@@ -549729,11 +549890,11 @@ ${cleanedBody}
|
|
|
549729
549890
|
}
|
|
549730
549891
|
function checkSkillExists(skillName, location, projectRoot) {
|
|
549731
549892
|
const snowDir = getSkillDirectory(skillName, location, projectRoot);
|
|
549732
|
-
if (
|
|
549893
|
+
if (existsSync35(snowDir)) {
|
|
549733
549894
|
return true;
|
|
549734
549895
|
}
|
|
549735
549896
|
const agentsDir = getSkillDirectoryForRoot(skillName, location, ".agents", projectRoot);
|
|
549736
|
-
return
|
|
549897
|
+
return existsSync35(agentsDir);
|
|
549737
549898
|
}
|
|
549738
549899
|
function getSkillDirectory(skillName, location, projectRoot) {
|
|
549739
549900
|
return getSkillDirectoryForRoot(skillName, location, ".snow", projectRoot);
|
|
@@ -549741,10 +549902,10 @@ function getSkillDirectory(skillName, location, projectRoot) {
|
|
|
549741
549902
|
function getSkillDirectoryForRoot(skillName, location, rootDirName, projectRoot) {
|
|
549742
549903
|
const segments = skillName.split("/").filter(Boolean);
|
|
549743
549904
|
if (location === "global") {
|
|
549744
|
-
return
|
|
549905
|
+
return join38(homedir23(), rootDirName, "skills", ...segments);
|
|
549745
549906
|
}
|
|
549746
549907
|
const root2 = projectRoot || process.cwd();
|
|
549747
|
-
return
|
|
549908
|
+
return join38(root2, rootDirName, "skills", ...segments);
|
|
549748
549909
|
}
|
|
549749
549910
|
function generateSkillTemplate(metadata) {
|
|
549750
549911
|
return `---
|
|
@@ -549873,7 +550034,7 @@ What this advanced example demonstrates.
|
|
|
549873
550034
|
async function createSkillFromGenerated(skillName, description, generated, location, projectRoot) {
|
|
549874
550035
|
try {
|
|
549875
550036
|
const skillDir = getSkillDirectory(skillName, location, projectRoot);
|
|
549876
|
-
if (
|
|
550037
|
+
if (existsSync35(skillDir)) {
|
|
549877
550038
|
return {
|
|
549878
550039
|
success: false,
|
|
549879
550040
|
path: skillDir,
|
|
@@ -549881,20 +550042,20 @@ async function createSkillFromGenerated(skillName, description, generated, locat
|
|
|
549881
550042
|
};
|
|
549882
550043
|
}
|
|
549883
550044
|
await mkdir4(skillDir, { recursive: true });
|
|
549884
|
-
await mkdir4(
|
|
549885
|
-
await mkdir4(
|
|
550045
|
+
await mkdir4(join38(skillDir, "scripts"), { recursive: true });
|
|
550046
|
+
await mkdir4(join38(skillDir, "templates"), { recursive: true });
|
|
549886
550047
|
const leafName = skillName.split("/").filter(Boolean).pop() || skillName;
|
|
549887
550048
|
const skillContent = generateSkillMarkdownWithFrontMatter({ name: leafName, description }, generated.skillMarkdownBody);
|
|
549888
|
-
await writeFile4(
|
|
549889
|
-
await writeFile4(
|
|
549890
|
-
await writeFile4(
|
|
550049
|
+
await writeFile4(join38(skillDir, "SKILL.md"), skillContent, "utf-8");
|
|
550050
|
+
await writeFile4(join38(skillDir, "reference.md"), generated.referenceMarkdown.trim() + "\n", "utf-8");
|
|
550051
|
+
await writeFile4(join38(skillDir, "examples.md"), generated.examplesMarkdown.trim() + "\n", "utf-8");
|
|
549891
550052
|
const templateContent = `This is a template file for ${skillName}.
|
|
549892
550053
|
|
|
549893
550054
|
You can use this as a starting point for generating code, configurations, or documentation.
|
|
549894
550055
|
|
|
549895
550056
|
Variables can be referenced like: {{variable_name}}
|
|
549896
550057
|
`;
|
|
549897
|
-
await writeFile4(
|
|
550058
|
+
await writeFile4(join38(skillDir, "templates", "template.txt"), templateContent, "utf-8");
|
|
549898
550059
|
const scriptContent = `#!/usr/bin/env python3
|
|
549899
550060
|
"""
|
|
549900
550061
|
Helper script for ${skillName}
|
|
@@ -549920,7 +550081,7 @@ def main():
|
|
|
549920
550081
|
if __name__ == "__main__":
|
|
549921
550082
|
main()
|
|
549922
550083
|
`;
|
|
549923
|
-
await writeFile4(
|
|
550084
|
+
await writeFile4(join38(skillDir, "scripts", "helper.py"), scriptContent, "utf-8");
|
|
549924
550085
|
return {
|
|
549925
550086
|
success: true,
|
|
549926
550087
|
path: skillDir
|
|
@@ -549936,7 +550097,7 @@ if __name__ == "__main__":
|
|
|
549936
550097
|
async function createSkillTemplate(skillName, description, location, projectRoot) {
|
|
549937
550098
|
try {
|
|
549938
550099
|
const skillDir = getSkillDirectory(skillName, location, projectRoot);
|
|
549939
|
-
if (
|
|
550100
|
+
if (existsSync35(skillDir)) {
|
|
549940
550101
|
return {
|
|
549941
550102
|
success: false,
|
|
549942
550103
|
path: skillDir,
|
|
@@ -549944,22 +550105,22 @@ async function createSkillTemplate(skillName, description, location, projectRoot
|
|
|
549944
550105
|
};
|
|
549945
550106
|
}
|
|
549946
550107
|
await mkdir4(skillDir, { recursive: true });
|
|
549947
|
-
await mkdir4(
|
|
549948
|
-
await mkdir4(
|
|
550108
|
+
await mkdir4(join38(skillDir, "scripts"), { recursive: true });
|
|
550109
|
+
await mkdir4(join38(skillDir, "templates"), { recursive: true });
|
|
549949
550110
|
const leafName = skillName.split("/").filter(Boolean).pop() || skillName;
|
|
549950
550111
|
const skillContent = generateSkillTemplate({ name: leafName, description });
|
|
549951
|
-
await writeFile4(
|
|
550112
|
+
await writeFile4(join38(skillDir, "SKILL.md"), skillContent, "utf-8");
|
|
549952
550113
|
const referenceContent = generateReferenceTemplate();
|
|
549953
|
-
await writeFile4(
|
|
550114
|
+
await writeFile4(join38(skillDir, "reference.md"), referenceContent, "utf-8");
|
|
549954
550115
|
const examplesContent = generateExamplesTemplate();
|
|
549955
|
-
await writeFile4(
|
|
550116
|
+
await writeFile4(join38(skillDir, "examples.md"), examplesContent, "utf-8");
|
|
549956
550117
|
const templateContent = `This is a template file for ${skillName}.
|
|
549957
550118
|
|
|
549958
550119
|
You can use this as a starting point for generating code, configurations, or documentation.
|
|
549959
550120
|
|
|
549960
550121
|
Variables can be referenced like: {{variable_name}}
|
|
549961
550122
|
`;
|
|
549962
|
-
await writeFile4(
|
|
550123
|
+
await writeFile4(join38(skillDir, "templates", "template.txt"), templateContent, "utf-8");
|
|
549963
550124
|
const scriptContent = `#!/usr/bin/env python3
|
|
549964
550125
|
"""
|
|
549965
550126
|
Helper script for ${skillName}
|
|
@@ -549985,7 +550146,7 @@ def main():
|
|
|
549985
550146
|
if __name__ == "__main__":
|
|
549986
550147
|
main()
|
|
549987
550148
|
`;
|
|
549988
|
-
await writeFile4(
|
|
550149
|
+
await writeFile4(join38(skillDir, "scripts", "helper.py"), scriptContent, "utf-8");
|
|
549989
550150
|
return {
|
|
549990
550151
|
success: true,
|
|
549991
550152
|
path: skillDir
|
|
@@ -553806,12 +553967,12 @@ var init_useTerminalSize = __esm({
|
|
|
553806
553967
|
});
|
|
553807
553968
|
|
|
553808
553969
|
// dist/ui/themes/index.js
|
|
553809
|
-
import { existsSync as
|
|
553970
|
+
import { existsSync as existsSync36, readFileSync as readFileSync28 } from "fs";
|
|
553810
553971
|
import { homedir as homedir24 } from "os";
|
|
553811
|
-
import { join as
|
|
553972
|
+
import { join as join39 } from "path";
|
|
553812
553973
|
function loadCustomThemeColors() {
|
|
553813
|
-
const configPath =
|
|
553814
|
-
if (!
|
|
553974
|
+
const configPath = join39(homedir24(), ".snow", "theme.json");
|
|
553975
|
+
if (!existsSync36(configPath)) {
|
|
553815
553976
|
return defaultCustomColors;
|
|
553816
553977
|
}
|
|
553817
553978
|
try {
|
|
@@ -557266,7 +557427,7 @@ var init_runUpdate = __esm({
|
|
|
557266
557427
|
});
|
|
557267
557428
|
|
|
557268
557429
|
// dist/ui/pages/configScreen/types.js
|
|
557269
|
-
var GROUP_FIELDS, isGroupField, MAX_VISIBLE_FIELDS, focusEventTokenRegex, isFocusEventInput, stripFocusArtifacts, SELECT_FIELDS, isSelectField;
|
|
557430
|
+
var GROUP_FIELDS, isGroupField, MAX_VISIBLE_FIELDS, focusEventTokenRegex, isFocusEventInput, stripFocusArtifacts, SELECT_FIELDS, isSelectField, NUMERIC_FIELDS;
|
|
557270
557431
|
var init_types8 = __esm({
|
|
557271
557432
|
"dist/ui/pages/configScreen/types.js"() {
|
|
557272
557433
|
"use strict";
|
|
@@ -557326,6 +557487,15 @@ var init_types8 = __esm({
|
|
|
557326
557487
|
"chatReasoningEffort"
|
|
557327
557488
|
];
|
|
557328
557489
|
isSelectField = (field) => SELECT_FIELDS.includes(field);
|
|
557490
|
+
NUMERIC_FIELDS = [
|
|
557491
|
+
"maxContextTokens",
|
|
557492
|
+
"maxTokens",
|
|
557493
|
+
"streamIdleTimeoutSec",
|
|
557494
|
+
"toolResultTokenLimit",
|
|
557495
|
+
"thinkingBudgetTokens",
|
|
557496
|
+
"autoCompressThreshold",
|
|
557497
|
+
"maxRetries"
|
|
557498
|
+
];
|
|
557329
557499
|
}
|
|
557330
557500
|
});
|
|
557331
557501
|
|
|
@@ -557413,7 +557583,8 @@ async function fetchAvailableModels(overrideConfig) {
|
|
|
557413
557583
|
if (!config3.baseUrl) {
|
|
557414
557584
|
throw new Error("Base URL not configured. Please configure API settings first.");
|
|
557415
557585
|
}
|
|
557416
|
-
const
|
|
557586
|
+
const rawCustomHeaders = overrideConfig ? getCustomHeadersForConfig(config3) : getCustomHeaders();
|
|
557587
|
+
const customHeaders = await resolveCustomHeaderPlaceholders(rawCustomHeaders);
|
|
557417
557588
|
try {
|
|
557418
557589
|
let models;
|
|
557419
557590
|
const defaultOpenAiBaseUrl = "https://api.openai.com/v1";
|
|
@@ -557461,6 +557632,7 @@ var init_models2 = __esm({
|
|
|
557461
557632
|
"dist/api/models.js"() {
|
|
557462
557633
|
"use strict";
|
|
557463
557634
|
init_apiConfig();
|
|
557635
|
+
init_customHeaders();
|
|
557464
557636
|
init_proxyUtils();
|
|
557465
557637
|
init_endpointResolver();
|
|
557466
557638
|
}
|
|
@@ -558407,14 +558579,16 @@ function useConfigInput(state, callbacks) {
|
|
|
558407
558579
|
setStreamIdleTimeoutSec,
|
|
558408
558580
|
toolResultTokenLimit,
|
|
558409
558581
|
setToolResultTokenLimit,
|
|
558582
|
+
maxRetries,
|
|
558583
|
+
setMaxRetries,
|
|
558410
558584
|
thinkingBudgetTokens,
|
|
558411
558585
|
setThinkingBudgetTokens,
|
|
558412
558586
|
autoCompressThreshold,
|
|
558413
558587
|
setAutoCompressThreshold,
|
|
558414
558588
|
setAdvancedModel,
|
|
558415
558589
|
setBasicModel,
|
|
558416
|
-
supportsVision,
|
|
558417
558590
|
setSupportsVision,
|
|
558591
|
+
supportsVision,
|
|
558418
558592
|
setVisionModel,
|
|
558419
558593
|
visionConfigMode,
|
|
558420
558594
|
setVisionConfigMode,
|
|
@@ -558551,7 +558725,7 @@ function useConfigInput(state, callbacks) {
|
|
|
558551
558725
|
}
|
|
558552
558726
|
return;
|
|
558553
558727
|
}
|
|
558554
|
-
if (currentField
|
|
558728
|
+
if (NUMERIC_FIELDS.includes(currentField)) {
|
|
558555
558729
|
handleNumericInput(input2, key);
|
|
558556
558730
|
return;
|
|
558557
558731
|
}
|
|
@@ -558621,6 +558795,12 @@ function useConfigInput(state, callbacks) {
|
|
|
558621
558795
|
min: 20,
|
|
558622
558796
|
max: 80
|
|
558623
558797
|
},
|
|
558798
|
+
maxRetries: {
|
|
558799
|
+
get: () => maxRetries,
|
|
558800
|
+
set: setMaxRetries,
|
|
558801
|
+
min: 0,
|
|
558802
|
+
max: Infinity
|
|
558803
|
+
},
|
|
558624
558804
|
thinkingBudgetTokens: {
|
|
558625
558805
|
get: () => thinkingBudgetTokens,
|
|
558626
558806
|
set: setThinkingBudgetTokens,
|
|
@@ -558719,7 +558899,7 @@ function useConfigInput(state, callbacks) {
|
|
|
558719
558899
|
setIsEditing(false);
|
|
558720
558900
|
} else if (currentField === "anthropicCacheTTL" || currentField === "anthropicSpeed" || currentField === "thinkingMode" || currentField === "thinkingEffort" || currentField === "geminiThinkingLevel" || currentField === "responsesReasoningEffort" || currentField === "responsesVerbosity" || currentField === "chatReasoningEffort") {
|
|
558721
558901
|
setIsEditing(true);
|
|
558722
|
-
} else if (currentField
|
|
558902
|
+
} else if (NUMERIC_FIELDS.includes(currentField)) {
|
|
558723
558903
|
setIsEditing(true);
|
|
558724
558904
|
} else if (currentField === "advancedModel" || currentField === "basicModel" || currentField === "visionModel") {
|
|
558725
558905
|
loadModels().then(() => {
|
|
@@ -563323,8 +563503,8 @@ __export(SystemPromptConfigScreen_exports, {
|
|
|
563323
563503
|
default: () => SystemPromptConfigScreen
|
|
563324
563504
|
});
|
|
563325
563505
|
import { spawn as spawn12, execSync as execSync6 } from "child_process";
|
|
563326
|
-
import { writeFileSync as writeFileSync20, readFileSync as readFileSync29, existsSync as
|
|
563327
|
-
import { join as
|
|
563506
|
+
import { writeFileSync as writeFileSync20, readFileSync as readFileSync29, existsSync as existsSync37, unlinkSync as unlinkSync6 } from "fs";
|
|
563507
|
+
import { join as join40 } from "path";
|
|
563328
563508
|
import { platform as platform4, tmpdir as tmpdir4 } from "os";
|
|
563329
563509
|
function checkCommandExists2(command) {
|
|
563330
563510
|
if (platform4() === "win32") {
|
|
@@ -563457,7 +563637,7 @@ function SystemPromptConfigScreen({ onBack }) {
|
|
|
563457
563637
|
setError(t.systemPromptConfig.editorNotFound);
|
|
563458
563638
|
return;
|
|
563459
563639
|
}
|
|
563460
|
-
const tempFile =
|
|
563640
|
+
const tempFile = join40(tmpdir4(), `snow-prompt-${Date.now()}.txt`);
|
|
563461
563641
|
writeFileSync20(tempFile, prompt.content || "", "utf8");
|
|
563462
563642
|
if (process.stdin.isTTY) {
|
|
563463
563643
|
process.stdin.pause();
|
|
@@ -563470,7 +563650,7 @@ function SystemPromptConfigScreen({ onBack }) {
|
|
|
563470
563650
|
process.stdin.resume();
|
|
563471
563651
|
process.stdin.setRawMode(true);
|
|
563472
563652
|
}
|
|
563473
|
-
if (
|
|
563653
|
+
if (existsSync37(tempFile)) {
|
|
563474
563654
|
try {
|
|
563475
563655
|
const editedContent = readFileSync29(tempFile, "utf8");
|
|
563476
563656
|
const newConfig = {
|
|
@@ -563496,7 +563676,7 @@ function SystemPromptConfigScreen({ onBack }) {
|
|
|
563496
563676
|
process.stdin.setRawMode(true);
|
|
563497
563677
|
}
|
|
563498
563678
|
setError(`${t.systemPromptConfig.editorOpenFailed}: ${error43.message}`);
|
|
563499
|
-
if (
|
|
563679
|
+
if (existsSync37(tempFile)) {
|
|
563500
563680
|
unlinkSync6(tempFile);
|
|
563501
563681
|
}
|
|
563502
563682
|
});
|
|
@@ -564320,6 +564500,11 @@ function CustomHeadersScreen({ onBack }) {
|
|
|
564320
564500
|
Box_default,
|
|
564321
564501
|
{ marginTop: 1 },
|
|
564322
564502
|
import_react82.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, t.customHeaders.editingHint)
|
|
564503
|
+
),
|
|
564504
|
+
import_react82.default.createElement(
|
|
564505
|
+
Box_default,
|
|
564506
|
+
{ marginTop: 1 },
|
|
564507
|
+
import_react82.default.createElement(Text, { color: theme14.colors.menuInfo, dimColor: true }, t.customHeaders.placeholderHint)
|
|
564323
564508
|
)
|
|
564324
564509
|
);
|
|
564325
564510
|
}
|
|
@@ -564365,6 +564550,11 @@ function CustomHeadersScreen({ onBack }) {
|
|
|
564365
564550
|
Box_default,
|
|
564366
564551
|
{ marginTop: 1 },
|
|
564367
564552
|
import_react82.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, t.customHeaders.headerNavigationHint)
|
|
564553
|
+
),
|
|
564554
|
+
import_react82.default.createElement(
|
|
564555
|
+
Box_default,
|
|
564556
|
+
{ marginTop: 1 },
|
|
564557
|
+
import_react82.default.createElement(Text, { color: theme14.colors.menuInfo, dimColor: true }, t.customHeaders.placeholderHint)
|
|
564368
564558
|
)
|
|
564369
564559
|
) : import_react82.default.createElement(
|
|
564370
564560
|
import_react82.default.Fragment,
|
|
@@ -564815,7 +565005,7 @@ var require_core6 = __commonJS({
|
|
|
564815
565005
|
return match && match.index === 0;
|
|
564816
565006
|
}
|
|
564817
565007
|
var BACKREF_RE = /\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;
|
|
564818
|
-
function
|
|
565008
|
+
function join50(regexps, separator = "|") {
|
|
564819
565009
|
let numCaptures = 0;
|
|
564820
565010
|
return regexps.map((regex2) => {
|
|
564821
565011
|
numCaptures += 1;
|
|
@@ -565119,7 +565309,7 @@ var require_core6 = __commonJS({
|
|
|
565119
565309
|
this.exec = () => null;
|
|
565120
565310
|
}
|
|
565121
565311
|
const terminators = this.regexes.map((el) => el[1]);
|
|
565122
|
-
this.matcherRe = langRe(
|
|
565312
|
+
this.matcherRe = langRe(join50(terminators), true);
|
|
565123
565313
|
this.lastIndex = 0;
|
|
565124
565314
|
}
|
|
565125
565315
|
/** @param {string} s */
|
|
@@ -589490,7 +589680,7 @@ var require_nsis = __commonJS({
|
|
|
589490
589680
|
className: "meta",
|
|
589491
589681
|
begin: /\$(\\[nrt]|\$)/
|
|
589492
589682
|
};
|
|
589493
|
-
const
|
|
589683
|
+
const PLUGINS2 = {
|
|
589494
589684
|
// plug::ins
|
|
589495
589685
|
className: "class",
|
|
589496
589686
|
begin: /\w+::\w+/
|
|
@@ -589548,7 +589738,7 @@ var require_nsis = __commonJS({
|
|
|
589548
589738
|
VARIABLES,
|
|
589549
589739
|
LANGUAGES,
|
|
589550
589740
|
PARAMETERS,
|
|
589551
|
-
|
|
589741
|
+
PLUGINS2,
|
|
589552
589742
|
hljs.NUMBER_MODE
|
|
589553
589743
|
]
|
|
589554
589744
|
};
|
|
@@ -643020,8 +643210,8 @@ __export(MCPConfigScreen_exports, {
|
|
|
643020
643210
|
default: () => MCPConfigScreen
|
|
643021
643211
|
});
|
|
643022
643212
|
import { spawn as spawn13, execSync as execSync7 } from "child_process";
|
|
643023
|
-
import { writeFileSync as writeFileSync21, readFileSync as readFileSync30, existsSync as
|
|
643024
|
-
import { join as
|
|
643213
|
+
import { writeFileSync as writeFileSync21, readFileSync as readFileSync30, existsSync as existsSync38, mkdirSync as mkdirSync20, unlinkSync as unlinkSync7 } from "fs";
|
|
643214
|
+
import { join as join41 } from "path";
|
|
643025
643215
|
import { platform as platform5 } from "os";
|
|
643026
643216
|
function checkCommandExists3(command) {
|
|
643027
643217
|
if (platform5() === "win32") {
|
|
@@ -643073,9 +643263,9 @@ function getSystemEditor2() {
|
|
|
643073
643263
|
}
|
|
643074
643264
|
function getConfigFilePath(scope) {
|
|
643075
643265
|
if (scope === "project") {
|
|
643076
|
-
return
|
|
643266
|
+
return join41(process.cwd(), ".snow", "mcp-config.draft.json");
|
|
643077
643267
|
}
|
|
643078
|
-
return
|
|
643268
|
+
return join41(process.cwd(), ".snow", "mcp-config.global.draft.json");
|
|
643079
643269
|
}
|
|
643080
643270
|
function getConfigByScope(scope) {
|
|
643081
643271
|
return scope === "project" ? getProjectMCPConfig() : getGlobalMCPConfig();
|
|
@@ -643084,8 +643274,8 @@ function openEditorForScope(scope, onBack, i18nMessages) {
|
|
|
643084
643274
|
const configFilePath = getConfigFilePath(scope);
|
|
643085
643275
|
const config3 = getConfigByScope(scope);
|
|
643086
643276
|
const originalContent = JSON.stringify(config3, null, 2);
|
|
643087
|
-
const dir =
|
|
643088
|
-
if (!
|
|
643277
|
+
const dir = join41(configFilePath, "..");
|
|
643278
|
+
if (!existsSync38(dir)) {
|
|
643089
643279
|
mkdirSync20(dir, { recursive: true });
|
|
643090
643280
|
}
|
|
643091
643281
|
writeFileSync21(configFilePath, originalContent, "utf8");
|
|
@@ -643126,7 +643316,7 @@ function openEditorForScope(scope, onBack, i18nMessages) {
|
|
|
643126
643316
|
process.stdin.resume();
|
|
643127
643317
|
process.stdin.setRawMode(true);
|
|
643128
643318
|
}
|
|
643129
|
-
if (
|
|
643319
|
+
if (existsSync38(configFilePath)) {
|
|
643130
643320
|
try {
|
|
643131
643321
|
const editedContent = readFileSync30(configFilePath, "utf8");
|
|
643132
643322
|
const parsedConfig = JSON.parse(editedContent);
|
|
@@ -647222,7 +647412,7 @@ var init_historyMenu = __esm({
|
|
|
647222
647412
|
import { spawn as spawn14 } from "child_process";
|
|
647223
647413
|
import { promises as fs53 } from "fs";
|
|
647224
647414
|
import { tmpdir as tmpdir5 } from "os";
|
|
647225
|
-
import { join as
|
|
647415
|
+
import { join as join42 } from "path";
|
|
647226
647416
|
function pauseStdinForExternalEditor() {
|
|
647227
647417
|
if (!process.stdin.isTTY) {
|
|
647228
647418
|
return () => {
|
|
@@ -647257,7 +647447,7 @@ async function editTextWithNotepad(initialText) {
|
|
|
647257
647447
|
if (process.platform !== "win32") {
|
|
647258
647448
|
return initialText;
|
|
647259
647449
|
}
|
|
647260
|
-
const tempFile =
|
|
647450
|
+
const tempFile = join42(tmpdir5(), `snow-chat-${Date.now()}-${Math.random().toString(16).slice(2)}.txt`);
|
|
647261
647451
|
await fs53.writeFile(tempFile, addUtf8Bom(initialText), "utf8");
|
|
647262
647452
|
const restoreStdin = pauseStdinForExternalEditor();
|
|
647263
647453
|
try {
|
|
@@ -649820,12 +650010,12 @@ var init_fileSearchAgent = __esm({
|
|
|
649820
650010
|
var _a20, _b14;
|
|
649821
650011
|
try {
|
|
649822
650012
|
const config3 = getSnowConfig();
|
|
649823
|
-
const
|
|
649824
|
-
const
|
|
649825
|
-
if (
|
|
649826
|
-
this.modelName = advancedModel;
|
|
649827
|
-
} else if (basicModel) {
|
|
650013
|
+
const basicModel = (_a20 = config3.basicModel) == null ? void 0 : _a20.trim();
|
|
650014
|
+
const advancedModel = (_b14 = config3.advancedModel) == null ? void 0 : _b14.trim();
|
|
650015
|
+
if (basicModel) {
|
|
649828
650016
|
this.modelName = basicModel;
|
|
650017
|
+
} else if (advancedModel) {
|
|
650018
|
+
this.modelName = advancedModel;
|
|
649829
650019
|
} else {
|
|
649830
650020
|
return false;
|
|
649831
650021
|
}
|
|
@@ -652997,9 +653187,9 @@ var init_gitBranch = __esm({
|
|
|
652997
653187
|
});
|
|
652998
653188
|
|
|
652999
653189
|
// dist/ui/components/common/statusline/useStatusLineHooks.js
|
|
653000
|
-
import { existsSync as
|
|
653001
|
-
import { extname as
|
|
653002
|
-
import { pathToFileURL as
|
|
653190
|
+
import { existsSync as existsSync39, readdirSync as readdirSync8 } from "node:fs";
|
|
653191
|
+
import { extname as extname10, join as join43 } from "node:path";
|
|
653192
|
+
import { pathToFileURL as pathToFileURL3 } from "node:url";
|
|
653003
653193
|
function isStatusLineHookDefinition(candidate) {
|
|
653004
653194
|
return typeof candidate === "object" && candidate !== null && typeof candidate.id === "string" && typeof candidate.getItems === "function";
|
|
653005
653195
|
}
|
|
@@ -653042,12 +653232,12 @@ function normalizeStatusLineHookExports(moduleExports, modulePath) {
|
|
|
653042
653232
|
});
|
|
653043
653233
|
}
|
|
653044
653234
|
async function loadExternalStatusLineHooks() {
|
|
653045
|
-
if (!
|
|
653235
|
+
if (!existsSync39(STATUSLINE_HOOKS_DIR)) {
|
|
653046
653236
|
return [];
|
|
653047
653237
|
}
|
|
653048
653238
|
let entries;
|
|
653049
653239
|
try {
|
|
653050
|
-
entries =
|
|
653240
|
+
entries = readdirSync8(STATUSLINE_HOOKS_DIR, { withFileTypes: true });
|
|
653051
653241
|
} catch (error42) {
|
|
653052
653242
|
logger.warn("Failed to read status line hook directory", {
|
|
653053
653243
|
directory: STATUSLINE_HOOKS_DIR,
|
|
@@ -653055,12 +653245,12 @@ async function loadExternalStatusLineHooks() {
|
|
|
653055
653245
|
});
|
|
653056
653246
|
return [];
|
|
653057
653247
|
}
|
|
653058
|
-
const moduleFiles = entries.filter((entry) => entry.isFile() && SUPPORTED_STATUSLINE_HOOK_EXTENSIONS.has(
|
|
653248
|
+
const moduleFiles = entries.filter((entry) => entry.isFile() && SUPPORTED_STATUSLINE_HOOK_EXTENSIONS.has(extname10(entry.name))).sort((left, right) => left.name.localeCompare(right.name));
|
|
653059
653249
|
const hooks = [];
|
|
653060
653250
|
for (const moduleFile of moduleFiles) {
|
|
653061
|
-
const modulePath =
|
|
653251
|
+
const modulePath = join43(STATUSLINE_HOOKS_DIR, moduleFile.name);
|
|
653062
653252
|
try {
|
|
653063
|
-
const moduleUrl =
|
|
653253
|
+
const moduleUrl = pathToFileURL3(modulePath).href;
|
|
653064
653254
|
const importedModule = await import(moduleUrl);
|
|
653065
653255
|
hooks.push(...normalizeStatusLineHookExports(importedModule, modulePath));
|
|
653066
653256
|
} catch (error42) {
|
|
@@ -653391,6 +653581,7 @@ function buildPrivacyState(workingDirectory = process.cwd()) {
|
|
|
653391
653581
|
enabled: enabled === true,
|
|
653392
653582
|
mode,
|
|
653393
653583
|
apiUrlConfigured: Boolean(apiUrl),
|
|
653584
|
+
apiUrl: mode === "api" ? apiUrl || void 0 : void 0,
|
|
653394
653585
|
model: model || void 0,
|
|
653395
653586
|
toolResultTools: [...toolResultTools]
|
|
653396
653587
|
};
|
|
@@ -657611,24 +657802,24 @@ var init_useSessionSave = __esm({
|
|
|
657611
657802
|
});
|
|
657612
657803
|
|
|
657613
657804
|
// dist/utils/config/permissionsConfig.js
|
|
657614
|
-
import { join as
|
|
657615
|
-
import { readFileSync as readFileSync31, writeFileSync as writeFileSync22, existsSync as
|
|
657805
|
+
import { join as join44 } from "path";
|
|
657806
|
+
import { readFileSync as readFileSync31, writeFileSync as writeFileSync22, existsSync as existsSync40, mkdirSync as mkdirSync21 } from "fs";
|
|
657616
657807
|
function getSnowDirPath(workingDirectory) {
|
|
657617
|
-
return
|
|
657808
|
+
return join44(workingDirectory, SNOW_DIR4);
|
|
657618
657809
|
}
|
|
657619
657810
|
function getPermissionsFilePath(workingDirectory) {
|
|
657620
|
-
return
|
|
657811
|
+
return join44(getSnowDirPath(workingDirectory), PERMISSIONS_FILE);
|
|
657621
657812
|
}
|
|
657622
657813
|
function ensureConfigDirectory7(workingDirectory) {
|
|
657623
657814
|
const snowDir = getSnowDirPath(workingDirectory);
|
|
657624
|
-
if (!
|
|
657815
|
+
if (!existsSync40(snowDir)) {
|
|
657625
657816
|
mkdirSync21(snowDir, { recursive: true });
|
|
657626
657817
|
}
|
|
657627
657818
|
}
|
|
657628
657819
|
function loadPermissionsConfig(workingDirectory) {
|
|
657629
657820
|
ensureConfigDirectory7(workingDirectory);
|
|
657630
657821
|
const configPath = getPermissionsFilePath(workingDirectory);
|
|
657631
|
-
if (!
|
|
657822
|
+
if (!existsSync40(configPath)) {
|
|
657632
657823
|
return { ...DEFAULT_CONFIG6 };
|
|
657633
657824
|
}
|
|
657634
657825
|
try {
|
|
@@ -668952,10 +669143,10 @@ var init_pixel_editor = __esm({
|
|
|
668952
669143
|
|
|
668953
669144
|
// dist/ui/pages/PixelEditorScreen.js
|
|
668954
669145
|
import { homedir as homedir25 } from "os";
|
|
668955
|
-
import { join as
|
|
668956
|
-
import { existsSync as
|
|
669146
|
+
import { join as join45 } from "path";
|
|
669147
|
+
import { existsSync as existsSync41, mkdirSync as mkdirSync22, readdirSync as readdirSync9, readFileSync as readFileSync32, writeFileSync as writeFileSync23, unlinkSync as unlinkSync8, statSync } from "fs";
|
|
668957
669148
|
function ensureDrawDir() {
|
|
668958
|
-
if (!
|
|
669149
|
+
if (!existsSync41(DRAW_DIR)) {
|
|
668959
669150
|
mkdirSync22(DRAW_DIR, { recursive: true });
|
|
668960
669151
|
}
|
|
668961
669152
|
}
|
|
@@ -669005,8 +669196,8 @@ function PixelEditorScreen({ onBack }) {
|
|
|
669005
669196
|
const loadDrawings = (0, import_react175.useCallback)(() => {
|
|
669006
669197
|
ensureDrawDir();
|
|
669007
669198
|
try {
|
|
669008
|
-
const files =
|
|
669009
|
-
const filePath =
|
|
669199
|
+
const files = readdirSync9(DRAW_DIR).filter((f) => f.endsWith(".json")).map((f) => {
|
|
669200
|
+
const filePath = join45(DRAW_DIR, f);
|
|
669010
669201
|
try {
|
|
669011
669202
|
const content = readFileSync32(filePath, "utf8");
|
|
669012
669203
|
const data = JSON.parse(content);
|
|
@@ -669028,7 +669219,7 @@ function PixelEditorScreen({ onBack }) {
|
|
|
669028
669219
|
(0, import_react175.useEffect)(() => {
|
|
669029
669220
|
if (view === "manager") {
|
|
669030
669221
|
loadDrawings();
|
|
669031
|
-
if (
|
|
669222
|
+
if (existsSync41(EXIT_IMAGE_PATH)) {
|
|
669032
669223
|
try {
|
|
669033
669224
|
const content = readFileSync32(EXIT_IMAGE_PATH, "utf8");
|
|
669034
669225
|
const data = JSON.parse(content);
|
|
@@ -669061,7 +669252,7 @@ function PixelEditorScreen({ onBack }) {
|
|
|
669061
669252
|
var _a20, _b14;
|
|
669062
669253
|
ensureDrawDir();
|
|
669063
669254
|
const safeName = sanitizeFileName(name);
|
|
669064
|
-
const filePath =
|
|
669255
|
+
const filePath = join45(DRAW_DIR, `${safeName}.json`);
|
|
669065
669256
|
const data = {
|
|
669066
669257
|
name,
|
|
669067
669258
|
width: ((_a20 = grid[0]) == null ? void 0 : _a20.length) ?? 32,
|
|
@@ -669087,8 +669278,8 @@ function PixelEditorScreen({ onBack }) {
|
|
|
669087
669278
|
}
|
|
669088
669279
|
}, [exitImageEnabled, exitImageName]);
|
|
669089
669280
|
const handleLoad = (0, import_react175.useCallback)((fileName) => {
|
|
669090
|
-
const filePath =
|
|
669091
|
-
if (!
|
|
669281
|
+
const filePath = join45(DRAW_DIR, fileName);
|
|
669282
|
+
if (!existsSync41(filePath))
|
|
669092
669283
|
return void 0;
|
|
669093
669284
|
try {
|
|
669094
669285
|
const content = readFileSync32(filePath, "utf8");
|
|
@@ -669102,7 +669293,7 @@ function PixelEditorScreen({ onBack }) {
|
|
|
669102
669293
|
}, []);
|
|
669103
669294
|
const deleteSelected = (0, import_react175.useCallback)(() => {
|
|
669104
669295
|
for (const name of selectedNames) {
|
|
669105
|
-
const filePath =
|
|
669296
|
+
const filePath = join45(DRAW_DIR, name);
|
|
669106
669297
|
try {
|
|
669107
669298
|
unlinkSync8(filePath);
|
|
669108
669299
|
} catch {
|
|
@@ -669342,8 +669533,8 @@ var init_PixelEditorScreen = __esm({
|
|
|
669342
669533
|
init_i18n();
|
|
669343
669534
|
await init_useTerminalTitle();
|
|
669344
669535
|
init_useGlobalNavigation();
|
|
669345
|
-
DRAW_DIR =
|
|
669346
|
-
EXIT_IMAGE_PATH =
|
|
669536
|
+
DRAW_DIR = join45(homedir25(), ".snow", "draw");
|
|
669537
|
+
EXIT_IMAGE_PATH = join45(homedir25(), ".snow", "exit-image.json");
|
|
669347
669538
|
}
|
|
669348
669539
|
});
|
|
669349
669540
|
|
|
@@ -673453,7 +673644,7 @@ __export(ExitScreen_exports, {
|
|
|
673453
673644
|
});
|
|
673454
673645
|
import { readFile as readFile4 } from "fs/promises";
|
|
673455
673646
|
import { homedir as homedir26 } from "os";
|
|
673456
|
-
import { join as
|
|
673647
|
+
import { join as join46 } from "path";
|
|
673457
673648
|
function dotLine(width) {
|
|
673458
673649
|
const count = Math.max(0, Math.floor(width / 3));
|
|
673459
673650
|
return Array.from({ length: count }, () => "\xB7").join(" ");
|
|
@@ -673591,7 +673782,7 @@ var init_ExitScreen = __esm({
|
|
|
673591
673782
|
init_processManager();
|
|
673592
673783
|
init_sessionManager();
|
|
673593
673784
|
await init_useTerminalTitle();
|
|
673594
|
-
EXIT_IMAGE_PATH2 =
|
|
673785
|
+
EXIT_IMAGE_PATH2 = join46(homedir26(), ".snow", "exit-image.json");
|
|
673595
673786
|
BLOCK_CHAR2 = "\u2580";
|
|
673596
673787
|
}
|
|
673597
673788
|
});
|
|
@@ -673836,8 +674027,8 @@ __export(sseDaemon_exports, {
|
|
|
673836
674027
|
stopDaemon: () => stopDaemon
|
|
673837
674028
|
});
|
|
673838
674029
|
import { spawn as spawn15, execSync as execSync9 } from "child_process";
|
|
673839
|
-
import { existsSync as
|
|
673840
|
-
import { join as
|
|
674030
|
+
import { existsSync as existsSync42, readFileSync as readFileSync33, writeFileSync as writeFileSync24, unlinkSync as unlinkSync9, readdirSync as readdirSync10, mkdirSync as mkdirSync23 } from "fs";
|
|
674031
|
+
import { join as join47 } from "path";
|
|
673841
674032
|
import { homedir as homedir27 } from "os";
|
|
673842
674033
|
function getTranslation() {
|
|
673843
674034
|
const currentLanguage = getCurrentLanguage();
|
|
@@ -673850,15 +674041,15 @@ function formatMessage2(template2, params) {
|
|
|
673850
674041
|
});
|
|
673851
674042
|
}
|
|
673852
674043
|
function getPidFilePath(port) {
|
|
673853
|
-
return
|
|
674044
|
+
return join47(DAEMON_DIR, `port-${port}.pid`);
|
|
673854
674045
|
}
|
|
673855
674046
|
function getLogFilePath(port) {
|
|
673856
|
-
return
|
|
674047
|
+
return join47(LOG_DIR, `port-${port}.log`);
|
|
673857
674048
|
}
|
|
673858
674049
|
function startDaemon(port = 3e3, workDir, timeout2 = 3e5) {
|
|
673859
674050
|
const pidFile = getPidFilePath(port);
|
|
673860
674051
|
const logFile = getLogFilePath(port);
|
|
673861
|
-
if (
|
|
674052
|
+
if (existsSync42(pidFile)) {
|
|
673862
674053
|
try {
|
|
673863
674054
|
const daemonInfo2 = JSON.parse(readFileSync33(pidFile, "utf-8"));
|
|
673864
674055
|
const { pid } = daemonInfo2;
|
|
@@ -673967,7 +674158,7 @@ function stopDaemon(target) {
|
|
|
673967
674158
|
target = 3e3;
|
|
673968
674159
|
}
|
|
673969
674160
|
const pidFile = getPidFilePath(target);
|
|
673970
|
-
const isPort = target <= 65535 &&
|
|
674161
|
+
const isPort = target <= 65535 && existsSync42(pidFile);
|
|
673971
674162
|
if (isPort) {
|
|
673972
674163
|
try {
|
|
673973
674164
|
const daemonInfo = JSON.parse(readFileSync33(pidFile, "utf-8"));
|
|
@@ -674039,7 +674230,7 @@ function killProcess(pid, pidFile) {
|
|
|
674039
674230
|
}
|
|
674040
674231
|
function getAllPidFiles() {
|
|
674041
674232
|
try {
|
|
674042
|
-
return
|
|
674233
|
+
return readdirSync10(DAEMON_DIR).filter((file2) => file2.endsWith(".pid")).map((file2) => join47(DAEMON_DIR, file2));
|
|
674043
674234
|
} catch {
|
|
674044
674235
|
return [];
|
|
674045
674236
|
}
|
|
@@ -674103,13 +674294,13 @@ var init_sseDaemon = __esm({
|
|
|
674103
674294
|
"use strict";
|
|
674104
674295
|
init_languageConfig();
|
|
674105
674296
|
init_i18n();
|
|
674106
|
-
SNOW_DIR5 =
|
|
674107
|
-
DAEMON_DIR =
|
|
674108
|
-
LOG_DIR =
|
|
674109
|
-
if (!
|
|
674297
|
+
SNOW_DIR5 = join47(homedir27(), ".snow");
|
|
674298
|
+
DAEMON_DIR = join47(SNOW_DIR5, "sse-daemons");
|
|
674299
|
+
LOG_DIR = join47(SNOW_DIR5, "sse-logs");
|
|
674300
|
+
if (!existsSync42(DAEMON_DIR)) {
|
|
674110
674301
|
mkdirSync23(DAEMON_DIR, { recursive: true });
|
|
674111
674302
|
}
|
|
674112
|
-
if (!
|
|
674303
|
+
if (!existsSync42(LOG_DIR)) {
|
|
674113
674304
|
mkdirSync23(LOG_DIR, { recursive: true });
|
|
674114
674305
|
}
|
|
674115
674306
|
}
|
|
@@ -675300,8 +675491,8 @@ var daemonLogger_exports = {};
|
|
|
675300
675491
|
__export(daemonLogger_exports, {
|
|
675301
675492
|
DaemonLogger: () => DaemonLogger
|
|
675302
675493
|
});
|
|
675303
|
-
import { existsSync as
|
|
675304
|
-
import { join as
|
|
675494
|
+
import { existsSync as existsSync43, statSync as statSync2, renameSync as renameSync2, writeFileSync as writeFileSync25, appendFileSync as appendFileSync2, mkdirSync as mkdirSync24 } from "fs";
|
|
675495
|
+
import { join as join48, dirname as dirname12, basename as basename8 } from "path";
|
|
675305
675496
|
var DaemonLogger;
|
|
675306
675497
|
var init_daemonLogger = __esm({
|
|
675307
675498
|
"dist/utils/sse/daemonLogger.js"() {
|
|
@@ -675336,11 +675527,11 @@ var init_daemonLogger = __esm({
|
|
|
675336
675527
|
*/
|
|
675337
675528
|
ensureLogDirectory() {
|
|
675338
675529
|
const logDir = dirname12(this.logFilePath);
|
|
675339
|
-
const archiveDir =
|
|
675340
|
-
if (!
|
|
675530
|
+
const archiveDir = join48(logDir, "archive");
|
|
675531
|
+
if (!existsSync43(logDir)) {
|
|
675341
675532
|
mkdirSync24(logDir, { recursive: true });
|
|
675342
675533
|
}
|
|
675343
|
-
if (!
|
|
675534
|
+
if (!existsSync43(archiveDir)) {
|
|
675344
675535
|
mkdirSync24(archiveDir, { recursive: true });
|
|
675345
675536
|
}
|
|
675346
675537
|
}
|
|
@@ -675374,7 +675565,7 @@ var init_daemonLogger = __esm({
|
|
|
675374
675565
|
*/
|
|
675375
675566
|
rotateIfNeeded() {
|
|
675376
675567
|
try {
|
|
675377
|
-
if (!
|
|
675568
|
+
if (!existsSync43(this.logFilePath)) {
|
|
675378
675569
|
return;
|
|
675379
675570
|
}
|
|
675380
675571
|
const stats = statSync2(this.logFilePath);
|
|
@@ -675394,13 +675585,13 @@ var init_daemonLogger = __esm({
|
|
|
675394
675585
|
const logDir = dirname12(this.logFilePath);
|
|
675395
675586
|
const logFileName = basename8(this.logFilePath);
|
|
675396
675587
|
const dateDir = this.getDateDirectory();
|
|
675397
|
-
const archiveDateDir =
|
|
675398
|
-
if (!
|
|
675588
|
+
const archiveDateDir = join48(logDir, "archive", dateDir);
|
|
675589
|
+
if (!existsSync43(archiveDateDir)) {
|
|
675399
675590
|
mkdirSync24(archiveDateDir, { recursive: true });
|
|
675400
675591
|
}
|
|
675401
675592
|
const timestamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
|
|
675402
675593
|
const archiveFileName = `${logFileName}.${timestamp}`;
|
|
675403
|
-
const archiveFilePath =
|
|
675594
|
+
const archiveFilePath = join48(archiveDateDir, archiveFileName);
|
|
675404
675595
|
try {
|
|
675405
675596
|
renameSync2(this.logFilePath, archiveFilePath);
|
|
675406
675597
|
this.cleanupOldArchives(archiveDateDir, logFileName);
|
|
@@ -675416,11 +675607,11 @@ var init_daemonLogger = __esm({
|
|
|
675416
675607
|
*/
|
|
675417
675608
|
cleanupOldArchives(dateDir, baseName) {
|
|
675418
675609
|
try {
|
|
675419
|
-
const { readdirSync:
|
|
675420
|
-
const files =
|
|
675610
|
+
const { readdirSync: readdirSync11 } = __require("fs");
|
|
675611
|
+
const files = readdirSync11(dateDir).filter((f) => f.startsWith(baseName)).map((f) => ({
|
|
675421
675612
|
name: f,
|
|
675422
|
-
path:
|
|
675423
|
-
stat: statSync2(
|
|
675613
|
+
path: join48(dateDir, f),
|
|
675614
|
+
stat: statSync2(join48(dateDir, f))
|
|
675424
675615
|
})).sort((a, b) => b.stat.mtime.getTime() - a.stat.mtime.getTime());
|
|
675425
675616
|
if (files.length > this.maxBackupFiles) {
|
|
675426
675617
|
const filesToDelete = files.slice(this.maxBackupFiles);
|
|
@@ -688741,7 +688932,7 @@ var require_package4 = __commonJS({
|
|
|
688741
688932
|
"package.json"(exports2, module2) {
|
|
688742
688933
|
module2.exports = {
|
|
688743
688934
|
name: "snow-ai",
|
|
688744
|
-
version: "0.8.
|
|
688935
|
+
version: "0.8.3",
|
|
688745
688936
|
description: "Agentic coding in your terminal",
|
|
688746
688937
|
license: "MIT",
|
|
688747
688938
|
bin: {
|
|
@@ -690969,7 +691160,7 @@ ${heading2(t.summary)}: ${success2(formatTemplate(t.summaryOk, { count: okCount
|
|
|
690969
691160
|
|
|
690970
691161
|
// dist/cli.js
|
|
690971
691162
|
import { readFileSync as readFileSync34 } from "fs";
|
|
690972
|
-
import { join as
|
|
691163
|
+
import { join as join49 } from "path";
|
|
690973
691164
|
import { fileURLToPath as fileURLToPath6 } from "url";
|
|
690974
691165
|
|
|
690975
691166
|
// dist/utils/config/legacyConfigMigration.js
|
|
@@ -691279,7 +691470,7 @@ try {
|
|
|
691279
691470
|
} catch {
|
|
691280
691471
|
}
|
|
691281
691472
|
var __dirname2 = fileURLToPath6(new URL(".", import.meta.url));
|
|
691282
|
-
var packageJson = JSON.parse(readFileSync34(
|
|
691473
|
+
var packageJson = JSON.parse(readFileSync34(join49(__dirname2, "../package.json"), "utf-8"));
|
|
691283
691474
|
var VERSION4 = packageJson.version;
|
|
691284
691475
|
async function loadDependencies() {
|
|
691285
691476
|
await Promise.resolve().then(() => (init_utils5(), utils_exports));
|