vivus-agent 1.1.30 → 1.1.32
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/main.js +611 -593
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env -S node --max-old-space-size=8192 --expose-gc
|
|
2
2
|
// Vivus CLI — local AI coding agent
|
|
3
|
-
// Built from source at 2026-06-
|
|
3
|
+
// Built from source at 2026-06-23T22:31:13.069Z
|
|
4
4
|
import { createRequire } from "node:module";
|
|
5
5
|
var __create = Object.create;
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
@@ -108119,7 +108119,7 @@ var init_auth = __esm(() => {
|
|
|
108119
108119
|
|
|
108120
108120
|
// src/utils/userAgent.ts
|
|
108121
108121
|
function getVivusCodeUserAgent() {
|
|
108122
|
-
return `vivus/${"1.1.
|
|
108122
|
+
return `vivus/${"1.1.32+82959fe"}`;
|
|
108123
108123
|
}
|
|
108124
108124
|
|
|
108125
108125
|
// src/utils/workloadContext.ts
|
|
@@ -108141,7 +108141,7 @@ function getUserAgent() {
|
|
|
108141
108141
|
const clientApp = process.env.VIVUS_AGENT_SDK_CLIENT_APP ? `, client-app/${process.env.VIVUS_AGENT_SDK_CLIENT_APP}` : "";
|
|
108142
108142
|
const workload = getWorkload();
|
|
108143
108143
|
const workloadSuffix = workload ? `, workload/${workload}` : "";
|
|
108144
|
-
return `vivus-cli/${"1.1.
|
|
108144
|
+
return `vivus-cli/${"1.1.32+82959fe"} (${process.env.USER_TYPE}, ${process.env.VIVUS_CODE_ENTRYPOINT ?? "cli"}${agentSdkVersion}${clientApp}${workloadSuffix})`;
|
|
108145
108145
|
}
|
|
108146
108146
|
function getMCPUserAgent() {
|
|
108147
108147
|
const parts = [];
|
|
@@ -108155,7 +108155,7 @@ function getMCPUserAgent() {
|
|
|
108155
108155
|
parts.push(`client-app/${process.env.VIVUS_AGENT_SDK_CLIENT_APP}`);
|
|
108156
108156
|
}
|
|
108157
108157
|
const suffix = parts.length > 0 ? ` (${parts.join(", ")})` : "";
|
|
108158
|
-
return `vivus/${"1.1.
|
|
108158
|
+
return `vivus/${"1.1.32+82959fe"}${suffix}`;
|
|
108159
108159
|
}
|
|
108160
108160
|
function getWebFetchUserAgent() {
|
|
108161
108161
|
return `Vivus-User (${getVivusCodeUserAgent()}; +https://support.anthropic.com/)`;
|
|
@@ -108293,7 +108293,7 @@ var init_user = __esm(() => {
|
|
|
108293
108293
|
deviceId,
|
|
108294
108294
|
sessionId: getSessionId(),
|
|
108295
108295
|
email: getEmail(),
|
|
108296
|
-
appVersion: "1.1.
|
|
108296
|
+
appVersion: "1.1.32+82959fe",
|
|
108297
108297
|
platform: getHostPlatformForAnalytics(),
|
|
108298
108298
|
organizationUuid,
|
|
108299
108299
|
accountUuid,
|
|
@@ -119604,7 +119604,7 @@ var init_metadata = __esm(() => {
|
|
|
119604
119604
|
COMPOUND_OPERATOR_REGEX = /\s*(?:&&|\|\||[;|])\s*/;
|
|
119605
119605
|
WHITESPACE_REGEX = /\s+/;
|
|
119606
119606
|
getVersionBase = memoize_default(() => {
|
|
119607
|
-
const match = "1.1.
|
|
119607
|
+
const match = "1.1.32+82959fe".match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);
|
|
119608
119608
|
return match ? match[0] : undefined;
|
|
119609
119609
|
});
|
|
119610
119610
|
buildEnvContext = memoize_default(async () => {
|
|
@@ -119644,9 +119644,9 @@ var init_metadata = __esm(() => {
|
|
|
119644
119644
|
isGithubAction: isEnvTruthy(process.env.GITHUB_ACTIONS),
|
|
119645
119645
|
isVivusCodeAction: isEnvTruthy(process.env.VIVUS_CODE_ACTION),
|
|
119646
119646
|
isVivusAiAuth: isVivusAISubscriber(),
|
|
119647
|
-
version: "1.1.
|
|
119647
|
+
version: "1.1.32+82959fe",
|
|
119648
119648
|
versionBase: getVersionBase(),
|
|
119649
|
-
buildTime: "2026-06-
|
|
119649
|
+
buildTime: "2026-06-23T22:31:12.509Z",
|
|
119650
119650
|
deploymentEnvironment: env3.detectDeploymentEnvironment(),
|
|
119651
119651
|
...isEnvTruthy(process.env.GITHUB_ACTIONS) && {
|
|
119652
119652
|
githubEventName: process.env.GITHUB_EVENT_NAME,
|
|
@@ -120314,7 +120314,7 @@ function initialize1PEventLogging() {
|
|
|
120314
120314
|
const platform2 = getPlatform();
|
|
120315
120315
|
const attributes = {
|
|
120316
120316
|
[import_semantic_conventions.ATTR_SERVICE_NAME]: "vivus",
|
|
120317
|
-
[import_semantic_conventions.ATTR_SERVICE_VERSION]: "1.1.
|
|
120317
|
+
[import_semantic_conventions.ATTR_SERVICE_VERSION]: "1.1.32+82959fe"
|
|
120318
120318
|
};
|
|
120319
120319
|
if (platform2 === "wsl") {
|
|
120320
120320
|
const wslVersion = getWslVersion();
|
|
@@ -120341,7 +120341,7 @@ function initialize1PEventLogging() {
|
|
|
120341
120341
|
})
|
|
120342
120342
|
]
|
|
120343
120343
|
});
|
|
120344
|
-
firstPartyEventLogger = firstPartyEventLoggerProvider.getLogger("com.anthropic.vivus_code.events", "1.1.
|
|
120344
|
+
firstPartyEventLogger = firstPartyEventLoggerProvider.getLogger("com.anthropic.vivus_code.events", "1.1.32+82959fe");
|
|
120345
120345
|
}
|
|
120346
120346
|
async function reinitialize1PEventLoggingIfConfigChanged() {
|
|
120347
120347
|
if (!is1PEventLoggingEnabled() || !firstPartyEventLoggerProvider) {
|
|
@@ -162555,7 +162555,7 @@ function getAttributionHeader(fingerprint) {
|
|
|
162555
162555
|
if (!isAttributionHeaderEnabled()) {
|
|
162556
162556
|
return "";
|
|
162557
162557
|
}
|
|
162558
|
-
const version2 = `${"1.1.
|
|
162558
|
+
const version2 = `${"1.1.32+82959fe"}.${fingerprint}`;
|
|
162559
162559
|
const entrypoint = process.env.VIVUS_CODE_ENTRYPOINT ?? "unknown";
|
|
162560
162560
|
const cch = "";
|
|
162561
162561
|
const workload = getWorkload();
|
|
@@ -175718,7 +175718,7 @@ function getTelemetryAttributes() {
|
|
|
175718
175718
|
attributes["session.id"] = sessionId;
|
|
175719
175719
|
}
|
|
175720
175720
|
if (shouldIncludeAttribute("OTEL_METRICS_INCLUDE_VERSION")) {
|
|
175721
|
-
attributes["app.version"] = "1.1.
|
|
175721
|
+
attributes["app.version"] = "1.1.32+82959fe";
|
|
175722
175722
|
}
|
|
175723
175723
|
const oauthAccount = getOauthAccountInfo();
|
|
175724
175724
|
if (oauthAccount) {
|
|
@@ -209212,6 +209212,7 @@ __export(exports_prompt2, {
|
|
|
209212
209212
|
DEFAULT_CHAR_BUDGET: () => DEFAULT_CHAR_BUDGET,
|
|
209213
209213
|
CHARS_PER_TOKEN: () => CHARS_PER_TOKEN
|
|
209214
209214
|
});
|
|
209215
|
+
import { join as join49 } from "path";
|
|
209215
209216
|
function getCharBudget(contextWindowTokens) {
|
|
209216
209217
|
if (Number(process.env.SLASH_COMMAND_TOOL_CHAR_BUDGET)) {
|
|
209217
209218
|
return Number(process.env.SLASH_COMMAND_TOOL_CHAR_BUDGET);
|
|
@@ -209336,10 +209337,12 @@ var init_prompt9 = __esm(() => {
|
|
|
209336
209337
|
init_stringWidth();
|
|
209337
209338
|
init_analytics();
|
|
209338
209339
|
init_debug();
|
|
209340
|
+
init_envUtils();
|
|
209339
209341
|
init_errors();
|
|
209340
209342
|
init_format2();
|
|
209341
209343
|
init_log3();
|
|
209342
209344
|
getPrompt2 = memoize_default(async (_cwd) => {
|
|
209345
|
+
const userSkillsDir = join49(getVivusConfigHomeDir(), "skills");
|
|
209343
209346
|
return `Execute a skill within the main conversation
|
|
209344
209347
|
|
|
209345
209348
|
When users ask you to perform tasks, check if any of the available skills match. Skills provide specialized capabilities and domain knowledge.
|
|
@@ -209354,6 +209357,13 @@ How to invoke:
|
|
|
209354
209357
|
- \`skill: "review-pr", args: "123"\` - invoke with arguments
|
|
209355
209358
|
- \`skill: "ms-office-suite:pdf"\` - invoke using fully qualified name
|
|
209356
209359
|
|
|
209360
|
+
Where skills come from (use this if the user asks where skills/memory live — do NOT guess or run filesystem searches):
|
|
209361
|
+
- Project skills: \`<project>/.vivus/skills/<name>/SKILL.md\` (also \`.codex/skills/\`)
|
|
209362
|
+
- Personal skills: \`${userSkillsDir}/<name>/SKILL.md\`
|
|
209363
|
+
- Plus installed plugins and built-in skills.
|
|
209364
|
+
- Persistent memory lives under \`${join49(getVivusConfigHomeDir(), "projects")}/<project-key>/memory/\`.
|
|
209365
|
+
- These are the ONLY skill/memory locations. Vivus does NOT read \`.github/skills\`, \`.claude/\`, or any other path — if you find a SKILL.md elsewhere it is NOT loaded.
|
|
209366
|
+
|
|
209357
209367
|
Important:
|
|
209358
209368
|
- Available skills are listed in system-reminder messages in the conversation
|
|
209359
209369
|
- When a skill matches the user's request, this is a BLOCKING REQUIREMENT: invoke the relevant Skill tool BEFORE generating any other response about the task
|
|
@@ -209560,7 +209570,7 @@ var init_memoryFileDetection = __esm(() => {
|
|
|
209560
209570
|
});
|
|
209561
209571
|
|
|
209562
209572
|
// src/utils/hooks/fileChangedWatcher.ts
|
|
209563
|
-
import { isAbsolute as isAbsolute10, join as
|
|
209573
|
+
import { isAbsolute as isAbsolute10, join as join50 } from "path";
|
|
209564
209574
|
function setEnvHookNotifier(cb) {
|
|
209565
209575
|
notifyCallback = cb;
|
|
209566
209576
|
}
|
|
@@ -209588,7 +209598,7 @@ function resolveWatchPaths(config3) {
|
|
|
209588
209598
|
for (const name of m.matcher.split("|").map((s) => s.trim())) {
|
|
209589
209599
|
if (!name)
|
|
209590
209600
|
continue;
|
|
209591
|
-
staticPaths.push(isAbsolute10(name) ? name :
|
|
209601
|
+
staticPaths.push(isAbsolute10(name) ? name : join50(currentCwd, name));
|
|
209592
209602
|
}
|
|
209593
209603
|
}
|
|
209594
209604
|
return [...new Set([...staticPaths, ...dynamicWatchPaths])];
|
|
@@ -209848,7 +209858,7 @@ var init_bashPipeCommand = __esm(() => {
|
|
|
209848
209858
|
import { execFile as execFile4 } from "child_process";
|
|
209849
209859
|
import { mkdir as mkdir10, stat as stat20 } from "fs/promises";
|
|
209850
209860
|
import * as os3 from "os";
|
|
209851
|
-
import { join as
|
|
209861
|
+
import { join as join51 } from "path";
|
|
209852
209862
|
function createArgv0ShellFunction(funcName, argv0, binaryPath, prependArgs = []) {
|
|
209853
209863
|
const quotedPath = quote([binaryPath]);
|
|
209854
209864
|
const argSuffix = prependArgs.length > 0 ? `${prependArgs.join(" ")} "$@"` : '"$@"';
|
|
@@ -209904,7 +209914,7 @@ function createFindGrepShellIntegration() {
|
|
|
209904
209914
|
}
|
|
209905
209915
|
function getConfigFile(shellPath) {
|
|
209906
209916
|
const fileName = shellPath.includes("zsh") ? ".zshrc" : shellPath.includes("bash") ? ".bashrc" : ".profile";
|
|
209907
|
-
const configPath =
|
|
209917
|
+
const configPath = join51(os3.homedir(), fileName);
|
|
209908
209918
|
return configPath;
|
|
209909
209919
|
}
|
|
209910
209920
|
function getUserSnapshotContent(configFile) {
|
|
@@ -210058,9 +210068,9 @@ var LITERAL_BACKSLASH = "\\", SNAPSHOT_CREATION_TIMEOUT = 1e4, VCS_DIRECTORIES_T
|
|
|
210058
210068
|
}
|
|
210059
210069
|
const timestamp = Date.now();
|
|
210060
210070
|
const randomId = Math.random().toString(36).substring(2, 8);
|
|
210061
|
-
const snapshotsDir =
|
|
210071
|
+
const snapshotsDir = join51(getVivusConfigHomeDir(), "shell-snapshots");
|
|
210062
210072
|
logForDebugging(`Snapshots directory: ${snapshotsDir}`);
|
|
210063
|
-
const shellSnapshotPath =
|
|
210073
|
+
const shellSnapshotPath = join51(snapshotsDir, `snapshot-${shellType}-${timestamp}-${randomId}.sh`);
|
|
210064
210074
|
await mkdir10(snapshotsDir, { recursive: true });
|
|
210065
210075
|
const snapshotScript = await getSnapshotScript(binShell, shellSnapshotPath, configFileExists);
|
|
210066
210076
|
logForDebugging(`Creating snapshot at: ${shellSnapshotPath}`);
|
|
@@ -211091,7 +211101,7 @@ var init_notebook = __esm(() => {
|
|
|
211091
211101
|
// src/utils/pdf.ts
|
|
211092
211102
|
import { randomUUID as randomUUID8 } from "crypto";
|
|
211093
211103
|
import { mkdir as mkdir12, readdir as readdir11, readFile as readFile13 } from "fs/promises";
|
|
211094
|
-
import { join as
|
|
211104
|
+
import { join as join52 } from "path";
|
|
211095
211105
|
async function readPDF(filePath) {
|
|
211096
211106
|
try {
|
|
211097
211107
|
const fs7 = getFsImplementation();
|
|
@@ -211201,9 +211211,9 @@ async function extractPDFPages(filePath, options2) {
|
|
|
211201
211211
|
};
|
|
211202
211212
|
}
|
|
211203
211213
|
const uuid3 = randomUUID8();
|
|
211204
|
-
const outputDir =
|
|
211214
|
+
const outputDir = join52(getToolResultsDir(), `pdf-${uuid3}`);
|
|
211205
211215
|
await mkdir12(outputDir, { recursive: true });
|
|
211206
|
-
const prefix =
|
|
211216
|
+
const prefix = join52(outputDir, "page");
|
|
211207
211217
|
const args = ["-jpeg", "-r", "100"];
|
|
211208
211218
|
if (options2?.firstPage) {
|
|
211209
211219
|
args.push("-f", String(options2.firstPage));
|
|
@@ -212413,7 +212423,7 @@ var init_validate2 = __esm(() => {
|
|
|
212413
212423
|
// src/keybindings/loadUserBindings.ts
|
|
212414
212424
|
import { readFileSync as readFileSync10 } from "fs";
|
|
212415
212425
|
import { readFile as readFile15, stat as stat22 } from "fs/promises";
|
|
212416
|
-
import { dirname as dirname24, join as
|
|
212426
|
+
import { dirname as dirname24, join as join53 } from "path";
|
|
212417
212427
|
function isKeybindingCustomizationEnabled() {
|
|
212418
212428
|
return getFeatureValue_CACHED_MAY_BE_STALE("tengu_keybinding_customization_release", false);
|
|
212419
212429
|
}
|
|
@@ -212436,7 +212446,7 @@ function isKeybindingBlockArray2(arr) {
|
|
|
212436
212446
|
return Array.isArray(arr) && arr.every(isKeybindingBlock2);
|
|
212437
212447
|
}
|
|
212438
212448
|
function getKeybindingsPath() {
|
|
212439
|
-
return
|
|
212449
|
+
return join53(getVivusConfigHomeDir(), "keybindings.json");
|
|
212440
212450
|
}
|
|
212441
212451
|
function getDefaultParsedBindings() {
|
|
212442
212452
|
return parseBindings(DEFAULT_BINDINGS);
|
|
@@ -215076,7 +215086,7 @@ var init_FileReadTool = __esm(() => {
|
|
|
215076
215086
|
|
|
215077
215087
|
// src/utils/tasks.ts
|
|
215078
215088
|
import { mkdir as mkdir13, readdir as readdir13, readFile as readFile16, unlink as unlink6, writeFile as writeFile9 } from "fs/promises";
|
|
215079
|
-
import { join as
|
|
215089
|
+
import { join as join55 } from "path";
|
|
215080
215090
|
function setLeaderTeamName(teamName) {
|
|
215081
215091
|
if (leaderTeamName === teamName)
|
|
215082
215092
|
return;
|
|
@@ -215095,7 +215105,7 @@ function notifyTasksUpdated() {
|
|
|
215095
215105
|
} catch {}
|
|
215096
215106
|
}
|
|
215097
215107
|
function getHighWaterMarkPath(taskListId) {
|
|
215098
|
-
return
|
|
215108
|
+
return join55(getTasksDir(taskListId), HIGH_WATER_MARK_FILE);
|
|
215099
215109
|
}
|
|
215100
215110
|
async function readHighWaterMark(taskListId) {
|
|
215101
215111
|
const path15 = getHighWaterMarkPath(taskListId);
|
|
@@ -215138,7 +215148,7 @@ async function resetTaskList(taskListId) {
|
|
|
215138
215148
|
}
|
|
215139
215149
|
for (const file2 of files) {
|
|
215140
215150
|
if (file2.endsWith(".json") && !file2.startsWith(".")) {
|
|
215141
|
-
const filePath =
|
|
215151
|
+
const filePath = join55(dir, file2);
|
|
215142
215152
|
try {
|
|
215143
215153
|
await unlink6(filePath);
|
|
215144
215154
|
} catch {}
|
|
@@ -215165,10 +215175,10 @@ function sanitizePathComponent(input) {
|
|
|
215165
215175
|
return input.replace(/[^a-zA-Z0-9_-]/g, "-");
|
|
215166
215176
|
}
|
|
215167
215177
|
function getTasksDir(taskListId) {
|
|
215168
|
-
return
|
|
215178
|
+
return join55(getVivusConfigHomeDir(), "tasks", sanitizePathComponent(taskListId));
|
|
215169
215179
|
}
|
|
215170
215180
|
function getTaskPath(taskListId, taskId) {
|
|
215171
|
-
return
|
|
215181
|
+
return join55(getTasksDir(taskListId), `${sanitizePathComponent(taskId)}.json`);
|
|
215172
215182
|
}
|
|
215173
215183
|
async function ensureTasksDir(taskListId) {
|
|
215174
215184
|
const dir = getTasksDir(taskListId);
|
|
@@ -215345,7 +215355,7 @@ async function blockTask(taskListId, fromTaskId, toTaskId) {
|
|
|
215345
215355
|
return true;
|
|
215346
215356
|
}
|
|
215347
215357
|
function getTaskListLockPath(taskListId) {
|
|
215348
|
-
return
|
|
215358
|
+
return join55(getTasksDir(taskListId), ".lock");
|
|
215349
215359
|
}
|
|
215350
215360
|
async function ensureTaskListLockFile(taskListId) {
|
|
215351
215361
|
await ensureTasksDir(taskListId);
|
|
@@ -233486,7 +233496,7 @@ var init_oauthPort = __esm(() => {
|
|
|
233486
233496
|
import { readdirSync as readdirSync4 } from "fs";
|
|
233487
233497
|
import { stat as stat23 } from "fs/promises";
|
|
233488
233498
|
import { homedir as homedir16, platform as platform2, tmpdir as tmpdir5, userInfo as userInfo3 } from "os";
|
|
233489
|
-
import { join as
|
|
233499
|
+
import { join as join56 } from "path";
|
|
233490
233500
|
function getAllBrowserDataPaths() {
|
|
233491
233501
|
const platform3 = getPlatform();
|
|
233492
233502
|
const home = homedir16();
|
|
@@ -233504,10 +233514,10 @@ function getAllBrowserDataPaths() {
|
|
|
233504
233514
|
break;
|
|
233505
233515
|
case "windows": {
|
|
233506
233516
|
if (config3.windows.dataPath.length > 0) {
|
|
233507
|
-
const appDataBase = config3.windows.useRoaming ?
|
|
233517
|
+
const appDataBase = config3.windows.useRoaming ? join56(home, "AppData", "Roaming") : join56(home, "AppData", "Local");
|
|
233508
233518
|
paths2.push({
|
|
233509
233519
|
browser: browserId,
|
|
233510
|
-
path:
|
|
233520
|
+
path: join56(appDataBase, ...config3.windows.dataPath)
|
|
233511
233521
|
});
|
|
233512
233522
|
}
|
|
233513
233523
|
continue;
|
|
@@ -233516,7 +233526,7 @@ function getAllBrowserDataPaths() {
|
|
|
233516
233526
|
if (dataPath && dataPath.length > 0) {
|
|
233517
233527
|
paths2.push({
|
|
233518
233528
|
browser: browserId,
|
|
233519
|
-
path:
|
|
233529
|
+
path: join56(home, ...dataPath)
|
|
233520
233530
|
});
|
|
233521
233531
|
}
|
|
233522
233532
|
}
|
|
@@ -233533,7 +233543,7 @@ function getAllNativeMessagingHostsDirs() {
|
|
|
233533
233543
|
if (config3.macos.nativeMessagingPath.length > 0) {
|
|
233534
233544
|
paths2.push({
|
|
233535
233545
|
browser: browserId,
|
|
233536
|
-
path:
|
|
233546
|
+
path: join56(home, ...config3.macos.nativeMessagingPath)
|
|
233537
233547
|
});
|
|
233538
233548
|
}
|
|
233539
233549
|
break;
|
|
@@ -233542,7 +233552,7 @@ function getAllNativeMessagingHostsDirs() {
|
|
|
233542
233552
|
if (config3.linux.nativeMessagingPath.length > 0) {
|
|
233543
233553
|
paths2.push({
|
|
233544
233554
|
browser: browserId,
|
|
233545
|
-
path:
|
|
233555
|
+
path: join56(home, ...config3.linux.nativeMessagingPath)
|
|
233546
233556
|
});
|
|
233547
233557
|
}
|
|
233548
233558
|
break;
|
|
@@ -233597,8 +233607,8 @@ async function detectAvailableBrowser() {
|
|
|
233597
233607
|
case "windows": {
|
|
233598
233608
|
const home = homedir16();
|
|
233599
233609
|
if (config3.windows.dataPath.length > 0) {
|
|
233600
|
-
const appDataBase = config3.windows.useRoaming ?
|
|
233601
|
-
const dataPath =
|
|
233610
|
+
const appDataBase = config3.windows.useRoaming ? join56(home, "AppData", "Roaming") : join56(home, "AppData", "Local");
|
|
233611
|
+
const dataPath = join56(appDataBase, ...config3.windows.dataPath);
|
|
233602
233612
|
try {
|
|
233603
233613
|
const stats = await stat23(dataPath);
|
|
233604
233614
|
if (stats.isDirectory()) {
|
|
@@ -233667,7 +233677,7 @@ function getSecureSocketPath() {
|
|
|
233667
233677
|
if (platform2() === "win32") {
|
|
233668
233678
|
return `\\\\.\\pipe\\${getSocketName()}`;
|
|
233669
233679
|
}
|
|
233670
|
-
return
|
|
233680
|
+
return join56(getSocketDir(), `${process.pid}.sock`);
|
|
233671
233681
|
}
|
|
233672
233682
|
function getAllSocketPaths() {
|
|
233673
233683
|
if (platform2() === "win32") {
|
|
@@ -233679,12 +233689,12 @@ function getAllSocketPaths() {
|
|
|
233679
233689
|
const files = readdirSync4(socketDir);
|
|
233680
233690
|
for (const file2 of files) {
|
|
233681
233691
|
if (file2.endsWith(".sock")) {
|
|
233682
|
-
paths2.push(
|
|
233692
|
+
paths2.push(join56(socketDir, file2));
|
|
233683
233693
|
}
|
|
233684
233694
|
}
|
|
233685
233695
|
} catch {}
|
|
233686
233696
|
const legacyName = `vivus-mcp-browser-bridge-${getUsername2()}`;
|
|
233687
|
-
const legacyTmpdir =
|
|
233697
|
+
const legacyTmpdir = join56(tmpdir5(), legacyName);
|
|
233688
233698
|
const legacyTmp = `/tmp/${legacyName}`;
|
|
233689
233699
|
if (!paths2.includes(legacyTmpdir)) {
|
|
233690
233700
|
paths2.push(legacyTmpdir);
|
|
@@ -233919,7 +233929,7 @@ function expandEnvVarsInString(value) {
|
|
|
233919
233929
|
}
|
|
233920
233930
|
|
|
233921
233931
|
// src/utils/plugins/mcpPluginIntegration.ts
|
|
233922
|
-
import { join as
|
|
233932
|
+
import { join as join57 } from "path";
|
|
233923
233933
|
async function loadMcpServersFromMcpb(plugin, mcpbPath, errors4) {
|
|
233924
233934
|
try {
|
|
233925
233935
|
logForDebugging(`Loading MCP servers from MCPB: ${mcpbPath}`);
|
|
@@ -234018,7 +234028,7 @@ async function loadPluginMcpServers(plugin, errors4 = []) {
|
|
|
234018
234028
|
}
|
|
234019
234029
|
async function loadMcpServersFromFile(pluginPath, relativePath) {
|
|
234020
234030
|
const fs7 = getFsImplementation();
|
|
234021
|
-
const filePath =
|
|
234031
|
+
const filePath = join57(pluginPath, relativePath);
|
|
234022
234032
|
let content;
|
|
234023
234033
|
try {
|
|
234024
234034
|
content = await fs7.readFile(filePath, { encoding: "utf-8" });
|
|
@@ -234309,9 +234319,9 @@ var init_vivusai = __esm(() => {
|
|
|
234309
234319
|
|
|
234310
234320
|
// src/services/mcp/config.ts
|
|
234311
234321
|
import { chmod as chmod4, open as open7, rename as rename4, stat as stat24, unlink as unlink7 } from "fs/promises";
|
|
234312
|
-
import { dirname as dirname25, join as
|
|
234322
|
+
import { dirname as dirname25, join as join58, parse as parse8 } from "path";
|
|
234313
234323
|
function getEnterpriseMcpFilePath() {
|
|
234314
|
-
return
|
|
234324
|
+
return join58(getManagedFilePath(), "managed-mcp.json");
|
|
234315
234325
|
}
|
|
234316
234326
|
function addScopeToServers(servers, scope) {
|
|
234317
234327
|
if (!servers) {
|
|
@@ -234324,7 +234334,7 @@ function addScopeToServers(servers, scope) {
|
|
|
234324
234334
|
return scopedServers;
|
|
234325
234335
|
}
|
|
234326
234336
|
async function writeMcpjsonFile(config3) {
|
|
234327
|
-
const mcpJsonPath =
|
|
234337
|
+
const mcpJsonPath = join58(getCwd(), ".mcp.json");
|
|
234328
234338
|
let existingMode;
|
|
234329
234339
|
try {
|
|
234330
234340
|
const stats = await stat24(mcpJsonPath);
|
|
@@ -234775,7 +234785,7 @@ function getProjectMcpConfigsFromCwd() {
|
|
|
234775
234785
|
if (!isSettingSourceEnabled("projectSettings")) {
|
|
234776
234786
|
return { servers: {}, errors: [] };
|
|
234777
234787
|
}
|
|
234778
|
-
const mcpJsonPath =
|
|
234788
|
+
const mcpJsonPath = join58(getCwd(), ".mcp.json");
|
|
234779
234789
|
const { config: config3, errors: errors4 } = parseMcpConfigFromFilePath({
|
|
234780
234790
|
filePath: mcpJsonPath,
|
|
234781
234791
|
expandVars: true,
|
|
@@ -234814,7 +234824,7 @@ function getMcpConfigsByScope(scope) {
|
|
|
234814
234824
|
currentDir = dirname25(currentDir);
|
|
234815
234825
|
}
|
|
234816
234826
|
for (const dir of dirs.reverse()) {
|
|
234817
|
-
const mcpJsonPath =
|
|
234827
|
+
const mcpJsonPath = join58(dir, ".mcp.json");
|
|
234818
234828
|
const { config: config3, errors: errors4 } = parseMcpConfigFromFilePath({
|
|
234819
234829
|
filePath: mcpJsonPath,
|
|
234820
234830
|
expandVars: true,
|
|
@@ -235236,7 +235246,7 @@ var init_config2 = __esm(() => {
|
|
|
235236
235246
|
|
|
235237
235247
|
// src/services/mcp/utils.ts
|
|
235238
235248
|
import { createHash as createHash9 } from "crypto";
|
|
235239
|
-
import { join as
|
|
235249
|
+
import { join as join59 } from "path";
|
|
235240
235250
|
function filterToolsByServer(tools, serverName) {
|
|
235241
235251
|
const prefix = `mcp__${normalizeNameForMCP(serverName)}__`;
|
|
235242
235252
|
return tools.filter((tool) => tool.name?.startsWith(prefix));
|
|
@@ -235314,7 +235324,7 @@ function describeMcpConfigFilePath(scope) {
|
|
|
235314
235324
|
case "user":
|
|
235315
235325
|
return getGlobalVivusFile();
|
|
235316
235326
|
case "project":
|
|
235317
|
-
return
|
|
235327
|
+
return join59(getCwd(), ".mcp.json");
|
|
235318
235328
|
case "local":
|
|
235319
235329
|
return `${getGlobalVivusFile()} [project: ${getCwd()}]`;
|
|
235320
235330
|
case "dynamic":
|
|
@@ -236027,7 +236037,7 @@ var init_xaaIdpLogin = __esm(() => {
|
|
|
236027
236037
|
import { createHash as createHash10, randomBytes as randomBytes9, randomUUID as randomUUID9 } from "crypto";
|
|
236028
236038
|
import { mkdir as mkdir14 } from "fs/promises";
|
|
236029
236039
|
import { createServer as createServer5 } from "http";
|
|
236030
|
-
import { join as
|
|
236040
|
+
import { join as join60 } from "path";
|
|
236031
236041
|
import { parse as parse10 } from "url";
|
|
236032
236042
|
function redactSensitiveUrlParams(url3) {
|
|
236033
236043
|
try {
|
|
@@ -237139,7 +237149,7 @@ class VivusAuthProvider {
|
|
|
237139
237149
|
const vivusDir = getVivusConfigHomeDir();
|
|
237140
237150
|
await mkdir14(vivusDir, { recursive: true });
|
|
237141
237151
|
const sanitizedKey = serverKey.replace(/[^a-zA-Z0-9]/g, "_");
|
|
237142
|
-
const lockfilePath =
|
|
237152
|
+
const lockfilePath = join60(vivusDir, `mcp-refresh-${sanitizedKey}.lock`);
|
|
237143
237153
|
let release;
|
|
237144
237154
|
for (let retry = 0;retry < MAX_LOCK_RETRIES; retry++) {
|
|
237145
237155
|
try {
|
|
@@ -237558,7 +237568,7 @@ var init_McpAuthTool = __esm(() => {
|
|
|
237558
237568
|
|
|
237559
237569
|
// src/utils/mcpOutputStorage.ts
|
|
237560
237570
|
import { writeFile as writeFile10 } from "fs/promises";
|
|
237561
|
-
import { join as
|
|
237571
|
+
import { join as join61 } from "path";
|
|
237562
237572
|
function getFormatDescription(type, schema) {
|
|
237563
237573
|
switch (type) {
|
|
237564
237574
|
case "toolResult":
|
|
@@ -237655,7 +237665,7 @@ function isBinaryContentType(contentType) {
|
|
|
237655
237665
|
async function persistBinaryContent(bytes, mimeType, persistId) {
|
|
237656
237666
|
await ensureToolResultsDir();
|
|
237657
237667
|
const ext = extensionForMimeType(mimeType);
|
|
237658
|
-
const filepath =
|
|
237668
|
+
const filepath = join61(getToolResultsDir(), `${persistId}.${ext}`);
|
|
237659
237669
|
try {
|
|
237660
237670
|
await writeFile10(filepath, bytes);
|
|
237661
237671
|
} catch (error41) {
|
|
@@ -242278,7 +242288,7 @@ function computeFingerprint(messageText, version2) {
|
|
|
242278
242288
|
}
|
|
242279
242289
|
function computeFingerprintFromMessages(messages) {
|
|
242280
242290
|
const firstMessageText = extractFirstMessageText(messages);
|
|
242281
|
-
return computeFingerprint(firstMessageText, "1.1.
|
|
242291
|
+
return computeFingerprint(firstMessageText, "1.1.32+82959fe");
|
|
242282
242292
|
}
|
|
242283
242293
|
var FINGERPRINT_SALT = "59cf53e54c78";
|
|
242284
242294
|
var init_fingerprint = () => {};
|
|
@@ -242320,7 +242330,7 @@ async function sideQuery(opts) {
|
|
|
242320
242330
|
betas.push(STRUCTURED_OUTPUTS_BETA_HEADER);
|
|
242321
242331
|
}
|
|
242322
242332
|
const messageText = extractFirstUserMessageText(messages);
|
|
242323
|
-
const fingerprint = computeFingerprint(messageText, "1.1.
|
|
242333
|
+
const fingerprint = computeFingerprint(messageText, "1.1.32+82959fe");
|
|
242324
242334
|
const attributionHeader = getAttributionHeader(fingerprint);
|
|
242325
242335
|
const systemBlocks = [
|
|
242326
242336
|
attributionHeader ? { type: "text", text: attributionHeader } : null,
|
|
@@ -242629,7 +242639,7 @@ function createLinkedTransportPair() {
|
|
|
242629
242639
|
|
|
242630
242640
|
// src/services/mcp/client.ts
|
|
242631
242641
|
import { mkdir as mkdir15, readFile as readFile17, unlink as unlink8, writeFile as writeFile11 } from "fs/promises";
|
|
242632
|
-
import { dirname as dirname26, join as
|
|
242642
|
+
import { dirname as dirname26, join as join62 } from "path";
|
|
242633
242643
|
function isMcpSessionExpiredError(error41) {
|
|
242634
242644
|
const httpStatus = "code" in error41 ? error41.code : undefined;
|
|
242635
242645
|
if (httpStatus !== 404) {
|
|
@@ -242641,7 +242651,7 @@ function getMcpToolTimeoutMs() {
|
|
|
242641
242651
|
return parseInt(process.env.MCP_TOOL_TIMEOUT || "", 10) || DEFAULT_MCP_TOOL_TIMEOUT_MS;
|
|
242642
242652
|
}
|
|
242643
242653
|
function getMcpAuthCachePath() {
|
|
242644
|
-
return
|
|
242654
|
+
return join62(getVivusConfigHomeDir(), "mcp-needs-auth-cache.json");
|
|
242645
242655
|
}
|
|
242646
242656
|
function getMcpAuthCache() {
|
|
242647
242657
|
if (!authCachePromise) {
|
|
@@ -243472,7 +243482,7 @@ async function setupSdkMcpClients(sdkMcpConfigs, sendMcpMessage) {
|
|
|
243472
243482
|
const client2 = new Client({
|
|
243473
243483
|
name: "vivus",
|
|
243474
243484
|
title: "Vivus",
|
|
243475
|
-
version: "1.1.
|
|
243485
|
+
version: "1.1.32+82959fe",
|
|
243476
243486
|
description: "Anthropic's agentic coding tool",
|
|
243477
243487
|
websiteUrl: PRODUCT_URL
|
|
243478
243488
|
}, {
|
|
@@ -243826,7 +243836,7 @@ var init_client6 = __esm(() => {
|
|
|
243826
243836
|
const client2 = new Client({
|
|
243827
243837
|
name: "vivus",
|
|
243828
243838
|
title: "Vivus",
|
|
243829
|
-
version: "1.1.
|
|
243839
|
+
version: "1.1.32+82959fe",
|
|
243830
243840
|
description: "Anthropic's agentic coding tool",
|
|
243831
243841
|
websiteUrl: PRODUCT_URL
|
|
243832
243842
|
}, {
|
|
@@ -244461,7 +244471,7 @@ var init_client6 = __esm(() => {
|
|
|
244461
244471
|
|
|
244462
244472
|
// src/utils/jetbrains.ts
|
|
244463
244473
|
import { homedir as homedir17, platform as platform3 } from "os";
|
|
244464
|
-
import { join as
|
|
244474
|
+
import { join as join63 } from "path";
|
|
244465
244475
|
function buildCommonPluginDirectoryPaths(ideName) {
|
|
244466
244476
|
const homeDir = homedir17();
|
|
244467
244477
|
const directories = [];
|
|
@@ -244469,28 +244479,28 @@ function buildCommonPluginDirectoryPaths(ideName) {
|
|
|
244469
244479
|
if (!idePatterns) {
|
|
244470
244480
|
return directories;
|
|
244471
244481
|
}
|
|
244472
|
-
const appData = process.env.APPDATA ||
|
|
244473
|
-
const localAppData = process.env.LOCALAPPDATA ||
|
|
244482
|
+
const appData = process.env.APPDATA || join63(homeDir, "AppData", "Roaming");
|
|
244483
|
+
const localAppData = process.env.LOCALAPPDATA || join63(homeDir, "AppData", "Local");
|
|
244474
244484
|
switch (platform3()) {
|
|
244475
244485
|
case "darwin":
|
|
244476
|
-
directories.push(
|
|
244486
|
+
directories.push(join63(homeDir, "Library", "Application Support", "JetBrains"), join63(homeDir, "Library", "Application Support"));
|
|
244477
244487
|
if (ideName.toLowerCase() === "androidstudio") {
|
|
244478
|
-
directories.push(
|
|
244488
|
+
directories.push(join63(homeDir, "Library", "Application Support", "Google"));
|
|
244479
244489
|
}
|
|
244480
244490
|
break;
|
|
244481
244491
|
case "win32":
|
|
244482
|
-
directories.push(
|
|
244492
|
+
directories.push(join63(appData, "JetBrains"), join63(localAppData, "JetBrains"), join63(appData));
|
|
244483
244493
|
if (ideName.toLowerCase() === "androidstudio") {
|
|
244484
|
-
directories.push(
|
|
244494
|
+
directories.push(join63(localAppData, "Google"));
|
|
244485
244495
|
}
|
|
244486
244496
|
break;
|
|
244487
244497
|
case "linux":
|
|
244488
|
-
directories.push(
|
|
244498
|
+
directories.push(join63(homeDir, ".config", "JetBrains"), join63(homeDir, ".local", "share", "JetBrains"));
|
|
244489
244499
|
for (const pattern of idePatterns) {
|
|
244490
|
-
directories.push(
|
|
244500
|
+
directories.push(join63(homeDir, "." + pattern));
|
|
244491
244501
|
}
|
|
244492
244502
|
if (ideName.toLowerCase() === "androidstudio") {
|
|
244493
|
-
directories.push(
|
|
244503
|
+
directories.push(join63(homeDir, ".config", "Google"));
|
|
244494
244504
|
}
|
|
244495
244505
|
break;
|
|
244496
244506
|
default:
|
|
@@ -244516,12 +244526,12 @@ async function detectPluginDirectories(ideName) {
|
|
|
244516
244526
|
continue;
|
|
244517
244527
|
if (!entry.isDirectory() && !entry.isSymbolicLink())
|
|
244518
244528
|
continue;
|
|
244519
|
-
const dir =
|
|
244529
|
+
const dir = join63(baseDir, entry.name);
|
|
244520
244530
|
if (platform3() === "linux") {
|
|
244521
244531
|
foundDirectories.push(dir);
|
|
244522
244532
|
continue;
|
|
244523
244533
|
}
|
|
244524
|
-
const pluginDir =
|
|
244534
|
+
const pluginDir = join63(dir, "plugins");
|
|
244525
244535
|
try {
|
|
244526
244536
|
await fs7.stat(pluginDir);
|
|
244527
244537
|
foundDirectories.push(pluginDir);
|
|
@@ -244537,7 +244547,7 @@ async function detectPluginDirectories(ideName) {
|
|
|
244537
244547
|
async function isJetBrainsPluginInstalled(ideType) {
|
|
244538
244548
|
const pluginDirs = await detectPluginDirectories(ideType);
|
|
244539
244549
|
for (const dir of pluginDirs) {
|
|
244540
|
-
const pluginPath =
|
|
244550
|
+
const pluginPath = join63(dir, PLUGIN_PREFIX);
|
|
244541
244551
|
try {
|
|
244542
244552
|
await getFsImplementation().stat(pluginPath);
|
|
244543
244553
|
return true;
|
|
@@ -245474,7 +245484,7 @@ var init_IdeOnboardingDialog = __esm(() => {
|
|
|
245474
245484
|
// src/utils/ide.ts
|
|
245475
245485
|
import { createConnection } from "net";
|
|
245476
245486
|
import * as os4 from "os";
|
|
245477
|
-
import { basename as basename12, join as
|
|
245487
|
+
import { basename as basename12, join as join64, sep as pathSeparator, resolve as resolve21 } from "path";
|
|
245478
245488
|
function isProcessRunning2(pid) {
|
|
245479
245489
|
try {
|
|
245480
245490
|
process.kill(pid, 0);
|
|
@@ -245518,7 +245528,7 @@ async function getSortedIdeLockfiles() {
|
|
|
245518
245528
|
const entries = await getFsImplementation().readdir(ideLockFilePath);
|
|
245519
245529
|
const lockEntries = entries.filter((file2) => file2.name.endsWith(".lock"));
|
|
245520
245530
|
const stats = await Promise.all(lockEntries.map(async (file2) => {
|
|
245521
|
-
const fullPath =
|
|
245531
|
+
const fullPath = join64(ideLockFilePath, file2.name);
|
|
245522
245532
|
try {
|
|
245523
245533
|
const fileStat = await getFsImplementation().stat(fullPath);
|
|
245524
245534
|
return { path: fullPath, mtime: fileStat.mtime };
|
|
@@ -245608,7 +245618,10 @@ async function checkIdeConnection(host, port, timeout = 500) {
|
|
|
245608
245618
|
}
|
|
245609
245619
|
}
|
|
245610
245620
|
async function getIdeLockfilesPaths() {
|
|
245611
|
-
const paths2 = [
|
|
245621
|
+
const paths2 = [
|
|
245622
|
+
join64(getVivusConfigHomeDir(), "ide"),
|
|
245623
|
+
join64(os4.homedir(), ".claude", "ide")
|
|
245624
|
+
];
|
|
245612
245625
|
if (getPlatform() !== "wsl") {
|
|
245613
245626
|
return paths2;
|
|
245614
245627
|
}
|
|
@@ -245628,7 +245641,7 @@ async function getIdeLockfilesPaths() {
|
|
|
245628
245641
|
if (user.name === "Public" || user.name === "Default" || user.name === "Default User" || user.name === "All Users") {
|
|
245629
245642
|
continue;
|
|
245630
245643
|
}
|
|
245631
|
-
paths2.push(
|
|
245644
|
+
paths2.push(join64(usersDir, user.name, ".vivus", "ide"));
|
|
245632
245645
|
}
|
|
245633
245646
|
} catch (error41) {
|
|
245634
245647
|
if (isFsInaccessible(error41)) {
|
|
@@ -245841,7 +245854,7 @@ async function isIDEExtensionInstalled(ideType) {
|
|
|
245841
245854
|
const result = await execFileNoThrowWithCwd(command, ["--list-extensions"], {
|
|
245842
245855
|
env: getInstallationEnv()
|
|
245843
245856
|
});
|
|
245844
|
-
if (result.stdout?.includes(
|
|
245857
|
+
if (COMPATIBLE_VSCODE_EXTENSION_IDS.some((id) => result.stdout?.includes(id))) {
|
|
245845
245858
|
return true;
|
|
245846
245859
|
}
|
|
245847
245860
|
} catch {}
|
|
@@ -245859,9 +245872,9 @@ async function installIDEExtension(ideType) {
|
|
|
245859
245872
|
return await installFromArtifactory(command);
|
|
245860
245873
|
}
|
|
245861
245874
|
let version2 = await getInstalledVSCodeExtensionVersion(command);
|
|
245862
|
-
if (!version2
|
|
245875
|
+
if (!version2) {
|
|
245863
245876
|
await sleep2(500);
|
|
245864
|
-
const result = await execFileNoThrowWithCwd(command, ["--force", "--install-extension", "
|
|
245877
|
+
const result = await execFileNoThrowWithCwd(command, ["--force", "--install-extension", "vivusai.vivus-agent"], {
|
|
245865
245878
|
env: getInstallationEnv()
|
|
245866
245879
|
});
|
|
245867
245880
|
if (result.code !== 0) {
|
|
@@ -245884,7 +245897,7 @@ function getInstallationEnv() {
|
|
|
245884
245897
|
return;
|
|
245885
245898
|
}
|
|
245886
245899
|
function getVivusCodeVersion() {
|
|
245887
|
-
return "1.1.
|
|
245900
|
+
return "1.1.32+82959fe";
|
|
245888
245901
|
}
|
|
245889
245902
|
async function getInstalledVSCodeExtensionVersion(command) {
|
|
245890
245903
|
const { stdout } = await execFileNoThrow(command, ["--list-extensions", "--show-versions"], {
|
|
@@ -245894,7 +245907,7 @@ async function getInstalledVSCodeExtensionVersion(command) {
|
|
|
245894
245907
|
`) || [];
|
|
245895
245908
|
for (const line of lines) {
|
|
245896
245909
|
const [extensionId, version2] = line.split("@");
|
|
245897
|
-
if (extensionId
|
|
245910
|
+
if (extensionId && COMPATIBLE_VSCODE_EXTENSION_IDS.includes(extensionId) && version2) {
|
|
245898
245911
|
return version2;
|
|
245899
245912
|
}
|
|
245900
245913
|
}
|
|
@@ -246112,7 +246125,7 @@ async function initializeIdeIntegration(onIdeDetected, ideToInstallExtension, on
|
|
|
246112
246125
|
}
|
|
246113
246126
|
}
|
|
246114
246127
|
async function installFromArtifactory(command) {
|
|
246115
|
-
const npmrcPath =
|
|
246128
|
+
const npmrcPath = join64(os4.homedir(), ".npmrc");
|
|
246116
246129
|
let authToken = null;
|
|
246117
246130
|
const fs7 = getFsImplementation();
|
|
246118
246131
|
try {
|
|
@@ -246147,7 +246160,7 @@ async function installFromArtifactory(command) {
|
|
|
246147
246160
|
throw new Error("No version found in artifactory response");
|
|
246148
246161
|
}
|
|
246149
246162
|
const vsixUrl = `https://artifactory.infra.ant.dev/artifactory/armorcode-vivus-internal/vivus-vscode-releases/${version2}/vivus.vsix`;
|
|
246150
|
-
const tempVsixPath =
|
|
246163
|
+
const tempVsixPath = join64(os4.tmpdir(), `vivus-${version2}-${Date.now()}.vsix`);
|
|
246151
246164
|
try {
|
|
246152
246165
|
const vsixResponse = await axios_default.get(vsixUrl, {
|
|
246153
246166
|
headers: {
|
|
@@ -246181,7 +246194,7 @@ async function installFromArtifactory(command) {
|
|
|
246181
246194
|
throw error41;
|
|
246182
246195
|
}
|
|
246183
246196
|
}
|
|
246184
|
-
var ideOnboardingDialog = () => (init_IdeOnboardingDialog(), __toCommonJS(exports_IdeOnboardingDialog)), supportedIdeConfigs, isSupportedVSCodeTerminal, isSupportedJetBrainsTerminal, isSupportedTerminal, getWindowsUserProfile, currentIDESearch = null, EXTENSION_ID, cachedRunningIDEs = null, EDITOR_DISPLAY_NAMES, detectHostIP;
|
|
246197
|
+
var ideOnboardingDialog = () => (init_IdeOnboardingDialog(), __toCommonJS(exports_IdeOnboardingDialog)), supportedIdeConfigs, isSupportedVSCodeTerminal, isSupportedJetBrainsTerminal, isSupportedTerminal, getWindowsUserProfile, currentIDESearch = null, EXTENSION_ID, COMPATIBLE_VSCODE_EXTENSION_IDS, cachedRunningIDEs = null, EDITOR_DISPLAY_NAMES, detectHostIP;
|
|
246185
246198
|
var init_ide = __esm(() => {
|
|
246186
246199
|
init_axios2();
|
|
246187
246200
|
init_execa();
|
|
@@ -246357,6 +246370,11 @@ var init_ide = __esm(() => {
|
|
|
246357
246370
|
return;
|
|
246358
246371
|
});
|
|
246359
246372
|
EXTENSION_ID = process.env.USER_TYPE === "ant" ? "anthropic.vivus-internal" : "anthropic.vivus";
|
|
246373
|
+
COMPATIBLE_VSCODE_EXTENSION_IDS = [
|
|
246374
|
+
EXTENSION_ID,
|
|
246375
|
+
"vivusai.vivus-agent",
|
|
246376
|
+
"anthropic.claude-code"
|
|
246377
|
+
];
|
|
246360
246378
|
EDITOR_DISPLAY_NAMES = {
|
|
246361
246379
|
code: "VS Code",
|
|
246362
246380
|
cursor: "Cursor",
|
|
@@ -248189,13 +248207,13 @@ var init_memoryTypes = __esm(() => {
|
|
|
248189
248207
|
|
|
248190
248208
|
// src/memdir/memoryScan.ts
|
|
248191
248209
|
import { readdir as readdir14 } from "fs/promises";
|
|
248192
|
-
import { basename as basename13, join as
|
|
248210
|
+
import { basename as basename13, join as join65 } from "path";
|
|
248193
248211
|
async function scanMemoryFiles(memoryDir, signal) {
|
|
248194
248212
|
try {
|
|
248195
248213
|
const entries = await readdir14(memoryDir, { recursive: true });
|
|
248196
248214
|
const mdFiles = entries.filter((f) => f.endsWith(".md") && basename13(f) !== "MEMORY.md");
|
|
248197
248215
|
const headerResults = await Promise.allSettled(mdFiles.map(async (relativePath) => {
|
|
248198
|
-
const filePath =
|
|
248216
|
+
const filePath = join65(memoryDir, relativePath);
|
|
248199
248217
|
const { content, mtimeMs } = await readFileInRange(filePath, 0, FRONTMATTER_MAX_LINES, undefined, signal);
|
|
248200
248218
|
const { frontmatter } = parseFrontmatter(content, filePath);
|
|
248201
248219
|
return {
|
|
@@ -249396,20 +249414,20 @@ __export(exports_teammateMailbox, {
|
|
|
249396
249414
|
ModeSetRequestMessageSchema: () => ModeSetRequestMessageSchema
|
|
249397
249415
|
});
|
|
249398
249416
|
import { mkdir as mkdir16, readFile as readFile18, writeFile as writeFile12 } from "fs/promises";
|
|
249399
|
-
import { join as
|
|
249417
|
+
import { join as join66 } from "path";
|
|
249400
249418
|
function getInboxPath(agentName, teamName) {
|
|
249401
249419
|
const team = teamName || getTeamName() || "default";
|
|
249402
249420
|
const safeTeam = sanitizePathComponent(team);
|
|
249403
249421
|
const safeAgentName = sanitizePathComponent(agentName);
|
|
249404
|
-
const inboxDir =
|
|
249405
|
-
const fullPath =
|
|
249422
|
+
const inboxDir = join66(getTeamsDir(), safeTeam, "inboxes");
|
|
249423
|
+
const fullPath = join66(inboxDir, `${safeAgentName}.json`);
|
|
249406
249424
|
logForDebugging(`[TeammateMailbox] getInboxPath: agent=${agentName}, team=${team}, fullPath=${fullPath}`);
|
|
249407
249425
|
return fullPath;
|
|
249408
249426
|
}
|
|
249409
249427
|
async function ensureInboxDir(teamName) {
|
|
249410
249428
|
const team = teamName || getTeamName() || "default";
|
|
249411
249429
|
const safeTeam = sanitizePathComponent(team);
|
|
249412
|
-
const inboxDir =
|
|
249430
|
+
const inboxDir = join66(getTeamsDir(), safeTeam, "inboxes");
|
|
249413
249431
|
await mkdir16(inboxDir, { recursive: true });
|
|
249414
249432
|
logForDebugging(`[TeammateMailbox] Ensured inbox directory: ${inboxDir}`);
|
|
249415
249433
|
}
|
|
@@ -253006,7 +253024,7 @@ var init_compact = __esm(() => {
|
|
|
253006
253024
|
// src/services/api/dumpPrompts.ts
|
|
253007
253025
|
import { createHash as createHash13 } from "crypto";
|
|
253008
253026
|
import { promises as fs7 } from "fs";
|
|
253009
|
-
import { dirname as dirname27, join as
|
|
253027
|
+
import { dirname as dirname27, join as join67 } from "path";
|
|
253010
253028
|
function hashString3(str2) {
|
|
253011
253029
|
return createHash13("sha256").update(str2).digest("hex");
|
|
253012
253030
|
}
|
|
@@ -253028,7 +253046,7 @@ function addApiRequestToCache(requestData) {
|
|
|
253028
253046
|
}
|
|
253029
253047
|
}
|
|
253030
253048
|
function getDumpPromptsPath(agentIdOrSessionId) {
|
|
253031
|
-
return
|
|
253049
|
+
return join67(getVivusConfigHomeDir(), "dump-prompts", `${agentIdOrSessionId ?? getSessionId()}.jsonl`);
|
|
253032
253050
|
}
|
|
253033
253051
|
function appendToFile(filePath, entries) {
|
|
253034
253052
|
if (entries.length === 0)
|
|
@@ -256230,7 +256248,7 @@ var init_types7 = __esm(() => {
|
|
|
256230
256248
|
import { createHash as createHash14 } from "crypto";
|
|
256231
256249
|
import { readFileSync as fsReadFileSync } from "fs";
|
|
256232
256250
|
import { unlink as unlink9, writeFile as writeFile13 } from "fs/promises";
|
|
256233
|
-
import { join as
|
|
256251
|
+
import { join as join68 } from "path";
|
|
256234
256252
|
function isNodeError(e) {
|
|
256235
256253
|
return e instanceof Error;
|
|
256236
256254
|
}
|
|
@@ -256252,7 +256270,7 @@ function initializePolicyLimitsLoadingPromise() {
|
|
|
256252
256270
|
}
|
|
256253
256271
|
}
|
|
256254
256272
|
function getCachePath2() {
|
|
256255
|
-
return
|
|
256273
|
+
return join68(getVivusConfigHomeDir(), CACHE_FILENAME);
|
|
256256
256274
|
}
|
|
256257
256275
|
function getPolicyLimitsEndpoint() {
|
|
256258
256276
|
return `${getOauthConfig().BASE_API_URL}/api/vivus_code/policy_limits`;
|
|
@@ -256617,15 +256635,15 @@ var init_policyLimits = __esm(() => {
|
|
|
256617
256635
|
|
|
256618
256636
|
// src/utils/imagePaste.ts
|
|
256619
256637
|
import { randomBytes as randomBytes11 } from "crypto";
|
|
256620
|
-
import { basename as basename14, extname as extname6, isAbsolute as isAbsolute12, join as
|
|
256638
|
+
import { basename as basename14, extname as extname6, isAbsolute as isAbsolute12, join as join69 } from "path";
|
|
256621
256639
|
function getClipboardCommands() {
|
|
256622
256640
|
const platform4 = process.platform;
|
|
256623
256641
|
const baseTmpDir = process.env.VIVUS_CODE_TMPDIR || (platform4 === "win32" ? process.env.TEMP || "C:\\Temp" : "/tmp");
|
|
256624
256642
|
const screenshotFilename = "vivus_cli_latest_screenshot.png";
|
|
256625
256643
|
const tempPaths = {
|
|
256626
|
-
darwin:
|
|
256627
|
-
linux:
|
|
256628
|
-
win32:
|
|
256644
|
+
darwin: join69(baseTmpDir, screenshotFilename),
|
|
256645
|
+
linux: join69(baseTmpDir, screenshotFilename),
|
|
256646
|
+
win32: join69(baseTmpDir, screenshotFilename)
|
|
256629
256647
|
};
|
|
256630
256648
|
const screenshotPath = tempPaths[platform4] || tempPaths.linux;
|
|
256631
256649
|
const commands = {
|
|
@@ -256804,9 +256822,9 @@ var init_imagePaste = __esm(() => {
|
|
|
256804
256822
|
|
|
256805
256823
|
// src/utils/imageStore.ts
|
|
256806
256824
|
import { mkdir as mkdir17, open as open8 } from "fs/promises";
|
|
256807
|
-
import { join as
|
|
256825
|
+
import { join as join70 } from "path";
|
|
256808
256826
|
function getImageStoreDir() {
|
|
256809
|
-
return
|
|
256827
|
+
return join70(getVivusConfigHomeDir(), IMAGE_STORE_DIR, getSessionId());
|
|
256810
256828
|
}
|
|
256811
256829
|
async function ensureImageStoreDir() {
|
|
256812
256830
|
const dir = getImageStoreDir();
|
|
@@ -256814,7 +256832,7 @@ async function ensureImageStoreDir() {
|
|
|
256814
256832
|
}
|
|
256815
256833
|
function getImagePath(imageId, mediaType) {
|
|
256816
256834
|
const extension2 = mediaType.split("/")[1] || "png";
|
|
256817
|
-
return
|
|
256835
|
+
return join70(getImageStoreDir(), `${imageId}.${extension2}`);
|
|
256818
256836
|
}
|
|
256819
256837
|
function cacheImagePath(content) {
|
|
256820
256838
|
if (content.type !== "image") {
|
|
@@ -256878,7 +256896,7 @@ function evictOldestIfAtCap() {
|
|
|
256878
256896
|
}
|
|
256879
256897
|
async function cleanupOldImageCaches() {
|
|
256880
256898
|
const fsImpl = getFsImplementation();
|
|
256881
|
-
const baseDir =
|
|
256899
|
+
const baseDir = join70(getVivusConfigHomeDir(), IMAGE_STORE_DIR);
|
|
256882
256900
|
const currentSessionId = getSessionId();
|
|
256883
256901
|
try {
|
|
256884
256902
|
let sessionDirs;
|
|
@@ -256891,7 +256909,7 @@ async function cleanupOldImageCaches() {
|
|
|
256891
256909
|
if (sessionDir.name === currentSessionId) {
|
|
256892
256910
|
continue;
|
|
256893
256911
|
}
|
|
256894
|
-
const sessionPath =
|
|
256912
|
+
const sessionPath = join70(baseDir, sessionDir.name);
|
|
256895
256913
|
try {
|
|
256896
256914
|
await fsImpl.rm(sessionPath, { recursive: true, force: true });
|
|
256897
256915
|
logForDebugging(`Cleaned up old image cache: ${sessionPath}`);
|
|
@@ -257255,9 +257273,9 @@ function isInputModeCharacter(input) {
|
|
|
257255
257273
|
}
|
|
257256
257274
|
|
|
257257
257275
|
// src/projectOnboardingState.ts
|
|
257258
|
-
import { join as
|
|
257276
|
+
import { join as join71 } from "path";
|
|
257259
257277
|
function getSteps() {
|
|
257260
|
-
const hasVivusMd = getFsImplementation().existsSync(
|
|
257278
|
+
const hasVivusMd = getFsImplementation().existsSync(join71(getCwd(), "VIVUS.md"));
|
|
257261
257279
|
const isWorkspaceDirEmpty = isDirEmpty(getCwd());
|
|
257262
257280
|
return [
|
|
257263
257281
|
{
|
|
@@ -257315,7 +257333,7 @@ var init_projectOnboardingState = __esm(() => {
|
|
|
257315
257333
|
// src/utils/appleTerminalBackup.ts
|
|
257316
257334
|
import { stat as stat25 } from "fs/promises";
|
|
257317
257335
|
import { homedir as homedir19 } from "os";
|
|
257318
|
-
import { join as
|
|
257336
|
+
import { join as join72 } from "path";
|
|
257319
257337
|
function markTerminalSetupInProgress(backupPath) {
|
|
257320
257338
|
saveGlobalConfig((current) => ({
|
|
257321
257339
|
...current,
|
|
@@ -257337,7 +257355,7 @@ function getTerminalRecoveryInfo() {
|
|
|
257337
257355
|
};
|
|
257338
257356
|
}
|
|
257339
257357
|
function getTerminalPlistPath() {
|
|
257340
|
-
return
|
|
257358
|
+
return join72(homedir19(), "Library", "Preferences", "com.apple.Terminal.plist");
|
|
257341
257359
|
}
|
|
257342
257360
|
async function backupTerminalPreferences() {
|
|
257343
257361
|
const terminalPlistPath = getTerminalPlistPath();
|
|
@@ -257409,37 +257427,37 @@ var init_appleTerminalBackup = __esm(() => {
|
|
|
257409
257427
|
|
|
257410
257428
|
// src/utils/completionCache.ts
|
|
257411
257429
|
import { homedir as homedir20 } from "os";
|
|
257412
|
-
import { dirname as dirname28, join as
|
|
257430
|
+
import { dirname as dirname28, join as join73 } from "path";
|
|
257413
257431
|
function detectShell() {
|
|
257414
257432
|
const shell = process.env.SHELL || "";
|
|
257415
257433
|
const home = homedir20();
|
|
257416
|
-
const vivusDir =
|
|
257434
|
+
const vivusDir = join73(home, ".vivus");
|
|
257417
257435
|
if (shell.endsWith("/zsh") || shell.endsWith("/zsh.exe")) {
|
|
257418
|
-
const cacheFile =
|
|
257436
|
+
const cacheFile = join73(vivusDir, "completion.zsh");
|
|
257419
257437
|
return {
|
|
257420
257438
|
name: "zsh",
|
|
257421
|
-
rcFile:
|
|
257439
|
+
rcFile: join73(home, ".zshrc"),
|
|
257422
257440
|
cacheFile,
|
|
257423
257441
|
completionLine: `[[ -f "${cacheFile}" ]] && source "${cacheFile}"`,
|
|
257424
257442
|
shellFlag: "zsh"
|
|
257425
257443
|
};
|
|
257426
257444
|
}
|
|
257427
257445
|
if (shell.endsWith("/bash") || shell.endsWith("/bash.exe")) {
|
|
257428
|
-
const cacheFile =
|
|
257446
|
+
const cacheFile = join73(vivusDir, "completion.bash");
|
|
257429
257447
|
return {
|
|
257430
257448
|
name: "bash",
|
|
257431
|
-
rcFile:
|
|
257449
|
+
rcFile: join73(home, ".bashrc"),
|
|
257432
257450
|
cacheFile,
|
|
257433
257451
|
completionLine: `[ -f "${cacheFile}" ] && source "${cacheFile}"`,
|
|
257434
257452
|
shellFlag: "bash"
|
|
257435
257453
|
};
|
|
257436
257454
|
}
|
|
257437
257455
|
if (shell.endsWith("/fish") || shell.endsWith("/fish.exe")) {
|
|
257438
|
-
const xdg = process.env.XDG_CONFIG_HOME ||
|
|
257439
|
-
const cacheFile =
|
|
257456
|
+
const xdg = process.env.XDG_CONFIG_HOME || join73(home, ".config");
|
|
257457
|
+
const cacheFile = join73(vivusDir, "completion.fish");
|
|
257440
257458
|
return {
|
|
257441
257459
|
name: "fish",
|
|
257442
|
-
rcFile:
|
|
257460
|
+
rcFile: join73(xdg, "fish", "config.fish"),
|
|
257443
257461
|
cacheFile,
|
|
257444
257462
|
completionLine: `[ -f "${cacheFile}" ] && source "${cacheFile}"`,
|
|
257445
257463
|
shellFlag: "fish"
|
|
@@ -257489,7 +257507,7 @@ __export(exports_terminalSetup, {
|
|
|
257489
257507
|
import { randomBytes as randomBytes12 } from "crypto";
|
|
257490
257508
|
import { copyFile as copyFile4, mkdir as mkdir18, readFile as readFile20, writeFile as writeFile14 } from "fs/promises";
|
|
257491
257509
|
import { homedir as homedir21, platform as platform4 } from "os";
|
|
257492
|
-
import { dirname as dirname29, join as
|
|
257510
|
+
import { dirname as dirname29, join as join74 } from "path";
|
|
257493
257511
|
import { pathToFileURL as pathToFileURL3 } from "url";
|
|
257494
257512
|
function isVSCodeRemoteSSH() {
|
|
257495
257513
|
const askpassMain = process.env.VSCODE_GIT_ASKPASS_MAIN ?? "";
|
|
@@ -257624,8 +257642,8 @@ async function installBindingsForVSCodeTerminal(editor = "VSCode", theme) {
|
|
|
257624
257642
|
]`)}${EOL3}`;
|
|
257625
257643
|
}
|
|
257626
257644
|
const editorDir = editor === "VSCode" ? "Code" : editor;
|
|
257627
|
-
const userDirPath =
|
|
257628
|
-
const keybindingsPath =
|
|
257645
|
+
const userDirPath = join74(homedir21(), platform4() === "win32" ? join74("AppData", "Roaming", editorDir, "User") : platform4() === "darwin" ? join74("Library", "Application Support", editorDir, "User") : join74(".config", editorDir, "User"));
|
|
257646
|
+
const keybindingsPath = join74(userDirPath, "keybindings.json");
|
|
257629
257647
|
try {
|
|
257630
257648
|
await mkdir18(userDirPath, {
|
|
257631
257649
|
recursive: true
|
|
@@ -257766,14 +257784,14 @@ chars = "\\u001B\\r"`;
|
|
|
257766
257784
|
const configPaths = [];
|
|
257767
257785
|
const xdgConfigHome = process.env.XDG_CONFIG_HOME;
|
|
257768
257786
|
if (xdgConfigHome) {
|
|
257769
|
-
configPaths.push(
|
|
257787
|
+
configPaths.push(join74(xdgConfigHome, "alacritty", "alacritty.toml"));
|
|
257770
257788
|
} else {
|
|
257771
|
-
configPaths.push(
|
|
257789
|
+
configPaths.push(join74(homedir21(), ".config", "alacritty", "alacritty.toml"));
|
|
257772
257790
|
}
|
|
257773
257791
|
if (platform4() === "win32") {
|
|
257774
257792
|
const appData = process.env.APPDATA;
|
|
257775
257793
|
if (appData) {
|
|
257776
|
-
configPaths.push(
|
|
257794
|
+
configPaths.push(join74(appData, "alacritty", "alacritty.toml"));
|
|
257777
257795
|
}
|
|
257778
257796
|
}
|
|
257779
257797
|
let configPath = null;
|
|
@@ -257834,8 +257852,8 @@ chars = "\\u001B\\r"`;
|
|
|
257834
257852
|
}
|
|
257835
257853
|
}
|
|
257836
257854
|
async function installBindingsForZed(theme) {
|
|
257837
|
-
const zedDir =
|
|
257838
|
-
const keymapPath =
|
|
257855
|
+
const zedDir = join74(homedir21(), ".config", "zed");
|
|
257856
|
+
const keymapPath = join74(zedDir, "keymap.json");
|
|
257839
257857
|
try {
|
|
257840
257858
|
await mkdir18(zedDir, {
|
|
257841
257859
|
recursive: true
|
|
@@ -257917,15 +257935,15 @@ var init_terminalSetup = __esm(() => {
|
|
|
257917
257935
|
// src/utils/pasteStore.ts
|
|
257918
257936
|
import { createHash as createHash15 } from "crypto";
|
|
257919
257937
|
import { mkdir as mkdir19, readdir as readdir15, readFile as readFile21, stat as stat26, unlink as unlink10, writeFile as writeFile15 } from "fs/promises";
|
|
257920
|
-
import { join as
|
|
257938
|
+
import { join as join75 } from "path";
|
|
257921
257939
|
function getPasteStoreDir() {
|
|
257922
|
-
return
|
|
257940
|
+
return join75(getVivusConfigHomeDir(), PASTE_STORE_DIR);
|
|
257923
257941
|
}
|
|
257924
257942
|
function hashPastedText(content) {
|
|
257925
257943
|
return createHash15("sha256").update(content).digest("hex").slice(0, 16);
|
|
257926
257944
|
}
|
|
257927
257945
|
function getPastePath(hash2) {
|
|
257928
|
-
return
|
|
257946
|
+
return join75(getPasteStoreDir(), `${hash2}.txt`);
|
|
257929
257947
|
}
|
|
257930
257948
|
async function storePastedText(hash2, content) {
|
|
257931
257949
|
try {
|
|
@@ -257962,7 +257980,7 @@ async function cleanupOldPastes(cutoffDate) {
|
|
|
257962
257980
|
if (!file2.endsWith(".txt")) {
|
|
257963
257981
|
continue;
|
|
257964
257982
|
}
|
|
257965
|
-
const filePath =
|
|
257983
|
+
const filePath = join75(pasteDir, file2);
|
|
257966
257984
|
try {
|
|
257967
257985
|
const stats = await stat26(filePath);
|
|
257968
257986
|
if (stats.mtimeMs < cutoffTime) {
|
|
@@ -257981,7 +257999,7 @@ var init_pasteStore = __esm(() => {
|
|
|
257981
257999
|
|
|
257982
258000
|
// src/history.ts
|
|
257983
258001
|
import { appendFile as appendFile4, writeFile as writeFile16 } from "fs/promises";
|
|
257984
|
-
import { join as
|
|
258002
|
+
import { join as join76 } from "path";
|
|
257985
258003
|
function getPastedTextRefNumLines(text2) {
|
|
257986
258004
|
return (text2.match(/\r\n|\r|\n/g) || []).length;
|
|
257987
258005
|
}
|
|
@@ -258023,7 +258041,7 @@ async function* makeLogEntryReader() {
|
|
|
258023
258041
|
for (let i2 = pendingEntries.length - 1;i2 >= 0; i2--) {
|
|
258024
258042
|
yield pendingEntries[i2];
|
|
258025
258043
|
}
|
|
258026
|
-
const historyPath =
|
|
258044
|
+
const historyPath = join76(getVivusConfigHomeDir(), "history.jsonl");
|
|
258027
258045
|
try {
|
|
258028
258046
|
for await (const line of readLinesReverse(historyPath)) {
|
|
258029
258047
|
try {
|
|
@@ -258118,7 +258136,7 @@ async function immediateFlushHistory() {
|
|
|
258118
258136
|
}
|
|
258119
258137
|
let release;
|
|
258120
258138
|
try {
|
|
258121
|
-
const historyPath =
|
|
258139
|
+
const historyPath = join76(getVivusConfigHomeDir(), "history.jsonl");
|
|
258122
258140
|
await writeFile16(historyPath, "", {
|
|
258123
258141
|
encoding: "utf8",
|
|
258124
258142
|
mode: 384,
|
|
@@ -300959,7 +300977,7 @@ async function initializeBetaTracing(resource) {
|
|
|
300959
300977
|
});
|
|
300960
300978
|
import_api_logs.logs.setGlobalLoggerProvider(loggerProvider);
|
|
300961
300979
|
setLoggerProvider(loggerProvider);
|
|
300962
|
-
const eventLogger = import_api_logs.logs.getLogger("com.anthropic.vivus_code.events", "1.1.
|
|
300980
|
+
const eventLogger = import_api_logs.logs.getLogger("com.anthropic.vivus_code.events", "1.1.32+82959fe");
|
|
300963
300981
|
setEventLogger(eventLogger);
|
|
300964
300982
|
process.on("beforeExit", async () => {
|
|
300965
300983
|
await loggerProvider?.forceFlush();
|
|
@@ -300999,7 +301017,7 @@ async function initializeTelemetry() {
|
|
|
300999
301017
|
const platform5 = getPlatform();
|
|
301000
301018
|
const baseAttributes = {
|
|
301001
301019
|
[import_semantic_conventions2.ATTR_SERVICE_NAME]: "vivus",
|
|
301002
|
-
[import_semantic_conventions2.ATTR_SERVICE_VERSION]: "1.1.
|
|
301020
|
+
[import_semantic_conventions2.ATTR_SERVICE_VERSION]: "1.1.32+82959fe"
|
|
301003
301021
|
};
|
|
301004
301022
|
if (platform5 === "wsl") {
|
|
301005
301023
|
const wslVersion = getWslVersion();
|
|
@@ -301044,7 +301062,7 @@ async function initializeTelemetry() {
|
|
|
301044
301062
|
} catch {}
|
|
301045
301063
|
};
|
|
301046
301064
|
registerCleanup(shutdownTelemetry2);
|
|
301047
|
-
return meterProvider2.getMeter("com.anthropic.vivus_code", "1.1.
|
|
301065
|
+
return meterProvider2.getMeter("com.anthropic.vivus_code", "1.1.32+82959fe");
|
|
301048
301066
|
}
|
|
301049
301067
|
const meterProvider = new import_sdk_metrics2.MeterProvider({
|
|
301050
301068
|
resource,
|
|
@@ -301064,7 +301082,7 @@ async function initializeTelemetry() {
|
|
|
301064
301082
|
});
|
|
301065
301083
|
import_api_logs.logs.setGlobalLoggerProvider(loggerProvider);
|
|
301066
301084
|
setLoggerProvider(loggerProvider);
|
|
301067
|
-
const eventLogger = import_api_logs.logs.getLogger("com.anthropic.vivus_code.events", "1.1.
|
|
301085
|
+
const eventLogger = import_api_logs.logs.getLogger("com.anthropic.vivus_code.events", "1.1.32+82959fe");
|
|
301068
301086
|
setEventLogger(eventLogger);
|
|
301069
301087
|
logForDebugging("[3P telemetry] Event logger set successfully");
|
|
301070
301088
|
process.on("beforeExit", async () => {
|
|
@@ -301126,7 +301144,7 @@ Current timeout: ${timeoutMs}ms
|
|
|
301126
301144
|
}
|
|
301127
301145
|
};
|
|
301128
301146
|
registerCleanup(shutdownTelemetry);
|
|
301129
|
-
return meterProvider.getMeter("com.anthropic.vivus_code", "1.1.
|
|
301147
|
+
return meterProvider.getMeter("com.anthropic.vivus_code", "1.1.32+82959fe");
|
|
301130
301148
|
}
|
|
301131
301149
|
async function flushTelemetry() {
|
|
301132
301150
|
const meterProvider = getMeterProvider();
|
|
@@ -301622,12 +301640,12 @@ var init_oauth2 = __esm(() => {
|
|
|
301622
301640
|
|
|
301623
301641
|
// src/utils/localInstaller.ts
|
|
301624
301642
|
import { access as access2, chmod as chmod5, writeFile as writeFile17 } from "fs/promises";
|
|
301625
|
-
import { join as
|
|
301643
|
+
import { join as join77 } from "path";
|
|
301626
301644
|
function getLocalInstallDir() {
|
|
301627
|
-
return
|
|
301645
|
+
return join77(getVivusConfigHomeDir(), "local");
|
|
301628
301646
|
}
|
|
301629
301647
|
function getLocalVivusPath() {
|
|
301630
|
-
return
|
|
301648
|
+
return join77(getLocalInstallDir(), "vivus");
|
|
301631
301649
|
}
|
|
301632
301650
|
function isRunningFromLocalInstallation() {
|
|
301633
301651
|
const execPath2 = process.argv[1] || "";
|
|
@@ -301647,8 +301665,8 @@ async function ensureLocalPackageEnvironment() {
|
|
|
301647
301665
|
try {
|
|
301648
301666
|
const localInstallDir = getLocalInstallDir();
|
|
301649
301667
|
await getFsImplementation().mkdir(localInstallDir);
|
|
301650
|
-
await writeIfMissing(
|
|
301651
|
-
const wrapperPath =
|
|
301668
|
+
await writeIfMissing(join77(localInstallDir, "package.json"), jsonStringify({ name: "vivus-local", version: "0.0.1", private: true }, null, 2));
|
|
301669
|
+
const wrapperPath = join77(localInstallDir, "vivus");
|
|
301652
301670
|
const created = await writeIfMissing(wrapperPath, `#!/bin/sh
|
|
301653
301671
|
exec "${localInstallDir}/node_modules/.bin/vivus" "$@"`, 493);
|
|
301654
301672
|
if (created) {
|
|
@@ -301684,7 +301702,7 @@ async function installOrUpdateVivusPackage(channel, specificVersion) {
|
|
|
301684
301702
|
}
|
|
301685
301703
|
async function localInstallationExists() {
|
|
301686
301704
|
try {
|
|
301687
|
-
await access2(
|
|
301705
|
+
await access2(join77(getLocalInstallDir(), "node_modules", ".bin", "vivus"));
|
|
301688
301706
|
return true;
|
|
301689
301707
|
} catch {
|
|
301690
301708
|
return false;
|
|
@@ -301713,15 +301731,15 @@ var init_localInstaller = __esm(() => {
|
|
|
301713
301731
|
// src/utils/shellConfig.ts
|
|
301714
301732
|
import { open as open10, readFile as readFile22, stat as stat27 } from "fs/promises";
|
|
301715
301733
|
import { homedir as osHomedir } from "os";
|
|
301716
|
-
import { join as
|
|
301734
|
+
import { join as join78 } from "path";
|
|
301717
301735
|
function getShellConfigPaths(options2) {
|
|
301718
301736
|
const home = options2?.homedir ?? osHomedir();
|
|
301719
301737
|
const env4 = options2?.env ?? process.env;
|
|
301720
301738
|
const zshConfigDir = env4.ZDOTDIR || home;
|
|
301721
301739
|
return {
|
|
301722
|
-
zsh:
|
|
301723
|
-
bash:
|
|
301724
|
-
fish:
|
|
301740
|
+
zsh: join78(zshConfigDir, ".zshrc"),
|
|
301741
|
+
bash: join78(home, ".bashrc"),
|
|
301742
|
+
fish: join78(home, ".config/fish/config.fish")
|
|
301725
301743
|
};
|
|
301726
301744
|
}
|
|
301727
301745
|
function filterVivusAliases(lines) {
|
|
@@ -301807,14 +301825,14 @@ var init_shellConfig = __esm(() => {
|
|
|
301807
301825
|
import { constants as fsConstants4 } from "fs";
|
|
301808
301826
|
import { access as access3, writeFile as writeFile18 } from "fs/promises";
|
|
301809
301827
|
import { homedir as homedir22 } from "os";
|
|
301810
|
-
import { join as
|
|
301828
|
+
import { join as join79 } from "path";
|
|
301811
301829
|
async function assertMinVersion() {
|
|
301812
301830
|
if (false) {}
|
|
301813
301831
|
try {
|
|
301814
301832
|
const versionConfig = await getDynamicConfig_BLOCKS_ON_INIT("tengu_version_config", { minVersion: "0.0.0" });
|
|
301815
|
-
if (versionConfig.minVersion && lt("1.1.
|
|
301833
|
+
if (versionConfig.minVersion && lt("1.1.32+82959fe", versionConfig.minVersion)) {
|
|
301816
301834
|
console.error(`
|
|
301817
|
-
It looks like your version of Vivus (${"1.1.
|
|
301835
|
+
It looks like your version of Vivus (${"1.1.32+82959fe"}) needs an update.
|
|
301818
301836
|
A newer version (${versionConfig.minVersion} or higher) is required to continue.
|
|
301819
301837
|
|
|
301820
301838
|
To update, please run:
|
|
@@ -301863,7 +301881,7 @@ function shouldSkipVersion(targetVersion) {
|
|
|
301863
301881
|
return shouldSkip;
|
|
301864
301882
|
}
|
|
301865
301883
|
function getLockFilePath() {
|
|
301866
|
-
return
|
|
301884
|
+
return join79(getVivusConfigHomeDir(), ".update.lock");
|
|
301867
301885
|
}
|
|
301868
301886
|
async function acquireLock() {
|
|
301869
301887
|
const fs8 = getFsImplementation();
|
|
@@ -302030,7 +302048,7 @@ async function installGlobalPackage(specificVersion) {
|
|
|
302030
302048
|
logError2(new AutoUpdaterError("Another process is currently installing an update"));
|
|
302031
302049
|
logEvent("tengu_auto_updater_lock_contention", {
|
|
302032
302050
|
pid: process.pid,
|
|
302033
|
-
currentVersion: "1.1.
|
|
302051
|
+
currentVersion: "1.1.32+82959fe"
|
|
302034
302052
|
});
|
|
302035
302053
|
return "in_progress";
|
|
302036
302054
|
}
|
|
@@ -302039,7 +302057,7 @@ async function installGlobalPackage(specificVersion) {
|
|
|
302039
302057
|
if (!env3.isRunningWithBun() && env3.isNpmFromWindowsPath()) {
|
|
302040
302058
|
logError2(new Error("Windows NPM detected in WSL environment"));
|
|
302041
302059
|
logEvent("tengu_auto_updater_windows_npm_in_wsl", {
|
|
302042
|
-
currentVersion: "1.1.
|
|
302060
|
+
currentVersion: "1.1.32+82959fe"
|
|
302043
302061
|
});
|
|
302044
302062
|
console.error(`
|
|
302045
302063
|
Error: Windows NPM detected in WSL
|
|
@@ -302298,7 +302316,7 @@ var init_packageManagers = __esm(() => {
|
|
|
302298
302316
|
// src/utils/doctorDiagnostic.ts
|
|
302299
302317
|
import { readFile as readFile24, realpath as realpath8 } from "fs/promises";
|
|
302300
302318
|
import { homedir as homedir23 } from "os";
|
|
302301
|
-
import { delimiter as delimiter2, join as
|
|
302319
|
+
import { delimiter as delimiter2, join as join80, posix as posix5, win32 as win323 } from "path";
|
|
302302
302320
|
function getNormalizedPaths() {
|
|
302303
302321
|
let invokedPath = process.argv[1] || "";
|
|
302304
302322
|
let execPath2 = process.execPath || process.argv[0] || "";
|
|
@@ -302361,8 +302379,8 @@ async function getInstallationPath() {
|
|
|
302361
302379
|
}
|
|
302362
302380
|
} catch {}
|
|
302363
302381
|
try {
|
|
302364
|
-
await getFsImplementation().stat(
|
|
302365
|
-
return
|
|
302382
|
+
await getFsImplementation().stat(join80(homedir23(), ".local/bin/vivus"));
|
|
302383
|
+
return join80(homedir23(), ".local/bin/vivus");
|
|
302366
302384
|
} catch {}
|
|
302367
302385
|
return "native";
|
|
302368
302386
|
}
|
|
@@ -302385,7 +302403,7 @@ function getInvokedBinary() {
|
|
|
302385
302403
|
async function detectMultipleInstallations() {
|
|
302386
302404
|
const fs8 = getFsImplementation();
|
|
302387
302405
|
const installations = [];
|
|
302388
|
-
const localPath =
|
|
302406
|
+
const localPath = join80(homedir23(), ".vivus", "local");
|
|
302389
302407
|
if (await localInstallationExists()) {
|
|
302390
302408
|
installations.push({ type: "npm-local", path: localPath });
|
|
302391
302409
|
}
|
|
@@ -302400,7 +302418,7 @@ async function detectMultipleInstallations() {
|
|
|
302400
302418
|
if (npmResult.code === 0 && npmResult.stdout) {
|
|
302401
302419
|
const npmPrefix = npmResult.stdout.trim();
|
|
302402
302420
|
const isWindows2 = getPlatform() === "windows";
|
|
302403
|
-
const globalBinPath = isWindows2 ?
|
|
302421
|
+
const globalBinPath = isWindows2 ? join80(npmPrefix, "vivus") : join80(npmPrefix, "bin", "vivus");
|
|
302404
302422
|
let globalBinExists = false;
|
|
302405
302423
|
try {
|
|
302406
302424
|
await fs8.stat(globalBinPath);
|
|
@@ -302419,7 +302437,7 @@ async function detectMultipleInstallations() {
|
|
|
302419
302437
|
}
|
|
302420
302438
|
} else {
|
|
302421
302439
|
for (const packageName of packagesToCheck) {
|
|
302422
|
-
const globalPackagePath = isWindows2 ?
|
|
302440
|
+
const globalPackagePath = isWindows2 ? join80(npmPrefix, "node_modules", packageName) : join80(npmPrefix, "lib", "node_modules", packageName);
|
|
302423
302441
|
try {
|
|
302424
302442
|
await fs8.stat(globalPackagePath);
|
|
302425
302443
|
installations.push({
|
|
@@ -302430,14 +302448,14 @@ async function detectMultipleInstallations() {
|
|
|
302430
302448
|
}
|
|
302431
302449
|
}
|
|
302432
302450
|
}
|
|
302433
|
-
const nativeBinPath =
|
|
302451
|
+
const nativeBinPath = join80(homedir23(), ".local", "bin", "vivus");
|
|
302434
302452
|
try {
|
|
302435
302453
|
await fs8.stat(nativeBinPath);
|
|
302436
302454
|
installations.push({ type: "native", path: nativeBinPath });
|
|
302437
302455
|
} catch {}
|
|
302438
302456
|
const config3 = getGlobalConfig();
|
|
302439
302457
|
if (config3.installMethod === "native") {
|
|
302440
|
-
const nativeDataPath =
|
|
302458
|
+
const nativeDataPath = join80(homedir23(), ".local", "share", "vivus");
|
|
302441
302459
|
try {
|
|
302442
302460
|
await fs8.stat(nativeDataPath);
|
|
302443
302461
|
if (!installations.some((i2) => i2.type === "native")) {
|
|
@@ -302450,7 +302468,7 @@ async function detectMultipleInstallations() {
|
|
|
302450
302468
|
async function detectConfigurationIssues(type) {
|
|
302451
302469
|
const warnings = [];
|
|
302452
302470
|
try {
|
|
302453
|
-
const raw = await readFile24(
|
|
302471
|
+
const raw = await readFile24(join80(getManagedFilePath(), "managed-settings.json"), "utf-8");
|
|
302454
302472
|
const parsed = jsonParse(raw);
|
|
302455
302473
|
const field = parsed && typeof parsed === "object" ? parsed.strictPluginOnlyCustomization : undefined;
|
|
302456
302474
|
if (field !== undefined && typeof field !== "boolean") {
|
|
@@ -302478,7 +302496,7 @@ async function detectConfigurationIssues(type) {
|
|
|
302478
302496
|
const path15 = process.env.PATH || "";
|
|
302479
302497
|
const pathDirectories = path15.split(delimiter2);
|
|
302480
302498
|
const homeDir = homedir23();
|
|
302481
|
-
const localBinPath =
|
|
302499
|
+
const localBinPath = join80(homeDir, ".local", "bin");
|
|
302482
302500
|
let normalizedLocalBinPath = localBinPath;
|
|
302483
302501
|
if (getPlatform() === "windows") {
|
|
302484
302502
|
normalizedLocalBinPath = localBinPath.split(win323.sep).join(posix5.sep);
|
|
@@ -302572,7 +302590,7 @@ function detectLinuxGlobPatternWarnings() {
|
|
|
302572
302590
|
}
|
|
302573
302591
|
async function getDoctorDiagnostic() {
|
|
302574
302592
|
const installationType = await getCurrentInstallationType();
|
|
302575
|
-
const version2 = typeof MACRO !== "undefined" ? "1.1.
|
|
302593
|
+
const version2 = typeof MACRO !== "undefined" ? "1.1.32+82959fe" : "unknown";
|
|
302576
302594
|
const installationPath = await getInstallationPath();
|
|
302577
302595
|
const invokedBinary = getInvokedBinary();
|
|
302578
302596
|
const multipleInstallations = await detectMultipleInstallations();
|
|
@@ -302662,7 +302680,7 @@ var init_doctorDiagnostic = __esm(() => {
|
|
|
302662
302680
|
|
|
302663
302681
|
// src/utils/xdg.ts
|
|
302664
302682
|
import { homedir as osHomedir2 } from "os";
|
|
302665
|
-
import { join as
|
|
302683
|
+
import { join as join81 } from "path";
|
|
302666
302684
|
function resolveOptions(options2) {
|
|
302667
302685
|
return {
|
|
302668
302686
|
env: options2?.env ?? process.env,
|
|
@@ -302671,26 +302689,26 @@ function resolveOptions(options2) {
|
|
|
302671
302689
|
}
|
|
302672
302690
|
function getXDGStateHome(options2) {
|
|
302673
302691
|
const { env: env4, home } = resolveOptions(options2);
|
|
302674
|
-
return env4.XDG_STATE_HOME ??
|
|
302692
|
+
return env4.XDG_STATE_HOME ?? join81(home, ".local", "state");
|
|
302675
302693
|
}
|
|
302676
302694
|
function getXDGCacheHome(options2) {
|
|
302677
302695
|
const { env: env4, home } = resolveOptions(options2);
|
|
302678
|
-
return env4.XDG_CACHE_HOME ??
|
|
302696
|
+
return env4.XDG_CACHE_HOME ?? join81(home, ".cache");
|
|
302679
302697
|
}
|
|
302680
302698
|
function getXDGDataHome(options2) {
|
|
302681
302699
|
const { env: env4, home } = resolveOptions(options2);
|
|
302682
|
-
return env4.XDG_DATA_HOME ??
|
|
302700
|
+
return env4.XDG_DATA_HOME ?? join81(home, ".local", "share");
|
|
302683
302701
|
}
|
|
302684
302702
|
function getUserBinDir(options2) {
|
|
302685
302703
|
const { home } = resolveOptions(options2);
|
|
302686
|
-
return
|
|
302704
|
+
return join81(home, ".local", "bin");
|
|
302687
302705
|
}
|
|
302688
302706
|
var init_xdg = () => {};
|
|
302689
302707
|
|
|
302690
302708
|
// src/utils/nativeInstaller/download.ts
|
|
302691
302709
|
import { createHash as createHash18 } from "crypto";
|
|
302692
302710
|
import { chmod as chmod6, writeFile as writeFile19 } from "fs/promises";
|
|
302693
|
-
import { join as
|
|
302711
|
+
import { join as join82 } from "path";
|
|
302694
302712
|
async function getLatestVersionFromArtifactory(tag2 = "latest") {
|
|
302695
302713
|
const startTime = Date.now();
|
|
302696
302714
|
const { stdout, code, stderr } = await execFileNoThrowWithCwd("npm", [
|
|
@@ -302832,8 +302850,8 @@ async function downloadVersionFromArtifactory(version2, stagingPath) {
|
|
|
302832
302850
|
}
|
|
302833
302851
|
}
|
|
302834
302852
|
};
|
|
302835
|
-
writeFileSync_DEPRECATED(
|
|
302836
|
-
writeFileSync_DEPRECATED(
|
|
302853
|
+
writeFileSync_DEPRECATED(join82(stagingPath, "package.json"), jsonStringify(packageJson, null, 2), { encoding: "utf8", flush: true });
|
|
302854
|
+
writeFileSync_DEPRECATED(join82(stagingPath, "package-lock.json"), jsonStringify(packageLock, null, 2), { encoding: "utf8", flush: true });
|
|
302837
302855
|
const result = await execFileNoThrowWithCwd("npm", ["ci", "--prefer-online", "--registry", ARTIFACTORY_REGISTRY_URL], {
|
|
302838
302856
|
timeout: 60000,
|
|
302839
302857
|
preserveOutputOnError: true,
|
|
@@ -302939,7 +302957,7 @@ async function downloadVersionFromBinaryRepo(version2, stagingPath, baseUrl, aut
|
|
|
302939
302957
|
const binaryName = getBinaryName(platform5);
|
|
302940
302958
|
const binaryUrl = `${baseUrl}/${version2}/${platform5}/${binaryName}`;
|
|
302941
302959
|
await fs8.mkdir(stagingPath);
|
|
302942
|
-
const binaryPath =
|
|
302960
|
+
const binaryPath = join82(stagingPath, binaryName);
|
|
302943
302961
|
try {
|
|
302944
302962
|
await downloadAndVerifyBinary(binaryUrl, expectedChecksum, binaryPath, authConfig || {});
|
|
302945
302963
|
const latencyMs = Date.now() - startTime;
|
|
@@ -302992,7 +303010,7 @@ var init_download = __esm(() => {
|
|
|
302992
303010
|
});
|
|
302993
303011
|
|
|
302994
303012
|
// src/utils/nativeInstaller/pidLock.ts
|
|
302995
|
-
import { basename as basename16, join as
|
|
303013
|
+
import { basename as basename16, join as join83 } from "path";
|
|
302996
303014
|
function isPidBasedLockingEnabled() {
|
|
302997
303015
|
const envVar = process.env.ENABLE_PID_BASED_VERSION_LOCKING;
|
|
302998
303016
|
if (isEnvTruthy(envVar)) {
|
|
@@ -303160,7 +303178,7 @@ function getAllLockInfo(locksDir) {
|
|
|
303160
303178
|
try {
|
|
303161
303179
|
const lockFiles = fs8.readdirStringSync(locksDir).filter((f) => f.endsWith(".lock"));
|
|
303162
303180
|
for (const lockFile of lockFiles) {
|
|
303163
|
-
const lockFilePath =
|
|
303181
|
+
const lockFilePath = join83(locksDir, lockFile);
|
|
303164
303182
|
const content = readLockContent(lockFilePath);
|
|
303165
303183
|
if (content) {
|
|
303166
303184
|
lockInfos.push({
|
|
@@ -303187,7 +303205,7 @@ function cleanupStaleLocks(locksDir) {
|
|
|
303187
303205
|
try {
|
|
303188
303206
|
const lockEntries = fs8.readdirStringSync(locksDir).filter((f) => f.endsWith(".lock"));
|
|
303189
303207
|
for (const lockEntry of lockEntries) {
|
|
303190
|
-
const lockFilePath =
|
|
303208
|
+
const lockFilePath = join83(locksDir, lockEntry);
|
|
303191
303209
|
try {
|
|
303192
303210
|
const stats = fs8.lstatSync(lockFilePath);
|
|
303193
303211
|
if (stats.isDirectory()) {
|
|
@@ -303242,7 +303260,7 @@ import {
|
|
|
303242
303260
|
writeFile as writeFile20
|
|
303243
303261
|
} from "fs/promises";
|
|
303244
303262
|
import { homedir as homedir24 } from "os";
|
|
303245
|
-
import { basename as basename17, delimiter as delimiter3, dirname as dirname30, join as
|
|
303263
|
+
import { basename as basename17, delimiter as delimiter3, dirname as dirname30, join as join84, resolve as resolve22 } from "path";
|
|
303246
303264
|
function getPlatform3() {
|
|
303247
303265
|
const os5 = env3.platform;
|
|
303248
303266
|
const arch = process.arch === "x64" ? "x64" : process.arch === "arm64" ? "arm64" : null;
|
|
@@ -303263,10 +303281,10 @@ function getBaseDirectories() {
|
|
|
303263
303281
|
const platform5 = getPlatform3();
|
|
303264
303282
|
const executableName = getBinaryName(platform5);
|
|
303265
303283
|
return {
|
|
303266
|
-
versions:
|
|
303267
|
-
staging:
|
|
303268
|
-
locks:
|
|
303269
|
-
executable:
|
|
303284
|
+
versions: join84(getXDGDataHome(), "vivus", "versions"),
|
|
303285
|
+
staging: join84(getXDGCacheHome(), "vivus", "staging"),
|
|
303286
|
+
locks: join84(getXDGStateHome(), "vivus", "locks"),
|
|
303287
|
+
executable: join84(getUserBinDir(), executableName)
|
|
303270
303288
|
};
|
|
303271
303289
|
}
|
|
303272
303290
|
async function isPossibleVivusBinary(filePath) {
|
|
@@ -303287,14 +303305,14 @@ async function getVersionPaths(version2) {
|
|
|
303287
303305
|
await Promise.all(dirsToCreate.map((dir) => mkdir20(dir, { recursive: true })));
|
|
303288
303306
|
const executableParentDir = dirname30(dirs.executable);
|
|
303289
303307
|
await mkdir20(executableParentDir, { recursive: true });
|
|
303290
|
-
const installPath =
|
|
303308
|
+
const installPath = join84(dirs.versions, version2);
|
|
303291
303309
|
try {
|
|
303292
303310
|
await stat28(installPath);
|
|
303293
303311
|
} catch {
|
|
303294
303312
|
await writeFile20(installPath, "", { encoding: "utf8" });
|
|
303295
303313
|
}
|
|
303296
303314
|
return {
|
|
303297
|
-
stagingPath:
|
|
303315
|
+
stagingPath: join84(dirs.staging, version2),
|
|
303298
303316
|
installPath
|
|
303299
303317
|
};
|
|
303300
303318
|
}
|
|
@@ -303395,7 +303413,7 @@ async function atomicMoveToInstallPath(stagedBinaryPath, installPath) {
|
|
|
303395
303413
|
}
|
|
303396
303414
|
async function installVersionFromPackage(stagingPath, installPath) {
|
|
303397
303415
|
try {
|
|
303398
|
-
const nodeModulesDir =
|
|
303416
|
+
const nodeModulesDir = join84(stagingPath, "node_modules", "@anthropic-ai");
|
|
303399
303417
|
const entries = await readdir16(nodeModulesDir);
|
|
303400
303418
|
const nativePackage = entries.find((entry) => entry.startsWith("vivus-cli-native-"));
|
|
303401
303419
|
if (!nativePackage) {
|
|
@@ -303406,7 +303424,7 @@ async function installVersionFromPackage(stagingPath, installPath) {
|
|
|
303406
303424
|
const error41 = new Error("Could not find platform-specific native package");
|
|
303407
303425
|
throw error41;
|
|
303408
303426
|
}
|
|
303409
|
-
const stagedBinaryPath =
|
|
303427
|
+
const stagedBinaryPath = join84(nodeModulesDir, nativePackage, "cli");
|
|
303410
303428
|
try {
|
|
303411
303429
|
await stat28(stagedBinaryPath);
|
|
303412
303430
|
} catch {
|
|
@@ -303436,7 +303454,7 @@ async function installVersionFromBinary(stagingPath, installPath) {
|
|
|
303436
303454
|
try {
|
|
303437
303455
|
const platform5 = getPlatform3();
|
|
303438
303456
|
const binaryName = getBinaryName(platform5);
|
|
303439
|
-
const stagedBinaryPath =
|
|
303457
|
+
const stagedBinaryPath = join84(stagingPath, binaryName);
|
|
303440
303458
|
try {
|
|
303441
303459
|
await stat28(stagedBinaryPath);
|
|
303442
303460
|
} catch {
|
|
@@ -303505,8 +303523,8 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
|
|
|
303505
303523
|
const maxVersion = await getMaxVersion();
|
|
303506
303524
|
if (maxVersion && gt(version2, maxVersion)) {
|
|
303507
303525
|
logForDebugging(`Native installer: maxVersion ${maxVersion} is set, capping update from ${version2} to ${maxVersion}`);
|
|
303508
|
-
if (gte("1.1.
|
|
303509
|
-
logForDebugging(`Native installer: current version ${"1.1.
|
|
303526
|
+
if (gte("1.1.32+82959fe", maxVersion)) {
|
|
303527
|
+
logForDebugging(`Native installer: current version ${"1.1.32+82959fe"} is already at or above maxVersion ${maxVersion}, skipping update`);
|
|
303510
303528
|
logEvent("tengu_native_update_skipped_max_version", {
|
|
303511
303529
|
latency_ms: Date.now() - startTime,
|
|
303512
303530
|
max_version: maxVersion,
|
|
@@ -303517,7 +303535,7 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
|
|
|
303517
303535
|
version2 = maxVersion;
|
|
303518
303536
|
}
|
|
303519
303537
|
}
|
|
303520
|
-
if (!forceReinstall && version2 === "1.1.
|
|
303538
|
+
if (!forceReinstall && version2 === "1.1.32+82959fe" && await versionIsAvailable(version2) && await isPossibleVivusBinary(executablePath)) {
|
|
303521
303539
|
logForDebugging(`Found ${version2} at ${executablePath}, skipping install`);
|
|
303522
303540
|
logEvent("tengu_native_update_complete", {
|
|
303523
303541
|
latency_ms: Date.now() - startTime,
|
|
@@ -303836,7 +303854,7 @@ async function getVersionFromSymlink(symlinkPath) {
|
|
|
303836
303854
|
}
|
|
303837
303855
|
function getLockFilePathFromVersionPath(dirs, versionPath) {
|
|
303838
303856
|
const versionName = basename17(versionPath);
|
|
303839
|
-
return
|
|
303857
|
+
return join84(dirs.locks, `${versionName}.lock`);
|
|
303840
303858
|
}
|
|
303841
303859
|
async function lockCurrentVersion() {
|
|
303842
303860
|
const dirs = getBaseDirectories();
|
|
@@ -303930,7 +303948,7 @@ async function cleanupOldVersions() {
|
|
|
303930
303948
|
if (!/^vivus\.exe\.old\.\d+$/.test(file2))
|
|
303931
303949
|
continue;
|
|
303932
303950
|
try {
|
|
303933
|
-
await unlink12(
|
|
303951
|
+
await unlink12(join84(executableDir, file2));
|
|
303934
303952
|
cleanedCount++;
|
|
303935
303953
|
} catch {}
|
|
303936
303954
|
}
|
|
@@ -303947,7 +303965,7 @@ async function cleanupOldVersions() {
|
|
|
303947
303965
|
const stagingEntries = await readdir16(dirs.staging);
|
|
303948
303966
|
let stagingCleanedCount = 0;
|
|
303949
303967
|
for (const entry of stagingEntries) {
|
|
303950
|
-
const stagingPath =
|
|
303968
|
+
const stagingPath = join84(dirs.staging, entry);
|
|
303951
303969
|
try {
|
|
303952
303970
|
const stats = await stat28(stagingPath);
|
|
303953
303971
|
if (stats.mtime.getTime() < oneHourAgo) {
|
|
@@ -303989,7 +304007,7 @@ async function cleanupOldVersions() {
|
|
|
303989
304007
|
const versionFiles = [];
|
|
303990
304008
|
let tempFilesCleanedCount = 0;
|
|
303991
304009
|
for (const entry of versionEntries) {
|
|
303992
|
-
const entryPath =
|
|
304010
|
+
const entryPath = join84(dirs.versions, entry);
|
|
303993
304011
|
if (/\.tmp\.\d+\.\d+$/.test(entry)) {
|
|
303994
304012
|
try {
|
|
303995
304013
|
const stats = await stat28(entryPath);
|
|
@@ -304181,9 +304199,9 @@ async function manualRemoveNpmPackage(packageName) {
|
|
|
304181
304199
|
}
|
|
304182
304200
|
}
|
|
304183
304201
|
if (getPlatform3().startsWith("win32")) {
|
|
304184
|
-
const binCmd =
|
|
304185
|
-
const binPs1 =
|
|
304186
|
-
const binExe =
|
|
304202
|
+
const binCmd = join84(globalPrefix, "vivus.cmd");
|
|
304203
|
+
const binPs1 = join84(globalPrefix, "vivus.ps1");
|
|
304204
|
+
const binExe = join84(globalPrefix, "vivus");
|
|
304187
304205
|
if (await tryRemove(binCmd, "bin script")) {
|
|
304188
304206
|
manuallyRemoved = true;
|
|
304189
304207
|
}
|
|
@@ -304194,14 +304212,14 @@ async function manualRemoveNpmPackage(packageName) {
|
|
|
304194
304212
|
manuallyRemoved = true;
|
|
304195
304213
|
}
|
|
304196
304214
|
} else {
|
|
304197
|
-
const binSymlink =
|
|
304215
|
+
const binSymlink = join84(globalPrefix, "bin", "vivus");
|
|
304198
304216
|
if (await tryRemove(binSymlink, "bin symlink")) {
|
|
304199
304217
|
manuallyRemoved = true;
|
|
304200
304218
|
}
|
|
304201
304219
|
}
|
|
304202
304220
|
if (manuallyRemoved) {
|
|
304203
304221
|
logForDebugging(`Successfully removed ${packageName} manually`);
|
|
304204
|
-
const nodeModulesPath = getPlatform3().startsWith("win32") ?
|
|
304222
|
+
const nodeModulesPath = getPlatform3().startsWith("win32") ? join84(globalPrefix, "node_modules", packageName) : join84(globalPrefix, "lib", "node_modules", packageName);
|
|
304205
304223
|
return {
|
|
304206
304224
|
success: true,
|
|
304207
304225
|
warning: `${packageName} executables removed, but node_modules directory was left intact for safety. You may manually delete it later at: ${nodeModulesPath}`
|
|
@@ -304260,7 +304278,7 @@ async function cleanupNpmInstallations() {
|
|
|
304260
304278
|
errors4.push(codePackageResult.error);
|
|
304261
304279
|
}
|
|
304262
304280
|
if ("") {}
|
|
304263
|
-
const localInstallDir =
|
|
304281
|
+
const localInstallDir = join84(homedir24(), ".vivus", "local");
|
|
304264
304282
|
try {
|
|
304265
304283
|
await rm5(localInstallDir, { recursive: true });
|
|
304266
304284
|
removed++;
|
|
@@ -305179,7 +305197,7 @@ function extractBashCommentLabel(command) {
|
|
|
305179
305197
|
|
|
305180
305198
|
// src/utils/plugins/lspPluginIntegration.ts
|
|
305181
305199
|
import { readFile as readFile25 } from "fs/promises";
|
|
305182
|
-
import { join as
|
|
305200
|
+
import { join as join85, relative as relative7, resolve as resolve23 } from "path";
|
|
305183
305201
|
function validatePathWithinPlugin(pluginPath, relativePath) {
|
|
305184
305202
|
const resolvedPluginPath = resolve23(pluginPath);
|
|
305185
305203
|
const resolvedFilePath = resolve23(pluginPath, relativePath);
|
|
@@ -305191,7 +305209,7 @@ function validatePathWithinPlugin(pluginPath, relativePath) {
|
|
|
305191
305209
|
}
|
|
305192
305210
|
async function loadPluginLspServers(plugin, errors4 = []) {
|
|
305193
305211
|
const servers = {};
|
|
305194
|
-
const lspJsonPath =
|
|
305212
|
+
const lspJsonPath = join85(plugin.path, ".lsp.json");
|
|
305195
305213
|
try {
|
|
305196
305214
|
const content = await readFile25(lspJsonPath, "utf-8");
|
|
305197
305215
|
const parsed = jsonParse(content);
|
|
@@ -309675,7 +309693,7 @@ function checkTeamMemSecrets(filePath, content) {
|
|
|
309675
309693
|
|
|
309676
309694
|
// src/utils/gitDiff.ts
|
|
309677
309695
|
import { access as access5, readFile as readFile26 } from "fs/promises";
|
|
309678
|
-
import { dirname as dirname31, join as
|
|
309696
|
+
import { dirname as dirname31, join as join86, relative as relative8, sep as sep12 } from "path";
|
|
309679
309697
|
async function fetchGitDiff() {
|
|
309680
309698
|
const isGit = await getIsGit();
|
|
309681
309699
|
if (!isGit)
|
|
@@ -309826,7 +309844,7 @@ async function isInTransientGitState() {
|
|
|
309826
309844
|
"CHERRY_PICK_HEAD",
|
|
309827
309845
|
"REVERT_HEAD"
|
|
309828
309846
|
];
|
|
309829
|
-
const results = await Promise.all(transientFiles.map((file2) => access5(
|
|
309847
|
+
const results = await Promise.all(transientFiles.map((file2) => access5(join86(gitDir, file2)).then(() => true).catch(() => false)));
|
|
309830
309848
|
return results.some(Boolean);
|
|
309831
309849
|
}
|
|
309832
309850
|
async function fetchUntrackedFiles(maxFiles) {
|
|
@@ -313076,9 +313094,9 @@ var init_FileWriteTool = __esm(() => {
|
|
|
313076
313094
|
});
|
|
313077
313095
|
|
|
313078
313096
|
// src/utils/plugins/orphanedPluginFilter.ts
|
|
313079
|
-
import { dirname as dirname34, isAbsolute as isAbsolute15, join as
|
|
313097
|
+
import { dirname as dirname34, isAbsolute as isAbsolute15, join as join87, normalize as normalize12, relative as relative11, sep as sep15 } from "path";
|
|
313080
313098
|
async function getGlobExclusionsForPluginCache(searchPath) {
|
|
313081
|
-
const cachePath = normalize12(
|
|
313099
|
+
const cachePath = normalize12(join87(getPluginsDirectory(), "cache"));
|
|
313082
313100
|
if (searchPath && !pathsOverlap(searchPath, cachePath)) {
|
|
313083
313101
|
return [];
|
|
313084
313102
|
}
|
|
@@ -313126,7 +313144,7 @@ var init_orphanedPluginFilter = __esm(() => {
|
|
|
313126
313144
|
});
|
|
313127
313145
|
|
|
313128
313146
|
// src/utils/glob.ts
|
|
313129
|
-
import { basename as basename19, dirname as dirname35, isAbsolute as isAbsolute16, join as
|
|
313147
|
+
import { basename as basename19, dirname as dirname35, isAbsolute as isAbsolute16, join as join88, sep as sep16 } from "path";
|
|
313130
313148
|
function extractGlobBaseDirectory(pattern) {
|
|
313131
313149
|
const globChars = /[*?[{]/;
|
|
313132
313150
|
const match = pattern.match(globChars);
|
|
@@ -313178,7 +313196,7 @@ async function glob(filePattern, cwd2, { limit, offset }, abortSignal, toolPermi
|
|
|
313178
313196
|
args.push("--glob", exclusion);
|
|
313179
313197
|
}
|
|
313180
313198
|
const allPaths = await ripGrep2(args, searchDir, abortSignal);
|
|
313181
|
-
const absolutePaths = allPaths.map((p) => isAbsolute16(p) ? p :
|
|
313199
|
+
const absolutePaths = allPaths.map((p) => isAbsolute16(p) ? p : join88(searchDir, p));
|
|
313182
313200
|
const truncated = absolutePaths.length > offset + limit;
|
|
313183
313201
|
const files = absolutePaths.slice(offset, offset + limit);
|
|
313184
313202
|
return { files, truncated };
|
|
@@ -336928,7 +336946,7 @@ __export(exports_teamHelpers, {
|
|
|
336928
336946
|
});
|
|
336929
336947
|
import { mkdirSync as mkdirSync4, readFileSync as readFileSync11, writeFileSync as writeFileSync3 } from "fs";
|
|
336930
336948
|
import { mkdir as mkdir21, readFile as readFile27, rm as rm6, writeFile as writeFile21 } from "fs/promises";
|
|
336931
|
-
import { join as
|
|
336949
|
+
import { join as join89 } from "path";
|
|
336932
336950
|
function sanitizeName(name) {
|
|
336933
336951
|
return name.replace(/[^a-zA-Z0-9]/g, "-").toLowerCase();
|
|
336934
336952
|
}
|
|
@@ -336936,10 +336954,10 @@ function sanitizeAgentName(name) {
|
|
|
336936
336954
|
return name.replace(/@/g, "-");
|
|
336937
336955
|
}
|
|
336938
336956
|
function getTeamDir(teamName) {
|
|
336939
|
-
return
|
|
336957
|
+
return join89(getTeamsDir(), sanitizeName(teamName));
|
|
336940
336958
|
}
|
|
336941
336959
|
function getTeamFilePath(teamName) {
|
|
336942
|
-
return
|
|
336960
|
+
return join89(getTeamDir(teamName), "config.json");
|
|
336943
336961
|
}
|
|
336944
336962
|
function readTeamFile(teamName) {
|
|
336945
336963
|
try {
|
|
@@ -337130,15 +337148,15 @@ async function setMemberActive(teamName, memberName, isActive) {
|
|
|
337130
337148
|
logForDebugging(`[TeammateTool] Set member ${memberName} in team ${teamName} to ${isActive ? "active" : "idle"}`);
|
|
337131
337149
|
}
|
|
337132
337150
|
async function destroyWorktree(worktreePath) {
|
|
337133
|
-
const gitFilePath =
|
|
337151
|
+
const gitFilePath = join89(worktreePath, ".git");
|
|
337134
337152
|
let mainRepoPath = null;
|
|
337135
337153
|
try {
|
|
337136
337154
|
const gitFileContent = (await readFile27(gitFilePath, "utf-8")).trim();
|
|
337137
337155
|
const match = gitFileContent.match(/^gitdir:\s*(.+)$/);
|
|
337138
337156
|
if (match && match[1]) {
|
|
337139
337157
|
const worktreeGitDir = match[1];
|
|
337140
|
-
const mainGitDir =
|
|
337141
|
-
mainRepoPath =
|
|
337158
|
+
const mainGitDir = join89(worktreeGitDir, "..", "..");
|
|
337159
|
+
mainRepoPath = join89(mainGitDir, "..");
|
|
337142
337160
|
}
|
|
337143
337161
|
} catch {}
|
|
337144
337162
|
if (mainRepoPath) {
|
|
@@ -338885,7 +338903,7 @@ var init_attachments = __esm(() => {
|
|
|
338885
338903
|
});
|
|
338886
338904
|
|
|
338887
338905
|
// src/utils/plugins/loadPluginCommands.ts
|
|
338888
|
-
import { basename as basename23, dirname as dirname37, join as
|
|
338906
|
+
import { basename as basename23, dirname as dirname37, join as join90 } from "path";
|
|
338889
338907
|
function isSkillFile(filePath) {
|
|
338890
338908
|
return /^skill\.md$/i.test(basename23(filePath));
|
|
338891
338909
|
}
|
|
@@ -339064,7 +339082,7 @@ function clearPluginCommandCache() {
|
|
|
339064
339082
|
async function loadSkillsFromDirectory(skillsPath, pluginName, sourceName, pluginManifest, pluginPath, loadedPaths) {
|
|
339065
339083
|
const fs8 = getFsImplementation();
|
|
339066
339084
|
const skills = [];
|
|
339067
|
-
const directSkillPath =
|
|
339085
|
+
const directSkillPath = join90(skillsPath, "SKILL.md");
|
|
339068
339086
|
let directSkillContent = null;
|
|
339069
339087
|
try {
|
|
339070
339088
|
directSkillContent = await fs8.readFile(directSkillPath, {
|
|
@@ -339115,8 +339133,8 @@ async function loadSkillsFromDirectory(skillsPath, pluginName, sourceName, plugi
|
|
|
339115
339133
|
if (!entry.isDirectory() && !entry.isSymbolicLink()) {
|
|
339116
339134
|
return;
|
|
339117
339135
|
}
|
|
339118
|
-
const skillDirPath =
|
|
339119
|
-
const skillFilePath =
|
|
339136
|
+
const skillDirPath = join90(skillsPath, entry.name);
|
|
339137
|
+
const skillFilePath = join90(skillDirPath, "SKILL.md");
|
|
339120
339138
|
let content;
|
|
339121
339139
|
try {
|
|
339122
339140
|
content = await fs8.readFile(skillFilePath, { encoding: "utf-8" });
|
|
@@ -339220,7 +339238,7 @@ var init_loadPluginCommands = __esm(() => {
|
|
|
339220
339238
|
if (plugin.commandsMetadata) {
|
|
339221
339239
|
for (const [name, metadata] of Object.entries(plugin.commandsMetadata)) {
|
|
339222
339240
|
if (metadata.source) {
|
|
339223
|
-
const fullMetadataPath =
|
|
339241
|
+
const fullMetadataPath = join90(plugin.path, metadata.source);
|
|
339224
339242
|
if (commandPath === fullMetadataPath) {
|
|
339225
339243
|
commandName = `${plugin.name}:${name}`;
|
|
339226
339244
|
metadataOverride = metadata;
|
|
@@ -339462,7 +339480,7 @@ var init_loadPluginOutputStyles = __esm(() => {
|
|
|
339462
339480
|
|
|
339463
339481
|
// src/utils/plugins/cacheUtils.ts
|
|
339464
339482
|
import { readdir as readdir18, rm as rm7, stat as stat30, unlink as unlink13, writeFile as writeFile22 } from "fs/promises";
|
|
339465
|
-
import { join as
|
|
339483
|
+
import { join as join91 } from "path";
|
|
339466
339484
|
function clearAllPluginCaches() {
|
|
339467
339485
|
clearPluginCache();
|
|
339468
339486
|
clearPluginCommandCache();
|
|
@@ -339499,11 +339517,11 @@ async function cleanupOrphanedPluginVersionsInBackground() {
|
|
|
339499
339517
|
const now2 = Date.now();
|
|
339500
339518
|
await Promise.all([...installedVersions].map((p) => removeOrphanedAtMarker(p)));
|
|
339501
339519
|
for (const marketplace of await readSubdirs(cachePath)) {
|
|
339502
|
-
const marketplacePath =
|
|
339520
|
+
const marketplacePath = join91(cachePath, marketplace);
|
|
339503
339521
|
for (const plugin of await readSubdirs(marketplacePath)) {
|
|
339504
|
-
const pluginPath =
|
|
339522
|
+
const pluginPath = join91(marketplacePath, plugin);
|
|
339505
339523
|
for (const version2 of await readSubdirs(pluginPath)) {
|
|
339506
|
-
const versionPath =
|
|
339524
|
+
const versionPath = join91(pluginPath, version2);
|
|
339507
339525
|
if (installedVersions.has(versionPath))
|
|
339508
339526
|
continue;
|
|
339509
339527
|
await processOrphanedPluginVersion(versionPath, now2);
|
|
@@ -339517,7 +339535,7 @@ async function cleanupOrphanedPluginVersionsInBackground() {
|
|
|
339517
339535
|
}
|
|
339518
339536
|
}
|
|
339519
339537
|
function getOrphanedAtPath(versionPath) {
|
|
339520
|
-
return
|
|
339538
|
+
return join91(versionPath, ORPHANED_AT_FILENAME2);
|
|
339521
339539
|
}
|
|
339522
339540
|
async function removeOrphanedAtMarker(versionPath) {
|
|
339523
339541
|
const orphanedAtPath = getOrphanedAtPath(versionPath);
|
|
@@ -339607,7 +339625,7 @@ var init_cacheUtils = __esm(() => {
|
|
|
339607
339625
|
|
|
339608
339626
|
// src/utils/plugins/officialMarketplaceGcs.ts
|
|
339609
339627
|
import { chmod as chmod8, mkdir as mkdir22, readFile as readFile28, rename as rename6, rm as rm8, writeFile as writeFile23 } from "fs/promises";
|
|
339610
|
-
import { dirname as dirname38, join as
|
|
339628
|
+
import { dirname as dirname38, join as join92, resolve as resolve29, sep as sep18 } from "path";
|
|
339611
339629
|
async function fetchOfficialMarketplaceFromGcs(installLocation, marketplacesCacheDir) {
|
|
339612
339630
|
const cacheDir = resolve29(marketplacesCacheDir);
|
|
339613
339631
|
const resolvedLoc = resolve29(installLocation);
|
|
@@ -339630,7 +339648,7 @@ async function fetchOfficialMarketplaceFromGcs(installLocation, marketplacesCach
|
|
|
339630
339648
|
if (!sha) {
|
|
339631
339649
|
throw new Error("latest pointer returned empty body");
|
|
339632
339650
|
}
|
|
339633
|
-
const sentinelPath =
|
|
339651
|
+
const sentinelPath = join92(installLocation, ".gcs-sha");
|
|
339634
339652
|
const currentSha = await readFile28(sentinelPath, "utf8").then((s) => s.trim(), () => null);
|
|
339635
339653
|
if (currentSha === sha) {
|
|
339636
339654
|
outcome = "noop";
|
|
@@ -339653,7 +339671,7 @@ async function fetchOfficialMarketplaceFromGcs(installLocation, marketplacesCach
|
|
|
339653
339671
|
const rel = arcPath.slice(ARC_PREFIX.length);
|
|
339654
339672
|
if (!rel || rel.endsWith("/"))
|
|
339655
339673
|
continue;
|
|
339656
|
-
const dest =
|
|
339674
|
+
const dest = join92(staging, rel);
|
|
339657
339675
|
await mkdir22(dirname38(dest), { recursive: true });
|
|
339658
339676
|
await writeFile23(dest, data);
|
|
339659
339677
|
const mode = modes[arcPath];
|
|
@@ -339661,7 +339679,7 @@ async function fetchOfficialMarketplaceFromGcs(installLocation, marketplacesCach
|
|
|
339661
339679
|
await chmod8(dest, mode & 511).catch(() => {});
|
|
339662
339680
|
}
|
|
339663
339681
|
}
|
|
339664
|
-
await writeFile23(
|
|
339682
|
+
await writeFile23(join92(staging, ".gcs-sha"), sha);
|
|
339665
339683
|
await rm8(installLocation, { recursive: true, force: true });
|
|
339666
339684
|
await rename6(staging, installLocation);
|
|
339667
339685
|
outcome = "updated";
|
|
@@ -339728,12 +339746,12 @@ var init_officialMarketplaceGcs = __esm(() => {
|
|
|
339728
339746
|
|
|
339729
339747
|
// src/utils/plugins/marketplaceManager.ts
|
|
339730
339748
|
import { writeFile as writeFile24 } from "fs/promises";
|
|
339731
|
-
import { basename as basename25, dirname as dirname39, isAbsolute as isAbsolute19, join as
|
|
339749
|
+
import { basename as basename25, dirname as dirname39, isAbsolute as isAbsolute19, join as join93, resolve as resolve30, sep as sep19 } from "path";
|
|
339732
339750
|
function getKnownMarketplacesFile() {
|
|
339733
|
-
return
|
|
339751
|
+
return join93(getPluginsDirectory(), "known_marketplaces.json");
|
|
339734
339752
|
}
|
|
339735
339753
|
function getMarketplacesCacheDir() {
|
|
339736
|
-
return
|
|
339754
|
+
return join93(getPluginsDirectory(), "marketplaces");
|
|
339737
339755
|
}
|
|
339738
339756
|
function clearMarketplacesCache() {
|
|
339739
339757
|
getMarketplace.cache?.clear?.();
|
|
@@ -339820,7 +339838,7 @@ async function saveKnownMarketplacesConfig(config3) {
|
|
|
339820
339838
|
throw new ConfigParseError(`Invalid marketplace config: ${parsed.error.message}`, configFile, config3);
|
|
339821
339839
|
}
|
|
339822
339840
|
const fs8 = getFsImplementation();
|
|
339823
|
-
const dir =
|
|
339841
|
+
const dir = join93(configFile, "..");
|
|
339824
339842
|
await fs8.mkdir(dir);
|
|
339825
339843
|
writeFileSync_DEPRECATED(configFile, jsonStringify(parsed.data, null, 2), {
|
|
339826
339844
|
encoding: "utf-8",
|
|
@@ -339867,7 +339885,7 @@ async function registerSeedMarketplaces() {
|
|
|
339867
339885
|
return false;
|
|
339868
339886
|
}
|
|
339869
339887
|
async function readSeedKnownMarketplaces(seedDir) {
|
|
339870
|
-
const seedJsonPath =
|
|
339888
|
+
const seedJsonPath = join93(seedDir, "known_marketplaces.json");
|
|
339871
339889
|
try {
|
|
339872
339890
|
const content = await getFsImplementation().readFile(seedJsonPath, {
|
|
339873
339891
|
encoding: "utf-8"
|
|
@@ -339886,8 +339904,8 @@ async function readSeedKnownMarketplaces(seedDir) {
|
|
|
339886
339904
|
}
|
|
339887
339905
|
}
|
|
339888
339906
|
async function findSeedMarketplaceLocation(seedDir, name) {
|
|
339889
|
-
const dirCandidate =
|
|
339890
|
-
const jsonCandidate =
|
|
339907
|
+
const dirCandidate = join93(seedDir, "marketplaces", name);
|
|
339908
|
+
const jsonCandidate = join93(seedDir, "marketplaces", `${name}.json`);
|
|
339891
339909
|
for (const candidate of [dirCandidate, jsonCandidate]) {
|
|
339892
339910
|
try {
|
|
339893
339911
|
await readCachedMarketplace(candidate);
|
|
@@ -339939,7 +339957,7 @@ async function gitPull(cwd2, ref, options2) {
|
|
|
339939
339957
|
async function gitSubmoduleUpdate(cwd2, credentialArgs, env4, sparsePaths) {
|
|
339940
339958
|
if (sparsePaths && sparsePaths.length > 0)
|
|
339941
339959
|
return;
|
|
339942
|
-
const hasGitmodules = await getFsImplementation().stat(
|
|
339960
|
+
const hasGitmodules = await getFsImplementation().stat(join93(cwd2, ".gitmodules")).then(() => true, () => false);
|
|
339943
339961
|
if (!hasGitmodules)
|
|
339944
339962
|
return;
|
|
339945
339963
|
const result = await execFileNoThrowWithCwd(gitExe(), [
|
|
@@ -340301,7 +340319,7 @@ Technical details: ${error41.message}`);
|
|
|
340301
340319
|
}
|
|
340302
340320
|
logPluginFetch("marketplace_url", url3, "success", performance.now() - fetchStarted);
|
|
340303
340321
|
safeCallProgress(onProgress, "Saving marketplace to cache");
|
|
340304
|
-
const cacheDir =
|
|
340322
|
+
const cacheDir = join93(cachePath, "..");
|
|
340305
340323
|
await fs8.mkdir(cacheDir);
|
|
340306
340324
|
writeFileSync_DEPRECATED(cachePath, jsonStringify(result.data, null, 2), {
|
|
340307
340325
|
encoding: "utf-8",
|
|
@@ -340338,7 +340356,7 @@ async function loadAndCacheMarketplace(source, onProgress) {
|
|
|
340338
340356
|
try {
|
|
340339
340357
|
switch (source.source) {
|
|
340340
340358
|
case "url": {
|
|
340341
|
-
temporaryCachePath =
|
|
340359
|
+
temporaryCachePath = join93(cacheDir, `${tempName}.json`);
|
|
340342
340360
|
cleanupNeeded = true;
|
|
340343
340361
|
await cacheMarketplaceFromUrl(source.url, temporaryCachePath, source.headers, onProgress);
|
|
340344
340362
|
marketplacePath = temporaryCachePath;
|
|
@@ -340347,7 +340365,7 @@ async function loadAndCacheMarketplace(source, onProgress) {
|
|
|
340347
340365
|
case "github": {
|
|
340348
340366
|
const sshUrl = `git@github.com:${source.repo}.git`;
|
|
340349
340367
|
const httpsUrl = `https://github.com/${source.repo}.git`;
|
|
340350
|
-
temporaryCachePath =
|
|
340368
|
+
temporaryCachePath = join93(cacheDir, tempName);
|
|
340351
340369
|
cleanupNeeded = true;
|
|
340352
340370
|
let lastError = null;
|
|
340353
340371
|
const sshConfigured = await isGitHubSshLikelyConfigured();
|
|
@@ -340392,14 +340410,14 @@ async function loadAndCacheMarketplace(source, onProgress) {
|
|
|
340392
340410
|
if (lastError) {
|
|
340393
340411
|
throw lastError;
|
|
340394
340412
|
}
|
|
340395
|
-
marketplacePath =
|
|
340413
|
+
marketplacePath = join93(temporaryCachePath, source.path || ".vivus-plugin/marketplace.json");
|
|
340396
340414
|
break;
|
|
340397
340415
|
}
|
|
340398
340416
|
case "git": {
|
|
340399
|
-
temporaryCachePath =
|
|
340417
|
+
temporaryCachePath = join93(cacheDir, tempName);
|
|
340400
340418
|
cleanupNeeded = true;
|
|
340401
340419
|
await cacheMarketplaceFromGit(source.url, temporaryCachePath, source.ref, source.sparsePaths, onProgress);
|
|
340402
|
-
marketplacePath =
|
|
340420
|
+
marketplacePath = join93(temporaryCachePath, source.path || ".vivus-plugin/marketplace.json");
|
|
340403
340421
|
break;
|
|
340404
340422
|
}
|
|
340405
340423
|
case "npm": {
|
|
@@ -340414,8 +340432,8 @@ async function loadAndCacheMarketplace(source, onProgress) {
|
|
|
340414
340432
|
}
|
|
340415
340433
|
case "directory": {
|
|
340416
340434
|
const absPath = resolve30(source.path);
|
|
340417
|
-
const vivusPath =
|
|
340418
|
-
const claudePath =
|
|
340435
|
+
const vivusPath = join93(absPath, ".vivus-plugin", "marketplace.json");
|
|
340436
|
+
const claudePath = join93(absPath, ".claude-plugin", "marketplace.json");
|
|
340419
340437
|
try {
|
|
340420
340438
|
await fs8.stat(vivusPath);
|
|
340421
340439
|
marketplacePath = vivusPath;
|
|
@@ -340427,8 +340445,8 @@ async function loadAndCacheMarketplace(source, onProgress) {
|
|
|
340427
340445
|
break;
|
|
340428
340446
|
}
|
|
340429
340447
|
case "settings": {
|
|
340430
|
-
temporaryCachePath =
|
|
340431
|
-
marketplacePath =
|
|
340448
|
+
temporaryCachePath = join93(cacheDir, source.name);
|
|
340449
|
+
marketplacePath = join93(temporaryCachePath, ".vivus-plugin", "marketplace.json");
|
|
340432
340450
|
cleanupNeeded = false;
|
|
340433
340451
|
await fs8.mkdir(dirname39(marketplacePath));
|
|
340434
340452
|
await writeFile24(marketplacePath, jsonStringify({
|
|
@@ -340463,7 +340481,7 @@ async function loadAndCacheMarketplace(source, onProgress) {
|
|
|
340463
340481
|
}
|
|
340464
340482
|
throw new Error(`Failed to parse marketplace file at ${marketplacePath}: ${errorMessage(e)}`);
|
|
340465
340483
|
}
|
|
340466
|
-
const finalCachePath =
|
|
340484
|
+
const finalCachePath = join93(cacheDir, marketplace.name);
|
|
340467
340485
|
const resolvedFinal = resolve30(finalCachePath);
|
|
340468
340486
|
const resolvedCacheDir = resolve30(cacheDir);
|
|
340469
340487
|
if (!resolvedFinal.startsWith(resolvedCacheDir + sep19)) {
|
|
@@ -340584,9 +340602,9 @@ async function removeMarketplaceSource(name) {
|
|
|
340584
340602
|
await saveKnownMarketplacesConfig(config3);
|
|
340585
340603
|
const fs8 = getFsImplementation();
|
|
340586
340604
|
const cacheDir = getMarketplacesCacheDir();
|
|
340587
|
-
const cachePath =
|
|
340605
|
+
const cachePath = join93(cacheDir, name);
|
|
340588
340606
|
await fs8.rm(cachePath, { recursive: true, force: true });
|
|
340589
|
-
const jsonCachePath =
|
|
340607
|
+
const jsonCachePath = join93(cacheDir, `${name}.json`);
|
|
340590
340608
|
await fs8.rm(jsonCachePath, { force: true });
|
|
340591
340609
|
const editableSources = ["userSettings", "projectSettings", "localSettings"];
|
|
340592
340610
|
for (const source of editableSources) {
|
|
@@ -340637,7 +340655,7 @@ async function removeMarketplaceSource(name) {
|
|
|
340637
340655
|
logForDebugging(`Removed marketplace source: ${name}`);
|
|
340638
340656
|
}
|
|
340639
340657
|
async function readCachedMarketplace(installLocation) {
|
|
340640
|
-
const nestedPath =
|
|
340658
|
+
const nestedPath = join93(installLocation, ".vivus-plugin", "marketplace.json");
|
|
340641
340659
|
try {
|
|
340642
340660
|
return await parseFileWithSchema(nestedPath, PluginMarketplaceSchema());
|
|
340643
340661
|
} catch (e) {
|
|
@@ -340647,7 +340665,7 @@ async function readCachedMarketplace(installLocation) {
|
|
|
340647
340665
|
if (code !== "ENOENT" && code !== "ENOTDIR")
|
|
340648
340666
|
throw e;
|
|
340649
340667
|
}
|
|
340650
|
-
const claudePath =
|
|
340668
|
+
const claudePath = join93(installLocation, ".claude-plugin", "marketplace.json");
|
|
340651
340669
|
try {
|
|
340652
340670
|
return await parseFileWithSchema(claudePath, PluginMarketplaceSchema());
|
|
340653
340671
|
} catch (e) {
|
|
@@ -340947,12 +340965,12 @@ var init_marketplaceManager = __esm(() => {
|
|
|
340947
340965
|
});
|
|
340948
340966
|
|
|
340949
340967
|
// src/utils/plugins/installedPluginsManager.ts
|
|
340950
|
-
import { dirname as dirname40, join as
|
|
340968
|
+
import { dirname as dirname40, join as join94 } from "path";
|
|
340951
340969
|
function getInstalledPluginsFilePath() {
|
|
340952
|
-
return
|
|
340970
|
+
return join94(getPluginsDirectory(), "installed_plugins.json");
|
|
340953
340971
|
}
|
|
340954
340972
|
function getInstalledPluginsV2FilePath() {
|
|
340955
|
-
return
|
|
340973
|
+
return join94(getPluginsDirectory(), "installed_plugins_v2.json");
|
|
340956
340974
|
}
|
|
340957
340975
|
function migrateToSinglePluginFile() {
|
|
340958
340976
|
if (migrationCompleted) {
|
|
@@ -341020,12 +341038,12 @@ function cleanupLegacyCache(v2Data) {
|
|
|
341020
341038
|
continue;
|
|
341021
341039
|
}
|
|
341022
341040
|
const entry = dirent.name;
|
|
341023
|
-
const entryPath =
|
|
341041
|
+
const entryPath = join94(cachePath, entry);
|
|
341024
341042
|
const subEntries = fs8.readdirSync(entryPath);
|
|
341025
341043
|
const hasVersionedStructure = subEntries.some((subDirent) => {
|
|
341026
341044
|
if (!subDirent.isDirectory())
|
|
341027
341045
|
return false;
|
|
341028
|
-
const subPath =
|
|
341046
|
+
const subPath = join94(entryPath, subDirent.name);
|
|
341029
341047
|
const versionEntries = fs8.readdirSync(subPath);
|
|
341030
341048
|
return versionEntries.some((vDirent) => vDirent.isDirectory());
|
|
341031
341049
|
});
|
|
@@ -341280,7 +341298,7 @@ async function getGitCommitSha2(dirPath) {
|
|
|
341280
341298
|
}
|
|
341281
341299
|
function getPluginVersionFromManifest(pluginCachePath, pluginId) {
|
|
341282
341300
|
const fs8 = getFsImplementation();
|
|
341283
|
-
const manifestPath =
|
|
341301
|
+
const manifestPath = join94(pluginCachePath, ".vivus-plugin", "plugin.json");
|
|
341284
341302
|
try {
|
|
341285
341303
|
const manifestContent = fs8.readFileSync(manifestPath, { encoding: "utf-8" });
|
|
341286
341304
|
const manifest = jsonParse(manifestContent);
|
|
@@ -341374,13 +341392,13 @@ async function migrateFromEnabledPlugins() {
|
|
|
341374
341392
|
let version2 = "unknown";
|
|
341375
341393
|
let gitCommitSha = undefined;
|
|
341376
341394
|
if (typeof entry.source === "string") {
|
|
341377
|
-
installPath =
|
|
341395
|
+
installPath = join94(marketplaceInstallLocation, entry.source);
|
|
341378
341396
|
version2 = getPluginVersionFromManifest(installPath, pluginId);
|
|
341379
341397
|
gitCommitSha = await getGitCommitSha2(installPath);
|
|
341380
341398
|
} else {
|
|
341381
341399
|
const cachePath = getPluginCachePath();
|
|
341382
341400
|
const sanitizedName = pluginName.replace(/[^a-zA-Z0-9-_]/g, "-");
|
|
341383
|
-
const pluginCachePath =
|
|
341401
|
+
const pluginCachePath = join94(cachePath, sanitizedName);
|
|
341384
341402
|
let dirEntries;
|
|
341385
341403
|
try {
|
|
341386
341404
|
dirEntries = (await getFsImplementation().readdir(pluginCachePath)).map((e) => typeof e === "string" ? e : e.name);
|
|
@@ -341738,7 +341756,7 @@ __export(exports_commitAttribution, {
|
|
|
341738
341756
|
});
|
|
341739
341757
|
import { createHash as createHash19, randomUUID as randomUUID16 } from "crypto";
|
|
341740
341758
|
import { stat as stat31 } from "fs/promises";
|
|
341741
|
-
import { isAbsolute as isAbsolute20, join as
|
|
341759
|
+
import { isAbsolute as isAbsolute20, join as join95, relative as relative15, sep as sep21 } from "path";
|
|
341742
341760
|
function getAttributionRepoRoot() {
|
|
341743
341761
|
const cwd2 = getCwd();
|
|
341744
341762
|
return findGitRoot(cwd2) ?? getOriginalCwd();
|
|
@@ -341817,7 +341835,7 @@ function expandFilePath(filePath) {
|
|
|
341817
341835
|
if (isAbsolute20(filePath)) {
|
|
341818
341836
|
return filePath;
|
|
341819
341837
|
}
|
|
341820
|
-
return
|
|
341838
|
+
return join95(getAttributionRepoRoot(), filePath);
|
|
341821
341839
|
}
|
|
341822
341840
|
function createEmptyAttributionState() {
|
|
341823
341841
|
return {
|
|
@@ -341975,7 +341993,7 @@ async function calculateCommitAttribution(states, stagedFiles) {
|
|
|
341975
341993
|
if (isGeneratedFile(file2)) {
|
|
341976
341994
|
return { type: "generated", file: file2 };
|
|
341977
341995
|
}
|
|
341978
|
-
const absPath =
|
|
341996
|
+
const absPath = join95(cwd2, file2);
|
|
341979
341997
|
const fileState = mergedFileStates.get(file2);
|
|
341980
341998
|
const baseline = mergedBaselines.get(file2);
|
|
341981
341999
|
const fileSurface = states[0].surface;
|
|
@@ -342117,7 +342135,7 @@ async function isGitTransientState() {
|
|
|
342117
342135
|
];
|
|
342118
342136
|
const results = await Promise.all(indicators.map(async (indicator) => {
|
|
342119
342137
|
try {
|
|
342120
|
-
await stat31(
|
|
342138
|
+
await stat31(join95(gitDir, indicator));
|
|
342121
342139
|
return true;
|
|
342122
342140
|
} catch {
|
|
342123
342141
|
return false;
|
|
@@ -352254,16 +352272,16 @@ import {
|
|
|
352254
352272
|
basename as basename28,
|
|
352255
352273
|
dirname as dirname41,
|
|
352256
352274
|
isAbsolute as isAbsolute22,
|
|
352257
|
-
join as
|
|
352275
|
+
join as join96,
|
|
352258
352276
|
sep as pathSep,
|
|
352259
352277
|
relative as relative16
|
|
352260
352278
|
} from "path";
|
|
352261
352279
|
function getSkillsPath(source, dir) {
|
|
352262
352280
|
switch (source) {
|
|
352263
352281
|
case "policySettings":
|
|
352264
|
-
return
|
|
352282
|
+
return join96(getManagedFilePath(), ".vivus", dir);
|
|
352265
352283
|
case "userSettings":
|
|
352266
|
-
return
|
|
352284
|
+
return join96(getVivusConfigHomeDir(), dir);
|
|
352267
352285
|
case "projectSettings":
|
|
352268
352286
|
return `.vivus/${dir}`;
|
|
352269
352287
|
case "plugin":
|
|
@@ -352433,8 +352451,8 @@ async function loadSkillsFromSkillsDir(basePath, source) {
|
|
|
352433
352451
|
if (!entry.isDirectory() && !entry.isSymbolicLink()) {
|
|
352434
352452
|
return null;
|
|
352435
352453
|
}
|
|
352436
|
-
const skillDirPath =
|
|
352437
|
-
const skillFilePath =
|
|
352454
|
+
const skillDirPath = join96(basePath, entry.name);
|
|
352455
|
+
const skillFilePath = join96(skillDirPath, "SKILL.md");
|
|
352438
352456
|
let content;
|
|
352439
352457
|
try {
|
|
352440
352458
|
content = await fs8.readFile(skillFilePath, { encoding: "utf-8" });
|
|
@@ -352589,7 +352607,7 @@ async function discoverSkillDirsForPaths(filePaths, cwd2) {
|
|
|
352589
352607
|
for (const filePath of filePaths) {
|
|
352590
352608
|
let currentDir = dirname41(filePath);
|
|
352591
352609
|
while (currentDir.startsWith(resolvedCwd + pathSep)) {
|
|
352592
|
-
const skillDir =
|
|
352610
|
+
const skillDir = join96(currentDir, ".vivus", "skills");
|
|
352593
352611
|
if (!dynamicSkillDirs.has(skillDir)) {
|
|
352594
352612
|
dynamicSkillDirs.add(skillDir);
|
|
352595
352613
|
try {
|
|
@@ -352712,8 +352730,8 @@ var init_loadSkillsDir = __esm(() => {
|
|
|
352712
352730
|
init_types2();
|
|
352713
352731
|
import_ignore = __toESM(require_ignore(), 1);
|
|
352714
352732
|
getSkillDirCommands = memoize_default(async (cwd2) => {
|
|
352715
|
-
const userSkillsDir =
|
|
352716
|
-
const managedSkillsDir =
|
|
352733
|
+
const userSkillsDir = join96(getVivusConfigHomeDir(), "skills");
|
|
352734
|
+
const managedSkillsDir = join96(getManagedFilePath(), ".vivus", "skills");
|
|
352717
352735
|
const projectSkillsDirs = getProjectDirsUpToHome("skills", cwd2);
|
|
352718
352736
|
logForDebugging(`Loading skills from: managed=${managedSkillsDir}, user=${userSkillsDir}, project=[${projectSkillsDirs.join(", ")}]`);
|
|
352719
352737
|
const additionalDirs = getAdditionalDirectoriesForVivusMd();
|
|
@@ -352724,7 +352742,7 @@ var init_loadSkillsDir = __esm(() => {
|
|
|
352724
352742
|
logForDebugging(`[bare] Skipping skill dir discovery (${additionalDirs.length === 0 ? "no --add-dir" : "projectSettings disabled or skillsLocked"})`);
|
|
352725
352743
|
return [];
|
|
352726
352744
|
}
|
|
352727
|
-
const additionalSkillsNested2 = await Promise.all(additionalDirs.map((dir) => loadSkillsFromSkillsDir(
|
|
352745
|
+
const additionalSkillsNested2 = await Promise.all(additionalDirs.map((dir) => loadSkillsFromSkillsDir(join96(dir, ".vivus", "skills"), "projectSettings")));
|
|
352728
352746
|
return additionalSkillsNested2.flat().map((s) => s.skill);
|
|
352729
352747
|
}
|
|
352730
352748
|
const [
|
|
@@ -352737,7 +352755,7 @@ var init_loadSkillsDir = __esm(() => {
|
|
|
352737
352755
|
isEnvTruthy(process.env.VIVUS_CODE_DISABLE_POLICY_SKILLS) ? Promise.resolve([]) : loadSkillsFromSkillsDir(managedSkillsDir, "policySettings"),
|
|
352738
352756
|
isSettingSourceEnabled("userSettings") && !skillsLocked ? loadSkillsFromSkillsDir(userSkillsDir, "userSettings") : Promise.resolve([]),
|
|
352739
352757
|
projectSettingsEnabled ? Promise.all(projectSkillsDirs.map((dir) => loadSkillsFromSkillsDir(dir, "projectSettings"))) : Promise.resolve([]),
|
|
352740
|
-
projectSettingsEnabled ? Promise.all(additionalDirs.map((dir) => loadSkillsFromSkillsDir(
|
|
352758
|
+
projectSettingsEnabled ? Promise.all(additionalDirs.map((dir) => loadSkillsFromSkillsDir(join96(dir, ".vivus", "skills"), "projectSettings"))) : Promise.resolve([]),
|
|
352741
352759
|
skillsLocked ? Promise.resolve([]) : loadSkillsFromCommandsDir(cwd2)
|
|
352742
352760
|
]);
|
|
352743
352761
|
const allSkillsWithPaths = [
|
|
@@ -353845,7 +353863,7 @@ var init_toolSearch = __esm(() => {
|
|
|
353845
353863
|
// src/services/vcr.ts
|
|
353846
353864
|
import { createHash as createHash20, randomUUID as randomUUID18 } from "crypto";
|
|
353847
353865
|
import { mkdir as mkdir23, readFile as readFile29, writeFile as writeFile25 } from "fs/promises";
|
|
353848
|
-
import { dirname as dirname42, join as
|
|
353866
|
+
import { dirname as dirname42, join as join97 } from "path";
|
|
353849
353867
|
function shouldUseVCR() {
|
|
353850
353868
|
if (false) {}
|
|
353851
353869
|
if (process.env.USER_TYPE === "ant" && isEnvTruthy(process.env.FORCE_VCR)) {
|
|
@@ -353858,7 +353876,7 @@ async function withFixture(input, fixtureName, f) {
|
|
|
353858
353876
|
return await f();
|
|
353859
353877
|
}
|
|
353860
353878
|
const hash2 = createHash20("sha1").update(jsonStringify(input)).digest("hex").slice(0, 12);
|
|
353861
|
-
const filename =
|
|
353879
|
+
const filename = join97(process.env.VIVUS_CODE_TEST_FIXTURES_ROOT ?? getCwd(), `fixtures/${fixtureName}-${hash2}.json`);
|
|
353862
353880
|
try {
|
|
353863
353881
|
const cached3 = jsonParse(await readFile29(filename, { encoding: "utf8" }));
|
|
353864
353882
|
return cached3;
|
|
@@ -353892,7 +353910,7 @@ async function withVCR(messages, f) {
|
|
|
353892
353910
|
return true;
|
|
353893
353911
|
}));
|
|
353894
353912
|
const dehydratedInput = mapMessages(messagesForAPI.map((_) => _.message.content), dehydrateValue);
|
|
353895
|
-
const filename =
|
|
353913
|
+
const filename = join97(process.env.VIVUS_CODE_TEST_FIXTURES_ROOT ?? getCwd(), `fixtures/${dehydratedInput.map((_) => createHash20("sha1").update(jsonStringify(_)).digest("hex").slice(0, 6)).join("-")}.json`);
|
|
353896
353914
|
try {
|
|
353897
353915
|
const cached3 = jsonParse(await readFile29(filename, { encoding: "utf8" }));
|
|
353898
353916
|
cached3.output.forEach(addCachedCostToTotalSessionCost);
|
|
@@ -354618,7 +354636,7 @@ var init_postCompactCleanup = __esm(() => {
|
|
|
354618
354636
|
|
|
354619
354637
|
// src/services/SessionMemory/prompts.ts
|
|
354620
354638
|
import { readFile as readFile30 } from "fs/promises";
|
|
354621
|
-
import { join as
|
|
354639
|
+
import { join as join98 } from "path";
|
|
354622
354640
|
function getDefaultUpdatePrompt() {
|
|
354623
354641
|
return `IMPORTANT: This message and these instructions are NOT part of the actual user conversation. Do NOT include any references to "note-taking", "session notes extraction", or these update instructions in the notes content.
|
|
354624
354642
|
|
|
@@ -354659,7 +354677,7 @@ You ONLY update the actual content that comes AFTER these two preserved lines. T
|
|
|
354659
354677
|
REMEMBER: Use the Edit tool in parallel and stop. Do not continue after the edits. Only include insights from the actual user conversation, never from these note-taking instructions. Do not delete or change section headers or italic _section descriptions_.`;
|
|
354660
354678
|
}
|
|
354661
354679
|
async function loadSessionMemoryTemplate() {
|
|
354662
|
-
const templatePath =
|
|
354680
|
+
const templatePath = join98(getVivusConfigHomeDir(), "session-memory", "config", "template.md");
|
|
354663
354681
|
try {
|
|
354664
354682
|
return await readFile30(templatePath, { encoding: "utf-8" });
|
|
354665
354683
|
} catch (e) {
|
|
@@ -354672,7 +354690,7 @@ async function loadSessionMemoryTemplate() {
|
|
|
354672
354690
|
}
|
|
354673
354691
|
}
|
|
354674
354692
|
async function loadSessionMemoryPrompt() {
|
|
354675
|
-
const promptPath =
|
|
354693
|
+
const promptPath = join98(getVivusConfigHomeDir(), "session-memory", "config", "prompt.md");
|
|
354676
354694
|
try {
|
|
354677
354695
|
return await readFile30(promptPath, { encoding: "utf-8" });
|
|
354678
354696
|
} catch (e) {
|
|
@@ -357948,7 +357966,7 @@ var init_consolidationPrompt = __esm(() => {
|
|
|
357948
357966
|
|
|
357949
357967
|
// src/utils/listSessionsImpl.ts
|
|
357950
357968
|
import { readdir as readdir19, stat as stat33 } from "fs/promises";
|
|
357951
|
-
import { basename as basename29, join as
|
|
357969
|
+
import { basename as basename29, join as join99 } from "path";
|
|
357952
357970
|
async function listCandidates(projectDir, doStat, projectPath) {
|
|
357953
357971
|
let names;
|
|
357954
357972
|
try {
|
|
@@ -357962,7 +357980,7 @@ async function listCandidates(projectDir, doStat, projectPath) {
|
|
|
357962
357980
|
const sessionId = validateUuid(name.slice(0, -6));
|
|
357963
357981
|
if (!sessionId)
|
|
357964
357982
|
return null;
|
|
357965
|
-
const filePath =
|
|
357983
|
+
const filePath = join99(projectDir, name);
|
|
357966
357984
|
if (!doStat)
|
|
357967
357985
|
return { sessionId, filePath, mtime: 0, projectPath };
|
|
357968
357986
|
try {
|
|
@@ -357981,9 +357999,9 @@ var init_listSessionsImpl = __esm(() => {
|
|
|
357981
357999
|
|
|
357982
358000
|
// src/services/autoDream/consolidationLock.ts
|
|
357983
358001
|
import { mkdir as mkdir24, readFile as readFile31, stat as stat34, unlink as unlink14, utimes, writeFile as writeFile26 } from "fs/promises";
|
|
357984
|
-
import { join as
|
|
358002
|
+
import { join as join100 } from "path";
|
|
357985
358003
|
function lockPath() {
|
|
357986
|
-
return
|
|
358004
|
+
return join100(getAutoMemPath(), LOCK_FILE);
|
|
357987
358005
|
}
|
|
357988
358006
|
async function readLastConsolidatedAt() {
|
|
357989
358007
|
try {
|
|
@@ -359435,7 +359453,7 @@ function getAnthropicEnvMetadata() {
|
|
|
359435
359453
|
function getBuildAgeMinutes() {
|
|
359436
359454
|
if (false)
|
|
359437
359455
|
;
|
|
359438
|
-
const buildTime = new Date("2026-06-
|
|
359456
|
+
const buildTime = new Date("2026-06-23T22:31:12.509Z").getTime();
|
|
359439
359457
|
if (isNaN(buildTime))
|
|
359440
359458
|
return;
|
|
359441
359459
|
return Math.floor((Date.now() - buildTime) / 60000);
|
|
@@ -360894,12 +360912,12 @@ var init_queryHelpers = __esm(() => {
|
|
|
360894
360912
|
import { randomUUID as randomUUID21 } from "crypto";
|
|
360895
360913
|
import { rm as rm9 } from "fs";
|
|
360896
360914
|
import { appendFile as appendFile5, copyFile as copyFile8, mkdir as mkdir25 } from "fs/promises";
|
|
360897
|
-
import { dirname as dirname43, isAbsolute as isAbsolute23, join as
|
|
360915
|
+
import { dirname as dirname43, isAbsolute as isAbsolute23, join as join101, relative as relative17 } from "path";
|
|
360898
360916
|
function safeRemoveOverlay(overlayPath) {
|
|
360899
360917
|
rm9(overlayPath, { recursive: true, force: true, maxRetries: 3, retryDelay: 100 }, () => {});
|
|
360900
360918
|
}
|
|
360901
360919
|
function getOverlayPath(id) {
|
|
360902
|
-
return
|
|
360920
|
+
return join101(getVivusTempDir(), "speculation", String(process.pid), id);
|
|
360903
360921
|
}
|
|
360904
360922
|
function denySpeculation(message, reason) {
|
|
360905
360923
|
return {
|
|
@@ -360911,8 +360929,8 @@ function denySpeculation(message, reason) {
|
|
|
360911
360929
|
async function copyOverlayToMain(overlayPath, writtenPaths, cwd2) {
|
|
360912
360930
|
let allCopied = true;
|
|
360913
360931
|
for (const rel of writtenPaths) {
|
|
360914
|
-
const src =
|
|
360915
|
-
const dest =
|
|
360932
|
+
const src = join101(overlayPath, rel);
|
|
360933
|
+
const dest = join101(cwd2, rel);
|
|
360916
360934
|
try {
|
|
360917
360935
|
await mkdir25(dirname43(dest), { recursive: true });
|
|
360918
360936
|
await copyFile8(src, dest);
|
|
@@ -361162,17 +361180,17 @@ async function startSpeculation(suggestionText, context, setAppState, isPipeline
|
|
|
361162
361180
|
}
|
|
361163
361181
|
if (isWriteTool) {
|
|
361164
361182
|
if (!writtenPathsRef.current.has(rel)) {
|
|
361165
|
-
const overlayFile =
|
|
361183
|
+
const overlayFile = join101(overlayPath, rel);
|
|
361166
361184
|
await mkdir25(dirname43(overlayFile), { recursive: true });
|
|
361167
361185
|
try {
|
|
361168
|
-
await copyFile8(
|
|
361186
|
+
await copyFile8(join101(cwd2, rel), overlayFile);
|
|
361169
361187
|
} catch {}
|
|
361170
361188
|
writtenPathsRef.current.add(rel);
|
|
361171
361189
|
}
|
|
361172
|
-
input = { ...input, [pathKey2]:
|
|
361190
|
+
input = { ...input, [pathKey2]: join101(overlayPath, rel) };
|
|
361173
361191
|
} else {
|
|
361174
361192
|
if (writtenPathsRef.current.has(rel)) {
|
|
361175
|
-
input = { ...input, [pathKey2]:
|
|
361193
|
+
input = { ...input, [pathKey2]: join101(overlayPath, rel) };
|
|
361176
361194
|
}
|
|
361177
361195
|
}
|
|
361178
361196
|
logForDebugging(`[Speculation] ${isWriteTool ? "Write" : "Read"} ${filePath} -> ${input[pathKey2]}`);
|
|
@@ -363405,10 +363423,10 @@ var init_filesApi = __esm(() => {
|
|
|
363405
363423
|
// src/utils/tempfile.ts
|
|
363406
363424
|
import { createHash as createHash22, randomUUID as randomUUID23 } from "crypto";
|
|
363407
363425
|
import { tmpdir as tmpdir7 } from "os";
|
|
363408
|
-
import { join as
|
|
363426
|
+
import { join as join103 } from "path";
|
|
363409
363427
|
function generateTempFilePath(prefix = "vivus-prompt", extension2 = ".md", options2) {
|
|
363410
363428
|
const id = options2?.contentHash ? createHash22("sha256").update(options2.contentHash).digest("hex").slice(0, 16) : randomUUID23();
|
|
363411
|
-
return
|
|
363429
|
+
return join103(tmpdir7(), `${prefix}-${id}${extension2}`);
|
|
363412
363430
|
}
|
|
363413
363431
|
var init_tempfile = () => {};
|
|
363414
363432
|
|
|
@@ -384399,14 +384417,14 @@ var require_turndown_cjs = __commonJS((exports, module) => {
|
|
|
384399
384417
|
} else if (node.nodeType === 1) {
|
|
384400
384418
|
replacement = replacementForNode.call(self2, node);
|
|
384401
384419
|
}
|
|
384402
|
-
return
|
|
384420
|
+
return join104(output, replacement);
|
|
384403
384421
|
}, "");
|
|
384404
384422
|
}
|
|
384405
384423
|
function postProcess(output) {
|
|
384406
384424
|
var self2 = this;
|
|
384407
384425
|
this.rules.forEach(function(rule) {
|
|
384408
384426
|
if (typeof rule.append === "function") {
|
|
384409
|
-
output =
|
|
384427
|
+
output = join104(output, rule.append(self2.options));
|
|
384410
384428
|
}
|
|
384411
384429
|
});
|
|
384412
384430
|
return output.replace(/^[\t\r\n]+/, "").replace(/[\t\r\n\s]+$/, "");
|
|
@@ -384419,7 +384437,7 @@ var require_turndown_cjs = __commonJS((exports, module) => {
|
|
|
384419
384437
|
content = content.trim();
|
|
384420
384438
|
return whitespace.leading + rule.replacement(content, node, this.options) + whitespace.trailing;
|
|
384421
384439
|
}
|
|
384422
|
-
function
|
|
384440
|
+
function join104(output, replacement) {
|
|
384423
384441
|
var s1 = trimTrailingNewlines(output);
|
|
384424
384442
|
var s2 = trimLeadingNewlines(replacement);
|
|
384425
384443
|
var nls = Math.max(output.length - s1.length, replacement.length - s2.length);
|
|
@@ -391852,9 +391870,9 @@ var init_TeamDeleteTool = __esm(() => {
|
|
|
391852
391870
|
|
|
391853
391871
|
// src/utils/concurrentSessions.ts
|
|
391854
391872
|
import { chmod as chmod9, mkdir as mkdir27, readdir as readdir20, readFile as readFile33, unlink as unlink16, writeFile as writeFile29 } from "fs/promises";
|
|
391855
|
-
import { join as
|
|
391873
|
+
import { join as join104 } from "path";
|
|
391856
391874
|
function getSessionsDir() {
|
|
391857
|
-
return
|
|
391875
|
+
return join104(getVivusConfigHomeDir(), "sessions");
|
|
391858
391876
|
}
|
|
391859
391877
|
function envSessionKind() {
|
|
391860
391878
|
if (false) {}
|
|
@@ -391865,7 +391883,7 @@ async function registerSession() {
|
|
|
391865
391883
|
return false;
|
|
391866
391884
|
const kind = envSessionKind() ?? "interactive";
|
|
391867
391885
|
const dir = getSessionsDir();
|
|
391868
|
-
const pidFile =
|
|
391886
|
+
const pidFile = join104(dir, `${process.pid}.json`);
|
|
391869
391887
|
registerCleanup(async () => {
|
|
391870
391888
|
try {
|
|
391871
391889
|
await unlink16(pidFile);
|
|
@@ -391894,7 +391912,7 @@ async function registerSession() {
|
|
|
391894
391912
|
}
|
|
391895
391913
|
}
|
|
391896
391914
|
async function updatePidFile(patch) {
|
|
391897
|
-
const pidFile =
|
|
391915
|
+
const pidFile = join104(getSessionsDir(), `${process.pid}.json`);
|
|
391898
391916
|
try {
|
|
391899
391917
|
const data = jsonParse(await readFile33(pidFile, "utf8"));
|
|
391900
391918
|
await writeFile29(pidFile, jsonStringify({ ...data, ...patch }));
|
|
@@ -391933,7 +391951,7 @@ async function countConcurrentSessions() {
|
|
|
391933
391951
|
if (isProcessRunning(pid)) {
|
|
391934
391952
|
count4++;
|
|
391935
391953
|
} else if (getPlatform() !== "wsl") {
|
|
391936
|
-
unlink16(
|
|
391954
|
+
unlink16(join104(dir, file2)).catch(() => {});
|
|
391937
391955
|
}
|
|
391938
391956
|
}
|
|
391939
391957
|
return count4;
|
|
@@ -393536,7 +393554,7 @@ var init_permissionSetup = __esm(() => {
|
|
|
393536
393554
|
import { statSync as statSync6 } from "fs";
|
|
393537
393555
|
import { lstat as lstat5, readdir as readdir21, readFile as readFile34, realpath as realpath11, stat as stat37 } from "fs/promises";
|
|
393538
393556
|
import { homedir as homedir28 } from "os";
|
|
393539
|
-
import { dirname as dirname45, join as
|
|
393557
|
+
import { dirname as dirname45, join as join105, resolve as resolve35, sep as sep24 } from "path";
|
|
393540
393558
|
function extractDescriptionFromMarkdown(content, defaultDescription = "Custom item") {
|
|
393541
393559
|
const lines = content.split(`
|
|
393542
393560
|
`);
|
|
@@ -393626,7 +393644,7 @@ function getProjectDirsUpToHome(subdir, cwd2) {
|
|
|
393626
393644
|
if (normalizePathForComparison(current) === normalizePathForComparison(home)) {
|
|
393627
393645
|
break;
|
|
393628
393646
|
}
|
|
393629
|
-
const vivusSubdir =
|
|
393647
|
+
const vivusSubdir = join105(current, ".vivus", subdir);
|
|
393630
393648
|
try {
|
|
393631
393649
|
statSync6(vivusSubdir);
|
|
393632
393650
|
dirs.push(vivusSubdir);
|
|
@@ -393673,7 +393691,7 @@ async function findMarkdownFilesNative(dir, signal) {
|
|
|
393673
393691
|
if (signal.aborted) {
|
|
393674
393692
|
break;
|
|
393675
393693
|
}
|
|
393676
|
-
const fullPath =
|
|
393694
|
+
const fullPath = join105(currentDir, entry.name);
|
|
393677
393695
|
try {
|
|
393678
393696
|
if (entry.isSymbolicLink()) {
|
|
393679
393697
|
try {
|
|
@@ -393759,16 +393777,16 @@ var init_markdownConfigLoader = __esm(() => {
|
|
|
393759
393777
|
];
|
|
393760
393778
|
loadMarkdownFilesForSubdir = memoize_default(async function(subdir, cwd2) {
|
|
393761
393779
|
const searchStartTime = Date.now();
|
|
393762
|
-
const userDir =
|
|
393763
|
-
const managedDir =
|
|
393780
|
+
const userDir = join105(getVivusConfigHomeDir(), subdir);
|
|
393781
|
+
const managedDir = join105(getManagedFilePath(), ".vivus", subdir);
|
|
393764
393782
|
const projectDirs = getProjectDirsUpToHome(subdir, cwd2);
|
|
393765
393783
|
const gitRoot = findGitRoot(cwd2);
|
|
393766
393784
|
const canonicalRoot = findCanonicalGitRoot(cwd2);
|
|
393767
393785
|
if (gitRoot && canonicalRoot && canonicalRoot !== gitRoot) {
|
|
393768
|
-
const worktreeSubdir = normalizePathForComparison(
|
|
393786
|
+
const worktreeSubdir = normalizePathForComparison(join105(gitRoot, ".vivus", subdir));
|
|
393769
393787
|
const worktreeHasSubdir = projectDirs.some((dir) => normalizePathForComparison(dir) === worktreeSubdir);
|
|
393770
393788
|
if (!worktreeHasSubdir) {
|
|
393771
|
-
const mainVivusSubdir =
|
|
393789
|
+
const mainVivusSubdir = join105(canonicalRoot, ".vivus", subdir);
|
|
393772
393790
|
if (!projectDirs.includes(mainVivusSubdir)) {
|
|
393773
393791
|
projectDirs.push(mainVivusSubdir);
|
|
393774
393792
|
}
|
|
@@ -401080,7 +401098,7 @@ import {
|
|
|
401080
401098
|
symlink as symlink5,
|
|
401081
401099
|
utimes as utimes2
|
|
401082
401100
|
} from "fs/promises";
|
|
401083
|
-
import { basename as basename33, dirname as dirname46, join as
|
|
401101
|
+
import { basename as basename33, dirname as dirname46, join as join106 } from "path";
|
|
401084
401102
|
function validateWorktreeSlug(slug) {
|
|
401085
401103
|
if (slug.length > MAX_WORKTREE_SLUG_LENGTH) {
|
|
401086
401104
|
throw new Error(`Invalid worktree name: must be ${MAX_WORKTREE_SLUG_LENGTH} characters or fewer (got ${slug.length})`);
|
|
@@ -401103,8 +401121,8 @@ async function symlinkDirectories(repoRootPath, worktreePath, dirsToSymlink) {
|
|
|
401103
401121
|
logForDebugging(`Skipping symlink for "${dir}": path traversal detected`, { level: "warn" });
|
|
401104
401122
|
continue;
|
|
401105
401123
|
}
|
|
401106
|
-
const sourcePath =
|
|
401107
|
-
const destPath =
|
|
401124
|
+
const sourcePath = join106(repoRootPath, dir);
|
|
401125
|
+
const destPath = join106(worktreePath, dir);
|
|
401108
401126
|
try {
|
|
401109
401127
|
await symlink5(sourcePath, destPath, "dir");
|
|
401110
401128
|
logForDebugging(`Symlinked ${dir} from main repository to worktree to avoid disk bloat`);
|
|
@@ -401128,7 +401146,7 @@ function generateTmuxSessionName(repoPath, branch) {
|
|
|
401128
401146
|
return combined.replace(/[/.]/g, "_");
|
|
401129
401147
|
}
|
|
401130
401148
|
function worktreesDir(repoRoot) {
|
|
401131
|
-
return
|
|
401149
|
+
return join106(repoRoot, ".vivus", "worktrees");
|
|
401132
401150
|
}
|
|
401133
401151
|
function flattenSlug(slug) {
|
|
401134
401152
|
return slug.replaceAll("/", "+");
|
|
@@ -401137,7 +401155,7 @@ function worktreeBranchName(slug) {
|
|
|
401137
401155
|
return `worktree-${flattenSlug(slug)}`;
|
|
401138
401156
|
}
|
|
401139
401157
|
function worktreePathFor(repoRoot, slug) {
|
|
401140
|
-
return
|
|
401158
|
+
return join106(worktreesDir(repoRoot), flattenSlug(slug));
|
|
401141
401159
|
}
|
|
401142
401160
|
async function getOrCreateWorktree(repoRoot, slug, options2) {
|
|
401143
401161
|
const worktreePath = worktreePathFor(repoRoot, slug);
|
|
@@ -401218,7 +401236,7 @@ async function getOrCreateWorktree(repoRoot, slug, options2) {
|
|
|
401218
401236
|
async function copyWorktreeIncludeFiles(repoRoot, worktreePath) {
|
|
401219
401237
|
let includeContent;
|
|
401220
401238
|
try {
|
|
401221
|
-
includeContent = await readFile35(
|
|
401239
|
+
includeContent = await readFile35(join106(repoRoot, ".worktreeinclude"), "utf-8");
|
|
401222
401240
|
} catch {
|
|
401223
401241
|
return [];
|
|
401224
401242
|
}
|
|
@@ -401273,8 +401291,8 @@ async function copyWorktreeIncludeFiles(repoRoot, worktreePath) {
|
|
|
401273
401291
|
}
|
|
401274
401292
|
const copied = [];
|
|
401275
401293
|
for (const relativePath of files) {
|
|
401276
|
-
const srcPath =
|
|
401277
|
-
const destPath =
|
|
401294
|
+
const srcPath = join106(repoRoot, relativePath);
|
|
401295
|
+
const destPath = join106(worktreePath, relativePath);
|
|
401278
401296
|
try {
|
|
401279
401297
|
await mkdir28(dirname46(destPath), { recursive: true });
|
|
401280
401298
|
await copyFile9(srcPath, destPath);
|
|
@@ -401290,9 +401308,9 @@ async function copyWorktreeIncludeFiles(repoRoot, worktreePath) {
|
|
|
401290
401308
|
}
|
|
401291
401309
|
async function performPostCreationSetup(repoRoot, worktreePath) {
|
|
401292
401310
|
const localSettingsRelativePath = getRelativeSettingsFilePathForSource("localSettings");
|
|
401293
|
-
const sourceSettingsLocal =
|
|
401311
|
+
const sourceSettingsLocal = join106(repoRoot, localSettingsRelativePath);
|
|
401294
401312
|
try {
|
|
401295
|
-
const destSettingsLocal =
|
|
401313
|
+
const destSettingsLocal = join106(worktreePath, localSettingsRelativePath);
|
|
401296
401314
|
await mkdirRecursive(dirname46(destSettingsLocal));
|
|
401297
401315
|
await copyFile9(sourceSettingsLocal, destSettingsLocal);
|
|
401298
401316
|
logForDebugging(`Copied settings.local.json to worktree: ${destSettingsLocal}`);
|
|
@@ -401302,8 +401320,8 @@ async function performPostCreationSetup(repoRoot, worktreePath) {
|
|
|
401302
401320
|
logForDebugging(`Failed to copy settings.local.json: ${e.message}`, { level: "warn" });
|
|
401303
401321
|
}
|
|
401304
401322
|
}
|
|
401305
|
-
const huskyPath =
|
|
401306
|
-
const gitHooksPath =
|
|
401323
|
+
const huskyPath = join106(repoRoot, ".husky");
|
|
401324
|
+
const gitHooksPath = join106(repoRoot, ".git", "hooks");
|
|
401307
401325
|
let hooksPath = null;
|
|
401308
401326
|
for (const candidatePath of [huskyPath, gitHooksPath]) {
|
|
401309
401327
|
try {
|
|
@@ -401578,7 +401596,7 @@ async function cleanupStaleAgentWorktrees(cutoffDate) {
|
|
|
401578
401596
|
if (!EPHEMERAL_WORKTREE_PATTERNS.some((p) => p.test(slug))) {
|
|
401579
401597
|
continue;
|
|
401580
401598
|
}
|
|
401581
|
-
const worktreePath =
|
|
401599
|
+
const worktreePath = join106(dir, slug);
|
|
401582
401600
|
if (currentPath === worktreePath) {
|
|
401583
401601
|
continue;
|
|
401584
401602
|
}
|
|
@@ -405789,7 +405807,7 @@ var init_permissions2 = __esm(() => {
|
|
|
405789
405807
|
// src/utils/permissions/filesystem.ts
|
|
405790
405808
|
import { randomBytes as randomBytes17 } from "crypto";
|
|
405791
405809
|
import { homedir as homedir29, tmpdir as tmpdir8 } from "os";
|
|
405792
|
-
import { join as
|
|
405810
|
+
import { join as join107, normalize as normalize14, posix as posix8, sep as sep25 } from "path";
|
|
405793
405811
|
function normalizeCaseForComparison2(path19) {
|
|
405794
405812
|
return path19.toLowerCase();
|
|
405795
405813
|
}
|
|
@@ -405798,11 +405816,11 @@ function getVivusSkillScope(filePath) {
|
|
|
405798
405816
|
const absolutePathLower = normalizeCaseForComparison2(absolutePath);
|
|
405799
405817
|
const bases = [
|
|
405800
405818
|
{
|
|
405801
|
-
dir: expandPath(
|
|
405819
|
+
dir: expandPath(join107(getOriginalCwd(), ".vivus", "skills")),
|
|
405802
405820
|
prefix: "/.vivus/skills/"
|
|
405803
405821
|
},
|
|
405804
405822
|
{
|
|
405805
|
-
dir: expandPath(
|
|
405823
|
+
dir: expandPath(join107(homedir29(), ".vivus", "skills")),
|
|
405806
405824
|
prefix: "~/.vivus/skills/"
|
|
405807
405825
|
}
|
|
405808
405826
|
];
|
|
@@ -405857,21 +405875,21 @@ function isVivusConfigFilePath(filePath) {
|
|
|
405857
405875
|
if (isVivusSettingsPath(filePath)) {
|
|
405858
405876
|
return true;
|
|
405859
405877
|
}
|
|
405860
|
-
const commandsDir =
|
|
405861
|
-
const agentsDir =
|
|
405862
|
-
const skillsDir =
|
|
405878
|
+
const commandsDir = join107(getOriginalCwd(), ".vivus", "commands");
|
|
405879
|
+
const agentsDir = join107(getOriginalCwd(), ".vivus", "agents");
|
|
405880
|
+
const skillsDir = join107(getOriginalCwd(), ".vivus", "skills");
|
|
405863
405881
|
return pathInWorkingPath(filePath, commandsDir) || pathInWorkingPath(filePath, agentsDir) || pathInWorkingPath(filePath, skillsDir);
|
|
405864
405882
|
}
|
|
405865
405883
|
function isSessionPlanFile(absolutePath) {
|
|
405866
|
-
const expectedPrefix =
|
|
405884
|
+
const expectedPrefix = join107(getPlansDirectory(), getPlanSlug());
|
|
405867
405885
|
const normalizedPath = normalize14(absolutePath);
|
|
405868
405886
|
return normalizedPath.startsWith(expectedPrefix) && normalizedPath.endsWith(".md");
|
|
405869
405887
|
}
|
|
405870
405888
|
function getSessionMemoryDir() {
|
|
405871
|
-
return
|
|
405889
|
+
return join107(getProjectDir2(getCwd()), getSessionId(), "session-memory") + sep25;
|
|
405872
405890
|
}
|
|
405873
405891
|
function getSessionMemoryPath() {
|
|
405874
|
-
return
|
|
405892
|
+
return join107(getSessionMemoryDir(), "summary.md");
|
|
405875
405893
|
}
|
|
405876
405894
|
function isSessionMemoryPath(absolutePath) {
|
|
405877
405895
|
const normalizedPath = normalize14(absolutePath);
|
|
@@ -405893,10 +405911,10 @@ function getVivusTempDirName() {
|
|
|
405893
405911
|
return `vivus-${uid}`;
|
|
405894
405912
|
}
|
|
405895
405913
|
function getProjectTempDir() {
|
|
405896
|
-
return
|
|
405914
|
+
return join107(getVivusTempDir(), sanitizePath2(getOriginalCwd())) + sep25;
|
|
405897
405915
|
}
|
|
405898
405916
|
function getScratchpadDir() {
|
|
405899
|
-
return
|
|
405917
|
+
return join107(getProjectTempDir(), getSessionId(), "scratchpad");
|
|
405900
405918
|
}
|
|
405901
405919
|
async function ensureScratchpadDir() {
|
|
405902
405920
|
if (!isScratchpadEnabled()) {
|
|
@@ -406474,7 +406492,7 @@ function checkEditableInternalPath(absolutePath, input) {
|
|
|
406474
406492
|
}
|
|
406475
406493
|
};
|
|
406476
406494
|
}
|
|
406477
|
-
if (normalizeCaseForComparison2(normalizedPath) === normalizeCaseForComparison2(
|
|
406495
|
+
if (normalizeCaseForComparison2(normalizedPath) === normalizeCaseForComparison2(join107(getOriginalCwd(), ".vivus", "launch.json"))) {
|
|
406478
406496
|
return {
|
|
406479
406497
|
behavior: "allow",
|
|
406480
406498
|
updatedInput: input,
|
|
@@ -406571,7 +406589,7 @@ function checkReadableInternalPath(absolutePath, input) {
|
|
|
406571
406589
|
}
|
|
406572
406590
|
};
|
|
406573
406591
|
}
|
|
406574
|
-
const tasksDir =
|
|
406592
|
+
const tasksDir = join107(getVivusConfigHomeDir(), "tasks") + sep25;
|
|
406575
406593
|
if (normalizedPath === tasksDir.slice(0, -1) || normalizedPath.startsWith(tasksDir)) {
|
|
406576
406594
|
return {
|
|
406577
406595
|
behavior: "allow",
|
|
@@ -406582,7 +406600,7 @@ function checkReadableInternalPath(absolutePath, input) {
|
|
|
406582
406600
|
}
|
|
406583
406601
|
};
|
|
406584
406602
|
}
|
|
406585
|
-
const teamsReadDir =
|
|
406603
|
+
const teamsReadDir = join107(getVivusConfigHomeDir(), "teams") + sep25;
|
|
406586
406604
|
if (normalizedPath === teamsReadDir.slice(0, -1) || normalizedPath.startsWith(teamsReadDir)) {
|
|
406587
406605
|
return {
|
|
406588
406606
|
behavior: "allow",
|
|
@@ -406655,11 +406673,11 @@ var init_filesystem = __esm(() => {
|
|
|
406655
406673
|
try {
|
|
406656
406674
|
resolvedBaseTmpDir = fs9.realpathSync(baseTmpDir);
|
|
406657
406675
|
} catch {}
|
|
406658
|
-
return
|
|
406676
|
+
return join107(resolvedBaseTmpDir, getVivusTempDirName()) + sep25;
|
|
406659
406677
|
});
|
|
406660
406678
|
getBundledSkillsRoot = memoize_default(function getBundledSkillsRoot2() {
|
|
406661
406679
|
const nonce = randomBytes17(16).toString("hex");
|
|
406662
|
-
return
|
|
406680
|
+
return join107(getVivusTempDir(), "bundled-skills", "1.1.32+82959fe", nonce);
|
|
406663
406681
|
});
|
|
406664
406682
|
getResolvedWorkingDirPaths = memoize_default(getPathsForPermissionCheck);
|
|
406665
406683
|
});
|
|
@@ -406733,7 +406751,7 @@ var init_validation3 = __esm(() => {
|
|
|
406733
406751
|
});
|
|
406734
406752
|
|
|
406735
406753
|
// src/utils/suggestions/directoryCompletion.ts
|
|
406736
|
-
import { basename as basename34, dirname as dirname48, join as
|
|
406754
|
+
import { basename as basename34, dirname as dirname48, join as join108, sep as sep26 } from "path";
|
|
406737
406755
|
function parsePartialPath(partialPath, basePath) {
|
|
406738
406756
|
if (!partialPath) {
|
|
406739
406757
|
const directory2 = basePath || getCwd();
|
|
@@ -406757,7 +406775,7 @@ async function scanDirectory(dirPath) {
|
|
|
406757
406775
|
const entries = await fs9.readdir(dirPath);
|
|
406758
406776
|
const directories = entries.filter((entry) => entry.isDirectory() && !entry.name.startsWith(".")).map((entry) => ({
|
|
406759
406777
|
name: entry.name,
|
|
406760
|
-
path:
|
|
406778
|
+
path: join108(dirPath, entry.name),
|
|
406761
406779
|
type: "directory"
|
|
406762
406780
|
})).slice(0, 100);
|
|
406763
406781
|
directoryCache.set(dirPath, directories);
|
|
@@ -406794,7 +406812,7 @@ async function scanDirectoryForPaths(dirPath, includeHidden = false) {
|
|
|
406794
406812
|
const entries = await fs9.readdir(dirPath);
|
|
406795
406813
|
const paths2 = entries.filter((entry) => includeHidden || !entry.name.startsWith(".")).map((entry) => ({
|
|
406796
406814
|
name: entry.name,
|
|
406797
|
-
path:
|
|
406815
|
+
path: join108(dirPath, entry.name),
|
|
406798
406816
|
type: entry.isDirectory() ? "directory" : "file"
|
|
406799
406817
|
})).sort((a2, b) => {
|
|
406800
406818
|
if (a2.type === "directory" && b.type !== "directory")
|
|
@@ -408419,7 +408437,7 @@ function Feedback({
|
|
|
408419
408437
|
platform: env3.platform,
|
|
408420
408438
|
gitRepo: envInfo.isGit,
|
|
408421
408439
|
terminal: env3.terminal,
|
|
408422
|
-
version: "1.1.
|
|
408440
|
+
version: "1.1.32+82959fe",
|
|
408423
408441
|
transcript: normalizeMessagesForAPI(messages),
|
|
408424
408442
|
errors: sanitizedErrors,
|
|
408425
408443
|
lastApiRequest: getLastAPIRequest(),
|
|
@@ -408611,7 +408629,7 @@ function Feedback({
|
|
|
408611
408629
|
", ",
|
|
408612
408630
|
env3.terminal,
|
|
408613
408631
|
", v",
|
|
408614
|
-
"1.1.
|
|
408632
|
+
"1.1.32+82959fe"
|
|
408615
408633
|
]
|
|
408616
408634
|
}, undefined, true, undefined, this)
|
|
408617
408635
|
]
|
|
@@ -408717,7 +408735,7 @@ ${sanitizedDescription}
|
|
|
408717
408735
|
` + `**Environment Info**
|
|
408718
408736
|
` + `- Platform: ${env3.platform}
|
|
408719
408737
|
` + `- Terminal: ${env3.terminal}
|
|
408720
|
-
` + `- Version: ${"1.1.
|
|
408738
|
+
` + `- Version: ${"1.1.32+82959fe"}
|
|
408721
408739
|
` + `- Feedback ID: ${feedbackId}
|
|
408722
408740
|
` + `
|
|
408723
408741
|
**Errors**
|
|
@@ -409629,7 +409647,7 @@ var init_fileSuggestions = __esm(() => {
|
|
|
409629
409647
|
});
|
|
409630
409648
|
|
|
409631
409649
|
// src/services/MagicDocs/prompts.ts
|
|
409632
|
-
import { join as
|
|
409650
|
+
import { join as join110 } from "path";
|
|
409633
409651
|
function getUpdatePromptTemplate() {
|
|
409634
409652
|
return `IMPORTANT: This message and these instructions are NOT part of the actual user conversation. Do NOT include any references to "documentation updates", "magic docs", or these update instructions in the document content.
|
|
409635
409653
|
|
|
@@ -409684,7 +409702,7 @@ REMEMBER: Only update if there is substantial new information. The Magic Doc hea
|
|
|
409684
409702
|
}
|
|
409685
409703
|
async function loadMagicDocsPrompt() {
|
|
409686
409704
|
const fs9 = getFsImplementation();
|
|
409687
|
-
const promptPath =
|
|
409705
|
+
const promptPath = join110(getVivusConfigHomeDir(), "magic-docs", "prompt.md");
|
|
409688
409706
|
try {
|
|
409689
409707
|
return await fs9.readFile(promptPath, { encoding: "utf-8" });
|
|
409690
409708
|
} catch {
|
|
@@ -410273,7 +410291,7 @@ __export(exports_copy, {
|
|
|
410273
410291
|
});
|
|
410274
410292
|
import { mkdir as mkdir29, writeFile as writeFile30 } from "fs/promises";
|
|
410275
410293
|
import { tmpdir as tmpdir9 } from "os";
|
|
410276
|
-
import { join as
|
|
410294
|
+
import { join as join111 } from "path";
|
|
410277
410295
|
function extractCodeBlocks(markdown) {
|
|
410278
410296
|
const tokens = marked.lexer(stripPromptXMLTags(markdown));
|
|
410279
410297
|
const blocks = [];
|
|
@@ -410315,7 +410333,7 @@ function fileExtension2(lang) {
|
|
|
410315
410333
|
return ".txt";
|
|
410316
410334
|
}
|
|
410317
410335
|
async function writeToFile(text2, filename) {
|
|
410318
|
-
const filePath =
|
|
410336
|
+
const filePath = join111(COPY_DIR, filename);
|
|
410319
410337
|
await mkdir29(COPY_DIR, {
|
|
410320
410338
|
recursive: true
|
|
410321
410339
|
});
|
|
@@ -410667,7 +410685,7 @@ var init_copy = __esm(() => {
|
|
|
410667
410685
|
import_compiler_runtime129 = __toESM(require_compiler_runtime(), 1);
|
|
410668
410686
|
import_react96 = __toESM(require_react(), 1);
|
|
410669
410687
|
jsx_dev_runtime165 = __toESM(require_jsx_dev_runtime(), 1);
|
|
410670
|
-
COPY_DIR =
|
|
410688
|
+
COPY_DIR = join111(tmpdir9(), "vivus");
|
|
410671
410689
|
});
|
|
410672
410690
|
|
|
410673
410691
|
// src/commands/copy/index.ts
|
|
@@ -410684,7 +410702,7 @@ var init_copy2 = __esm(() => {
|
|
|
410684
410702
|
|
|
410685
410703
|
// src/utils/desktopDeepLink.ts
|
|
410686
410704
|
import { readdir as readdir23 } from "fs/promises";
|
|
410687
|
-
import { join as
|
|
410705
|
+
import { join as join112 } from "path";
|
|
410688
410706
|
function isDevMode() {
|
|
410689
410707
|
if (true) {
|
|
410690
410708
|
return true;
|
|
@@ -410747,12 +410765,12 @@ async function getDesktopVersion() {
|
|
|
410747
410765
|
if (!localAppData) {
|
|
410748
410766
|
return null;
|
|
410749
410767
|
}
|
|
410750
|
-
const installDir =
|
|
410768
|
+
const installDir = join112(localAppData, "AnthropicVivus");
|
|
410751
410769
|
try {
|
|
410752
410770
|
const entries = await readdir23(installDir);
|
|
410753
|
-
const versions2 = entries.filter((e) => e.startsWith("app-")).map((e) => e.slice(4)).filter((v) =>
|
|
410754
|
-
const ca =
|
|
410755
|
-
const cb =
|
|
410771
|
+
const versions2 = entries.filter((e) => e.startsWith("app-")).map((e) => e.slice(4)).filter((v) => import_semver6.coerce(v) !== null).sort((a2, b) => {
|
|
410772
|
+
const ca = import_semver6.coerce(a2);
|
|
410773
|
+
const cb = import_semver6.coerce(b);
|
|
410756
410774
|
return ca.compare(cb);
|
|
410757
410775
|
});
|
|
410758
410776
|
return versions2.length > 0 ? versions2[versions2.length - 1] : null;
|
|
@@ -410776,7 +410794,7 @@ async function getDesktopInstallStatus() {
|
|
|
410776
410794
|
if (!version2) {
|
|
410777
410795
|
return { status: "ready", version: "unknown" };
|
|
410778
410796
|
}
|
|
410779
|
-
const coerced =
|
|
410797
|
+
const coerced = import_semver6.coerce(version2);
|
|
410780
410798
|
if (!coerced || !gte(coerced.version, MIN_DESKTOP_VERSION)) {
|
|
410781
410799
|
return { status: "version-too-old", version: version2 };
|
|
410782
410800
|
}
|
|
@@ -410829,14 +410847,14 @@ async function openCurrentSessionInDesktop() {
|
|
|
410829
410847
|
}
|
|
410830
410848
|
return { success: true, deepLinkUrl };
|
|
410831
410849
|
}
|
|
410832
|
-
var
|
|
410850
|
+
var import_semver6, MIN_DESKTOP_VERSION = "1.1.2396";
|
|
410833
410851
|
var init_desktopDeepLink = __esm(() => {
|
|
410834
410852
|
init_state();
|
|
410835
410853
|
init_cwd2();
|
|
410836
410854
|
init_debug();
|
|
410837
410855
|
init_execFileNoThrow();
|
|
410838
410856
|
init_file();
|
|
410839
|
-
|
|
410857
|
+
import_semver6 = __toESM(require_semver3(), 1);
|
|
410840
410858
|
});
|
|
410841
410859
|
|
|
410842
410860
|
// src/components/design-system/LoadingState.tsx
|
|
@@ -411849,7 +411867,7 @@ function buildPrimarySection() {
|
|
|
411849
411867
|
}, undefined, false, undefined, this);
|
|
411850
411868
|
return [{
|
|
411851
411869
|
label: "Version",
|
|
411852
|
-
value: "1.1.
|
|
411870
|
+
value: "1.1.32+82959fe"
|
|
411853
411871
|
}, {
|
|
411854
411872
|
label: "Session name",
|
|
411855
411873
|
value: nameValue
|
|
@@ -415600,7 +415618,7 @@ function Config({
|
|
|
415600
415618
|
}
|
|
415601
415619
|
}, undefined, false, undefined, this)
|
|
415602
415620
|
}, undefined, false, undefined, this) : showSubmenu === "ChannelDowngrade" ? /* @__PURE__ */ jsx_dev_runtime178.jsxDEV(ChannelDowngradeDialog, {
|
|
415603
|
-
currentVersion: "1.1.
|
|
415621
|
+
currentVersion: "1.1.32+82959fe",
|
|
415604
415622
|
onChoice: (choice) => {
|
|
415605
415623
|
setShowSubmenu(null);
|
|
415606
415624
|
setTabsHidden(false);
|
|
@@ -415612,7 +415630,7 @@ function Config({
|
|
|
415612
415630
|
autoUpdatesChannel: "stable"
|
|
415613
415631
|
};
|
|
415614
415632
|
if (choice === "stay") {
|
|
415615
|
-
newSettings.minimumVersion = "1.1.
|
|
415633
|
+
newSettings.minimumVersion = "1.1.32+82959fe";
|
|
415616
415634
|
}
|
|
415617
415635
|
updateSettingsForSource("userSettings", newSettings);
|
|
415618
415636
|
setSettingsData((prev_27) => ({
|
|
@@ -421018,7 +421036,7 @@ var exports_Doctor = {};
|
|
|
421018
421036
|
__export(exports_Doctor, {
|
|
421019
421037
|
Doctor: () => Doctor
|
|
421020
421038
|
});
|
|
421021
|
-
import { join as
|
|
421039
|
+
import { join as join113 } from "path";
|
|
421022
421040
|
function DistTagsDisplay(t0) {
|
|
421023
421041
|
const $2 = import_compiler_runtime158.c(8);
|
|
421024
421042
|
const {
|
|
@@ -421148,8 +421166,8 @@ function Doctor(t0) {
|
|
|
421148
421166
|
t5 = () => {
|
|
421149
421167
|
getDoctorDiagnostic().then(setDiagnostic);
|
|
421150
421168
|
(async () => {
|
|
421151
|
-
const userAgentsDir =
|
|
421152
|
-
const projectAgentsDir =
|
|
421169
|
+
const userAgentsDir = join113(getVivusConfigHomeDir(), "agents");
|
|
421170
|
+
const projectAgentsDir = join113(getOriginalCwd(), ".vivus", "agents");
|
|
421153
421171
|
const {
|
|
421154
421172
|
activeAgents,
|
|
421155
421173
|
allAgents,
|
|
@@ -421172,7 +421190,7 @@ function Doctor(t0) {
|
|
|
421172
421190
|
}, async () => toolPermissionContext);
|
|
421173
421191
|
setContextWarnings(warnings);
|
|
421174
421192
|
if (isPidBasedLockingEnabled()) {
|
|
421175
|
-
const locksDir =
|
|
421193
|
+
const locksDir = join113(getXDGStateHome(), "vivus", "locks");
|
|
421176
421194
|
const staleLocksCleaned = cleanupStaleLocks(locksDir);
|
|
421177
421195
|
const locks = getAllLockInfo(locksDir);
|
|
421178
421196
|
setVersionLockInfo({
|
|
@@ -422049,7 +422067,7 @@ var init_versions3 = __esm(() => {
|
|
|
422049
422067
|
|
|
422050
422068
|
// src/components/memory/MemoryFileSelector.tsx
|
|
422051
422069
|
import { mkdir as mkdir30 } from "fs/promises";
|
|
422052
|
-
import { join as
|
|
422070
|
+
import { join as join114 } from "path";
|
|
422053
422071
|
function MemoryFileSelector(t0) {
|
|
422054
422072
|
const $2 = import_compiler_runtime159.c(58);
|
|
422055
422073
|
const {
|
|
@@ -422057,8 +422075,8 @@ function MemoryFileSelector(t0) {
|
|
|
422057
422075
|
onCancel
|
|
422058
422076
|
} = t0;
|
|
422059
422077
|
const existingMemoryFiles = import_react115.use(getMemoryFiles());
|
|
422060
|
-
const userMemoryPath =
|
|
422061
|
-
const projectMemoryPath =
|
|
422078
|
+
const userMemoryPath = join114(getVivusConfigHomeDir(), "VIVUS.md");
|
|
422079
|
+
const projectMemoryPath = join114(getOriginalCwd(), "VIVUS.md");
|
|
422062
422080
|
const hasUserMemory = existingMemoryFiles.some((f) => f.path === userMemoryPath);
|
|
422063
422081
|
const hasProjectMemory = existingMemoryFiles.some((f_0) => f_0.path === projectMemoryPath);
|
|
422064
422082
|
const allMemoryFiles = [...existingMemoryFiles.filter(_temp81).map(_temp230), ...hasUserMemory ? [] : [{
|
|
@@ -423698,7 +423716,7 @@ function HelpV2(t0) {
|
|
|
423698
423716
|
let t6;
|
|
423699
423717
|
if ($2[31] !== tabs) {
|
|
423700
423718
|
t6 = /* @__PURE__ */ jsx_dev_runtime205.jsxDEV(Tabs, {
|
|
423701
|
-
title: `Vivus v${"1.1.
|
|
423719
|
+
title: `Vivus v${"1.1.32+82959fe"}`,
|
|
423702
423720
|
color: "professionalBlue",
|
|
423703
423721
|
defaultTab: "general",
|
|
423704
423722
|
children: tabs
|
|
@@ -432773,7 +432791,7 @@ __export(exports_pluginStartupCheck, {
|
|
|
432773
432791
|
findMissingPlugins: () => findMissingPlugins,
|
|
432774
432792
|
checkEnabledPlugins: () => checkEnabledPlugins
|
|
432775
432793
|
});
|
|
432776
|
-
import { join as
|
|
432794
|
+
import { join as join115 } from "path";
|
|
432777
432795
|
async function checkEnabledPlugins() {
|
|
432778
432796
|
const settings = getInitialSettings();
|
|
432779
432797
|
const enabledPlugins = [];
|
|
@@ -432908,7 +432926,7 @@ async function installSelectedPlugins(pluginsToInstall, onProgress, scope = "use
|
|
|
432908
432926
|
} else {
|
|
432909
432927
|
registerPluginInstallation({
|
|
432910
432928
|
pluginId,
|
|
432911
|
-
installPath:
|
|
432929
|
+
installPath: join115(marketplaceInstallLocation, entry.source),
|
|
432912
432930
|
version: entry.version
|
|
432913
432931
|
}, scope, projectPath);
|
|
432914
432932
|
}
|
|
@@ -433228,9 +433246,9 @@ var init_AddMarketplace = __esm(() => {
|
|
|
433228
433246
|
// src/utils/plugins/installCounts.ts
|
|
433229
433247
|
import { randomBytes as randomBytes18 } from "crypto";
|
|
433230
433248
|
import { readFile as readFile37, rename as rename7, unlink as unlink17, writeFile as writeFile33 } from "fs/promises";
|
|
433231
|
-
import { join as
|
|
433249
|
+
import { join as join116 } from "path";
|
|
433232
433250
|
function getInstallCountsCachePath() {
|
|
433233
|
-
return
|
|
433251
|
+
return join116(getPluginsDirectory(), INSTALL_COUNTS_CACHE_FILENAME);
|
|
433234
433252
|
}
|
|
433235
433253
|
async function loadInstallCountsCache() {
|
|
433236
433254
|
const cachePath = getInstallCountsCachePath();
|
|
@@ -435976,7 +435994,7 @@ var init_DiscoverPlugins = __esm(() => {
|
|
|
435976
435994
|
});
|
|
435977
435995
|
|
|
435978
435996
|
// src/services/plugins/pluginOperations.ts
|
|
435979
|
-
import { dirname as dirname51, join as
|
|
435997
|
+
import { dirname as dirname51, join as join117 } from "path";
|
|
435980
435998
|
function assertInstallableScope(scope) {
|
|
435981
435999
|
if (!VALID_INSTALLABLE_SCOPES.includes(scope)) {
|
|
435982
436000
|
throw new Error(`Invalid scope "${scope}". Must be one of: ${VALID_INSTALLABLE_SCOPES.join(", ")}`);
|
|
@@ -436454,7 +436472,7 @@ async function performPluginUpdate({
|
|
|
436454
436472
|
throw e;
|
|
436455
436473
|
}
|
|
436456
436474
|
const marketplaceDir = marketplaceStats.isDirectory() ? marketplaceInstallLocation : dirname51(marketplaceInstallLocation);
|
|
436457
|
-
sourcePath =
|
|
436475
|
+
sourcePath = join117(marketplaceDir, entry.source);
|
|
436458
436476
|
try {
|
|
436459
436477
|
await fs9.stat(sourcePath);
|
|
436460
436478
|
} catch (e) {
|
|
@@ -436469,8 +436487,8 @@ async function performPluginUpdate({
|
|
|
436469
436487
|
throw e;
|
|
436470
436488
|
}
|
|
436471
436489
|
let pluginManifest;
|
|
436472
|
-
const manifestPath =
|
|
436473
|
-
const claudeManifestPath =
|
|
436490
|
+
const manifestPath = join117(sourcePath, ".vivus-plugin", "plugin.json");
|
|
436491
|
+
const claudeManifestPath = join117(sourcePath, ".claude-plugin", "plugin.json");
|
|
436474
436492
|
try {
|
|
436475
436493
|
pluginManifest = await loadPluginManifest(manifestPath, entry.name, entry.source);
|
|
436476
436494
|
} catch {
|
|
@@ -437694,9 +437712,9 @@ var init_ManageMarketplaces = __esm(() => {
|
|
|
437694
437712
|
// src/utils/plugins/pluginFlagging.ts
|
|
437695
437713
|
import { randomBytes as randomBytes19 } from "crypto";
|
|
437696
437714
|
import { readFile as readFile38, rename as rename8, unlink as unlink18, writeFile as writeFile34 } from "fs/promises";
|
|
437697
|
-
import { join as
|
|
437715
|
+
import { join as join118 } from "path";
|
|
437698
437716
|
function getFlaggedPluginsPath() {
|
|
437699
|
-
return
|
|
437717
|
+
return join118(getPluginsDirectory(), FLAGGED_PLUGINS_FILENAME);
|
|
437700
437718
|
}
|
|
437701
437719
|
function parsePluginsData(content) {
|
|
437702
437720
|
const parsed = jsonParse(content);
|
|
@@ -447804,9 +447822,9 @@ ${args ? "Additional user input: " + args : ""}
|
|
|
447804
447822
|
|
|
447805
447823
|
// src/utils/releaseNotes.ts
|
|
447806
447824
|
import { mkdir as mkdir33, readFile as readFile41, writeFile as writeFile35 } from "fs/promises";
|
|
447807
|
-
import { dirname as dirname53, join as
|
|
447825
|
+
import { dirname as dirname53, join as join121 } from "path";
|
|
447808
447826
|
function getChangelogCachePath() {
|
|
447809
|
-
return
|
|
447827
|
+
return join121(getVivusConfigHomeDir(), "cache", "changelog.md");
|
|
447810
447828
|
}
|
|
447811
447829
|
async function migrateChangelogFromConfig() {
|
|
447812
447830
|
const config4 = getGlobalConfig();
|
|
@@ -447895,8 +447913,8 @@ function parseChangelog(content) {
|
|
|
447895
447913
|
function getRecentReleaseNotes(currentVersion, previousVersion, changelogContent = getStoredChangelogFromMemory()) {
|
|
447896
447914
|
try {
|
|
447897
447915
|
const releaseNotes = parseChangelog(changelogContent);
|
|
447898
|
-
const baseCurrentVersion =
|
|
447899
|
-
const basePreviousVersion = previousVersion ?
|
|
447916
|
+
const baseCurrentVersion = import_semver9.coerce(currentVersion);
|
|
447917
|
+
const basePreviousVersion = previousVersion ? import_semver9.coerce(previousVersion) : null;
|
|
447900
447918
|
if (!basePreviousVersion || baseCurrentVersion && gt(baseCurrentVersion.version, basePreviousVersion.version)) {
|
|
447901
447919
|
return Object.entries(releaseNotes).filter(([version2]) => !basePreviousVersion || gt(version2, basePreviousVersion.version)).sort(([versionA], [versionB]) => gt(versionA, versionB) ? -1 : 1).flatMap(([_, notes]) => notes).filter(Boolean).slice(0, MAX_RELEASE_NOTES_SHOWN);
|
|
447902
447920
|
}
|
|
@@ -447924,7 +447942,7 @@ function getAllReleaseNotes(changelogContent = getStoredChangelogFromMemory()) {
|
|
|
447924
447942
|
return [];
|
|
447925
447943
|
}
|
|
447926
447944
|
}
|
|
447927
|
-
async function checkForReleaseNotes(lastSeenVersion, currentVersion = "1.1.
|
|
447945
|
+
async function checkForReleaseNotes(lastSeenVersion, currentVersion = "1.1.32+82959fe") {
|
|
447928
447946
|
if (process.env.USER_TYPE === "ant") {
|
|
447929
447947
|
const changelog = "";
|
|
447930
447948
|
if (changelog) {
|
|
@@ -447951,7 +447969,7 @@ async function checkForReleaseNotes(lastSeenVersion, currentVersion = "1.1.30+da
|
|
|
447951
447969
|
releaseNotes
|
|
447952
447970
|
};
|
|
447953
447971
|
}
|
|
447954
|
-
function checkForReleaseNotesSync(lastSeenVersion, currentVersion = "1.1.
|
|
447972
|
+
function checkForReleaseNotesSync(lastSeenVersion, currentVersion = "1.1.32+82959fe") {
|
|
447955
447973
|
if (process.env.USER_TYPE === "ant") {
|
|
447956
447974
|
const changelog = "";
|
|
447957
447975
|
if (changelog) {
|
|
@@ -447973,7 +447991,7 @@ function checkForReleaseNotesSync(lastSeenVersion, currentVersion = "1.1.30+da03
|
|
|
447973
447991
|
releaseNotes
|
|
447974
447992
|
};
|
|
447975
447993
|
}
|
|
447976
|
-
var
|
|
447994
|
+
var import_semver9, MAX_RELEASE_NOTES_SHOWN = 5, CHANGELOG_URL = "https://github.com/anthropics/vivus/blob/main/CHANGELOG.md", RAW_CHANGELOG_URL = "https://raw.githubusercontent.com/anthropics/vivus/refs/heads/main/CHANGELOG.md", changelogMemoryCache = null;
|
|
447977
447995
|
var init_releaseNotes = __esm(() => {
|
|
447978
447996
|
init_axios2();
|
|
447979
447997
|
init_state();
|
|
@@ -447981,7 +447999,7 @@ var init_releaseNotes = __esm(() => {
|
|
|
447981
447999
|
init_envUtils();
|
|
447982
448000
|
init_errors();
|
|
447983
448001
|
init_log3();
|
|
447984
|
-
|
|
448002
|
+
import_semver9 = __toESM(require_semver3(), 1);
|
|
447985
448003
|
});
|
|
447986
448004
|
|
|
447987
448005
|
// src/commands/release-notes/release-notes.ts
|
|
@@ -449121,7 +449139,7 @@ function getRecentActivitySync() {
|
|
|
449121
449139
|
return cachedActivity;
|
|
449122
449140
|
}
|
|
449123
449141
|
function getLogoDisplayData() {
|
|
449124
|
-
const version2 = process.env.DEMO_VERSION ?? "1.1.
|
|
449142
|
+
const version2 = process.env.DEMO_VERSION ?? "1.1.32+82959fe";
|
|
449125
449143
|
const serverUrl = getDirectConnectServerUrl();
|
|
449126
449144
|
const displayPath = process.env.DEMO_VERSION ? "/code/vivus" : getDisplayPath(getCwd());
|
|
449127
449145
|
const cwd2 = serverUrl ? `${displayPath} in ${serverUrl.replace(/^https?:\/\//, "")}` : displayPath;
|
|
@@ -450648,7 +450666,7 @@ function LogoV2() {
|
|
|
450648
450666
|
if ($2[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
450649
450667
|
t2 = () => {
|
|
450650
450668
|
const currentConfig = getGlobalConfig();
|
|
450651
|
-
if (currentConfig.lastReleaseNotesSeen === "1.1.
|
|
450669
|
+
if (currentConfig.lastReleaseNotesSeen === "1.1.32+82959fe") {
|
|
450652
450670
|
return;
|
|
450653
450671
|
}
|
|
450654
450672
|
saveGlobalConfig(_temp329);
|
|
@@ -451324,12 +451342,12 @@ function LogoV2() {
|
|
|
451324
451342
|
return t41;
|
|
451325
451343
|
}
|
|
451326
451344
|
function _temp329(current) {
|
|
451327
|
-
if (current.lastReleaseNotesSeen === "1.1.
|
|
451345
|
+
if (current.lastReleaseNotesSeen === "1.1.32+82959fe") {
|
|
451328
451346
|
return current;
|
|
451329
451347
|
}
|
|
451330
451348
|
return {
|
|
451331
451349
|
...current,
|
|
451332
|
-
lastReleaseNotesSeen: "1.1.
|
|
451350
|
+
lastReleaseNotesSeen: "1.1.32+82959fe"
|
|
451333
451351
|
};
|
|
451334
451352
|
}
|
|
451335
451353
|
function _temp245(s_0) {
|
|
@@ -464445,7 +464463,7 @@ __export(exports_thinkback, {
|
|
|
464445
464463
|
call: () => call40
|
|
464446
464464
|
});
|
|
464447
464465
|
import { readFile as readFile42 } from "fs/promises";
|
|
464448
|
-
import { join as
|
|
464466
|
+
import { join as join122 } from "path";
|
|
464449
464467
|
function getMarketplaceName() {
|
|
464450
464468
|
return OFFICIAL_MARKETPLACE_NAME;
|
|
464451
464469
|
}
|
|
@@ -464463,15 +464481,15 @@ async function getThinkbackSkillDir() {
|
|
|
464463
464481
|
if (!thinkbackPlugin) {
|
|
464464
464482
|
return null;
|
|
464465
464483
|
}
|
|
464466
|
-
const skillDir =
|
|
464484
|
+
const skillDir = join122(thinkbackPlugin.path, "skills", SKILL_NAME);
|
|
464467
464485
|
if (await pathExists(skillDir)) {
|
|
464468
464486
|
return skillDir;
|
|
464469
464487
|
}
|
|
464470
464488
|
return null;
|
|
464471
464489
|
}
|
|
464472
464490
|
async function playAnimation(skillDir) {
|
|
464473
|
-
const dataPath =
|
|
464474
|
-
const playerPath =
|
|
464491
|
+
const dataPath = join122(skillDir, "year_in_review.js");
|
|
464492
|
+
const playerPath = join122(skillDir, "player.js");
|
|
464475
464493
|
try {
|
|
464476
464494
|
await readFile42(dataPath);
|
|
464477
464495
|
} catch (e) {
|
|
@@ -464519,7 +464537,7 @@ async function playAnimation(skillDir) {
|
|
|
464519
464537
|
} catch {} finally {
|
|
464520
464538
|
inkInstance.exitAlternateScreen();
|
|
464521
464539
|
}
|
|
464522
|
-
const htmlPath =
|
|
464540
|
+
const htmlPath = join122(skillDir, "year_in_review.html");
|
|
464523
464541
|
if (await pathExists(htmlPath)) {
|
|
464524
464542
|
const platform5 = getPlatform();
|
|
464525
464543
|
const openCmd = platform5 === "macos" ? "open" : platform5 === "windows" ? "start" : "xdg-open";
|
|
@@ -464855,7 +464873,7 @@ function ThinkbackFlow(t0) {
|
|
|
464855
464873
|
if (!skillDir) {
|
|
464856
464874
|
return;
|
|
464857
464875
|
}
|
|
464858
|
-
const dataPath =
|
|
464876
|
+
const dataPath = join122(skillDir, "year_in_review.js");
|
|
464859
464877
|
pathExists(dataPath).then((exists) => {
|
|
464860
464878
|
logForDebugging(`Checking for ${dataPath}: ${exists ? "found" : "not found"}`);
|
|
464861
464879
|
setHasGenerated(exists);
|
|
@@ -465029,7 +465047,7 @@ var exports_thinkback_play = {};
|
|
|
465029
465047
|
__export(exports_thinkback_play, {
|
|
465030
465048
|
call: () => call41
|
|
465031
465049
|
});
|
|
465032
|
-
import { join as
|
|
465050
|
+
import { join as join123 } from "path";
|
|
465033
465051
|
function getPluginId2() {
|
|
465034
465052
|
const marketplaceName = process.env.USER_TYPE === "ant" ? INTERNAL_MARKETPLACE_NAME : OFFICIAL_MARKETPLACE_NAME;
|
|
465035
465053
|
return `thinkback@${marketplaceName}`;
|
|
@@ -465051,7 +465069,7 @@ async function call41() {
|
|
|
465051
465069
|
value: "Thinkback plugin installation path not found."
|
|
465052
465070
|
};
|
|
465053
465071
|
}
|
|
465054
|
-
const skillDir =
|
|
465072
|
+
const skillDir = join123(firstInstall.installPath, "skills", SKILL_NAME2);
|
|
465055
465073
|
const result = await playAnimation(skillDir);
|
|
465056
465074
|
return { type: "text", value: result.message };
|
|
465057
465075
|
}
|
|
@@ -471446,7 +471464,7 @@ var init_types12 = __esm(() => {
|
|
|
471446
471464
|
|
|
471447
471465
|
// src/components/agents/agentFileUtils.ts
|
|
471448
471466
|
import { mkdir as mkdir35, open as open13, unlink as unlink19 } from "fs/promises";
|
|
471449
|
-
import { join as
|
|
471467
|
+
import { join as join124 } from "path";
|
|
471450
471468
|
function formatAgentAsMarkdown(agentType, whenToUse, tools, systemPrompt, color3, model, memory2, effort) {
|
|
471451
471469
|
const escapedWhenToUse = whenToUse.replace(/\\/g, "\\\\").replace(/"/g, "\\\"").replace(/\n/g, "\\\\n");
|
|
471452
471470
|
const isAllTools = tools === undefined || tools.length === 1 && tools[0] === "*";
|
|
@@ -471473,26 +471491,26 @@ function getAgentDirectoryPath(location) {
|
|
|
471473
471491
|
case "flagSettings":
|
|
471474
471492
|
throw new Error(`Cannot get directory path for ${location} agents`);
|
|
471475
471493
|
case "userSettings":
|
|
471476
|
-
return
|
|
471494
|
+
return join124(getVivusConfigHomeDir(), AGENT_PATHS.AGENTS_DIR);
|
|
471477
471495
|
case "projectSettings":
|
|
471478
|
-
return
|
|
471496
|
+
return join124(getCwd(), AGENT_PATHS.FOLDER_NAME, AGENT_PATHS.AGENTS_DIR);
|
|
471479
471497
|
case "policySettings":
|
|
471480
|
-
return
|
|
471498
|
+
return join124(getManagedFilePath(), AGENT_PATHS.FOLDER_NAME, AGENT_PATHS.AGENTS_DIR);
|
|
471481
471499
|
case "localSettings":
|
|
471482
|
-
return
|
|
471500
|
+
return join124(getCwd(), AGENT_PATHS.FOLDER_NAME, AGENT_PATHS.AGENTS_DIR);
|
|
471483
471501
|
}
|
|
471484
471502
|
}
|
|
471485
471503
|
function getRelativeAgentDirectoryPath(location) {
|
|
471486
471504
|
switch (location) {
|
|
471487
471505
|
case "projectSettings":
|
|
471488
|
-
return
|
|
471506
|
+
return join124(".", AGENT_PATHS.FOLDER_NAME, AGENT_PATHS.AGENTS_DIR);
|
|
471489
471507
|
default:
|
|
471490
471508
|
return getAgentDirectoryPath(location);
|
|
471491
471509
|
}
|
|
471492
471510
|
}
|
|
471493
471511
|
function getNewAgentFilePath(agent) {
|
|
471494
471512
|
const dirPath = getAgentDirectoryPath(agent.source);
|
|
471495
|
-
return
|
|
471513
|
+
return join124(dirPath, `${agent.agentType}.md`);
|
|
471496
471514
|
}
|
|
471497
471515
|
function getActualAgentFilePath(agent) {
|
|
471498
471516
|
if (agent.source === "built-in") {
|
|
@@ -471503,14 +471521,14 @@ function getActualAgentFilePath(agent) {
|
|
|
471503
471521
|
}
|
|
471504
471522
|
const dirPath = getAgentDirectoryPath(agent.source);
|
|
471505
471523
|
const filename = agent.filename || agent.agentType;
|
|
471506
|
-
return
|
|
471524
|
+
return join124(dirPath, `${filename}.md`);
|
|
471507
471525
|
}
|
|
471508
471526
|
function getNewRelativeAgentFilePath(agent) {
|
|
471509
471527
|
if (agent.source === "built-in") {
|
|
471510
471528
|
return "Built-in";
|
|
471511
471529
|
}
|
|
471512
471530
|
const dirPath = getRelativeAgentDirectoryPath(agent.source);
|
|
471513
|
-
return
|
|
471531
|
+
return join124(dirPath, `${agent.agentType}.md`);
|
|
471514
471532
|
}
|
|
471515
471533
|
function getActualRelativeAgentFilePath(agent) {
|
|
471516
471534
|
if (isBuiltInAgent(agent)) {
|
|
@@ -471524,7 +471542,7 @@ function getActualRelativeAgentFilePath(agent) {
|
|
|
471524
471542
|
}
|
|
471525
471543
|
const dirPath = getRelativeAgentDirectoryPath(agent.source);
|
|
471526
471544
|
const filename = agent.filename || agent.agentType;
|
|
471527
|
-
return
|
|
471545
|
+
return join124(dirPath, `${filename}.md`);
|
|
471528
471546
|
}
|
|
471529
471547
|
async function ensureAgentDirectoryExists(source) {
|
|
471530
471548
|
const dirPath = getAgentDirectoryPath(source);
|
|
@@ -477536,7 +477554,7 @@ var init_rewind = __esm(() => {
|
|
|
477536
477554
|
// src/utils/heapDumpService.ts
|
|
477537
477555
|
import { createWriteStream as createWriteStream3, writeFileSync as writeFileSync4 } from "fs";
|
|
477538
477556
|
import { readdir as readdir26, readFile as readFile44, writeFile as writeFile37 } from "fs/promises";
|
|
477539
|
-
import { join as
|
|
477557
|
+
import { join as join125 } from "path";
|
|
477540
477558
|
import { pipeline as pipeline2 } from "stream/promises";
|
|
477541
477559
|
import {
|
|
477542
477560
|
getHeapSnapshot,
|
|
@@ -477626,7 +477644,7 @@ async function captureMemoryDiagnostics(trigger, dumpNumber = 0) {
|
|
|
477626
477644
|
smapsRollup,
|
|
477627
477645
|
platform: process.platform,
|
|
477628
477646
|
nodeVersion: process.version,
|
|
477629
|
-
ccVersion: "1.1.
|
|
477647
|
+
ccVersion: "1.1.32+82959fe"
|
|
477630
477648
|
};
|
|
477631
477649
|
}
|
|
477632
477650
|
async function performHeapDump(trigger = "manual", dumpNumber = 0) {
|
|
@@ -477644,8 +477662,8 @@ async function performHeapDump(trigger = "manual", dumpNumber = 0) {
|
|
|
477644
477662
|
const suffix = dumpNumber > 0 ? `-dump${dumpNumber}` : "";
|
|
477645
477663
|
const heapFilename = `${sessionId}${suffix}.heapsnapshot`;
|
|
477646
477664
|
const diagFilename = `${sessionId}${suffix}-diagnostics.json`;
|
|
477647
|
-
const heapPath =
|
|
477648
|
-
const diagPath =
|
|
477665
|
+
const heapPath = join125(dumpDir, heapFilename);
|
|
477666
|
+
const diagPath = join125(dumpDir, diagFilename);
|
|
477649
477667
|
await writeFile37(diagPath, jsonStringify(diagnostics, null, 2), {
|
|
477650
477668
|
mode: 384
|
|
477651
477669
|
});
|
|
@@ -478212,7 +478230,7 @@ var init_bridge_kick = __esm(() => {
|
|
|
478212
478230
|
var call56 = async () => {
|
|
478213
478231
|
return {
|
|
478214
478232
|
type: "text",
|
|
478215
|
-
value: `${"1.1.
|
|
478233
|
+
value: `${"1.1.32+82959fe"} (built ${"2026-06-23T22:31:12.509Z"})`
|
|
478216
478234
|
};
|
|
478217
478235
|
}, version2, version_default;
|
|
478218
478236
|
var init_version = __esm(() => {
|
|
@@ -479491,7 +479509,7 @@ var init_sandbox_toggle2 = __esm(() => {
|
|
|
479491
479509
|
|
|
479492
479510
|
// src/utils/vivusInChrome/setupPortable.ts
|
|
479493
479511
|
import { readdir as readdir27 } from "fs/promises";
|
|
479494
|
-
import { join as
|
|
479512
|
+
import { join as join126 } from "path";
|
|
479495
479513
|
function getExtensionIds() {
|
|
479496
479514
|
return process.env.USER_TYPE === "ant" ? [PROD_EXTENSION_ID, DEV_EXTENSION_ID, ANT_EXTENSION_ID] : [PROD_EXTENSION_ID];
|
|
479497
479515
|
}
|
|
@@ -479518,7 +479536,7 @@ async function detectExtensionInstallationPortable(browserPaths, log) {
|
|
|
479518
479536
|
}
|
|
479519
479537
|
for (const profile of profileDirs) {
|
|
479520
479538
|
for (const extensionId of extensionIds) {
|
|
479521
|
-
const extensionPath =
|
|
479539
|
+
const extensionPath = join126(browserBasePath, profile, "Extensions", extensionId);
|
|
479522
479540
|
try {
|
|
479523
479541
|
await readdir27(extensionPath);
|
|
479524
479542
|
log?.(`[Vivus in Chrome] Extension ${extensionId} found in ${browser} ${profile}`);
|
|
@@ -479542,7 +479560,7 @@ var init_setupPortable = __esm(() => {
|
|
|
479542
479560
|
// src/utils/vivusInChrome/setup.ts
|
|
479543
479561
|
import { chmod as chmod10, mkdir as mkdir36, readFile as readFile45, writeFile as writeFile38 } from "fs/promises";
|
|
479544
479562
|
import { homedir as homedir33 } from "os";
|
|
479545
|
-
import { join as
|
|
479563
|
+
import { join as join127 } from "path";
|
|
479546
479564
|
import { fileURLToPath as fileURLToPath7 } from "url";
|
|
479547
479565
|
function shouldEnableVivusInChrome(chromeFlag) {
|
|
479548
479566
|
if (getIsNonInteractiveSession() && chromeFlag !== true) {
|
|
@@ -479599,8 +479617,8 @@ function setupVivusInChrome() {
|
|
|
479599
479617
|
};
|
|
479600
479618
|
} else {
|
|
479601
479619
|
const __filename3 = fileURLToPath7(import.meta.url);
|
|
479602
|
-
const __dirname3 =
|
|
479603
|
-
const cliPath =
|
|
479620
|
+
const __dirname3 = join127(__filename3, "..");
|
|
479621
|
+
const cliPath = join127(__dirname3, "cli.js");
|
|
479604
479622
|
createWrapperScript(`"${process.execPath}" "${cliPath}" --chrome-native-host`).then((manifestBinaryPath) => installChromeNativeHostManifest(manifestBinaryPath)).catch((e) => logForDebugging(`[Vivus in Chrome] Failed to install native host: ${e}`, { level: "error" }));
|
|
479605
479623
|
const mcpConfig = {
|
|
479606
479624
|
[VIVUS_IN_CHROME_MCP_SERVER_NAME]: {
|
|
@@ -479622,8 +479640,8 @@ function getNativeMessagingHostsDirs() {
|
|
|
479622
479640
|
const platform5 = getPlatform();
|
|
479623
479641
|
if (platform5 === "windows") {
|
|
479624
479642
|
const home = homedir33();
|
|
479625
|
-
const appData = process.env.APPDATA ||
|
|
479626
|
-
return [
|
|
479643
|
+
const appData = process.env.APPDATA || join127(home, "AppData", "Local");
|
|
479644
|
+
return [join127(appData, "Vivus", "ChromeNativeHost")];
|
|
479627
479645
|
}
|
|
479628
479646
|
return getAllNativeMessagingHostsDirs().map(({ path: path23 }) => path23);
|
|
479629
479647
|
}
|
|
@@ -479648,7 +479666,7 @@ async function installChromeNativeHostManifest(manifestBinaryPath) {
|
|
|
479648
479666
|
const manifestContent = jsonStringify(manifest, null, 2);
|
|
479649
479667
|
let anyManifestUpdated = false;
|
|
479650
479668
|
for (const manifestDir of manifestDirs) {
|
|
479651
|
-
const manifestPath =
|
|
479669
|
+
const manifestPath = join127(manifestDir, NATIVE_HOST_MANIFEST_NAME);
|
|
479652
479670
|
const existingContent = await readFile45(manifestPath, "utf-8").catch(() => null);
|
|
479653
479671
|
if (existingContent === manifestContent) {
|
|
479654
479672
|
continue;
|
|
@@ -479663,7 +479681,7 @@ async function installChromeNativeHostManifest(manifestBinaryPath) {
|
|
|
479663
479681
|
}
|
|
479664
479682
|
}
|
|
479665
479683
|
if (getPlatform() === "windows") {
|
|
479666
|
-
const manifestPath =
|
|
479684
|
+
const manifestPath = join127(manifestDirs[0], NATIVE_HOST_MANIFEST_NAME);
|
|
479667
479685
|
registerWindowsNativeHosts(manifestPath);
|
|
479668
479686
|
}
|
|
479669
479687
|
if (anyManifestUpdated) {
|
|
@@ -479701,8 +479719,8 @@ function registerWindowsNativeHosts(manifestPath) {
|
|
|
479701
479719
|
}
|
|
479702
479720
|
async function createWrapperScript(command7) {
|
|
479703
479721
|
const platform5 = getPlatform();
|
|
479704
|
-
const chromeDir =
|
|
479705
|
-
const wrapperPath = platform5 === "windows" ?
|
|
479722
|
+
const chromeDir = join127(getVivusConfigHomeDir(), "chrome");
|
|
479723
|
+
const wrapperPath = platform5 === "windows" ? join127(chromeDir, "chrome-native-host.bat") : join127(chromeDir, "chrome-native-host");
|
|
479706
479724
|
const scriptContent = platform5 === "windows" ? `@echo off
|
|
479707
479725
|
REM Chrome native host wrapper script
|
|
479708
479726
|
REM Generated by Vivus - do not edit manually
|
|
@@ -480308,7 +480326,7 @@ var init_advisor2 = __esm(() => {
|
|
|
480308
480326
|
// src/skills/bundledSkills.ts
|
|
480309
480327
|
import { constants as fsConstants6 } from "fs";
|
|
480310
480328
|
import { mkdir as mkdir37, open as open14 } from "fs/promises";
|
|
480311
|
-
import { dirname as dirname54, isAbsolute as isAbsolute24, join as
|
|
480329
|
+
import { dirname as dirname54, isAbsolute as isAbsolute24, join as join128, normalize as normalize15, sep as pathSep2 } from "path";
|
|
480312
480330
|
function registerBundledSkill(definition) {
|
|
480313
480331
|
const { files: files2 } = definition;
|
|
480314
480332
|
let skillRoot;
|
|
@@ -480356,7 +480374,7 @@ function getBundledSkills() {
|
|
|
480356
480374
|
return [...bundledSkills];
|
|
480357
480375
|
}
|
|
480358
480376
|
function getBundledSkillExtractDir(skillName) {
|
|
480359
|
-
return
|
|
480377
|
+
return join128(getBundledSkillsRoot(), skillName);
|
|
480360
480378
|
}
|
|
480361
480379
|
async function extractBundledSkillFiles(skillName, files2) {
|
|
480362
480380
|
const dir = getBundledSkillExtractDir(skillName);
|
|
@@ -480398,7 +480416,7 @@ function resolveSkillFilePath(baseDir, relPath) {
|
|
|
480398
480416
|
if (isAbsolute24(normalized) || normalized.split(pathSep2).includes("..") || normalized.split("/").includes("..")) {
|
|
480399
480417
|
throw new Error(`bundled skill file path escapes skill dir: ${relPath}`);
|
|
480400
480418
|
}
|
|
480401
|
-
return
|
|
480419
|
+
return join128(baseDir, normalized);
|
|
480402
480420
|
}
|
|
480403
480421
|
function prependBaseDir(blocks, baseDir) {
|
|
480404
480422
|
const prefix = `Base directory for this skill: ${baseDir}
|
|
@@ -480759,7 +480777,7 @@ var init_exit2 = __esm(() => {
|
|
|
480759
480777
|
});
|
|
480760
480778
|
|
|
480761
480779
|
// src/components/ExportDialog.tsx
|
|
480762
|
-
import { join as
|
|
480780
|
+
import { join as join129 } from "path";
|
|
480763
480781
|
function ExportDialog({
|
|
480764
480782
|
content,
|
|
480765
480783
|
defaultFilename,
|
|
@@ -480792,7 +480810,7 @@ function ExportDialog({
|
|
|
480792
480810
|
};
|
|
480793
480811
|
const handleFilenameSubmit = () => {
|
|
480794
480812
|
const finalFilename = filename.endsWith(".txt") ? filename : filename.replace(/\.[^.]+$/, "") + ".txt";
|
|
480795
|
-
const filepath =
|
|
480813
|
+
const filepath = join129(getCwd(), finalFilename);
|
|
480796
480814
|
try {
|
|
480797
480815
|
writeFileSync_DEPRECATED(filepath, content, {
|
|
480798
480816
|
encoding: "utf-8",
|
|
@@ -481015,7 +481033,7 @@ __export(exports_export, {
|
|
|
481015
481033
|
extractFirstPrompt: () => extractFirstPrompt,
|
|
481016
481034
|
call: () => call62
|
|
481017
481035
|
});
|
|
481018
|
-
import { join as
|
|
481036
|
+
import { join as join130 } from "path";
|
|
481019
481037
|
function formatTimestamp(date6) {
|
|
481020
481038
|
const year = date6.getFullYear();
|
|
481021
481039
|
const month = String(date6.getMonth() + 1).padStart(2, "0");
|
|
@@ -481059,7 +481077,7 @@ async function call62(onDone, context2, args) {
|
|
|
481059
481077
|
const filename = args.trim();
|
|
481060
481078
|
if (filename) {
|
|
481061
481079
|
const finalFilename = filename.endsWith(".txt") ? filename : filename.replace(/\.[^.]+$/, "") + ".txt";
|
|
481062
|
-
const filepath =
|
|
481080
|
+
const filepath = join130(getCwd(), finalFilename);
|
|
481063
481081
|
try {
|
|
481064
481082
|
writeFileSync_DEPRECATED(filepath, content, {
|
|
481065
481083
|
encoding: "utf-8",
|
|
@@ -483212,7 +483230,7 @@ var require_asciichart = __commonJS((exports) => {
|
|
|
483212
483230
|
// src/utils/statsCache.ts
|
|
483213
483231
|
import { randomBytes as randomBytes20 } from "crypto";
|
|
483214
483232
|
import { open as open15 } from "fs/promises";
|
|
483215
|
-
import { join as
|
|
483233
|
+
import { join as join131 } from "path";
|
|
483216
483234
|
async function withStatsCacheLock(fn) {
|
|
483217
483235
|
while (statsCacheLockPromise) {
|
|
483218
483236
|
await statsCacheLockPromise;
|
|
@@ -483229,7 +483247,7 @@ async function withStatsCacheLock(fn) {
|
|
|
483229
483247
|
}
|
|
483230
483248
|
}
|
|
483231
483249
|
function getStatsCachePath() {
|
|
483232
|
-
return
|
|
483250
|
+
return join131(getVivusConfigHomeDir(), STATS_CACHE_FILENAME);
|
|
483233
483251
|
}
|
|
483234
483252
|
function getEmptyCache() {
|
|
483235
483253
|
return {
|
|
@@ -483897,12 +483915,12 @@ var init_ansiToPng = __esm(() => {
|
|
|
483897
483915
|
// src/utils/screenshotClipboard.ts
|
|
483898
483916
|
import { mkdir as mkdir38, unlink as unlink20, writeFile as writeFile39 } from "fs/promises";
|
|
483899
483917
|
import { tmpdir as tmpdir10 } from "os";
|
|
483900
|
-
import { join as
|
|
483918
|
+
import { join as join132 } from "path";
|
|
483901
483919
|
async function copyAnsiToClipboard(ansiText, options2) {
|
|
483902
483920
|
try {
|
|
483903
|
-
const tempDir =
|
|
483921
|
+
const tempDir = join132(tmpdir10(), "vivus-screenshots");
|
|
483904
483922
|
await mkdir38(tempDir, { recursive: true });
|
|
483905
|
-
const pngPath =
|
|
483923
|
+
const pngPath = join132(tempDir, `screenshot-${Date.now()}.png`);
|
|
483906
483924
|
const pngBuffer = ansiToPng(ansiText, options2);
|
|
483907
483925
|
await writeFile39(pngPath, pngBuffer);
|
|
483908
483926
|
const result = await copyPngToClipboard(pngPath);
|
|
@@ -483973,7 +483991,7 @@ var init_screenshotClipboard = __esm(() => {
|
|
|
483973
483991
|
|
|
483974
483992
|
// src/utils/stats.ts
|
|
483975
483993
|
import { open as open16 } from "fs/promises";
|
|
483976
|
-
import { basename as basename39, join as
|
|
483994
|
+
import { basename as basename39, join as join133, sep as sep31 } from "path";
|
|
483977
483995
|
async function processSessionFiles(sessionFiles, options2 = {}) {
|
|
483978
483996
|
const { fromDate, toDate } = options2;
|
|
483979
483997
|
const fs10 = getFsImplementation();
|
|
@@ -484151,17 +484169,17 @@ async function getAllSessionFiles() {
|
|
|
484151
484169
|
return [];
|
|
484152
484170
|
throw e;
|
|
484153
484171
|
}
|
|
484154
|
-
const projectDirs = allEntries.filter((dirent) => dirent.isDirectory()).map((dirent) =>
|
|
484172
|
+
const projectDirs = allEntries.filter((dirent) => dirent.isDirectory()).map((dirent) => join133(projectsDir, dirent.name));
|
|
484155
484173
|
const projectResults = await Promise.all(projectDirs.map(async (projectDir) => {
|
|
484156
484174
|
try {
|
|
484157
484175
|
const entries = await fs10.readdir(projectDir);
|
|
484158
|
-
const mainFiles = entries.filter((dirent) => dirent.isFile() && dirent.name.endsWith(".jsonl")).map((dirent) =>
|
|
484176
|
+
const mainFiles = entries.filter((dirent) => dirent.isFile() && dirent.name.endsWith(".jsonl")).map((dirent) => join133(projectDir, dirent.name));
|
|
484159
484177
|
const sessionDirs = entries.filter((dirent) => dirent.isDirectory());
|
|
484160
484178
|
const subagentResults = await Promise.all(sessionDirs.map(async (sessionDir) => {
|
|
484161
|
-
const subagentsDir =
|
|
484179
|
+
const subagentsDir = join133(projectDir, sessionDir.name, "subagents");
|
|
484162
484180
|
try {
|
|
484163
484181
|
const subagentEntries = await fs10.readdir(subagentsDir);
|
|
484164
|
-
return subagentEntries.filter((dirent) => dirent.isFile() && dirent.name.endsWith(".jsonl") && dirent.name.startsWith("agent-")).map((dirent) =>
|
|
484182
|
+
return subagentEntries.filter((dirent) => dirent.isFile() && dirent.name.endsWith(".jsonl") && dirent.name.startsWith("agent-")).map((dirent) => join133(subagentsDir, dirent.name));
|
|
484165
484183
|
} catch {
|
|
484166
484184
|
return [];
|
|
484167
484185
|
}
|
|
@@ -486041,7 +486059,7 @@ import {
|
|
|
486041
486059
|
writeFile as writeFile40
|
|
486042
486060
|
} from "fs/promises";
|
|
486043
486061
|
import { tmpdir as tmpdir11 } from "os";
|
|
486044
|
-
import { extname as extname12, join as
|
|
486062
|
+
import { extname as extname12, join as join134 } from "path";
|
|
486045
486063
|
function getAnalysisModel() {
|
|
486046
486064
|
return getDefaultOpusModel();
|
|
486047
486065
|
}
|
|
@@ -486049,13 +486067,13 @@ function getInsightsModel() {
|
|
|
486049
486067
|
return getDefaultOpusModel();
|
|
486050
486068
|
}
|
|
486051
486069
|
function getDataDir() {
|
|
486052
|
-
return
|
|
486070
|
+
return join134(getVivusConfigHomeDir(), "usage-data");
|
|
486053
486071
|
}
|
|
486054
486072
|
function getFacetsDir() {
|
|
486055
|
-
return
|
|
486073
|
+
return join134(getDataDir(), "facets");
|
|
486056
486074
|
}
|
|
486057
486075
|
function getSessionMetaDir() {
|
|
486058
|
-
return
|
|
486076
|
+
return join134(getDataDir(), "session-meta");
|
|
486059
486077
|
}
|
|
486060
486078
|
function getLanguageFromPath(filePath) {
|
|
486061
486079
|
const ext = extname12(filePath).toLowerCase();
|
|
@@ -486400,7 +486418,7 @@ async function formatTranscriptWithSummarization(log) {
|
|
|
486400
486418
|
`);
|
|
486401
486419
|
}
|
|
486402
486420
|
async function loadCachedFacets(sessionId) {
|
|
486403
|
-
const facetPath =
|
|
486421
|
+
const facetPath = join134(getFacetsDir(), `${sessionId}.json`);
|
|
486404
486422
|
try {
|
|
486405
486423
|
const content = await readFile46(facetPath, { encoding: "utf-8" });
|
|
486406
486424
|
const parsed = jsonParse(content);
|
|
@@ -486419,14 +486437,14 @@ async function saveFacets(facets) {
|
|
|
486419
486437
|
try {
|
|
486420
486438
|
await mkdir39(getFacetsDir(), { recursive: true });
|
|
486421
486439
|
} catch {}
|
|
486422
|
-
const facetPath =
|
|
486440
|
+
const facetPath = join134(getFacetsDir(), `${facets.session_id}.json`);
|
|
486423
486441
|
await writeFile40(facetPath, jsonStringify(facets, null, 2), {
|
|
486424
486442
|
encoding: "utf-8",
|
|
486425
486443
|
mode: 384
|
|
486426
486444
|
});
|
|
486427
486445
|
}
|
|
486428
486446
|
async function loadCachedSessionMeta(sessionId) {
|
|
486429
|
-
const metaPath =
|
|
486447
|
+
const metaPath = join134(getSessionMetaDir(), `${sessionId}.json`);
|
|
486430
486448
|
try {
|
|
486431
486449
|
const content = await readFile46(metaPath, { encoding: "utf-8" });
|
|
486432
486450
|
return jsonParse(content);
|
|
@@ -486438,7 +486456,7 @@ async function saveSessionMeta(meta) {
|
|
|
486438
486456
|
try {
|
|
486439
486457
|
await mkdir39(getSessionMetaDir(), { recursive: true });
|
|
486440
486458
|
} catch {}
|
|
486441
|
-
const metaPath =
|
|
486459
|
+
const metaPath = join134(getSessionMetaDir(), `${meta.session_id}.json`);
|
|
486442
486460
|
await writeFile40(metaPath, jsonStringify(meta, null, 2), {
|
|
486443
486461
|
encoding: "utf-8",
|
|
486444
486462
|
mode: 384
|
|
@@ -487495,7 +487513,7 @@ function generateHtmlReport(data, insights) {
|
|
|
487495
487513
|
</html>`;
|
|
487496
487514
|
}
|
|
487497
487515
|
function buildExportData(data, insights, facets, remoteStats) {
|
|
487498
|
-
const version3 = typeof MACRO !== "undefined" ? "1.1.
|
|
487516
|
+
const version3 = typeof MACRO !== "undefined" ? "1.1.32+82959fe" : "unknown";
|
|
487499
487517
|
const remote_hosts_collected = remoteStats?.hosts.filter((h2) => h2.sessionCount > 0).map((h2) => h2.name);
|
|
487500
487518
|
const facets_summary = {
|
|
487501
487519
|
total: facets.size,
|
|
@@ -487546,7 +487564,7 @@ async function scanAllSessions() {
|
|
|
487546
487564
|
} catch {
|
|
487547
487565
|
return [];
|
|
487548
487566
|
}
|
|
487549
|
-
const projectDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) =>
|
|
487567
|
+
const projectDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join134(projectsDir, dirent.name));
|
|
487550
487568
|
const allSessions = [];
|
|
487551
487569
|
for (let i2 = 0;i2 < projectDirs.length; i2++) {
|
|
487552
487570
|
const sessionFiles = await getSessionFilesWithMtime(projectDirs[i2]);
|
|
@@ -487568,7 +487586,7 @@ async function scanAllSessions() {
|
|
|
487568
487586
|
async function generateUsageReport(options2) {
|
|
487569
487587
|
let remoteStats;
|
|
487570
487588
|
if (process.env.USER_TYPE === "ant" && options2?.collectRemote) {
|
|
487571
|
-
const destDir =
|
|
487589
|
+
const destDir = join134(getVivusConfigHomeDir(), "projects");
|
|
487572
487590
|
const { hosts, totalCopied } = await collectAllRemoteHostData(destDir);
|
|
487573
487591
|
remoteStats = { hosts, totalCopied };
|
|
487574
487592
|
}
|
|
@@ -487707,7 +487725,7 @@ async function generateUsageReport(options2) {
|
|
|
487707
487725
|
try {
|
|
487708
487726
|
await mkdir39(getDataDir(), { recursive: true });
|
|
487709
487727
|
} catch {}
|
|
487710
|
-
const htmlPath =
|
|
487728
|
+
const htmlPath = join134(getDataDir(), "report.html");
|
|
487711
487729
|
await writeFile40(htmlPath, htmlReport, {
|
|
487712
487730
|
encoding: "utf-8",
|
|
487713
487731
|
mode: 384
|
|
@@ -487803,13 +487821,13 @@ var init_insights = __esm(() => {
|
|
|
487803
487821
|
} : async () => 0;
|
|
487804
487822
|
collectFromRemoteHost = process.env.USER_TYPE === "ant" ? async (homespace, destDir) => {
|
|
487805
487823
|
const result = { copied: 0, skipped: 0 };
|
|
487806
|
-
const tempDir = await mkdtemp(
|
|
487824
|
+
const tempDir = await mkdtemp(join134(tmpdir11(), "vivus-hs-"));
|
|
487807
487825
|
try {
|
|
487808
487826
|
const scpResult = await execFileNoThrow("scp", ["-rq", `${homespace}.coder:/root/.vivus/projects/`, tempDir], { timeout: 300000 });
|
|
487809
487827
|
if (scpResult.code !== 0) {
|
|
487810
487828
|
return result;
|
|
487811
487829
|
}
|
|
487812
|
-
const projectsDir =
|
|
487830
|
+
const projectsDir = join134(tempDir, "projects");
|
|
487813
487831
|
let projectDirents;
|
|
487814
487832
|
try {
|
|
487815
487833
|
projectDirents = await readdir28(projectsDir, { withFileTypes: true });
|
|
@@ -487818,11 +487836,11 @@ var init_insights = __esm(() => {
|
|
|
487818
487836
|
}
|
|
487819
487837
|
await Promise.all(projectDirents.map(async (dirent) => {
|
|
487820
487838
|
const projectName = dirent.name;
|
|
487821
|
-
const projectPath =
|
|
487839
|
+
const projectPath = join134(projectsDir, projectName);
|
|
487822
487840
|
if (!dirent.isDirectory())
|
|
487823
487841
|
return;
|
|
487824
487842
|
const destProjectName = `${projectName}__${homespace}`;
|
|
487825
|
-
const destProjectPath =
|
|
487843
|
+
const destProjectPath = join134(destDir, destProjectName);
|
|
487826
487844
|
try {
|
|
487827
487845
|
await mkdir39(destProjectPath, { recursive: true });
|
|
487828
487846
|
} catch {}
|
|
@@ -487836,8 +487854,8 @@ var init_insights = __esm(() => {
|
|
|
487836
487854
|
const fileName = fileDirent.name;
|
|
487837
487855
|
if (!fileName.endsWith(".jsonl"))
|
|
487838
487856
|
return;
|
|
487839
|
-
const srcFile =
|
|
487840
|
-
const destFile =
|
|
487857
|
+
const srcFile = join134(projectPath, fileName);
|
|
487858
|
+
const destFile = join134(destProjectPath, fileName);
|
|
487841
487859
|
try {
|
|
487842
487860
|
await copyFile10(srcFile, destFile, fsConstants7.COPYFILE_EXCL);
|
|
487843
487861
|
result.copied++;
|
|
@@ -488783,7 +488801,7 @@ import {
|
|
|
488783
488801
|
unlink as unlink22,
|
|
488784
488802
|
writeFile as writeFile41
|
|
488785
488803
|
} from "fs/promises";
|
|
488786
|
-
import { basename as basename40, dirname as dirname56, join as
|
|
488804
|
+
import { basename as basename40, dirname as dirname56, join as join135 } from "path";
|
|
488787
488805
|
function isTranscriptMessage(entry) {
|
|
488788
488806
|
return entry.type === "user" || entry.type === "assistant" || entry.type === "attachment" || entry.type === "system";
|
|
488789
488807
|
}
|
|
@@ -488797,18 +488815,18 @@ function isEphemeralToolProgress(dataType) {
|
|
|
488797
488815
|
return typeof dataType === "string" && EPHEMERAL_PROGRESS_TYPES.has(dataType);
|
|
488798
488816
|
}
|
|
488799
488817
|
function getProjectsDir2() {
|
|
488800
|
-
return
|
|
488818
|
+
return join135(getVivusConfigHomeDir(), "projects");
|
|
488801
488819
|
}
|
|
488802
488820
|
function getTranscriptPath() {
|
|
488803
488821
|
const projectDir = getSessionProjectDir() ?? getProjectDir2(getOriginalCwd());
|
|
488804
|
-
return
|
|
488822
|
+
return join135(projectDir, `${getSessionId()}.jsonl`);
|
|
488805
488823
|
}
|
|
488806
488824
|
function getTranscriptPathForSession(sessionId) {
|
|
488807
488825
|
if (sessionId === getSessionId()) {
|
|
488808
488826
|
return getTranscriptPath();
|
|
488809
488827
|
}
|
|
488810
488828
|
const projectDir = getProjectDir2(getOriginalCwd());
|
|
488811
|
-
return
|
|
488829
|
+
return join135(projectDir, `${sessionId}.jsonl`);
|
|
488812
488830
|
}
|
|
488813
488831
|
function setAgentTranscriptSubdir(agentId, subdir) {
|
|
488814
488832
|
agentTranscriptSubdirs.set(agentId, subdir);
|
|
@@ -488820,8 +488838,8 @@ function getAgentTranscriptPath(agentId) {
|
|
|
488820
488838
|
const projectDir = getSessionProjectDir() ?? getProjectDir2(getOriginalCwd());
|
|
488821
488839
|
const sessionId = getSessionId();
|
|
488822
488840
|
const subdir = agentTranscriptSubdirs.get(agentId);
|
|
488823
|
-
const base2 = subdir ?
|
|
488824
|
-
return
|
|
488841
|
+
const base2 = subdir ? join135(projectDir, sessionId, "subagents", subdir) : join135(projectDir, sessionId, "subagents");
|
|
488842
|
+
return join135(base2, `agent-${agentId}.jsonl`);
|
|
488825
488843
|
}
|
|
488826
488844
|
function getAgentMetadataPath(agentId) {
|
|
488827
488845
|
return getAgentTranscriptPath(agentId).replace(/\.jsonl$/, ".meta.json");
|
|
@@ -488844,10 +488862,10 @@ async function readAgentMetadata(agentId) {
|
|
|
488844
488862
|
}
|
|
488845
488863
|
function getRemoteAgentsDir() {
|
|
488846
488864
|
const projectDir = getSessionProjectDir() ?? getProjectDir2(getOriginalCwd());
|
|
488847
|
-
return
|
|
488865
|
+
return join135(projectDir, getSessionId(), "remote-agents");
|
|
488848
488866
|
}
|
|
488849
488867
|
function getRemoteAgentMetadataPath(taskId) {
|
|
488850
|
-
return
|
|
488868
|
+
return join135(getRemoteAgentsDir(), `remote-agent-${taskId}.meta.json`);
|
|
488851
488869
|
}
|
|
488852
488870
|
async function writeRemoteAgentMetadata(taskId, metadata) {
|
|
488853
488871
|
const path23 = getRemoteAgentMetadataPath(taskId);
|
|
@@ -488890,7 +488908,7 @@ async function listRemoteAgentMetadata() {
|
|
|
488890
488908
|
if (!entry.isFile() || !entry.name.endsWith(".meta.json"))
|
|
488891
488909
|
continue;
|
|
488892
488910
|
try {
|
|
488893
|
-
const raw = await readFile47(
|
|
488911
|
+
const raw = await readFile47(join135(dir, entry.name), "utf-8");
|
|
488894
488912
|
results.push(JSON.parse(raw));
|
|
488895
488913
|
} catch (e) {
|
|
488896
488914
|
logForDebugging(`listRemoteAgentMetadata: skipping ${entry.name}: ${String(e)}`);
|
|
@@ -488900,7 +488918,7 @@ async function listRemoteAgentMetadata() {
|
|
|
488900
488918
|
}
|
|
488901
488919
|
function sessionIdExists(sessionId) {
|
|
488902
488920
|
const projectDir = getProjectDir2(getOriginalCwd());
|
|
488903
|
-
const sessionFile =
|
|
488921
|
+
const sessionFile = join135(projectDir, `${sessionId}.jsonl`);
|
|
488904
488922
|
const fs10 = getFsImplementation();
|
|
488905
488923
|
try {
|
|
488906
488924
|
fs10.statSync(sessionFile);
|
|
@@ -490869,7 +490887,7 @@ async function loadTranscriptFile(filePath, opts) {
|
|
|
490869
490887
|
};
|
|
490870
490888
|
}
|
|
490871
490889
|
async function loadSessionFile(sessionId) {
|
|
490872
|
-
const sessionFile =
|
|
490890
|
+
const sessionFile = join135(getSessionProjectDir() ?? getProjectDir2(getOriginalCwd()), `${sessionId}.jsonl`);
|
|
490873
490891
|
return loadTranscriptFile(sessionFile);
|
|
490874
490892
|
}
|
|
490875
490893
|
function clearSessionMessagesCache() {
|
|
@@ -490937,7 +490955,7 @@ async function loadAllProjectsMessageLogsFull(limit) {
|
|
|
490937
490955
|
} catch {
|
|
490938
490956
|
return [];
|
|
490939
490957
|
}
|
|
490940
|
-
const projectDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) =>
|
|
490958
|
+
const projectDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join135(projectsDir, dirent.name));
|
|
490941
490959
|
const logsPerProject = await Promise.all(projectDirs.map((projectDir) => getLogsWithoutIndex(projectDir, limit)));
|
|
490942
490960
|
const allLogs = logsPerProject.flat();
|
|
490943
490961
|
const deduped = new Map;
|
|
@@ -490962,7 +490980,7 @@ async function loadAllProjectsMessageLogsProgressive(limit, initialEnrichCount =
|
|
|
490962
490980
|
} catch {
|
|
490963
490981
|
return { logs: [], allStatLogs: [], nextIndex: 0 };
|
|
490964
490982
|
}
|
|
490965
|
-
const projectDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) =>
|
|
490983
|
+
const projectDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join135(projectsDir, dirent.name));
|
|
490966
490984
|
const rawLogs = [];
|
|
490967
490985
|
for (const projectDir of projectDirs) {
|
|
490968
490986
|
rawLogs.push(...await getSessionFilesLite(projectDir, limit));
|
|
@@ -491023,7 +491041,7 @@ async function getStatOnlyLogsForWorktrees(worktreePaths, limit) {
|
|
|
491023
491041
|
for (const { path: wtPath, prefix } of indexed) {
|
|
491024
491042
|
if (dirName === prefix || dirName.startsWith(prefix + "-")) {
|
|
491025
491043
|
seenDirs.add(dirName);
|
|
491026
|
-
allLogs.push(...await getSessionFilesLite(
|
|
491044
|
+
allLogs.push(...await getSessionFilesLite(join135(projectsDir, dirent.name), undefined, wtPath));
|
|
491027
491045
|
break;
|
|
491028
491046
|
}
|
|
491029
491047
|
}
|
|
@@ -491092,7 +491110,7 @@ async function loadSubagentTranscripts(agentIds) {
|
|
|
491092
491110
|
return transcripts;
|
|
491093
491111
|
}
|
|
491094
491112
|
async function loadAllSubagentTranscriptsFromDisk() {
|
|
491095
|
-
const subagentsDir =
|
|
491113
|
+
const subagentsDir = join135(getSessionProjectDir() ?? getProjectDir2(getOriginalCwd()), getSessionId(), "subagents");
|
|
491096
491114
|
let entries;
|
|
491097
491115
|
try {
|
|
491098
491116
|
entries = await readdir29(subagentsDir, { withFileTypes: true });
|
|
@@ -491220,7 +491238,7 @@ async function getSessionFilesWithMtime(projectDir) {
|
|
|
491220
491238
|
const sessionId = validateUuid2(basename40(dirent.name, ".jsonl"));
|
|
491221
491239
|
if (!sessionId)
|
|
491222
491240
|
continue;
|
|
491223
|
-
candidates.push({ sessionId, filePath:
|
|
491241
|
+
candidates.push({ sessionId, filePath: join135(projectDir, dirent.name) });
|
|
491224
491242
|
}
|
|
491225
491243
|
await Promise.all(candidates.map(async ({ sessionId, filePath }) => {
|
|
491226
491244
|
try {
|
|
@@ -491606,7 +491624,7 @@ var init_sessionStorage = __esm(() => {
|
|
|
491606
491624
|
init_settings2();
|
|
491607
491625
|
init_slowOperations();
|
|
491608
491626
|
init_uuid();
|
|
491609
|
-
VERSION5 = typeof MACRO !== "undefined" ? "1.1.
|
|
491627
|
+
VERSION5 = typeof MACRO !== "undefined" ? "1.1.32+82959fe" : "unknown";
|
|
491610
491628
|
MAX_TOMBSTONE_REWRITE_BYTES = 50 * 1024 * 1024;
|
|
491611
491629
|
SKIP_FIRST_PROMPT_PATTERN = /^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/;
|
|
491612
491630
|
EPHEMERAL_PROGRESS_TYPES = new Set([
|
|
@@ -491618,7 +491636,7 @@ var init_sessionStorage = __esm(() => {
|
|
|
491618
491636
|
MAX_TRANSCRIPT_READ_BYTES = 50 * 1024 * 1024;
|
|
491619
491637
|
agentTranscriptSubdirs = new Map;
|
|
491620
491638
|
getProjectDir2 = memoize_default((projectDir) => {
|
|
491621
|
-
return
|
|
491639
|
+
return join135(getProjectsDir2(), sanitizePath2(projectDir));
|
|
491622
491640
|
});
|
|
491623
491641
|
METADATA_TYPE_MARKERS = [
|
|
491624
491642
|
'"type":"summary"',
|
|
@@ -491862,7 +491880,7 @@ import {
|
|
|
491862
491880
|
dirname as dirname57,
|
|
491863
491881
|
extname as extname13,
|
|
491864
491882
|
isAbsolute as isAbsolute25,
|
|
491865
|
-
join as
|
|
491883
|
+
join as join136,
|
|
491866
491884
|
parse as parse12,
|
|
491867
491885
|
relative as relative26,
|
|
491868
491886
|
sep as sep32
|
|
@@ -492107,7 +492125,7 @@ async function processMdRules({
|
|
|
492107
492125
|
throw e;
|
|
492108
492126
|
}
|
|
492109
492127
|
for (const entry of entries) {
|
|
492110
|
-
const entryPath =
|
|
492128
|
+
const entryPath = join136(rulesDir, entry.name);
|
|
492111
492129
|
const { resolvedPath: resolvedEntryPath, isSymlink: isSymlink2 } = safeResolvePath(fs10, entryPath);
|
|
492112
492130
|
const stats2 = isSymlink2 ? await fs10.stat(resolvedEntryPath) : null;
|
|
492113
492131
|
const isDirectory = stats2 ? stats2.isDirectory() : entry.isDirectory();
|
|
@@ -492178,16 +492196,16 @@ async function getManagedAndUserConditionalRules(targetPath, processedPaths) {
|
|
|
492178
492196
|
async function getMemoryFilesForNestedDirectory(dir, targetPath, processedPaths) {
|
|
492179
492197
|
const result = [];
|
|
492180
492198
|
if (isSettingSourceEnabled("projectSettings")) {
|
|
492181
|
-
const projectPath =
|
|
492199
|
+
const projectPath = join136(dir, "VIVUS.md");
|
|
492182
492200
|
result.push(...await processMemoryFile(projectPath, "Project", processedPaths, false));
|
|
492183
|
-
const dotVivusPath =
|
|
492201
|
+
const dotVivusPath = join136(dir, ".vivus", "VIVUS.md");
|
|
492184
492202
|
result.push(...await processMemoryFile(dotVivusPath, "Project", processedPaths, false));
|
|
492185
492203
|
}
|
|
492186
492204
|
if (isSettingSourceEnabled("localSettings")) {
|
|
492187
|
-
const localPath =
|
|
492205
|
+
const localPath = join136(dir, "VIVUS.local.md");
|
|
492188
492206
|
result.push(...await processMemoryFile(localPath, "Local", processedPaths, false));
|
|
492189
492207
|
}
|
|
492190
|
-
const rulesDir =
|
|
492208
|
+
const rulesDir = join136(dir, ".vivus", "rules");
|
|
492191
492209
|
const unconditionalProcessedPaths = new Set(processedPaths);
|
|
492192
492210
|
result.push(...await processMdRules({
|
|
492193
492211
|
rulesDir,
|
|
@@ -492203,7 +492221,7 @@ async function getMemoryFilesForNestedDirectory(dir, targetPath, processedPaths)
|
|
|
492203
492221
|
return result;
|
|
492204
492222
|
}
|
|
492205
492223
|
async function getConditionalRulesForCwdLevelDirectory(dir, targetPath, processedPaths) {
|
|
492206
|
-
const rulesDir =
|
|
492224
|
+
const rulesDir = join136(dir, ".vivus", "rules");
|
|
492207
492225
|
return processConditionedMdRules(targetPath, rulesDir, "Project", processedPaths, false);
|
|
492208
492226
|
}
|
|
492209
492227
|
async function processConditionedMdRules(targetPath, rulesDir, type, processedPaths, includeExternal) {
|
|
@@ -492448,11 +492466,11 @@ var init_vivusmd = __esm(() => {
|
|
|
492448
492466
|
for (const dir of dirs.reverse()) {
|
|
492449
492467
|
const skipProject = isNestedWorktree && pathInWorkingPath(dir, canonicalRoot) && !pathInWorkingPath(dir, gitRoot);
|
|
492450
492468
|
if (isSettingSourceEnabled("projectSettings") && !skipProject) {
|
|
492451
|
-
const projectPath =
|
|
492469
|
+
const projectPath = join136(dir, "VIVUS.md");
|
|
492452
492470
|
result.push(...await processMemoryFile(projectPath, "Project", processedPaths, includeExternal));
|
|
492453
|
-
const dotVivusPath =
|
|
492471
|
+
const dotVivusPath = join136(dir, ".vivus", "VIVUS.md");
|
|
492454
492472
|
result.push(...await processMemoryFile(dotVivusPath, "Project", processedPaths, includeExternal));
|
|
492455
|
-
const rulesDir =
|
|
492473
|
+
const rulesDir = join136(dir, ".vivus", "rules");
|
|
492456
492474
|
result.push(...await processMdRules({
|
|
492457
492475
|
rulesDir,
|
|
492458
492476
|
type: "Project",
|
|
@@ -492462,18 +492480,18 @@ var init_vivusmd = __esm(() => {
|
|
|
492462
492480
|
}));
|
|
492463
492481
|
}
|
|
492464
492482
|
if (isSettingSourceEnabled("localSettings")) {
|
|
492465
|
-
const localPath =
|
|
492483
|
+
const localPath = join136(dir, "VIVUS.local.md");
|
|
492466
492484
|
result.push(...await processMemoryFile(localPath, "Local", processedPaths, includeExternal));
|
|
492467
492485
|
}
|
|
492468
492486
|
}
|
|
492469
492487
|
if (isEnvTruthy(process.env.VIVUS_CODE_ADDITIONAL_DIRECTORIES_VIVUS_MD)) {
|
|
492470
492488
|
const additionalDirs = getAdditionalDirectoriesForVivusMd();
|
|
492471
492489
|
for (const dir of additionalDirs) {
|
|
492472
|
-
const projectPath =
|
|
492490
|
+
const projectPath = join136(dir, "VIVUS.md");
|
|
492473
492491
|
result.push(...await processMemoryFile(projectPath, "Project", processedPaths, includeExternal));
|
|
492474
|
-
const dotVivusPath =
|
|
492492
|
+
const dotVivusPath = join136(dir, ".vivus", "VIVUS.md");
|
|
492475
492493
|
result.push(...await processMemoryFile(dotVivusPath, "Project", processedPaths, includeExternal));
|
|
492476
|
-
const rulesDir =
|
|
492494
|
+
const rulesDir = join136(dir, ".vivus", "rules");
|
|
492477
492495
|
result.push(...await processMdRules({
|
|
492478
492496
|
rulesDir,
|
|
492479
492497
|
type: "Project",
|
|
@@ -493040,7 +493058,7 @@ __export(exports_upstreamproxy, {
|
|
|
493040
493058
|
});
|
|
493041
493059
|
import { mkdir as mkdir41, readFile as readFile48, unlink as unlink23, writeFile as writeFile42 } from "fs/promises";
|
|
493042
493060
|
import { homedir as homedir34 } from "os";
|
|
493043
|
-
import { join as
|
|
493061
|
+
import { join as join137 } from "path";
|
|
493044
493062
|
async function initUpstreamProxy(opts) {
|
|
493045
493063
|
if (!isEnvTruthy(process.env.VIVUS_CODE_REMOTE)) {
|
|
493046
493064
|
return state;
|
|
@@ -493061,7 +493079,7 @@ async function initUpstreamProxy(opts) {
|
|
|
493061
493079
|
}
|
|
493062
493080
|
setNonDumpable();
|
|
493063
493081
|
const baseUrl = opts?.ccrBaseUrl ?? process.env.ANTHROPIC_BASE_URL ?? "https://api.anthropic.com";
|
|
493064
|
-
const caBundlePath = opts?.caBundlePath ??
|
|
493082
|
+
const caBundlePath = opts?.caBundlePath ?? join137(homedir34(), ".ccr", "ca-bundle.crt");
|
|
493065
493083
|
const caOk = await downloadCaBundle(baseUrl, opts?.systemCaPath ?? SYSTEM_CA_BUNDLE, caBundlePath);
|
|
493066
493084
|
if (!caOk)
|
|
493067
493085
|
return state;
|
|
@@ -493161,7 +493179,7 @@ async function downloadCaBundle(baseUrl, systemCaPath, outPath) {
|
|
|
493161
493179
|
}
|
|
493162
493180
|
const ccrCa = await resp.text();
|
|
493163
493181
|
const systemCa = await readFile48(systemCaPath, "utf8").catch(() => "");
|
|
493164
|
-
await mkdir41(
|
|
493182
|
+
await mkdir41(join137(outPath, ".."), { recursive: true });
|
|
493165
493183
|
await writeFile42(outPath, systemCa + `
|
|
493166
493184
|
` + ccrCa, "utf8");
|
|
493167
493185
|
return true;
|
|
@@ -494478,7 +494496,7 @@ function buildSystemInitMessage(inputs) {
|
|
|
494478
494496
|
slash_commands: inputs.commands.filter((c4) => c4.userInvocable !== false).map((c4) => c4.name),
|
|
494479
494497
|
apiKeySource: getAnthropicApiKeyWithSource().source,
|
|
494480
494498
|
betas: getSdkBetas(),
|
|
494481
|
-
vivus_code_version: "1.1.
|
|
494499
|
+
vivus_code_version: "1.1.32+82959fe",
|
|
494482
494500
|
output_style: outputStyle2,
|
|
494483
494501
|
agents: inputs.agents.map((agent) => agent.agentType),
|
|
494484
494502
|
skills: inputs.skills.filter((s) => s.userInvocable !== false).map((skill) => skill.name),
|
|
@@ -500858,7 +500876,7 @@ var init_ShowInIDEPrompt = __esm(() => {
|
|
|
500858
500876
|
|
|
500859
500877
|
// src/components/permissions/FilePermissionDialog/permissionOptions.tsx
|
|
500860
500878
|
import { homedir as homedir35 } from "os";
|
|
500861
|
-
import { basename as basename45, join as
|
|
500879
|
+
import { basename as basename45, join as join138, sep as sep33 } from "path";
|
|
500862
500880
|
function isInVivusFolder(filePath) {
|
|
500863
500881
|
const absolutePath = expandPath(filePath);
|
|
500864
500882
|
const vivusFolderPath = expandPath(`${getOriginalCwd()}/.vivus`);
|
|
@@ -500868,7 +500886,7 @@ function isInVivusFolder(filePath) {
|
|
|
500868
500886
|
}
|
|
500869
500887
|
function isInGlobalVivusFolder(filePath) {
|
|
500870
500888
|
const absolutePath = expandPath(filePath);
|
|
500871
|
-
const globalVivusFolderPath =
|
|
500889
|
+
const globalVivusFolderPath = join138(homedir35(), ".vivus");
|
|
500872
500890
|
const normalizedAbsolutePath = normalizeCaseForComparison2(absolutePath);
|
|
500873
500891
|
const normalizedGlobalVivusFolderPath = normalizeCaseForComparison2(globalVivusFolderPath);
|
|
500874
500892
|
return normalizedAbsolutePath.startsWith(normalizedGlobalVivusFolderPath + sep33.toLowerCase()) || normalizedAbsolutePath.startsWith(normalizedGlobalVivusFolderPath + "/");
|
|
@@ -509104,9 +509122,9 @@ var init_useVoiceEnabled = __esm(() => {
|
|
|
509104
509122
|
|
|
509105
509123
|
// src/hooks/useUpdateNotification.ts
|
|
509106
509124
|
function getSemverPart(version3) {
|
|
509107
|
-
return `${
|
|
509125
|
+
return `${import_semver12.major(version3, { loose: true })}.${import_semver12.minor(version3, { loose: true })}.${import_semver12.patch(version3, { loose: true })}`;
|
|
509108
509126
|
}
|
|
509109
|
-
function useUpdateNotification(updatedVersion, initialVersion = "1.1.
|
|
509127
|
+
function useUpdateNotification(updatedVersion, initialVersion = "1.1.32+82959fe") {
|
|
509110
509128
|
const [lastNotifiedSemver, setLastNotifiedSemver] = import_react228.useState(() => getSemverPart(initialVersion));
|
|
509111
509129
|
if (!updatedVersion) {
|
|
509112
509130
|
return null;
|
|
@@ -509118,10 +509136,10 @@ function useUpdateNotification(updatedVersion, initialVersion = "1.1.30+da035a8"
|
|
|
509118
509136
|
}
|
|
509119
509137
|
return null;
|
|
509120
509138
|
}
|
|
509121
|
-
var import_react228,
|
|
509139
|
+
var import_react228, import_semver12;
|
|
509122
509140
|
var init_useUpdateNotification = __esm(() => {
|
|
509123
509141
|
import_react228 = __toESM(require_react(), 1);
|
|
509124
|
-
|
|
509142
|
+
import_semver12 = __toESM(require_semver3(), 1);
|
|
509125
509143
|
});
|
|
509126
509144
|
|
|
509127
509145
|
// src/components/AutoUpdater.tsx
|
|
@@ -509146,7 +509164,7 @@ function AutoUpdater({
|
|
|
509146
509164
|
return;
|
|
509147
509165
|
}
|
|
509148
509166
|
if (false) {}
|
|
509149
|
-
const currentVersion = "1.1.
|
|
509167
|
+
const currentVersion = "1.1.32+82959fe";
|
|
509150
509168
|
const channel = getInitialSettings()?.autoUpdatesChannel ?? "latest";
|
|
509151
509169
|
let latestVersion = await getLatestVersion(channel);
|
|
509152
509170
|
const isDisabled = isAutoUpdaterDisabled();
|
|
@@ -509359,12 +509377,12 @@ function NativeAutoUpdater({
|
|
|
509359
509377
|
logEvent("tengu_native_auto_updater_start", {});
|
|
509360
509378
|
try {
|
|
509361
509379
|
const maxVersion = await getMaxVersion();
|
|
509362
|
-
if (maxVersion && gt("1.1.
|
|
509380
|
+
if (maxVersion && gt("1.1.32+82959fe", maxVersion)) {
|
|
509363
509381
|
const msg = await getMaxVersionMessage();
|
|
509364
509382
|
setMaxVersionIssue(msg ?? "affects your version");
|
|
509365
509383
|
}
|
|
509366
509384
|
const result = await installLatest(channel);
|
|
509367
|
-
const currentVersion = "1.1.
|
|
509385
|
+
const currentVersion = "1.1.32+82959fe";
|
|
509368
509386
|
const latencyMs = Date.now() - startTime;
|
|
509369
509387
|
if (result.lockFailed) {
|
|
509370
509388
|
logEvent("tengu_native_auto_updater_lock_contention", {
|
|
@@ -509501,17 +509519,17 @@ function PackageManagerAutoUpdater(t0) {
|
|
|
509501
509519
|
const maxVersion = await getMaxVersion();
|
|
509502
509520
|
if (maxVersion && latest && gt(latest, maxVersion)) {
|
|
509503
509521
|
logForDebugging(`PackageManagerAutoUpdater: maxVersion ${maxVersion} is set, capping update from ${latest} to ${maxVersion}`);
|
|
509504
|
-
if (gte("1.1.
|
|
509505
|
-
logForDebugging(`PackageManagerAutoUpdater: current version ${"1.1.
|
|
509522
|
+
if (gte("1.1.32+82959fe", maxVersion)) {
|
|
509523
|
+
logForDebugging(`PackageManagerAutoUpdater: current version ${"1.1.32+82959fe"} is already at or above maxVersion ${maxVersion}, skipping update`);
|
|
509506
509524
|
setUpdateAvailable(false);
|
|
509507
509525
|
return;
|
|
509508
509526
|
}
|
|
509509
509527
|
latest = maxVersion;
|
|
509510
509528
|
}
|
|
509511
|
-
const hasUpdate = latest && !gte("1.1.
|
|
509529
|
+
const hasUpdate = latest && !gte("1.1.32+82959fe", latest) && !shouldSkipVersion(latest);
|
|
509512
509530
|
setUpdateAvailable(!!hasUpdate);
|
|
509513
509531
|
if (hasUpdate) {
|
|
509514
|
-
logForDebugging(`PackageManagerAutoUpdater: Update available ${"1.1.
|
|
509532
|
+
logForDebugging(`PackageManagerAutoUpdater: Update available ${"1.1.32+82959fe"} -> ${latest}`);
|
|
509515
509533
|
}
|
|
509516
509534
|
};
|
|
509517
509535
|
$2[0] = t1;
|
|
@@ -509545,7 +509563,7 @@ function PackageManagerAutoUpdater(t0) {
|
|
|
509545
509563
|
wrap: "truncate",
|
|
509546
509564
|
children: [
|
|
509547
509565
|
"currentVersion: ",
|
|
509548
|
-
"1.1.
|
|
509566
|
+
"1.1.32+82959fe"
|
|
509549
509567
|
]
|
|
509550
509568
|
}, undefined, true, undefined, this);
|
|
509551
509569
|
$2[3] = verbose;
|
|
@@ -517475,7 +517493,7 @@ function buildStatusLineCommandInput(permissionMode, exceeds200kTokens, settings
|
|
|
517475
517493
|
project_dir: getOriginalCwd(),
|
|
517476
517494
|
added_dirs: addedDirs
|
|
517477
517495
|
},
|
|
517478
|
-
version: "1.1.
|
|
517496
|
+
version: "1.1.32+82959fe",
|
|
517479
517497
|
output_style: {
|
|
517480
517498
|
name: outputStyleName
|
|
517481
517499
|
},
|
|
@@ -523571,9 +523589,9 @@ function initSkillImprovement() {
|
|
|
523571
523589
|
async function applySkillImprovement(skillName, updates) {
|
|
523572
523590
|
if (!skillName)
|
|
523573
523591
|
return;
|
|
523574
|
-
const { join:
|
|
523592
|
+
const { join: join139 } = await import("path");
|
|
523575
523593
|
const fs10 = await import("fs/promises");
|
|
523576
|
-
const filePath =
|
|
523594
|
+
const filePath = join139(getCwd(), ".vivus", "skills", skillName, "SKILL.md");
|
|
523577
523595
|
let currentContent;
|
|
523578
523596
|
try {
|
|
523579
523597
|
currentContent = await fs10.readFile(filePath, "utf-8");
|
|
@@ -523727,7 +523745,7 @@ function useMoreRight(_args) {
|
|
|
523727
523745
|
// src/utils/cleanup.ts
|
|
523728
523746
|
import * as fs10 from "fs/promises";
|
|
523729
523747
|
import { homedir as homedir36 } from "os";
|
|
523730
|
-
import { join as
|
|
523748
|
+
import { join as join139 } from "path";
|
|
523731
523749
|
function getCutoffDate() {
|
|
523732
523750
|
const settings = getSettings_DEPRECATED() || {};
|
|
523733
523751
|
const cleanupPeriodDays = settings.cleanupPeriodDays ?? DEFAULT_CLEANUP_PERIOD_DAYS;
|
|
@@ -523752,7 +523770,7 @@ async function cleanupOldFilesInDirectory(dirPath, cutoffDate, isMessagePath) {
|
|
|
523752
523770
|
try {
|
|
523753
523771
|
const timestamp = convertFileNameToDate(file2.name);
|
|
523754
523772
|
if (timestamp < cutoffDate) {
|
|
523755
|
-
await getFsImplementation().unlink(
|
|
523773
|
+
await getFsImplementation().unlink(join139(dirPath, file2.name));
|
|
523756
523774
|
if (isMessagePath) {
|
|
523757
523775
|
result.messages++;
|
|
523758
523776
|
} else {
|
|
@@ -523783,7 +523801,7 @@ async function cleanupOldMessageFiles() {
|
|
|
523783
523801
|
} catch {
|
|
523784
523802
|
return result;
|
|
523785
523803
|
}
|
|
523786
|
-
const mcpLogDirs = dirents.filter((dirent) => dirent.isDirectory() && dirent.name.startsWith("mcp-logs-")).map((dirent) =>
|
|
523804
|
+
const mcpLogDirs = dirents.filter((dirent) => dirent.isDirectory() && dirent.name.startsWith("mcp-logs-")).map((dirent) => join139(baseCachePath, dirent.name));
|
|
523787
523805
|
for (const mcpLogDir of mcpLogDirs) {
|
|
523788
523806
|
result = addCleanupResults(result, await cleanupOldFilesInDirectory(mcpLogDir, cutoffDate, true));
|
|
523789
523807
|
await tryRmdir(mcpLogDir, fsImpl);
|
|
@@ -523822,7 +523840,7 @@ async function cleanupOldSessionFiles() {
|
|
|
523822
523840
|
for (const projectDirent of projectDirents) {
|
|
523823
523841
|
if (!projectDirent.isDirectory())
|
|
523824
523842
|
continue;
|
|
523825
|
-
const projectDir =
|
|
523843
|
+
const projectDir = join139(projectsDir, projectDirent.name);
|
|
523826
523844
|
let entries;
|
|
523827
523845
|
try {
|
|
523828
523846
|
entries = await fsImpl.readdir(projectDir);
|
|
@@ -523836,15 +523854,15 @@ async function cleanupOldSessionFiles() {
|
|
|
523836
523854
|
continue;
|
|
523837
523855
|
}
|
|
523838
523856
|
try {
|
|
523839
|
-
if (await unlinkIfOld(
|
|
523857
|
+
if (await unlinkIfOld(join139(projectDir, entry.name), cutoffDate, fsImpl)) {
|
|
523840
523858
|
result.messages++;
|
|
523841
523859
|
}
|
|
523842
523860
|
} catch {
|
|
523843
523861
|
result.errors++;
|
|
523844
523862
|
}
|
|
523845
523863
|
} else if (entry.isDirectory()) {
|
|
523846
|
-
const sessionDir =
|
|
523847
|
-
const toolResultsDir =
|
|
523864
|
+
const sessionDir = join139(projectDir, entry.name);
|
|
523865
|
+
const toolResultsDir = join139(sessionDir, TOOL_RESULTS_SUBDIR);
|
|
523848
523866
|
let toolDirs;
|
|
523849
523867
|
try {
|
|
523850
523868
|
toolDirs = await fsImpl.readdir(toolResultsDir);
|
|
@@ -523855,14 +523873,14 @@ async function cleanupOldSessionFiles() {
|
|
|
523855
523873
|
for (const toolEntry of toolDirs) {
|
|
523856
523874
|
if (toolEntry.isFile()) {
|
|
523857
523875
|
try {
|
|
523858
|
-
if (await unlinkIfOld(
|
|
523876
|
+
if (await unlinkIfOld(join139(toolResultsDir, toolEntry.name), cutoffDate, fsImpl)) {
|
|
523859
523877
|
result.messages++;
|
|
523860
523878
|
}
|
|
523861
523879
|
} catch {
|
|
523862
523880
|
result.errors++;
|
|
523863
523881
|
}
|
|
523864
523882
|
} else if (toolEntry.isDirectory()) {
|
|
523865
|
-
const toolDirPath =
|
|
523883
|
+
const toolDirPath = join139(toolResultsDir, toolEntry.name);
|
|
523866
523884
|
let toolFiles;
|
|
523867
523885
|
try {
|
|
523868
523886
|
toolFiles = await fsImpl.readdir(toolDirPath);
|
|
@@ -523873,7 +523891,7 @@ async function cleanupOldSessionFiles() {
|
|
|
523873
523891
|
if (!tf.isFile())
|
|
523874
523892
|
continue;
|
|
523875
523893
|
try {
|
|
523876
|
-
if (await unlinkIfOld(
|
|
523894
|
+
if (await unlinkIfOld(join139(toolDirPath, tf.name), cutoffDate, fsImpl)) {
|
|
523877
523895
|
result.messages++;
|
|
523878
523896
|
}
|
|
523879
523897
|
} catch {
|
|
@@ -523905,7 +523923,7 @@ async function cleanupSingleDirectory(dirPath, extension2, removeEmptyDir = true
|
|
|
523905
523923
|
if (!dirent.isFile() || !dirent.name.endsWith(extension2))
|
|
523906
523924
|
continue;
|
|
523907
523925
|
try {
|
|
523908
|
-
if (await unlinkIfOld(
|
|
523926
|
+
if (await unlinkIfOld(join139(dirPath, dirent.name), cutoffDate, fsImpl)) {
|
|
523909
523927
|
result.messages++;
|
|
523910
523928
|
}
|
|
523911
523929
|
} catch {
|
|
@@ -523918,7 +523936,7 @@ async function cleanupSingleDirectory(dirPath, extension2, removeEmptyDir = true
|
|
|
523918
523936
|
return result;
|
|
523919
523937
|
}
|
|
523920
523938
|
function cleanupOldPlanFiles() {
|
|
523921
|
-
const plansDir =
|
|
523939
|
+
const plansDir = join139(getVivusConfigHomeDir(), "plans");
|
|
523922
523940
|
return cleanupSingleDirectory(plansDir, ".md");
|
|
523923
523941
|
}
|
|
523924
523942
|
async function cleanupOldFileHistoryBackups() {
|
|
@@ -523927,14 +523945,14 @@ async function cleanupOldFileHistoryBackups() {
|
|
|
523927
523945
|
const fsImpl = getFsImplementation();
|
|
523928
523946
|
try {
|
|
523929
523947
|
const configDir = getVivusConfigHomeDir();
|
|
523930
|
-
const fileHistoryStorageDir =
|
|
523948
|
+
const fileHistoryStorageDir = join139(configDir, "file-history");
|
|
523931
523949
|
let dirents;
|
|
523932
523950
|
try {
|
|
523933
523951
|
dirents = await fsImpl.readdir(fileHistoryStorageDir);
|
|
523934
523952
|
} catch {
|
|
523935
523953
|
return result;
|
|
523936
523954
|
}
|
|
523937
|
-
const fileHistorySessionsDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) =>
|
|
523955
|
+
const fileHistorySessionsDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join139(fileHistoryStorageDir, dirent.name));
|
|
523938
523956
|
await Promise.all(fileHistorySessionsDirs.map(async (fileHistorySessionDir) => {
|
|
523939
523957
|
try {
|
|
523940
523958
|
const stats2 = await fsImpl.stat(fileHistorySessionDir);
|
|
@@ -523961,14 +523979,14 @@ async function cleanupOldSessionEnvDirs() {
|
|
|
523961
523979
|
const fsImpl = getFsImplementation();
|
|
523962
523980
|
try {
|
|
523963
523981
|
const configDir = getVivusConfigHomeDir();
|
|
523964
|
-
const sessionEnvBaseDir =
|
|
523982
|
+
const sessionEnvBaseDir = join139(configDir, "session-env");
|
|
523965
523983
|
let dirents;
|
|
523966
523984
|
try {
|
|
523967
523985
|
dirents = await fsImpl.readdir(sessionEnvBaseDir);
|
|
523968
523986
|
} catch {
|
|
523969
523987
|
return result;
|
|
523970
523988
|
}
|
|
523971
|
-
const sessionEnvDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) =>
|
|
523989
|
+
const sessionEnvDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join139(sessionEnvBaseDir, dirent.name));
|
|
523972
523990
|
for (const sessionEnvDir of sessionEnvDirs) {
|
|
523973
523991
|
try {
|
|
523974
523992
|
const stats2 = await fsImpl.stat(sessionEnvDir);
|
|
@@ -523990,7 +524008,7 @@ async function cleanupOldDebugLogs() {
|
|
|
523990
524008
|
const cutoffDate = getCutoffDate();
|
|
523991
524009
|
const result = { messages: 0, errors: 0 };
|
|
523992
524010
|
const fsImpl = getFsImplementation();
|
|
523993
|
-
const debugDir =
|
|
524011
|
+
const debugDir = join139(getVivusConfigHomeDir(), "debug");
|
|
523994
524012
|
let dirents;
|
|
523995
524013
|
try {
|
|
523996
524014
|
dirents = await fsImpl.readdir(debugDir);
|
|
@@ -524002,7 +524020,7 @@ async function cleanupOldDebugLogs() {
|
|
|
524002
524020
|
continue;
|
|
524003
524021
|
}
|
|
524004
524022
|
try {
|
|
524005
|
-
if (await unlinkIfOld(
|
|
524023
|
+
if (await unlinkIfOld(join139(debugDir, dirent.name), cutoffDate, fsImpl)) {
|
|
524006
524024
|
result.messages++;
|
|
524007
524025
|
}
|
|
524008
524026
|
} catch {
|
|
@@ -524012,7 +524030,7 @@ async function cleanupOldDebugLogs() {
|
|
|
524012
524030
|
return result;
|
|
524013
524031
|
}
|
|
524014
524032
|
async function cleanupNpmCacheForAnthropicPackages() {
|
|
524015
|
-
const markerPath =
|
|
524033
|
+
const markerPath = join139(getVivusConfigHomeDir(), ".npm-cache-cleanup");
|
|
524016
524034
|
try {
|
|
524017
524035
|
const stat45 = await fs10.stat(markerPath);
|
|
524018
524036
|
if (Date.now() - stat45.mtimeMs < ONE_DAY_MS) {
|
|
@@ -524027,7 +524045,7 @@ async function cleanupNpmCacheForAnthropicPackages() {
|
|
|
524027
524045
|
return;
|
|
524028
524046
|
}
|
|
524029
524047
|
logForDebugging("npm cache cleanup: starting");
|
|
524030
|
-
const npmCachePath =
|
|
524048
|
+
const npmCachePath = join139(homedir36(), ".npm", "_cacache");
|
|
524031
524049
|
const NPM_CACHE_RETENTION_COUNT = 5;
|
|
524032
524050
|
const startTime = Date.now();
|
|
524033
524051
|
try {
|
|
@@ -524082,7 +524100,7 @@ async function cleanupNpmCacheForAnthropicPackages() {
|
|
|
524082
524100
|
}
|
|
524083
524101
|
}
|
|
524084
524102
|
async function cleanupOldVersionsThrottled() {
|
|
524085
|
-
const markerPath =
|
|
524103
|
+
const markerPath = join139(getVivusConfigHomeDir(), ".version-cleanup");
|
|
524086
524104
|
try {
|
|
524087
524105
|
const stat45 = await fs10.stat(markerPath);
|
|
524088
524106
|
if (Date.now() - stat45.mtimeMs < ONE_DAY_MS) {
|
|
@@ -527313,7 +527331,7 @@ __export(exports_asciicast, {
|
|
|
527313
527331
|
_resetRecordingStateForTesting: () => _resetRecordingStateForTesting
|
|
527314
527332
|
});
|
|
527315
527333
|
import { appendFile as appendFile6, rename as rename10 } from "fs/promises";
|
|
527316
|
-
import { basename as basename54, dirname as dirname58, join as
|
|
527334
|
+
import { basename as basename54, dirname as dirname58, join as join141 } from "path";
|
|
527317
527335
|
function getRecordFilePath() {
|
|
527318
527336
|
if (recordingState.filePath !== null) {
|
|
527319
527337
|
return recordingState.filePath;
|
|
@@ -527324,10 +527342,10 @@ function getRecordFilePath() {
|
|
|
527324
527342
|
if (!isEnvTruthy(process.env.VIVUS_CODE_TERMINAL_RECORDING)) {
|
|
527325
527343
|
return null;
|
|
527326
527344
|
}
|
|
527327
|
-
const projectsDir =
|
|
527328
|
-
const projectDir =
|
|
527345
|
+
const projectsDir = join141(getVivusConfigHomeDir(), "projects");
|
|
527346
|
+
const projectDir = join141(projectsDir, sanitizePath2(getOriginalCwd()));
|
|
527329
527347
|
recordingState.timestamp = Date.now();
|
|
527330
|
-
recordingState.filePath =
|
|
527348
|
+
recordingState.filePath = join141(projectDir, `${getSessionId()}-${recordingState.timestamp}.cast`);
|
|
527331
527349
|
return recordingState.filePath;
|
|
527332
527350
|
}
|
|
527333
527351
|
function _resetRecordingStateForTesting() {
|
|
@@ -527336,13 +527354,13 @@ function _resetRecordingStateForTesting() {
|
|
|
527336
527354
|
}
|
|
527337
527355
|
function getSessionRecordingPaths() {
|
|
527338
527356
|
const sessionId = getSessionId();
|
|
527339
|
-
const projectsDir =
|
|
527340
|
-
const projectDir =
|
|
527357
|
+
const projectsDir = join141(getVivusConfigHomeDir(), "projects");
|
|
527358
|
+
const projectDir = join141(projectsDir, sanitizePath2(getOriginalCwd()));
|
|
527341
527359
|
try {
|
|
527342
527360
|
const entries = getFsImplementation().readdirSync(projectDir);
|
|
527343
527361
|
const names = typeof entries[0] === "string" ? entries : entries.map((e) => e.name);
|
|
527344
527362
|
const files2 = names.filter((f) => f.startsWith(sessionId) && f.endsWith(".cast")).sort();
|
|
527345
|
-
return files2.map((f) =>
|
|
527363
|
+
return files2.map((f) => join141(projectDir, f));
|
|
527346
527364
|
} catch {
|
|
527347
527365
|
return [];
|
|
527348
527366
|
}
|
|
@@ -527352,9 +527370,9 @@ async function renameRecordingForSession() {
|
|
|
527352
527370
|
if (!oldPath || recordingState.timestamp === 0) {
|
|
527353
527371
|
return;
|
|
527354
527372
|
}
|
|
527355
|
-
const projectsDir =
|
|
527356
|
-
const projectDir =
|
|
527357
|
-
const newPath =
|
|
527373
|
+
const projectsDir = join141(getVivusConfigHomeDir(), "projects");
|
|
527374
|
+
const projectDir = join141(projectsDir, sanitizePath2(getOriginalCwd()));
|
|
527375
|
+
const newPath = join141(projectDir, `${getSessionId()}-${recordingState.timestamp}.cast`);
|
|
527358
527376
|
if (oldPath === newPath) {
|
|
527359
527377
|
return;
|
|
527360
527378
|
}
|
|
@@ -528975,7 +528993,7 @@ async function submitTranscriptShare(messages, trigger, appearanceId) {
|
|
|
528975
528993
|
} catch {}
|
|
528976
528994
|
const data = {
|
|
528977
528995
|
trigger,
|
|
528978
|
-
version: "1.1.
|
|
528996
|
+
version: "1.1.32+82959fe",
|
|
528979
528997
|
platform: process.platform,
|
|
528980
528998
|
transcript,
|
|
528981
528999
|
subagentTranscripts: Object.keys(subagentTranscripts).length > 0 ? subagentTranscripts : undefined,
|
|
@@ -530261,7 +530279,7 @@ var init_useChromeExtensionNotification = __esm(() => {
|
|
|
530261
530279
|
});
|
|
530262
530280
|
|
|
530263
530281
|
// src/utils/plugins/officialMarketplaceStartupCheck.ts
|
|
530264
|
-
import { join as
|
|
530282
|
+
import { join as join142 } from "path";
|
|
530265
530283
|
function isOfficialMarketplaceAutoInstallDisabled() {
|
|
530266
530284
|
return isEnvTruthy(process.env.VIVUS_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALL);
|
|
530267
530285
|
}
|
|
@@ -530344,7 +530362,7 @@ async function checkAndInstallOfficialMarketplace() {
|
|
|
530344
530362
|
return { installed: false, skipped: true, reason: "policy_blocked" };
|
|
530345
530363
|
}
|
|
530346
530364
|
const cacheDir = getMarketplacesCacheDir();
|
|
530347
|
-
const installLocation =
|
|
530365
|
+
const installLocation = join142(cacheDir, OFFICIAL_MARKETPLACE_NAME);
|
|
530348
530366
|
const gcsSha = await fetchOfficialMarketplaceFromGcs(installLocation, cacheDir);
|
|
530349
530367
|
if (gcsSha !== null) {
|
|
530350
530368
|
const known = await loadKnownMarketplacesConfig();
|
|
@@ -533365,7 +533383,7 @@ var init_usePluginRecommendationBase = __esm(() => {
|
|
|
533365
533383
|
});
|
|
533366
533384
|
|
|
533367
533385
|
// src/hooks/useLspPluginRecommendation.tsx
|
|
533368
|
-
import { extname as extname15, join as
|
|
533386
|
+
import { extname as extname15, join as join143 } from "path";
|
|
533369
533387
|
function useLspPluginRecommendation() {
|
|
533370
533388
|
const $2 = import_compiler_runtime356.c(12);
|
|
533371
533389
|
const trackedFiles = useAppState(_temp244);
|
|
@@ -533450,7 +533468,7 @@ function useLspPluginRecommendation() {
|
|
|
533450
533468
|
case "yes": {
|
|
533451
533469
|
installPluginAndNotify(pluginId, pluginName, "lsp-plugin", addNotification, async (pluginData) => {
|
|
533452
533470
|
logForDebugging(`[useLspPluginRecommendation] Installing plugin: ${pluginId}`);
|
|
533453
|
-
const localSourcePath = typeof pluginData.entry.source === "string" ?
|
|
533471
|
+
const localSourcePath = typeof pluginData.entry.source === "string" ? join143(pluginData.marketplaceInstallLocation, pluginData.entry.source) : undefined;
|
|
533454
533472
|
await cacheAndRegisterPlugin(pluginId, pluginData.entry, "user", undefined, localSourcePath);
|
|
533455
533473
|
const settings = getSettingsForSource("userSettings");
|
|
533456
533474
|
updateSettingsForSource("userSettings", {
|
|
@@ -536294,7 +536312,7 @@ var exports_REPL = {};
|
|
|
536294
536312
|
__export(exports_REPL, {
|
|
536295
536313
|
REPL: () => REPL
|
|
536296
536314
|
});
|
|
536297
|
-
import { dirname as dirname60, join as
|
|
536315
|
+
import { dirname as dirname60, join as join144 } from "path";
|
|
536298
536316
|
import { tmpdir as tmpdir12 } from "os";
|
|
536299
536317
|
import { writeFile as writeFile44 } from "fs/promises";
|
|
536300
536318
|
import { randomUUID as randomUUID48 } from "crypto";
|
|
@@ -538890,7 +538908,7 @@ Note: ctrl + z now suspends Vivus, ctrl + _ undoes input.
|
|
|
538890
538908
|
const w = Math.max(80, (process.stdout.columns ?? 80) - 6);
|
|
538891
538909
|
const raw = await renderMessagesToPlainText(deferredMessages, tools, w);
|
|
538892
538910
|
const text2 = raw.replace(/[ \t]+$/gm, "");
|
|
538893
|
-
const path25 =
|
|
538911
|
+
const path25 = join144(tmpdir12(), `cc-transcript-${Date.now()}.txt`);
|
|
538894
538912
|
await writeFile44(path25, text2);
|
|
538895
538913
|
const opened = openFileInExternalEditor(path25);
|
|
538896
538914
|
setStatus(opened ? `opening ${path25}` : `wrote ${path25} · no $VISUAL/$EDITOR set`);
|
|
@@ -540394,7 +540412,7 @@ function WelcomeV2() {
|
|
|
540394
540412
|
dimColor: true,
|
|
540395
540413
|
children: [
|
|
540396
540414
|
"v",
|
|
540397
|
-
"1.1.
|
|
540415
|
+
"1.1.32+82959fe",
|
|
540398
540416
|
" "
|
|
540399
540417
|
]
|
|
540400
540418
|
}, undefined, true, undefined, this)
|
|
@@ -540594,7 +540612,7 @@ function WelcomeV2() {
|
|
|
540594
540612
|
dimColor: true,
|
|
540595
540613
|
children: [
|
|
540596
540614
|
"v",
|
|
540597
|
-
"1.1.
|
|
540615
|
+
"1.1.32+82959fe",
|
|
540598
540616
|
" "
|
|
540599
540617
|
]
|
|
540600
540618
|
}, undefined, true, undefined, this)
|
|
@@ -540820,7 +540838,7 @@ function AppleTerminalWelcomeV2(t0) {
|
|
|
540820
540838
|
dimColor: true,
|
|
540821
540839
|
children: [
|
|
540822
540840
|
"v",
|
|
540823
|
-
"1.1.
|
|
540841
|
+
"1.1.32+82959fe",
|
|
540824
540842
|
" "
|
|
540825
540843
|
]
|
|
540826
540844
|
}, undefined, true, undefined, this);
|
|
@@ -541074,7 +541092,7 @@ function AppleTerminalWelcomeV2(t0) {
|
|
|
541074
541092
|
dimColor: true,
|
|
541075
541093
|
children: [
|
|
541076
541094
|
"v",
|
|
541077
|
-
"1.1.
|
|
541095
|
+
"1.1.32+82959fe",
|
|
541078
541096
|
" "
|
|
541079
541097
|
]
|
|
541080
541098
|
}, undefined, true, undefined, this);
|
|
@@ -544090,12 +544108,12 @@ function cliOk(msg) {
|
|
|
544090
544108
|
}
|
|
544091
544109
|
|
|
544092
544110
|
// src/utils/errorLogSink.ts
|
|
544093
|
-
import { dirname as dirname62, join as
|
|
544111
|
+
import { dirname as dirname62, join as join145 } from "path";
|
|
544094
544112
|
function getErrorsPath() {
|
|
544095
|
-
return
|
|
544113
|
+
return join145(CACHE_PATHS.errors(), DATE + ".jsonl");
|
|
544096
544114
|
}
|
|
544097
544115
|
function getMCPLogsPath(serverName) {
|
|
544098
|
-
return
|
|
544116
|
+
return join145(CACHE_PATHS.mcpLogs(serverName), DATE + ".jsonl");
|
|
544099
544117
|
}
|
|
544100
544118
|
function createJsonlWriter(options2) {
|
|
544101
544119
|
const writer = createBufferedWriter(options2);
|
|
@@ -544139,7 +544157,7 @@ function appendToLog(path25, message) {
|
|
|
544139
544157
|
cwd: getFsImplementation().cwd(),
|
|
544140
544158
|
userType: process.env.USER_TYPE,
|
|
544141
544159
|
sessionId: getSessionId(),
|
|
544142
|
-
version: "1.1.
|
|
544160
|
+
version: "1.1.32+82959fe"
|
|
544143
544161
|
};
|
|
544144
544162
|
getLogWriter(path25).write(messageWithTimestamp);
|
|
544145
544163
|
}
|
|
@@ -544438,7 +544456,7 @@ var init_sessionMemory = __esm(() => {
|
|
|
544438
544456
|
// src/utils/iTermBackup.ts
|
|
544439
544457
|
import { copyFile as copyFile11, stat as stat47 } from "fs/promises";
|
|
544440
544458
|
import { homedir as homedir38 } from "os";
|
|
544441
|
-
import { join as
|
|
544459
|
+
import { join as join146 } from "path";
|
|
544442
544460
|
function markITerm2SetupComplete() {
|
|
544443
544461
|
saveGlobalConfig((current) => ({
|
|
544444
544462
|
...current,
|
|
@@ -544453,7 +544471,7 @@ function getIterm2RecoveryInfo() {
|
|
|
544453
544471
|
};
|
|
544454
544472
|
}
|
|
544455
544473
|
function getITerm2PlistPath() {
|
|
544456
|
-
return
|
|
544474
|
+
return join146(homedir38(), "Library", "Preferences", "com.googlecode.iterm2.plist");
|
|
544457
544475
|
}
|
|
544458
544476
|
async function checkAndRestoreITerm2Backup() {
|
|
544459
544477
|
const { inProgress, backupPath } = getIterm2RecoveryInfo();
|
|
@@ -547818,7 +547836,7 @@ var init_idleTimeout = __esm(() => {
|
|
|
547818
547836
|
// src/bridge/inboundAttachments.ts
|
|
547819
547837
|
import { randomUUID as randomUUID51 } from "crypto";
|
|
547820
547838
|
import { mkdir as mkdir42, writeFile as writeFile46 } from "fs/promises";
|
|
547821
|
-
import { basename as basename55, join as
|
|
547839
|
+
import { basename as basename55, join as join147 } from "path";
|
|
547822
547840
|
function debug(msg) {
|
|
547823
547841
|
logForDebugging(`[bridge:inbound-attach] ${msg}`);
|
|
547824
547842
|
}
|
|
@@ -547834,7 +547852,7 @@ function sanitizeFileName(name) {
|
|
|
547834
547852
|
return base2 || "attachment";
|
|
547835
547853
|
}
|
|
547836
547854
|
function uploadsDir() {
|
|
547837
|
-
return
|
|
547855
|
+
return join147(getVivusConfigHomeDir(), "uploads", getSessionId());
|
|
547838
547856
|
}
|
|
547839
547857
|
async function resolveOne(att) {
|
|
547840
547858
|
const token = getBridgeAccessToken();
|
|
@@ -547863,7 +547881,7 @@ async function resolveOne(att) {
|
|
|
547863
547881
|
const safeName = sanitizeFileName(att.file_name);
|
|
547864
547882
|
const prefix = (att.file_uuid.slice(0, 8) || randomUUID51().slice(0, 8)).replace(/[^a-zA-Z0-9_-]/g, "_");
|
|
547865
547883
|
const dir = uploadsDir();
|
|
547866
|
-
const outPath =
|
|
547884
|
+
const outPath = join147(dir, `${prefix}-${safeName}`);
|
|
547867
547885
|
try {
|
|
547868
547886
|
await mkdir42(dir, { recursive: true });
|
|
547869
547887
|
await writeFile46(outPath, data);
|
|
@@ -547963,7 +547981,7 @@ var init_sessionUrl = __esm(() => {
|
|
|
547963
547981
|
|
|
547964
547982
|
// src/utils/plugins/zipCacheAdapters.ts
|
|
547965
547983
|
import { readFile as readFile50 } from "fs/promises";
|
|
547966
|
-
import { join as
|
|
547984
|
+
import { join as join148 } from "path";
|
|
547967
547985
|
async function readZipCacheKnownMarketplaces() {
|
|
547968
547986
|
try {
|
|
547969
547987
|
const content = await readFile50(getZipCacheKnownMarketplacesPath(), "utf-8");
|
|
@@ -547988,13 +548006,13 @@ async function saveMarketplaceJsonToZipCache(marketplaceName, installLocation) {
|
|
|
547988
548006
|
const content = await readMarketplaceJsonContent(installLocation);
|
|
547989
548007
|
if (content !== null) {
|
|
547990
548008
|
const relPath = getMarketplaceJsonRelativePath(marketplaceName);
|
|
547991
|
-
await atomicWriteToZipCache(
|
|
548009
|
+
await atomicWriteToZipCache(join148(zipCachePath, relPath), content);
|
|
547992
548010
|
}
|
|
547993
548011
|
}
|
|
547994
548012
|
async function readMarketplaceJsonContent(dir) {
|
|
547995
548013
|
const candidates = [
|
|
547996
|
-
|
|
547997
|
-
|
|
548014
|
+
join148(dir, ".vivus-plugin", "marketplace.json"),
|
|
548015
|
+
join148(dir, "marketplace.json"),
|
|
547998
548016
|
dir
|
|
547999
548017
|
];
|
|
548000
548018
|
for (const candidate of candidates) {
|
|
@@ -548124,8 +548142,8 @@ async function getEnvLessBridgeConfig() {
|
|
|
548124
548142
|
}
|
|
548125
548143
|
async function checkEnvLessBridgeMinVersion() {
|
|
548126
548144
|
const cfg = await getEnvLessBridgeConfig();
|
|
548127
|
-
if (cfg.min_version && lt("1.1.
|
|
548128
|
-
return `Your version of Vivus (${"1.1.
|
|
548145
|
+
if (cfg.min_version && lt("1.1.32+82959fe", cfg.min_version)) {
|
|
548146
|
+
return `Your version of Vivus (${"1.1.32+82959fe"}) is too old for Remote Control.
|
|
548129
548147
|
Version ${cfg.min_version} or higher is required. Run \`vivus update\` to update.`;
|
|
548130
548148
|
}
|
|
548131
548149
|
return null;
|
|
@@ -548453,9 +548471,9 @@ __export(exports_bridgePointer, {
|
|
|
548453
548471
|
BRIDGE_POINTER_TTL_MS: () => BRIDGE_POINTER_TTL_MS
|
|
548454
548472
|
});
|
|
548455
548473
|
import { mkdir as mkdir43, readFile as readFile51, stat as stat48, unlink as unlink24, writeFile as writeFile47 } from "fs/promises";
|
|
548456
|
-
import { dirname as dirname63, join as
|
|
548474
|
+
import { dirname as dirname63, join as join149 } from "path";
|
|
548457
548475
|
function getBridgePointerPath(dir) {
|
|
548458
|
-
return
|
|
548476
|
+
return join149(getProjectsDir(), sanitizePath2(dir), "bridge-pointer.json");
|
|
548459
548477
|
}
|
|
548460
548478
|
async function writeBridgePointer(dir, pointer) {
|
|
548461
548479
|
const path25 = getBridgePointerPath(dir);
|
|
@@ -548599,7 +548617,7 @@ async function initBridgeCore(params) {
|
|
|
548599
548617
|
const rawApi = createBridgeApiClient({
|
|
548600
548618
|
baseUrl,
|
|
548601
548619
|
getAccessToken,
|
|
548602
|
-
runnerVersion: "1.1.
|
|
548620
|
+
runnerVersion: "1.1.32+82959fe",
|
|
548603
548621
|
onDebug: logForDebugging,
|
|
548604
548622
|
onAuth401,
|
|
548605
548623
|
getTrustedDeviceToken
|
|
@@ -554264,7 +554282,7 @@ async function startMCPServer(cwd3, debug2, verbose) {
|
|
|
554264
554282
|
setCwd(cwd3);
|
|
554265
554283
|
const server = new Server({
|
|
554266
554284
|
name: "vivus/tengu",
|
|
554267
|
-
version: "1.1.
|
|
554285
|
+
version: "1.1.32+82959fe"
|
|
554268
554286
|
}, {
|
|
554269
554287
|
capabilities: {
|
|
554270
554288
|
tools: {}
|
|
@@ -554396,14 +554414,14 @@ __export(exports_vivusDesktop, {
|
|
|
554396
554414
|
});
|
|
554397
554415
|
import { readdir as readdir30, readFile as readFile53, stat as stat50 } from "fs/promises";
|
|
554398
554416
|
import { homedir as homedir39 } from "os";
|
|
554399
|
-
import { join as
|
|
554417
|
+
import { join as join150 } from "path";
|
|
554400
554418
|
async function getVivusDesktopConfigPath() {
|
|
554401
554419
|
const platform5 = getPlatform();
|
|
554402
554420
|
if (!SUPPORTED_PLATFORMS.includes(platform5)) {
|
|
554403
554421
|
throw new Error(`Unsupported platform: ${platform5} - Vivus Desktop integration only works on macOS and WSL.`);
|
|
554404
554422
|
}
|
|
554405
554423
|
if (platform5 === "macos") {
|
|
554406
|
-
return
|
|
554424
|
+
return join150(homedir39(), "Library", "Application Support", "Vivus", "vivus_desktop_config.json");
|
|
554407
554425
|
}
|
|
554408
554426
|
const windowsHome = process.env.USERPROFILE ? process.env.USERPROFILE.replace(/\\/g, "/") : null;
|
|
554409
554427
|
if (windowsHome) {
|
|
@@ -554422,7 +554440,7 @@ async function getVivusDesktopConfigPath() {
|
|
|
554422
554440
|
if (user.name === "Public" || user.name === "Default" || user.name === "Default User" || user.name === "All Users") {
|
|
554423
554441
|
continue;
|
|
554424
554442
|
}
|
|
554425
|
-
const potentialConfigPath =
|
|
554443
|
+
const potentialConfigPath = join150(usersDir, user.name, "AppData", "Roaming", "Vivus", "vivus_desktop_config.json");
|
|
554426
554444
|
try {
|
|
554427
554445
|
await stat50(potentialConfigPath);
|
|
554428
554446
|
return potentialConfigPath;
|
|
@@ -555331,12 +555349,12 @@ __export(exports_install, {
|
|
|
555331
555349
|
install: () => install
|
|
555332
555350
|
});
|
|
555333
555351
|
import { homedir as homedir40 } from "node:os";
|
|
555334
|
-
import { join as
|
|
555352
|
+
import { join as join151 } from "node:path";
|
|
555335
555353
|
function getInstallationPath2() {
|
|
555336
555354
|
const isWindows2 = env3.platform === "win32";
|
|
555337
555355
|
const homeDir = homedir40();
|
|
555338
555356
|
if (isWindows2) {
|
|
555339
|
-
const windowsPath =
|
|
555357
|
+
const windowsPath = join151(homeDir, ".local", "bin", "vivus.exe");
|
|
555340
555358
|
return windowsPath.replace(/\//g, "\\");
|
|
555341
555359
|
}
|
|
555342
555360
|
return "~/.local/bin/vivus";
|
|
@@ -555875,7 +555893,7 @@ __export(exports_update, {
|
|
|
555875
555893
|
});
|
|
555876
555894
|
async function update() {
|
|
555877
555895
|
logEvent("tengu_update_check", {});
|
|
555878
|
-
writeToStdout(`Current version: ${"1.1.
|
|
555896
|
+
writeToStdout(`Current version: ${"1.1.32+82959fe"}
|
|
555879
555897
|
`);
|
|
555880
555898
|
const channel = getInitialSettings()?.autoUpdatesChannel ?? "latest";
|
|
555881
555899
|
writeToStdout(`Checking for updates to ${channel} version...
|
|
@@ -555950,8 +555968,8 @@ async function update() {
|
|
|
555950
555968
|
writeToStdout(`Vivus is managed by Homebrew.
|
|
555951
555969
|
`);
|
|
555952
555970
|
const latest = await getLatestVersion(channel);
|
|
555953
|
-
if (latest && !gte("1.1.
|
|
555954
|
-
writeToStdout(`Update available: ${"1.1.
|
|
555971
|
+
if (latest && !gte("1.1.32+82959fe", latest)) {
|
|
555972
|
+
writeToStdout(`Update available: ${"1.1.32+82959fe"} → ${latest}
|
|
555955
555973
|
`);
|
|
555956
555974
|
writeToStdout(`
|
|
555957
555975
|
`);
|
|
@@ -555967,8 +555985,8 @@ async function update() {
|
|
|
555967
555985
|
writeToStdout(`Vivus is managed by winget.
|
|
555968
555986
|
`);
|
|
555969
555987
|
const latest = await getLatestVersion(channel);
|
|
555970
|
-
if (latest && !gte("1.1.
|
|
555971
|
-
writeToStdout(`Update available: ${"1.1.
|
|
555988
|
+
if (latest && !gte("1.1.32+82959fe", latest)) {
|
|
555989
|
+
writeToStdout(`Update available: ${"1.1.32+82959fe"} → ${latest}
|
|
555972
555990
|
`);
|
|
555973
555991
|
writeToStdout(`
|
|
555974
555992
|
`);
|
|
@@ -555984,8 +556002,8 @@ async function update() {
|
|
|
555984
556002
|
writeToStdout(`Vivus is managed by apk.
|
|
555985
556003
|
`);
|
|
555986
556004
|
const latest = await getLatestVersion(channel);
|
|
555987
|
-
if (latest && !gte("1.1.
|
|
555988
|
-
writeToStdout(`Update available: ${"1.1.
|
|
556005
|
+
if (latest && !gte("1.1.32+82959fe", latest)) {
|
|
556006
|
+
writeToStdout(`Update available: ${"1.1.32+82959fe"} → ${latest}
|
|
555989
556007
|
`);
|
|
555990
556008
|
writeToStdout(`
|
|
555991
556009
|
`);
|
|
@@ -556050,11 +556068,11 @@ async function update() {
|
|
|
556050
556068
|
`);
|
|
556051
556069
|
await gracefulShutdown(1);
|
|
556052
556070
|
}
|
|
556053
|
-
if (result.latestVersion === "1.1.
|
|
556054
|
-
writeToStdout(source_default.green(`Vivus is up to date (${"1.1.
|
|
556071
|
+
if (result.latestVersion === "1.1.32+82959fe") {
|
|
556072
|
+
writeToStdout(source_default.green(`Vivus is up to date (${"1.1.32+82959fe"})`) + `
|
|
556055
556073
|
`);
|
|
556056
556074
|
} else {
|
|
556057
|
-
writeToStdout(source_default.green(`Successfully updated from ${"1.1.
|
|
556075
|
+
writeToStdout(source_default.green(`Successfully updated from ${"1.1.32+82959fe"} to version ${result.latestVersion}`) + `
|
|
556058
556076
|
`);
|
|
556059
556077
|
await regenerateCompletionCache();
|
|
556060
556078
|
}
|
|
@@ -556111,12 +556129,12 @@ async function update() {
|
|
|
556111
556129
|
`);
|
|
556112
556130
|
await gracefulShutdown(1);
|
|
556113
556131
|
}
|
|
556114
|
-
if (latestVersion === "1.1.
|
|
556115
|
-
writeToStdout(source_default.green(`Vivus is up to date (${"1.1.
|
|
556132
|
+
if (latestVersion === "1.1.32+82959fe") {
|
|
556133
|
+
writeToStdout(source_default.green(`Vivus is up to date (${"1.1.32+82959fe"})`) + `
|
|
556116
556134
|
`);
|
|
556117
556135
|
await gracefulShutdown(0);
|
|
556118
556136
|
}
|
|
556119
|
-
writeToStdout(`New version available: ${latestVersion} (current: ${"1.1.
|
|
556137
|
+
writeToStdout(`New version available: ${latestVersion} (current: ${"1.1.32+82959fe"})
|
|
556120
556138
|
`);
|
|
556121
556139
|
writeToStdout(`Installing update...
|
|
556122
556140
|
`);
|
|
@@ -556161,7 +556179,7 @@ async function update() {
|
|
|
556161
556179
|
logForDebugging(`update: Installation status: ${status2}`);
|
|
556162
556180
|
switch (status2) {
|
|
556163
556181
|
case "success":
|
|
556164
|
-
writeToStdout(source_default.green(`Successfully updated from ${"1.1.
|
|
556182
|
+
writeToStdout(source_default.green(`Successfully updated from ${"1.1.32+82959fe"} to version ${latestVersion}`) + `
|
|
556165
556183
|
`);
|
|
556166
556184
|
await regenerateCompletionCache();
|
|
556167
556185
|
break;
|
|
@@ -557135,7 +557153,7 @@ function completeOnboarding() {
|
|
|
557135
557153
|
saveGlobalConfig((current) => ({
|
|
557136
557154
|
...current,
|
|
557137
557155
|
hasCompletedOnboarding: true,
|
|
557138
|
-
lastOnboardingVersion: "1.1.
|
|
557156
|
+
lastOnboardingVersion: "1.1.32+82959fe"
|
|
557139
557157
|
}));
|
|
557140
557158
|
}
|
|
557141
557159
|
function showDialog(root2, renderer) {
|
|
@@ -561309,7 +561327,7 @@ ${customInstructions}` : customInstructions;
|
|
|
561309
561327
|
}
|
|
561310
561328
|
}
|
|
561311
561329
|
logForDiagnosticsNoPII("info", "started", {
|
|
561312
|
-
version: "1.1.
|
|
561330
|
+
version: "1.1.32+82959fe",
|
|
561313
561331
|
is_native_binary: isInBundledMode()
|
|
561314
561332
|
});
|
|
561315
561333
|
registerCleanup(async () => {
|
|
@@ -562093,7 +562111,7 @@ Usage: vivus --remote "your task description"`, () => gracefulShutdown(1));
|
|
|
562093
562111
|
pendingHookMessages
|
|
562094
562112
|
}, renderAndRun);
|
|
562095
562113
|
}
|
|
562096
|
-
}).version("1.1.
|
|
562114
|
+
}).version("1.1.32+82959fe (Vivus)", "-v, --version", "Output the version number");
|
|
562097
562115
|
program2.option("-w, --worktree [name]", "Create a new git worktree for this session (optionally specify a name)");
|
|
562098
562116
|
program2.option("--tmux", "Create a tmux session for the worktree (requires --worktree). Uses iTerm2 native panes when available; use --tmux=classic for traditional tmux.");
|
|
562099
562117
|
if (canUserConfigureAdvisor()) {
|