@funnycode/myclaude 0.1.171 → 0.1.173
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/myclaude.js +230 -193
- package/dist/myclaude.mjs +230 -193
- package/package.json +1 -1
package/dist/myclaude.js
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
// MACRO - build-time constants (injected by build.ts)
|
|
5
5
|
// MACRO injected by build script
|
|
6
6
|
globalThis.MACRO = {
|
|
7
|
-
VERSION: "0.1.
|
|
8
|
-
BUILD_TIME: "2026-08-
|
|
7
|
+
VERSION: "0.1.173",
|
|
8
|
+
BUILD_TIME: "2026-08-01T11:52:35.626Z",
|
|
9
9
|
PACKAGE_URL: "@funnycode/myclaude",
|
|
10
10
|
NATIVE_PACKAGE_URL: "@funnycode/myclaude",
|
|
11
11
|
VERSION_CHANGELOG: '',
|
|
@@ -119947,7 +119947,7 @@ var package_default;
|
|
|
119947
119947
|
var init_package = __esm(() => {
|
|
119948
119948
|
package_default = {
|
|
119949
119949
|
name: "@funnycode/myclaude",
|
|
119950
|
-
version: "0.1.
|
|
119950
|
+
version: "0.1.173",
|
|
119951
119951
|
private: false,
|
|
119952
119952
|
description: "An open-source AI coding assistant in your terminal - powered by Claude",
|
|
119953
119953
|
license: "MIT",
|
|
@@ -410152,12 +410152,29 @@ function isInputModeCharacter(input) {
|
|
|
410152
410152
|
|
|
410153
410153
|
// src/projectOnboardingState.ts
|
|
410154
410154
|
import { join as join105 } from "path";
|
|
410155
|
-
function getDirectoryFingerprint(dirPath) {
|
|
410155
|
+
function getDirectoryFingerprint(dirPath, visitedRealPaths, rootRealPath) {
|
|
410156
410156
|
const fs13 = getFsImplementation();
|
|
410157
|
+
if (!visitedRealPaths) {
|
|
410158
|
+
visitedRealPaths = new Set;
|
|
410159
|
+
}
|
|
410160
|
+
let currentRealPath;
|
|
410161
|
+
try {
|
|
410162
|
+
currentRealPath = fs13.realpathSync(dirPath);
|
|
410163
|
+
} catch {
|
|
410164
|
+
currentRealPath = dirPath;
|
|
410165
|
+
}
|
|
410166
|
+
if (visitedRealPaths.has(currentRealPath)) {
|
|
410167
|
+
return "";
|
|
410168
|
+
}
|
|
410169
|
+
visitedRealPaths.add(currentRealPath);
|
|
410170
|
+
if (rootRealPath === undefined) {
|
|
410171
|
+
rootRealPath = currentRealPath;
|
|
410172
|
+
}
|
|
410157
410173
|
let entries;
|
|
410158
410174
|
try {
|
|
410159
410175
|
entries = fs13.readdirSync(dirPath).map((dirent) => dirent.name);
|
|
410160
410176
|
} catch {
|
|
410177
|
+
visitedRealPaths.delete(currentRealPath);
|
|
410161
410178
|
return "";
|
|
410162
410179
|
}
|
|
410163
410180
|
const sortedEntries = entries.sort();
|
|
@@ -410167,14 +410184,33 @@ function getDirectoryFingerprint(dirPath) {
|
|
|
410167
410184
|
try {
|
|
410168
410185
|
const lstat7 = fs13.lstatSync(fullPath);
|
|
410169
410186
|
if (lstat7.isSymbolicLink()) {
|
|
410170
|
-
|
|
410171
|
-
|
|
410172
|
-
|
|
410187
|
+
try {
|
|
410188
|
+
const stat37 = fs13.statSync(fullPath);
|
|
410189
|
+
if (stat37.isDirectory()) {
|
|
410190
|
+
let targetRealPath;
|
|
410191
|
+
try {
|
|
410192
|
+
targetRealPath = fs13.realpathSync(fullPath);
|
|
410193
|
+
} catch {
|
|
410194
|
+
targetRealPath = fullPath;
|
|
410195
|
+
}
|
|
410196
|
+
if (targetRealPath.startsWith(rootRealPath + "/") || targetRealPath === rootRealPath) {
|
|
410197
|
+
fingerprintParts.push(entry + "/");
|
|
410198
|
+
fingerprintParts.push(getDirectoryFingerprint(fullPath, visitedRealPaths, rootRealPath));
|
|
410199
|
+
} else {
|
|
410200
|
+
fingerprintParts.push(entry);
|
|
410201
|
+
}
|
|
410202
|
+
} else {
|
|
410203
|
+
fingerprintParts.push(entry);
|
|
410204
|
+
}
|
|
410205
|
+
} catch {
|
|
410206
|
+
continue;
|
|
410207
|
+
}
|
|
410208
|
+
} else if (lstat7.isDirectory()) {
|
|
410173
410209
|
if (entry === "node_modules" || entry === ".git" || entry === "dist" || entry === "build" || entry === ".next" || entry === "out" || entry === "coverage" || entry === "target" || entry === "vendor" || entry === "__pycache__" || entry === ".cache" || entry === ".mypy_cache" || entry === ".svn" || entry === ".hg") {
|
|
410174
410210
|
continue;
|
|
410175
410211
|
}
|
|
410176
410212
|
fingerprintParts.push(entry + "/");
|
|
410177
|
-
fingerprintParts.push(getDirectoryFingerprint(fullPath));
|
|
410213
|
+
fingerprintParts.push(getDirectoryFingerprint(fullPath, visitedRealPaths));
|
|
410178
410214
|
} else {
|
|
410179
410215
|
fingerprintParts.push(entry);
|
|
410180
410216
|
}
|
|
@@ -410182,6 +410218,7 @@ function getDirectoryFingerprint(dirPath) {
|
|
|
410182
410218
|
continue;
|
|
410183
410219
|
}
|
|
410184
410220
|
}
|
|
410221
|
+
visitedRealPaths.delete(currentRealPath);
|
|
410185
410222
|
return fingerprintParts.join(`
|
|
410186
410223
|
`);
|
|
410187
410224
|
}
|
|
@@ -412663,7 +412700,7 @@ var init_renderPlaceholder = __esm(() => {
|
|
|
412663
412700
|
});
|
|
412664
412701
|
|
|
412665
412702
|
// src/hooks/usePasteHandler.ts
|
|
412666
|
-
import { basename as
|
|
412703
|
+
import { basename as basename38 } from "path";
|
|
412667
412704
|
function usePasteHandler({
|
|
412668
412705
|
onPaste,
|
|
412669
412706
|
onInput,
|
|
@@ -412714,7 +412751,7 @@ function usePasteHandler({
|
|
|
412714
412751
|
const validImages = results.filter((r) => r !== null);
|
|
412715
412752
|
if (validImages.length > 0) {
|
|
412716
412753
|
for (const imageData of validImages) {
|
|
412717
|
-
const filename =
|
|
412754
|
+
const filename = basename38(imageData.path);
|
|
412718
412755
|
onImagePaste2(imageData.base64, imageData.mediaType, filename, imageData.dimensions, imageData.path);
|
|
412719
412756
|
}
|
|
412720
412757
|
const nonImageLines = lines2.filter((line) => !isImageFilePath(line));
|
|
@@ -413319,7 +413356,7 @@ var init_TextInput = __esm(() => {
|
|
|
413319
413356
|
});
|
|
413320
413357
|
|
|
413321
413358
|
// src/utils/suggestions/directoryCompletion.ts
|
|
413322
|
-
import { basename as
|
|
413359
|
+
import { basename as basename39, dirname as dirname53, join as join112, sep as sep31 } from "path";
|
|
413323
413360
|
function parsePartialPath(partialPath, basePath) {
|
|
413324
413361
|
if (!partialPath) {
|
|
413325
413362
|
const directory2 = basePath || getCwd();
|
|
@@ -413330,7 +413367,7 @@ function parsePartialPath(partialPath, basePath) {
|
|
|
413330
413367
|
return { directory: resolved, prefix: "" };
|
|
413331
413368
|
}
|
|
413332
413369
|
const directory = dirname53(resolved);
|
|
413333
|
-
const prefix =
|
|
413370
|
+
const prefix = basename39(partialPath);
|
|
413334
413371
|
return { directory, prefix };
|
|
413335
413372
|
}
|
|
413336
413373
|
async function scanDirectory(dirPath) {
|
|
@@ -415467,8 +415504,8 @@ class FileIndex {
|
|
|
415467
415504
|
}
|
|
415468
415505
|
loadFromFileListAsync(fileList) {
|
|
415469
415506
|
let markQueryable = () => {};
|
|
415470
|
-
const queryable = new Promise((
|
|
415471
|
-
markQueryable =
|
|
415507
|
+
const queryable = new Promise((resolve45) => {
|
|
415508
|
+
markQueryable = resolve45;
|
|
415472
415509
|
});
|
|
415473
415510
|
const done = this.buildAsync(fileList, markQueryable);
|
|
415474
415511
|
return { queryable, done };
|
|
@@ -415649,7 +415686,7 @@ function isUpper(code) {
|
|
|
415649
415686
|
return code >= 65 && code <= 90;
|
|
415650
415687
|
}
|
|
415651
415688
|
function yieldToEventLoop() {
|
|
415652
|
-
return new Promise((
|
|
415689
|
+
return new Promise((resolve45) => setImmediate(resolve45));
|
|
415653
415690
|
}
|
|
415654
415691
|
function computeTopLevelEntries(paths2, limit2) {
|
|
415655
415692
|
const topLevel = new Set;
|
|
@@ -425002,7 +425039,7 @@ function extractFirstFrame(output) {
|
|
|
425002
425039
|
return output.slice(contentStart, endIndex);
|
|
425003
425040
|
}
|
|
425004
425041
|
function renderToAnsiString(node, columns) {
|
|
425005
|
-
return new Promise(async (
|
|
425042
|
+
return new Promise(async (resolve45) => {
|
|
425006
425043
|
let output = "";
|
|
425007
425044
|
const stream4 = new PassThrough3;
|
|
425008
425045
|
if (columns !== undefined) {
|
|
@@ -425018,7 +425055,7 @@ function renderToAnsiString(node, columns) {
|
|
|
425018
425055
|
patchConsole: false
|
|
425019
425056
|
});
|
|
425020
425057
|
await instance.waitUntilExit();
|
|
425021
|
-
await
|
|
425058
|
+
await resolve45(extractFirstFrame(output));
|
|
425022
425059
|
});
|
|
425023
425060
|
}
|
|
425024
425061
|
async function renderToString(node, columns) {
|
|
@@ -425614,7 +425651,7 @@ var init_useTurnDiffs = __esm(() => {
|
|
|
425614
425651
|
});
|
|
425615
425652
|
|
|
425616
425653
|
// src/components/diff/DiffDetailView.tsx
|
|
425617
|
-
import { resolve as
|
|
425654
|
+
import { resolve as resolve45 } from "path";
|
|
425618
425655
|
function DiffDetailView(t0) {
|
|
425619
425656
|
const $3 = import_compiler_runtime146.c(53);
|
|
425620
425657
|
const {
|
|
@@ -425647,7 +425684,7 @@ function DiffDetailView(t0) {
|
|
|
425647
425684
|
let content;
|
|
425648
425685
|
let t22;
|
|
425649
425686
|
if ($3[1] !== filePath) {
|
|
425650
|
-
const fullPath =
|
|
425687
|
+
const fullPath = resolve45(getCwd(), filePath);
|
|
425651
425688
|
content = readFileSafe(fullPath);
|
|
425652
425689
|
t22 = content?.split(`
|
|
425653
425690
|
`)[0] ?? null;
|
|
@@ -429591,12 +429628,12 @@ import {
|
|
|
429591
429628
|
spawn as spawn10,
|
|
429592
429629
|
spawnSync as spawnSync4
|
|
429593
429630
|
} from "child_process";
|
|
429594
|
-
import { basename as
|
|
429631
|
+
import { basename as basename40 } from "path";
|
|
429595
429632
|
function isCommandAvailable3(command3) {
|
|
429596
429633
|
return !!whichSync(command3);
|
|
429597
429634
|
}
|
|
429598
429635
|
function classifyGuiEditor(editor) {
|
|
429599
|
-
const base2 =
|
|
429636
|
+
const base2 = basename40(editor.split(" ")[0] ?? "");
|
|
429600
429637
|
return GUI_EDITORS.find((g2) => base2.includes(g2));
|
|
429601
429638
|
}
|
|
429602
429639
|
function guiGotoArgv(guiFamily, filePath, line) {
|
|
@@ -429633,7 +429670,7 @@ function openFileInExternalEditor(filePath, line) {
|
|
|
429633
429670
|
const inkInstance = instances_default.get(process.stdout);
|
|
429634
429671
|
if (!inkInstance)
|
|
429635
429672
|
return false;
|
|
429636
|
-
const useGotoLine = line && PLUS_N_EDITORS.test(
|
|
429673
|
+
const useGotoLine = line && PLUS_N_EDITORS.test(basename40(base2));
|
|
429637
429674
|
inkInstance.enterAlternateScreen();
|
|
429638
429675
|
try {
|
|
429639
429676
|
const syncOpts = { stdio: "inherit" };
|
|
@@ -436658,7 +436695,7 @@ var init_channelPermissions = __esm(() => {
|
|
|
436658
436695
|
});
|
|
436659
436696
|
|
|
436660
436697
|
// src/services/mcp/useManageMCPConnections.ts
|
|
436661
|
-
import { basename as
|
|
436698
|
+
import { basename as basename41 } from "path";
|
|
436662
436699
|
function getErrorKey(error49) {
|
|
436663
436700
|
const plugin = "plugin" in error49 ? error49.plugin : "no-plugin";
|
|
436664
436701
|
return `${error49.type}:${error49.source}:${plugin}`;
|
|
@@ -436813,8 +436850,8 @@ function useManageMCPConnections(dynamicMcpConfig, isStrictMcpConfig = false) {
|
|
|
436813
436850
|
}
|
|
436814
436851
|
const backoffMs = Math.min(INITIAL_BACKOFF_MS * Math.pow(2, attempt - 1), MAX_BACKOFF_MS);
|
|
436815
436852
|
logMCPDebug(client.name, `Scheduling reconnection attempt ${attempt + 1} in ${backoffMs}ms`);
|
|
436816
|
-
await new Promise((
|
|
436817
|
-
const timer = setTimeout(
|
|
436853
|
+
await new Promise((resolve46) => {
|
|
436854
|
+
const timer = setTimeout(resolve46, backoffMs);
|
|
436818
436855
|
reconnectTimersRef.current.set(client.name, timer);
|
|
436819
436856
|
});
|
|
436820
436857
|
}
|
|
@@ -437035,7 +437072,7 @@ function useManageMCPConnections(dynamicMcpConfig, isStrictMcpConfig = false) {
|
|
|
437035
437072
|
else if (serverConfig.scope === "claudeai")
|
|
437036
437073
|
counts.claudeai++;
|
|
437037
437074
|
if (process.env.USER_TYPE === "ant" && !isMcpServerDisabled(name) && (serverConfig.type === undefined || serverConfig.type === "stdio") && "command" in serverConfig) {
|
|
437038
|
-
stdioCommands.push(
|
|
437075
|
+
stdioCommands.push(basename41(serverConfig.command));
|
|
437039
437076
|
}
|
|
437040
437077
|
}
|
|
437041
437078
|
logEvent("tengu_mcp_servers", {
|
|
@@ -439837,7 +439874,7 @@ var init_pluginStartupCheck = __esm(() => {
|
|
|
439837
439874
|
|
|
439838
439875
|
// src/utils/plugins/parseMarketplaceInput.ts
|
|
439839
439876
|
import { homedir as homedir30 } from "os";
|
|
439840
|
-
import { resolve as
|
|
439877
|
+
import { resolve as resolve46 } from "path";
|
|
439841
439878
|
async function parseMarketplaceInput(input) {
|
|
439842
439879
|
const trimmed = input.trim();
|
|
439843
439880
|
const fs13 = getFsImplementation();
|
|
@@ -439872,7 +439909,7 @@ async function parseMarketplaceInput(input) {
|
|
|
439872
439909
|
const isWindows2 = process.platform === "win32";
|
|
439873
439910
|
const isWindowsPath = isWindows2 && (trimmed.startsWith(".\\") || trimmed.startsWith("..\\") || /^[a-zA-Z]:[/\\]/.test(trimmed));
|
|
439874
439911
|
if (trimmed.startsWith("./") || trimmed.startsWith("../") || trimmed.startsWith("/") || trimmed.startsWith("~") || isWindowsPath) {
|
|
439875
|
-
const resolvedPath =
|
|
439912
|
+
const resolvedPath = resolve46(trimmed.startsWith("~") ? trimmed.replace(/^~/, homedir30()) : trimmed);
|
|
439876
439913
|
let stats;
|
|
439877
439914
|
try {
|
|
439878
439915
|
stats = await fs13.stat(resolvedPath);
|
|
@@ -454142,10 +454179,10 @@ var require_browser2 = __commonJS((exports) => {
|
|
|
454142
454179
|
text2 = canvas;
|
|
454143
454180
|
canvas = undefined;
|
|
454144
454181
|
}
|
|
454145
|
-
return new Promise(function(
|
|
454182
|
+
return new Promise(function(resolve48, reject2) {
|
|
454146
454183
|
try {
|
|
454147
454184
|
const data = QRCode.create(text2, opts);
|
|
454148
|
-
|
|
454185
|
+
resolve48(renderFunc(data, canvas, opts));
|
|
454149
454186
|
} catch (e) {
|
|
454150
454187
|
reject2(e);
|
|
454151
454188
|
}
|
|
@@ -454201,11 +454238,11 @@ function getStringRendererFromType(type) {
|
|
|
454201
454238
|
}
|
|
454202
454239
|
function render2(renderFunc, text2, params) {
|
|
454203
454240
|
if (!params.cb) {
|
|
454204
|
-
return new Promise(function(
|
|
454241
|
+
return new Promise(function(resolve48, reject2) {
|
|
454205
454242
|
try {
|
|
454206
454243
|
const data = QRCode.create(text2, params.opts);
|
|
454207
454244
|
return renderFunc(data, params.opts, function(err2, data2) {
|
|
454208
|
-
return err2 ? reject2(err2) :
|
|
454245
|
+
return err2 ? reject2(err2) : resolve48(data2);
|
|
454209
454246
|
});
|
|
454210
454247
|
} catch (e) {
|
|
454211
454248
|
reject2(e);
|
|
@@ -456599,8 +456636,8 @@ async function fetchReferralEligibility(campaign = "claude_code_guest_pass") {
|
|
|
456599
456636
|
const url3 = `${getOauthConfig().BASE_API_URL}/api/oauth/organizations/${orgUUID}/referral/eligibility`;
|
|
456600
456637
|
let resolvePromise;
|
|
456601
456638
|
let rejectPromise;
|
|
456602
|
-
const promise3 = new Promise((
|
|
456603
|
-
resolvePromise =
|
|
456639
|
+
const promise3 = new Promise((resolve48, reject2) => {
|
|
456640
|
+
resolvePromise = resolve48;
|
|
456604
456641
|
rejectPromise = reject2;
|
|
456605
456642
|
});
|
|
456606
456643
|
fetchInProgressMap.set(orgUUID, promise3);
|
|
@@ -490448,8 +490485,8 @@ async function withStatsCacheLock(fn) {
|
|
|
490448
490485
|
await statsCacheLockPromise;
|
|
490449
490486
|
}
|
|
490450
490487
|
let releaseLock2;
|
|
490451
|
-
statsCacheLockPromise = new Promise((
|
|
490452
|
-
releaseLock2 =
|
|
490488
|
+
statsCacheLockPromise = new Promise((resolve48) => {
|
|
490489
|
+
releaseLock2 = resolve48;
|
|
490453
490490
|
});
|
|
490454
490491
|
try {
|
|
490455
490492
|
return await fn();
|
|
@@ -491203,7 +491240,7 @@ var init_screenshotClipboard = __esm(() => {
|
|
|
491203
491240
|
|
|
491204
491241
|
// src/utils/stats.ts
|
|
491205
491242
|
import { open as open16 } from "fs/promises";
|
|
491206
|
-
import { basename as
|
|
491243
|
+
import { basename as basename44, join as join138, sep as sep36 } from "path";
|
|
491207
491244
|
async function processSessionFiles(sessionFiles, options = {}) {
|
|
491208
491245
|
const { fromDate, toDate } = options;
|
|
491209
491246
|
const fs14 = getFsImplementation();
|
|
@@ -491261,7 +491298,7 @@ async function processSessionFiles(sessionFiles, options = {}) {
|
|
|
491261
491298
|
logForDebugging(`Failed to read session file ${sessionFile}: ${errorMessage(error49)}`);
|
|
491262
491299
|
continue;
|
|
491263
491300
|
}
|
|
491264
|
-
const sessionId =
|
|
491301
|
+
const sessionId = basename44(sessionFile, ".jsonl");
|
|
491265
491302
|
const messages = [];
|
|
491266
491303
|
for (const entry of entries) {
|
|
491267
491304
|
if (isTranscriptMessage(entry)) {
|
|
@@ -495609,7 +495646,7 @@ async function scanAllSessions() {
|
|
|
495609
495646
|
});
|
|
495610
495647
|
}
|
|
495611
495648
|
if (i3 % 10 === 9) {
|
|
495612
|
-
await new Promise((
|
|
495649
|
+
await new Promise((resolve48) => setImmediate(resolve48));
|
|
495613
495650
|
}
|
|
495614
495651
|
}
|
|
495615
495652
|
allSessions.sort((a2, b3) => b3.mtime - a2.mtime);
|
|
@@ -496847,7 +496884,7 @@ import {
|
|
|
496847
496884
|
unlink as unlink19,
|
|
496848
496885
|
writeFile as writeFile41
|
|
496849
496886
|
} from "fs/promises";
|
|
496850
|
-
import { basename as
|
|
496887
|
+
import { basename as basename45, dirname as dirname61, join as join140 } from "path";
|
|
496851
496888
|
function isTranscriptMessage(entry) {
|
|
496852
496889
|
return entry.type === "user" || entry.type === "assistant" || entry.type === "attachment" || entry.type === "system";
|
|
496853
496890
|
}
|
|
@@ -497061,8 +497098,8 @@ class Project {
|
|
|
497061
497098
|
decrementPendingWrites() {
|
|
497062
497099
|
this.pendingWriteCount--;
|
|
497063
497100
|
if (this.pendingWriteCount === 0) {
|
|
497064
|
-
for (const
|
|
497065
|
-
|
|
497101
|
+
for (const resolve48 of this.flushResolvers) {
|
|
497102
|
+
resolve48();
|
|
497066
497103
|
}
|
|
497067
497104
|
this.flushResolvers = [];
|
|
497068
497105
|
}
|
|
@@ -497076,13 +497113,13 @@ class Project {
|
|
|
497076
497113
|
}
|
|
497077
497114
|
}
|
|
497078
497115
|
enqueueWrite(filePath, entry) {
|
|
497079
|
-
return new Promise((
|
|
497116
|
+
return new Promise((resolve48) => {
|
|
497080
497117
|
let queue2 = this.writeQueues.get(filePath);
|
|
497081
497118
|
if (!queue2) {
|
|
497082
497119
|
queue2 = [];
|
|
497083
497120
|
this.writeQueues.set(filePath, queue2);
|
|
497084
497121
|
}
|
|
497085
|
-
queue2.push({ entry, resolve:
|
|
497122
|
+
queue2.push({ entry, resolve: resolve48 });
|
|
497086
497123
|
this.scheduleDrain();
|
|
497087
497124
|
});
|
|
497088
497125
|
}
|
|
@@ -497116,7 +497153,7 @@ class Project {
|
|
|
497116
497153
|
const batch = queue2.splice(0);
|
|
497117
497154
|
let content = "";
|
|
497118
497155
|
const resolvers3 = [];
|
|
497119
|
-
for (const { entry, resolve:
|
|
497156
|
+
for (const { entry, resolve: resolve48 } of batch) {
|
|
497120
497157
|
const line = jsonStringify(entry) + `
|
|
497121
497158
|
`;
|
|
497122
497159
|
if (content.length + line.length >= this.MAX_CHUNK_BYTES) {
|
|
@@ -497128,7 +497165,7 @@ class Project {
|
|
|
497128
497165
|
content = "";
|
|
497129
497166
|
}
|
|
497130
497167
|
content += line;
|
|
497131
|
-
resolvers3.push(
|
|
497168
|
+
resolvers3.push(resolve48);
|
|
497132
497169
|
}
|
|
497133
497170
|
if (content.length > 0) {
|
|
497134
497171
|
await this.appendToFile(filePath, content);
|
|
@@ -497251,8 +497288,8 @@ class Project {
|
|
|
497251
497288
|
if (this.pendingWriteCount === 0) {
|
|
497252
497289
|
return;
|
|
497253
497290
|
}
|
|
497254
|
-
return new Promise((
|
|
497255
|
-
this.flushResolvers.push(
|
|
497291
|
+
return new Promise((resolve48) => {
|
|
497292
|
+
this.flushResolvers.push(resolve48);
|
|
497256
497293
|
});
|
|
497257
497294
|
}
|
|
497258
497295
|
async removeMessageByUuid(targetUuid) {
|
|
@@ -497902,7 +497939,7 @@ function applySnipRemovals(messages) {
|
|
|
497902
497939
|
messages.delete(uuid5);
|
|
497903
497940
|
removedCount++;
|
|
497904
497941
|
}
|
|
497905
|
-
const
|
|
497942
|
+
const resolve48 = (start) => {
|
|
497906
497943
|
const path25 = [];
|
|
497907
497944
|
let cur = start;
|
|
497908
497945
|
while (cur && toDelete.has(cur)) {
|
|
@@ -497921,7 +497958,7 @@ function applySnipRemovals(messages) {
|
|
|
497921
497958
|
for (const [uuid5, msg] of messages) {
|
|
497922
497959
|
if (!msg.parentUuid || !toDelete.has(msg.parentUuid))
|
|
497923
497960
|
continue;
|
|
497924
|
-
messages.set(uuid5, { ...msg, parentUuid:
|
|
497961
|
+
messages.set(uuid5, { ...msg, parentUuid: resolve48(msg.parentUuid) });
|
|
497925
497962
|
relinkedCount++;
|
|
497926
497963
|
}
|
|
497927
497964
|
logEvent("tengu_snip_resume_filtered", {
|
|
@@ -499281,7 +499318,7 @@ async function getSessionFilesWithMtime(projectDir) {
|
|
|
499281
499318
|
for (const dirent of dirents) {
|
|
499282
499319
|
if (!dirent.isFile() || !dirent.name.endsWith(".jsonl"))
|
|
499283
499320
|
continue;
|
|
499284
|
-
const sessionId = validateUuid2(
|
|
499321
|
+
const sessionId = validateUuid2(basename45(dirent.name, ".jsonl"));
|
|
499285
499322
|
if (!sessionId)
|
|
499286
499323
|
continue;
|
|
499287
499324
|
candidates.push({ sessionId, filePath: join140(projectDir, dirent.name) });
|
|
@@ -500933,8 +500970,8 @@ class DiskTaskOutput {
|
|
|
500933
500970
|
this.#queue.push(content);
|
|
500934
500971
|
}
|
|
500935
500972
|
if (!this.#flushPromise) {
|
|
500936
|
-
this.#flushPromise = new Promise((
|
|
500937
|
-
this.#flushResolve =
|
|
500973
|
+
this.#flushPromise = new Promise((resolve48) => {
|
|
500974
|
+
this.#flushResolve = resolve48;
|
|
500938
500975
|
});
|
|
500939
500976
|
track(this.#drain());
|
|
500940
500977
|
}
|
|
@@ -501000,10 +501037,10 @@ class DiskTaskOutput {
|
|
|
501000
501037
|
}
|
|
501001
501038
|
}
|
|
501002
501039
|
} finally {
|
|
501003
|
-
const
|
|
501040
|
+
const resolve48 = this.#flushResolve;
|
|
501004
501041
|
this.#flushPromise = null;
|
|
501005
501042
|
this.#flushResolve = null;
|
|
501006
|
-
|
|
501043
|
+
resolve48();
|
|
501007
501044
|
}
|
|
501008
501045
|
}
|
|
501009
501046
|
}
|
|
@@ -501291,11 +501328,11 @@ class ShellCommandImpl {
|
|
|
501291
501328
|
this.#childProcess.once("exit", this.#exitHandler.bind(this));
|
|
501292
501329
|
this.#childProcess.once("error", this.#errorHandler.bind(this));
|
|
501293
501330
|
this.#timeoutId = setTimeout(ShellCommandImpl.#handleTimeout, this.#timeout, this);
|
|
501294
|
-
const exitPromise = new Promise((
|
|
501295
|
-
this.#exitCodeResolver =
|
|
501331
|
+
const exitPromise = new Promise((resolve48) => {
|
|
501332
|
+
this.#exitCodeResolver = resolve48;
|
|
501296
501333
|
});
|
|
501297
|
-
return new Promise((
|
|
501298
|
-
this.#resultResolver =
|
|
501334
|
+
return new Promise((resolve48) => {
|
|
501335
|
+
this.#resultResolver = resolve48;
|
|
501299
501336
|
exitPromise.then(this.#handleExit.bind(this));
|
|
501300
501337
|
});
|
|
501301
501338
|
}
|
|
@@ -502320,7 +502357,7 @@ __export(exports_hooks2, {
|
|
|
502320
502357
|
executeConfigChangeHooks: () => executeConfigChangeHooks,
|
|
502321
502358
|
createBaseHookInput: () => createBaseHookInput
|
|
502322
502359
|
});
|
|
502323
|
-
import { basename as
|
|
502360
|
+
import { basename as basename46 } from "path";
|
|
502324
502361
|
import { spawn as spawn11 } from "child_process";
|
|
502325
502362
|
import { randomUUID as randomUUID30 } from "crypto";
|
|
502326
502363
|
function getSessionEndHookTimeoutMs() {
|
|
@@ -502341,7 +502378,7 @@ function executeInBackground({
|
|
|
502341
502378
|
}) {
|
|
502342
502379
|
if (asyncRewake) {
|
|
502343
502380
|
shellCommand.result.then(async (result) => {
|
|
502344
|
-
await new Promise((
|
|
502381
|
+
await new Promise((resolve48) => setImmediate(resolve48));
|
|
502345
502382
|
const stdout = await shellCommand.taskOutput.getStdout();
|
|
502346
502383
|
const stderr = shellCommand.taskOutput.getStderr();
|
|
502347
502384
|
shellCommand.cleanup();
|
|
@@ -502787,8 +502824,8 @@ async function execCommandHook(hook, hookEvent, hookName, jsonInput, signal, hoo
|
|
|
502787
502824
|
child.stderr.setEncoding("utf8");
|
|
502788
502825
|
let initialResponseChecked = false;
|
|
502789
502826
|
let asyncResolve = null;
|
|
502790
|
-
const childIsAsyncPromise = new Promise((
|
|
502791
|
-
asyncResolve =
|
|
502827
|
+
const childIsAsyncPromise = new Promise((resolve48) => {
|
|
502828
|
+
asyncResolve = resolve48;
|
|
502792
502829
|
});
|
|
502793
502830
|
const processedPromptLines = new Set;
|
|
502794
502831
|
let promptChain = Promise.resolve();
|
|
@@ -502879,13 +502916,13 @@ async function execCommandHook(hook, hookEvent, hookName, jsonInput, signal, hoo
|
|
|
502879
502916
|
hookEvent,
|
|
502880
502917
|
getOutput: async () => ({ stdout, stderr, output })
|
|
502881
502918
|
});
|
|
502882
|
-
const stdoutEndPromise = new Promise((
|
|
502883
|
-
child.stdout.on("end", () =>
|
|
502919
|
+
const stdoutEndPromise = new Promise((resolve48) => {
|
|
502920
|
+
child.stdout.on("end", () => resolve48());
|
|
502884
502921
|
});
|
|
502885
|
-
const stderrEndPromise = new Promise((
|
|
502886
|
-
child.stderr.on("end", () =>
|
|
502922
|
+
const stderrEndPromise = new Promise((resolve48) => {
|
|
502923
|
+
child.stderr.on("end", () => resolve48());
|
|
502887
502924
|
});
|
|
502888
|
-
const stdinWritePromise = stdinWritten ? Promise.resolve() : new Promise((
|
|
502925
|
+
const stdinWritePromise = stdinWritten ? Promise.resolve() : new Promise((resolve48, reject2) => {
|
|
502889
502926
|
child.stdin.on("error", (err2) => {
|
|
502890
502927
|
if (!requestPrompt) {
|
|
502891
502928
|
reject2(err2);
|
|
@@ -502898,12 +502935,12 @@ async function execCommandHook(hook, hookEvent, hookName, jsonInput, signal, hoo
|
|
|
502898
502935
|
if (!requestPrompt) {
|
|
502899
502936
|
child.stdin.end();
|
|
502900
502937
|
}
|
|
502901
|
-
|
|
502938
|
+
resolve48();
|
|
502902
502939
|
});
|
|
502903
502940
|
const childErrorPromise = new Promise((_2, reject2) => {
|
|
502904
502941
|
child.on("error", reject2);
|
|
502905
502942
|
});
|
|
502906
|
-
const childClosePromise = new Promise((
|
|
502943
|
+
const childClosePromise = new Promise((resolve48) => {
|
|
502907
502944
|
let exitCode = null;
|
|
502908
502945
|
child.on("close", (code) => {
|
|
502909
502946
|
exitCode = code ?? 1;
|
|
@@ -502911,7 +502948,7 @@ async function execCommandHook(hook, hookEvent, hookName, jsonInput, signal, hoo
|
|
|
502911
502948
|
const finalStdout = processedPromptLines.size === 0 ? stdout : stdout.split(`
|
|
502912
502949
|
`).filter((line) => !processedPromptLines.has(line.trim())).join(`
|
|
502913
502950
|
`);
|
|
502914
|
-
|
|
502951
|
+
resolve48({
|
|
502915
502952
|
stdout: finalStdout,
|
|
502916
502953
|
stderr,
|
|
502917
502954
|
output,
|
|
@@ -503151,7 +503188,7 @@ async function getMatchingHooks(appState, sessionId, hookEvent, hookInput, tools
|
|
|
503151
503188
|
matchQuery = hookInput.load_reason;
|
|
503152
503189
|
break;
|
|
503153
503190
|
case "FileChanged":
|
|
503154
|
-
matchQuery =
|
|
503191
|
+
matchQuery = basename46(hookInput.file_path);
|
|
503155
503192
|
break;
|
|
503156
503193
|
default:
|
|
503157
503194
|
break;
|
|
@@ -504942,12 +504979,12 @@ async function executeFunctionHook({
|
|
|
504942
504979
|
hook
|
|
504943
504980
|
};
|
|
504944
504981
|
}
|
|
504945
|
-
const passed = await new Promise((
|
|
504982
|
+
const passed = await new Promise((resolve48, reject2) => {
|
|
504946
504983
|
const onAbort = () => reject2(new Error("Function hook cancelled"));
|
|
504947
504984
|
abortSignal.addEventListener("abort", onAbort);
|
|
504948
504985
|
Promise.resolve(hook.callback(messages, abortSignal)).then((result) => {
|
|
504949
504986
|
abortSignal.removeEventListener("abort", onAbort);
|
|
504950
|
-
|
|
504987
|
+
resolve48(result);
|
|
504951
504988
|
}).catch((error49) => {
|
|
504952
504989
|
abortSignal.removeEventListener("abort", onAbort);
|
|
504953
504990
|
reject2(error49);
|
|
@@ -505182,7 +505219,7 @@ import {
|
|
|
505182
505219
|
symlink as symlink5,
|
|
505183
505220
|
utimes as utimes2
|
|
505184
505221
|
} from "fs/promises";
|
|
505185
|
-
import { basename as
|
|
505222
|
+
import { basename as basename47, dirname as dirname62, join as join144 } from "path";
|
|
505186
505223
|
function validateWorktreeSlug(slug) {
|
|
505187
505224
|
if (slug.length > MAX_WORKTREE_SLUG_LENGTH) {
|
|
505188
505225
|
throw new Error(`Invalid worktree name: must be ${MAX_WORKTREE_SLUG_LENGTH} characters or fewer (got ${slug.length})`);
|
|
@@ -505225,7 +505262,7 @@ function restoreWorktreeSession(session2) {
|
|
|
505225
505262
|
currentWorktreeSession = session2;
|
|
505226
505263
|
}
|
|
505227
505264
|
function generateTmuxSessionName(repoPath, branch2) {
|
|
505228
|
-
const repoName =
|
|
505265
|
+
const repoName = basename47(repoPath);
|
|
505229
505266
|
const combined = `${repoName}_${branch2}`;
|
|
505230
505267
|
return combined.replace(/[/.]/g, "_");
|
|
505231
505268
|
}
|
|
@@ -505801,7 +505838,7 @@ async function execIntoTmuxWorktree(args) {
|
|
|
505801
505838
|
error: `Error: ${errorMessage(error49)}`
|
|
505802
505839
|
};
|
|
505803
505840
|
}
|
|
505804
|
-
repoName =
|
|
505841
|
+
repoName = basename47(findCanonicalGitRoot(getCwd()) ?? getCwd());
|
|
505805
505842
|
console.log(`Using worktree via hook: ${worktreeDir}`);
|
|
505806
505843
|
} else {
|
|
505807
505844
|
const repoRoot = findCanonicalGitRoot(getCwd());
|
|
@@ -505811,7 +505848,7 @@ async function execIntoTmuxWorktree(args) {
|
|
|
505811
505848
|
error: "Error: --worktree requires a git repository"
|
|
505812
505849
|
};
|
|
505813
505850
|
}
|
|
505814
|
-
repoName =
|
|
505851
|
+
repoName = basename47(repoRoot);
|
|
505815
505852
|
worktreeDir = worktreePathFor(repoRoot, worktreeName);
|
|
505816
505853
|
try {
|
|
505817
505854
|
const result = await getOrCreateWorktree(repoRoot, worktreeName, prNumber !== null ? { prNumber } : undefined);
|
|
@@ -509115,11 +509152,11 @@ class ChromeNativeHost {
|
|
|
509115
509152
|
}
|
|
509116
509153
|
log2(`Creating socket listener: ${this.socketPath}`);
|
|
509117
509154
|
this.server = createServer7((socket) => this.handleMcpClient(socket));
|
|
509118
|
-
await new Promise((
|
|
509155
|
+
await new Promise((resolve48, reject2) => {
|
|
509119
509156
|
this.server.listen(this.socketPath, () => {
|
|
509120
509157
|
log2("Socket server listening for connections");
|
|
509121
509158
|
this.running = true;
|
|
509122
|
-
|
|
509159
|
+
resolve48();
|
|
509123
509160
|
});
|
|
509124
509161
|
this.server.on("error", (err2) => {
|
|
509125
509162
|
log2("Socket server error:", err2);
|
|
@@ -509144,8 +509181,8 @@ class ChromeNativeHost {
|
|
|
509144
509181
|
}
|
|
509145
509182
|
this.mcpClients.clear();
|
|
509146
509183
|
if (this.server) {
|
|
509147
|
-
await new Promise((
|
|
509148
|
-
this.server.close(() =>
|
|
509184
|
+
await new Promise((resolve48) => {
|
|
509185
|
+
this.server.close(() => resolve48());
|
|
509149
509186
|
});
|
|
509150
509187
|
this.server = null;
|
|
509151
509188
|
}
|
|
@@ -509366,8 +509403,8 @@ class ChromeMessageReader {
|
|
|
509366
509403
|
return messageBytes.toString("utf-8");
|
|
509367
509404
|
}
|
|
509368
509405
|
}
|
|
509369
|
-
return new Promise((
|
|
509370
|
-
this.pendingResolve =
|
|
509406
|
+
return new Promise((resolve48) => {
|
|
509407
|
+
this.pendingResolve = resolve48;
|
|
509371
509408
|
this.tryProcessMessage();
|
|
509372
509409
|
});
|
|
509373
509410
|
}
|
|
@@ -511956,7 +511993,7 @@ async function startNodeRelay(wsUrl, authHeader, wsAuthHeader) {
|
|
|
511956
511993
|
cleanupConn(states.get(sock));
|
|
511957
511994
|
});
|
|
511958
511995
|
});
|
|
511959
|
-
return new Promise((
|
|
511996
|
+
return new Promise((resolve48, reject2) => {
|
|
511960
511997
|
server.once("error", reject2);
|
|
511961
511998
|
server.listen(0, "127.0.0.1", () => {
|
|
511962
511999
|
const addr = server.address();
|
|
@@ -511964,7 +512001,7 @@ async function startNodeRelay(wsUrl, authHeader, wsAuthHeader) {
|
|
|
511964
512001
|
reject2(new Error("upstreamproxy: server has no TCP address"));
|
|
511965
512002
|
return;
|
|
511966
512003
|
}
|
|
511967
|
-
|
|
512004
|
+
resolve48({
|
|
511968
512005
|
port: addr.port,
|
|
511969
512006
|
stop: () => server.close()
|
|
511970
512007
|
});
|
|
@@ -512469,7 +512506,7 @@ async function showInvalidConfigDialog({
|
|
|
512469
512506
|
...getBaseRenderOptions(false),
|
|
512470
512507
|
theme: SAFE_ERROR_THEME_NAME
|
|
512471
512508
|
};
|
|
512472
|
-
await new Promise(async (
|
|
512509
|
+
await new Promise(async (resolve48) => {
|
|
512473
512510
|
const {
|
|
512474
512511
|
unmount
|
|
512475
512512
|
} = await render(/* @__PURE__ */ jsx_dev_runtime356.jsxDEV(AppStateProvider, {
|
|
@@ -512479,7 +512516,7 @@ async function showInvalidConfigDialog({
|
|
|
512479
512516
|
errorDescription: error49.message,
|
|
512480
512517
|
onExit: () => {
|
|
512481
512518
|
unmount();
|
|
512482
|
-
|
|
512519
|
+
resolve48();
|
|
512483
512520
|
process.exit(1);
|
|
512484
512521
|
},
|
|
512485
512522
|
onReset: () => {
|
|
@@ -512488,7 +512525,7 @@ async function showInvalidConfigDialog({
|
|
|
512488
512525
|
encoding: "utf8"
|
|
512489
512526
|
});
|
|
512490
512527
|
unmount();
|
|
512491
|
-
|
|
512528
|
+
resolve48();
|
|
512492
512529
|
process.exit(0);
|
|
512493
512530
|
}
|
|
512494
512531
|
}, undefined, false, undefined, this)
|
|
@@ -519992,7 +520029,7 @@ var init_FileEditToolDiff = __esm(() => {
|
|
|
519992
520029
|
|
|
519993
520030
|
// src/hooks/useDiffInIDE.ts
|
|
519994
520031
|
import { randomUUID as randomUUID34 } from "crypto";
|
|
519995
|
-
import { basename as
|
|
520032
|
+
import { basename as basename49 } from "path";
|
|
519996
520033
|
function useDiffInIDE({
|
|
519997
520034
|
onChange,
|
|
519998
520035
|
toolUseContext,
|
|
@@ -520003,7 +520040,7 @@ function useDiffInIDE({
|
|
|
520003
520040
|
const isUnmounted = import_react211.useRef(false);
|
|
520004
520041
|
const [hasError, setHasError] = import_react211.useState(false);
|
|
520005
520042
|
const sha = import_react211.useMemo(() => randomUUID34().slice(0, 6), []);
|
|
520006
|
-
const tabName = import_react211.useMemo(() => `✻ [Claude Code] ${
|
|
520043
|
+
const tabName = import_react211.useMemo(() => `✻ [Claude Code] ${basename49(filePath)} (${sha}) ⧉`, [filePath, sha]);
|
|
520007
520044
|
const shouldShowDiffInIDE = hasAccessToIDEExtensionDiffFeature(toolUseContext.options.mcpClients) && getGlobalConfig().diffTool === "auto" && !filePath.endsWith(".ipynb");
|
|
520008
520045
|
const ideName = getConnectedIdeName(toolUseContext.options.mcpClients) ?? "IDE";
|
|
520009
520046
|
async function showDiff() {
|
|
@@ -520185,7 +520222,7 @@ var init_useDiffInIDE = __esm(() => {
|
|
|
520185
520222
|
});
|
|
520186
520223
|
|
|
520187
520224
|
// src/components/ShowInIDEPrompt.tsx
|
|
520188
|
-
import { basename as
|
|
520225
|
+
import { basename as basename50, relative as relative30 } from "path";
|
|
520189
520226
|
function ShowInIDEPrompt(t0) {
|
|
520190
520227
|
const $3 = import_compiler_runtime295.c(36);
|
|
520191
520228
|
const {
|
|
@@ -520242,7 +520279,7 @@ function ShowInIDEPrompt(t0) {
|
|
|
520242
520279
|
}
|
|
520243
520280
|
let t4;
|
|
520244
520281
|
if ($3[5] !== filePath) {
|
|
520245
|
-
t4 =
|
|
520282
|
+
t4 = basename50(filePath);
|
|
520246
520283
|
$3[5] = filePath;
|
|
520247
520284
|
$3[6] = t4;
|
|
520248
520285
|
} else {
|
|
@@ -520403,7 +520440,7 @@ var init_ShowInIDEPrompt = __esm(() => {
|
|
|
520403
520440
|
|
|
520404
520441
|
// src/components/permissions/FilePermissionDialog/permissionOptions.tsx
|
|
520405
520442
|
import { homedir as homedir36 } from "os";
|
|
520406
|
-
import { basename as
|
|
520443
|
+
import { basename as basename51, join as join147, sep as sep39 } from "path";
|
|
520407
520444
|
function isInClaudeFolder(filePath) {
|
|
520408
520445
|
const absolutePath = expandPath(filePath);
|
|
520409
520446
|
const claudeFolderPath = expandPath(`${getOriginalCwd()}/.claude`);
|
|
@@ -520485,7 +520522,7 @@ function getFilePermissionOptions({
|
|
|
520485
520522
|
}
|
|
520486
520523
|
} else {
|
|
520487
520524
|
const dirPath = getDirectoryForPath(filePath);
|
|
520488
|
-
const dirName =
|
|
520525
|
+
const dirName = basename51(dirPath) || "this directory";
|
|
520489
520526
|
if (operationType === "read") {
|
|
520490
520527
|
sessionLabel = /* @__PURE__ */ jsx_dev_runtime379.jsxDEV(ThemedText, {
|
|
520491
520528
|
children: [
|
|
@@ -520984,7 +521021,7 @@ var init_FilePermissionDialog = __esm(() => {
|
|
|
520984
521021
|
});
|
|
520985
521022
|
|
|
520986
521023
|
// src/components/permissions/SedEditPermissionRequest/SedEditPermissionRequest.tsx
|
|
520987
|
-
import { basename as
|
|
521024
|
+
import { basename as basename52, relative as relative32 } from "path";
|
|
520988
521025
|
function SedEditPermissionRequest(t0) {
|
|
520989
521026
|
const $3 = import_compiler_runtime296.c(9);
|
|
520990
521027
|
let props;
|
|
@@ -521160,7 +521197,7 @@ function SedEditPermissionRequestInner(t0) {
|
|
|
521160
521197
|
}
|
|
521161
521198
|
let t10;
|
|
521162
521199
|
if ($3[16] !== filePath) {
|
|
521163
|
-
t10 =
|
|
521200
|
+
t10 = basename52(filePath);
|
|
521164
521201
|
$3[16] = filePath;
|
|
521165
521202
|
$3[17] = t10;
|
|
521166
521203
|
} else {
|
|
@@ -521372,7 +521409,7 @@ var init_useShellPermissionFeedback = __esm(() => {
|
|
|
521372
521409
|
});
|
|
521373
521410
|
|
|
521374
521411
|
// src/components/permissions/shellPermissionHelpers.tsx
|
|
521375
|
-
import { basename as
|
|
521412
|
+
import { basename as basename53, sep as sep40 } from "path";
|
|
521376
521413
|
function commandListDisplay(commands) {
|
|
521377
521414
|
switch (commands.length) {
|
|
521378
521415
|
case 0:
|
|
@@ -521423,7 +521460,7 @@ function commandListDisplayTruncated(commands) {
|
|
|
521423
521460
|
function formatPathList(paths2) {
|
|
521424
521461
|
if (paths2.length === 0)
|
|
521425
521462
|
return "";
|
|
521426
|
-
const names = paths2.map((p) =>
|
|
521463
|
+
const names = paths2.map((p) => basename53(p) || p);
|
|
521427
521464
|
if (names.length === 1) {
|
|
521428
521465
|
return /* @__PURE__ */ jsx_dev_runtime382.jsxDEV(ThemedText, {
|
|
521429
521466
|
children: [
|
|
@@ -521489,7 +521526,7 @@ function generateShellSuggestionsLabel(suggestions, shellToolName, commandTransf
|
|
|
521489
521526
|
if (hasReadPaths && !hasDirectories && !hasCommands) {
|
|
521490
521527
|
if (readPaths.length === 1) {
|
|
521491
521528
|
const firstPath = readPaths[0];
|
|
521492
|
-
const dirName =
|
|
521529
|
+
const dirName = basename53(firstPath) || firstPath;
|
|
521493
521530
|
return /* @__PURE__ */ jsx_dev_runtime382.jsxDEV(ThemedText, {
|
|
521494
521531
|
children: [
|
|
521495
521532
|
"Yes, allow reading from ",
|
|
@@ -521513,7 +521550,7 @@ function generateShellSuggestionsLabel(suggestions, shellToolName, commandTransf
|
|
|
521513
521550
|
if (hasDirectories && !hasReadPaths && !hasCommands) {
|
|
521514
521551
|
if (directories.length === 1) {
|
|
521515
521552
|
const firstDir = directories[0];
|
|
521516
|
-
const dirName =
|
|
521553
|
+
const dirName = basename53(firstDir) || firstDir;
|
|
521517
521554
|
return /* @__PURE__ */ jsx_dev_runtime382.jsxDEV(ThemedText, {
|
|
521518
521555
|
children: [
|
|
521519
521556
|
"Yes, and always allow access to ",
|
|
@@ -523753,7 +523790,7 @@ function createSingleEditDiffConfig(filePath, oldString, newString, replaceAll)
|
|
|
523753
523790
|
}
|
|
523754
523791
|
|
|
523755
523792
|
// src/components/permissions/FileEditPermissionRequest/FileEditPermissionRequest.tsx
|
|
523756
|
-
import { basename as
|
|
523793
|
+
import { basename as basename54, relative as relative33 } from "path";
|
|
523757
523794
|
function FileEditPermissionRequest(props) {
|
|
523758
523795
|
const $3 = import_compiler_runtime301.c(51);
|
|
523759
523796
|
const parseInput = _temp178;
|
|
@@ -523796,7 +523833,7 @@ function FileEditPermissionRequest(props) {
|
|
|
523796
523833
|
t3 = " ";
|
|
523797
523834
|
T0 = ThemedText;
|
|
523798
523835
|
t0 = true;
|
|
523799
|
-
t1 =
|
|
523836
|
+
t1 = basename54(file_path);
|
|
523800
523837
|
$3[0] = props.onDone;
|
|
523801
523838
|
$3[1] = props.onReject;
|
|
523802
523839
|
$3[2] = props.toolUseConfirm;
|
|
@@ -524223,7 +524260,7 @@ var init_FileWriteToolDiff = __esm(() => {
|
|
|
524223
524260
|
});
|
|
524224
524261
|
|
|
524225
524262
|
// src/components/permissions/FileWritePermissionRequest/FileWritePermissionRequest.tsx
|
|
524226
|
-
import { basename as
|
|
524263
|
+
import { basename as basename55, relative as relative34 } from "path";
|
|
524227
524264
|
function FileWritePermissionRequest(props) {
|
|
524228
524265
|
const $3 = import_compiler_runtime304.c(30);
|
|
524229
524266
|
const parseInput = _temp181;
|
|
@@ -524290,7 +524327,7 @@ function FileWritePermissionRequest(props) {
|
|
|
524290
524327
|
}
|
|
524291
524328
|
let t9;
|
|
524292
524329
|
if ($3[7] !== file_path) {
|
|
524293
|
-
t9 =
|
|
524330
|
+
t9 = basename55(file_path);
|
|
524294
524331
|
$3[7] = file_path;
|
|
524295
524332
|
$3[8] = t9;
|
|
524296
524333
|
} else {
|
|
@@ -524695,7 +524732,7 @@ var init_NotebookEditToolDiff = __esm(() => {
|
|
|
524695
524732
|
});
|
|
524696
524733
|
|
|
524697
524734
|
// src/components/permissions/NotebookEditPermissionRequest/NotebookEditPermissionRequest.tsx
|
|
524698
|
-
import { basename as
|
|
524735
|
+
import { basename as basename56 } from "path";
|
|
524699
524736
|
function NotebookEditPermissionRequest(props) {
|
|
524700
524737
|
const $3 = import_compiler_runtime306.c(52);
|
|
524701
524738
|
const parseInput = _temp185;
|
|
@@ -524739,7 +524776,7 @@ function NotebookEditPermissionRequest(props) {
|
|
|
524739
524776
|
t4 = " ";
|
|
524740
524777
|
T0 = ThemedText;
|
|
524741
524778
|
t0 = true;
|
|
524742
|
-
t1 =
|
|
524779
|
+
t1 = basename56(notebook_path);
|
|
524743
524780
|
$3[0] = props.onDone;
|
|
524744
524781
|
$3[1] = props.onReject;
|
|
524745
524782
|
$3[2] = props.toolUseConfirm;
|
|
@@ -529217,7 +529254,7 @@ var init_AutoUpdaterWrapper = __esm(() => {
|
|
|
529217
529254
|
});
|
|
529218
529255
|
|
|
529219
529256
|
// src/components/IdeStatusIndicator.tsx
|
|
529220
|
-
import { basename as
|
|
529257
|
+
import { basename as basename57 } from "path";
|
|
529221
529258
|
function IdeStatusIndicator(t0) {
|
|
529222
529259
|
const $3 = import_compiler_runtime316.c(7);
|
|
529223
529260
|
const {
|
|
@@ -529257,7 +529294,7 @@ function IdeStatusIndicator(t0) {
|
|
|
529257
529294
|
if (ideSelection.filePath) {
|
|
529258
529295
|
let t1;
|
|
529259
529296
|
if ($3[3] !== ideSelection.filePath) {
|
|
529260
|
-
t1 =
|
|
529297
|
+
t1 = basename57(ideSelection.filePath);
|
|
529261
529298
|
$3[3] = ideSelection.filePath;
|
|
529262
529299
|
$3[4] = t1;
|
|
529263
529300
|
} else {
|
|
@@ -532387,7 +532424,7 @@ var init_slackChannelSuggestions = __esm(() => {
|
|
|
532387
532424
|
});
|
|
532388
532425
|
|
|
532389
532426
|
// src/hooks/unifiedSuggestions.ts
|
|
532390
|
-
import { basename as
|
|
532427
|
+
import { basename as basename58 } from "path";
|
|
532391
532428
|
function createSuggestionFromSource(source) {
|
|
532392
532429
|
switch (source.type) {
|
|
532393
532430
|
case "file":
|
|
@@ -532449,7 +532486,7 @@ async function generateUnifiedSuggestions(query3, mcpResources, agents2, showOnE
|
|
|
532449
532486
|
displayText: suggestion.displayText,
|
|
532450
532487
|
description: suggestion.description,
|
|
532451
532488
|
path: suggestion.displayText,
|
|
532452
|
-
filename:
|
|
532489
|
+
filename: basename58(suggestion.displayText),
|
|
532453
532490
|
score: suggestion.metadata?.score
|
|
532454
532491
|
}));
|
|
532455
532492
|
const mcpSources = Object.values(mcpResources).flat().map((resource) => ({
|
|
@@ -533672,7 +533709,7 @@ var init_AutoModeOptInDialog = __esm(() => {
|
|
|
533672
533709
|
});
|
|
533673
533710
|
|
|
533674
533711
|
// src/components/BridgeDialog.tsx
|
|
533675
|
-
import { basename as
|
|
533712
|
+
import { basename as basename59 } from "path";
|
|
533676
533713
|
function BridgeDialog(t0) {
|
|
533677
533714
|
const $3 = import_compiler_runtime321.c(87);
|
|
533678
533715
|
const {
|
|
@@ -533695,7 +533732,7 @@ function BridgeDialog(t0) {
|
|
|
533695
533732
|
const [branchName, setBranchName] = import_react243.useState("");
|
|
533696
533733
|
let t1;
|
|
533697
533734
|
if ($3[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
533698
|
-
t1 =
|
|
533735
|
+
t1 = basename59(getOriginalCwd());
|
|
533699
533736
|
$3[0] = t1;
|
|
533700
533737
|
} else {
|
|
533701
533738
|
t1 = $3[0];
|
|
@@ -544184,7 +544221,7 @@ var init_coordinatorHandler = __esm(() => {
|
|
|
544184
544221
|
});
|
|
544185
544222
|
|
|
544186
544223
|
// src/hooks/toolPermission/PermissionContext.ts
|
|
544187
|
-
function createResolveOnce(
|
|
544224
|
+
function createResolveOnce(resolve48) {
|
|
544188
544225
|
let claimed = false;
|
|
544189
544226
|
let delivered = false;
|
|
544190
544227
|
return {
|
|
@@ -544193,7 +544230,7 @@ function createResolveOnce(resolve47) {
|
|
|
544193
544230
|
return;
|
|
544194
544231
|
delivered = true;
|
|
544195
544232
|
claimed = true;
|
|
544196
|
-
|
|
544233
|
+
resolve48(value);
|
|
544197
544234
|
},
|
|
544198
544235
|
isResolved() {
|
|
544199
544236
|
return claimed;
|
|
@@ -544238,11 +544275,11 @@ function createPermissionContext(tool, input, toolUseContext, assistantMessage,
|
|
|
544238
544275
|
setToolPermissionContext(applyPermissionUpdates(appState.toolPermissionContext, updates));
|
|
544239
544276
|
return updates.some((update) => supportsPersistence(update.destination));
|
|
544240
544277
|
},
|
|
544241
|
-
resolveIfAborted(
|
|
544278
|
+
resolveIfAborted(resolve48) {
|
|
544242
544279
|
if (!toolUseContext.abortController.signal.aborted)
|
|
544243
544280
|
return false;
|
|
544244
544281
|
this.logCancelled();
|
|
544245
|
-
|
|
544282
|
+
resolve48(this.cancelAndAbort(undefined, true));
|
|
544246
544283
|
return true;
|
|
544247
544284
|
},
|
|
544248
544285
|
cancelAndAbort(feedback2, isAbort, contentBlocks) {
|
|
@@ -544358,7 +544395,7 @@ var init_PermissionContext = __esm(() => {
|
|
|
544358
544395
|
|
|
544359
544396
|
// src/hooks/toolPermission/handlers/interactiveHandler.ts
|
|
544360
544397
|
import { randomUUID as randomUUID40 } from "crypto";
|
|
544361
|
-
function handleInteractivePermission(params,
|
|
544398
|
+
function handleInteractivePermission(params, resolve48) {
|
|
544362
544399
|
const {
|
|
544363
544400
|
ctx,
|
|
544364
544401
|
description,
|
|
@@ -544367,7 +544404,7 @@ function handleInteractivePermission(params, resolve47) {
|
|
|
544367
544404
|
bridgeCallbacks,
|
|
544368
544405
|
channelCallbacks
|
|
544369
544406
|
} = params;
|
|
544370
|
-
const { resolve: resolveOnce, isResolved, claim } = createResolveOnce(
|
|
544407
|
+
const { resolve: resolveOnce, isResolved, claim } = createResolveOnce(resolve48);
|
|
544371
544408
|
let userInteracted = false;
|
|
544372
544409
|
let checkmarkTransitionTimer;
|
|
544373
544410
|
let checkmarkAbortHandler;
|
|
@@ -544554,8 +544591,8 @@ async function handleSwarmWorkerPermission(params) {
|
|
|
544554
544591
|
...prev,
|
|
544555
544592
|
pendingWorkerRequest: null
|
|
544556
544593
|
}));
|
|
544557
|
-
const decision = await new Promise((
|
|
544558
|
-
const { resolve: resolveOnce, claim } = createResolveOnce(
|
|
544594
|
+
const decision = await new Promise((resolve48) => {
|
|
544595
|
+
const { resolve: resolveOnce, claim } = createResolveOnce(resolve48);
|
|
544559
544596
|
const request = createPermissionRequest({
|
|
544560
544597
|
toolName: ctx.tool.name,
|
|
544561
544598
|
toolUseId: ctx.toolUseID,
|
|
@@ -544621,15 +544658,15 @@ function useCanUseTool(setToolUseConfirmQueue, setToolPermissionContext) {
|
|
|
544621
544658
|
const $3 = import_compiler_runtime339.c(3);
|
|
544622
544659
|
let t0;
|
|
544623
544660
|
if ($3[0] !== setToolPermissionContext || $3[1] !== setToolUseConfirmQueue) {
|
|
544624
|
-
t0 = async (tool, input, toolUseContext, assistantMessage, toolUseID, forceDecision) => new Promise((
|
|
544661
|
+
t0 = async (tool, input, toolUseContext, assistantMessage, toolUseID, forceDecision) => new Promise((resolve48) => {
|
|
544625
544662
|
const ctx = createPermissionContext(tool, input, toolUseContext, assistantMessage, toolUseID, setToolPermissionContext, createPermissionQueueOps(setToolUseConfirmQueue));
|
|
544626
|
-
if (ctx.resolveIfAborted(
|
|
544663
|
+
if (ctx.resolveIfAborted(resolve48)) {
|
|
544627
544664
|
return;
|
|
544628
544665
|
}
|
|
544629
544666
|
const decisionPromise = forceDecision !== undefined ? Promise.resolve(forceDecision) : hasPermissionsToUseTool(tool, input, toolUseContext, assistantMessage, toolUseID);
|
|
544630
544667
|
return decisionPromise.then(async (result) => {
|
|
544631
544668
|
if (result.behavior === "allow") {
|
|
544632
|
-
if (ctx.resolveIfAborted(
|
|
544669
|
+
if (ctx.resolveIfAborted(resolve48)) {
|
|
544633
544670
|
return;
|
|
544634
544671
|
}
|
|
544635
544672
|
if (false) {}
|
|
@@ -544637,7 +544674,7 @@ function useCanUseTool(setToolUseConfirmQueue, setToolPermissionContext) {
|
|
|
544637
544674
|
decision: "accept",
|
|
544638
544675
|
source: "config"
|
|
544639
544676
|
});
|
|
544640
|
-
|
|
544677
|
+
resolve48(ctx.buildAllow(result.updatedInput ?? input, {
|
|
544641
544678
|
decisionReason: result.decisionReason
|
|
544642
544679
|
}));
|
|
544643
544680
|
return;
|
|
@@ -544648,7 +544685,7 @@ function useCanUseTool(setToolUseConfirmQueue, setToolPermissionContext) {
|
|
|
544648
544685
|
toolPermissionContext: appState.toolPermissionContext,
|
|
544649
544686
|
tools: toolUseContext.options.tools
|
|
544650
544687
|
});
|
|
544651
|
-
if (ctx.resolveIfAborted(
|
|
544688
|
+
if (ctx.resolveIfAborted(resolve48)) {
|
|
544652
544689
|
return;
|
|
544653
544690
|
}
|
|
544654
544691
|
switch (result.behavior) {
|
|
@@ -544664,7 +544701,7 @@ function useCanUseTool(setToolUseConfirmQueue, setToolPermissionContext) {
|
|
|
544664
544701
|
source: "config"
|
|
544665
544702
|
});
|
|
544666
544703
|
if (false) {}
|
|
544667
|
-
|
|
544704
|
+
resolve48(result);
|
|
544668
544705
|
return;
|
|
544669
544706
|
}
|
|
544670
544707
|
case "ask": {
|
|
@@ -544677,11 +544714,11 @@ function useCanUseTool(setToolUseConfirmQueue, setToolPermissionContext) {
|
|
|
544677
544714
|
permissionMode: appState.toolPermissionContext.mode
|
|
544678
544715
|
});
|
|
544679
544716
|
if (coordinatorDecision) {
|
|
544680
|
-
|
|
544717
|
+
resolve48(coordinatorDecision);
|
|
544681
544718
|
return;
|
|
544682
544719
|
}
|
|
544683
544720
|
}
|
|
544684
|
-
if (ctx.resolveIfAborted(
|
|
544721
|
+
if (ctx.resolveIfAborted(resolve48)) {
|
|
544685
544722
|
return;
|
|
544686
544723
|
}
|
|
544687
544724
|
const swarmDecision = await handleSwarmWorkerPermission({
|
|
@@ -544692,7 +544729,7 @@ function useCanUseTool(setToolUseConfirmQueue, setToolPermissionContext) {
|
|
|
544692
544729
|
suggestions: result.suggestions
|
|
544693
544730
|
});
|
|
544694
544731
|
if (swarmDecision) {
|
|
544695
|
-
|
|
544732
|
+
resolve48(swarmDecision);
|
|
544696
544733
|
return;
|
|
544697
544734
|
}
|
|
544698
544735
|
if (false) {}
|
|
@@ -544703,7 +544740,7 @@ function useCanUseTool(setToolUseConfirmQueue, setToolPermissionContext) {
|
|
|
544703
544740
|
awaitAutomatedChecksBeforeDialog: appState.toolPermissionContext.awaitAutomatedChecksBeforeDialog,
|
|
544704
544741
|
bridgeCallbacks: undefined,
|
|
544705
544742
|
channelCallbacks: undefined
|
|
544706
|
-
},
|
|
544743
|
+
}, resolve48);
|
|
544707
544744
|
return;
|
|
544708
544745
|
}
|
|
544709
544746
|
}
|
|
@@ -544711,10 +544748,10 @@ function useCanUseTool(setToolUseConfirmQueue, setToolPermissionContext) {
|
|
|
544711
544748
|
if (error49 instanceof AbortError || error49 instanceof APIUserAbortError) {
|
|
544712
544749
|
logForDebugging(`Permission check threw ${error49.constructor.name} for tool=${tool.name}: ${error49.message}`);
|
|
544713
544750
|
ctx.logCancelled();
|
|
544714
|
-
|
|
544751
|
+
resolve48(ctx.cancelAndAbort(undefined, true));
|
|
544715
544752
|
} else {
|
|
544716
544753
|
logError2(error49);
|
|
544717
|
-
|
|
544754
|
+
resolve48(ctx.cancelAndAbort(undefined, true));
|
|
544718
544755
|
}
|
|
544719
544756
|
}).finally(() => {
|
|
544720
544757
|
clearClassifierChecking(toolUseID);
|
|
@@ -546386,7 +546423,7 @@ __export(exports_asciicast, {
|
|
|
546386
546423
|
_resetRecordingStateForTesting: () => _resetRecordingStateForTesting
|
|
546387
546424
|
});
|
|
546388
546425
|
import { appendFile as appendFile7, rename as rename12 } from "fs/promises";
|
|
546389
|
-
import { basename as
|
|
546426
|
+
import { basename as basename60, dirname as dirname63, join as join150 } from "path";
|
|
546390
546427
|
function getRecordFilePath() {
|
|
546391
546428
|
if (recordingState.filePath !== null) {
|
|
546392
546429
|
return recordingState.filePath;
|
|
@@ -546432,8 +546469,8 @@ async function renameRecordingForSession() {
|
|
|
546432
546469
|
return;
|
|
546433
546470
|
}
|
|
546434
546471
|
await recorder?.flush();
|
|
546435
|
-
const oldName =
|
|
546436
|
-
const newName =
|
|
546472
|
+
const oldName = basename60(oldPath);
|
|
546473
|
+
const newName = basename60(newPath);
|
|
546437
546474
|
try {
|
|
546438
546475
|
await rename12(oldPath, newPath);
|
|
546439
546476
|
recordingState.filePath = newPath;
|
|
@@ -551190,7 +551227,7 @@ class StructuredIO {
|
|
|
551190
551227
|
});
|
|
551191
551228
|
}
|
|
551192
551229
|
try {
|
|
551193
|
-
return await new Promise((
|
|
551230
|
+
return await new Promise((resolve49, reject2) => {
|
|
551194
551231
|
this.pendingRequests.set(requestId, {
|
|
551195
551232
|
request: {
|
|
551196
551233
|
type: "control_request",
|
|
@@ -551198,7 +551235,7 @@ class StructuredIO {
|
|
|
551198
551235
|
request
|
|
551199
551236
|
},
|
|
551200
551237
|
resolve: (result) => {
|
|
551201
|
-
|
|
551238
|
+
resolve49(result);
|
|
551202
551239
|
},
|
|
551203
551240
|
reject: reject2,
|
|
551204
551241
|
schema
|
|
@@ -552321,7 +552358,7 @@ function usePluginRecommendationBase() {
|
|
|
552321
552358
|
const isCheckingRef = React148.useRef(false);
|
|
552322
552359
|
let t0;
|
|
552323
552360
|
if ($3[0] !== recommendation) {
|
|
552324
|
-
t0 = (
|
|
552361
|
+
t0 = (resolve49) => {
|
|
552325
552362
|
if (getIsRemoteMode()) {
|
|
552326
552363
|
return;
|
|
552327
552364
|
}
|
|
@@ -552332,7 +552369,7 @@ function usePluginRecommendationBase() {
|
|
|
552332
552369
|
return;
|
|
552333
552370
|
}
|
|
552334
552371
|
isCheckingRef.current = true;
|
|
552335
|
-
|
|
552372
|
+
resolve49().then((rec) => {
|
|
552336
552373
|
if (rec) {
|
|
552337
552374
|
setRecommendation(rec);
|
|
552338
552375
|
}
|
|
@@ -553208,7 +553245,7 @@ var init_usePluginAutoupdateNotification = __esm(() => {
|
|
|
553208
553245
|
});
|
|
553209
553246
|
|
|
553210
553247
|
// src/utils/plugins/reconciler.ts
|
|
553211
|
-
import { isAbsolute as isAbsolute29, resolve as
|
|
553248
|
+
import { isAbsolute as isAbsolute29, resolve as resolve49 } from "path";
|
|
553212
553249
|
function diffMarketplaces(declared, materialized, opts) {
|
|
553213
553250
|
const missing = [];
|
|
553214
553251
|
const sourceChanged = [];
|
|
@@ -553321,7 +553358,7 @@ function normalizeSource(source, projectRoot) {
|
|
|
553321
553358
|
const canonicalRoot = findCanonicalGitRoot(base2);
|
|
553322
553359
|
return {
|
|
553323
553360
|
...source,
|
|
553324
|
-
path:
|
|
553361
|
+
path: resolve49(canonicalRoot ?? base2, source.path)
|
|
553325
553362
|
};
|
|
553326
553363
|
}
|
|
553327
553364
|
return source;
|
|
@@ -556595,12 +556632,12 @@ Error: sandbox required but unavailable: ${reason}
|
|
|
556595
556632
|
return () => unregisterLeaderSetToolPermissionContext();
|
|
556596
556633
|
}, [setToolPermissionContext]);
|
|
556597
556634
|
const canUseTool = useCanUseTool_default(setToolUseConfirmQueue, setToolPermissionContext);
|
|
556598
|
-
const requestPrompt = import_react319.useCallback((title, toolInputSummary) => (request) => new Promise((
|
|
556635
|
+
const requestPrompt = import_react319.useCallback((title, toolInputSummary) => (request) => new Promise((resolve50, reject2) => {
|
|
556599
556636
|
setPromptQueue((prev) => [...prev, {
|
|
556600
556637
|
request,
|
|
556601
556638
|
title,
|
|
556602
556639
|
toolInputSummary,
|
|
556603
|
-
resolve:
|
|
556640
|
+
resolve: resolve50,
|
|
556604
556641
|
reject: reject2
|
|
556605
556642
|
}]);
|
|
556606
556643
|
}), []);
|
|
@@ -559477,8 +559514,8 @@ async function handleMcpjsonServerApprovals(root2) {
|
|
|
559477
559514
|
if (pendingServers.length === 0) {
|
|
559478
559515
|
return;
|
|
559479
559516
|
}
|
|
559480
|
-
await new Promise((
|
|
559481
|
-
const done = () => void
|
|
559517
|
+
await new Promise((resolve50) => {
|
|
559518
|
+
const done = () => void resolve50();
|
|
559482
559519
|
if (pendingServers.length === 1 && pendingServers[0] !== undefined) {
|
|
559483
559520
|
const serverName = pendingServers[0];
|
|
559484
559521
|
root2.render(/* @__PURE__ */ jsx_dev_runtime470.jsxDEV(AppStateProvider, {
|
|
@@ -562257,8 +562294,8 @@ function completeOnboarding() {
|
|
|
562257
562294
|
}));
|
|
562258
562295
|
}
|
|
562259
562296
|
function showDialog(root2, renderer) {
|
|
562260
|
-
return new Promise((
|
|
562261
|
-
const done = (result) => void
|
|
562297
|
+
return new Promise((resolve50) => {
|
|
562298
|
+
const done = (result) => void resolve50(result);
|
|
562262
562299
|
root2.render(renderer(done));
|
|
562263
562300
|
});
|
|
562264
562301
|
}
|
|
@@ -563885,11 +563922,11 @@ async function isCodeGraphInstalled() {
|
|
|
563885
563922
|
if (cachedResult !== null)
|
|
563886
563923
|
return cachedResult;
|
|
563887
563924
|
if (checkStarted) {
|
|
563888
|
-
await new Promise((
|
|
563925
|
+
await new Promise((resolve50) => {
|
|
563889
563926
|
const check3 = setInterval(() => {
|
|
563890
563927
|
if (cachedResult !== null) {
|
|
563891
563928
|
clearInterval(check3);
|
|
563892
|
-
|
|
563929
|
+
resolve50();
|
|
563893
563930
|
}
|
|
563894
563931
|
}, 50);
|
|
563895
563932
|
});
|
|
@@ -563915,7 +563952,7 @@ var init_codegraphCheck = __esm(() => {
|
|
|
563915
563952
|
|
|
563916
563953
|
// src/plugins/bundled/eccBuiltin.ts
|
|
563917
563954
|
import { readdirSync as readdirSync6, readFileSync as readFileSync18, existsSync as existsSync11 } from "fs";
|
|
563918
|
-
import { join as join154, dirname as dirname67, basename as
|
|
563955
|
+
import { join as join154, dirname as dirname67, basename as basename61, extname as extname17 } from "path";
|
|
563919
563956
|
import { fileURLToPath as fileURLToPath9 } from "url";
|
|
563920
563957
|
function resolveSeedDir() {
|
|
563921
563958
|
if (process.env.CLAUDE_CODE_PLUGIN_SEED_DIR) {
|
|
@@ -563973,7 +564010,7 @@ var init_eccBuiltin = __esm(() => {
|
|
|
563973
564010
|
for (const file2 of files3) {
|
|
563974
564011
|
if (extname17(file2) !== ".md")
|
|
563975
564012
|
continue;
|
|
563976
|
-
const name =
|
|
564013
|
+
const name = basename61(file2, ".md");
|
|
563977
564014
|
const content = readFileSync18(join154(ECC_COMMANDS_DIR, file2), "utf-8");
|
|
563978
564015
|
registerMarkdownSkill(name, join154(ECC_COMMANDS_DIR, file2), content, "Custom command");
|
|
563979
564016
|
count4++;
|
|
@@ -567701,8 +567738,8 @@ class SerialBatchEventUploader {
|
|
|
567701
567738
|
if (items.length === 0)
|
|
567702
567739
|
return;
|
|
567703
567740
|
while (this.pending.length + items.length > this.config.maxQueueSize && !this.closed) {
|
|
567704
|
-
await new Promise((
|
|
567705
|
-
this.backpressureResolvers.push(
|
|
567741
|
+
await new Promise((resolve50) => {
|
|
567742
|
+
this.backpressureResolvers.push(resolve50);
|
|
567706
567743
|
});
|
|
567707
567744
|
}
|
|
567708
567745
|
if (this.closed)
|
|
@@ -567715,8 +567752,8 @@ class SerialBatchEventUploader {
|
|
|
567715
567752
|
return Promise.resolve();
|
|
567716
567753
|
}
|
|
567717
567754
|
this.drain();
|
|
567718
|
-
return new Promise((
|
|
567719
|
-
this.flushResolvers.push(
|
|
567755
|
+
return new Promise((resolve50) => {
|
|
567756
|
+
this.flushResolvers.push(resolve50);
|
|
567720
567757
|
});
|
|
567721
567758
|
}
|
|
567722
567759
|
close() {
|
|
@@ -567727,11 +567764,11 @@ class SerialBatchEventUploader {
|
|
|
567727
567764
|
this.pending = [];
|
|
567728
567765
|
this.sleepResolve?.();
|
|
567729
567766
|
this.sleepResolve = null;
|
|
567730
|
-
for (const
|
|
567731
|
-
|
|
567767
|
+
for (const resolve50 of this.backpressureResolvers)
|
|
567768
|
+
resolve50();
|
|
567732
567769
|
this.backpressureResolvers = [];
|
|
567733
|
-
for (const
|
|
567734
|
-
|
|
567770
|
+
for (const resolve50 of this.flushResolvers)
|
|
567771
|
+
resolve50();
|
|
567735
567772
|
this.flushResolvers = [];
|
|
567736
567773
|
}
|
|
567737
567774
|
async drain() {
|
|
@@ -567766,8 +567803,8 @@ class SerialBatchEventUploader {
|
|
|
567766
567803
|
} finally {
|
|
567767
567804
|
this.draining = false;
|
|
567768
567805
|
if (this.pending.length === 0) {
|
|
567769
|
-
for (const
|
|
567770
|
-
|
|
567806
|
+
for (const resolve50 of this.flushResolvers)
|
|
567807
|
+
resolve50();
|
|
567771
567808
|
this.flushResolvers = [];
|
|
567772
567809
|
}
|
|
567773
567810
|
}
|
|
@@ -567806,16 +567843,16 @@ class SerialBatchEventUploader {
|
|
|
567806
567843
|
releaseBackpressure() {
|
|
567807
567844
|
const resolvers3 = this.backpressureResolvers;
|
|
567808
567845
|
this.backpressureResolvers = [];
|
|
567809
|
-
for (const
|
|
567810
|
-
|
|
567846
|
+
for (const resolve50 of resolvers3)
|
|
567847
|
+
resolve50();
|
|
567811
567848
|
}
|
|
567812
567849
|
sleep(ms) {
|
|
567813
|
-
return new Promise((
|
|
567814
|
-
this.sleepResolve =
|
|
567815
|
-
setTimeout((self2,
|
|
567850
|
+
return new Promise((resolve50) => {
|
|
567851
|
+
this.sleepResolve = resolve50;
|
|
567852
|
+
setTimeout((self2, resolve51) => {
|
|
567816
567853
|
self2.sleepResolve = null;
|
|
567817
|
-
|
|
567818
|
-
}, ms, this,
|
|
567854
|
+
resolve51();
|
|
567855
|
+
}, ms, this, resolve50);
|
|
567819
567856
|
});
|
|
567820
567857
|
}
|
|
567821
567858
|
}
|
|
@@ -570607,7 +570644,7 @@ var init_idleTimeout = __esm(() => {
|
|
|
570607
570644
|
// src/bridge/inboundAttachments.ts
|
|
570608
570645
|
import { randomUUID as randomUUID50 } from "crypto";
|
|
570609
570646
|
import { mkdir as mkdir45, writeFile as writeFile46 } from "fs/promises";
|
|
570610
|
-
import { basename as
|
|
570647
|
+
import { basename as basename62, join as join157 } from "path";
|
|
570611
570648
|
function debug3(msg) {
|
|
570612
570649
|
logForDebugging(`[bridge:inbound-attach] ${msg}`);
|
|
570613
570650
|
}
|
|
@@ -570619,7 +570656,7 @@ function extractInboundAttachments(msg) {
|
|
|
570619
570656
|
return parsed.success ? parsed.data : [];
|
|
570620
570657
|
}
|
|
570621
570658
|
function sanitizeFileName(name) {
|
|
570622
|
-
const base2 =
|
|
570659
|
+
const base2 = basename62(name).replace(/[^a-zA-Z0-9._-]/g, "_");
|
|
570623
570660
|
return base2 || "attachment";
|
|
570624
570661
|
}
|
|
570625
570662
|
function uploadsDir() {
|
|
@@ -574794,8 +574831,8 @@ ${m2.text}
|
|
|
574794
574831
|
const controller = new AbortController;
|
|
574795
574832
|
activeOAuthFlows.set(serverName, controller);
|
|
574796
574833
|
let resolveAuthUrl;
|
|
574797
|
-
const authUrlPromise = new Promise((
|
|
574798
|
-
resolveAuthUrl =
|
|
574834
|
+
const authUrlPromise = new Promise((resolve50) => {
|
|
574835
|
+
resolveAuthUrl = resolve50;
|
|
574799
574836
|
});
|
|
574800
574837
|
const oauthPromise = performMCPOAuthFlow(serverName, config5, (url3) => resolveAuthUrl(url3), controller.signal, {
|
|
574801
574838
|
skipBrowserOpen: true,
|
|
@@ -574908,8 +574945,8 @@ ${m2.text}
|
|
|
574908
574945
|
});
|
|
574909
574946
|
const service = new OAuthService;
|
|
574910
574947
|
let urlResolver;
|
|
574911
|
-
const urlPromise = new Promise((
|
|
574912
|
-
urlResolver =
|
|
574948
|
+
const urlPromise = new Promise((resolve50) => {
|
|
574949
|
+
urlResolver = resolve50;
|
|
574913
574950
|
});
|
|
574914
574951
|
const flow = service.startOAuthFlow(async (manualUrl, automaticUrl) => {
|
|
574915
574952
|
urlResolver({ manualUrl, automaticUrl });
|
|
@@ -575297,8 +575334,8 @@ function createCanUseToolWithPermissionPrompt(permissionPromptTool) {
|
|
|
575297
575334
|
}
|
|
575298
575335
|
};
|
|
575299
575336
|
}
|
|
575300
|
-
const abortPromise = new Promise((
|
|
575301
|
-
combinedSignal.addEventListener("abort", () =>
|
|
575337
|
+
const abortPromise = new Promise((resolve50) => {
|
|
575338
|
+
combinedSignal.addEventListener("abort", () => resolve50("aborted"), {
|
|
575302
575339
|
once: true
|
|
575303
575340
|
});
|
|
575304
575341
|
});
|
|
@@ -577605,7 +577642,7 @@ __export(exports_plugins, {
|
|
|
577605
577642
|
VALID_UPDATE_SCOPES: () => VALID_UPDATE_SCOPES,
|
|
577606
577643
|
VALID_INSTALLABLE_SCOPES: () => VALID_INSTALLABLE_SCOPES
|
|
577607
577644
|
});
|
|
577608
|
-
import { basename as
|
|
577645
|
+
import { basename as basename63, dirname as dirname71 } from "path";
|
|
577609
577646
|
function handleMarketplaceError(error49, action2) {
|
|
577610
577647
|
logError2(error49);
|
|
577611
577648
|
cliError(`${figures_default.cross} Failed to ${action2}: ${errorMessage(error49)}`);
|
|
@@ -577639,7 +577676,7 @@ async function pluginValidateHandler(manifestPath, options) {
|
|
|
577639
577676
|
let contentResults = [];
|
|
577640
577677
|
if (result.fileType === "plugin") {
|
|
577641
577678
|
const manifestDir = dirname71(result.filePath);
|
|
577642
|
-
if (
|
|
577679
|
+
if (basename63(manifestDir) === ".claude-plugin") {
|
|
577643
577680
|
contentResults = await validatePluginContents(dirname71(manifestDir));
|
|
577644
577681
|
for (const r of contentResults) {
|
|
577645
577682
|
console.log(`Validating ${r.fileType}: ${r.filePath}
|
|
@@ -578484,7 +578521,7 @@ async function setupTokenHandler(root2) {
|
|
|
578484
578521
|
const {
|
|
578485
578522
|
ConsoleOAuthFlow: ConsoleOAuthFlow2
|
|
578486
578523
|
} = await Promise.resolve().then(() => (init_ConsoleOAuthFlow(), exports_ConsoleOAuthFlow));
|
|
578487
|
-
await new Promise((
|
|
578524
|
+
await new Promise((resolve50) => {
|
|
578488
578525
|
root2.render(/* @__PURE__ */ jsx_dev_runtime491.jsxDEV(AppStateProvider, {
|
|
578489
578526
|
onChangeAppState,
|
|
578490
578527
|
children: /* @__PURE__ */ jsx_dev_runtime491.jsxDEV(KeybindingSetup, {
|
|
@@ -578508,7 +578545,7 @@ async function setupTokenHandler(root2) {
|
|
|
578508
578545
|
}, undefined, true, undefined, this),
|
|
578509
578546
|
/* @__PURE__ */ jsx_dev_runtime491.jsxDEV(ConsoleOAuthFlow2, {
|
|
578510
578547
|
onDone: () => {
|
|
578511
|
-
|
|
578548
|
+
resolve50();
|
|
578512
578549
|
},
|
|
578513
578550
|
mode: "setup-token",
|
|
578514
578551
|
startingMessage: "This will guide you through long-lived (1-year) auth token setup for your Claude account. Claude subscription required."
|
|
@@ -578544,7 +578581,7 @@ function DoctorWithPlugins(t0) {
|
|
|
578544
578581
|
}
|
|
578545
578582
|
async function doctorHandler(root2) {
|
|
578546
578583
|
logEvent("tengu_doctor_command", {});
|
|
578547
|
-
await new Promise((
|
|
578584
|
+
await new Promise((resolve50) => {
|
|
578548
578585
|
root2.render(/* @__PURE__ */ jsx_dev_runtime491.jsxDEV(AppStateProvider, {
|
|
578549
578586
|
children: /* @__PURE__ */ jsx_dev_runtime491.jsxDEV(KeybindingSetup, {
|
|
578550
578587
|
children: /* @__PURE__ */ jsx_dev_runtime491.jsxDEV(MCPConnectionManager, {
|
|
@@ -578552,7 +578589,7 @@ async function doctorHandler(root2) {
|
|
|
578552
578589
|
isStrictMcpConfig: false,
|
|
578553
578590
|
children: /* @__PURE__ */ jsx_dev_runtime491.jsxDEV(DoctorWithPlugins, {
|
|
578554
578591
|
onDone: () => {
|
|
578555
|
-
|
|
578592
|
+
resolve50();
|
|
578556
578593
|
}
|
|
578557
578594
|
}, undefined, false, undefined, this)
|
|
578558
578595
|
}, undefined, false, undefined, this)
|
|
@@ -578570,14 +578607,14 @@ async function installHandler(target, options) {
|
|
|
578570
578607
|
const {
|
|
578571
578608
|
install: install2
|
|
578572
578609
|
} = await Promise.resolve().then(() => (init_install(), exports_install));
|
|
578573
|
-
await new Promise((
|
|
578610
|
+
await new Promise((resolve50) => {
|
|
578574
578611
|
const args = [];
|
|
578575
578612
|
if (target)
|
|
578576
578613
|
args.push(target);
|
|
578577
578614
|
if (options.force)
|
|
578578
578615
|
args.push("--force");
|
|
578579
578616
|
install2.call((result) => {
|
|
578580
|
-
|
|
578617
|
+
resolve50();
|
|
578581
578618
|
process.exit(result.includes("failed") ? 1 : 0);
|
|
578582
578619
|
}, {}, args);
|
|
578583
578620
|
});
|
|
@@ -579017,7 +579054,7 @@ __export(exports_main, {
|
|
|
579017
579054
|
main: () => main
|
|
579018
579055
|
});
|
|
579019
579056
|
import { readFileSync as readFileSync19 } from "fs";
|
|
579020
|
-
import { resolve as
|
|
579057
|
+
import { resolve as resolve50, join as join162, dirname as dirname72 } from "path";
|
|
579021
579058
|
import { fileURLToPath as fileURLToPath10 } from "url";
|
|
579022
579059
|
import { existsSync as existsSync12 } from "fs";
|
|
579023
579060
|
function logManagedSettings() {
|
|
@@ -579581,12 +579618,12 @@ ${getTmuxInstallInstructions2()}
|
|
|
579581
579618
|
process.exit(1);
|
|
579582
579619
|
}
|
|
579583
579620
|
try {
|
|
579584
|
-
const filePath =
|
|
579621
|
+
const filePath = resolve50(options.systemPromptFile);
|
|
579585
579622
|
systemPrompt = readFileSync19(filePath, "utf8");
|
|
579586
579623
|
} catch (error49) {
|
|
579587
579624
|
const code = getErrnoCode(error49);
|
|
579588
579625
|
if (code === "ENOENT") {
|
|
579589
|
-
process.stderr.write(source_default.red(`Error: System prompt file not found: ${
|
|
579626
|
+
process.stderr.write(source_default.red(`Error: System prompt file not found: ${resolve50(options.systemPromptFile)}
|
|
579590
579627
|
`));
|
|
579591
579628
|
process.exit(1);
|
|
579592
579629
|
}
|
|
@@ -579603,12 +579640,12 @@ ${getTmuxInstallInstructions2()}
|
|
|
579603
579640
|
process.exit(1);
|
|
579604
579641
|
}
|
|
579605
579642
|
try {
|
|
579606
|
-
const filePath =
|
|
579643
|
+
const filePath = resolve50(options.appendSystemPromptFile);
|
|
579607
579644
|
appendSystemPrompt = readFileSync19(filePath, "utf8");
|
|
579608
579645
|
} catch (error49) {
|
|
579609
579646
|
const code = getErrnoCode(error49);
|
|
579610
579647
|
if (code === "ENOENT") {
|
|
579611
|
-
process.stderr.write(source_default.red(`Error: Append system prompt file not found: ${
|
|
579648
|
+
process.stderr.write(source_default.red(`Error: Append system prompt file not found: ${resolve50(options.appendSystemPromptFile)}
|
|
579612
579649
|
`));
|
|
579613
579650
|
process.exit(1);
|
|
579614
579651
|
}
|
|
@@ -579654,7 +579691,7 @@ ${addendum}` : addendum;
|
|
|
579654
579691
|
errors6 = result.errors;
|
|
579655
579692
|
}
|
|
579656
579693
|
} else {
|
|
579657
|
-
const configPath =
|
|
579694
|
+
const configPath = resolve50(configItem);
|
|
579658
579695
|
const result = parseMcpConfigFromFilePath({
|
|
579659
579696
|
filePath: configPath,
|
|
579660
579697
|
expandVars: true,
|
|
@@ -580408,8 +580445,8 @@ ${customInstructions}` : customInstructions;
|
|
|
580408
580445
|
return connectMcpBatch(dedupedClaudeAi, "claudeai");
|
|
580409
580446
|
});
|
|
580410
580447
|
let claudeaiTimer;
|
|
580411
|
-
const claudeaiTimedOut = await Promise.race([claudeaiConnect.then(() => false), new Promise((
|
|
580412
|
-
claudeaiTimer = setTimeout((r) => r(true), CLAUDE_AI_MCP_TIMEOUT_MS,
|
|
580448
|
+
const claudeaiTimedOut = await Promise.race([claudeaiConnect.then(() => false), new Promise((resolve51) => {
|
|
580449
|
+
claudeaiTimer = setTimeout((r) => r(true), CLAUDE_AI_MCP_TIMEOUT_MS, resolve51);
|
|
580413
580450
|
})]);
|
|
580414
580451
|
if (claudeaiTimer)
|
|
580415
580452
|
clearTimeout(claudeaiTimer);
|