@costrict/csc 4.2.19 → 4.2.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +683 -538
- package/dist/services/rawDump/batchWorker.js +16 -9
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -66656,8 +66656,8 @@ function getClientVersion() {
|
|
|
66656
66656
|
if (cached)
|
|
66657
66657
|
return cached;
|
|
66658
66658
|
try {
|
|
66659
|
-
if ("4.2.
|
|
66660
|
-
cached = "4.2.
|
|
66659
|
+
if ("4.2.20") {
|
|
66660
|
+
cached = "4.2.20";
|
|
66661
66661
|
return cached;
|
|
66662
66662
|
}
|
|
66663
66663
|
} catch {}
|
|
@@ -140197,6 +140197,59 @@ var init_modelAllowlist = __esm(() => {
|
|
|
140197
140197
|
init_modelStrings();
|
|
140198
140198
|
});
|
|
140199
140199
|
|
|
140200
|
+
// src/services/api/openai/listModels.ts
|
|
140201
|
+
var exports_listModels = {};
|
|
140202
|
+
__export(exports_listModels, {
|
|
140203
|
+
getCachedOpenAIModels: () => getCachedOpenAIModels,
|
|
140204
|
+
fetchOpenAIModels: () => fetchOpenAIModels,
|
|
140205
|
+
clearOpenAIModelsCache: () => clearOpenAIModelsCache
|
|
140206
|
+
});
|
|
140207
|
+
async function fetchOpenAIModels() {
|
|
140208
|
+
if (modelCache && Date.now() - modelCache.timestamp < CACHE_TTL_MS) {
|
|
140209
|
+
return modelCache.models;
|
|
140210
|
+
}
|
|
140211
|
+
const apiKey = process.env.OPENAI_API_KEY;
|
|
140212
|
+
if (!apiKey)
|
|
140213
|
+
return [];
|
|
140214
|
+
const baseURL = process.env.OPENAI_BASE_URL || "https://api.openai.com/v1";
|
|
140215
|
+
const endpoint = `${baseURL.replace(/\/$/, "")}/models`;
|
|
140216
|
+
const controller = new AbortController;
|
|
140217
|
+
const timeout = setTimeout(() => controller.abort(), FETCH_TIMEOUT_MS);
|
|
140218
|
+
try {
|
|
140219
|
+
const response = await fetch(endpoint, {
|
|
140220
|
+
method: "GET",
|
|
140221
|
+
headers: {
|
|
140222
|
+
Authorization: `Bearer ${apiKey}`,
|
|
140223
|
+
Accept: "application/json"
|
|
140224
|
+
},
|
|
140225
|
+
signal: controller.signal
|
|
140226
|
+
});
|
|
140227
|
+
clearTimeout(timeout);
|
|
140228
|
+
if (!response.ok) {
|
|
140229
|
+
throw new Error(`HTTP ${response.status}`);
|
|
140230
|
+
}
|
|
140231
|
+
const data = await response.json();
|
|
140232
|
+
const models = Array.isArray(data.data) ? data.data : [];
|
|
140233
|
+
if (models.length === 0)
|
|
140234
|
+
return [];
|
|
140235
|
+
modelCache = { models, timestamp: Date.now() };
|
|
140236
|
+
return models;
|
|
140237
|
+
} catch {
|
|
140238
|
+
clearTimeout(timeout);
|
|
140239
|
+
return modelCache?.models ?? [];
|
|
140240
|
+
}
|
|
140241
|
+
}
|
|
140242
|
+
function getCachedOpenAIModels() {
|
|
140243
|
+
return modelCache?.models ?? [];
|
|
140244
|
+
}
|
|
140245
|
+
function clearOpenAIModelsCache() {
|
|
140246
|
+
modelCache = null;
|
|
140247
|
+
}
|
|
140248
|
+
var modelCache = null, CACHE_TTL_MS, FETCH_TIMEOUT_MS = 5000;
|
|
140249
|
+
var init_listModels = __esm(() => {
|
|
140250
|
+
CACHE_TTL_MS = 60 * 60 * 1000;
|
|
140251
|
+
});
|
|
140252
|
+
|
|
140200
140253
|
// src/utils/model/model.ts
|
|
140201
140254
|
function getSmallFastModel() {
|
|
140202
140255
|
const provider = getAPIProvider();
|
|
@@ -140247,8 +140300,15 @@ function getDefaultOpusModel() {
|
|
|
140247
140300
|
if (provider === "costrict") {
|
|
140248
140301
|
return process.env.COSTRICT_DEFAULT_OPUS_MODEL || "Auto";
|
|
140249
140302
|
}
|
|
140250
|
-
if (provider === "openai"
|
|
140251
|
-
|
|
140303
|
+
if (provider === "openai") {
|
|
140304
|
+
if (process.env.OPENAI_DEFAULT_OPUS_MODEL) {
|
|
140305
|
+
return process.env.OPENAI_DEFAULT_OPUS_MODEL;
|
|
140306
|
+
}
|
|
140307
|
+
const cached3 = getCachedOpenAIModels();
|
|
140308
|
+
if (cached3.length > 0) {
|
|
140309
|
+
return cached3[0].id;
|
|
140310
|
+
}
|
|
140311
|
+
return "";
|
|
140252
140312
|
}
|
|
140253
140313
|
if (provider === "gemini" && process.env.GEMINI_DEFAULT_OPUS_MODEL) {
|
|
140254
140314
|
return process.env.GEMINI_DEFAULT_OPUS_MODEL;
|
|
@@ -140266,8 +140326,15 @@ function getDefaultSonnetModel() {
|
|
|
140266
140326
|
if (provider === "costrict") {
|
|
140267
140327
|
return process.env.COSTRICT_DEFAULT_SONNET_MODEL || "Auto";
|
|
140268
140328
|
}
|
|
140269
|
-
if (provider === "openai"
|
|
140270
|
-
|
|
140329
|
+
if (provider === "openai") {
|
|
140330
|
+
if (process.env.OPENAI_DEFAULT_SONNET_MODEL) {
|
|
140331
|
+
return process.env.OPENAI_DEFAULT_SONNET_MODEL;
|
|
140332
|
+
}
|
|
140333
|
+
const cached3 = getCachedOpenAIModels();
|
|
140334
|
+
if (cached3.length > 0) {
|
|
140335
|
+
return cached3[0].id;
|
|
140336
|
+
}
|
|
140337
|
+
return "";
|
|
140271
140338
|
}
|
|
140272
140339
|
if (provider === "gemini" && process.env.GEMINI_DEFAULT_SONNET_MODEL) {
|
|
140273
140340
|
return process.env.GEMINI_DEFAULT_SONNET_MODEL;
|
|
@@ -140285,8 +140352,15 @@ function getDefaultHaikuModel() {
|
|
|
140285
140352
|
if (provider === "costrict") {
|
|
140286
140353
|
return process.env.COSTRICT_DEFAULT_HAIKU_MODEL || getMainLoopModel();
|
|
140287
140354
|
}
|
|
140288
|
-
if (provider === "openai"
|
|
140289
|
-
|
|
140355
|
+
if (provider === "openai") {
|
|
140356
|
+
if (process.env.OPENAI_DEFAULT_HAIKU_MODEL) {
|
|
140357
|
+
return process.env.OPENAI_DEFAULT_HAIKU_MODEL;
|
|
140358
|
+
}
|
|
140359
|
+
const cached3 = getCachedOpenAIModels();
|
|
140360
|
+
if (cached3.length > 0) {
|
|
140361
|
+
return cached3[0].id;
|
|
140362
|
+
}
|
|
140363
|
+
return "";
|
|
140290
140364
|
}
|
|
140291
140365
|
if (provider === "gemini" && process.env.GEMINI_DEFAULT_HAIKU_MODEL) {
|
|
140292
140366
|
return process.env.GEMINI_DEFAULT_HAIKU_MODEL;
|
|
@@ -140612,6 +140686,7 @@ var init_model = __esm(() => {
|
|
|
140612
140686
|
init_modelAllowlist();
|
|
140613
140687
|
init_aliases();
|
|
140614
140688
|
init_stringUtils();
|
|
140689
|
+
init_listModels();
|
|
140615
140690
|
LEGACY_OPUS_FIRSTPARTY = [
|
|
140616
140691
|
"claude-opus-4-20250514",
|
|
140617
140692
|
"claude-opus-4-1-20250805",
|
|
@@ -220325,8 +220400,8 @@ __export(exports_models4, {
|
|
|
220325
220400
|
clearModelCache: () => clearModelCache
|
|
220326
220401
|
});
|
|
220327
220402
|
async function fetchCoStrictModels(baseUrl, accessToken) {
|
|
220328
|
-
if (
|
|
220329
|
-
return
|
|
220403
|
+
if (modelCache2 && Date.now() - modelCache2.timestamp < CACHE_TTL_MS2) {
|
|
220404
|
+
return modelCache2.models;
|
|
220330
220405
|
}
|
|
220331
220406
|
const controller = new AbortController;
|
|
220332
220407
|
const timeout = setTimeout(() => controller.abort(), 5000);
|
|
@@ -220336,7 +220411,7 @@ async function fetchCoStrictModels(baseUrl, accessToken) {
|
|
|
220336
220411
|
headers: {
|
|
220337
220412
|
Authorization: `Bearer ${accessToken}`,
|
|
220338
220413
|
Accept: "application/json",
|
|
220339
|
-
"User-Agent": `csc/${"4.2.
|
|
220414
|
+
"User-Agent": `csc/${"4.2.20"}`
|
|
220340
220415
|
},
|
|
220341
220416
|
signal: controller.signal
|
|
220342
220417
|
});
|
|
@@ -220348,12 +220423,12 @@ async function fetchCoStrictModels(baseUrl, accessToken) {
|
|
|
220348
220423
|
const models = data.data || [];
|
|
220349
220424
|
if (models.length === 0)
|
|
220350
220425
|
return getDefaultModels();
|
|
220351
|
-
|
|
220426
|
+
modelCache2 = { models, timestamp: Date.now() };
|
|
220352
220427
|
return models;
|
|
220353
220428
|
} catch {
|
|
220354
220429
|
clearTimeout(timeout);
|
|
220355
|
-
if (
|
|
220356
|
-
return
|
|
220430
|
+
if (modelCache2)
|
|
220431
|
+
return modelCache2.models;
|
|
220357
220432
|
return getDefaultModels();
|
|
220358
220433
|
}
|
|
220359
220434
|
}
|
|
@@ -220364,14 +220439,14 @@ function getDefaultModels() {
|
|
|
220364
220439
|
];
|
|
220365
220440
|
}
|
|
220366
220441
|
function clearModelCache() {
|
|
220367
|
-
|
|
220442
|
+
modelCache2 = null;
|
|
220368
220443
|
}
|
|
220369
220444
|
function getCachedCoStrictModels() {
|
|
220370
|
-
return
|
|
220445
|
+
return modelCache2?.models ?? [];
|
|
220371
220446
|
}
|
|
220372
|
-
var
|
|
220447
|
+
var modelCache2 = null, CACHE_TTL_MS2;
|
|
220373
220448
|
var init_models7 = __esm(() => {
|
|
220374
|
-
|
|
220449
|
+
CACHE_TTL_MS2 = 60 * 60 * 1000;
|
|
220375
220450
|
});
|
|
220376
220451
|
|
|
220377
220452
|
// src/costrict/provider/modelMapping.ts
|
|
@@ -222373,7 +222448,7 @@ var init_auth7 = __esm(() => {
|
|
|
222373
222448
|
|
|
222374
222449
|
// src/utils/userAgent.ts
|
|
222375
222450
|
function getClaudeCodeUserAgent() {
|
|
222376
|
-
return `costrict/${"4.2.
|
|
222451
|
+
return `costrict/${"4.2.20"}`;
|
|
222377
222452
|
}
|
|
222378
222453
|
|
|
222379
222454
|
// src/utils/workloadContext.ts
|
|
@@ -222395,7 +222470,7 @@ function getUserAgent() {
|
|
|
222395
222470
|
const clientApp = process.env.CLAUDE_AGENT_SDK_CLIENT_APP ? `, client-app/${process.env.CLAUDE_AGENT_SDK_CLIENT_APP}` : "";
|
|
222396
222471
|
const workload = getWorkload();
|
|
222397
222472
|
const workloadSuffix = workload ? `, workload/${workload}` : "";
|
|
222398
|
-
return `csc/${"4.2.
|
|
222473
|
+
return `csc/${"4.2.20"}`;
|
|
222399
222474
|
}
|
|
222400
222475
|
function getMCPUserAgent() {
|
|
222401
222476
|
const parts = [];
|
|
@@ -222409,7 +222484,7 @@ function getMCPUserAgent() {
|
|
|
222409
222484
|
parts.push(`client-app/${process.env.CLAUDE_AGENT_SDK_CLIENT_APP}`);
|
|
222410
222485
|
}
|
|
222411
222486
|
const suffix = parts.length > 0 ? ` (${parts.join(", ")})` : "";
|
|
222412
|
-
return `csc/${"4.2.
|
|
222487
|
+
return `csc/${"4.2.20"}${suffix}`;
|
|
222413
222488
|
}
|
|
222414
222489
|
function getWebFetchUserAgent() {
|
|
222415
222490
|
return `Claude-User (${getClaudeCodeUserAgent()}; +https://support.anthropic.com/)`;
|
|
@@ -222529,7 +222604,7 @@ var init_user = __esm(() => {
|
|
|
222529
222604
|
deviceId,
|
|
222530
222605
|
sessionId: getSessionId(),
|
|
222531
222606
|
email: getEmail(),
|
|
222532
|
-
appVersion: "4.2.
|
|
222607
|
+
appVersion: "4.2.20",
|
|
222533
222608
|
platform: getHostPlatformForAnalytics(),
|
|
222534
222609
|
organizationUuid,
|
|
222535
222610
|
accountUuid,
|
|
@@ -233577,7 +233652,7 @@ var init_metadata = __esm(() => {
|
|
|
233577
233652
|
COMPOUND_OPERATOR_REGEX = /\s*(?:&&|\|\||[;|])\s*/;
|
|
233578
233653
|
WHITESPACE_REGEX = /\s+/;
|
|
233579
233654
|
getVersionBase = memoize_default(() => {
|
|
233580
|
-
const match = "4.2.
|
|
233655
|
+
const match = "4.2.20".match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);
|
|
233581
233656
|
return match ? match[0] : undefined;
|
|
233582
233657
|
});
|
|
233583
233658
|
buildEnvContext = memoize_default(async () => {
|
|
@@ -233617,9 +233692,9 @@ var init_metadata = __esm(() => {
|
|
|
233617
233692
|
isGithubAction: isEnvTruthy(process.env.GITHUB_ACTIONS),
|
|
233618
233693
|
isClaudeCodeAction: isEnvTruthy(process.env.CLAUDE_CODE_ACTION),
|
|
233619
233694
|
isClaudeAiAuth: isClaudeAISubscriber(),
|
|
233620
|
-
version: "4.2.
|
|
233695
|
+
version: "4.2.20",
|
|
233621
233696
|
versionBase: getVersionBase(),
|
|
233622
|
-
buildTime: "2026-07-
|
|
233697
|
+
buildTime: "2026-07-30T04:23:55.080Z",
|
|
233623
233698
|
deploymentEnvironment: env4.detectDeploymentEnvironment(),
|
|
233624
233699
|
...isEnvTruthy(process.env.GITHUB_ACTIONS) && {
|
|
233625
233700
|
githubEventName: process.env.GITHUB_EVENT_NAME,
|
|
@@ -234290,7 +234365,7 @@ function initialize1PEventLogging() {
|
|
|
234290
234365
|
const platform3 = getPlatform();
|
|
234291
234366
|
const attributes = {
|
|
234292
234367
|
[import_semantic_conventions2.ATTR_SERVICE_NAME]: "claude-code",
|
|
234293
|
-
[import_semantic_conventions2.ATTR_SERVICE_VERSION]: "4.2.
|
|
234368
|
+
[import_semantic_conventions2.ATTR_SERVICE_VERSION]: "4.2.20"
|
|
234294
234369
|
};
|
|
234295
234370
|
if (platform3 === "wsl") {
|
|
234296
234371
|
const wslVersion = getWslVersion();
|
|
@@ -234317,7 +234392,7 @@ function initialize1PEventLogging() {
|
|
|
234317
234392
|
})
|
|
234318
234393
|
]
|
|
234319
234394
|
});
|
|
234320
|
-
firstPartyEventLogger = firstPartyEventLoggerProvider.getLogger("com.anthropic.claude_code.events", "4.2.
|
|
234395
|
+
firstPartyEventLogger = firstPartyEventLoggerProvider.getLogger("com.anthropic.claude_code.events", "4.2.20");
|
|
234321
234396
|
}
|
|
234322
234397
|
async function reinitialize1PEventLoggingIfConfigChanged() {
|
|
234323
234398
|
if (!is1PEventLoggingEnabled() || !firstPartyEventLoggerProvider) {
|
|
@@ -434333,7 +434408,7 @@ function getTelemetryAttributes() {
|
|
|
434333
434408
|
attributes["session.id"] = sessionId;
|
|
434334
434409
|
}
|
|
434335
434410
|
if (shouldIncludeAttribute("OTEL_METRICS_INCLUDE_VERSION")) {
|
|
434336
|
-
attributes["app.version"] = "4.2.
|
|
434411
|
+
attributes["app.version"] = "4.2.20";
|
|
434337
434412
|
}
|
|
434338
434413
|
const oauthAccount = getOauthAccountInfo();
|
|
434339
434414
|
if (oauthAccount) {
|
|
@@ -467853,7 +467928,7 @@ function initLangfuse() {
|
|
|
467853
467928
|
flushInterval: parseInt(process.env.LANGFUSE_FLUSH_INTERVAL ?? "10", 10),
|
|
467854
467929
|
mask: maskFn,
|
|
467855
467930
|
environment: process.env.LANGFUSE_TRACING_ENVIRONMENT ?? "development",
|
|
467856
|
-
release: "4.2.
|
|
467931
|
+
release: "4.2.20",
|
|
467857
467932
|
exportMode: process.env.LANGFUSE_EXPORT_MODE ?? "batched",
|
|
467858
467933
|
timeout: parseInt(process.env.LANGFUSE_TIMEOUT ?? "5", 10)
|
|
467859
467934
|
});
|
|
@@ -470807,7 +470882,7 @@ async function fetchPolicyLimits(cachedChecksum) {
|
|
|
470807
470882
|
}
|
|
470808
470883
|
const response3 = await axios_default.get(endpoint3, {
|
|
470809
470884
|
headers,
|
|
470810
|
-
timeout:
|
|
470885
|
+
timeout: FETCH_TIMEOUT_MS2,
|
|
470811
470886
|
validateStatus: (status) => status === 200 || status === 304 || status === 404
|
|
470812
470887
|
});
|
|
470813
470888
|
if (response3.status === 304) {
|
|
@@ -471029,7 +471104,7 @@ function stopBackgroundPolling() {
|
|
|
471029
471104
|
pollingIntervalId = null;
|
|
471030
471105
|
}
|
|
471031
471106
|
}
|
|
471032
|
-
var CACHE_FILENAME = "policy-limits.json",
|
|
471107
|
+
var CACHE_FILENAME = "policy-limits.json", FETCH_TIMEOUT_MS2 = 1e4, DEFAULT_MAX_RETRIES5 = 5, POLLING_INTERVAL_MS, pollingIntervalId = null, cleanupRegistered2 = false, loadingCompletePromise = null, loadingCompleteResolve = null, LOADING_PROMISE_TIMEOUT_MS = 30000, sessionCache2 = null, ESSENTIAL_TRAFFIC_DENY_ON_MISS;
|
|
471033
471108
|
var init_policyLimits = __esm(() => {
|
|
471034
471109
|
init_axios2();
|
|
471035
471110
|
init_oauth();
|
|
@@ -499753,7 +499828,7 @@ function initSentry() {
|
|
|
499753
499828
|
}
|
|
499754
499829
|
init3({
|
|
499755
499830
|
dsn,
|
|
499756
|
-
release: typeof MACRO !== "undefined" ? "4.2.
|
|
499831
|
+
release: typeof MACRO !== "undefined" ? "4.2.20" : undefined,
|
|
499757
499832
|
environment: typeof BUILD_ENV !== "undefined" ? BUILD_ENV : "production",
|
|
499758
499833
|
maxBreadcrumbs: 20,
|
|
499759
499834
|
sampleRate: 1,
|
|
@@ -527650,7 +527725,7 @@ async function initializeBetaTracing(resource) {
|
|
|
527650
527725
|
});
|
|
527651
527726
|
logs.setGlobalLoggerProvider(loggerProvider);
|
|
527652
527727
|
setLoggerProvider(loggerProvider);
|
|
527653
|
-
const eventLogger = logs.getLogger("com.anthropic.claude_code.events", "4.2.
|
|
527728
|
+
const eventLogger = logs.getLogger("com.anthropic.claude_code.events", "4.2.20");
|
|
527654
527729
|
setEventLogger(eventLogger);
|
|
527655
527730
|
process.on("beforeExit", async () => {
|
|
527656
527731
|
await loggerProvider?.forceFlush();
|
|
@@ -527690,7 +527765,7 @@ async function initializeTelemetry() {
|
|
|
527690
527765
|
const platform5 = getPlatform();
|
|
527691
527766
|
const baseAttributes = {
|
|
527692
527767
|
[import_semantic_conventions29.ATTR_SERVICE_NAME]: "claude-code",
|
|
527693
|
-
[import_semantic_conventions29.ATTR_SERVICE_VERSION]: "4.2.
|
|
527768
|
+
[import_semantic_conventions29.ATTR_SERVICE_VERSION]: "4.2.20"
|
|
527694
527769
|
};
|
|
527695
527770
|
if (platform5 === "wsl") {
|
|
527696
527771
|
const wslVersion = getWslVersion();
|
|
@@ -527735,7 +527810,7 @@ async function initializeTelemetry() {
|
|
|
527735
527810
|
} catch {}
|
|
527736
527811
|
};
|
|
527737
527812
|
registerCleanup(shutdownTelemetry2);
|
|
527738
|
-
return meterProvider2.getMeter("com.anthropic.claude_code", "4.2.
|
|
527813
|
+
return meterProvider2.getMeter("com.anthropic.claude_code", "4.2.20");
|
|
527739
527814
|
}
|
|
527740
527815
|
const meterProvider = new import_sdk_metrics2.MeterProvider({
|
|
527741
527816
|
resource,
|
|
@@ -527755,7 +527830,7 @@ async function initializeTelemetry() {
|
|
|
527755
527830
|
});
|
|
527756
527831
|
logs.setGlobalLoggerProvider(loggerProvider);
|
|
527757
527832
|
setLoggerProvider(loggerProvider);
|
|
527758
|
-
const eventLogger = logs.getLogger("com.anthropic.claude_code.events", "4.2.
|
|
527833
|
+
const eventLogger = logs.getLogger("com.anthropic.claude_code.events", "4.2.20");
|
|
527759
527834
|
setEventLogger(eventLogger);
|
|
527760
527835
|
logForDebugging("[3P telemetry] Event logger set successfully");
|
|
527761
527836
|
process.on("beforeExit", async () => {
|
|
@@ -527817,7 +527892,7 @@ Current timeout: ${timeoutMs}ms
|
|
|
527817
527892
|
}
|
|
527818
527893
|
};
|
|
527819
527894
|
registerCleanup(shutdownTelemetry);
|
|
527820
|
-
return meterProvider.getMeter("com.anthropic.claude_code", "4.2.
|
|
527895
|
+
return meterProvider.getMeter("com.anthropic.claude_code", "4.2.20");
|
|
527821
527896
|
}
|
|
527822
527897
|
async function flushTelemetry() {
|
|
527823
527898
|
const meterProvider = getMeterProvider();
|
|
@@ -528876,7 +528951,7 @@ async function installGlobalPackage(specificVersion) {
|
|
|
528876
528951
|
logError3(new AutoUpdaterError("Another process is currently installing an update"));
|
|
528877
528952
|
logEvent("tengu_auto_updater_lock_contention", {
|
|
528878
528953
|
pid: process.pid,
|
|
528879
|
-
currentVersion: "4.2.
|
|
528954
|
+
currentVersion: "4.2.20"
|
|
528880
528955
|
});
|
|
528881
528956
|
return { status: "in_progress" };
|
|
528882
528957
|
}
|
|
@@ -528885,7 +528960,7 @@ async function installGlobalPackage(specificVersion) {
|
|
|
528885
528960
|
if (!env4.isRunningWithBun() && env4.isNpmFromWindowsPath()) {
|
|
528886
528961
|
logError3(new Error("Windows NPM detected in WSL environment"));
|
|
528887
528962
|
logEvent("tengu_auto_updater_windows_npm_in_wsl", {
|
|
528888
|
-
currentVersion: "4.2.
|
|
528963
|
+
currentVersion: "4.2.20"
|
|
528889
528964
|
});
|
|
528890
528965
|
return {
|
|
528891
528966
|
status: "install_failed",
|
|
@@ -529431,7 +529506,7 @@ function detectLinuxGlobPatternWarnings() {
|
|
|
529431
529506
|
}
|
|
529432
529507
|
async function getDoctorDiagnostic() {
|
|
529433
529508
|
const installationType = await getCurrentInstallationType();
|
|
529434
|
-
const version9 = typeof MACRO !== "undefined" ? "4.2.
|
|
529509
|
+
const version9 = typeof MACRO !== "undefined" ? "4.2.20" : "unknown";
|
|
529435
529510
|
const installationPath = await getInstallationPath();
|
|
529436
529511
|
const invokedBinary = getInvokedBinary();
|
|
529437
529512
|
const multipleInstallations = await detectMultipleInstallations();
|
|
@@ -567618,7 +567693,7 @@ async function setupSdkMcpClients(sdkMcpConfigs, sendMcpMessage) {
|
|
|
567618
567693
|
const client10 = new Client3({
|
|
567619
567694
|
name: "claude-code",
|
|
567620
567695
|
title: "CoStrict",
|
|
567621
|
-
version: "4.2.
|
|
567696
|
+
version: "4.2.20",
|
|
567622
567697
|
description: "CoStrict agentic coding tool",
|
|
567623
567698
|
websiteUrl: PRODUCT_URL
|
|
567624
567699
|
}, {
|
|
@@ -567989,7 +568064,7 @@ var init_client18 = __esm(() => {
|
|
|
567989
568064
|
const client10 = new Client3({
|
|
567990
568065
|
name: "claude-code",
|
|
567991
568066
|
title: "CoStrict",
|
|
567992
|
-
version: "4.2.
|
|
568067
|
+
version: "4.2.20",
|
|
567993
568068
|
description: "CoStrict agentic coding tool",
|
|
567994
568069
|
websiteUrl: PRODUCT_URL
|
|
567995
568070
|
}, {
|
|
@@ -569379,7 +569454,7 @@ function getInstallationEnv() {
|
|
|
569379
569454
|
return;
|
|
569380
569455
|
}
|
|
569381
569456
|
function getClaudeCodeVersion() {
|
|
569382
|
-
return "4.2.
|
|
569457
|
+
return "4.2.20";
|
|
569383
569458
|
}
|
|
569384
569459
|
async function getInstalledVSCodeExtensionVersion(command4) {
|
|
569385
569460
|
const { stdout } = await execFileNoThrow2(command4, ["--list-extensions", "--show-versions"], {
|
|
@@ -570743,8 +570818,8 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
|
|
|
570743
570818
|
const maxVersion = await getMaxVersion();
|
|
570744
570819
|
if (maxVersion && gt(version10, maxVersion)) {
|
|
570745
570820
|
logForDebugging(`Native installer: maxVersion ${maxVersion} is set, capping update from ${version10} to ${maxVersion}`);
|
|
570746
|
-
if (gte2("4.2.
|
|
570747
|
-
logForDebugging(`Native installer: current version ${"4.2.
|
|
570821
|
+
if (gte2("4.2.20", maxVersion)) {
|
|
570822
|
+
logForDebugging(`Native installer: current version ${"4.2.20"} is already at or above maxVersion ${maxVersion}, skipping update`);
|
|
570748
570823
|
logEvent("tengu_native_update_skipped_max_version", {
|
|
570749
570824
|
latency_ms: Date.now() - startTime2,
|
|
570750
570825
|
max_version: maxVersion,
|
|
@@ -570755,7 +570830,7 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
|
|
|
570755
570830
|
version10 = maxVersion;
|
|
570756
570831
|
}
|
|
570757
570832
|
}
|
|
570758
|
-
if (!forceReinstall && version10 === "4.2.
|
|
570833
|
+
if (!forceReinstall && version10 === "4.2.20" && await versionIsAvailable(version10) && await isPossibleClaudeBinary(executablePath)) {
|
|
570759
570834
|
logForDebugging(`Found ${version10} at ${executablePath}, skipping install`);
|
|
570760
570835
|
logEvent("tengu_native_update_complete", {
|
|
570761
570836
|
latency_ms: Date.now() - startTime2,
|
|
@@ -591344,7 +591419,7 @@ function getCachedOverageCreditGrant() {
|
|
|
591344
591419
|
const cached10 = getGlobalConfig().overageCreditGrantCache?.[orgId];
|
|
591345
591420
|
if (!cached10)
|
|
591346
591421
|
return null;
|
|
591347
|
-
if (Date.now() - cached10.timestamp >
|
|
591422
|
+
if (Date.now() - cached10.timestamp > CACHE_TTL_MS3)
|
|
591348
591423
|
return null;
|
|
591349
591424
|
return cached10.info;
|
|
591350
591425
|
}
|
|
@@ -591374,7 +591449,7 @@ async function refreshOverageCreditGrantCache() {
|
|
|
591374
591449
|
const prevCached = prev.overageCreditGrantCache?.[orgId];
|
|
591375
591450
|
const existing = prevCached?.info;
|
|
591376
591451
|
const dataUnchanged = existing && existing.available === info2.available && existing.eligible === info2.eligible && existing.granted === info2.granted && existing.amount_minor_units === info2.amount_minor_units && existing.currency === info2.currency;
|
|
591377
|
-
if (dataUnchanged && prevCached && Date.now() - prevCached.timestamp <=
|
|
591452
|
+
if (dataUnchanged && prevCached && Date.now() - prevCached.timestamp <= CACHE_TTL_MS3) {
|
|
591378
591453
|
return prev;
|
|
591379
591454
|
}
|
|
591380
591455
|
const entry = {
|
|
@@ -591399,7 +591474,7 @@ function formatGrantAmount(info2) {
|
|
|
591399
591474
|
}
|
|
591400
591475
|
return null;
|
|
591401
591476
|
}
|
|
591402
|
-
var
|
|
591477
|
+
var CACHE_TTL_MS3;
|
|
591403
591478
|
var init_overageCreditGrant = __esm(() => {
|
|
591404
591479
|
init_axios2();
|
|
591405
591480
|
init_oauth();
|
|
@@ -591407,7 +591482,7 @@ var init_overageCreditGrant = __esm(() => {
|
|
|
591407
591482
|
init_config4();
|
|
591408
591483
|
init_log3();
|
|
591409
591484
|
init_api3();
|
|
591410
|
-
|
|
591485
|
+
CACHE_TTL_MS3 = 60 * 60 * 1000;
|
|
591411
591486
|
});
|
|
591412
591487
|
|
|
591413
591488
|
// src/services/api/usage.ts
|
|
@@ -648437,7 +648512,7 @@ async function getWithPermittedRedirects(url5, signal, redirectChecker, depth =
|
|
|
648437
648512
|
try {
|
|
648438
648513
|
return await axios_default.get(url5, {
|
|
648439
648514
|
signal,
|
|
648440
|
-
timeout:
|
|
648515
|
+
timeout: FETCH_TIMEOUT_MS3,
|
|
648441
648516
|
maxRedirects: 0,
|
|
648442
648517
|
responseType: "arraybuffer",
|
|
648443
648518
|
maxContentLength: MAX_HTTP_CONTENT_LENGTH,
|
|
@@ -648576,7 +648651,7 @@ async function applyPromptToMarkdown(prompt, markdownContent, signal, isNonInter
|
|
|
648576
648651
|
}
|
|
648577
648652
|
return "No response from model";
|
|
648578
648653
|
}
|
|
648579
|
-
var EgressBlockedError,
|
|
648654
|
+
var EgressBlockedError, CACHE_TTL_MS4, MAX_CACHE_SIZE_BYTES, URL_CACHE, turndownServicePromise, MAX_URL_LENGTH = 2000, MAX_HTTP_CONTENT_LENGTH = 10485760, FETCH_TIMEOUT_MS3 = 60000, MAX_REDIRECTS = 10, MAX_MARKDOWN_LENGTH = 1e5;
|
|
648580
648655
|
var init_utils37 = __esm(() => {
|
|
648581
648656
|
init_axios2();
|
|
648582
648657
|
init_index_min();
|
|
@@ -648600,11 +648675,11 @@ var init_utils37 = __esm(() => {
|
|
|
648600
648675
|
this.name = "EgressBlockedError";
|
|
648601
648676
|
}
|
|
648602
648677
|
};
|
|
648603
|
-
|
|
648678
|
+
CACHE_TTL_MS4 = 15 * 60 * 1000;
|
|
648604
648679
|
MAX_CACHE_SIZE_BYTES = 50 * 1024 * 1024;
|
|
648605
648680
|
URL_CACHE = new I({
|
|
648606
648681
|
maxSize: MAX_CACHE_SIZE_BYTES,
|
|
648607
|
-
ttl:
|
|
648682
|
+
ttl: CACHE_TTL_MS4
|
|
648608
648683
|
});
|
|
648609
648684
|
});
|
|
648610
648685
|
|
|
@@ -649752,58 +649827,80 @@ ${script}
|
|
|
649752
649827
|
function assertCompiles(script) {
|
|
649753
649828
|
new Function(wrapScript(script));
|
|
649754
649829
|
}
|
|
649755
|
-
function
|
|
649756
|
-
|
|
649757
|
-
|
|
649758
|
-
|
|
649759
|
-
|
|
649760
|
-
|
|
649761
|
-
|
|
649762
|
-
|
|
649763
|
-
|
|
649764
|
-
|
|
649765
|
-
|
|
649766
|
-
|
|
649767
|
-
|
|
649768
|
-
|
|
649769
|
-
|
|
649770
|
-
|
|
649830
|
+
function runScriptInSandbox(script, host, args) {
|
|
649831
|
+
const context40 = vm.createContext({});
|
|
649832
|
+
const glue = vm.runInContext(GLUE_SOURCE, context40);
|
|
649833
|
+
context40.agent = glue.wrapAsync(host.agent);
|
|
649834
|
+
context40.parallel = glue.wrapAsync(host.parallel);
|
|
649835
|
+
context40.parallelSettled = glue.wrapAsync(host.parallelSettled);
|
|
649836
|
+
context40.pipeline = glue.wrapAsync(host.pipeline);
|
|
649837
|
+
context40.query = {
|
|
649838
|
+
count: glue.wrapAsync(host.query.count),
|
|
649839
|
+
glob: glue.wrapAsync(host.query.glob),
|
|
649840
|
+
grep: glue.wrapAsync(host.query.grep),
|
|
649841
|
+
read: glue.wrapAsync(host.query.read)
|
|
649842
|
+
};
|
|
649843
|
+
context40.args = glue.parseArgs(JSON.stringify(args ?? null));
|
|
649844
|
+
context40.console = {
|
|
649845
|
+
log: glue.wrapSync((...a8) => host.console.log(...a8)),
|
|
649846
|
+
warn: glue.wrapSync((...a8) => host.console.warn(...a8)),
|
|
649847
|
+
error: glue.wrapSync((...a8) => host.console.error(...a8)),
|
|
649848
|
+
info: glue.wrapSync((...a8) => host.console.info(...a8))
|
|
649849
|
+
};
|
|
649850
|
+
context40.budget = {
|
|
649851
|
+
total: host.budget.total,
|
|
649852
|
+
spent: glue.wrapSync(host.budget.spent),
|
|
649853
|
+
remaining: glue.wrapSync(host.budget.remaining)
|
|
649854
|
+
};
|
|
649855
|
+
context40.Math = glue.buildMath(host.seed);
|
|
649856
|
+
context40.Date = glue.buildDate(host.runStartMs);
|
|
649857
|
+
context40.structuredClone = glue.cloneJSON;
|
|
649858
|
+
const compiled = new vm.Script(wrapScript(script), {
|
|
649859
|
+
filename: "workflow.js"
|
|
649860
|
+
});
|
|
649861
|
+
return Promise.resolve(compiled.runInContext(context40));
|
|
649771
649862
|
}
|
|
649772
|
-
|
|
649773
|
-
|
|
649863
|
+
var GLUE_SOURCE = `({
|
|
649864
|
+
wrapAsync: (fn) => (...a) => Promise.resolve(fn(...a)).then(
|
|
649865
|
+
(r) => r === undefined ? undefined : JSON.parse(JSON.stringify(r)),
|
|
649866
|
+
(e) => { throw new Error(e && e.message ? String(e.message) : String(e)) },
|
|
649867
|
+
),
|
|
649868
|
+
wrapSync: (fn) => (...a) => {
|
|
649869
|
+
let r
|
|
649870
|
+
try {
|
|
649871
|
+
r = fn(...a)
|
|
649872
|
+
} catch (e) {
|
|
649873
|
+
throw new Error(e && e.message ? String(e.message) : String(e))
|
|
649874
|
+
}
|
|
649875
|
+
return r === undefined ? undefined : JSON.parse(JSON.stringify(r))
|
|
649876
|
+
},
|
|
649877
|
+
parseArgs: (json) => JSON.parse(json),
|
|
649878
|
+
buildMath: (seed) => {
|
|
649879
|
+
const m = Object.create(null)
|
|
649880
|
+
for (const k of Object.getOwnPropertyNames(Math)) m[k] = Math[k]
|
|
649881
|
+
let a = seed >>> 0
|
|
649882
|
+
m.random = () => {
|
|
649883
|
+
a = (a + 0x6d2b79f5) | 0
|
|
649884
|
+
let t = Math.imul(a ^ (a >>> 15), 1 | a)
|
|
649885
|
+
t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t
|
|
649886
|
+
return ((t ^ (t >>> 14)) >>> 0) / 4294967296
|
|
649887
|
+
}
|
|
649888
|
+
return m
|
|
649889
|
+
},
|
|
649890
|
+
buildDate: (frozenNow) => class extends Date {
|
|
649774
649891
|
constructor(...args) {
|
|
649775
649892
|
if (args.length === 0) {
|
|
649776
|
-
super(frozenNow)
|
|
649893
|
+
super(frozenNow)
|
|
649777
649894
|
} else {
|
|
649778
|
-
super(...args)
|
|
649895
|
+
super(...args)
|
|
649779
649896
|
}
|
|
649780
649897
|
}
|
|
649781
649898
|
static now() {
|
|
649782
|
-
return frozenNow
|
|
649899
|
+
return frozenNow
|
|
649783
649900
|
}
|
|
649784
|
-
}
|
|
649785
|
-
|
|
649786
|
-
}
|
|
649787
|
-
function runScriptInSandbox(script, host, args) {
|
|
649788
|
-
const sandbox = {
|
|
649789
|
-
agent: host.agent,
|
|
649790
|
-
parallel: host.parallel,
|
|
649791
|
-
parallelSettled: host.parallelSettled,
|
|
649792
|
-
pipeline: host.pipeline,
|
|
649793
|
-
query: host.query,
|
|
649794
|
-
args,
|
|
649795
|
-
console: host.console,
|
|
649796
|
-
budget: host.budget,
|
|
649797
|
-
Math: buildSeededMath(host.seed),
|
|
649798
|
-
Date: buildFrozenDate(host.runStartMs),
|
|
649799
|
-
structuredClone
|
|
649800
|
-
};
|
|
649801
|
-
const context40 = vm.createContext(sandbox);
|
|
649802
|
-
const compiled = new vm.Script(wrapScript(script), {
|
|
649803
|
-
filename: "workflow.js"
|
|
649804
|
-
});
|
|
649805
|
-
return Promise.resolve(compiled.runInContext(context40));
|
|
649806
|
-
}
|
|
649901
|
+
},
|
|
649902
|
+
cloneJSON: (v) => JSON.parse(JSON.stringify(v)),
|
|
649903
|
+
})`;
|
|
649807
649904
|
var init_sandbox = () => {};
|
|
649808
649905
|
|
|
649809
649906
|
// packages/builtin-tools/src/tools/DynamicWorkflowTool/runtime/scheduler.ts
|
|
@@ -652342,7 +652439,7 @@ class BingSearchAdapter {
|
|
|
652342
652439
|
try {
|
|
652343
652440
|
const response3 = await axios_default.get(url5, {
|
|
652344
652441
|
signal: abortController.signal,
|
|
652345
|
-
timeout:
|
|
652442
|
+
timeout: FETCH_TIMEOUT_MS4,
|
|
652346
652443
|
responseType: "text",
|
|
652347
652444
|
headers: BROWSER_HEADERS
|
|
652348
652445
|
});
|
|
@@ -652443,7 +652540,7 @@ function resolveBingUrl(rawUrl) {
|
|
|
652443
652540
|
return rawUrl;
|
|
652444
652541
|
return;
|
|
652445
652542
|
}
|
|
652446
|
-
var import_he3,
|
|
652543
|
+
var import_he3, FETCH_TIMEOUT_MS4 = 30000, BROWSER_HEADERS, decodeHtmlEntities;
|
|
652447
652544
|
var init_bingAdapter = __esm(() => {
|
|
652448
652545
|
init_axios2();
|
|
652449
652546
|
init_errors();
|
|
@@ -652485,7 +652582,7 @@ class BraveSearchAdapter {
|
|
|
652485
652582
|
try {
|
|
652486
652583
|
const response3 = await axios_default.get(BRAVE_LLM_CONTEXT_URL, {
|
|
652487
652584
|
signal: abortController.signal,
|
|
652488
|
-
timeout:
|
|
652585
|
+
timeout: FETCH_TIMEOUT_MS5,
|
|
652489
652586
|
responseType: "json",
|
|
652490
652587
|
headers: {
|
|
652491
652588
|
Accept: "application/json",
|
|
@@ -652570,7 +652667,7 @@ function getBraveApiKey() {
|
|
|
652570
652667
|
}
|
|
652571
652668
|
throw new Error("BraveSearchAdapter requires BRAVE_SEARCH_API_KEY or BRAVE_API_KEY");
|
|
652572
652669
|
}
|
|
652573
|
-
var
|
|
652670
|
+
var FETCH_TIMEOUT_MS5 = 30000, BRAVE_LLM_CONTEXT_URL = "https://api.search.brave.com/res/v1/llm/context", BRAVE_API_KEY_ENV_VARS;
|
|
652574
652671
|
var init_braveAdapter = __esm(() => {
|
|
652575
652672
|
init_axios2();
|
|
652576
652673
|
init_errors();
|
|
@@ -652616,7 +652713,7 @@ class ExaSearchAdapter {
|
|
|
652616
652713
|
}
|
|
652617
652714
|
}, {
|
|
652618
652715
|
signal: abortController.signal,
|
|
652619
|
-
timeout:
|
|
652716
|
+
timeout: FETCH_TIMEOUT_MS6,
|
|
652620
652717
|
headers: {
|
|
652621
652718
|
"Content-Type": "application/json",
|
|
652622
652719
|
Accept: "application/json, text/event-stream"
|
|
@@ -652726,7 +652823,7 @@ class ExaSearchAdapter {
|
|
|
652726
652823
|
return results;
|
|
652727
652824
|
}
|
|
652728
652825
|
}
|
|
652729
|
-
var EXA_MCP_URL = "https://mcp.exa.ai/mcp",
|
|
652826
|
+
var EXA_MCP_URL = "https://mcp.exa.ai/mcp", FETCH_TIMEOUT_MS6 = 25000;
|
|
652730
652827
|
var init_exaAdapter = __esm(() => {
|
|
652731
652828
|
init_axios2();
|
|
652732
652829
|
init_errors();
|
|
@@ -656248,7 +656345,13 @@ function getModelOptionsBase(fastMode = false) {
|
|
|
656248
656345
|
if (getAPIProvider() === "costrict") {
|
|
656249
656346
|
const costrictModels = getCachedCoStrictModels();
|
|
656250
656347
|
if (costrictModels.length === 0) {
|
|
656251
|
-
return [
|
|
656348
|
+
return [
|
|
656349
|
+
{
|
|
656350
|
+
value: "Auto",
|
|
656351
|
+
label: "Auto",
|
|
656352
|
+
description: "Auto-select (login to see models)"
|
|
656353
|
+
}
|
|
656354
|
+
];
|
|
656252
656355
|
}
|
|
656253
656356
|
const sorted = [...costrictModels].sort((a8, b9) => a8.id.localeCompare(b9.id, "en"));
|
|
656254
656357
|
return sorted.map((m4) => {
|
|
@@ -656263,6 +656366,24 @@ function getModelOptionsBase(fastMode = false) {
|
|
|
656263
656366
|
};
|
|
656264
656367
|
});
|
|
656265
656368
|
}
|
|
656369
|
+
if (getAPIProvider() === "openai") {
|
|
656370
|
+
const cached10 = getCachedOpenAIModels();
|
|
656371
|
+
if (cached10.length > 0) {
|
|
656372
|
+
const seen = new Set;
|
|
656373
|
+
const options = [getDefaultOptionForUser(fastMode)];
|
|
656374
|
+
for (const m4 of [...cached10].sort((a8, b9) => a8.id.localeCompare(b9.id, "en"))) {
|
|
656375
|
+
if (seen.has(m4.id))
|
|
656376
|
+
continue;
|
|
656377
|
+
seen.add(m4.id);
|
|
656378
|
+
options.push({
|
|
656379
|
+
value: m4.id,
|
|
656380
|
+
label: m4.id,
|
|
656381
|
+
description: m4.owned_by ? `via ${m4.owned_by}` : "OpenAI-compatible model"
|
|
656382
|
+
});
|
|
656383
|
+
}
|
|
656384
|
+
return options;
|
|
656385
|
+
}
|
|
656386
|
+
}
|
|
656266
656387
|
if (getAPIProvider() === "firstParty") {
|
|
656267
656388
|
const payg1POptions = [getDefaultOptionForUser(fastMode)];
|
|
656268
656389
|
if (isOpus1mMergeEnabled()) {
|
|
@@ -656418,6 +656539,7 @@ var MaxSonnet46Option, MaxHaiku45Option;
|
|
|
656418
656539
|
var init_modelOptions = __esm(() => {
|
|
656419
656540
|
init_state();
|
|
656420
656541
|
init_models7();
|
|
656542
|
+
init_listModels();
|
|
656421
656543
|
init_auth7();
|
|
656422
656544
|
init_modelStrings();
|
|
656423
656545
|
init_sfModels();
|
|
@@ -663449,10 +663571,15 @@ __export(exports_WorkflowTool, {
|
|
|
663449
663571
|
});
|
|
663450
663572
|
import { randomUUID as randomUUID31 } from "crypto";
|
|
663451
663573
|
import { mkdir as mkdir32, readdir as readdir17, readFile as readFile41, writeFile as writeFile35 } from "fs/promises";
|
|
663452
|
-
import { join as join125, parse as parse24 } from "path";
|
|
663574
|
+
import { join as join125, parse as parse24, relative as relative23, resolve as resolve43, isAbsolute as isAbsolute29 } from "path";
|
|
663453
663575
|
async function findWorkflowFile(workflowDir, workflow) {
|
|
663576
|
+
const resolvedDir = resolve43(workflowDir);
|
|
663454
663577
|
for (const ext of WORKFLOW_FILE_EXTENSIONS) {
|
|
663455
663578
|
const path36 = join125(workflowDir, `${workflow}${ext}`);
|
|
663579
|
+
const rel = relative23(resolvedDir, resolve43(path36));
|
|
663580
|
+
if (rel.startsWith("..") || isAbsolute29(rel)) {
|
|
663581
|
+
continue;
|
|
663582
|
+
}
|
|
663456
663583
|
try {
|
|
663457
663584
|
return { path: path36, content: await readFile41(path36, "utf-8") };
|
|
663458
663585
|
} catch {}
|
|
@@ -663713,7 +663840,7 @@ var init_WorkflowTool = __esm(() => {
|
|
|
663713
663840
|
init_json();
|
|
663714
663841
|
init_constants16();
|
|
663715
663842
|
inputSchema53 = exports_external.object({
|
|
663716
|
-
workflow: exports_external.string().describe("Name of the workflow to execute"),
|
|
663843
|
+
workflow: exports_external.string().refine((val) => !val.includes("..") && !val.includes("/") && !val.includes("\\"), "Workflow name must not contain path separators or traversal sequences").describe("Name of the workflow to execute"),
|
|
663717
663844
|
args: exports_external.string().optional().describe("Arguments to pass to the workflow"),
|
|
663718
663845
|
action: exports_external.enum(["start", "status", "advance", "cancel", "list"]).optional().describe("Workflow action. Defaults to start."),
|
|
663719
663846
|
run_id: exports_external.string().optional().describe("Workflow run id for status, advance, or cancel.")
|
|
@@ -665338,12 +665465,12 @@ async function appendTeamMember(input4, spawn11, result) {
|
|
|
665338
665465
|
async function handleSpawn(input4, context40) {
|
|
665339
665466
|
const spawn11 = await resolveSpawn(input4, context40);
|
|
665340
665467
|
const executor = await getTeammateExecutor(true, {
|
|
665341
|
-
onNeedsIt2Setup: context40.setToolJSX ? (tmuxAvailable2) => new Promise((
|
|
665468
|
+
onNeedsIt2Setup: context40.setToolJSX ? (tmuxAvailable2) => new Promise((resolve44) => {
|
|
665342
665469
|
context40.setToolJSX({
|
|
665343
665470
|
jsx: import_react100.default.createElement(It2SetupPrompt, {
|
|
665344
665471
|
onDone: (result2) => {
|
|
665345
665472
|
context40.setToolJSX(null);
|
|
665346
|
-
|
|
665473
|
+
resolve44(result2);
|
|
665347
665474
|
},
|
|
665348
665475
|
tmuxAvailable: tmuxAvailable2
|
|
665349
665476
|
}),
|
|
@@ -667560,8 +667687,8 @@ function registerAgentForeground({
|
|
|
667560
667687
|
diskLoaded: false
|
|
667561
667688
|
};
|
|
667562
667689
|
let resolveBackgroundSignal;
|
|
667563
|
-
const backgroundSignal = new Promise((
|
|
667564
|
-
resolveBackgroundSignal =
|
|
667690
|
+
const backgroundSignal = new Promise((resolve44) => {
|
|
667691
|
+
resolveBackgroundSignal = resolve44;
|
|
667565
667692
|
});
|
|
667566
667693
|
backgroundSignalResolvers.set(agentId, resolveBackgroundSignal);
|
|
667567
667694
|
registerTask(taskState, setAppState);
|
|
@@ -669075,8 +669202,8 @@ async function* runShellCommand({
|
|
|
669075
669202
|
let assistantAutoBackgrounded = false;
|
|
669076
669203
|
let resolveProgress = null;
|
|
669077
669204
|
function createProgressSignal() {
|
|
669078
|
-
return new Promise((
|
|
669079
|
-
resolveProgress = () =>
|
|
669205
|
+
return new Promise((resolve44) => {
|
|
669206
|
+
resolveProgress = () => resolve44(null);
|
|
669080
669207
|
});
|
|
669081
669208
|
}
|
|
669082
669209
|
const shouldAutoBackground = !isBackgroundTasksDisabled3 && isAutobackgroundingAllowed2(command4);
|
|
@@ -669087,10 +669214,10 @@ async function* runShellCommand({
|
|
|
669087
669214
|
fullOutput = allLines;
|
|
669088
669215
|
lastTotalLines = totalLines;
|
|
669089
669216
|
lastTotalBytes = isIncomplete ? totalBytes : 0;
|
|
669090
|
-
const
|
|
669091
|
-
if (
|
|
669217
|
+
const resolve44 = resolveProgress;
|
|
669218
|
+
if (resolve44) {
|
|
669092
669219
|
resolveProgress = null;
|
|
669093
|
-
|
|
669220
|
+
resolve44();
|
|
669094
669221
|
}
|
|
669095
669222
|
},
|
|
669096
669223
|
preventCwdChanges,
|
|
@@ -669120,10 +669247,10 @@ async function* runShellCommand({
|
|
|
669120
669247
|
return;
|
|
669121
669248
|
}
|
|
669122
669249
|
backgroundShellId = foregroundTaskId;
|
|
669123
|
-
const
|
|
669124
|
-
if (
|
|
669250
|
+
const resolve44 = resolveProgress;
|
|
669251
|
+
if (resolve44) {
|
|
669125
669252
|
resolveProgress = null;
|
|
669126
|
-
|
|
669253
|
+
resolve44();
|
|
669127
669254
|
}
|
|
669128
669255
|
logEvent(eventName, {
|
|
669129
669256
|
command_type: getCommandTypeForLogging2(command4)
|
|
@@ -669133,10 +669260,10 @@ async function* runShellCommand({
|
|
|
669133
669260
|
}
|
|
669134
669261
|
spawnBackgroundTask().then((shellId) => {
|
|
669135
669262
|
backgroundShellId = shellId;
|
|
669136
|
-
const
|
|
669137
|
-
if (
|
|
669263
|
+
const resolve44 = resolveProgress;
|
|
669264
|
+
if (resolve44) {
|
|
669138
669265
|
resolveProgress = null;
|
|
669139
|
-
|
|
669266
|
+
resolve44();
|
|
669140
669267
|
}
|
|
669141
669268
|
logEvent(eventName, {
|
|
669142
669269
|
command_type: getCommandTypeForLogging2(command4)
|
|
@@ -669177,8 +669304,8 @@ async function* runShellCommand({
|
|
|
669177
669304
|
{
|
|
669178
669305
|
const initialResult = await Promise.race([
|
|
669179
669306
|
resultPromise,
|
|
669180
|
-
new Promise((
|
|
669181
|
-
const t2 = setTimeout((r7) => r7(null), PROGRESS_THRESHOLD_MS3,
|
|
669307
|
+
new Promise((resolve44) => {
|
|
669308
|
+
const t2 = setTimeout((r7) => r7(null), PROGRESS_THRESHOLD_MS3, resolve44);
|
|
669182
669309
|
t2.unref();
|
|
669183
669310
|
})
|
|
669184
669311
|
]);
|
|
@@ -671156,17 +671283,17 @@ var init_stream5 = __esm(() => {
|
|
|
671156
671283
|
if (this.hasError) {
|
|
671157
671284
|
return Promise.reject(this.hasError);
|
|
671158
671285
|
}
|
|
671159
|
-
return new Promise((
|
|
671160
|
-
this.readResolve =
|
|
671286
|
+
return new Promise((resolve44, reject2) => {
|
|
671287
|
+
this.readResolve = resolve44;
|
|
671161
671288
|
this.readReject = reject2;
|
|
671162
671289
|
});
|
|
671163
671290
|
}
|
|
671164
671291
|
enqueue(value) {
|
|
671165
671292
|
if (this.readResolve) {
|
|
671166
|
-
const
|
|
671293
|
+
const resolve44 = this.readResolve;
|
|
671167
671294
|
this.readResolve = undefined;
|
|
671168
671295
|
this.readReject = undefined;
|
|
671169
|
-
|
|
671296
|
+
resolve44({ done: false, value });
|
|
671170
671297
|
} else {
|
|
671171
671298
|
this.queue.push(value);
|
|
671172
671299
|
}
|
|
@@ -671174,10 +671301,10 @@ var init_stream5 = __esm(() => {
|
|
|
671174
671301
|
done() {
|
|
671175
671302
|
this.isDone = true;
|
|
671176
671303
|
if (this.readResolve) {
|
|
671177
|
-
const
|
|
671304
|
+
const resolve44 = this.readResolve;
|
|
671178
671305
|
this.readResolve = undefined;
|
|
671179
671306
|
this.readReject = undefined;
|
|
671180
|
-
|
|
671307
|
+
resolve44({ done: true, value: undefined });
|
|
671181
671308
|
}
|
|
671182
671309
|
}
|
|
671183
671310
|
error(error100) {
|
|
@@ -672051,7 +672178,7 @@ import {
|
|
|
672051
672178
|
realpathSync as realpathSync6,
|
|
672052
672179
|
writeFileSync as writeFileSync13
|
|
672053
672180
|
} from "fs";
|
|
672054
|
-
import { basename as basename29, join as join127, resolve as
|
|
672181
|
+
import { basename as basename29, join as join127, resolve as resolve44 } from "path";
|
|
672055
672182
|
function getSkillLearningRootDir() {
|
|
672056
672183
|
return join127(getClaudeConfigHomeDir(), "skill-learning");
|
|
672057
672184
|
}
|
|
@@ -672227,7 +672354,7 @@ function git(args, cwd2) {
|
|
|
672227
672354
|
}
|
|
672228
672355
|
}
|
|
672229
672356
|
function normalizePath3(path36) {
|
|
672230
|
-
const resolved =
|
|
672357
|
+
const resolved = resolve44(path36);
|
|
672231
672358
|
try {
|
|
672232
672359
|
return realpathSync6.native(resolved).normalize("NFC");
|
|
672233
672360
|
} catch {
|
|
@@ -675768,8 +675895,8 @@ class StreamingToolExecutor {
|
|
|
675768
675895
|
}
|
|
675769
675896
|
if (this.hasExecutingTools() && !this.hasCompletedResults() && !this.hasPendingProgress()) {
|
|
675770
675897
|
const executingPromises = this.tools.filter((t2) => t2.status === "executing" && t2.promise).map((t2) => t2.promise);
|
|
675771
|
-
const progressPromise = new Promise((
|
|
675772
|
-
this.progressAvailableResolve =
|
|
675898
|
+
const progressPromise = new Promise((resolve45) => {
|
|
675899
|
+
this.progressAvailableResolve = resolve45;
|
|
675773
675900
|
});
|
|
675774
675901
|
if (executingPromises.length > 0) {
|
|
675775
675902
|
await Promise.race([...executingPromises, progressPromise]);
|
|
@@ -676176,7 +676303,7 @@ function streamOnEnd() {
|
|
|
676176
676303
|
});
|
|
676177
676304
|
}
|
|
676178
676305
|
function readFileInRangeStreaming(filePath, offset, maxLines, maxBytes, truncateOnByteLimit, signal) {
|
|
676179
|
-
return new Promise((
|
|
676306
|
+
return new Promise((resolve45, reject2) => {
|
|
676180
676307
|
const state3 = {
|
|
676181
676308
|
stream: createReadStream3(filePath, {
|
|
676182
676309
|
encoding: "utf8",
|
|
@@ -676187,7 +676314,7 @@ function readFileInRangeStreaming(filePath, offset, maxLines, maxBytes, truncate
|
|
|
676187
676314
|
endLine: maxLines !== undefined ? offset + maxLines : Infinity,
|
|
676188
676315
|
maxBytes,
|
|
676189
676316
|
truncateOnByteLimit,
|
|
676190
|
-
resolve:
|
|
676317
|
+
resolve: resolve45,
|
|
676191
676318
|
totalBytesRead: 0,
|
|
676192
676319
|
selectedBytes: 0,
|
|
676193
676320
|
truncatedByBytes: false,
|
|
@@ -677805,7 +677932,7 @@ async function acquireQueueLockWithRetry(timeoutMs = 1e4) {
|
|
|
677805
677932
|
do {
|
|
677806
677933
|
if (await acquireQueueLock())
|
|
677807
677934
|
return true;
|
|
677808
|
-
await new Promise((
|
|
677935
|
+
await new Promise((resolve45) => setTimeout(resolve45, 25));
|
|
677809
677936
|
} while (Date.now() < deadline);
|
|
677810
677937
|
return false;
|
|
677811
677938
|
}
|
|
@@ -679518,7 +679645,7 @@ async function postJson(url5, body, headers, maxAttempts = 3) {
|
|
|
679518
679645
|
for (let attempt = 0;attempt < maxAttempts; attempt++) {
|
|
679519
679646
|
if (attempt > 0) {
|
|
679520
679647
|
const delay4 = 5000 * 2 ** (attempt - 1);
|
|
679521
|
-
await new Promise((
|
|
679648
|
+
await new Promise((resolve45) => setTimeout(resolve45, delay4));
|
|
679522
679649
|
}
|
|
679523
679650
|
const controller = new AbortController;
|
|
679524
679651
|
const timer = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS2);
|
|
@@ -688428,7 +688555,7 @@ var init_findRelevantMemories = __esm(() => {
|
|
|
688428
688555
|
|
|
688429
688556
|
// src/utils/attachments.ts
|
|
688430
688557
|
import { readdir as readdir25, stat as stat37 } from "fs/promises";
|
|
688431
|
-
import { dirname as dirname60, parse as parse25, relative as
|
|
688558
|
+
import { dirname as dirname60, parse as parse25, relative as relative24, resolve as resolve45 } from "path";
|
|
688432
688559
|
import { randomUUID as randomUUID40 } from "crypto";
|
|
688433
688560
|
async function getAttachments(input4, toolUseContext, ideSelection, queuedCommands, messages, querySource, options) {
|
|
688434
688561
|
if (isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_ATTACHMENTS) || isEnvTruthy(process.env.CLAUDE_CODE_SIMPLE)) {
|
|
@@ -688887,12 +689014,12 @@ async function getSelectedLinesFromIDE(ideSelection, toolUseContext) {
|
|
|
688887
689014
|
lineEnd: ideSelection.lineStart + ideSelection.lineCount - 1,
|
|
688888
689015
|
filename: ideSelection.filePath,
|
|
688889
689016
|
content: ideSelection.text,
|
|
688890
|
-
displayPath:
|
|
689017
|
+
displayPath: relative24(getCwd(), ideSelection.filePath)
|
|
688891
689018
|
}
|
|
688892
689019
|
];
|
|
688893
689020
|
}
|
|
688894
689021
|
function getDirectoriesToProcess(targetPath, originalCwd) {
|
|
688895
|
-
const targetDir = dirname60(
|
|
689022
|
+
const targetDir = dirname60(resolve45(targetPath));
|
|
688896
689023
|
const nestedDirs = [];
|
|
688897
689024
|
let currentDir = targetDir;
|
|
688898
689025
|
while (currentDir !== originalCwd && currentDir !== parse25(currentDir).root) {
|
|
@@ -688926,7 +689053,7 @@ function memoryFilesToAttachments(memoryFiles, toolUseContext, triggerFilePath)
|
|
|
688926
689053
|
type: "nested_memory",
|
|
688927
689054
|
path: memoryFile.path,
|
|
688928
689055
|
content: memoryFile,
|
|
688929
|
-
displayPath:
|
|
689056
|
+
displayPath: relative24(getCwd(), memoryFile.path)
|
|
688930
689057
|
});
|
|
688931
689058
|
toolUseContext.loadedNestedMemoryPaths?.add(memoryFile.path);
|
|
688932
689059
|
toolUseContext.readFileState.set(memoryFile.path, {
|
|
@@ -689022,7 +689149,7 @@ async function processAtMentionedFiles(input4, toolUseContext) {
|
|
|
689022
689149
|
type: "directory",
|
|
689023
689150
|
path: absoluteFilename,
|
|
689024
689151
|
content: stdout,
|
|
689025
|
-
displayPath:
|
|
689152
|
+
displayPath: relative24(getCwd(), absoluteFilename)
|
|
689026
689153
|
};
|
|
689027
689154
|
} catch {
|
|
689028
689155
|
return null;
|
|
@@ -689352,7 +689479,7 @@ async function getDynamicSkillAttachments(toolUseContext) {
|
|
|
689352
689479
|
const candidates = entries.filter((e7) => e7.isDirectory() || e7.isSymbolicLink()).map((e7) => e7.name).filter((name3) => !name3.startsWith("."));
|
|
689353
689480
|
const checked = await Promise.all(candidates.map(async (name3) => {
|
|
689354
689481
|
try {
|
|
689355
|
-
await stat37(
|
|
689482
|
+
await stat37(resolve45(skillDir, name3, "SKILL.md"));
|
|
689356
689483
|
return name3;
|
|
689357
689484
|
} catch {
|
|
689358
689485
|
return null;
|
|
@@ -689372,7 +689499,7 @@ async function getDynamicSkillAttachments(toolUseContext) {
|
|
|
689372
689499
|
type: "dynamic_skill",
|
|
689373
689500
|
skillDir,
|
|
689374
689501
|
skillNames,
|
|
689375
|
-
displayPath:
|
|
689502
|
+
displayPath: relative24(getCwd(), skillDir)
|
|
689376
689503
|
});
|
|
689377
689504
|
}
|
|
689378
689505
|
}
|
|
@@ -689572,7 +689699,7 @@ async function tryGetPDFReference(filename) {
|
|
|
689572
689699
|
filename,
|
|
689573
689700
|
pageCount: effectivePageCount,
|
|
689574
689701
|
fileSize: stats.size,
|
|
689575
|
-
displayPath:
|
|
689702
|
+
displayPath: relative24(getCwd(), filename)
|
|
689576
689703
|
};
|
|
689577
689704
|
}
|
|
689578
689705
|
} catch {}
|
|
@@ -689612,7 +689739,7 @@ async function generateFileAttachment(filename, toolUseContext, successEventName
|
|
|
689612
689739
|
return {
|
|
689613
689740
|
type: "already_read_file",
|
|
689614
689741
|
filename,
|
|
689615
|
-
displayPath:
|
|
689742
|
+
displayPath: relative24(getCwd(), filename),
|
|
689616
689743
|
content: {
|
|
689617
689744
|
type: "text",
|
|
689618
689745
|
file: {
|
|
@@ -689640,7 +689767,7 @@ async function generateFileAttachment(filename, toolUseContext, successEventName
|
|
|
689640
689767
|
return {
|
|
689641
689768
|
type: "compact_file_reference",
|
|
689642
689769
|
filename,
|
|
689643
|
-
displayPath:
|
|
689770
|
+
displayPath: relative24(getCwd(), filename)
|
|
689644
689771
|
};
|
|
689645
689772
|
}
|
|
689646
689773
|
const appState2 = toolUseContext.getAppState();
|
|
@@ -689660,7 +689787,7 @@ async function generateFileAttachment(filename, toolUseContext, successEventName
|
|
|
689660
689787
|
filename,
|
|
689661
689788
|
content: result.data,
|
|
689662
689789
|
truncated: true,
|
|
689663
|
-
displayPath:
|
|
689790
|
+
displayPath: relative24(getCwd(), filename)
|
|
689664
689791
|
};
|
|
689665
689792
|
} catch {
|
|
689666
689793
|
logEvent(errorEventName, {});
|
|
@@ -689678,7 +689805,7 @@ async function generateFileAttachment(filename, toolUseContext, successEventName
|
|
|
689678
689805
|
type: "file",
|
|
689679
689806
|
filename,
|
|
689680
689807
|
content: result.data,
|
|
689681
|
-
displayPath:
|
|
689808
|
+
displayPath: relative24(getCwd(), filename)
|
|
689682
689809
|
};
|
|
689683
689810
|
} catch (error100) {
|
|
689684
689811
|
if (error100 instanceof MaxFileReadTokenExceededError || error100 instanceof FileTooLargeError) {
|
|
@@ -691350,10 +691477,10 @@ var init_marketplaceHelpers = __esm(() => {
|
|
|
691350
691477
|
|
|
691351
691478
|
// src/utils/plugins/officialMarketplaceGcs.ts
|
|
691352
691479
|
import { chmod as chmod10, mkdir as mkdir44, readFile as readFile56, rename as rename10, rm as rm12, writeFile as writeFile48 } from "fs/promises";
|
|
691353
|
-
import { dirname as dirname63, join as join147, resolve as
|
|
691480
|
+
import { dirname as dirname63, join as join147, resolve as resolve46, sep as sep27 } from "path";
|
|
691354
691481
|
async function fetchOfficialMarketplaceFromGcs(installLocation, marketplacesCacheDir) {
|
|
691355
|
-
const cacheDir =
|
|
691356
|
-
const resolvedLoc =
|
|
691482
|
+
const cacheDir = resolve46(marketplacesCacheDir);
|
|
691483
|
+
const resolvedLoc = resolve46(installLocation);
|
|
691357
691484
|
if (resolvedLoc !== cacheDir && !resolvedLoc.startsWith(cacheDir + sep27)) {
|
|
691358
691485
|
logForDebugging(`fetchOfficialMarketplaceFromGcs: refusing path outside cache dir: ${installLocation}`, { level: "error" });
|
|
691359
691486
|
return null;
|
|
@@ -691472,7 +691599,7 @@ var init_officialMarketplaceGcs = __esm(() => {
|
|
|
691472
691599
|
|
|
691473
691600
|
// src/utils/plugins/marketplaceManager.ts
|
|
691474
691601
|
import { writeFile as writeFile49 } from "fs/promises";
|
|
691475
|
-
import { basename as basename36, dirname as dirname64, isAbsolute as
|
|
691602
|
+
import { basename as basename36, dirname as dirname64, isAbsolute as isAbsolute30, join as join148, resolve as resolve47, sep as sep28 } from "path";
|
|
691476
691603
|
function getKnownMarketplacesFile() {
|
|
691477
691604
|
return join148(getPluginsDirectory(), "known_marketplaces.json");
|
|
691478
691605
|
}
|
|
@@ -692217,14 +692344,14 @@ async function loadAndCacheMarketplace(source, onProgress) {
|
|
|
692217
692344
|
throw new Error("NPM marketplace sources not yet implemented");
|
|
692218
692345
|
}
|
|
692219
692346
|
case "file": {
|
|
692220
|
-
const absPath =
|
|
692347
|
+
const absPath = resolve47(source.path);
|
|
692221
692348
|
marketplacePath = absPath;
|
|
692222
692349
|
temporaryCachePath = dirname64(dirname64(absPath));
|
|
692223
692350
|
cleanupNeeded = false;
|
|
692224
692351
|
break;
|
|
692225
692352
|
}
|
|
692226
692353
|
case "directory": {
|
|
692227
|
-
const absPath =
|
|
692354
|
+
const absPath = resolve47(source.path);
|
|
692228
692355
|
marketplacePath = join148(absPath, ".claude-plugin", "marketplace.json");
|
|
692229
692356
|
temporaryCachePath = absPath;
|
|
692230
692357
|
cleanupNeeded = false;
|
|
@@ -692256,8 +692383,8 @@ async function loadAndCacheMarketplace(source, onProgress) {
|
|
|
692256
692383
|
throw new Error(`Failed to parse marketplace file at ${marketplacePath}: ${errorMessage(e7)}`);
|
|
692257
692384
|
}
|
|
692258
692385
|
const finalCachePath = join148(cacheDir, marketplace.name);
|
|
692259
|
-
const resolvedFinal =
|
|
692260
|
-
const resolvedCacheDir =
|
|
692386
|
+
const resolvedFinal = resolve47(finalCachePath);
|
|
692387
|
+
const resolvedCacheDir = resolve47(cacheDir);
|
|
692261
692388
|
if (!resolvedFinal.startsWith(resolvedCacheDir + sep28)) {
|
|
692262
692389
|
throw new Error(`Marketplace name '${marketplace.name}' resolves to a path outside the cache directory`);
|
|
692263
692390
|
}
|
|
@@ -692293,8 +692420,8 @@ Technical details: ${errorMsg}`);
|
|
|
692293
692420
|
}
|
|
692294
692421
|
async function addMarketplaceSource(source, onProgress) {
|
|
692295
692422
|
let resolvedSource = source;
|
|
692296
|
-
if (isLocalMarketplaceSource(source) && !
|
|
692297
|
-
resolvedSource = { ...source, path:
|
|
692423
|
+
if (isLocalMarketplaceSource(source) && !isAbsolute30(source.path)) {
|
|
692424
|
+
resolvedSource = { ...source, path: resolve47(source.path) };
|
|
692298
692425
|
}
|
|
692299
692426
|
if (!isSourceAllowedByPolicy(resolvedSource)) {
|
|
692300
692427
|
if (isSourceInBlocklist(resolvedSource)) {
|
|
@@ -692342,9 +692469,9 @@ Tip: The shorthand "${resolvedSource.repo}" assumes github.com. ` + `For interna
|
|
|
692342
692469
|
}
|
|
692343
692470
|
logForDebugging(`Marketplace '${marketplace.name}' exists with different source \u2014 overwriting`);
|
|
692344
692471
|
if (!isLocalMarketplaceSource(oldEntry.source)) {
|
|
692345
|
-
const cacheDir =
|
|
692346
|
-
const resolvedOld =
|
|
692347
|
-
const resolvedNew =
|
|
692472
|
+
const cacheDir = resolve47(getMarketplacesCacheDir());
|
|
692473
|
+
const resolvedOld = resolve47(oldEntry.installLocation);
|
|
692474
|
+
const resolvedNew = resolve47(cachePath);
|
|
692348
692475
|
if (resolvedOld === resolvedNew) {} else if (resolvedOld === cacheDir || resolvedOld.startsWith(cacheDir + sep28)) {
|
|
692349
692476
|
const fs32 = getFsImplementation();
|
|
692350
692477
|
await fs32.rm(oldEntry.installLocation, { recursive: true, force: true });
|
|
@@ -692578,8 +692705,8 @@ async function refreshMarketplace(name3, onProgress, options) {
|
|
|
692578
692705
|
throw new Error(`Marketplace '${name3}' is seed-managed (${seedDir}) and its content is ` + `controlled by the seed image. To update: ask your admin to update the seed.`);
|
|
692579
692706
|
}
|
|
692580
692707
|
if (!isLocalMarketplaceSource(source)) {
|
|
692581
|
-
const cacheDir =
|
|
692582
|
-
const resolvedLoc =
|
|
692708
|
+
const cacheDir = resolve47(getMarketplacesCacheDir());
|
|
692709
|
+
const resolvedLoc = resolve47(installLocation);
|
|
692583
692710
|
if (resolvedLoc !== cacheDir && !resolvedLoc.startsWith(cacheDir + sep28)) {
|
|
692584
692711
|
throw new Error(`Marketplace '${name3}' has a corrupted installLocation ` + `(${installLocation}) \u2014 expected a path inside ${cacheDir}. ` + `This can happen after cross-platform path writes or manual edits ` + `to known_marketplaces.json. ` + `Run: claude plugin marketplace remove "${name3}" and re-add it.`);
|
|
692585
692712
|
}
|
|
@@ -692713,7 +692840,7 @@ var init_marketplaceManager = __esm(() => {
|
|
|
692713
692840
|
if (!entry) {
|
|
692714
692841
|
throw new Error(`Marketplace '${name3}' not found in configuration. Available marketplaces: ${Object.keys(config12).join(", ")}`);
|
|
692715
692842
|
}
|
|
692716
|
-
if (isLocalMarketplaceSource(entry.source) && !
|
|
692843
|
+
if (isLocalMarketplaceSource(entry.source) && !isAbsolute30(entry.source.path)) {
|
|
692717
692844
|
throw new Error(`Marketplace "${name3}" has a relative source path (${entry.source.path}) ` + `in known_marketplaces.json \u2014 this is stale state from an older ` + `CoStrict version. Run 'claude marketplace remove ${name3}' and ` + `re-add it from the original project directory.`);
|
|
692718
692845
|
}
|
|
692719
692846
|
try {
|
|
@@ -693302,14 +693429,14 @@ var init_pluginVersioning = __esm(() => {
|
|
|
693302
693429
|
// src/utils/plugins/pluginInstallationHelpers.ts
|
|
693303
693430
|
import { randomBytes as randomBytes19 } from "crypto";
|
|
693304
693431
|
import { rename as rename11, rm as rm13 } from "fs/promises";
|
|
693305
|
-
import { dirname as dirname66, join as join150, resolve as
|
|
693432
|
+
import { dirname as dirname66, join as join150, resolve as resolve48, sep as sep29 } from "path";
|
|
693306
693433
|
function getCurrentTimestamp() {
|
|
693307
693434
|
return new Date().toISOString();
|
|
693308
693435
|
}
|
|
693309
693436
|
function validatePathWithinBase(basePath, relativePath) {
|
|
693310
|
-
const resolvedPath =
|
|
693311
|
-
const normalizedBase =
|
|
693312
|
-
if (!resolvedPath.startsWith(normalizedBase) && resolvedPath !==
|
|
693437
|
+
const resolvedPath = resolve48(basePath, relativePath);
|
|
693438
|
+
const normalizedBase = resolve48(basePath) + sep29;
|
|
693439
|
+
if (!resolvedPath.startsWith(normalizedBase) && resolvedPath !== resolve48(basePath)) {
|
|
693313
693440
|
throw new Error(`Path traversal detected: "${relativePath}" would escape the base directory`);
|
|
693314
693441
|
}
|
|
693315
693442
|
return resolvedPath;
|
|
@@ -693567,7 +693694,7 @@ import {
|
|
|
693567
693694
|
stat as stat40,
|
|
693568
693695
|
symlink as symlink3
|
|
693569
693696
|
} from "fs/promises";
|
|
693570
|
-
import { basename as basename37, dirname as dirname67, join as join151, relative as
|
|
693697
|
+
import { basename as basename37, dirname as dirname67, join as join151, relative as relative25, resolve as resolve49, sep as sep30 } from "path";
|
|
693571
693698
|
function getPluginCachePath() {
|
|
693572
693699
|
return join151(getPluginsDirectory(), "cache");
|
|
693573
693700
|
}
|
|
@@ -693637,9 +693764,9 @@ async function copyDir(src, dest) {
|
|
|
693637
693764
|
}
|
|
693638
693765
|
const srcPrefix = resolvedSrc.endsWith(sep30) ? resolvedSrc : resolvedSrc + sep30;
|
|
693639
693766
|
if (resolvedTarget.startsWith(srcPrefix) || resolvedTarget === resolvedSrc) {
|
|
693640
|
-
const targetRelativeToSrc =
|
|
693767
|
+
const targetRelativeToSrc = relative25(resolvedSrc, resolvedTarget);
|
|
693641
693768
|
const destTargetPath = join151(dest, targetRelativeToSrc);
|
|
693642
|
-
const relativeLinkPath =
|
|
693769
|
+
const relativeLinkPath = relative25(dirname67(destPath), destTargetPath);
|
|
693643
693770
|
await symlink3(relativeLinkPath, destPath);
|
|
693644
693771
|
} else {
|
|
693645
693772
|
await symlink3(resolvedTarget, destPath);
|
|
@@ -694919,7 +695046,7 @@ async function loadSessionOnlyPlugins(sessionPluginPaths) {
|
|
|
694919
695046
|
const errors14 = [];
|
|
694920
695047
|
for (const [index2, pluginPath] of sessionPluginPaths.entries()) {
|
|
694921
695048
|
try {
|
|
694922
|
-
const resolvedPath =
|
|
695049
|
+
const resolvedPath = resolve49(pluginPath);
|
|
694923
695050
|
if (!await pathExists(resolvedPath)) {
|
|
694924
695051
|
logForDebugging(`Plugin path does not exist: ${resolvedPath}, skipping`, { level: "warn" });
|
|
694925
695052
|
errors14.push({
|
|
@@ -701256,7 +701383,7 @@ async function hasPermissionsToUseToolInner(tool, input4, context40) {
|
|
|
701256
701383
|
};
|
|
701257
701384
|
}
|
|
701258
701385
|
logForDebugging(`[AskUserQuestion] headless mode: waiting ${autoSelectTimeoutSeconds}s before auto-selecting first options`);
|
|
701259
|
-
await new Promise((
|
|
701386
|
+
await new Promise((resolve50) => setTimeout(resolve50, autoSelectTimeoutSeconds * 1000));
|
|
701260
701387
|
if (context40.abortController.signal.aborted) {
|
|
701261
701388
|
throw new AbortError;
|
|
701262
701389
|
}
|
|
@@ -701756,8 +701883,8 @@ __export(exports_permissionSetup, {
|
|
|
701756
701883
|
createDisabledBypassPermissionsContext: () => createDisabledBypassPermissionsContext,
|
|
701757
701884
|
checkAndDisableBypassPermissions: () => checkAndDisableBypassPermissions
|
|
701758
701885
|
});
|
|
701759
|
-
import { relative as
|
|
701760
|
-
import { resolve as
|
|
701886
|
+
import { relative as relative26 } from "path";
|
|
701887
|
+
import { resolve as resolve50 } from "path";
|
|
701761
701888
|
function isDangerousBashPermission(toolName, ruleContent) {
|
|
701762
701889
|
if (toolName !== BASH_TOOL_NAME) {
|
|
701763
701890
|
return false;
|
|
@@ -701860,7 +701987,7 @@ function formatPermissionSource(source) {
|
|
|
701860
701987
|
if (SETTING_SOURCES.includes(source)) {
|
|
701861
701988
|
const filePath = getSettingsFilePathForSource(source);
|
|
701862
701989
|
if (filePath) {
|
|
701863
|
-
const relativePath =
|
|
701990
|
+
const relativePath = relative26(getCwd(), filePath);
|
|
701864
701991
|
return relativePath.length < filePath.length ? relativePath : filePath;
|
|
701865
701992
|
}
|
|
701866
701993
|
}
|
|
@@ -702089,7 +702216,7 @@ function isSymlinkTo({
|
|
|
702089
702216
|
originalCwd
|
|
702090
702217
|
}) {
|
|
702091
702218
|
const { resolvedPath: resolvedProcessPwd, isSymlink: isProcessPwdSymlink } = safeResolvePath(getFsImplementation(), processPwd);
|
|
702092
|
-
return isProcessPwdSymlink ? resolvedProcessPwd ===
|
|
702219
|
+
return isProcessPwdSymlink ? resolvedProcessPwd === resolve50(originalCwd) : false;
|
|
702093
702220
|
}
|
|
702094
702221
|
function initialPermissionModeFromCLI({
|
|
702095
702222
|
permissionModeCli,
|
|
@@ -707387,8 +707514,8 @@ async function detectArchiveFormat(file3, url5) {
|
|
|
707387
707514
|
return detectFormatByUrl(url5) ?? await detectFormatByMagic(file3);
|
|
707388
707515
|
}
|
|
707389
707516
|
async function extractFromTarGz(archive, outDir) {
|
|
707390
|
-
await new Promise((
|
|
707391
|
-
execFile14("tar", ["xzf", archive, "-C", outDir], (err3) => err3 ? reject2(err3) :
|
|
707517
|
+
await new Promise((resolve51, reject2) => {
|
|
707518
|
+
execFile14("tar", ["xzf", archive, "-C", outDir], (err3) => err3 ? reject2(err3) : resolve51());
|
|
707392
707519
|
});
|
|
707393
707520
|
for (const name3 of [BIN_NAME, "cs-cloud"]) {
|
|
707394
707521
|
const p2 = path47.join(outDir, name3);
|
|
@@ -707407,8 +707534,8 @@ async function extractFromZip(archive, outDir) {
|
|
|
707407
707534
|
const zipPath = archive.endsWith(".zip") ? archive : archive + ".zip";
|
|
707408
707535
|
if (zipPath !== archive)
|
|
707409
707536
|
await fsp2.rename(archive, zipPath);
|
|
707410
|
-
await new Promise((
|
|
707411
|
-
execFile14("powershell", ["-NoProfile", "-Command", `Expand-Archive -LiteralPath '${zipPath}' -DestinationPath '${outDir}' -Force`], (err3) => err3 ? reject2(err3) :
|
|
707537
|
+
await new Promise((resolve51, reject2) => {
|
|
707538
|
+
execFile14("powershell", ["-NoProfile", "-Command", `Expand-Archive -LiteralPath '${zipPath}' -DestinationPath '${outDir}' -Force`], (err3) => err3 ? reject2(err3) : resolve51());
|
|
707412
707539
|
}).finally(() => {
|
|
707413
707540
|
if (zipPath !== archive)
|
|
707414
707541
|
fsp2.rename(zipPath, archive).catch(() => {});
|
|
@@ -707422,8 +707549,8 @@ async function extractFromZip(archive, outDir) {
|
|
|
707422
707549
|
}
|
|
707423
707550
|
return bin;
|
|
707424
707551
|
}
|
|
707425
|
-
await new Promise((
|
|
707426
|
-
execFile14("unzip", ["-o", archive, "-d", outDir], (err3) => err3 ? reject2(err3) :
|
|
707552
|
+
await new Promise((resolve51, reject2) => {
|
|
707553
|
+
execFile14("unzip", ["-o", archive, "-d", outDir], (err3) => err3 ? reject2(err3) : resolve51());
|
|
707427
707554
|
});
|
|
707428
707555
|
for (const name3 of [BIN_NAME, "cs-cloud"]) {
|
|
707429
707556
|
const p2 = path47.join(outDir, name3);
|
|
@@ -707487,8 +707614,8 @@ async function downloadToTemp(url5, expectedSha256, totalSize) {
|
|
|
707487
707614
|
if (totalSize)
|
|
707488
707615
|
process.stdout.write("\r");
|
|
707489
707616
|
ws.end();
|
|
707490
|
-
await new Promise((
|
|
707491
|
-
ws.on("finish",
|
|
707617
|
+
await new Promise((resolve51, reject2) => {
|
|
707618
|
+
ws.on("finish", resolve51);
|
|
707492
707619
|
ws.on("error", reject2);
|
|
707493
707620
|
});
|
|
707494
707621
|
if (hash4 && expectedSha256) {
|
|
@@ -707521,12 +707648,12 @@ async function ensureCsCloud() {
|
|
|
707521
707648
|
await fsp2.unlink(archive).catch(() => {});
|
|
707522
707649
|
}
|
|
707523
707650
|
if (process.platform === "darwin") {
|
|
707524
|
-
await new Promise((
|
|
707651
|
+
await new Promise((resolve51, reject2) => {
|
|
707525
707652
|
execFile14("xattr", ["-d", "com.apple.quarantine", bin], (err3) => {
|
|
707526
707653
|
if (err3 && !err3.message?.includes("NO SUCH"))
|
|
707527
707654
|
reject2(err3);
|
|
707528
707655
|
else
|
|
707529
|
-
|
|
707656
|
+
resolve51();
|
|
707530
707657
|
});
|
|
707531
707658
|
});
|
|
707532
707659
|
}
|
|
@@ -707549,15 +707676,15 @@ async function runCsCloud(args) {
|
|
|
707549
707676
|
shell: false,
|
|
707550
707677
|
detached: false
|
|
707551
707678
|
});
|
|
707552
|
-
const code = await new Promise((
|
|
707679
|
+
const code = await new Promise((resolve51) => {
|
|
707553
707680
|
child.on("error", (err3) => {
|
|
707554
707681
|
console.error(t("cli.cloud.failedToRun", { error: err3.message }));
|
|
707555
|
-
|
|
707682
|
+
resolve51(1);
|
|
707556
707683
|
});
|
|
707557
|
-
child.on("exit",
|
|
707684
|
+
child.on("exit", resolve51);
|
|
707558
707685
|
child.on("disconnect", () => {
|
|
707559
707686
|
console.error(t("cli.cloud.disconnected"));
|
|
707560
|
-
|
|
707687
|
+
resolve51(1);
|
|
707561
707688
|
});
|
|
707562
707689
|
});
|
|
707563
707690
|
process.exit(code ?? 1);
|
|
@@ -707646,7 +707773,7 @@ async function probeStatus(opts) {
|
|
|
707646
707773
|
return status;
|
|
707647
707774
|
}
|
|
707648
707775
|
function runStatusJson(bin) {
|
|
707649
|
-
return new Promise((
|
|
707776
|
+
return new Promise((resolve51) => {
|
|
707650
707777
|
const args = ["status", "--json", ...getEnvStatusArgs()];
|
|
707651
707778
|
const child = spawn12(bin, args, {
|
|
707652
707779
|
stdio: ["ignore", "pipe", "pipe"],
|
|
@@ -707664,11 +707791,11 @@ function runStatusJson(bin) {
|
|
|
707664
707791
|
});
|
|
707665
707792
|
child.on("error", (err3) => {
|
|
707666
707793
|
logError3(err3);
|
|
707667
|
-
|
|
707794
|
+
resolve51({ running: false, reason: "spawn-failed" });
|
|
707668
707795
|
});
|
|
707669
707796
|
child.on("exit", (code) => {
|
|
707670
707797
|
if (code !== 0) {
|
|
707671
|
-
|
|
707798
|
+
resolve51({
|
|
707672
707799
|
running: false,
|
|
707673
707800
|
reason: `exit-${code}`
|
|
707674
707801
|
});
|
|
@@ -707676,10 +707803,10 @@ function runStatusJson(bin) {
|
|
|
707676
707803
|
}
|
|
707677
707804
|
try {
|
|
707678
707805
|
const parsed = JSON.parse(stdout.trim());
|
|
707679
|
-
|
|
707806
|
+
resolve51(parsed);
|
|
707680
707807
|
} catch (err3) {
|
|
707681
707808
|
logError3(err3);
|
|
707682
|
-
|
|
707809
|
+
resolve51({ running: false, reason: "parse-failed" });
|
|
707683
707810
|
}
|
|
707684
707811
|
});
|
|
707685
707812
|
});
|
|
@@ -707688,7 +707815,7 @@ function isDaemonUsable(status) {
|
|
|
707688
707815
|
return status.running === true && status.authenticated === true && typeof status.device_id === "string" && status.device_id.length > 0 && typeof status.local_url === "string" && status.local_url.length > 0;
|
|
707689
707816
|
}
|
|
707690
707817
|
function spawnDaemonStart(bin) {
|
|
707691
|
-
return new Promise((
|
|
707818
|
+
return new Promise((resolve51, reject2) => {
|
|
707692
707819
|
const args = ["start", ...getEnvStartArgs()];
|
|
707693
707820
|
const child = spawn12(bin, args, {
|
|
707694
707821
|
stdio: "ignore",
|
|
@@ -707700,7 +707827,7 @@ function spawnDaemonStart(bin) {
|
|
|
707700
707827
|
child.once("error", reject2);
|
|
707701
707828
|
child.unref();
|
|
707702
707829
|
setTimeout(() => {
|
|
707703
|
-
|
|
707830
|
+
resolve51();
|
|
707704
707831
|
}, SPAWN_WARMUP_MS);
|
|
707705
707832
|
});
|
|
707706
707833
|
}
|
|
@@ -707733,7 +707860,7 @@ async function ensureDaemonReady() {
|
|
|
707733
707860
|
const maxAttempts = Math.max(1, Math.ceil(timeoutMs / START_RETRY_INTERVAL_MS));
|
|
707734
707861
|
csbridgeDebug("ensureDaemonReady", `will retry ${maxAttempts} times @ ${START_RETRY_INTERVAL_MS}ms`);
|
|
707735
707862
|
for (let i10 = 0;i10 < maxAttempts; i10++) {
|
|
707736
|
-
await new Promise((
|
|
707863
|
+
await new Promise((resolve51) => setTimeout(resolve51, START_RETRY_INTERVAL_MS));
|
|
707737
707864
|
status = await probeStatus({ force: true });
|
|
707738
707865
|
if (isDaemonUsable(status)) {
|
|
707739
707866
|
csbridgeDebug("ensureDaemonReady", `usable after ${i10 + 1} retries`);
|
|
@@ -708767,7 +708894,7 @@ function Feedback({
|
|
|
708767
708894
|
platform: env4.platform,
|
|
708768
708895
|
gitRepo: envInfo.isGit,
|
|
708769
708896
|
terminal: env4.terminal,
|
|
708770
|
-
version: "4.2.
|
|
708897
|
+
version: "4.2.20",
|
|
708771
708898
|
transcript: normalizeMessagesForAPI(messages),
|
|
708772
708899
|
errors: sanitizedErrors,
|
|
708773
708900
|
lastApiRequest: getLastAPIRequest(),
|
|
@@ -708950,7 +709077,7 @@ function Feedback({
|
|
|
708950
709077
|
", ",
|
|
708951
709078
|
env4.terminal,
|
|
708952
709079
|
", v",
|
|
708953
|
-
"4.2.
|
|
709080
|
+
"4.2.20"
|
|
708954
709081
|
]
|
|
708955
709082
|
})
|
|
708956
709083
|
]
|
|
@@ -709047,7 +709174,7 @@ ${sanitizedDescription}
|
|
|
709047
709174
|
` + `**Environment Info**
|
|
709048
709175
|
` + `- Platform: ${env4.platform}
|
|
709049
709176
|
` + `- Terminal: ${env4.terminal}
|
|
709050
|
-
` + `- Version: ${"4.2.
|
|
709177
|
+
` + `- Version: ${"4.2.20"}
|
|
709051
709178
|
` + `- Feedback ID: ${feedbackId}
|
|
709052
709179
|
` + `
|
|
709053
709180
|
**Errors**
|
|
@@ -709304,8 +709431,8 @@ class FileIndex {
|
|
|
709304
709431
|
}
|
|
709305
709432
|
loadFromFileListAsync(fileList) {
|
|
709306
709433
|
let markQueryable = () => {};
|
|
709307
|
-
const queryable = new Promise((
|
|
709308
|
-
markQueryable =
|
|
709434
|
+
const queryable = new Promise((resolve51) => {
|
|
709435
|
+
markQueryable = resolve51;
|
|
709309
709436
|
});
|
|
709310
709437
|
const done = this.buildAsync(fileList, markQueryable);
|
|
709311
709438
|
return { queryable, done };
|
|
@@ -709511,7 +709638,7 @@ function isUpper(code) {
|
|
|
709511
709638
|
return code >= 65 && code <= 90;
|
|
709512
709639
|
}
|
|
709513
709640
|
function yieldToEventLoop() {
|
|
709514
|
-
return new Promise((
|
|
709641
|
+
return new Promise((resolve51) => setImmediate(resolve51));
|
|
709515
709642
|
}
|
|
709516
709643
|
function computeTopLevelEntries(paths2, limit2) {
|
|
709517
709644
|
const topLevel = new Set;
|
|
@@ -711286,7 +711413,7 @@ function buildPrimarySection() {
|
|
|
711286
711413
|
children: t("settings.status.renameHint")
|
|
711287
711414
|
});
|
|
711288
711415
|
return [
|
|
711289
|
-
{ label: t("settings.status.version"), value: "4.2.
|
|
711416
|
+
{ label: t("settings.status.version"), value: "4.2.20" },
|
|
711290
711417
|
{ label: t("settings.status.sessionName"), value: nameValue },
|
|
711291
711418
|
{ label: t("settings.status.sessionId"), value: sessionId },
|
|
711292
711419
|
{ label: t("settings.status.cwd"), value: getCwd() },
|
|
@@ -714144,7 +714271,7 @@ function Config({
|
|
|
714144
714271
|
}
|
|
714145
714272
|
})
|
|
714146
714273
|
}) : showSubmenu === "ChannelDowngrade" ? /* @__PURE__ */ jsx_runtime191.jsx(ChannelDowngradeDialog, {
|
|
714147
|
-
currentVersion: "4.2.
|
|
714274
|
+
currentVersion: "4.2.20",
|
|
714148
714275
|
onChoice: (choice) => {
|
|
714149
714276
|
setShowSubmenu(null);
|
|
714150
714277
|
setTabsHidden(false);
|
|
@@ -714156,7 +714283,7 @@ function Config({
|
|
|
714156
714283
|
autoUpdatesChannel: "stable"
|
|
714157
714284
|
};
|
|
714158
714285
|
if (choice === "stay") {
|
|
714159
|
-
newSettings.minimumVersion = "4.2.
|
|
714286
|
+
newSettings.minimumVersion = "4.2.20";
|
|
714160
714287
|
}
|
|
714161
714288
|
updateSettingsForSource("userSettings", newSettings);
|
|
714162
714289
|
setSettingsData((prev) => ({
|
|
@@ -716463,7 +716590,7 @@ var init_useTurnDiffs = __esm(() => {
|
|
|
716463
716590
|
});
|
|
716464
716591
|
|
|
716465
716592
|
// src/components/diff/DiffDetailView.tsx
|
|
716466
|
-
import { resolve as
|
|
716593
|
+
import { resolve as resolve51 } from "path";
|
|
716467
716594
|
function DiffDetailView({
|
|
716468
716595
|
filePath,
|
|
716469
716596
|
hunks,
|
|
@@ -716477,7 +716604,7 @@ function DiffDetailView({
|
|
|
716477
716604
|
if (!filePath) {
|
|
716478
716605
|
return { firstLine: null, fileContent: undefined };
|
|
716479
716606
|
}
|
|
716480
|
-
const fullPath =
|
|
716607
|
+
const fullPath = resolve51(getCwd(), filePath);
|
|
716481
716608
|
const content = readFileSafe(fullPath);
|
|
716482
716609
|
return {
|
|
716483
716610
|
firstLine: content?.split(`
|
|
@@ -718840,12 +718967,12 @@ var init_MemoryFileSelector = __esm(() => {
|
|
|
718840
718967
|
|
|
718841
718968
|
// src/components/memory/MemoryUpdateNotification.tsx
|
|
718842
718969
|
import { homedir as homedir38 } from "os";
|
|
718843
|
-
import { relative as
|
|
718970
|
+
import { relative as relative28 } from "path";
|
|
718844
718971
|
function getRelativeMemoryPath(path50) {
|
|
718845
718972
|
const homeDir = homedir38();
|
|
718846
718973
|
const cwd2 = getCwd();
|
|
718847
718974
|
const relativeToHome = path50.startsWith(homeDir) ? "~" + path50.slice(homeDir.length) : null;
|
|
718848
|
-
const relativeToCwd = path50.startsWith(cwd2) ? "./" +
|
|
718975
|
+
const relativeToCwd = path50.startsWith(cwd2) ? "./" + relative28(cwd2, path50) : null;
|
|
718849
718976
|
if (relativeToHome && relativeToCwd) {
|
|
718850
718977
|
return relativeToHome.length <= relativeToCwd.length ? relativeToHome : relativeToCwd;
|
|
718851
718978
|
}
|
|
@@ -719625,7 +719752,7 @@ function HelpV2({ onClose, commands: commands11 }) {
|
|
|
719625
719752
|
color: "professionalBlue",
|
|
719626
719753
|
children: [
|
|
719627
719754
|
/* @__PURE__ */ jsx_runtime218.jsx(Tabs, {
|
|
719628
|
-
title: process.env.USER_TYPE === "sf" ? "/help" : `CoStrict v${"4.2.
|
|
719755
|
+
title: process.env.USER_TYPE === "sf" ? "/help" : `CoStrict v${"4.2.20"}`,
|
|
719629
719756
|
color: "professionalBlue",
|
|
719630
719757
|
defaultTab: "general",
|
|
719631
719758
|
children: tabs
|
|
@@ -731489,8 +731616,8 @@ function useManageMCPConnections(dynamicMcpConfig, isStrictMcpConfig = false) {
|
|
|
731489
731616
|
}
|
|
731490
731617
|
const backoffMs = Math.min(INITIAL_BACKOFF_MS * 2 ** (attempt - 1), MAX_BACKOFF_MS);
|
|
731491
731618
|
logMCPDebug(client10.name, `Scheduling reconnection attempt ${attempt + 1} in ${backoffMs}ms`);
|
|
731492
|
-
await new Promise((
|
|
731493
|
-
const timer = setTimeout(
|
|
731619
|
+
await new Promise((resolve52) => {
|
|
731620
|
+
const timer = setTimeout(resolve52, backoffMs);
|
|
731494
731621
|
reconnectTimersRef.current.set(client10.name, timer);
|
|
731495
731622
|
});
|
|
731496
731623
|
}
|
|
@@ -733925,7 +734052,7 @@ var init_pluginStartupCheck = __esm(() => {
|
|
|
733925
734052
|
|
|
733926
734053
|
// src/utils/plugins/parseMarketplaceInput.ts
|
|
733927
734054
|
import { homedir as homedir39 } from "os";
|
|
733928
|
-
import { resolve as
|
|
734055
|
+
import { resolve as resolve52 } from "path";
|
|
733929
734056
|
async function parseMarketplaceInput(input4) {
|
|
733930
734057
|
const trimmed = input4.trim();
|
|
733931
734058
|
const fs33 = getFsImplementation();
|
|
@@ -733960,7 +734087,7 @@ async function parseMarketplaceInput(input4) {
|
|
|
733960
734087
|
const isWindows3 = process.platform === "win32";
|
|
733961
734088
|
const isWindowsPath = isWindows3 && (trimmed.startsWith(".\\") || trimmed.startsWith("..\\") || /^[a-zA-Z]:[/\\]/.test(trimmed));
|
|
733962
734089
|
if (trimmed.startsWith("./") || trimmed.startsWith("../") || trimmed.startsWith("/") || trimmed.startsWith("~") || isWindowsPath) {
|
|
733963
|
-
const resolvedPath =
|
|
734090
|
+
const resolvedPath = resolve52(trimmed.startsWith("~") ? trimmed.replace(/^~/, homedir39()) : trimmed);
|
|
733964
734091
|
let stats;
|
|
733965
734092
|
try {
|
|
733966
734093
|
stats = await fs33.stat(resolvedPath);
|
|
@@ -742626,7 +742753,7 @@ function getAllReleaseNotes(changelogContent = getStoredChangelogFromMemory()) {
|
|
|
742626
742753
|
return [];
|
|
742627
742754
|
}
|
|
742628
742755
|
}
|
|
742629
|
-
async function checkForReleaseNotes(lastSeenVersion, currentVersion = "4.2.
|
|
742756
|
+
async function checkForReleaseNotes(lastSeenVersion, currentVersion = "4.2.20") {
|
|
742630
742757
|
if (process.env.USER_TYPE === "sf") {
|
|
742631
742758
|
const changelog = "";
|
|
742632
742759
|
if (changelog) {
|
|
@@ -742653,7 +742780,7 @@ async function checkForReleaseNotes(lastSeenVersion, currentVersion = "4.2.19")
|
|
|
742653
742780
|
releaseNotes
|
|
742654
742781
|
};
|
|
742655
742782
|
}
|
|
742656
|
-
function checkForReleaseNotesSync(lastSeenVersion, currentVersion = "4.2.
|
|
742783
|
+
function checkForReleaseNotesSync(lastSeenVersion, currentVersion = "4.2.20") {
|
|
742657
742784
|
if (process.env.USER_TYPE === "sf") {
|
|
742658
742785
|
const changelog = "";
|
|
742659
742786
|
if (changelog) {
|
|
@@ -745166,7 +745293,7 @@ function isNotLoggedIn() {
|
|
|
745166
745293
|
return true;
|
|
745167
745294
|
}
|
|
745168
745295
|
function getLogoDisplayData() {
|
|
745169
|
-
const version10 = process.env.DEMO_VERSION ?? "4.2.
|
|
745296
|
+
const version10 = process.env.DEMO_VERSION ?? "4.2.20";
|
|
745170
745297
|
const serverUrl = getDirectConnectServerUrl();
|
|
745171
745298
|
const displayPath = process.env.DEMO_VERSION ? "/code/claude" : getDisplayPath(getCwd());
|
|
745172
745299
|
const cwd2 = serverUrl ? `${displayPath} in ${serverUrl.replace(/^https?:\/\//, "")}` : displayPath;
|
|
@@ -745744,7 +745871,7 @@ var init_MatrixMessageLine = __esm(() => {
|
|
|
745744
745871
|
// src/components/matrix-tactical/MatrixWelcome.tsx
|
|
745745
745872
|
import { basename as basename47 } from "path";
|
|
745746
745873
|
function MatrixWelcome({
|
|
745747
|
-
version: version10 = "4.2.
|
|
745874
|
+
version: version10 = "4.2.20",
|
|
745748
745875
|
projectName,
|
|
745749
745876
|
cwd: cwd2,
|
|
745750
745877
|
modelDisplayName,
|
|
@@ -746379,13 +746506,13 @@ function LogoV2() {
|
|
|
746379
746506
|
const { hasReleaseNotes } = checkForReleaseNotesSync(config13.lastReleaseNotesSeen);
|
|
746380
746507
|
import_react167.useEffect(() => {
|
|
746381
746508
|
const currentConfig = getGlobalConfig();
|
|
746382
|
-
if (currentConfig.lastReleaseNotesSeen === "4.2.
|
|
746509
|
+
if (currentConfig.lastReleaseNotesSeen === "4.2.20") {
|
|
746383
746510
|
return;
|
|
746384
746511
|
}
|
|
746385
746512
|
saveGlobalConfig((current2) => {
|
|
746386
|
-
if (current2.lastReleaseNotesSeen === "4.2.
|
|
746513
|
+
if (current2.lastReleaseNotesSeen === "4.2.20")
|
|
746387
746514
|
return current2;
|
|
746388
|
-
return { ...current2, lastReleaseNotesSeen: "4.2.
|
|
746515
|
+
return { ...current2, lastReleaseNotesSeen: "4.2.20" };
|
|
746389
746516
|
});
|
|
746390
746517
|
if (showOnboarding) {
|
|
746391
746518
|
incrementProjectOnboardingSeenCount();
|
|
@@ -747110,7 +747237,7 @@ var init_nullRenderingAttachments = __esm(() => {
|
|
|
747110
747237
|
});
|
|
747111
747238
|
|
|
747112
747239
|
// src/utils/statusNoticeDefinitions.tsx
|
|
747113
|
-
import { relative as
|
|
747240
|
+
import { relative as relative29 } from "path";
|
|
747114
747241
|
function getActiveNotices(context41) {
|
|
747115
747242
|
return statusNoticeDefinitions.filter((notice) => notice.isActive(context41));
|
|
747116
747243
|
}
|
|
@@ -747136,7 +747263,7 @@ var init_statusNoticeDefinitions = __esm(() => {
|
|
|
747136
747263
|
const largeMemoryFiles = getLargeMemoryFiles(ctx.memoryFiles);
|
|
747137
747264
|
return /* @__PURE__ */ jsx_runtime265.jsx(jsx_runtime265.Fragment, {
|
|
747138
747265
|
children: largeMemoryFiles.map((file3) => {
|
|
747139
|
-
const displayPath = file3.path.startsWith(getCwd()) ?
|
|
747266
|
+
const displayPath = file3.path.startsWith(getCwd()) ? relative29(getCwd(), file3.path) : file3.path;
|
|
747140
747267
|
return /* @__PURE__ */ jsx_runtime265.jsxs(ThemedBox_default, {
|
|
747141
747268
|
flexDirection: "row",
|
|
747142
747269
|
children: [
|
|
@@ -755725,10 +755852,10 @@ var require_browser2 = __commonJS((exports) => {
|
|
|
755725
755852
|
text2 = canvas;
|
|
755726
755853
|
canvas = undefined;
|
|
755727
755854
|
}
|
|
755728
|
-
return new Promise(function(
|
|
755855
|
+
return new Promise(function(resolve54, reject2) {
|
|
755729
755856
|
try {
|
|
755730
755857
|
const data = QRCode.create(text2, opts);
|
|
755731
|
-
|
|
755858
|
+
resolve54(renderFunc(data, canvas, opts));
|
|
755732
755859
|
} catch (e7) {
|
|
755733
755860
|
reject2(e7);
|
|
755734
755861
|
}
|
|
@@ -755784,11 +755911,11 @@ function getStringRendererFromType(type) {
|
|
|
755784
755911
|
}
|
|
755785
755912
|
function render(renderFunc, text2, params) {
|
|
755786
755913
|
if (!params.cb) {
|
|
755787
|
-
return new Promise(function(
|
|
755914
|
+
return new Promise(function(resolve54, reject2) {
|
|
755788
755915
|
try {
|
|
755789
755916
|
const data = QRCode.create(text2, params.opts);
|
|
755790
755917
|
return renderFunc(data, params.opts, function(err3, data2) {
|
|
755791
|
-
return err3 ? reject2(err3) :
|
|
755918
|
+
return err3 ? reject2(err3) : resolve54(data2);
|
|
755792
755919
|
});
|
|
755793
755920
|
} catch (e7) {
|
|
755794
755921
|
reject2(e7);
|
|
@@ -764474,13 +764601,13 @@ var exports_files6 = {};
|
|
|
764474
764601
|
__export(exports_files6, {
|
|
764475
764602
|
call: () => call47
|
|
764476
764603
|
});
|
|
764477
|
-
import { relative as
|
|
764604
|
+
import { relative as relative30 } from "path";
|
|
764478
764605
|
async function call47(_args, context41) {
|
|
764479
764606
|
const files2 = context41.readFileState ? cacheKeys(context41.readFileState) : [];
|
|
764480
764607
|
if (files2.length === 0) {
|
|
764481
764608
|
return { type: "text", value: "No files in context" };
|
|
764482
764609
|
}
|
|
764483
|
-
const fileList = files2.map((file3) =>
|
|
764610
|
+
const fileList = files2.map((file3) => relative30(getCwd(), file3)).join(`
|
|
764484
764611
|
`);
|
|
764485
764612
|
return { type: "text", value: `Files in context:
|
|
764486
764613
|
${fileList}` };
|
|
@@ -768915,7 +769042,7 @@ async function captureMemoryDiagnostics(trigger, dumpNumber = 0) {
|
|
|
768915
769042
|
smapsRollup,
|
|
768916
769043
|
platform: process.platform,
|
|
768917
769044
|
nodeVersion: process.version,
|
|
768918
|
-
ccVersion: "4.2.
|
|
769045
|
+
ccVersion: "4.2.20"
|
|
768919
769046
|
};
|
|
768920
769047
|
}
|
|
768921
769048
|
async function performHeapDump(trigger = "manual", dumpNumber = 0) {
|
|
@@ -769031,7 +769158,7 @@ var init_mock_limits = __esm(() => {
|
|
|
769031
769158
|
var call55 = async () => {
|
|
769032
769159
|
return {
|
|
769033
769160
|
type: "text",
|
|
769034
|
-
value: `${"4.2.
|
|
769161
|
+
value: `${"4.2.20"} (built ${"2026-07-30T04:23:55.080Z"})`
|
|
769035
769162
|
};
|
|
769036
769163
|
}, version10, version_default;
|
|
769037
769164
|
var init_version2 = __esm(() => {
|
|
@@ -771237,7 +771364,7 @@ var exports_sandbox_toggle = {};
|
|
|
771237
771364
|
__export(exports_sandbox_toggle, {
|
|
771238
771365
|
call: () => call60
|
|
771239
771366
|
});
|
|
771240
|
-
import { relative as
|
|
771367
|
+
import { relative as relative31 } from "path";
|
|
771241
771368
|
async function call60(onDone, _context, args) {
|
|
771242
771369
|
const settings = getSettings_DEPRECATED();
|
|
771243
771370
|
const themeName = settings.theme || "light";
|
|
@@ -771279,7 +771406,7 @@ async function call60(onDone, _context, args) {
|
|
|
771279
771406
|
const cleanPattern = commandPattern.replace(/^["']|["']$/gu, "");
|
|
771280
771407
|
addToExcludedCommands(cleanPattern);
|
|
771281
771408
|
const localSettingsPath = getSettingsFilePathForSource("localSettings");
|
|
771282
|
-
const relativePath = localSettingsPath ?
|
|
771409
|
+
const relativePath = localSettingsPath ? relative31(getCwdState(), localSettingsPath) : ".claude/settings.local.json";
|
|
771283
771410
|
const message2 = color("success", themeName)(`Added "${cleanPattern}" to excluded commands in ${relativePath}`);
|
|
771284
771411
|
onDone(message2);
|
|
771285
771412
|
return null;
|
|
@@ -772072,12 +772199,12 @@ async function stopDaemonByPid(name3 = "remote-control", timeoutMs = 1e4) {
|
|
|
772072
772199
|
removeDaemonState(name3);
|
|
772073
772200
|
return true;
|
|
772074
772201
|
}
|
|
772075
|
-
await new Promise((
|
|
772202
|
+
await new Promise((resolve55) => setTimeout(resolve55, pollInterval));
|
|
772076
772203
|
}
|
|
772077
772204
|
try {
|
|
772078
772205
|
process.kill(pid, "SIGKILL");
|
|
772079
772206
|
} catch {}
|
|
772080
|
-
await new Promise((
|
|
772207
|
+
await new Promise((resolve55) => setTimeout(resolve55, 500));
|
|
772081
772208
|
removeDaemonState(name3);
|
|
772082
772209
|
return true;
|
|
772083
772210
|
}
|
|
@@ -772190,12 +772317,12 @@ async function tailLog(logPath) {
|
|
|
772190
772317
|
}
|
|
772191
772318
|
} catch {}
|
|
772192
772319
|
console.log(t("cli.bg.tailWatching"));
|
|
772193
|
-
return new Promise((
|
|
772320
|
+
return new Promise((resolve55) => {
|
|
772194
772321
|
const onSignal = () => {
|
|
772195
772322
|
unwatchFile4(logPath);
|
|
772196
772323
|
process.removeListener("SIGINT", onSignal);
|
|
772197
772324
|
console.log(t("cli.bg.tailDetached"));
|
|
772198
|
-
|
|
772325
|
+
resolve55();
|
|
772199
772326
|
};
|
|
772200
772327
|
process.on("SIGINT", onSignal);
|
|
772201
772328
|
watchFile4(logPath, { interval: 300 }, () => {
|
|
@@ -772552,7 +772679,7 @@ async function killHandler(target) {
|
|
|
772552
772679
|
console.log(t("cli.bg.sessionAlreadyExited", "Session already exited."));
|
|
772553
772680
|
return;
|
|
772554
772681
|
}
|
|
772555
|
-
await new Promise((
|
|
772682
|
+
await new Promise((resolve55) => setTimeout(resolve55, 2000));
|
|
772556
772683
|
if (isProcessRunning(session2.pid)) {
|
|
772557
772684
|
try {
|
|
772558
772685
|
process.kill(session2.pid, "SIGKILL");
|
|
@@ -772867,7 +772994,7 @@ var init_pipeTransport = __esm(() => {
|
|
|
772867
772994
|
await unlink24(this.socketPath);
|
|
772868
772995
|
} catch {}
|
|
772869
772996
|
}
|
|
772870
|
-
await new Promise((
|
|
772997
|
+
await new Promise((resolve55, reject2) => {
|
|
772871
772998
|
this.server = createServer8((socket) => this.setupSocket(socket));
|
|
772872
772999
|
this.server.on("error", reject2);
|
|
772873
773000
|
this.server.listen(this.socketPath, () => {
|
|
@@ -772881,7 +773008,7 @@ var init_pipeTransport = __esm(() => {
|
|
|
772881
773008
|
hostname: hostname5()
|
|
772882
773009
|
})).catch(() => {});
|
|
772883
773010
|
}
|
|
772884
|
-
|
|
773011
|
+
resolve55();
|
|
772885
773012
|
});
|
|
772886
773013
|
});
|
|
772887
773014
|
if (options?.enableTcp) {
|
|
@@ -772889,7 +773016,7 @@ var init_pipeTransport = __esm(() => {
|
|
|
772889
773016
|
}
|
|
772890
773017
|
}
|
|
772891
773018
|
async startTcpServer(port2) {
|
|
772892
|
-
return new Promise((
|
|
773019
|
+
return new Promise((resolve55, reject2) => {
|
|
772893
773020
|
this.tcpServer = createServer8((socket) => this.setupSocket(socket));
|
|
772894
773021
|
this.tcpServer.on("error", reject2);
|
|
772895
773022
|
this.tcpServer.listen(port2, "0.0.0.0", () => {
|
|
@@ -772897,7 +773024,7 @@ var init_pipeTransport = __esm(() => {
|
|
|
772897
773024
|
if (addr && typeof addr === "object") {
|
|
772898
773025
|
this._tcpAddress = { host: "0.0.0.0", port: addr.port };
|
|
772899
773026
|
}
|
|
772900
|
-
|
|
773027
|
+
resolve55();
|
|
772901
773028
|
});
|
|
772902
773029
|
});
|
|
772903
773030
|
}
|
|
@@ -772932,17 +773059,17 @@ var init_pipeTransport = __esm(() => {
|
|
|
772932
773059
|
}
|
|
772933
773060
|
this.clients.clear();
|
|
772934
773061
|
if (this.tcpServer) {
|
|
772935
|
-
await new Promise((
|
|
773062
|
+
await new Promise((resolve55) => {
|
|
772936
773063
|
this.tcpServer.close(() => {
|
|
772937
773064
|
this.tcpServer = null;
|
|
772938
773065
|
this._tcpAddress = null;
|
|
772939
|
-
|
|
773066
|
+
resolve55();
|
|
772940
773067
|
});
|
|
772941
773068
|
});
|
|
772942
773069
|
}
|
|
772943
|
-
return new Promise((
|
|
773070
|
+
return new Promise((resolve55) => {
|
|
772944
773071
|
if (!this.server) {
|
|
772945
|
-
|
|
773072
|
+
resolve55();
|
|
772946
773073
|
return;
|
|
772947
773074
|
}
|
|
772948
773075
|
this.server.close(() => {
|
|
@@ -772953,7 +773080,7 @@ var init_pipeTransport = __esm(() => {
|
|
|
772953
773080
|
} else {
|
|
772954
773081
|
unlink24(this.socketPath).catch(() => {});
|
|
772955
773082
|
}
|
|
772956
|
-
|
|
773083
|
+
resolve55();
|
|
772957
773084
|
});
|
|
772958
773085
|
});
|
|
772959
773086
|
}
|
|
@@ -774084,7 +774211,7 @@ var init_provider3 = __esm(() => {
|
|
|
774084
774211
|
// src/skills/bundledSkills.ts
|
|
774085
774212
|
import { constants as fsConstants7 } from "fs";
|
|
774086
774213
|
import { mkdir as mkdir59, open as open14 } from "fs/promises";
|
|
774087
|
-
import { dirname as dirname78, isAbsolute as
|
|
774214
|
+
import { dirname as dirname78, isAbsolute as isAbsolute31, join as join189, normalize as normalize18, sep as pathSep2 } from "path";
|
|
774088
774215
|
function registerBundledSkill(definition) {
|
|
774089
774216
|
const { files: files3 } = definition;
|
|
774090
774217
|
let skillRoot;
|
|
@@ -774171,7 +774298,7 @@ async function safeWriteFile(p2, content) {
|
|
|
774171
774298
|
}
|
|
774172
774299
|
function resolveSkillFilePath(baseDir, relPath) {
|
|
774173
774300
|
const normalized = normalize18(relPath);
|
|
774174
|
-
if (
|
|
774301
|
+
if (isAbsolute31(normalized) || normalized.split(pathSep2).includes("..") || normalized.split("/").includes("..")) {
|
|
774175
774302
|
throw new Error(`bundled skill file path escapes skill dir: ${relPath}`);
|
|
774176
774303
|
}
|
|
774177
774304
|
return join189(baseDir, normalized);
|
|
@@ -775943,7 +776070,7 @@ var init_installLock = __esm(() => {
|
|
|
775943
776070
|
rename: (from, to) => rename15(from, to),
|
|
775944
776071
|
rm: (dir, options) => rm15(dir, options),
|
|
775945
776072
|
stat: (target) => stat46(target),
|
|
775946
|
-
sleep: (ms) => new Promise((
|
|
776073
|
+
sleep: (ms) => new Promise((resolve55) => setTimeout(resolve55, ms)),
|
|
775947
776074
|
now: () => Date.now(),
|
|
775948
776075
|
pid: process.pid,
|
|
775949
776076
|
isPidAlive: realIsPidAlive
|
|
@@ -776200,7 +776327,7 @@ async function mutateState(fn) {
|
|
|
776200
776327
|
}
|
|
776201
776328
|
async function fetchWithTimeout(costrictFetch, url5) {
|
|
776202
776329
|
const controller = new AbortController;
|
|
776203
|
-
const timeoutId = setTimeout(() => controller.abort(),
|
|
776330
|
+
const timeoutId = setTimeout(() => controller.abort(), FETCH_TIMEOUT_MS7);
|
|
776204
776331
|
try {
|
|
776205
776332
|
const response3 = await costrictFetch(url5, { signal: controller.signal });
|
|
776206
776333
|
return response3;
|
|
@@ -776945,7 +777072,7 @@ async function batchUpdateFavoriteItems(slugs) {
|
|
|
776945
777072
|
}
|
|
776946
777073
|
return { updated, errors: errors14 };
|
|
776947
777074
|
}
|
|
776948
|
-
var FAVORITE_PAGE_SIZE = 20, FAVORITE_MAX_PAGES = 20, FAVORITE_LIST_CACHE_TTL_MS = 30000, _listFavoriteItemsCache = null, STORE_TYPE_MAP, LOCAL_TO_STORE_TYPE,
|
|
777075
|
+
var FAVORITE_PAGE_SIZE = 20, FAVORITE_MAX_PAGES = 20, FAVORITE_LIST_CACHE_TTL_MS = 30000, _listFavoriteItemsCache = null, STORE_TYPE_MAP, LOCAL_TO_STORE_TYPE, FETCH_TIMEOUT_MS7 = 15000, SUPPORTED_MCP_TYPES;
|
|
776949
777076
|
var init_favorite = __esm(() => {
|
|
776950
777077
|
init_fetch2();
|
|
776951
777078
|
init_auth();
|
|
@@ -778349,8 +778476,8 @@ async function withStatsCacheLock(fn) {
|
|
|
778349
778476
|
await statsCacheLockPromise;
|
|
778350
778477
|
}
|
|
778351
778478
|
let releaseLock3;
|
|
778352
|
-
statsCacheLockPromise = new Promise((
|
|
778353
|
-
releaseLock3 =
|
|
778479
|
+
statsCacheLockPromise = new Promise((resolve55) => {
|
|
778480
|
+
releaseLock3 = resolve55;
|
|
778354
778481
|
});
|
|
778355
778482
|
try {
|
|
778356
778483
|
return await fn();
|
|
@@ -781026,7 +781153,7 @@ var init_hostGuard = __esm(() => {
|
|
|
781026
781153
|
|
|
781027
781154
|
// src/commands/agents-platform/agentsApi.ts
|
|
781028
781155
|
function sleep10(ms) {
|
|
781029
|
-
return new Promise((
|
|
781156
|
+
return new Promise((resolve55) => setTimeout(resolve55, ms));
|
|
781030
781157
|
}
|
|
781031
781158
|
async function buildHeaders8() {
|
|
781032
781159
|
let apiKey;
|
|
@@ -781716,11 +781843,11 @@ __export(exports_assistant, {
|
|
|
781716
781843
|
call: () => call77,
|
|
781717
781844
|
NewInstallWizard: () => NewInstallWizard
|
|
781718
781845
|
});
|
|
781719
|
-
import { resolve as
|
|
781846
|
+
import { resolve as resolve55 } from "path";
|
|
781720
781847
|
async function computeDefaultInstallDir() {
|
|
781721
781848
|
const cwd2 = process.cwd();
|
|
781722
781849
|
const gitRoot = findGitRoot(cwd2);
|
|
781723
|
-
return gitRoot ||
|
|
781850
|
+
return gitRoot || resolve55(cwd2);
|
|
781724
781851
|
}
|
|
781725
781852
|
function NewInstallWizard({ defaultDir, onInstalled, onCancel, onError }) {
|
|
781726
781853
|
useRegisterOverlay("assistant-install-wizard");
|
|
@@ -781741,7 +781868,7 @@ function NewInstallWizard({ defaultDir, onInstalled, onCancel, onError }) {
|
|
|
781741
781868
|
if (starting)
|
|
781742
781869
|
return;
|
|
781743
781870
|
setStarting(true);
|
|
781744
|
-
const dir = defaultDir ||
|
|
781871
|
+
const dir = defaultDir || resolve55(".");
|
|
781745
781872
|
try {
|
|
781746
781873
|
const launch = buildCliLaunch(["daemon", "start", `--dir=${dir}`]);
|
|
781747
781874
|
const child = spawnCli(launch, {
|
|
@@ -782085,16 +782212,16 @@ var init_doubaoSTT = __esm(() => {
|
|
|
782085
782212
|
if (chunk2 === null) {
|
|
782086
782213
|
this.done = true;
|
|
782087
782214
|
if (this.waiting) {
|
|
782088
|
-
const
|
|
782215
|
+
const resolve56 = this.waiting;
|
|
782089
782216
|
this.waiting = null;
|
|
782090
|
-
|
|
782217
|
+
resolve56({ value: undefined, done: true });
|
|
782091
782218
|
}
|
|
782092
782219
|
return;
|
|
782093
782220
|
}
|
|
782094
782221
|
if (this.waiting) {
|
|
782095
|
-
const
|
|
782222
|
+
const resolve56 = this.waiting;
|
|
782096
782223
|
this.waiting = null;
|
|
782097
|
-
|
|
782224
|
+
resolve56({ value: chunk2, done: false });
|
|
782098
782225
|
} else {
|
|
782099
782226
|
this.chunks.push(chunk2);
|
|
782100
782227
|
}
|
|
@@ -782103,9 +782230,9 @@ var init_doubaoSTT = __esm(() => {
|
|
|
782103
782230
|
this.done = true;
|
|
782104
782231
|
this.chunks.length = 0;
|
|
782105
782232
|
if (this.waiting) {
|
|
782106
|
-
const
|
|
782233
|
+
const resolve56 = this.waiting;
|
|
782107
782234
|
this.waiting = null;
|
|
782108
|
-
|
|
782235
|
+
resolve56({ value: undefined, done: true });
|
|
782109
782236
|
}
|
|
782110
782237
|
}
|
|
782111
782238
|
[Symbol.asyncIterator]() {
|
|
@@ -782118,8 +782245,8 @@ var init_doubaoSTT = __esm(() => {
|
|
|
782118
782245
|
if (this.done) {
|
|
782119
782246
|
return { value: undefined, done: true };
|
|
782120
782247
|
}
|
|
782121
|
-
return new Promise((
|
|
782122
|
-
this.waiting =
|
|
782248
|
+
return new Promise((resolve56) => {
|
|
782249
|
+
this.waiting = resolve56;
|
|
782123
782250
|
});
|
|
782124
782251
|
}
|
|
782125
782252
|
};
|
|
@@ -782280,7 +782407,7 @@ function useVoice({
|
|
|
782280
782407
|
const keyterms = await getVoiceKeyterms();
|
|
782281
782408
|
if (isStale())
|
|
782282
782409
|
return;
|
|
782283
|
-
await new Promise((
|
|
782410
|
+
await new Promise((resolve56) => {
|
|
782284
782411
|
connectVoiceStream({
|
|
782285
782412
|
onTranscript: (t2, isFinal) => {
|
|
782286
782413
|
if (isStale())
|
|
@@ -782291,12 +782418,12 @@ function useVoice({
|
|
|
782291
782418
|
accumulatedRef.current += t2.trim();
|
|
782292
782419
|
}
|
|
782293
782420
|
},
|
|
782294
|
-
onError: () =>
|
|
782421
|
+
onError: () => resolve56(),
|
|
782295
782422
|
onClose: () => {},
|
|
782296
782423
|
onReady: (conn) => {
|
|
782297
782424
|
if (isStale()) {
|
|
782298
782425
|
conn.close();
|
|
782299
|
-
|
|
782426
|
+
resolve56();
|
|
782300
782427
|
return;
|
|
782301
782428
|
}
|
|
782302
782429
|
connectionRef.current = conn;
|
|
@@ -782316,13 +782443,13 @@ function useVoice({
|
|
|
782316
782443
|
conn.send(Buffer.concat(slice));
|
|
782317
782444
|
conn.finalize().then(() => {
|
|
782318
782445
|
conn.close();
|
|
782319
|
-
|
|
782446
|
+
resolve56();
|
|
782320
782447
|
});
|
|
782321
782448
|
}
|
|
782322
782449
|
}, { language: stt.code, keyterms }).then((c10) => {
|
|
782323
782450
|
if (!c10)
|
|
782324
|
-
|
|
782325
|
-
}, () =>
|
|
782451
|
+
resolve56();
|
|
782452
|
+
}, () => resolve56());
|
|
782326
782453
|
});
|
|
782327
782454
|
if (isStale())
|
|
782328
782455
|
return;
|
|
@@ -783693,7 +783820,7 @@ var exports_main = {};
|
|
|
783693
783820
|
__export(exports_main, {
|
|
783694
783821
|
daemonMain: () => daemonMain
|
|
783695
783822
|
});
|
|
783696
|
-
import { resolve as
|
|
783823
|
+
import { resolve as resolve56 } from "path";
|
|
783697
783824
|
async function daemonMain(args) {
|
|
783698
783825
|
const subcommand = args[0] || "status";
|
|
783699
783826
|
switch (subcommand) {
|
|
@@ -783815,9 +783942,9 @@ function parseSupervisorArgs(args) {
|
|
|
783815
783942
|
for (let i10 = 0;i10 < args.length; i10++) {
|
|
783816
783943
|
const arg = args[i10];
|
|
783817
783944
|
if (arg === "--dir" && i10 + 1 < args.length) {
|
|
783818
|
-
result.dir =
|
|
783945
|
+
result.dir = resolve56(args[++i10]);
|
|
783819
783946
|
} else if (arg.startsWith("--dir=")) {
|
|
783820
|
-
result.dir =
|
|
783947
|
+
result.dir = resolve56(arg.slice("--dir=".length));
|
|
783821
783948
|
} else if (arg === "--spawn-mode" && i10 + 1 < args.length) {
|
|
783822
783949
|
result.spawnMode = args[++i10];
|
|
783823
783950
|
} else if (arg.startsWith("--spawn-mode=")) {
|
|
@@ -783842,7 +783969,7 @@ function parseSupervisorArgs(args) {
|
|
|
783842
783969
|
}
|
|
783843
783970
|
async function runSupervisor(args) {
|
|
783844
783971
|
const config13 = parseSupervisorArgs(args);
|
|
783845
|
-
const dir = config13.dir ||
|
|
783972
|
+
const dir = config13.dir || resolve56(".");
|
|
783846
783973
|
console.log(`[daemon] supervisor starting in ${dir}`);
|
|
783847
783974
|
const workers = [
|
|
783848
783975
|
{
|
|
@@ -783884,16 +784011,16 @@ async function runSupervisor(args) {
|
|
|
783884
784011
|
spawnWorker(worker, dir, config13, controller.signal);
|
|
783885
784012
|
}
|
|
783886
784013
|
}
|
|
783887
|
-
await new Promise((
|
|
784014
|
+
await new Promise((resolve57) => {
|
|
783888
784015
|
if (controller.signal.aborted) {
|
|
783889
|
-
|
|
784016
|
+
resolve57();
|
|
783890
784017
|
return;
|
|
783891
784018
|
}
|
|
783892
|
-
controller.signal.addEventListener("abort", () =>
|
|
784019
|
+
controller.signal.addEventListener("abort", () => resolve57(), { once: true });
|
|
783893
784020
|
});
|
|
783894
|
-
await Promise.all(workers.filter((w2) => w2.process && w2.process.exitCode === null).map((w2) => new Promise((
|
|
784021
|
+
await Promise.all(workers.filter((w2) => w2.process && w2.process.exitCode === null).map((w2) => new Promise((resolve57) => {
|
|
783895
784022
|
if (!w2.process || w2.process.exitCode !== null) {
|
|
783896
|
-
|
|
784023
|
+
resolve57();
|
|
783897
784024
|
return;
|
|
783898
784025
|
}
|
|
783899
784026
|
let killTimer = null;
|
|
@@ -783902,13 +784029,13 @@ async function runSupervisor(args) {
|
|
|
783902
784029
|
clearTimeout(killTimer);
|
|
783903
784030
|
killTimer = null;
|
|
783904
784031
|
}
|
|
783905
|
-
|
|
784032
|
+
resolve57();
|
|
783906
784033
|
});
|
|
783907
784034
|
killTimer = setTimeout(() => {
|
|
783908
784035
|
if (w2.process && w2.process.exitCode === null) {
|
|
783909
784036
|
w2.process.kill("SIGKILL");
|
|
783910
784037
|
}
|
|
783911
|
-
|
|
784038
|
+
resolve57();
|
|
783912
784039
|
}, 30000);
|
|
783913
784040
|
killTimer.unref?.();
|
|
783914
784041
|
})));
|
|
@@ -786796,7 +786923,7 @@ function generateHtmlReport(data, insights) {
|
|
|
786796
786923
|
</html>`;
|
|
786797
786924
|
}
|
|
786798
786925
|
function buildExportData(data, insights, facets, remoteStats) {
|
|
786799
|
-
const version11 = typeof MACRO !== "undefined" ? "4.2.
|
|
786926
|
+
const version11 = typeof MACRO !== "undefined" ? "4.2.20" : "unknown";
|
|
786800
786927
|
const remote_hosts_collected = remoteStats?.hosts.filter((h8) => h8.sessionCount > 0).map((h8) => h8.name);
|
|
786801
786928
|
const facets_summary = {
|
|
786802
786929
|
total: facets.size,
|
|
@@ -786865,7 +786992,7 @@ async function scanAllSessions() {
|
|
|
786865
786992
|
});
|
|
786866
786993
|
}
|
|
786867
786994
|
if (i10 % 10 === 9) {
|
|
786868
|
-
await new Promise((
|
|
786995
|
+
await new Promise((resolve57) => setImmediate(resolve57));
|
|
786869
786996
|
}
|
|
786870
786997
|
}
|
|
786871
786998
|
}
|
|
@@ -788505,8 +788632,8 @@ class Project {
|
|
|
788505
788632
|
decrementPendingWrites() {
|
|
788506
788633
|
this.pendingWriteCount--;
|
|
788507
788634
|
if (this.pendingWriteCount === 0) {
|
|
788508
|
-
for (const
|
|
788509
|
-
|
|
788635
|
+
for (const resolve57 of this.flushResolvers) {
|
|
788636
|
+
resolve57();
|
|
788510
788637
|
}
|
|
788511
788638
|
this.flushResolvers = [];
|
|
788512
788639
|
}
|
|
@@ -788520,7 +788647,7 @@ class Project {
|
|
|
788520
788647
|
}
|
|
788521
788648
|
}
|
|
788522
788649
|
enqueueWrite(filePath, entry) {
|
|
788523
|
-
return new Promise((
|
|
788650
|
+
return new Promise((resolve57) => {
|
|
788524
788651
|
let queue3 = this.writeQueues.get(filePath);
|
|
788525
788652
|
if (!queue3) {
|
|
788526
788653
|
queue3 = [];
|
|
@@ -788532,7 +788659,7 @@ class Project {
|
|
|
788532
788659
|
d7.resolve();
|
|
788533
788660
|
}
|
|
788534
788661
|
}
|
|
788535
|
-
queue3.push({ entry, resolve:
|
|
788662
|
+
queue3.push({ entry, resolve: resolve57 });
|
|
788536
788663
|
this.scheduleDrain();
|
|
788537
788664
|
});
|
|
788538
788665
|
}
|
|
@@ -788566,7 +788693,7 @@ class Project {
|
|
|
788566
788693
|
const batch = queue3.splice(0);
|
|
788567
788694
|
let content = "";
|
|
788568
788695
|
const resolvers2 = [];
|
|
788569
|
-
for (const { entry, resolve:
|
|
788696
|
+
for (const { entry, resolve: resolve57 } of batch) {
|
|
788570
788697
|
const line = jsonStringify(entry) + `
|
|
788571
788698
|
`;
|
|
788572
788699
|
if (content.length + line.length >= this.MAX_CHUNK_BYTES) {
|
|
@@ -788578,7 +788705,7 @@ class Project {
|
|
|
788578
788705
|
content = "";
|
|
788579
788706
|
}
|
|
788580
788707
|
content += line;
|
|
788581
|
-
resolvers2.push(
|
|
788708
|
+
resolvers2.push(resolve57);
|
|
788582
788709
|
}
|
|
788583
788710
|
if (content.length > 0) {
|
|
788584
788711
|
await this.appendToFile(filePath, content);
|
|
@@ -788720,8 +788847,8 @@ class Project {
|
|
|
788720
788847
|
if (this.pendingWriteCount === 0) {
|
|
788721
788848
|
return;
|
|
788722
788849
|
}
|
|
788723
|
-
return new Promise((
|
|
788724
|
-
this.flushResolvers.push(
|
|
788850
|
+
return new Promise((resolve57) => {
|
|
788851
|
+
this.flushResolvers.push(resolve57);
|
|
788725
788852
|
});
|
|
788726
788853
|
}
|
|
788727
788854
|
async removeMessageByUuid(targetUuid) {
|
|
@@ -789376,7 +789503,7 @@ function applySnipRemovals(messages) {
|
|
|
789376
789503
|
messages.delete(uuid9);
|
|
789377
789504
|
removedCount++;
|
|
789378
789505
|
}
|
|
789379
|
-
const
|
|
789506
|
+
const resolve57 = (start) => {
|
|
789380
789507
|
const path56 = [];
|
|
789381
789508
|
let cur = start;
|
|
789382
789509
|
while (cur && toDelete.has(cur)) {
|
|
@@ -789395,7 +789522,7 @@ function applySnipRemovals(messages) {
|
|
|
789395
789522
|
for (const [uuid9, msg] of messages) {
|
|
789396
789523
|
if (!msg.parentUuid || !toDelete.has(msg.parentUuid))
|
|
789397
789524
|
continue;
|
|
789398
|
-
messages.set(uuid9, { ...msg, parentUuid:
|
|
789525
|
+
messages.set(uuid9, { ...msg, parentUuid: resolve57(msg.parentUuid) });
|
|
789399
789526
|
relinkedCount++;
|
|
789400
789527
|
}
|
|
789401
789528
|
logEvent("tengu_snip_resume_filtered", {
|
|
@@ -791246,7 +791373,7 @@ var init_sessionStorage = __esm(() => {
|
|
|
791246
791373
|
init_settings2();
|
|
791247
791374
|
init_slowOperations();
|
|
791248
791375
|
init_uuid();
|
|
791249
|
-
VERSION11 = typeof MACRO !== "undefined" ? "4.2.
|
|
791376
|
+
VERSION11 = typeof MACRO !== "undefined" ? "4.2.20" : "unknown";
|
|
791250
791377
|
MAX_TOMBSTONE_REWRITE_BYTES = 50 * 1024 * 1024;
|
|
791251
791378
|
SKIP_FIRST_PROMPT_PATTERN2 = /^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/;
|
|
791252
791379
|
EPHEMERAL_PROGRESS_TYPES = new Set([
|
|
@@ -791908,14 +792035,14 @@ function pathInWorkingPath(path56, workingPath) {
|
|
|
791908
792035
|
const normalizedWorkingPath = absoluteWorkingPath.replace(/^\/private\/var\//, "/var/").replace(/^\/private\/tmp(\/|$)/, "/tmp$1");
|
|
791909
792036
|
const caseNormalizedPath = normalizeCaseForComparison2(normalizedPath);
|
|
791910
792037
|
const caseNormalizedWorkingPath = normalizeCaseForComparison2(normalizedWorkingPath);
|
|
791911
|
-
const
|
|
791912
|
-
if (
|
|
792038
|
+
const relative32 = relativePath(caseNormalizedWorkingPath, caseNormalizedPath);
|
|
792039
|
+
if (relative32 === "") {
|
|
791913
792040
|
return true;
|
|
791914
792041
|
}
|
|
791915
|
-
if (containsPathTraversal(
|
|
792042
|
+
if (containsPathTraversal(relative32)) {
|
|
791916
792043
|
return false;
|
|
791917
792044
|
}
|
|
791918
|
-
return !posix11.isAbsolute(
|
|
792045
|
+
return !posix11.isAbsolute(relative32);
|
|
791919
792046
|
}
|
|
791920
792047
|
function rootPathForSource(source) {
|
|
791921
792048
|
switch (source) {
|
|
@@ -792587,7 +792714,7 @@ var init_filesystem = __esm(() => {
|
|
|
792587
792714
|
});
|
|
792588
792715
|
getBundledSkillsRoot = memoize_default(function getBundledSkillsRoot2() {
|
|
792589
792716
|
const nonce = randomBytes24(16).toString("hex");
|
|
792590
|
-
return join204(getCostrictTempDir(), "bundled-skills", "4.2.
|
|
792717
|
+
return join204(getCostrictTempDir(), "bundled-skills", "4.2.20", nonce);
|
|
792591
792718
|
});
|
|
792592
792719
|
getResolvedWorkingDirPaths = memoize_default(getPathsForPermissionCheck);
|
|
792593
792720
|
});
|
|
@@ -792667,8 +792794,8 @@ class DiskTaskOutput {
|
|
|
792667
792794
|
this.#queue.push(content);
|
|
792668
792795
|
}
|
|
792669
792796
|
if (!this.#flushPromise) {
|
|
792670
|
-
this.#flushPromise = new Promise((
|
|
792671
|
-
this.#flushResolve =
|
|
792797
|
+
this.#flushPromise = new Promise((resolve57) => {
|
|
792798
|
+
this.#flushResolve = resolve57;
|
|
792672
792799
|
});
|
|
792673
792800
|
track(this.#drain());
|
|
792674
792801
|
}
|
|
@@ -792734,10 +792861,10 @@ class DiskTaskOutput {
|
|
|
792734
792861
|
}
|
|
792735
792862
|
}
|
|
792736
792863
|
} finally {
|
|
792737
|
-
const
|
|
792864
|
+
const resolve57 = this.#flushResolve;
|
|
792738
792865
|
this.#flushPromise = null;
|
|
792739
792866
|
this.#flushResolve = null;
|
|
792740
|
-
|
|
792867
|
+
resolve57();
|
|
792741
792868
|
}
|
|
792742
792869
|
}
|
|
792743
792870
|
}
|
|
@@ -793072,11 +793199,11 @@ class ShellCommandImpl {
|
|
|
793072
793199
|
this.#childProcess.once("exit", this.#exitHandler.bind(this));
|
|
793073
793200
|
this.#childProcess.once("error", this.#errorHandler.bind(this));
|
|
793074
793201
|
this.#timeoutId = setTimeout(ShellCommandImpl.#handleTimeout, this.#timeout, this);
|
|
793075
|
-
const exitPromise = new Promise((
|
|
793076
|
-
this.#exitCodeResolver =
|
|
793202
|
+
const exitPromise = new Promise((resolve57) => {
|
|
793203
|
+
this.#exitCodeResolver = resolve57;
|
|
793077
793204
|
});
|
|
793078
|
-
return new Promise((
|
|
793079
|
-
this.#resultResolver =
|
|
793205
|
+
return new Promise((resolve57) => {
|
|
793206
|
+
this.#resultResolver = resolve57;
|
|
793080
793207
|
exitPromise.then(this.#handleExit.bind(this));
|
|
793081
793208
|
});
|
|
793082
793209
|
}
|
|
@@ -794168,7 +794295,7 @@ function executeInBackground({
|
|
|
794168
794295
|
}) {
|
|
794169
794296
|
if (asyncRewake) {
|
|
794170
794297
|
shellCommand.result.then(async (result) => {
|
|
794171
|
-
await new Promise((
|
|
794298
|
+
await new Promise((resolve57) => setImmediate(resolve57));
|
|
794172
794299
|
const stdout = await shellCommand.taskOutput.getStdout();
|
|
794173
794300
|
const stderr = shellCommand.taskOutput.getStderr();
|
|
794174
794301
|
shellCommand.cleanup();
|
|
@@ -794635,8 +794762,8 @@ async function execCommandHook(hook, hookEvent, hookName, jsonInput, signal, hoo
|
|
|
794635
794762
|
child.stderr.setEncoding("utf8");
|
|
794636
794763
|
let initialResponseChecked = false;
|
|
794637
794764
|
let asyncResolve = null;
|
|
794638
|
-
const childIsAsyncPromise = new Promise((
|
|
794639
|
-
asyncResolve =
|
|
794765
|
+
const childIsAsyncPromise = new Promise((resolve57) => {
|
|
794766
|
+
asyncResolve = resolve57;
|
|
794640
794767
|
});
|
|
794641
794768
|
const processedPromptLines = new Set;
|
|
794642
794769
|
let promptChain = Promise.resolve();
|
|
@@ -794726,13 +794853,13 @@ async function execCommandHook(hook, hookEvent, hookName, jsonInput, signal, hoo
|
|
|
794726
794853
|
hookEvent,
|
|
794727
794854
|
getOutput: async () => ({ stdout, stderr, output })
|
|
794728
794855
|
});
|
|
794729
|
-
const stdoutEndPromise = new Promise((
|
|
794730
|
-
child.stdout.on("end", () =>
|
|
794856
|
+
const stdoutEndPromise = new Promise((resolve57) => {
|
|
794857
|
+
child.stdout.on("end", () => resolve57());
|
|
794731
794858
|
});
|
|
794732
|
-
const stderrEndPromise = new Promise((
|
|
794733
|
-
child.stderr.on("end", () =>
|
|
794859
|
+
const stderrEndPromise = new Promise((resolve57) => {
|
|
794860
|
+
child.stderr.on("end", () => resolve57());
|
|
794734
794861
|
});
|
|
794735
|
-
const stdinWritePromise = stdinWritten ? Promise.resolve() : new Promise((
|
|
794862
|
+
const stdinWritePromise = stdinWritten ? Promise.resolve() : new Promise((resolve57, reject2) => {
|
|
794736
794863
|
child.stdin.on("error", (err3) => {
|
|
794737
794864
|
if (!requestPrompt) {
|
|
794738
794865
|
reject2(err3);
|
|
@@ -794745,12 +794872,12 @@ async function execCommandHook(hook, hookEvent, hookName, jsonInput, signal, hoo
|
|
|
794745
794872
|
if (!requestPrompt) {
|
|
794746
794873
|
child.stdin.end();
|
|
794747
794874
|
}
|
|
794748
|
-
|
|
794875
|
+
resolve57();
|
|
794749
794876
|
});
|
|
794750
794877
|
const childErrorPromise = new Promise((_2, reject2) => {
|
|
794751
794878
|
child.on("error", reject2);
|
|
794752
794879
|
});
|
|
794753
|
-
const childClosePromise = new Promise((
|
|
794880
|
+
const childClosePromise = new Promise((resolve57) => {
|
|
794754
794881
|
let exitCode = null;
|
|
794755
794882
|
child.on("close", (code) => {
|
|
794756
794883
|
exitCode = code ?? 1;
|
|
@@ -794758,7 +794885,7 @@ async function execCommandHook(hook, hookEvent, hookName, jsonInput, signal, hoo
|
|
|
794758
794885
|
const finalStdout = processedPromptLines.size === 0 ? stdout : stdout.split(`
|
|
794759
794886
|
`).filter((line) => !processedPromptLines.has(line.trim())).join(`
|
|
794760
794887
|
`);
|
|
794761
|
-
|
|
794888
|
+
resolve57({
|
|
794762
794889
|
stdout: finalStdout,
|
|
794763
794890
|
stderr,
|
|
794764
794891
|
output,
|
|
@@ -796800,12 +796927,12 @@ async function executeFunctionHook({
|
|
|
796800
796927
|
hook
|
|
796801
796928
|
};
|
|
796802
796929
|
}
|
|
796803
|
-
const passed = await new Promise((
|
|
796930
|
+
const passed = await new Promise((resolve57, reject2) => {
|
|
796804
796931
|
const onAbort = () => reject2(new Error("Function hook cancelled"));
|
|
796805
796932
|
abortSignal.addEventListener("abort", onAbort);
|
|
796806
796933
|
Promise.resolve(hook.callback(messages, abortSignal)).then((result) => {
|
|
796807
796934
|
abortSignal.removeEventListener("abort", onAbort);
|
|
796808
|
-
|
|
796935
|
+
resolve57(result);
|
|
796809
796936
|
}).catch((error100) => {
|
|
796810
796937
|
abortSignal.removeEventListener("abort", onAbort);
|
|
796811
796938
|
reject2(error100);
|
|
@@ -798857,7 +798984,7 @@ function computeFingerprint(messageText, version11) {
|
|
|
798857
798984
|
}
|
|
798858
798985
|
function computeFingerprintFromMessages(messages) {
|
|
798859
798986
|
const firstMessageText = extractFirstMessageText(messages);
|
|
798860
|
-
return computeFingerprint(firstMessageText, "4.2.
|
|
798987
|
+
return computeFingerprint(firstMessageText, "4.2.20");
|
|
798861
798988
|
}
|
|
798862
798989
|
var FINGERPRINT_SALT = "59cf53e54c78";
|
|
798863
798990
|
var init_fingerprint = () => {};
|
|
@@ -799267,7 +799394,7 @@ function getAnthropicEnvMetadata() {
|
|
|
799267
799394
|
function getBuildAgeMinutes() {
|
|
799268
799395
|
if (false)
|
|
799269
799396
|
;
|
|
799270
|
-
const buildTime = new Date("2026-07-
|
|
799397
|
+
const buildTime = new Date("2026-07-30T04:23:55.080Z").getTime();
|
|
799271
799398
|
if (isNaN(buildTime))
|
|
799272
799399
|
return;
|
|
799273
799400
|
return Math.floor((Date.now() - buildTime) / 60000);
|
|
@@ -804664,7 +804791,7 @@ async function sideQuery(opts) {
|
|
|
804664
804791
|
betas.push(STRUCTURED_OUTPUTS_BETA_HEADER);
|
|
804665
804792
|
}
|
|
804666
804793
|
const messageText = extractFirstUserMessageText(messages);
|
|
804667
|
-
const fingerprint = computeFingerprint(messageText, "4.2.
|
|
804794
|
+
const fingerprint = computeFingerprint(messageText, "4.2.20");
|
|
804668
804795
|
const attributionHeader = getAttributionHeader(fingerprint);
|
|
804669
804796
|
const systemBlocks = [
|
|
804670
804797
|
attributionHeader ? { type: "text", text: attributionHeader } : null,
|
|
@@ -805101,11 +805228,11 @@ class ChromeNativeHost {
|
|
|
805101
805228
|
}
|
|
805102
805229
|
log15(`Creating socket listener: ${this.socketPath}`);
|
|
805103
805230
|
this.server = createServer9((socket) => this.handleMcpClient(socket));
|
|
805104
|
-
await new Promise((
|
|
805231
|
+
await new Promise((resolve57, reject2) => {
|
|
805105
805232
|
this.server.listen(this.socketPath, () => {
|
|
805106
805233
|
log15("Socket server listening for connections");
|
|
805107
805234
|
this.running = true;
|
|
805108
|
-
|
|
805235
|
+
resolve57();
|
|
805109
805236
|
});
|
|
805110
805237
|
this.server.on("error", (err3) => {
|
|
805111
805238
|
log15("Socket server error:", err3);
|
|
@@ -805130,8 +805257,8 @@ class ChromeNativeHost {
|
|
|
805130
805257
|
}
|
|
805131
805258
|
this.mcpClients.clear();
|
|
805132
805259
|
if (this.server) {
|
|
805133
|
-
await new Promise((
|
|
805134
|
-
this.server.close(() =>
|
|
805260
|
+
await new Promise((resolve57) => {
|
|
805261
|
+
this.server.close(() => resolve57());
|
|
805135
805262
|
});
|
|
805136
805263
|
this.server = null;
|
|
805137
805264
|
}
|
|
@@ -805352,8 +805479,8 @@ class ChromeMessageReader {
|
|
|
805352
805479
|
return messageBytes.toString("utf-8");
|
|
805353
805480
|
}
|
|
805354
805481
|
}
|
|
805355
|
-
return new Promise((
|
|
805356
|
-
this.pendingResolve =
|
|
805482
|
+
return new Promise((resolve57) => {
|
|
805483
|
+
this.pendingResolve = resolve57;
|
|
805357
805484
|
this.tryProcessMessage();
|
|
805358
805485
|
});
|
|
805359
805486
|
}
|
|
@@ -807082,8 +807209,8 @@ class Connection {
|
|
|
807082
807209
|
this.requestHandler = requestHandler;
|
|
807083
807210
|
this.notificationHandler = notificationHandler;
|
|
807084
807211
|
this.stream = stream7;
|
|
807085
|
-
this.closedPromise = new Promise((
|
|
807086
|
-
this.abortController.signal.addEventListener("abort", () =>
|
|
807212
|
+
this.closedPromise = new Promise((resolve57) => {
|
|
807213
|
+
this.abortController.signal.addEventListener("abort", () => resolve57());
|
|
807087
807214
|
});
|
|
807088
807215
|
this.receive();
|
|
807089
807216
|
}
|
|
@@ -807229,8 +807356,8 @@ class Connection {
|
|
|
807229
807356
|
sendRequest(method, params) {
|
|
807230
807357
|
this.throwIfClosed();
|
|
807231
807358
|
const id = this.nextRequestId++;
|
|
807232
|
-
const responsePromise = new Promise((
|
|
807233
|
-
this.pendingResponses.set(id, { resolve:
|
|
807359
|
+
const responsePromise = new Promise((resolve57, reject2) => {
|
|
807360
|
+
this.pendingResponses.set(id, { resolve: resolve57, reject: reject2 });
|
|
807234
807361
|
});
|
|
807235
807362
|
responsePromise.catch(() => {});
|
|
807236
807363
|
this.sendMessage({ jsonrpc: "2.0", id, method, params });
|
|
@@ -808060,7 +808187,7 @@ function buildSystemInitMessage(inputs) {
|
|
|
808060
808187
|
slash_commands: inputs.commands.filter((c10) => c10.userInvocable !== false).map((c10) => c10.name),
|
|
808061
808188
|
apiKeySource: getAnthropicApiKeyWithSource().source,
|
|
808062
808189
|
betas: getSdkBetas(),
|
|
808063
|
-
claude_code_version: "4.2.
|
|
808190
|
+
claude_code_version: "4.2.20",
|
|
808064
808191
|
output_style: outputStyle2,
|
|
808065
808192
|
agents: inputs.agents.map((agent) => agent.agentType),
|
|
808066
808193
|
skills: inputs.skills.filter((s) => s.userInvocable !== false).map((skill) => skill.name),
|
|
@@ -810170,8 +810297,8 @@ function nextSdkMessageOrAbort(sdkMessages, abortSignal) {
|
|
|
810170
810297
|
return Promise.resolve({ done: true, value: undefined });
|
|
810171
810298
|
}
|
|
810172
810299
|
let abortHandler;
|
|
810173
|
-
const abortPromise = new Promise((
|
|
810174
|
-
abortHandler = () =>
|
|
810300
|
+
const abortPromise = new Promise((resolve58) => {
|
|
810301
|
+
abortHandler = () => resolve58({ done: true, value: undefined });
|
|
810175
810302
|
abortSignal.addEventListener("abort", abortHandler, { once: true });
|
|
810176
810303
|
});
|
|
810177
810304
|
return Promise.race([sdkMessages.next(), abortPromise]).finally(() => {
|
|
@@ -810947,9 +811074,9 @@ class AcpAgent {
|
|
|
810947
811074
|
const promptCancelGeneration = session2.cancelGeneration;
|
|
810948
811075
|
if (session2.promptRunning) {
|
|
810949
811076
|
const promptUuid = randomUUID68();
|
|
810950
|
-
const cancelled = await new Promise((
|
|
811077
|
+
const cancelled = await new Promise((resolve58) => {
|
|
810951
811078
|
session2.pendingQueue.push(promptUuid);
|
|
810952
|
-
session2.pendingMessages.set(promptUuid, { resolve:
|
|
811079
|
+
session2.pendingMessages.set(promptUuid, { resolve: resolve58 });
|
|
810953
811080
|
});
|
|
810954
811081
|
if (cancelled) {
|
|
810955
811082
|
return { stopReason: "cancelled" };
|
|
@@ -811520,7 +811647,7 @@ var exports_workerRegistry = {};
|
|
|
811520
811647
|
__export(exports_workerRegistry, {
|
|
811521
811648
|
runDaemonWorker: () => runDaemonWorker
|
|
811522
811649
|
});
|
|
811523
|
-
import { resolve as
|
|
811650
|
+
import { resolve as resolve58 } from "path";
|
|
811524
811651
|
async function runDaemonWorker(kind) {
|
|
811525
811652
|
if (!kind) {
|
|
811526
811653
|
console.error("Error: --daemon-worker requires a worker kind");
|
|
@@ -811537,7 +811664,7 @@ async function runDaemonWorker(kind) {
|
|
|
811537
811664
|
}
|
|
811538
811665
|
}
|
|
811539
811666
|
async function runRemoteControlWorker() {
|
|
811540
|
-
const dir = process.env.DAEMON_WORKER_DIR ||
|
|
811667
|
+
const dir = process.env.DAEMON_WORKER_DIR || resolve58(".");
|
|
811541
811668
|
const name3 = process.env.DAEMON_WORKER_NAME || undefined;
|
|
811542
811669
|
const spawnMode = process.env.DAEMON_WORKER_SPAWN_MODE || "same-dir";
|
|
811543
811670
|
const capacity = parseInt(process.env.DAEMON_WORKER_CAPACITY || "4", 10);
|
|
@@ -811604,7 +811731,7 @@ function appendToLog(path58, message2) {
|
|
|
811604
811731
|
cwd: getFsImplementation().cwd(),
|
|
811605
811732
|
userType: process.env.USER_TYPE,
|
|
811606
811733
|
sessionId: getSessionId(),
|
|
811607
|
-
version: "4.2.
|
|
811734
|
+
version: "4.2.20"
|
|
811608
811735
|
};
|
|
811609
811736
|
getLogWriter(path58).write(messageWithTimestamp);
|
|
811610
811737
|
}
|
|
@@ -814183,7 +814310,7 @@ async function tick() {
|
|
|
814183
814310
|
return;
|
|
814184
814311
|
inflight?.abort();
|
|
814185
814312
|
inflight = new AbortController;
|
|
814186
|
-
const timeout = setTimeout(() => inflight?.abort(),
|
|
814313
|
+
const timeout = setTimeout(() => inflight?.abort(), FETCH_TIMEOUT_MS8);
|
|
814187
814314
|
try {
|
|
814188
814315
|
const balance = await active3.fetchBalance(inflight.signal);
|
|
814189
814316
|
setProviderBalance(active3.providerId, balance);
|
|
@@ -814217,7 +814344,7 @@ function stopBalancePolling() {
|
|
|
814217
814344
|
function getActiveBalanceProviderId() {
|
|
814218
814345
|
return active3?.providerId ?? null;
|
|
814219
814346
|
}
|
|
814220
|
-
var DEFAULT_INTERVAL_MIN = 10, PROVIDERS, timer = null, inflight = null, active3 = null,
|
|
814347
|
+
var DEFAULT_INTERVAL_MIN = 10, PROVIDERS, timer = null, inflight = null, active3 = null, FETCH_TIMEOUT_MS8 = 1e4;
|
|
814221
814348
|
var init_poller = __esm(() => {
|
|
814222
814349
|
init_store();
|
|
814223
814350
|
init_deepseek();
|
|
@@ -814353,7 +814480,7 @@ async function startNodeRelay(wsUrl, authHeader, wsAuthHeader) {
|
|
|
814353
814480
|
cleanupConn(states.get(sock));
|
|
814354
814481
|
});
|
|
814355
814482
|
});
|
|
814356
|
-
return new Promise((
|
|
814483
|
+
return new Promise((resolve59, reject2) => {
|
|
814357
814484
|
server2.once("error", reject2);
|
|
814358
814485
|
server2.listen(0, "127.0.0.1", () => {
|
|
814359
814486
|
const addr = server2.address();
|
|
@@ -814361,7 +814488,7 @@ async function startNodeRelay(wsUrl, authHeader, wsAuthHeader) {
|
|
|
814361
814488
|
reject2(new Error("upstreamproxy: server has no TCP address"));
|
|
814362
814489
|
return;
|
|
814363
814490
|
}
|
|
814364
|
-
|
|
814491
|
+
resolve59({
|
|
814365
814492
|
port: addr.port,
|
|
814366
814493
|
stop: () => server2.close()
|
|
814367
814494
|
});
|
|
@@ -814790,7 +814917,7 @@ async function showInvalidConfigDialog({ error: error100 }) {
|
|
|
814790
814917
|
...getBaseRenderOptions(false),
|
|
814791
814918
|
theme: SAFE_ERROR_THEME_NAME
|
|
814792
814919
|
};
|
|
814793
|
-
await new Promise(async (
|
|
814920
|
+
await new Promise(async (resolve59) => {
|
|
814794
814921
|
const { unmount } = await root_default(/* @__PURE__ */ jsx_runtime376.jsx(AppStateProvider, {
|
|
814795
814922
|
children: /* @__PURE__ */ jsx_runtime376.jsx(KeybindingSetup2, {
|
|
814796
814923
|
children: /* @__PURE__ */ jsx_runtime376.jsx(InvalidConfigDialog, {
|
|
@@ -814798,7 +814925,7 @@ async function showInvalidConfigDialog({ error: error100 }) {
|
|
|
814798
814925
|
errorDescription: error100.message,
|
|
814799
814926
|
onExit: () => {
|
|
814800
814927
|
unmount();
|
|
814801
|
-
|
|
814928
|
+
resolve59();
|
|
814802
814929
|
process.exit(1);
|
|
814803
814930
|
},
|
|
814804
814931
|
onReset: () => {
|
|
@@ -814807,7 +814934,7 @@ async function showInvalidConfigDialog({ error: error100 }) {
|
|
|
814807
814934
|
encoding: "utf8"
|
|
814808
814935
|
});
|
|
814809
814936
|
unmount();
|
|
814810
|
-
|
|
814937
|
+
resolve59();
|
|
814811
814938
|
process.exit(0);
|
|
814812
814939
|
}
|
|
814813
814940
|
})
|
|
@@ -819961,7 +820088,7 @@ var init_useDiffInIDE = __esm(() => {
|
|
|
819961
820088
|
});
|
|
819962
820089
|
|
|
819963
820090
|
// src/components/ShowInIDEPrompt.tsx
|
|
819964
|
-
import { basename as basename57, relative as
|
|
820091
|
+
import { basename as basename57, relative as relative33 } from "path";
|
|
819965
820092
|
function ShowInIDEPrompt({
|
|
819966
820093
|
onChange,
|
|
819967
820094
|
options,
|
|
@@ -819995,7 +820122,7 @@ function ShowInIDEPrompt({
|
|
|
819995
820122
|
}),
|
|
819996
820123
|
symlinkTarget && /* @__PURE__ */ jsx_runtime397.jsx(ThemedText, {
|
|
819997
820124
|
color: "warning",
|
|
819998
|
-
children:
|
|
820125
|
+
children: relative33(getCwd(), symlinkTarget).startsWith("..") ? `This will modify ${symlinkTarget} (outside working directory) via a symlink` : `Symlink target: ${symlinkTarget}`
|
|
819999
820126
|
}),
|
|
820000
820127
|
isSupportedVSCodeTerminal() && /* @__PURE__ */ jsx_runtime397.jsx(ThemedText, {
|
|
820001
820128
|
dimColor: true,
|
|
@@ -820461,7 +820588,7 @@ var init_useFilePermissionDialog = __esm(() => {
|
|
|
820461
820588
|
});
|
|
820462
820589
|
|
|
820463
820590
|
// src/components/permissions/FilePermissionDialog/FilePermissionDialog.tsx
|
|
820464
|
-
import { relative as
|
|
820591
|
+
import { relative as relative34 } from "path";
|
|
820465
820592
|
function FilePermissionDialog({
|
|
820466
820593
|
toolUseConfirm,
|
|
820467
820594
|
toolUseContext,
|
|
@@ -820562,7 +820689,7 @@ function FilePermissionDialog({
|
|
|
820562
820689
|
noInputMode
|
|
820563
820690
|
});
|
|
820564
820691
|
}
|
|
820565
|
-
const isSymlinkOutsideCwd = symlinkTarget != null &&
|
|
820692
|
+
const isSymlinkOutsideCwd = symlinkTarget != null && relative34(getCwd(), symlinkTarget).startsWith("..");
|
|
820566
820693
|
const symlinkWarning = symlinkTarget ? /* @__PURE__ */ jsx_runtime399.jsx(ThemedBox_default, {
|
|
820567
820694
|
paddingX: 1,
|
|
820568
820695
|
marginBottom: 1,
|
|
@@ -820650,7 +820777,7 @@ var init_FilePermissionDialog = __esm(() => {
|
|
|
820650
820777
|
});
|
|
820651
820778
|
|
|
820652
820779
|
// src/components/permissions/SedEditPermissionRequest/SedEditPermissionRequest.tsx
|
|
820653
|
-
import { basename as basename59, relative as
|
|
820780
|
+
import { basename as basename59, relative as relative35 } from "path";
|
|
820654
820781
|
function SedEditPermissionRequest({ sedInfo, ...props }) {
|
|
820655
820782
|
const { filePath } = sedInfo;
|
|
820656
820783
|
const contentPromise = import_react246.useMemo(() => (async () => {
|
|
@@ -820720,7 +820847,7 @@ function SedEditPermissionRequestInner({
|
|
|
820720
820847
|
onDone: props.onDone,
|
|
820721
820848
|
onReject: props.onReject,
|
|
820722
820849
|
title: t("permissions.edit.file"),
|
|
820723
|
-
subtitle:
|
|
820850
|
+
subtitle: relative35(getCwd(), filePath),
|
|
820724
820851
|
question: /* @__PURE__ */ jsx_runtime400.jsxs(ThemedText, {
|
|
820725
820852
|
children: [
|
|
820726
820853
|
t("permissions.do.you.want.to.make.this.edit.to"),
|
|
@@ -822871,7 +822998,7 @@ function createSingleEditDiffConfig(filePath, oldString, newString, replaceAll2)
|
|
|
822871
822998
|
}
|
|
822872
822999
|
|
|
822873
823000
|
// src/components/permissions/FileEditPermissionRequest/FileEditPermissionRequest.tsx
|
|
822874
|
-
import { basename as basename61, relative as
|
|
823001
|
+
import { basename as basename61, relative as relative36 } from "path";
|
|
822875
823002
|
function FileEditPermissionRequest(props) {
|
|
822876
823003
|
const parseInput = (input4) => {
|
|
822877
823004
|
return FileEditTool.inputSchema.parse(input4);
|
|
@@ -822885,7 +823012,7 @@ function FileEditPermissionRequest(props) {
|
|
|
822885
823012
|
onReject: props.onReject,
|
|
822886
823013
|
workerBadge: props.workerBadge,
|
|
822887
823014
|
title: t("permissions.editFileTitle"),
|
|
822888
|
-
subtitle:
|
|
823015
|
+
subtitle: relative36(getCwd(), file_path),
|
|
822889
823016
|
question: /* @__PURE__ */ jsx_runtime407.jsx(ThemedText, {
|
|
822890
823017
|
children: t("permissions.editFileQuestion", { path: basename61(file_path) })
|
|
822891
823018
|
}),
|
|
@@ -823063,7 +823190,7 @@ var init_FileWriteToolDiff = __esm(() => {
|
|
|
823063
823190
|
});
|
|
823064
823191
|
|
|
823065
823192
|
// src/components/permissions/FileWritePermissionRequest/FileWritePermissionRequest.tsx
|
|
823066
|
-
import { basename as basename62, relative as
|
|
823193
|
+
import { basename as basename62, relative as relative37 } from "path";
|
|
823067
823194
|
function FileWritePermissionRequest(props) {
|
|
823068
823195
|
const parseInput = (input4) => {
|
|
823069
823196
|
return FileWriteTool.inputSchema.parse(input4);
|
|
@@ -823087,7 +823214,7 @@ function FileWritePermissionRequest(props) {
|
|
|
823087
823214
|
onReject: props.onReject,
|
|
823088
823215
|
workerBadge: props.workerBadge,
|
|
823089
823216
|
title: fileExists ? t("permissions.overwriteFileTitle") : t("permissions.createFileTitle"),
|
|
823090
|
-
subtitle:
|
|
823217
|
+
subtitle: relative37(getCwd(), file_path),
|
|
823091
823218
|
question: /* @__PURE__ */ jsx_runtime410.jsx(ThemedText, {
|
|
823092
823219
|
children: t("permissions.writeFileQuestion", { action: actionText, path: basename62(file_path) })
|
|
823093
823220
|
}),
|
|
@@ -823141,7 +823268,7 @@ var init_FileWritePermissionRequest = __esm(() => {
|
|
|
823141
823268
|
});
|
|
823142
823269
|
|
|
823143
823270
|
// src/components/permissions/NotebookEditPermissionRequest/NotebookEditToolDiff.tsx
|
|
823144
|
-
import { relative as
|
|
823271
|
+
import { relative as relative38 } from "path";
|
|
823145
823272
|
function NotebookEditToolDiff(props) {
|
|
823146
823273
|
const notebookDataPromise = import_react254.useMemo(() => getFsImplementation().readFile(props.notebook_path, { encoding: "utf-8" }).then((content) => safeParseJSON(content)).catch(() => null), [props.notebook_path]);
|
|
823147
823274
|
return /* @__PURE__ */ jsx_runtime411.jsx(import_react254.Suspense, {
|
|
@@ -823222,7 +823349,7 @@ function NotebookEditToolDiffInner({
|
|
|
823222
823349
|
children: [
|
|
823223
823350
|
/* @__PURE__ */ jsx_runtime411.jsx(ThemedText, {
|
|
823224
823351
|
bold: true,
|
|
823225
|
-
children: verbose ? notebook_path :
|
|
823352
|
+
children: verbose ? notebook_path : relative38(getCwd(), notebook_path)
|
|
823226
823353
|
}),
|
|
823227
823354
|
/* @__PURE__ */ jsx_runtime411.jsxs(ThemedText, {
|
|
823228
823355
|
dimColor: true,
|
|
@@ -828371,7 +828498,7 @@ var init_commandSuggestions = __esm(() => {
|
|
|
828371
828498
|
// src/utils/suggestions/shellHistoryCompletion.ts
|
|
828372
828499
|
async function getShellHistoryCommands() {
|
|
828373
828500
|
const now2 = Date.now();
|
|
828374
|
-
if (shellHistoryCache && now2 - shellHistoryCacheTimestamp <
|
|
828501
|
+
if (shellHistoryCache && now2 - shellHistoryCacheTimestamp < CACHE_TTL_MS5) {
|
|
828375
828502
|
return shellHistoryCache;
|
|
828376
828503
|
}
|
|
828377
828504
|
const commands11 = [];
|
|
@@ -828425,7 +828552,7 @@ async function getShellHistoryCompletion(input4) {
|
|
|
828425
828552
|
}
|
|
828426
828553
|
return null;
|
|
828427
828554
|
}
|
|
828428
|
-
var shellHistoryCache = null, shellHistoryCacheTimestamp = 0,
|
|
828555
|
+
var shellHistoryCache = null, shellHistoryCacheTimestamp = 0, CACHE_TTL_MS5 = 60000;
|
|
828429
828556
|
var init_shellHistoryCompletion = __esm(() => {
|
|
828430
828557
|
init_history2();
|
|
828431
828558
|
init_debug();
|
|
@@ -832649,7 +832776,7 @@ function buildStatusLineCommandInput(permissionMode, exceeds200kTokens, settings
|
|
|
832649
832776
|
project_dir: getOriginalCwd(),
|
|
832650
832777
|
added_dirs: addedDirs
|
|
832651
832778
|
},
|
|
832652
|
-
version: "4.2.
|
|
832779
|
+
version: "4.2.20",
|
|
832653
832780
|
output_style: {
|
|
832654
832781
|
name: outputStyleName
|
|
832655
832782
|
},
|
|
@@ -838596,10 +838723,10 @@ var require_commonjs = __commonJS((exports) => {
|
|
|
838596
838723
|
return this[ENCODING] ? buf.join("") : Buffer.concat(buf, buf.dataLength);
|
|
838597
838724
|
}
|
|
838598
838725
|
async promise() {
|
|
838599
|
-
return new Promise((
|
|
838726
|
+
return new Promise((resolve59, reject2) => {
|
|
838600
838727
|
this.on(DESTROYED, () => reject2(new Error("stream destroyed")));
|
|
838601
838728
|
this.on("error", (er) => reject2(er));
|
|
838602
|
-
this.on("end", () =>
|
|
838729
|
+
this.on("end", () => resolve59());
|
|
838603
838730
|
});
|
|
838604
838731
|
}
|
|
838605
838732
|
[Symbol.asyncIterator]() {
|
|
@@ -838618,7 +838745,7 @@ var require_commonjs = __commonJS((exports) => {
|
|
|
838618
838745
|
return Promise.resolve({ done: false, value: res });
|
|
838619
838746
|
if (this[EOF])
|
|
838620
838747
|
return stop();
|
|
838621
|
-
let
|
|
838748
|
+
let resolve59;
|
|
838622
838749
|
let reject2;
|
|
838623
838750
|
const onerr = (er) => {
|
|
838624
838751
|
this.off("data", ondata);
|
|
@@ -838632,19 +838759,19 @@ var require_commonjs = __commonJS((exports) => {
|
|
|
838632
838759
|
this.off("end", onend);
|
|
838633
838760
|
this.off(DESTROYED, ondestroy);
|
|
838634
838761
|
this.pause();
|
|
838635
|
-
|
|
838762
|
+
resolve59({ value, done: !!this[EOF] });
|
|
838636
838763
|
};
|
|
838637
838764
|
const onend = () => {
|
|
838638
838765
|
this.off("error", onerr);
|
|
838639
838766
|
this.off("data", ondata);
|
|
838640
838767
|
this.off(DESTROYED, ondestroy);
|
|
838641
838768
|
stop();
|
|
838642
|
-
|
|
838769
|
+
resolve59({ done: true, value: undefined });
|
|
838643
838770
|
};
|
|
838644
838771
|
const ondestroy = () => onerr(new Error("stream destroyed"));
|
|
838645
838772
|
return new Promise((res2, rej) => {
|
|
838646
838773
|
reject2 = rej;
|
|
838647
|
-
|
|
838774
|
+
resolve59 = res2;
|
|
838648
838775
|
this.once(DESTROYED, ondestroy);
|
|
838649
838776
|
this.once("error", onerr);
|
|
838650
838777
|
this.once("end", onend);
|
|
@@ -839221,10 +839348,10 @@ var require_minipass = __commonJS((exports, module) => {
|
|
|
839221
839348
|
return this[OBJECTMODE] ? Promise.reject(new Error("cannot concat in objectMode")) : this.collect().then((buf) => this[OBJECTMODE] ? Promise.reject(new Error("cannot concat in objectMode")) : this[ENCODING] ? buf.join("") : Buffer.concat(buf, buf.dataLength));
|
|
839222
839349
|
}
|
|
839223
839350
|
promise() {
|
|
839224
|
-
return new Promise((
|
|
839351
|
+
return new Promise((resolve59, reject2) => {
|
|
839225
839352
|
this.on(DESTROYED, () => reject2(new Error("stream destroyed")));
|
|
839226
839353
|
this.on("error", (er) => reject2(er));
|
|
839227
|
-
this.on("end", () =>
|
|
839354
|
+
this.on("end", () => resolve59());
|
|
839228
839355
|
});
|
|
839229
839356
|
}
|
|
839230
839357
|
[ASYNCITERATOR]() {
|
|
@@ -839234,7 +839361,7 @@ var require_minipass = __commonJS((exports, module) => {
|
|
|
839234
839361
|
return Promise.resolve({ done: false, value: res });
|
|
839235
839362
|
if (this[EOF])
|
|
839236
839363
|
return Promise.resolve({ done: true });
|
|
839237
|
-
let
|
|
839364
|
+
let resolve59 = null;
|
|
839238
839365
|
let reject2 = null;
|
|
839239
839366
|
const onerr = (er) => {
|
|
839240
839367
|
this.removeListener("data", ondata);
|
|
@@ -839245,17 +839372,17 @@ var require_minipass = __commonJS((exports, module) => {
|
|
|
839245
839372
|
this.removeListener("error", onerr);
|
|
839246
839373
|
this.removeListener("end", onend);
|
|
839247
839374
|
this.pause();
|
|
839248
|
-
|
|
839375
|
+
resolve59({ value, done: !!this[EOF] });
|
|
839249
839376
|
};
|
|
839250
839377
|
const onend = () => {
|
|
839251
839378
|
this.removeListener("error", onerr);
|
|
839252
839379
|
this.removeListener("data", ondata);
|
|
839253
|
-
|
|
839380
|
+
resolve59({ done: true });
|
|
839254
839381
|
};
|
|
839255
839382
|
const ondestroy = () => onerr(new Error("stream destroyed"));
|
|
839256
839383
|
return new Promise((res2, rej) => {
|
|
839257
839384
|
reject2 = rej;
|
|
839258
|
-
|
|
839385
|
+
resolve59 = res2;
|
|
839259
839386
|
this.once(DESTROYED, ondestroy);
|
|
839260
839387
|
this.once("error", onerr);
|
|
839261
839388
|
this.once("end", onend);
|
|
@@ -839741,7 +839868,7 @@ var require_lib17 = __commonJS((exports, module) => {
|
|
|
839741
839868
|
exports.fromStream = fromStream;
|
|
839742
839869
|
function fromStream(stream7, opts) {
|
|
839743
839870
|
const istream = integrityStream(opts);
|
|
839744
|
-
return new Promise((
|
|
839871
|
+
return new Promise((resolve59, reject2) => {
|
|
839745
839872
|
stream7.pipe(istream);
|
|
839746
839873
|
stream7.on("error", reject2);
|
|
839747
839874
|
istream.on("error", reject2);
|
|
@@ -839749,7 +839876,7 @@ var require_lib17 = __commonJS((exports, module) => {
|
|
|
839749
839876
|
istream.on("integrity", (s) => {
|
|
839750
839877
|
sri = s;
|
|
839751
839878
|
});
|
|
839752
|
-
istream.on("end", () =>
|
|
839879
|
+
istream.on("end", () => resolve59(sri));
|
|
839753
839880
|
istream.resume();
|
|
839754
839881
|
});
|
|
839755
839882
|
}
|
|
@@ -839802,7 +839929,7 @@ var require_lib17 = __commonJS((exports, module) => {
|
|
|
839802
839929
|
}));
|
|
839803
839930
|
}
|
|
839804
839931
|
const checker = integrityStream(opts);
|
|
839805
|
-
return new Promise((
|
|
839932
|
+
return new Promise((resolve59, reject2) => {
|
|
839806
839933
|
stream7.pipe(checker);
|
|
839807
839934
|
stream7.on("error", reject2);
|
|
839808
839935
|
checker.on("error", reject2);
|
|
@@ -839810,7 +839937,7 @@ var require_lib17 = __commonJS((exports, module) => {
|
|
|
839810
839937
|
checker.on("verified", (s) => {
|
|
839811
839938
|
verified = s;
|
|
839812
839939
|
});
|
|
839813
|
-
checker.on("end", () =>
|
|
839940
|
+
checker.on("end", () => resolve59(verified));
|
|
839814
839941
|
checker.resume();
|
|
839815
839942
|
});
|
|
839816
839943
|
}
|
|
@@ -840029,10 +840156,10 @@ var require_polyfill = __commonJS((exports, module) => {
|
|
|
840029
840156
|
} = __require("fs/promises");
|
|
840030
840157
|
var {
|
|
840031
840158
|
dirname: dirname85,
|
|
840032
|
-
isAbsolute:
|
|
840159
|
+
isAbsolute: isAbsolute32,
|
|
840033
840160
|
join: join214,
|
|
840034
840161
|
parse: parse28,
|
|
840035
|
-
resolve:
|
|
840162
|
+
resolve: resolve59,
|
|
840036
840163
|
sep: sep42,
|
|
840037
840164
|
toNamespacedPath
|
|
840038
840165
|
} = __require("path");
|
|
@@ -840134,8 +840261,8 @@ var require_polyfill = __commonJS((exports, module) => {
|
|
|
840134
840261
|
return stat53(dest).then(() => true, (err3) => err3.code === "ENOENT" ? false : Promise.reject(err3));
|
|
840135
840262
|
}
|
|
840136
840263
|
async function checkParentPaths(src, srcStat, dest) {
|
|
840137
|
-
const srcParent =
|
|
840138
|
-
const destParent =
|
|
840264
|
+
const srcParent = resolve59(dirname85(src));
|
|
840265
|
+
const destParent = resolve59(dirname85(dest));
|
|
840139
840266
|
if (destParent === srcParent || destParent === parse28(destParent).root) {
|
|
840140
840267
|
return;
|
|
840141
840268
|
}
|
|
@@ -840158,7 +840285,7 @@ var require_polyfill = __commonJS((exports, module) => {
|
|
|
840158
840285
|
}
|
|
840159
840286
|
return checkParentPaths(src, srcStat, destParent);
|
|
840160
840287
|
}
|
|
840161
|
-
var normalizePathToArray = (path59) =>
|
|
840288
|
+
var normalizePathToArray = (path59) => resolve59(path59).split(sep42).filter(Boolean);
|
|
840162
840289
|
function isSrcSubdir(src, dest) {
|
|
840163
840290
|
const srcArr = normalizePathToArray(src);
|
|
840164
840291
|
const destArr = normalizePathToArray(dest);
|
|
@@ -840287,8 +840414,8 @@ var require_polyfill = __commonJS((exports, module) => {
|
|
|
840287
840414
|
}
|
|
840288
840415
|
async function onLink(destStat, src, dest) {
|
|
840289
840416
|
let resolvedSrc = await readlink3(src);
|
|
840290
|
-
if (!
|
|
840291
|
-
resolvedSrc =
|
|
840417
|
+
if (!isAbsolute32(resolvedSrc)) {
|
|
840418
|
+
resolvedSrc = resolve59(dirname85(src), resolvedSrc);
|
|
840292
840419
|
}
|
|
840293
840420
|
if (!destStat) {
|
|
840294
840421
|
return symlink6(resolvedSrc, dest);
|
|
@@ -840302,8 +840429,8 @@ var require_polyfill = __commonJS((exports, module) => {
|
|
|
840302
840429
|
}
|
|
840303
840430
|
throw err3;
|
|
840304
840431
|
}
|
|
840305
|
-
if (!
|
|
840306
|
-
resolvedDest =
|
|
840432
|
+
if (!isAbsolute32(resolvedDest)) {
|
|
840433
|
+
resolvedDest = resolve59(dirname85(dest), resolvedDest);
|
|
840307
840434
|
}
|
|
840308
840435
|
if (isSrcSubdir(resolvedSrc, resolvedDest)) {
|
|
840309
840436
|
throw new ERR_FS_CP_EINVAL({
|
|
@@ -840398,7 +840525,7 @@ var require_readdir_scoped = __commonJS((exports, module) => {
|
|
|
840398
840525
|
|
|
840399
840526
|
// node_modules/.bun/@npmcli+fs@5.0.0/node_modules/@npmcli/fs/lib/move-file.js
|
|
840400
840527
|
var require_move_file = __commonJS((exports, module) => {
|
|
840401
|
-
var { dirname: dirname85, join: join214, resolve:
|
|
840528
|
+
var { dirname: dirname85, join: join214, resolve: resolve59, relative: relative40, isAbsolute: isAbsolute32 } = __require("path");
|
|
840402
840529
|
var fs34 = __require("fs/promises");
|
|
840403
840530
|
var pathExists3 = async (path59) => {
|
|
840404
840531
|
try {
|
|
@@ -840440,12 +840567,12 @@ var require_move_file = __commonJS((exports, module) => {
|
|
|
840440
840567
|
if (root9) {
|
|
840441
840568
|
await Promise.all(symlinks.map(async ({ source: symSource, destination: symDestination }) => {
|
|
840442
840569
|
let target = await fs34.readlink(symSource);
|
|
840443
|
-
if (
|
|
840444
|
-
target =
|
|
840570
|
+
if (isAbsolute32(target)) {
|
|
840571
|
+
target = resolve59(symDestination, relative40(symSource, target));
|
|
840445
840572
|
}
|
|
840446
840573
|
let targetStat = "file";
|
|
840447
840574
|
try {
|
|
840448
|
-
targetStat = await fs34.stat(
|
|
840575
|
+
targetStat = await fs34.stat(resolve59(dirname85(symSource), target));
|
|
840449
840576
|
if (targetStat.isDirectory()) {
|
|
840450
840577
|
targetStat = "junction";
|
|
840451
840578
|
}
|
|
@@ -845903,8 +846030,8 @@ var require_verify2 = __commonJS((exports, module) => {
|
|
|
845903
846030
|
liveContent.add(integrity[algo].toString());
|
|
845904
846031
|
}
|
|
845905
846032
|
});
|
|
845906
|
-
await new Promise((
|
|
845907
|
-
indexStream.on("end",
|
|
846033
|
+
await new Promise((resolve59, reject2) => {
|
|
846034
|
+
indexStream.on("end", resolve59).on("error", reject2);
|
|
845908
846035
|
});
|
|
845909
846036
|
const contentDir = contentPath.contentDir(cache14);
|
|
845910
846037
|
const files3 = await glob2(path59.join(contentDir, "**"), {
|
|
@@ -847777,7 +847904,7 @@ var init_pipePermissionRelay = __esm(() => {
|
|
|
847777
847904
|
});
|
|
847778
847905
|
|
|
847779
847906
|
// src/hooks/toolPermission/PermissionContext.ts
|
|
847780
|
-
function createResolveOnce(
|
|
847907
|
+
function createResolveOnce(resolve59) {
|
|
847781
847908
|
let claimed = false;
|
|
847782
847909
|
let delivered = false;
|
|
847783
847910
|
return {
|
|
@@ -847786,7 +847913,7 @@ function createResolveOnce(resolve58) {
|
|
|
847786
847913
|
return;
|
|
847787
847914
|
delivered = true;
|
|
847788
847915
|
claimed = true;
|
|
847789
|
-
|
|
847916
|
+
resolve59(value);
|
|
847790
847917
|
},
|
|
847791
847918
|
isResolved() {
|
|
847792
847919
|
return claimed;
|
|
@@ -847831,11 +847958,11 @@ function createPermissionContext(tool, input4, toolUseContext, assistantMessage,
|
|
|
847831
847958
|
setToolPermissionContext(applyPermissionUpdates(appState.toolPermissionContext, updates));
|
|
847832
847959
|
return updates.some((update) => supportsPersistence(update.destination));
|
|
847833
847960
|
},
|
|
847834
|
-
resolveIfAborted(
|
|
847961
|
+
resolveIfAborted(resolve59) {
|
|
847835
847962
|
if (!toolUseContext.abortController.signal.aborted)
|
|
847836
847963
|
return false;
|
|
847837
847964
|
this.logCancelled();
|
|
847838
|
-
|
|
847965
|
+
resolve59(this.cancelAndAbort(undefined, true));
|
|
847839
847966
|
return true;
|
|
847840
847967
|
},
|
|
847841
847968
|
cancelAndAbort(feedback2, isAbort, contentBlocks) {
|
|
@@ -847990,7 +848117,7 @@ function getLatestChannelContextHint(messages) {
|
|
|
847990
848117
|
}
|
|
847991
848118
|
return null;
|
|
847992
848119
|
}
|
|
847993
|
-
function handleInteractivePermission(params,
|
|
848120
|
+
function handleInteractivePermission(params, resolve59) {
|
|
847994
848121
|
const {
|
|
847995
848122
|
ctx,
|
|
847996
848123
|
description,
|
|
@@ -847998,7 +848125,7 @@ function handleInteractivePermission(params, resolve58) {
|
|
|
847998
848125
|
awaitAutomatedChecksBeforeDialog,
|
|
847999
848126
|
channelCallbacks
|
|
848000
848127
|
} = params;
|
|
848001
|
-
const { resolve: resolveOnce, isResolved, claim } = createResolveOnce(
|
|
848128
|
+
const { resolve: resolveOnce, isResolved, claim } = createResolveOnce(resolve59);
|
|
848002
848129
|
let userInteracted = false;
|
|
848003
848130
|
let checkmarkTransitionTimer;
|
|
848004
848131
|
let checkmarkAbortHandler;
|
|
@@ -848288,8 +848415,8 @@ async function handleSwarmWorkerPermission(params) {
|
|
|
848288
848415
|
...prev,
|
|
848289
848416
|
pendingWorkerRequest: null
|
|
848290
848417
|
}));
|
|
848291
|
-
const decision = await new Promise((
|
|
848292
|
-
const { resolve: resolveOnce, claim } = createResolveOnce(
|
|
848418
|
+
const decision = await new Promise((resolve59) => {
|
|
848419
|
+
const { resolve: resolveOnce, claim } = createResolveOnce(resolve59);
|
|
848293
848420
|
const request3 = createPermissionRequest({
|
|
848294
848421
|
toolName: ctx.tool.name,
|
|
848295
848422
|
toolUseId: ctx.toolUseID,
|
|
@@ -848353,9 +848480,9 @@ var init_swarmWorkerHandler = __esm(() => {
|
|
|
848353
848480
|
// src/hooks/useCanUseTool.tsx
|
|
848354
848481
|
function useCanUseTool(setToolUseConfirmQueue, setToolPermissionContext) {
|
|
848355
848482
|
return import_react312.useCallback(async (tool, input4, toolUseContext, assistantMessage, toolUseID, forceDecision) => {
|
|
848356
|
-
return new Promise((
|
|
848483
|
+
return new Promise((resolve59) => {
|
|
848357
848484
|
const ctx = createPermissionContext(tool, input4, toolUseContext, assistantMessage, toolUseID, setToolPermissionContext, createPermissionQueueOps(setToolUseConfirmQueue));
|
|
848358
|
-
if (ctx.resolveIfAborted(
|
|
848485
|
+
if (ctx.resolveIfAborted(resolve59))
|
|
848359
848486
|
return;
|
|
848360
848487
|
const decisionPromise = forceDecision !== undefined ? Promise.resolve(forceDecision) : hasPermissionsToUseTool(tool, input4, toolUseContext, assistantMessage, toolUseID);
|
|
848361
848488
|
return decisionPromise.then(async (result) => {
|
|
@@ -848369,13 +848496,13 @@ function useCanUseTool(setToolUseConfirmQueue, setToolPermissionContext) {
|
|
|
848369
848496
|
});
|
|
848370
848497
|
}
|
|
848371
848498
|
if (result.behavior === "allow") {
|
|
848372
|
-
if (ctx.resolveIfAborted(
|
|
848499
|
+
if (ctx.resolveIfAborted(resolve59))
|
|
848373
848500
|
return;
|
|
848374
848501
|
if (result.decisionReason?.type === "classifier" && result.decisionReason.classifier === "auto-mode") {
|
|
848375
848502
|
setYoloClassifierApproval(toolUseID, result.decisionReason.reason);
|
|
848376
848503
|
}
|
|
848377
848504
|
ctx.logDecision({ decision: "accept", source: "config" });
|
|
848378
|
-
|
|
848505
|
+
resolve59(ctx.buildAllow(result.updatedInput ?? input4, {
|
|
848379
848506
|
decisionReason: result.decisionReason
|
|
848380
848507
|
}));
|
|
848381
848508
|
return;
|
|
@@ -848387,7 +848514,7 @@ function useCanUseTool(setToolUseConfirmQueue, setToolPermissionContext) {
|
|
|
848387
848514
|
tools: toolUseContext.options.tools
|
|
848388
848515
|
});
|
|
848389
848516
|
const description = getToolDescription(tool, rawDescription);
|
|
848390
|
-
if (ctx.resolveIfAborted(
|
|
848517
|
+
if (ctx.resolveIfAborted(resolve59))
|
|
848391
848518
|
return;
|
|
848392
848519
|
switch (result.behavior) {
|
|
848393
848520
|
case "deny": {
|
|
@@ -848426,7 +848553,7 @@ function useCanUseTool(setToolUseConfirmQueue, setToolPermissionContext) {
|
|
|
848426
848553
|
})
|
|
848427
848554
|
});
|
|
848428
848555
|
}
|
|
848429
|
-
|
|
848556
|
+
resolve59(result);
|
|
848430
848557
|
return;
|
|
848431
848558
|
}
|
|
848432
848559
|
case "ask": {
|
|
@@ -848439,11 +848566,11 @@ function useCanUseTool(setToolUseConfirmQueue, setToolPermissionContext) {
|
|
|
848439
848566
|
permissionMode: appState.toolPermissionContext.mode
|
|
848440
848567
|
});
|
|
848441
848568
|
if (coordinatorDecision) {
|
|
848442
|
-
|
|
848569
|
+
resolve59(coordinatorDecision);
|
|
848443
848570
|
return;
|
|
848444
848571
|
}
|
|
848445
848572
|
}
|
|
848446
|
-
if (ctx.resolveIfAborted(
|
|
848573
|
+
if (ctx.resolveIfAborted(resolve59))
|
|
848447
848574
|
return;
|
|
848448
848575
|
const swarmDecision = await handleSwarmWorkerPermission({
|
|
848449
848576
|
ctx,
|
|
@@ -848453,7 +848580,7 @@ function useCanUseTool(setToolUseConfirmQueue, setToolPermissionContext) {
|
|
|
848453
848580
|
suggestions: result.suggestions
|
|
848454
848581
|
});
|
|
848455
848582
|
if (swarmDecision) {
|
|
848456
|
-
|
|
848583
|
+
resolve59(swarmDecision);
|
|
848457
848584
|
return;
|
|
848458
848585
|
}
|
|
848459
848586
|
if (false) {}
|
|
@@ -848463,7 +848590,7 @@ function useCanUseTool(setToolUseConfirmQueue, setToolPermissionContext) {
|
|
|
848463
848590
|
result,
|
|
848464
848591
|
awaitAutomatedChecksBeforeDialog: appState.toolPermissionContext.awaitAutomatedChecksBeforeDialog,
|
|
848465
848592
|
channelCallbacks: appState.channelPermissionCallbacks
|
|
848466
|
-
},
|
|
848593
|
+
}, resolve59);
|
|
848467
848594
|
return;
|
|
848468
848595
|
}
|
|
848469
848596
|
}
|
|
@@ -848471,10 +848598,10 @@ function useCanUseTool(setToolUseConfirmQueue, setToolPermissionContext) {
|
|
|
848471
848598
|
if (error100 instanceof AbortError || error100 instanceof APIUserAbortError) {
|
|
848472
848599
|
logForDebugging(`Permission check threw ${error100.constructor.name} for tool=${tool.name}: ${error100.message}`);
|
|
848473
848600
|
ctx.logCancelled();
|
|
848474
|
-
|
|
848601
|
+
resolve59(ctx.cancelAndAbort(undefined, true));
|
|
848475
848602
|
} else {
|
|
848476
848603
|
logError3(error100);
|
|
848477
|
-
|
|
848604
|
+
resolve59(ctx.cancelAndAbort(undefined, true));
|
|
848478
848605
|
}
|
|
848479
848606
|
}).finally(() => {
|
|
848480
848607
|
clearClassifierChecking(toolUseID);
|
|
@@ -851274,7 +851401,7 @@ async function submitTranscriptShare(messages, trigger, appearanceId) {
|
|
|
851274
851401
|
} catch {}
|
|
851275
851402
|
const data = {
|
|
851276
851403
|
trigger,
|
|
851277
|
-
version: "4.2.
|
|
851404
|
+
version: "4.2.20",
|
|
851278
851405
|
platform: process.platform,
|
|
851279
851406
|
transcript,
|
|
851280
851407
|
subagentTranscripts: Object.keys(subagentTranscripts).length > 0 ? subagentTranscripts : undefined,
|
|
@@ -852529,7 +852656,7 @@ function getReleaseType(current2, latest) {
|
|
|
852529
852656
|
return "patch";
|
|
852530
852657
|
}
|
|
852531
852658
|
async function checkNewAutoUpdate(callbacks) {
|
|
852532
|
-
const currentVersion = "4.2.
|
|
852659
|
+
const currentVersion = "4.2.20";
|
|
852533
852660
|
logForDebugging(`[newAutoUpdater] checking, current: ${currentVersion}`);
|
|
852534
852661
|
if (isNewAutoUpdaterDisabled()) {
|
|
852535
852662
|
return { action: "skip", currentVersion, latestVersion: null };
|
|
@@ -854255,7 +854382,7 @@ var init_lspRecommendation = __esm(() => {
|
|
|
854255
854382
|
function usePluginRecommendationBase() {
|
|
854256
854383
|
const [recommendation, setRecommendation] = React168.useState(null);
|
|
854257
854384
|
const isCheckingRef = React168.useRef(false);
|
|
854258
|
-
const tryResolve = React168.useCallback((
|
|
854385
|
+
const tryResolve = React168.useCallback((resolve59) => {
|
|
854259
854386
|
if (getIsRemoteMode())
|
|
854260
854387
|
return;
|
|
854261
854388
|
if (recommendation)
|
|
@@ -854263,7 +854390,7 @@ function usePluginRecommendationBase() {
|
|
|
854263
854390
|
if (isCheckingRef.current)
|
|
854264
854391
|
return;
|
|
854265
854392
|
isCheckingRef.current = true;
|
|
854266
|
-
|
|
854393
|
+
resolve59().then((rec) => {
|
|
854267
854394
|
if (rec)
|
|
854268
854395
|
setRecommendation(rec);
|
|
854269
854396
|
}).catch(logError3).finally(() => {
|
|
@@ -855423,7 +855550,7 @@ function makeRecord(plugin2, key6, lifecycle, prev, lastError) {
|
|
|
855423
855550
|
}
|
|
855424
855551
|
async function fetchWithTimeout2(costrictFetch, url5) {
|
|
855425
855552
|
const controller = new AbortController;
|
|
855426
|
-
const timeoutId = setTimeout(() => controller.abort(),
|
|
855553
|
+
const timeoutId = setTimeout(() => controller.abort(), FETCH_TIMEOUT_MS9);
|
|
855427
855554
|
try {
|
|
855428
855555
|
return await costrictFetch(url5, { signal: controller.signal });
|
|
855429
855556
|
} finally {
|
|
@@ -855634,7 +855761,7 @@ async function reconcileCloudPlugins() {
|
|
|
855634
855761
|
}
|
|
855635
855762
|
return result;
|
|
855636
855763
|
}
|
|
855637
|
-
var PLUGIN_PAGE_SIZE = 20, PLUGIN_MAX_PAGES = 20,
|
|
855764
|
+
var PLUGIN_PAGE_SIZE = 20, PLUGIN_MAX_PAGES = 20, FETCH_TIMEOUT_MS9 = 15000, AGGREGATED_MARKETPLACE_NAME = "costrict-plugins", AGGREGATED_MARKETPLACE_SOURCE;
|
|
855638
855765
|
var init_reconcileCloudPlugins = __esm(() => {
|
|
855639
855766
|
init_fetch2();
|
|
855640
855767
|
init_auth();
|
|
@@ -855759,7 +855886,7 @@ var init_cloudPluginSyncLoop = __esm(() => {
|
|
|
855759
855886
|
});
|
|
855760
855887
|
|
|
855761
855888
|
// src/utils/plugins/reconciler.ts
|
|
855762
|
-
import { isAbsolute as
|
|
855889
|
+
import { isAbsolute as isAbsolute32, resolve as resolve59 } from "path";
|
|
855763
855890
|
function diffMarketplaces(declared, materialized, opts) {
|
|
855764
855891
|
const missing = [];
|
|
855765
855892
|
const sourceChanged = [];
|
|
@@ -855867,12 +855994,12 @@ async function reconcileMarketplaces(opts) {
|
|
|
855867
855994
|
return { installed, updated, failed, upToDate: diff2.upToDate, skipped };
|
|
855868
855995
|
}
|
|
855869
855996
|
function normalizeSource(source, projectRoot) {
|
|
855870
|
-
if ((source.source === "directory" || source.source === "file") && !
|
|
855997
|
+
if ((source.source === "directory" || source.source === "file") && !isAbsolute32(source.path)) {
|
|
855871
855998
|
const base2 = projectRoot ?? getOriginalCwd();
|
|
855872
855999
|
const canonicalRoot = findCanonicalGitRoot(base2);
|
|
855873
856000
|
return {
|
|
855874
856001
|
...source,
|
|
855875
|
-
path:
|
|
856002
|
+
path: resolve59(canonicalRoot ?? base2, source.path)
|
|
855876
856003
|
};
|
|
855877
856004
|
}
|
|
855878
856005
|
return source;
|
|
@@ -860226,8 +860353,8 @@ ${t("repl.sandboxRequired", { reason })}
|
|
|
860226
860353
|
return () => unregisterLeaderSetToolPermissionContext();
|
|
860227
860354
|
}, [setToolPermissionContext]);
|
|
860228
860355
|
const canUseTool = useCanUseTool_default(setToolUseConfirmQueue, setToolPermissionContext);
|
|
860229
|
-
const requestPrompt = import_react359.useCallback((title, toolInputSummary) => (request3) => new Promise((
|
|
860230
|
-
setPromptQueue((prev) => [...prev, { request: request3, title, toolInputSummary, resolve:
|
|
860356
|
+
const requestPrompt = import_react359.useCallback((title, toolInputSummary) => (request3) => new Promise((resolve60, reject2) => {
|
|
860357
|
+
setPromptQueue((prev) => [...prev, { request: request3, title, toolInputSummary, resolve: resolve60, reject: reject2 }]);
|
|
860231
860358
|
}), []);
|
|
860232
860359
|
const getToolUseContext = import_react359.useCallback((messages2, _newMessages, abortController2, mainLoopModel2) => {
|
|
860233
860360
|
const s = store.getState();
|
|
@@ -863030,7 +863157,7 @@ function cliOk(msg) {
|
|
|
863030
863157
|
|
|
863031
863158
|
// src/cli/handlers/skill.ts
|
|
863032
863159
|
import { access as access6, mkdir as mkdir74, writeFile as writeFile80 } from "fs/promises";
|
|
863033
|
-
import { join as join223, resolve as
|
|
863160
|
+
import { join as join223, resolve as resolve60 } from "path";
|
|
863034
863161
|
function isUuid(value) {
|
|
863035
863162
|
return /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/iu.test(value);
|
|
863036
863163
|
}
|
|
@@ -863043,14 +863170,14 @@ function sanitizeSkillInstallName(value) {
|
|
|
863043
863170
|
}
|
|
863044
863171
|
function resolveInstallRoot(options, cwd2, configHome) {
|
|
863045
863172
|
if (options.dir) {
|
|
863046
|
-
return { root:
|
|
863173
|
+
return { root: resolve60(cwd2, options.dir), scope: "dir" };
|
|
863047
863174
|
}
|
|
863048
863175
|
const scope = options.scope ?? "user";
|
|
863049
863176
|
if (scope === "user") {
|
|
863050
|
-
return { root:
|
|
863177
|
+
return { root: resolve60(configHome, "skills"), scope };
|
|
863051
863178
|
}
|
|
863052
863179
|
if (scope === "project") {
|
|
863053
|
-
return { root:
|
|
863180
|
+
return { root: resolve60(cwd2, ".costrict", "skills"), scope };
|
|
863054
863181
|
}
|
|
863055
863182
|
throw new SkillInstallError("invalidScope", { scope });
|
|
863056
863183
|
}
|
|
@@ -863447,8 +863574,8 @@ async function handleMcpjsonServerApprovals(root9) {
|
|
|
863447
863574
|
if (pendingServers.length === 0) {
|
|
863448
863575
|
return;
|
|
863449
863576
|
}
|
|
863450
|
-
await new Promise((
|
|
863451
|
-
const done = () => void
|
|
863577
|
+
await new Promise((resolve61) => {
|
|
863578
|
+
const done = () => void resolve61();
|
|
863452
863579
|
if (pendingServers.length === 1 && pendingServers[0] !== undefined) {
|
|
863453
863580
|
const serverName = pendingServers[0];
|
|
863454
863581
|
root9.render(/* @__PURE__ */ jsx_runtime490.jsx(AppStateProvider, {
|
|
@@ -863762,7 +863889,7 @@ function WelcomeV2() {
|
|
|
863762
863889
|
dimColor: true,
|
|
863763
863890
|
children: [
|
|
863764
863891
|
"v",
|
|
863765
|
-
"4.2.
|
|
863892
|
+
"4.2.20",
|
|
863766
863893
|
" "
|
|
863767
863894
|
]
|
|
863768
863895
|
})
|
|
@@ -863828,7 +863955,7 @@ function WelcomeV2() {
|
|
|
863828
863955
|
dimColor: true,
|
|
863829
863956
|
children: [
|
|
863830
863957
|
"v",
|
|
863831
|
-
"4.2.
|
|
863958
|
+
"4.2.20",
|
|
863832
863959
|
" "
|
|
863833
863960
|
]
|
|
863834
863961
|
})
|
|
@@ -863930,7 +864057,7 @@ function AppleTerminalWelcomeV2({ theme: theme2, welcomeMessage }) {
|
|
|
863930
864057
|
dimColor: true,
|
|
863931
864058
|
children: [
|
|
863932
864059
|
"v",
|
|
863933
|
-
"4.2.
|
|
864060
|
+
"4.2.20",
|
|
863934
864061
|
" "
|
|
863935
864062
|
]
|
|
863936
864063
|
})
|
|
@@ -863996,7 +864123,7 @@ function AppleTerminalWelcomeV2({ theme: theme2, welcomeMessage }) {
|
|
|
863996
864123
|
dimColor: true,
|
|
863997
864124
|
children: [
|
|
863998
864125
|
"v",
|
|
863999
|
-
"4.2.
|
|
864126
|
+
"4.2.20",
|
|
864000
864127
|
" "
|
|
864001
864128
|
]
|
|
864002
864129
|
})
|
|
@@ -864936,12 +865063,12 @@ function completeOnboarding() {
|
|
|
864936
865063
|
saveGlobalConfig((current2) => ({
|
|
864937
865064
|
...current2,
|
|
864938
865065
|
hasCompletedOnboarding: true,
|
|
864939
|
-
lastOnboardingVersion: "4.2.
|
|
865066
|
+
lastOnboardingVersion: "4.2.20"
|
|
864940
865067
|
}));
|
|
864941
865068
|
}
|
|
864942
865069
|
function showDialog(root9, renderer) {
|
|
864943
|
-
return new Promise((
|
|
864944
|
-
const done = (result) => void
|
|
865070
|
+
return new Promise((resolve61) => {
|
|
865071
|
+
const done = (result) => void resolve61(result);
|
|
864945
865072
|
root9.render(renderer(done));
|
|
864946
865073
|
});
|
|
864947
865074
|
}
|
|
@@ -871887,7 +872014,7 @@ async function launchWindowsTerminal(terminal, claudePath, claudeArgs, cwd2) {
|
|
|
871887
872014
|
});
|
|
871888
872015
|
}
|
|
871889
872016
|
function spawnDetached(command11, args, opts = {}) {
|
|
871890
|
-
return new Promise((
|
|
872017
|
+
return new Promise((resolve61) => {
|
|
871891
872018
|
const child = spawn17(command11, args, {
|
|
871892
872019
|
detached: true,
|
|
871893
872020
|
stdio: "ignore",
|
|
@@ -871898,11 +872025,11 @@ function spawnDetached(command11, args, opts = {}) {
|
|
|
871898
872025
|
logForDebugging(`Failed to spawn ${command11}: ${err3.message}`, {
|
|
871899
872026
|
level: "error"
|
|
871900
872027
|
});
|
|
871901
|
-
|
|
872028
|
+
resolve61(false);
|
|
871902
872029
|
});
|
|
871903
872030
|
child.once("spawn", () => {
|
|
871904
872031
|
child.unref();
|
|
871905
|
-
|
|
872032
|
+
resolve61(true);
|
|
871906
872033
|
});
|
|
871907
872034
|
});
|
|
871908
872035
|
}
|
|
@@ -872809,6 +872936,15 @@ To attach: ${source_default.bold(`tmux attach -t ${tmuxSessionName}`)}`));
|
|
|
872809
872936
|
}
|
|
872810
872937
|
} catch {}
|
|
872811
872938
|
}
|
|
872939
|
+
if (getAPIProvider() === "openai") {
|
|
872940
|
+
try {
|
|
872941
|
+
const { fetchOpenAIModels: fetchOpenAIModels2 } = await Promise.resolve().then(() => (init_listModels(), exports_listModels));
|
|
872942
|
+
await Promise.race([
|
|
872943
|
+
fetchOpenAIModels2(),
|
|
872944
|
+
new Promise((_2, reject2) => setTimeout(() => reject2(new Error("OpenAI models fetch timeout")), 5000))
|
|
872945
|
+
]).catch(() => {});
|
|
872946
|
+
} catch {}
|
|
872947
|
+
}
|
|
872812
872948
|
if (!isBareMode()) {
|
|
872813
872949
|
const { hasReleaseNotes } = await checkForReleaseNotes(getGlobalConfig().lastReleaseNotesSeen);
|
|
872814
872950
|
if (hasReleaseNotes) {
|
|
@@ -873643,7 +873779,7 @@ class StructuredIO {
|
|
|
873643
873779
|
});
|
|
873644
873780
|
}
|
|
873645
873781
|
try {
|
|
873646
|
-
return await new Promise((
|
|
873782
|
+
return await new Promise((resolve61, reject2) => {
|
|
873647
873783
|
this.pendingRequests.set(requestId2, {
|
|
873648
873784
|
request: {
|
|
873649
873785
|
type: "control_request",
|
|
@@ -873651,7 +873787,7 @@ class StructuredIO {
|
|
|
873651
873787
|
request: request3
|
|
873652
873788
|
},
|
|
873653
873789
|
resolve: (result) => {
|
|
873654
|
-
|
|
873790
|
+
resolve61(result);
|
|
873655
873791
|
},
|
|
873656
873792
|
reject: reject2,
|
|
873657
873793
|
schema: schema4
|
|
@@ -873869,8 +874005,8 @@ class SerialBatchEventUploader {
|
|
|
873869
874005
|
if (items.length === 0)
|
|
873870
874006
|
return;
|
|
873871
874007
|
while (this.pending.length + items.length > this.config.maxQueueSize && !this.closed) {
|
|
873872
|
-
await new Promise((
|
|
873873
|
-
this.backpressureResolvers.push(
|
|
874008
|
+
await new Promise((resolve61) => {
|
|
874009
|
+
this.backpressureResolvers.push(resolve61);
|
|
873874
874010
|
});
|
|
873875
874011
|
}
|
|
873876
874012
|
if (this.closed)
|
|
@@ -873883,8 +874019,8 @@ class SerialBatchEventUploader {
|
|
|
873883
874019
|
return Promise.resolve();
|
|
873884
874020
|
}
|
|
873885
874021
|
this.drain();
|
|
873886
|
-
return new Promise((
|
|
873887
|
-
this.flushResolvers.push(
|
|
874022
|
+
return new Promise((resolve61) => {
|
|
874023
|
+
this.flushResolvers.push(resolve61);
|
|
873888
874024
|
});
|
|
873889
874025
|
}
|
|
873890
874026
|
close() {
|
|
@@ -873895,11 +874031,11 @@ class SerialBatchEventUploader {
|
|
|
873895
874031
|
this.pending = [];
|
|
873896
874032
|
this.sleepResolve?.();
|
|
873897
874033
|
this.sleepResolve = null;
|
|
873898
|
-
for (const
|
|
873899
|
-
|
|
874034
|
+
for (const resolve61 of this.backpressureResolvers)
|
|
874035
|
+
resolve61();
|
|
873900
874036
|
this.backpressureResolvers = [];
|
|
873901
|
-
for (const
|
|
873902
|
-
|
|
874037
|
+
for (const resolve61 of this.flushResolvers)
|
|
874038
|
+
resolve61();
|
|
873903
874039
|
this.flushResolvers = [];
|
|
873904
874040
|
}
|
|
873905
874041
|
async drain() {
|
|
@@ -873934,8 +874070,8 @@ class SerialBatchEventUploader {
|
|
|
873934
874070
|
} finally {
|
|
873935
874071
|
this.draining = false;
|
|
873936
874072
|
if (this.pending.length === 0) {
|
|
873937
|
-
for (const
|
|
873938
|
-
|
|
874073
|
+
for (const resolve61 of this.flushResolvers)
|
|
874074
|
+
resolve61();
|
|
873939
874075
|
this.flushResolvers = [];
|
|
873940
874076
|
}
|
|
873941
874077
|
}
|
|
@@ -873974,16 +874110,16 @@ class SerialBatchEventUploader {
|
|
|
873974
874110
|
releaseBackpressure() {
|
|
873975
874111
|
const resolvers2 = this.backpressureResolvers;
|
|
873976
874112
|
this.backpressureResolvers = [];
|
|
873977
|
-
for (const
|
|
873978
|
-
|
|
874113
|
+
for (const resolve61 of resolvers2)
|
|
874114
|
+
resolve61();
|
|
873979
874115
|
}
|
|
873980
874116
|
sleep(ms) {
|
|
873981
|
-
return new Promise((
|
|
873982
|
-
this.sleepResolve =
|
|
873983
|
-
setTimeout((self2,
|
|
874117
|
+
return new Promise((resolve61) => {
|
|
874118
|
+
this.sleepResolve = resolve61;
|
|
874119
|
+
setTimeout((self2, resolve62) => {
|
|
873984
874120
|
self2.sleepResolve = null;
|
|
873985
|
-
|
|
873986
|
-
}, ms, this,
|
|
874121
|
+
resolve62();
|
|
874122
|
+
}, ms, this, resolve61);
|
|
873987
874123
|
});
|
|
873988
874124
|
}
|
|
873989
874125
|
}
|
|
@@ -877550,8 +877686,8 @@ ${m4.text}
|
|
|
877550
877686
|
const controller = new AbortController;
|
|
877551
877687
|
activeOAuthFlows.set(serverName, controller);
|
|
877552
877688
|
let resolveAuthUrl;
|
|
877553
|
-
const authUrlPromise = new Promise((
|
|
877554
|
-
resolveAuthUrl =
|
|
877689
|
+
const authUrlPromise = new Promise((resolve61) => {
|
|
877690
|
+
resolveAuthUrl = resolve61;
|
|
877555
877691
|
});
|
|
877556
877692
|
const oauthPromise = performMCPOAuthFlow(serverName, config13, (url5) => resolveAuthUrl(url5), controller.signal, {
|
|
877557
877693
|
skipBrowserOpen: true,
|
|
@@ -877665,8 +877801,8 @@ ${m4.text}
|
|
|
877665
877801
|
});
|
|
877666
877802
|
const service = new OAuthService;
|
|
877667
877803
|
let urlResolver;
|
|
877668
|
-
const urlPromise = new Promise((
|
|
877669
|
-
urlResolver =
|
|
877804
|
+
const urlPromise = new Promise((resolve61) => {
|
|
877805
|
+
urlResolver = resolve61;
|
|
877670
877806
|
});
|
|
877671
877807
|
const flow = service.startOAuthFlow(async (manualUrl, automaticUrl) => {
|
|
877672
877808
|
urlResolver({ manualUrl, automaticUrl });
|
|
@@ -877994,8 +878130,8 @@ function createCanUseToolWithPermissionPrompt(permissionPromptTool) {
|
|
|
877994
878130
|
}
|
|
877995
878131
|
};
|
|
877996
878132
|
}
|
|
877997
|
-
const abortPromise = new Promise((
|
|
877998
|
-
combinedSignal.addEventListener("abort", () =>
|
|
878133
|
+
const abortPromise = new Promise((resolve61) => {
|
|
878134
|
+
combinedSignal.addEventListener("abort", () => resolve61("aborted"), {
|
|
877999
878135
|
once: true
|
|
878000
878136
|
});
|
|
878001
878137
|
});
|
|
@@ -879324,7 +879460,7 @@ var init_SSHProbe = __esm(() => {
|
|
|
879324
879460
|
|
|
879325
879461
|
// src/ssh/SSHDeploy.ts
|
|
879326
879462
|
import { existsSync as existsSync37 } from "fs";
|
|
879327
|
-
import { resolve as
|
|
879463
|
+
import { resolve as resolve61 } from "path";
|
|
879328
879464
|
async function runSshCommand(host, command11, timeoutMs = SSH_TIMEOUT_MS) {
|
|
879329
879465
|
const proc = Bun.spawn(["ssh", "-o", "ConnectTimeout=10", host, command11], {
|
|
879330
879466
|
stdout: "pipe",
|
|
@@ -879343,11 +879479,11 @@ async function runSshCommand(host, command11, timeoutMs = SSH_TIMEOUT_MS) {
|
|
|
879343
879479
|
}
|
|
879344
879480
|
}
|
|
879345
879481
|
function findLocalBinary() {
|
|
879346
|
-
const projectRoot =
|
|
879347
|
-
const distPath =
|
|
879482
|
+
const projectRoot = resolve61(import.meta.dir, "../..");
|
|
879483
|
+
const distPath = resolve61(projectRoot, "dist/cli.js");
|
|
879348
879484
|
if (existsSync37(distPath))
|
|
879349
879485
|
return distPath;
|
|
879350
|
-
const devPath =
|
|
879486
|
+
const devPath = resolve61(projectRoot, "src/entrypoints/cli.tsx");
|
|
879351
879487
|
if (existsSync37(devPath))
|
|
879352
879488
|
return devPath;
|
|
879353
879489
|
throw new Error("Cannot find local CLI binary to deploy. Run `bun run build` first.");
|
|
@@ -879993,7 +880129,7 @@ async function startMCPServer(cwd3, debug5, verbose) {
|
|
|
879993
880129
|
setCwd(cwd3);
|
|
879994
880130
|
const server2 = new Server({
|
|
879995
880131
|
name: "claude/tengu",
|
|
879996
|
-
version: "4.2.
|
|
880132
|
+
version: "4.2.20"
|
|
879997
880133
|
}, {
|
|
879998
880134
|
capabilities: {
|
|
879999
880135
|
tools: {}
|
|
@@ -882278,7 +882414,7 @@ function createHealthRoutes(sessionManager) {
|
|
|
882278
882414
|
const uptime2 = process.uptime() * 1000;
|
|
882279
882415
|
return c10.json({
|
|
882280
882416
|
status: "ok",
|
|
882281
|
-
version: "4.2.
|
|
882417
|
+
version: "4.2.20",
|
|
882282
882418
|
uptime_ms: Math.round(uptime2),
|
|
882283
882419
|
active_sessions: sessionManager.getActiveCount()
|
|
882284
882420
|
});
|
|
@@ -882550,7 +882686,7 @@ function getMacroDefines() {
|
|
|
882550
882686
|
commit = execSync3("git rev-parse --short HEAD", { encoding: "utf-8", cwd: __dirname }).trim();
|
|
882551
882687
|
} catch {}
|
|
882552
882688
|
return {
|
|
882553
|
-
"MACRO.VERSION": JSON.stringify("4.2.
|
|
882689
|
+
"MACRO.VERSION": JSON.stringify("4.2.20"),
|
|
882554
882690
|
"MACRO.BUILD_TIME": JSON.stringify(new Date().toISOString()),
|
|
882555
882691
|
"MACRO.COMMIT": JSON.stringify(commit),
|
|
882556
882692
|
"MACRO.FEEDBACK_CHANNEL": JSON.stringify(""),
|
|
@@ -883474,6 +883610,15 @@ function createSessionRoutes(sessionManager, eventBus) {
|
|
|
883474
883610
|
permissionMode = "default";
|
|
883475
883611
|
}
|
|
883476
883612
|
}
|
|
883613
|
+
if (!permissionMode) {
|
|
883614
|
+
try {
|
|
883615
|
+
const { getInitialSettings: getInitialSettings2 } = await Promise.resolve().then(() => (init_settings2(), exports_settings));
|
|
883616
|
+
const settingsMode = getInitialSettings2().permissions?.defaultMode;
|
|
883617
|
+
if (typeof settingsMode === "string" && settingsMode.length > 0) {
|
|
883618
|
+
permissionMode = settingsMode;
|
|
883619
|
+
}
|
|
883620
|
+
} catch {}
|
|
883621
|
+
}
|
|
883477
883622
|
try {
|
|
883478
883623
|
const handle = await sessionManager.createSession({
|
|
883479
883624
|
cwd: cwd4,
|
|
@@ -887120,12 +887265,12 @@ var init_attachments3 = __esm(() => {
|
|
|
887120
887265
|
class ControlChannel {
|
|
887121
887266
|
pending = new Map;
|
|
887122
887267
|
register(requestId2, timeoutMs = 1e4) {
|
|
887123
|
-
return new Promise((
|
|
887268
|
+
return new Promise((resolve62, reject2) => {
|
|
887124
887269
|
const timeout2 = setTimeout(() => {
|
|
887125
887270
|
this.pending.delete(requestId2);
|
|
887126
887271
|
reject2(new Error(`Control response timed out for ${requestId2}`));
|
|
887127
887272
|
}, timeoutMs);
|
|
887128
|
-
this.pending.set(requestId2, { resolve:
|
|
887273
|
+
this.pending.set(requestId2, { resolve: resolve62, reject: reject2, timeout: timeout2 });
|
|
887129
887274
|
});
|
|
887130
887275
|
}
|
|
887131
887276
|
tryResolve(msg) {
|
|
@@ -887355,7 +887500,7 @@ var init_sessionHandle = __esm(() => {
|
|
|
887355
887500
|
if (this._status === "stopped") {
|
|
887356
887501
|
throw new Error(`Session ${this.sessionId} is stopped`);
|
|
887357
887502
|
}
|
|
887358
|
-
return new Promise((
|
|
887503
|
+
return new Promise((resolve62, reject2) => {
|
|
887359
887504
|
const timer3 = setTimeout(() => {
|
|
887360
887505
|
const error100 = new Error(`Session ${this.sessionId} init timed out`);
|
|
887361
887506
|
this.reportInitializationFailure(error100);
|
|
@@ -887366,7 +887511,7 @@ var init_sessionHandle = __esm(() => {
|
|
|
887366
887511
|
this.initResolve = (data) => {
|
|
887367
887512
|
clearTimeout(timer3);
|
|
887368
887513
|
origResolve?.(data);
|
|
887369
|
-
|
|
887514
|
+
resolve62();
|
|
887370
887515
|
};
|
|
887371
887516
|
this.initReject = (err3) => {
|
|
887372
887517
|
clearTimeout(timer3);
|
|
@@ -887592,12 +887737,12 @@ ${stderrTail}` : baseMessage;
|
|
|
887592
887737
|
}
|
|
887593
887738
|
if (this._status === "running")
|
|
887594
887739
|
return;
|
|
887595
|
-
return new Promise((
|
|
887740
|
+
return new Promise((resolve62, reject2) => {
|
|
887596
887741
|
const origResolve = this.initResolve;
|
|
887597
887742
|
const origReject = this.initReject;
|
|
887598
887743
|
this.initResolve = (data) => {
|
|
887599
887744
|
origResolve?.(data);
|
|
887600
|
-
|
|
887745
|
+
resolve62();
|
|
887601
887746
|
};
|
|
887602
887747
|
this.initReject = (err3) => {
|
|
887603
887748
|
origReject?.(err3);
|
|
@@ -887743,10 +887888,10 @@ ${stderrTail}` : baseMessage;
|
|
|
887743
887888
|
getPendingPermissions: () => this.pendingPermissions,
|
|
887744
887889
|
getPendingQuestions: () => this.pendingQuestions,
|
|
887745
887890
|
resolveInit: (data) => {
|
|
887746
|
-
const
|
|
887891
|
+
const resolve62 = this.initResolve;
|
|
887747
887892
|
this.initResolve = null;
|
|
887748
887893
|
this.initReject = null;
|
|
887749
|
-
|
|
887894
|
+
resolve62?.(data);
|
|
887750
887895
|
this.opts.onInit?.(data);
|
|
887751
887896
|
},
|
|
887752
887897
|
resolvePrompt: (value) => {
|
|
@@ -887877,10 +888022,10 @@ ${stderrTail}` : baseMessage;
|
|
|
887877
888022
|
if (!this._title && !this._titleGenerationAttempted) {
|
|
887878
888023
|
this._firstPromptContent = content;
|
|
887879
888024
|
}
|
|
887880
|
-
return new Promise((
|
|
888025
|
+
return new Promise((resolve62, reject2) => {
|
|
887881
888026
|
this.promptResolve = (value) => {
|
|
887882
888027
|
this._prompting = false;
|
|
887883
|
-
|
|
888028
|
+
resolve62(value);
|
|
887884
888029
|
};
|
|
887885
888030
|
this.promptReject = (reason) => {
|
|
887886
888031
|
this._prompting = false;
|
|
@@ -887907,16 +888052,16 @@ ${stderrTail}` : baseMessage;
|
|
|
887907
888052
|
});
|
|
887908
888053
|
if (!this.promptResolve)
|
|
887909
888054
|
return;
|
|
887910
|
-
await new Promise((
|
|
888055
|
+
await new Promise((resolve62) => {
|
|
887911
888056
|
const timeout2 = setTimeout(() => {
|
|
887912
888057
|
this.terminate();
|
|
887913
|
-
|
|
888058
|
+
resolve62();
|
|
887914
888059
|
}, 2000);
|
|
887915
888060
|
const originalResolve = this.promptResolve;
|
|
887916
888061
|
this.promptResolve = (value) => {
|
|
887917
888062
|
clearTimeout(timeout2);
|
|
887918
888063
|
originalResolve?.(value);
|
|
887919
|
-
|
|
888064
|
+
resolve62();
|
|
887920
888065
|
};
|
|
887921
888066
|
});
|
|
887922
888067
|
}
|
|
@@ -888017,12 +888162,12 @@ ${stderrTail}` : baseMessage;
|
|
|
888017
888162
|
if (!child || !pid)
|
|
888018
888163
|
return;
|
|
888019
888164
|
if (process.platform === "win32") {
|
|
888020
|
-
await new Promise((
|
|
888165
|
+
await new Promise((resolve62) => {
|
|
888021
888166
|
import_tree_kill2.default(pid, signal, (err3) => {
|
|
888022
888167
|
if (err3 && err3.code !== "ESRCH") {
|
|
888023
888168
|
logError3(err3);
|
|
888024
888169
|
}
|
|
888025
|
-
|
|
888170
|
+
resolve62();
|
|
888026
888171
|
});
|
|
888027
888172
|
});
|
|
888028
888173
|
return;
|
|
@@ -888057,7 +888202,7 @@ ${stderrTail}` : baseMessage;
|
|
|
888057
888202
|
while (Date.now() < deadline) {
|
|
888058
888203
|
if (this._directExited && !this.isTreeAlive(groupId))
|
|
888059
888204
|
return true;
|
|
888060
|
-
await new Promise((
|
|
888205
|
+
await new Promise((resolve62) => setTimeout(resolve62, TREE_EXIT_POLL_MS));
|
|
888061
888206
|
}
|
|
888062
888207
|
return this._directExited && !this.isTreeAlive(groupId);
|
|
888063
888208
|
}
|
|
@@ -888141,7 +888286,7 @@ __export(exports_sessionManager, {
|
|
|
888141
888286
|
});
|
|
888142
888287
|
import { readFile as readFile93, writeFile as writeFile83, mkdir as mkdir76, rm as rm18 } from "fs/promises";
|
|
888143
888288
|
import { existsSync as existsSync42, statSync as statSync14 } from "fs";
|
|
888144
|
-
import { join as join236, resolve as
|
|
888289
|
+
import { join as join236, resolve as resolve62, isAbsolute as isAbsolute33 } from "path";
|
|
888145
888290
|
|
|
888146
888291
|
class SessionManager {
|
|
888147
888292
|
sessions = new Map;
|
|
@@ -888407,8 +888552,8 @@ class SessionManager {
|
|
|
888407
888552
|
}
|
|
888408
888553
|
const sessionId2 = opts.sessionId ?? crypto.randomUUID();
|
|
888409
888554
|
let cwd4 = opts.cwd || this.defaultWorkspace || process.cwd();
|
|
888410
|
-
if (!
|
|
888411
|
-
cwd4 =
|
|
888555
|
+
if (!isAbsolute33(cwd4)) {
|
|
888556
|
+
cwd4 = resolve62(process.cwd(), cwd4);
|
|
888412
888557
|
}
|
|
888413
888558
|
if (!existsSync42(cwd4) || !statSync14(cwd4).isDirectory()) {
|
|
888414
888559
|
throw new Error(`Working directory does not exist: ${cwd4}`);
|
|
@@ -888509,8 +888654,8 @@ class SessionManager {
|
|
|
888509
888654
|
return this._initDataReady ?? Promise.resolve();
|
|
888510
888655
|
}
|
|
888511
888656
|
startProbeSession(opts) {
|
|
888512
|
-
this._initDataReady = new Promise((
|
|
888513
|
-
this._resolveInitDataReady =
|
|
888657
|
+
this._initDataReady = new Promise((resolve63) => {
|
|
888658
|
+
this._resolveInitDataReady = resolve63;
|
|
888514
888659
|
});
|
|
888515
888660
|
(async () => {
|
|
888516
888661
|
try {
|
|
@@ -888558,8 +888703,8 @@ class SessionManager {
|
|
|
888558
888703
|
}
|
|
888559
888704
|
refillWarmPool(opts) {
|
|
888560
888705
|
let cwd4 = opts.cwd || this.defaultWorkspace || process.cwd();
|
|
888561
|
-
if (!
|
|
888562
|
-
cwd4 =
|
|
888706
|
+
if (!isAbsolute33(cwd4)) {
|
|
888707
|
+
cwd4 = resolve62(process.cwd(), cwd4);
|
|
888563
888708
|
}
|
|
888564
888709
|
if (this._shuttingDown || this.poolTargetSize <= 0)
|
|
888565
888710
|
return;
|
|
@@ -889510,7 +889655,7 @@ __export(exports_update, {
|
|
|
889510
889655
|
});
|
|
889511
889656
|
async function update() {
|
|
889512
889657
|
logEvent("tengu_update_check", {});
|
|
889513
|
-
writeToStdout(`${t("cli.update.currentVersion", "Current version")}: ${"4.2.
|
|
889658
|
+
writeToStdout(`${t("cli.update.currentVersion", "Current version")}: ${"4.2.20"}
|
|
889514
889659
|
`);
|
|
889515
889660
|
const channel5 = getInitialSettings()?.autoUpdatesChannel ?? "latest";
|
|
889516
889661
|
writeToStdout(`${t("cli.update.checkingUpdates", { channel: channel5 }, "Checking for updates to {channel} version...")}
|
|
@@ -889585,8 +889730,8 @@ async function update() {
|
|
|
889585
889730
|
writeToStdout(`${t("cli.update.managedByHomebrew", "CoStrict is managed by Homebrew.")}
|
|
889586
889731
|
`);
|
|
889587
889732
|
const latest = await getLatestVersion(channel5);
|
|
889588
|
-
if (latest && !gte2("4.2.
|
|
889589
|
-
writeToStdout(`${t("cli.update.updateAvailable", { current: "4.2.
|
|
889733
|
+
if (latest && !gte2("4.2.20", latest)) {
|
|
889734
|
+
writeToStdout(`${t("cli.update.updateAvailable", { current: "4.2.20", latest }, "Update available: {current} \u2192 {latest}")}
|
|
889590
889735
|
`);
|
|
889591
889736
|
writeToStdout(`
|
|
889592
889737
|
`);
|
|
@@ -889602,8 +889747,8 @@ async function update() {
|
|
|
889602
889747
|
writeToStdout(`${t("cli.update.managedByWinget", "CoStrict is managed by winget.")}
|
|
889603
889748
|
`);
|
|
889604
889749
|
const latest = await getLatestVersion(channel5);
|
|
889605
|
-
if (latest && !gte2("4.2.
|
|
889606
|
-
writeToStdout(`${t("cli.update.updateAvailable", { current: "4.2.
|
|
889750
|
+
if (latest && !gte2("4.2.20", latest)) {
|
|
889751
|
+
writeToStdout(`${t("cli.update.updateAvailable", { current: "4.2.20", latest }, "Update available: {current} \u2192 {latest}")}
|
|
889607
889752
|
`);
|
|
889608
889753
|
writeToStdout(`
|
|
889609
889754
|
`);
|
|
@@ -889619,8 +889764,8 @@ async function update() {
|
|
|
889619
889764
|
writeToStdout(`${t("cli.update.managedByApk", "CoStrict is managed by apk.")}
|
|
889620
889765
|
`);
|
|
889621
889766
|
const latest = await getLatestVersion(channel5);
|
|
889622
|
-
if (latest && !gte2("4.2.
|
|
889623
|
-
writeToStdout(`${t("cli.update.updateAvailable", { current: "4.2.
|
|
889767
|
+
if (latest && !gte2("4.2.20", latest)) {
|
|
889768
|
+
writeToStdout(`${t("cli.update.updateAvailable", { current: "4.2.20", latest }, "Update available: {current} \u2192 {latest}")}
|
|
889624
889769
|
`);
|
|
889625
889770
|
writeToStdout(`
|
|
889626
889771
|
`);
|
|
@@ -889685,11 +889830,11 @@ async function update() {
|
|
|
889685
889830
|
`);
|
|
889686
889831
|
await gracefulShutdown(1);
|
|
889687
889832
|
}
|
|
889688
|
-
if (result2.latestVersion === "4.2.
|
|
889689
|
-
writeToStdout(source_default.green(t("cli.update.upToDateVersion", { version: "4.2.
|
|
889833
|
+
if (result2.latestVersion === "4.2.20") {
|
|
889834
|
+
writeToStdout(source_default.green(t("cli.update.upToDateVersion", { version: "4.2.20" }, "CoStrict is up to date ({version})")) + `
|
|
889690
889835
|
`);
|
|
889691
889836
|
} else {
|
|
889692
|
-
writeToStdout(source_default.green(t("cli.update.successfullyUpdated", { from: "4.2.
|
|
889837
|
+
writeToStdout(source_default.green(t("cli.update.successfullyUpdated", { from: "4.2.20", to: String(result2.latestVersion) }, "Successfully updated from {from} to version {to}")) + `
|
|
889693
889838
|
`);
|
|
889694
889839
|
regenerateCompletionCache();
|
|
889695
889840
|
}
|
|
@@ -889749,12 +889894,12 @@ async function update() {
|
|
|
889749
889894
|
`);
|
|
889750
889895
|
await gracefulShutdown(1);
|
|
889751
889896
|
}
|
|
889752
|
-
if (latestVersion === "4.2.
|
|
889753
|
-
writeToStdout(source_default.green(t("cli.update.upToDateVersion", { version: "4.2.
|
|
889897
|
+
if (latestVersion === "4.2.20") {
|
|
889898
|
+
writeToStdout(source_default.green(t("cli.update.upToDateVersion", { version: "4.2.20" }, "CoStrict is up to date ({version})")) + `
|
|
889754
889899
|
`);
|
|
889755
889900
|
await gracefulShutdown(0);
|
|
889756
889901
|
}
|
|
889757
|
-
writeToStdout(`${t("cli.update.newVersionAvailable", { latest: String(latestVersion), current: "4.2.
|
|
889902
|
+
writeToStdout(`${t("cli.update.newVersionAvailable", { latest: String(latestVersion), current: "4.2.20" }, "New version available: {latest} (current: {current})")}
|
|
889758
889903
|
`);
|
|
889759
889904
|
writeToStdout(`${t("cli.update.installing", "Installing update...")}
|
|
889760
889905
|
`);
|
|
@@ -889799,7 +889944,7 @@ async function update() {
|
|
|
889799
889944
|
logForDebugging(`update: Installation status: ${result.status}`);
|
|
889800
889945
|
switch (result.status) {
|
|
889801
889946
|
case "success":
|
|
889802
|
-
writeToStdout(source_default.green(t("cli.update.successfullyUpdated", { from: "4.2.
|
|
889947
|
+
writeToStdout(source_default.green(t("cli.update.successfullyUpdated", { from: "4.2.20", to: String(latestVersion) }, "Successfully updated from {from} to version {to}")) + `
|
|
889803
889948
|
`);
|
|
889804
889949
|
regenerateCompletionCache();
|
|
889805
889950
|
break;
|
|
@@ -890223,7 +890368,7 @@ async function setupTokenHandler(root9) {
|
|
|
890223
890368
|
logEvent("tengu_setup_token_command", {});
|
|
890224
890369
|
const showAuthWarning = !isAnthropicAuthEnabled();
|
|
890225
890370
|
const { ConsoleOAuthFlow: ConsoleOAuthFlow2 } = await Promise.resolve().then(() => (init_ConsoleOAuthFlow(), exports_ConsoleOAuthFlow));
|
|
890226
|
-
await new Promise((
|
|
890371
|
+
await new Promise((resolve63) => {
|
|
890227
890372
|
root9.render(/* @__PURE__ */ jsx_runtime512.jsx(AppStateProvider, {
|
|
890228
890373
|
onChangeAppState,
|
|
890229
890374
|
children: /* @__PURE__ */ jsx_runtime512.jsx(KeybindingSetup2, {
|
|
@@ -890247,7 +890392,7 @@ async function setupTokenHandler(root9) {
|
|
|
890247
890392
|
}),
|
|
890248
890393
|
/* @__PURE__ */ jsx_runtime512.jsx(ConsoleOAuthFlow2, {
|
|
890249
890394
|
onDone: () => {
|
|
890250
|
-
|
|
890395
|
+
resolve63();
|
|
890251
890396
|
},
|
|
890252
890397
|
mode: "setup-token",
|
|
890253
890398
|
startingMessage: "This will guide you through long-lived (1-year) auth token setup for your API provider account. Claude subscription required."
|
|
@@ -890271,7 +890416,7 @@ function DoctorWithPlugins({ onDone }) {
|
|
|
890271
890416
|
}
|
|
890272
890417
|
async function doctorHandler(root9) {
|
|
890273
890418
|
logEvent("tengu_doctor_command", {});
|
|
890274
|
-
await new Promise((
|
|
890419
|
+
await new Promise((resolve63) => {
|
|
890275
890420
|
root9.render(/* @__PURE__ */ jsx_runtime512.jsx(AppStateProvider, {
|
|
890276
890421
|
children: /* @__PURE__ */ jsx_runtime512.jsx(KeybindingSetup2, {
|
|
890277
890422
|
children: /* @__PURE__ */ jsx_runtime512.jsx(MCPConnectionManager, {
|
|
@@ -890279,7 +890424,7 @@ async function doctorHandler(root9) {
|
|
|
890279
890424
|
isStrictMcpConfig: false,
|
|
890280
890425
|
children: /* @__PURE__ */ jsx_runtime512.jsx(DoctorWithPlugins, {
|
|
890281
890426
|
onDone: () => {
|
|
890282
|
-
|
|
890427
|
+
resolve63();
|
|
890283
890428
|
}
|
|
890284
890429
|
})
|
|
890285
890430
|
})
|
|
@@ -890293,14 +890438,14 @@ async function installHandler(target, options) {
|
|
|
890293
890438
|
const { setup: setup2 } = await Promise.resolve().then(() => (init_setup4(), exports_setup2));
|
|
890294
890439
|
await setup2(cwd4(), "default", false, false, undefined, false);
|
|
890295
890440
|
const { install: install2 } = await Promise.resolve().then(() => (init_install(), exports_install));
|
|
890296
|
-
await new Promise((
|
|
890441
|
+
await new Promise((resolve63) => {
|
|
890297
890442
|
const args = [];
|
|
890298
890443
|
if (target)
|
|
890299
890444
|
args.push(target);
|
|
890300
890445
|
if (options.force)
|
|
890301
890446
|
args.push("--force");
|
|
890302
890447
|
install2.call((result) => {
|
|
890303
|
-
|
|
890448
|
+
resolve63();
|
|
890304
890449
|
process.exit(result.includes("failed") ? 1 : 0);
|
|
890305
890450
|
}, {}, args);
|
|
890306
890451
|
});
|
|
@@ -890602,7 +890747,7 @@ __export(exports_main2, {
|
|
|
890602
890747
|
main: () => main
|
|
890603
890748
|
});
|
|
890604
890749
|
import { readFileSync as readFileSync45 } from "fs";
|
|
890605
|
-
import { relative as
|
|
890750
|
+
import { relative as relative40, resolve as resolve63 } from "path";
|
|
890606
890751
|
function logManagedSettings() {
|
|
890607
890752
|
try {
|
|
890608
890753
|
const policySettings = getSettingsForSource("policySettings");
|
|
@@ -891301,13 +891446,13 @@ async function run5() {
|
|
|
891301
891446
|
process.exit(1);
|
|
891302
891447
|
}
|
|
891303
891448
|
try {
|
|
891304
|
-
const filePath =
|
|
891449
|
+
const filePath = resolve63(options.systemPromptFile);
|
|
891305
891450
|
systemPrompt2 = readFileSync45(filePath, "utf8");
|
|
891306
891451
|
} catch (error100) {
|
|
891307
891452
|
const code = getErrnoCode(error100);
|
|
891308
891453
|
if (code === "ENOENT") {
|
|
891309
891454
|
process.stderr.write(source_default.red(cliDesc("errors.cli.systemPromptFileNotFound", `Error: System prompt file not found: {path}
|
|
891310
|
-
`).replace("{path}",
|
|
891455
|
+
`).replace("{path}", resolve63(options.systemPromptFile))));
|
|
891311
891456
|
process.exit(1);
|
|
891312
891457
|
}
|
|
891313
891458
|
process.stderr.write(source_default.red(cliDesc("errors.cli.errorReadingSystemPromptFile", `Error reading system prompt file: {error}
|
|
@@ -891323,13 +891468,13 @@ async function run5() {
|
|
|
891323
891468
|
process.exit(1);
|
|
891324
891469
|
}
|
|
891325
891470
|
try {
|
|
891326
|
-
const filePath =
|
|
891471
|
+
const filePath = resolve63(options.appendSystemPromptFile);
|
|
891327
891472
|
appendSystemPrompt = readFileSync45(filePath, "utf8");
|
|
891328
891473
|
} catch (error100) {
|
|
891329
891474
|
const code = getErrnoCode(error100);
|
|
891330
891475
|
if (code === "ENOENT") {
|
|
891331
891476
|
process.stderr.write(source_default.red(cliDesc("errors.cli.appendSystemPromptFileNotFound", `Error: Append system prompt file not found: {path}
|
|
891332
|
-
`).replace("{path}",
|
|
891477
|
+
`).replace("{path}", resolve63(options.appendSystemPromptFile))));
|
|
891333
891478
|
process.exit(1);
|
|
891334
891479
|
}
|
|
891335
891480
|
process.stderr.write(source_default.red(cliDesc("errors.cli.errorReadingAppendSystemPromptFile", `Error reading append system prompt file: {error}
|
|
@@ -891389,7 +891534,7 @@ ${addendum}` : addendum;
|
|
|
891389
891534
|
errors14 = result.errors;
|
|
891390
891535
|
}
|
|
891391
891536
|
} else {
|
|
891392
|
-
const configPath =
|
|
891537
|
+
const configPath = resolve63(configItem);
|
|
891393
891538
|
const result = parseMcpConfigFromFilePath({
|
|
891394
891539
|
filePath: configPath,
|
|
891395
891540
|
expandVars: true,
|
|
@@ -892003,7 +892148,7 @@ ${assistantAddendum}` : assistantAddendum;
|
|
|
892003
892148
|
}
|
|
892004
892149
|
}
|
|
892005
892150
|
logForDiagnosticsNoPII("info", "started", {
|
|
892006
|
-
version: "4.2.
|
|
892151
|
+
version: "4.2.20",
|
|
892007
892152
|
is_native_binary: isInBundledMode()
|
|
892008
892153
|
});
|
|
892009
892154
|
registerCleanup(async () => {
|
|
@@ -892494,7 +892639,7 @@ Session: ${directConnectConfig.sessionId}`, "info");
|
|
|
892494
892639
|
sshSession = await createSSHSession2({
|
|
892495
892640
|
host: _pendingSSH.host,
|
|
892496
892641
|
cwd: _pendingSSH.cwd,
|
|
892497
|
-
localVersion: "4.2.
|
|
892642
|
+
localVersion: "4.2.20",
|
|
892498
892643
|
permissionMode: _pendingSSH.permissionMode,
|
|
892499
892644
|
dangerouslySkipPermissions: _pendingSSH.dangerouslySkipPermissions,
|
|
892500
892645
|
extraCliArgs: _pendingSSH.extraCliArgs,
|
|
@@ -892812,7 +892957,7 @@ Usage: csc --remote "your task description"`, () => gracefulShutdown(1));
|
|
|
892812
892957
|
await exitWithError2(root9, `Unable to resume from ccshare: ${errorMessage(error100)}`, () => gracefulShutdown(1));
|
|
892813
892958
|
}
|
|
892814
892959
|
} else {
|
|
892815
|
-
const resolvedPath =
|
|
892960
|
+
const resolvedPath = resolve63(options.resume);
|
|
892816
892961
|
try {
|
|
892817
892962
|
const resumeStart = performance.now();
|
|
892818
892963
|
let logOption;
|
|
@@ -892963,7 +893108,7 @@ Usage: csc --remote "your task description"`, () => gracefulShutdown(1));
|
|
|
892963
893108
|
pendingHookMessages
|
|
892964
893109
|
}, renderAndRun);
|
|
892965
893110
|
}
|
|
892966
|
-
}).version("4.2.
|
|
893111
|
+
}).version("4.2.20 (CoStrict)", "-v, --version", cliDesc("cli.option.version", "Output the version number"));
|
|
892967
893112
|
program2.addOption(new Option("-w, --worktree [name]", cliDesc("cli.option.worktree", "Create a new git worktree for this session (optionally specify a name)")).hideHelp());
|
|
892968
893113
|
program2.addOption(new Option("--tmux", cliDesc("cli.option.tmux", "Create a tmux session for the worktree (requires --worktree). Uses iTerm2 native panes when available; use --tmux=classic for traditional tmux.")).hideHelp());
|
|
892969
893114
|
if (canUserConfigureAdvisor()) {
|
|
@@ -893450,7 +893595,7 @@ async function logTenguInit({
|
|
|
893450
893595
|
...process.env.USER_TYPE === "sf" ? (() => {
|
|
893451
893596
|
const cwd5 = getCwd();
|
|
893452
893597
|
const gitRoot = findGitRoot(cwd5);
|
|
893453
|
-
const rp = gitRoot ?
|
|
893598
|
+
const rp = gitRoot ? relative40(gitRoot, cwd5) || "." : undefined;
|
|
893454
893599
|
return rp ? {
|
|
893455
893600
|
relativeProjectPath: rp
|
|
893456
893601
|
} : {};
|
|
@@ -893706,10 +893851,10 @@ if (process.env.CLAUDE_CODE_REMOTE === "true") {
|
|
|
893706
893851
|
async function main2() {
|
|
893707
893852
|
const args = process.argv.slice(2);
|
|
893708
893853
|
if (args.length === 1 && (args[0] === "--version" || args[0] === "-v" || args[0] === "-V")) {
|
|
893709
|
-
const d7 = new Date("2026-07-
|
|
893854
|
+
const d7 = new Date("2026-07-30T04:23:55.080Z");
|
|
893710
893855
|
const p2 = (n3) => String(n3).padStart(2, "0");
|
|
893711
893856
|
const buildTime = `${d7.getFullYear()}/${p2(d7.getMonth() + 1)}/${p2(d7.getDate())} ${p2(d7.getHours())}:${p2(d7.getMinutes())}:${p2(d7.getSeconds())}`;
|
|
893712
|
-
console.log(`${"4.2.
|
|
893857
|
+
console.log(`${"4.2.20"} (commit: ${"e5b91f14d"}, built: ${buildTime})`);
|
|
893713
893858
|
return;
|
|
893714
893859
|
}
|
|
893715
893860
|
let stopServeParentWatchdog;
|
|
@@ -893740,7 +893885,7 @@ async function main2() {
|
|
|
893740
893885
|
await terminateBatchWorker2();
|
|
893741
893886
|
});
|
|
893742
893887
|
const drainThenExit = () => {
|
|
893743
|
-
Promise.race([runCleanupFunctions2().catch(() => {}), new Promise((
|
|
893888
|
+
Promise.race([runCleanupFunctions2().catch(() => {}), new Promise((resolve64) => setTimeout(resolve64, 2000))]).then(() => terminateBatchWorker2()).finally(() => process.exit());
|
|
893744
893889
|
};
|
|
893745
893890
|
process.on("SIGTERM", () => {
|
|
893746
893891
|
if (isServeProcess2())
|
|
@@ -893885,5 +894030,5 @@ async function main2() {
|
|
|
893885
894030
|
}
|
|
893886
894031
|
main2();
|
|
893887
894032
|
|
|
893888
|
-
//# debugId=
|
|
894033
|
+
//# debugId=DBC9E78BF78381CC64756E2164756E21
|
|
893889
894034
|
|