vivus-agent 1.1.30 → 1.1.31
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 +585 -575
- 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-23T19:
|
|
3
|
+
// Built from source at 2026-06-23T19:29:51.792Z
|
|
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.31+c38c44f"}`;
|
|
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.31+c38c44f"} (${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.31+c38c44f"}${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.31+c38c44f",
|
|
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.31+c38c44f".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.31+c38c44f",
|
|
119648
119648
|
versionBase: getVersionBase(),
|
|
119649
|
-
buildTime: "2026-06-23T19:
|
|
119649
|
+
buildTime: "2026-06-23T19:29:51.252Z",
|
|
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.31+c38c44f"
|
|
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.31+c38c44f");
|
|
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.31+c38c44f"}.${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.31+c38c44f";
|
|
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.31+c38c44f");
|
|
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.31+c38c44f");
|
|
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.31+c38c44f",
|
|
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.31+c38c44f",
|
|
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,7 @@ async function checkIdeConnection(host, port, timeout = 500) {
|
|
|
245608
245618
|
}
|
|
245609
245619
|
}
|
|
245610
245620
|
async function getIdeLockfilesPaths() {
|
|
245611
|
-
const paths2 = [
|
|
245621
|
+
const paths2 = [join64(getVivusConfigHomeDir(), "ide")];
|
|
245612
245622
|
if (getPlatform() !== "wsl") {
|
|
245613
245623
|
return paths2;
|
|
245614
245624
|
}
|
|
@@ -245628,7 +245638,7 @@ async function getIdeLockfilesPaths() {
|
|
|
245628
245638
|
if (user.name === "Public" || user.name === "Default" || user.name === "Default User" || user.name === "All Users") {
|
|
245629
245639
|
continue;
|
|
245630
245640
|
}
|
|
245631
|
-
paths2.push(
|
|
245641
|
+
paths2.push(join64(usersDir, user.name, ".vivus", "ide"));
|
|
245632
245642
|
}
|
|
245633
245643
|
} catch (error41) {
|
|
245634
245644
|
if (isFsInaccessible(error41)) {
|
|
@@ -245884,7 +245894,7 @@ function getInstallationEnv() {
|
|
|
245884
245894
|
return;
|
|
245885
245895
|
}
|
|
245886
245896
|
function getVivusCodeVersion() {
|
|
245887
|
-
return "1.1.
|
|
245897
|
+
return "1.1.31+c38c44f";
|
|
245888
245898
|
}
|
|
245889
245899
|
async function getInstalledVSCodeExtensionVersion(command) {
|
|
245890
245900
|
const { stdout } = await execFileNoThrow(command, ["--list-extensions", "--show-versions"], {
|
|
@@ -246112,7 +246122,7 @@ async function initializeIdeIntegration(onIdeDetected, ideToInstallExtension, on
|
|
|
246112
246122
|
}
|
|
246113
246123
|
}
|
|
246114
246124
|
async function installFromArtifactory(command) {
|
|
246115
|
-
const npmrcPath =
|
|
246125
|
+
const npmrcPath = join64(os4.homedir(), ".npmrc");
|
|
246116
246126
|
let authToken = null;
|
|
246117
246127
|
const fs7 = getFsImplementation();
|
|
246118
246128
|
try {
|
|
@@ -246147,7 +246157,7 @@ async function installFromArtifactory(command) {
|
|
|
246147
246157
|
throw new Error("No version found in artifactory response");
|
|
246148
246158
|
}
|
|
246149
246159
|
const vsixUrl = `https://artifactory.infra.ant.dev/artifactory/armorcode-vivus-internal/vivus-vscode-releases/${version2}/vivus.vsix`;
|
|
246150
|
-
const tempVsixPath =
|
|
246160
|
+
const tempVsixPath = join64(os4.tmpdir(), `vivus-${version2}-${Date.now()}.vsix`);
|
|
246151
246161
|
try {
|
|
246152
246162
|
const vsixResponse = await axios_default.get(vsixUrl, {
|
|
246153
246163
|
headers: {
|
|
@@ -248189,13 +248199,13 @@ var init_memoryTypes = __esm(() => {
|
|
|
248189
248199
|
|
|
248190
248200
|
// src/memdir/memoryScan.ts
|
|
248191
248201
|
import { readdir as readdir14 } from "fs/promises";
|
|
248192
|
-
import { basename as basename13, join as
|
|
248202
|
+
import { basename as basename13, join as join65 } from "path";
|
|
248193
248203
|
async function scanMemoryFiles(memoryDir, signal) {
|
|
248194
248204
|
try {
|
|
248195
248205
|
const entries = await readdir14(memoryDir, { recursive: true });
|
|
248196
248206
|
const mdFiles = entries.filter((f) => f.endsWith(".md") && basename13(f) !== "MEMORY.md");
|
|
248197
248207
|
const headerResults = await Promise.allSettled(mdFiles.map(async (relativePath) => {
|
|
248198
|
-
const filePath =
|
|
248208
|
+
const filePath = join65(memoryDir, relativePath);
|
|
248199
248209
|
const { content, mtimeMs } = await readFileInRange(filePath, 0, FRONTMATTER_MAX_LINES, undefined, signal);
|
|
248200
248210
|
const { frontmatter } = parseFrontmatter(content, filePath);
|
|
248201
248211
|
return {
|
|
@@ -249396,20 +249406,20 @@ __export(exports_teammateMailbox, {
|
|
|
249396
249406
|
ModeSetRequestMessageSchema: () => ModeSetRequestMessageSchema
|
|
249397
249407
|
});
|
|
249398
249408
|
import { mkdir as mkdir16, readFile as readFile18, writeFile as writeFile12 } from "fs/promises";
|
|
249399
|
-
import { join as
|
|
249409
|
+
import { join as join66 } from "path";
|
|
249400
249410
|
function getInboxPath(agentName, teamName) {
|
|
249401
249411
|
const team = teamName || getTeamName() || "default";
|
|
249402
249412
|
const safeTeam = sanitizePathComponent(team);
|
|
249403
249413
|
const safeAgentName = sanitizePathComponent(agentName);
|
|
249404
|
-
const inboxDir =
|
|
249405
|
-
const fullPath =
|
|
249414
|
+
const inboxDir = join66(getTeamsDir(), safeTeam, "inboxes");
|
|
249415
|
+
const fullPath = join66(inboxDir, `${safeAgentName}.json`);
|
|
249406
249416
|
logForDebugging(`[TeammateMailbox] getInboxPath: agent=${agentName}, team=${team}, fullPath=${fullPath}`);
|
|
249407
249417
|
return fullPath;
|
|
249408
249418
|
}
|
|
249409
249419
|
async function ensureInboxDir(teamName) {
|
|
249410
249420
|
const team = teamName || getTeamName() || "default";
|
|
249411
249421
|
const safeTeam = sanitizePathComponent(team);
|
|
249412
|
-
const inboxDir =
|
|
249422
|
+
const inboxDir = join66(getTeamsDir(), safeTeam, "inboxes");
|
|
249413
249423
|
await mkdir16(inboxDir, { recursive: true });
|
|
249414
249424
|
logForDebugging(`[TeammateMailbox] Ensured inbox directory: ${inboxDir}`);
|
|
249415
249425
|
}
|
|
@@ -253006,7 +253016,7 @@ var init_compact = __esm(() => {
|
|
|
253006
253016
|
// src/services/api/dumpPrompts.ts
|
|
253007
253017
|
import { createHash as createHash13 } from "crypto";
|
|
253008
253018
|
import { promises as fs7 } from "fs";
|
|
253009
|
-
import { dirname as dirname27, join as
|
|
253019
|
+
import { dirname as dirname27, join as join67 } from "path";
|
|
253010
253020
|
function hashString3(str2) {
|
|
253011
253021
|
return createHash13("sha256").update(str2).digest("hex");
|
|
253012
253022
|
}
|
|
@@ -253028,7 +253038,7 @@ function addApiRequestToCache(requestData) {
|
|
|
253028
253038
|
}
|
|
253029
253039
|
}
|
|
253030
253040
|
function getDumpPromptsPath(agentIdOrSessionId) {
|
|
253031
|
-
return
|
|
253041
|
+
return join67(getVivusConfigHomeDir(), "dump-prompts", `${agentIdOrSessionId ?? getSessionId()}.jsonl`);
|
|
253032
253042
|
}
|
|
253033
253043
|
function appendToFile(filePath, entries) {
|
|
253034
253044
|
if (entries.length === 0)
|
|
@@ -256230,7 +256240,7 @@ var init_types7 = __esm(() => {
|
|
|
256230
256240
|
import { createHash as createHash14 } from "crypto";
|
|
256231
256241
|
import { readFileSync as fsReadFileSync } from "fs";
|
|
256232
256242
|
import { unlink as unlink9, writeFile as writeFile13 } from "fs/promises";
|
|
256233
|
-
import { join as
|
|
256243
|
+
import { join as join68 } from "path";
|
|
256234
256244
|
function isNodeError(e) {
|
|
256235
256245
|
return e instanceof Error;
|
|
256236
256246
|
}
|
|
@@ -256252,7 +256262,7 @@ function initializePolicyLimitsLoadingPromise() {
|
|
|
256252
256262
|
}
|
|
256253
256263
|
}
|
|
256254
256264
|
function getCachePath2() {
|
|
256255
|
-
return
|
|
256265
|
+
return join68(getVivusConfigHomeDir(), CACHE_FILENAME);
|
|
256256
256266
|
}
|
|
256257
256267
|
function getPolicyLimitsEndpoint() {
|
|
256258
256268
|
return `${getOauthConfig().BASE_API_URL}/api/vivus_code/policy_limits`;
|
|
@@ -256617,15 +256627,15 @@ var init_policyLimits = __esm(() => {
|
|
|
256617
256627
|
|
|
256618
256628
|
// src/utils/imagePaste.ts
|
|
256619
256629
|
import { randomBytes as randomBytes11 } from "crypto";
|
|
256620
|
-
import { basename as basename14, extname as extname6, isAbsolute as isAbsolute12, join as
|
|
256630
|
+
import { basename as basename14, extname as extname6, isAbsolute as isAbsolute12, join as join69 } from "path";
|
|
256621
256631
|
function getClipboardCommands() {
|
|
256622
256632
|
const platform4 = process.platform;
|
|
256623
256633
|
const baseTmpDir = process.env.VIVUS_CODE_TMPDIR || (platform4 === "win32" ? process.env.TEMP || "C:\\Temp" : "/tmp");
|
|
256624
256634
|
const screenshotFilename = "vivus_cli_latest_screenshot.png";
|
|
256625
256635
|
const tempPaths = {
|
|
256626
|
-
darwin:
|
|
256627
|
-
linux:
|
|
256628
|
-
win32:
|
|
256636
|
+
darwin: join69(baseTmpDir, screenshotFilename),
|
|
256637
|
+
linux: join69(baseTmpDir, screenshotFilename),
|
|
256638
|
+
win32: join69(baseTmpDir, screenshotFilename)
|
|
256629
256639
|
};
|
|
256630
256640
|
const screenshotPath = tempPaths[platform4] || tempPaths.linux;
|
|
256631
256641
|
const commands = {
|
|
@@ -256804,9 +256814,9 @@ var init_imagePaste = __esm(() => {
|
|
|
256804
256814
|
|
|
256805
256815
|
// src/utils/imageStore.ts
|
|
256806
256816
|
import { mkdir as mkdir17, open as open8 } from "fs/promises";
|
|
256807
|
-
import { join as
|
|
256817
|
+
import { join as join70 } from "path";
|
|
256808
256818
|
function getImageStoreDir() {
|
|
256809
|
-
return
|
|
256819
|
+
return join70(getVivusConfigHomeDir(), IMAGE_STORE_DIR, getSessionId());
|
|
256810
256820
|
}
|
|
256811
256821
|
async function ensureImageStoreDir() {
|
|
256812
256822
|
const dir = getImageStoreDir();
|
|
@@ -256814,7 +256824,7 @@ async function ensureImageStoreDir() {
|
|
|
256814
256824
|
}
|
|
256815
256825
|
function getImagePath(imageId, mediaType) {
|
|
256816
256826
|
const extension2 = mediaType.split("/")[1] || "png";
|
|
256817
|
-
return
|
|
256827
|
+
return join70(getImageStoreDir(), `${imageId}.${extension2}`);
|
|
256818
256828
|
}
|
|
256819
256829
|
function cacheImagePath(content) {
|
|
256820
256830
|
if (content.type !== "image") {
|
|
@@ -256878,7 +256888,7 @@ function evictOldestIfAtCap() {
|
|
|
256878
256888
|
}
|
|
256879
256889
|
async function cleanupOldImageCaches() {
|
|
256880
256890
|
const fsImpl = getFsImplementation();
|
|
256881
|
-
const baseDir =
|
|
256891
|
+
const baseDir = join70(getVivusConfigHomeDir(), IMAGE_STORE_DIR);
|
|
256882
256892
|
const currentSessionId = getSessionId();
|
|
256883
256893
|
try {
|
|
256884
256894
|
let sessionDirs;
|
|
@@ -256891,7 +256901,7 @@ async function cleanupOldImageCaches() {
|
|
|
256891
256901
|
if (sessionDir.name === currentSessionId) {
|
|
256892
256902
|
continue;
|
|
256893
256903
|
}
|
|
256894
|
-
const sessionPath =
|
|
256904
|
+
const sessionPath = join70(baseDir, sessionDir.name);
|
|
256895
256905
|
try {
|
|
256896
256906
|
await fsImpl.rm(sessionPath, { recursive: true, force: true });
|
|
256897
256907
|
logForDebugging(`Cleaned up old image cache: ${sessionPath}`);
|
|
@@ -257255,9 +257265,9 @@ function isInputModeCharacter(input) {
|
|
|
257255
257265
|
}
|
|
257256
257266
|
|
|
257257
257267
|
// src/projectOnboardingState.ts
|
|
257258
|
-
import { join as
|
|
257268
|
+
import { join as join71 } from "path";
|
|
257259
257269
|
function getSteps() {
|
|
257260
|
-
const hasVivusMd = getFsImplementation().existsSync(
|
|
257270
|
+
const hasVivusMd = getFsImplementation().existsSync(join71(getCwd(), "VIVUS.md"));
|
|
257261
257271
|
const isWorkspaceDirEmpty = isDirEmpty(getCwd());
|
|
257262
257272
|
return [
|
|
257263
257273
|
{
|
|
@@ -257315,7 +257325,7 @@ var init_projectOnboardingState = __esm(() => {
|
|
|
257315
257325
|
// src/utils/appleTerminalBackup.ts
|
|
257316
257326
|
import { stat as stat25 } from "fs/promises";
|
|
257317
257327
|
import { homedir as homedir19 } from "os";
|
|
257318
|
-
import { join as
|
|
257328
|
+
import { join as join72 } from "path";
|
|
257319
257329
|
function markTerminalSetupInProgress(backupPath) {
|
|
257320
257330
|
saveGlobalConfig((current) => ({
|
|
257321
257331
|
...current,
|
|
@@ -257337,7 +257347,7 @@ function getTerminalRecoveryInfo() {
|
|
|
257337
257347
|
};
|
|
257338
257348
|
}
|
|
257339
257349
|
function getTerminalPlistPath() {
|
|
257340
|
-
return
|
|
257350
|
+
return join72(homedir19(), "Library", "Preferences", "com.apple.Terminal.plist");
|
|
257341
257351
|
}
|
|
257342
257352
|
async function backupTerminalPreferences() {
|
|
257343
257353
|
const terminalPlistPath = getTerminalPlistPath();
|
|
@@ -257409,37 +257419,37 @@ var init_appleTerminalBackup = __esm(() => {
|
|
|
257409
257419
|
|
|
257410
257420
|
// src/utils/completionCache.ts
|
|
257411
257421
|
import { homedir as homedir20 } from "os";
|
|
257412
|
-
import { dirname as dirname28, join as
|
|
257422
|
+
import { dirname as dirname28, join as join73 } from "path";
|
|
257413
257423
|
function detectShell() {
|
|
257414
257424
|
const shell = process.env.SHELL || "";
|
|
257415
257425
|
const home = homedir20();
|
|
257416
|
-
const vivusDir =
|
|
257426
|
+
const vivusDir = join73(home, ".vivus");
|
|
257417
257427
|
if (shell.endsWith("/zsh") || shell.endsWith("/zsh.exe")) {
|
|
257418
|
-
const cacheFile =
|
|
257428
|
+
const cacheFile = join73(vivusDir, "completion.zsh");
|
|
257419
257429
|
return {
|
|
257420
257430
|
name: "zsh",
|
|
257421
|
-
rcFile:
|
|
257431
|
+
rcFile: join73(home, ".zshrc"),
|
|
257422
257432
|
cacheFile,
|
|
257423
257433
|
completionLine: `[[ -f "${cacheFile}" ]] && source "${cacheFile}"`,
|
|
257424
257434
|
shellFlag: "zsh"
|
|
257425
257435
|
};
|
|
257426
257436
|
}
|
|
257427
257437
|
if (shell.endsWith("/bash") || shell.endsWith("/bash.exe")) {
|
|
257428
|
-
const cacheFile =
|
|
257438
|
+
const cacheFile = join73(vivusDir, "completion.bash");
|
|
257429
257439
|
return {
|
|
257430
257440
|
name: "bash",
|
|
257431
|
-
rcFile:
|
|
257441
|
+
rcFile: join73(home, ".bashrc"),
|
|
257432
257442
|
cacheFile,
|
|
257433
257443
|
completionLine: `[ -f "${cacheFile}" ] && source "${cacheFile}"`,
|
|
257434
257444
|
shellFlag: "bash"
|
|
257435
257445
|
};
|
|
257436
257446
|
}
|
|
257437
257447
|
if (shell.endsWith("/fish") || shell.endsWith("/fish.exe")) {
|
|
257438
|
-
const xdg = process.env.XDG_CONFIG_HOME ||
|
|
257439
|
-
const cacheFile =
|
|
257448
|
+
const xdg = process.env.XDG_CONFIG_HOME || join73(home, ".config");
|
|
257449
|
+
const cacheFile = join73(vivusDir, "completion.fish");
|
|
257440
257450
|
return {
|
|
257441
257451
|
name: "fish",
|
|
257442
|
-
rcFile:
|
|
257452
|
+
rcFile: join73(xdg, "fish", "config.fish"),
|
|
257443
257453
|
cacheFile,
|
|
257444
257454
|
completionLine: `[ -f "${cacheFile}" ] && source "${cacheFile}"`,
|
|
257445
257455
|
shellFlag: "fish"
|
|
@@ -257489,7 +257499,7 @@ __export(exports_terminalSetup, {
|
|
|
257489
257499
|
import { randomBytes as randomBytes12 } from "crypto";
|
|
257490
257500
|
import { copyFile as copyFile4, mkdir as mkdir18, readFile as readFile20, writeFile as writeFile14 } from "fs/promises";
|
|
257491
257501
|
import { homedir as homedir21, platform as platform4 } from "os";
|
|
257492
|
-
import { dirname as dirname29, join as
|
|
257502
|
+
import { dirname as dirname29, join as join74 } from "path";
|
|
257493
257503
|
import { pathToFileURL as pathToFileURL3 } from "url";
|
|
257494
257504
|
function isVSCodeRemoteSSH() {
|
|
257495
257505
|
const askpassMain = process.env.VSCODE_GIT_ASKPASS_MAIN ?? "";
|
|
@@ -257624,8 +257634,8 @@ async function installBindingsForVSCodeTerminal(editor = "VSCode", theme) {
|
|
|
257624
257634
|
]`)}${EOL3}`;
|
|
257625
257635
|
}
|
|
257626
257636
|
const editorDir = editor === "VSCode" ? "Code" : editor;
|
|
257627
|
-
const userDirPath =
|
|
257628
|
-
const keybindingsPath =
|
|
257637
|
+
const userDirPath = join74(homedir21(), platform4() === "win32" ? join74("AppData", "Roaming", editorDir, "User") : platform4() === "darwin" ? join74("Library", "Application Support", editorDir, "User") : join74(".config", editorDir, "User"));
|
|
257638
|
+
const keybindingsPath = join74(userDirPath, "keybindings.json");
|
|
257629
257639
|
try {
|
|
257630
257640
|
await mkdir18(userDirPath, {
|
|
257631
257641
|
recursive: true
|
|
@@ -257766,14 +257776,14 @@ chars = "\\u001B\\r"`;
|
|
|
257766
257776
|
const configPaths = [];
|
|
257767
257777
|
const xdgConfigHome = process.env.XDG_CONFIG_HOME;
|
|
257768
257778
|
if (xdgConfigHome) {
|
|
257769
|
-
configPaths.push(
|
|
257779
|
+
configPaths.push(join74(xdgConfigHome, "alacritty", "alacritty.toml"));
|
|
257770
257780
|
} else {
|
|
257771
|
-
configPaths.push(
|
|
257781
|
+
configPaths.push(join74(homedir21(), ".config", "alacritty", "alacritty.toml"));
|
|
257772
257782
|
}
|
|
257773
257783
|
if (platform4() === "win32") {
|
|
257774
257784
|
const appData = process.env.APPDATA;
|
|
257775
257785
|
if (appData) {
|
|
257776
|
-
configPaths.push(
|
|
257786
|
+
configPaths.push(join74(appData, "alacritty", "alacritty.toml"));
|
|
257777
257787
|
}
|
|
257778
257788
|
}
|
|
257779
257789
|
let configPath = null;
|
|
@@ -257834,8 +257844,8 @@ chars = "\\u001B\\r"`;
|
|
|
257834
257844
|
}
|
|
257835
257845
|
}
|
|
257836
257846
|
async function installBindingsForZed(theme) {
|
|
257837
|
-
const zedDir =
|
|
257838
|
-
const keymapPath =
|
|
257847
|
+
const zedDir = join74(homedir21(), ".config", "zed");
|
|
257848
|
+
const keymapPath = join74(zedDir, "keymap.json");
|
|
257839
257849
|
try {
|
|
257840
257850
|
await mkdir18(zedDir, {
|
|
257841
257851
|
recursive: true
|
|
@@ -257917,15 +257927,15 @@ var init_terminalSetup = __esm(() => {
|
|
|
257917
257927
|
// src/utils/pasteStore.ts
|
|
257918
257928
|
import { createHash as createHash15 } from "crypto";
|
|
257919
257929
|
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
|
|
257930
|
+
import { join as join75 } from "path";
|
|
257921
257931
|
function getPasteStoreDir() {
|
|
257922
|
-
return
|
|
257932
|
+
return join75(getVivusConfigHomeDir(), PASTE_STORE_DIR);
|
|
257923
257933
|
}
|
|
257924
257934
|
function hashPastedText(content) {
|
|
257925
257935
|
return createHash15("sha256").update(content).digest("hex").slice(0, 16);
|
|
257926
257936
|
}
|
|
257927
257937
|
function getPastePath(hash2) {
|
|
257928
|
-
return
|
|
257938
|
+
return join75(getPasteStoreDir(), `${hash2}.txt`);
|
|
257929
257939
|
}
|
|
257930
257940
|
async function storePastedText(hash2, content) {
|
|
257931
257941
|
try {
|
|
@@ -257962,7 +257972,7 @@ async function cleanupOldPastes(cutoffDate) {
|
|
|
257962
257972
|
if (!file2.endsWith(".txt")) {
|
|
257963
257973
|
continue;
|
|
257964
257974
|
}
|
|
257965
|
-
const filePath =
|
|
257975
|
+
const filePath = join75(pasteDir, file2);
|
|
257966
257976
|
try {
|
|
257967
257977
|
const stats = await stat26(filePath);
|
|
257968
257978
|
if (stats.mtimeMs < cutoffTime) {
|
|
@@ -257981,7 +257991,7 @@ var init_pasteStore = __esm(() => {
|
|
|
257981
257991
|
|
|
257982
257992
|
// src/history.ts
|
|
257983
257993
|
import { appendFile as appendFile4, writeFile as writeFile16 } from "fs/promises";
|
|
257984
|
-
import { join as
|
|
257994
|
+
import { join as join76 } from "path";
|
|
257985
257995
|
function getPastedTextRefNumLines(text2) {
|
|
257986
257996
|
return (text2.match(/\r\n|\r|\n/g) || []).length;
|
|
257987
257997
|
}
|
|
@@ -258023,7 +258033,7 @@ async function* makeLogEntryReader() {
|
|
|
258023
258033
|
for (let i2 = pendingEntries.length - 1;i2 >= 0; i2--) {
|
|
258024
258034
|
yield pendingEntries[i2];
|
|
258025
258035
|
}
|
|
258026
|
-
const historyPath =
|
|
258036
|
+
const historyPath = join76(getVivusConfigHomeDir(), "history.jsonl");
|
|
258027
258037
|
try {
|
|
258028
258038
|
for await (const line of readLinesReverse(historyPath)) {
|
|
258029
258039
|
try {
|
|
@@ -258118,7 +258128,7 @@ async function immediateFlushHistory() {
|
|
|
258118
258128
|
}
|
|
258119
258129
|
let release;
|
|
258120
258130
|
try {
|
|
258121
|
-
const historyPath =
|
|
258131
|
+
const historyPath = join76(getVivusConfigHomeDir(), "history.jsonl");
|
|
258122
258132
|
await writeFile16(historyPath, "", {
|
|
258123
258133
|
encoding: "utf8",
|
|
258124
258134
|
mode: 384,
|
|
@@ -300959,7 +300969,7 @@ async function initializeBetaTracing(resource) {
|
|
|
300959
300969
|
});
|
|
300960
300970
|
import_api_logs.logs.setGlobalLoggerProvider(loggerProvider);
|
|
300961
300971
|
setLoggerProvider(loggerProvider);
|
|
300962
|
-
const eventLogger = import_api_logs.logs.getLogger("com.anthropic.vivus_code.events", "1.1.
|
|
300972
|
+
const eventLogger = import_api_logs.logs.getLogger("com.anthropic.vivus_code.events", "1.1.31+c38c44f");
|
|
300963
300973
|
setEventLogger(eventLogger);
|
|
300964
300974
|
process.on("beforeExit", async () => {
|
|
300965
300975
|
await loggerProvider?.forceFlush();
|
|
@@ -300999,7 +301009,7 @@ async function initializeTelemetry() {
|
|
|
300999
301009
|
const platform5 = getPlatform();
|
|
301000
301010
|
const baseAttributes = {
|
|
301001
301011
|
[import_semantic_conventions2.ATTR_SERVICE_NAME]: "vivus",
|
|
301002
|
-
[import_semantic_conventions2.ATTR_SERVICE_VERSION]: "1.1.
|
|
301012
|
+
[import_semantic_conventions2.ATTR_SERVICE_VERSION]: "1.1.31+c38c44f"
|
|
301003
301013
|
};
|
|
301004
301014
|
if (platform5 === "wsl") {
|
|
301005
301015
|
const wslVersion = getWslVersion();
|
|
@@ -301044,7 +301054,7 @@ async function initializeTelemetry() {
|
|
|
301044
301054
|
} catch {}
|
|
301045
301055
|
};
|
|
301046
301056
|
registerCleanup(shutdownTelemetry2);
|
|
301047
|
-
return meterProvider2.getMeter("com.anthropic.vivus_code", "1.1.
|
|
301057
|
+
return meterProvider2.getMeter("com.anthropic.vivus_code", "1.1.31+c38c44f");
|
|
301048
301058
|
}
|
|
301049
301059
|
const meterProvider = new import_sdk_metrics2.MeterProvider({
|
|
301050
301060
|
resource,
|
|
@@ -301064,7 +301074,7 @@ async function initializeTelemetry() {
|
|
|
301064
301074
|
});
|
|
301065
301075
|
import_api_logs.logs.setGlobalLoggerProvider(loggerProvider);
|
|
301066
301076
|
setLoggerProvider(loggerProvider);
|
|
301067
|
-
const eventLogger = import_api_logs.logs.getLogger("com.anthropic.vivus_code.events", "1.1.
|
|
301077
|
+
const eventLogger = import_api_logs.logs.getLogger("com.anthropic.vivus_code.events", "1.1.31+c38c44f");
|
|
301068
301078
|
setEventLogger(eventLogger);
|
|
301069
301079
|
logForDebugging("[3P telemetry] Event logger set successfully");
|
|
301070
301080
|
process.on("beforeExit", async () => {
|
|
@@ -301126,7 +301136,7 @@ Current timeout: ${timeoutMs}ms
|
|
|
301126
301136
|
}
|
|
301127
301137
|
};
|
|
301128
301138
|
registerCleanup(shutdownTelemetry);
|
|
301129
|
-
return meterProvider.getMeter("com.anthropic.vivus_code", "1.1.
|
|
301139
|
+
return meterProvider.getMeter("com.anthropic.vivus_code", "1.1.31+c38c44f");
|
|
301130
301140
|
}
|
|
301131
301141
|
async function flushTelemetry() {
|
|
301132
301142
|
const meterProvider = getMeterProvider();
|
|
@@ -301622,12 +301632,12 @@ var init_oauth2 = __esm(() => {
|
|
|
301622
301632
|
|
|
301623
301633
|
// src/utils/localInstaller.ts
|
|
301624
301634
|
import { access as access2, chmod as chmod5, writeFile as writeFile17 } from "fs/promises";
|
|
301625
|
-
import { join as
|
|
301635
|
+
import { join as join77 } from "path";
|
|
301626
301636
|
function getLocalInstallDir() {
|
|
301627
|
-
return
|
|
301637
|
+
return join77(getVivusConfigHomeDir(), "local");
|
|
301628
301638
|
}
|
|
301629
301639
|
function getLocalVivusPath() {
|
|
301630
|
-
return
|
|
301640
|
+
return join77(getLocalInstallDir(), "vivus");
|
|
301631
301641
|
}
|
|
301632
301642
|
function isRunningFromLocalInstallation() {
|
|
301633
301643
|
const execPath2 = process.argv[1] || "";
|
|
@@ -301647,8 +301657,8 @@ async function ensureLocalPackageEnvironment() {
|
|
|
301647
301657
|
try {
|
|
301648
301658
|
const localInstallDir = getLocalInstallDir();
|
|
301649
301659
|
await getFsImplementation().mkdir(localInstallDir);
|
|
301650
|
-
await writeIfMissing(
|
|
301651
|
-
const wrapperPath =
|
|
301660
|
+
await writeIfMissing(join77(localInstallDir, "package.json"), jsonStringify({ name: "vivus-local", version: "0.0.1", private: true }, null, 2));
|
|
301661
|
+
const wrapperPath = join77(localInstallDir, "vivus");
|
|
301652
301662
|
const created = await writeIfMissing(wrapperPath, `#!/bin/sh
|
|
301653
301663
|
exec "${localInstallDir}/node_modules/.bin/vivus" "$@"`, 493);
|
|
301654
301664
|
if (created) {
|
|
@@ -301684,7 +301694,7 @@ async function installOrUpdateVivusPackage(channel, specificVersion) {
|
|
|
301684
301694
|
}
|
|
301685
301695
|
async function localInstallationExists() {
|
|
301686
301696
|
try {
|
|
301687
|
-
await access2(
|
|
301697
|
+
await access2(join77(getLocalInstallDir(), "node_modules", ".bin", "vivus"));
|
|
301688
301698
|
return true;
|
|
301689
301699
|
} catch {
|
|
301690
301700
|
return false;
|
|
@@ -301713,15 +301723,15 @@ var init_localInstaller = __esm(() => {
|
|
|
301713
301723
|
// src/utils/shellConfig.ts
|
|
301714
301724
|
import { open as open10, readFile as readFile22, stat as stat27 } from "fs/promises";
|
|
301715
301725
|
import { homedir as osHomedir } from "os";
|
|
301716
|
-
import { join as
|
|
301726
|
+
import { join as join78 } from "path";
|
|
301717
301727
|
function getShellConfigPaths(options2) {
|
|
301718
301728
|
const home = options2?.homedir ?? osHomedir();
|
|
301719
301729
|
const env4 = options2?.env ?? process.env;
|
|
301720
301730
|
const zshConfigDir = env4.ZDOTDIR || home;
|
|
301721
301731
|
return {
|
|
301722
|
-
zsh:
|
|
301723
|
-
bash:
|
|
301724
|
-
fish:
|
|
301732
|
+
zsh: join78(zshConfigDir, ".zshrc"),
|
|
301733
|
+
bash: join78(home, ".bashrc"),
|
|
301734
|
+
fish: join78(home, ".config/fish/config.fish")
|
|
301725
301735
|
};
|
|
301726
301736
|
}
|
|
301727
301737
|
function filterVivusAliases(lines) {
|
|
@@ -301807,14 +301817,14 @@ var init_shellConfig = __esm(() => {
|
|
|
301807
301817
|
import { constants as fsConstants4 } from "fs";
|
|
301808
301818
|
import { access as access3, writeFile as writeFile18 } from "fs/promises";
|
|
301809
301819
|
import { homedir as homedir22 } from "os";
|
|
301810
|
-
import { join as
|
|
301820
|
+
import { join as join79 } from "path";
|
|
301811
301821
|
async function assertMinVersion() {
|
|
301812
301822
|
if (false) {}
|
|
301813
301823
|
try {
|
|
301814
301824
|
const versionConfig = await getDynamicConfig_BLOCKS_ON_INIT("tengu_version_config", { minVersion: "0.0.0" });
|
|
301815
|
-
if (versionConfig.minVersion && lt("1.1.
|
|
301825
|
+
if (versionConfig.minVersion && lt("1.1.31+c38c44f", versionConfig.minVersion)) {
|
|
301816
301826
|
console.error(`
|
|
301817
|
-
It looks like your version of Vivus (${"1.1.
|
|
301827
|
+
It looks like your version of Vivus (${"1.1.31+c38c44f"}) needs an update.
|
|
301818
301828
|
A newer version (${versionConfig.minVersion} or higher) is required to continue.
|
|
301819
301829
|
|
|
301820
301830
|
To update, please run:
|
|
@@ -301863,7 +301873,7 @@ function shouldSkipVersion(targetVersion) {
|
|
|
301863
301873
|
return shouldSkip;
|
|
301864
301874
|
}
|
|
301865
301875
|
function getLockFilePath() {
|
|
301866
|
-
return
|
|
301876
|
+
return join79(getVivusConfigHomeDir(), ".update.lock");
|
|
301867
301877
|
}
|
|
301868
301878
|
async function acquireLock() {
|
|
301869
301879
|
const fs8 = getFsImplementation();
|
|
@@ -302030,7 +302040,7 @@ async function installGlobalPackage(specificVersion) {
|
|
|
302030
302040
|
logError2(new AutoUpdaterError("Another process is currently installing an update"));
|
|
302031
302041
|
logEvent("tengu_auto_updater_lock_contention", {
|
|
302032
302042
|
pid: process.pid,
|
|
302033
|
-
currentVersion: "1.1.
|
|
302043
|
+
currentVersion: "1.1.31+c38c44f"
|
|
302034
302044
|
});
|
|
302035
302045
|
return "in_progress";
|
|
302036
302046
|
}
|
|
@@ -302039,7 +302049,7 @@ async function installGlobalPackage(specificVersion) {
|
|
|
302039
302049
|
if (!env3.isRunningWithBun() && env3.isNpmFromWindowsPath()) {
|
|
302040
302050
|
logError2(new Error("Windows NPM detected in WSL environment"));
|
|
302041
302051
|
logEvent("tengu_auto_updater_windows_npm_in_wsl", {
|
|
302042
|
-
currentVersion: "1.1.
|
|
302052
|
+
currentVersion: "1.1.31+c38c44f"
|
|
302043
302053
|
});
|
|
302044
302054
|
console.error(`
|
|
302045
302055
|
Error: Windows NPM detected in WSL
|
|
@@ -302298,7 +302308,7 @@ var init_packageManagers = __esm(() => {
|
|
|
302298
302308
|
// src/utils/doctorDiagnostic.ts
|
|
302299
302309
|
import { readFile as readFile24, realpath as realpath8 } from "fs/promises";
|
|
302300
302310
|
import { homedir as homedir23 } from "os";
|
|
302301
|
-
import { delimiter as delimiter2, join as
|
|
302311
|
+
import { delimiter as delimiter2, join as join80, posix as posix5, win32 as win323 } from "path";
|
|
302302
302312
|
function getNormalizedPaths() {
|
|
302303
302313
|
let invokedPath = process.argv[1] || "";
|
|
302304
302314
|
let execPath2 = process.execPath || process.argv[0] || "";
|
|
@@ -302361,8 +302371,8 @@ async function getInstallationPath() {
|
|
|
302361
302371
|
}
|
|
302362
302372
|
} catch {}
|
|
302363
302373
|
try {
|
|
302364
|
-
await getFsImplementation().stat(
|
|
302365
|
-
return
|
|
302374
|
+
await getFsImplementation().stat(join80(homedir23(), ".local/bin/vivus"));
|
|
302375
|
+
return join80(homedir23(), ".local/bin/vivus");
|
|
302366
302376
|
} catch {}
|
|
302367
302377
|
return "native";
|
|
302368
302378
|
}
|
|
@@ -302385,7 +302395,7 @@ function getInvokedBinary() {
|
|
|
302385
302395
|
async function detectMultipleInstallations() {
|
|
302386
302396
|
const fs8 = getFsImplementation();
|
|
302387
302397
|
const installations = [];
|
|
302388
|
-
const localPath =
|
|
302398
|
+
const localPath = join80(homedir23(), ".vivus", "local");
|
|
302389
302399
|
if (await localInstallationExists()) {
|
|
302390
302400
|
installations.push({ type: "npm-local", path: localPath });
|
|
302391
302401
|
}
|
|
@@ -302400,7 +302410,7 @@ async function detectMultipleInstallations() {
|
|
|
302400
302410
|
if (npmResult.code === 0 && npmResult.stdout) {
|
|
302401
302411
|
const npmPrefix = npmResult.stdout.trim();
|
|
302402
302412
|
const isWindows2 = getPlatform() === "windows";
|
|
302403
|
-
const globalBinPath = isWindows2 ?
|
|
302413
|
+
const globalBinPath = isWindows2 ? join80(npmPrefix, "vivus") : join80(npmPrefix, "bin", "vivus");
|
|
302404
302414
|
let globalBinExists = false;
|
|
302405
302415
|
try {
|
|
302406
302416
|
await fs8.stat(globalBinPath);
|
|
@@ -302419,7 +302429,7 @@ async function detectMultipleInstallations() {
|
|
|
302419
302429
|
}
|
|
302420
302430
|
} else {
|
|
302421
302431
|
for (const packageName of packagesToCheck) {
|
|
302422
|
-
const globalPackagePath = isWindows2 ?
|
|
302432
|
+
const globalPackagePath = isWindows2 ? join80(npmPrefix, "node_modules", packageName) : join80(npmPrefix, "lib", "node_modules", packageName);
|
|
302423
302433
|
try {
|
|
302424
302434
|
await fs8.stat(globalPackagePath);
|
|
302425
302435
|
installations.push({
|
|
@@ -302430,14 +302440,14 @@ async function detectMultipleInstallations() {
|
|
|
302430
302440
|
}
|
|
302431
302441
|
}
|
|
302432
302442
|
}
|
|
302433
|
-
const nativeBinPath =
|
|
302443
|
+
const nativeBinPath = join80(homedir23(), ".local", "bin", "vivus");
|
|
302434
302444
|
try {
|
|
302435
302445
|
await fs8.stat(nativeBinPath);
|
|
302436
302446
|
installations.push({ type: "native", path: nativeBinPath });
|
|
302437
302447
|
} catch {}
|
|
302438
302448
|
const config3 = getGlobalConfig();
|
|
302439
302449
|
if (config3.installMethod === "native") {
|
|
302440
|
-
const nativeDataPath =
|
|
302450
|
+
const nativeDataPath = join80(homedir23(), ".local", "share", "vivus");
|
|
302441
302451
|
try {
|
|
302442
302452
|
await fs8.stat(nativeDataPath);
|
|
302443
302453
|
if (!installations.some((i2) => i2.type === "native")) {
|
|
@@ -302450,7 +302460,7 @@ async function detectMultipleInstallations() {
|
|
|
302450
302460
|
async function detectConfigurationIssues(type) {
|
|
302451
302461
|
const warnings = [];
|
|
302452
302462
|
try {
|
|
302453
|
-
const raw = await readFile24(
|
|
302463
|
+
const raw = await readFile24(join80(getManagedFilePath(), "managed-settings.json"), "utf-8");
|
|
302454
302464
|
const parsed = jsonParse(raw);
|
|
302455
302465
|
const field = parsed && typeof parsed === "object" ? parsed.strictPluginOnlyCustomization : undefined;
|
|
302456
302466
|
if (field !== undefined && typeof field !== "boolean") {
|
|
@@ -302478,7 +302488,7 @@ async function detectConfigurationIssues(type) {
|
|
|
302478
302488
|
const path15 = process.env.PATH || "";
|
|
302479
302489
|
const pathDirectories = path15.split(delimiter2);
|
|
302480
302490
|
const homeDir = homedir23();
|
|
302481
|
-
const localBinPath =
|
|
302491
|
+
const localBinPath = join80(homeDir, ".local", "bin");
|
|
302482
302492
|
let normalizedLocalBinPath = localBinPath;
|
|
302483
302493
|
if (getPlatform() === "windows") {
|
|
302484
302494
|
normalizedLocalBinPath = localBinPath.split(win323.sep).join(posix5.sep);
|
|
@@ -302572,7 +302582,7 @@ function detectLinuxGlobPatternWarnings() {
|
|
|
302572
302582
|
}
|
|
302573
302583
|
async function getDoctorDiagnostic() {
|
|
302574
302584
|
const installationType = await getCurrentInstallationType();
|
|
302575
|
-
const version2 = typeof MACRO !== "undefined" ? "1.1.
|
|
302585
|
+
const version2 = typeof MACRO !== "undefined" ? "1.1.31+c38c44f" : "unknown";
|
|
302576
302586
|
const installationPath = await getInstallationPath();
|
|
302577
302587
|
const invokedBinary = getInvokedBinary();
|
|
302578
302588
|
const multipleInstallations = await detectMultipleInstallations();
|
|
@@ -302662,7 +302672,7 @@ var init_doctorDiagnostic = __esm(() => {
|
|
|
302662
302672
|
|
|
302663
302673
|
// src/utils/xdg.ts
|
|
302664
302674
|
import { homedir as osHomedir2 } from "os";
|
|
302665
|
-
import { join as
|
|
302675
|
+
import { join as join81 } from "path";
|
|
302666
302676
|
function resolveOptions(options2) {
|
|
302667
302677
|
return {
|
|
302668
302678
|
env: options2?.env ?? process.env,
|
|
@@ -302671,26 +302681,26 @@ function resolveOptions(options2) {
|
|
|
302671
302681
|
}
|
|
302672
302682
|
function getXDGStateHome(options2) {
|
|
302673
302683
|
const { env: env4, home } = resolveOptions(options2);
|
|
302674
|
-
return env4.XDG_STATE_HOME ??
|
|
302684
|
+
return env4.XDG_STATE_HOME ?? join81(home, ".local", "state");
|
|
302675
302685
|
}
|
|
302676
302686
|
function getXDGCacheHome(options2) {
|
|
302677
302687
|
const { env: env4, home } = resolveOptions(options2);
|
|
302678
|
-
return env4.XDG_CACHE_HOME ??
|
|
302688
|
+
return env4.XDG_CACHE_HOME ?? join81(home, ".cache");
|
|
302679
302689
|
}
|
|
302680
302690
|
function getXDGDataHome(options2) {
|
|
302681
302691
|
const { env: env4, home } = resolveOptions(options2);
|
|
302682
|
-
return env4.XDG_DATA_HOME ??
|
|
302692
|
+
return env4.XDG_DATA_HOME ?? join81(home, ".local", "share");
|
|
302683
302693
|
}
|
|
302684
302694
|
function getUserBinDir(options2) {
|
|
302685
302695
|
const { home } = resolveOptions(options2);
|
|
302686
|
-
return
|
|
302696
|
+
return join81(home, ".local", "bin");
|
|
302687
302697
|
}
|
|
302688
302698
|
var init_xdg = () => {};
|
|
302689
302699
|
|
|
302690
302700
|
// src/utils/nativeInstaller/download.ts
|
|
302691
302701
|
import { createHash as createHash18 } from "crypto";
|
|
302692
302702
|
import { chmod as chmod6, writeFile as writeFile19 } from "fs/promises";
|
|
302693
|
-
import { join as
|
|
302703
|
+
import { join as join82 } from "path";
|
|
302694
302704
|
async function getLatestVersionFromArtifactory(tag2 = "latest") {
|
|
302695
302705
|
const startTime = Date.now();
|
|
302696
302706
|
const { stdout, code, stderr } = await execFileNoThrowWithCwd("npm", [
|
|
@@ -302832,8 +302842,8 @@ async function downloadVersionFromArtifactory(version2, stagingPath) {
|
|
|
302832
302842
|
}
|
|
302833
302843
|
}
|
|
302834
302844
|
};
|
|
302835
|
-
writeFileSync_DEPRECATED(
|
|
302836
|
-
writeFileSync_DEPRECATED(
|
|
302845
|
+
writeFileSync_DEPRECATED(join82(stagingPath, "package.json"), jsonStringify(packageJson, null, 2), { encoding: "utf8", flush: true });
|
|
302846
|
+
writeFileSync_DEPRECATED(join82(stagingPath, "package-lock.json"), jsonStringify(packageLock, null, 2), { encoding: "utf8", flush: true });
|
|
302837
302847
|
const result = await execFileNoThrowWithCwd("npm", ["ci", "--prefer-online", "--registry", ARTIFACTORY_REGISTRY_URL], {
|
|
302838
302848
|
timeout: 60000,
|
|
302839
302849
|
preserveOutputOnError: true,
|
|
@@ -302939,7 +302949,7 @@ async function downloadVersionFromBinaryRepo(version2, stagingPath, baseUrl, aut
|
|
|
302939
302949
|
const binaryName = getBinaryName(platform5);
|
|
302940
302950
|
const binaryUrl = `${baseUrl}/${version2}/${platform5}/${binaryName}`;
|
|
302941
302951
|
await fs8.mkdir(stagingPath);
|
|
302942
|
-
const binaryPath =
|
|
302952
|
+
const binaryPath = join82(stagingPath, binaryName);
|
|
302943
302953
|
try {
|
|
302944
302954
|
await downloadAndVerifyBinary(binaryUrl, expectedChecksum, binaryPath, authConfig || {});
|
|
302945
302955
|
const latencyMs = Date.now() - startTime;
|
|
@@ -302992,7 +303002,7 @@ var init_download = __esm(() => {
|
|
|
302992
303002
|
});
|
|
302993
303003
|
|
|
302994
303004
|
// src/utils/nativeInstaller/pidLock.ts
|
|
302995
|
-
import { basename as basename16, join as
|
|
303005
|
+
import { basename as basename16, join as join83 } from "path";
|
|
302996
303006
|
function isPidBasedLockingEnabled() {
|
|
302997
303007
|
const envVar = process.env.ENABLE_PID_BASED_VERSION_LOCKING;
|
|
302998
303008
|
if (isEnvTruthy(envVar)) {
|
|
@@ -303160,7 +303170,7 @@ function getAllLockInfo(locksDir) {
|
|
|
303160
303170
|
try {
|
|
303161
303171
|
const lockFiles = fs8.readdirStringSync(locksDir).filter((f) => f.endsWith(".lock"));
|
|
303162
303172
|
for (const lockFile of lockFiles) {
|
|
303163
|
-
const lockFilePath =
|
|
303173
|
+
const lockFilePath = join83(locksDir, lockFile);
|
|
303164
303174
|
const content = readLockContent(lockFilePath);
|
|
303165
303175
|
if (content) {
|
|
303166
303176
|
lockInfos.push({
|
|
@@ -303187,7 +303197,7 @@ function cleanupStaleLocks(locksDir) {
|
|
|
303187
303197
|
try {
|
|
303188
303198
|
const lockEntries = fs8.readdirStringSync(locksDir).filter((f) => f.endsWith(".lock"));
|
|
303189
303199
|
for (const lockEntry of lockEntries) {
|
|
303190
|
-
const lockFilePath =
|
|
303200
|
+
const lockFilePath = join83(locksDir, lockEntry);
|
|
303191
303201
|
try {
|
|
303192
303202
|
const stats = fs8.lstatSync(lockFilePath);
|
|
303193
303203
|
if (stats.isDirectory()) {
|
|
@@ -303242,7 +303252,7 @@ import {
|
|
|
303242
303252
|
writeFile as writeFile20
|
|
303243
303253
|
} from "fs/promises";
|
|
303244
303254
|
import { homedir as homedir24 } from "os";
|
|
303245
|
-
import { basename as basename17, delimiter as delimiter3, dirname as dirname30, join as
|
|
303255
|
+
import { basename as basename17, delimiter as delimiter3, dirname as dirname30, join as join84, resolve as resolve22 } from "path";
|
|
303246
303256
|
function getPlatform3() {
|
|
303247
303257
|
const os5 = env3.platform;
|
|
303248
303258
|
const arch = process.arch === "x64" ? "x64" : process.arch === "arm64" ? "arm64" : null;
|
|
@@ -303263,10 +303273,10 @@ function getBaseDirectories() {
|
|
|
303263
303273
|
const platform5 = getPlatform3();
|
|
303264
303274
|
const executableName = getBinaryName(platform5);
|
|
303265
303275
|
return {
|
|
303266
|
-
versions:
|
|
303267
|
-
staging:
|
|
303268
|
-
locks:
|
|
303269
|
-
executable:
|
|
303276
|
+
versions: join84(getXDGDataHome(), "vivus", "versions"),
|
|
303277
|
+
staging: join84(getXDGCacheHome(), "vivus", "staging"),
|
|
303278
|
+
locks: join84(getXDGStateHome(), "vivus", "locks"),
|
|
303279
|
+
executable: join84(getUserBinDir(), executableName)
|
|
303270
303280
|
};
|
|
303271
303281
|
}
|
|
303272
303282
|
async function isPossibleVivusBinary(filePath) {
|
|
@@ -303287,14 +303297,14 @@ async function getVersionPaths(version2) {
|
|
|
303287
303297
|
await Promise.all(dirsToCreate.map((dir) => mkdir20(dir, { recursive: true })));
|
|
303288
303298
|
const executableParentDir = dirname30(dirs.executable);
|
|
303289
303299
|
await mkdir20(executableParentDir, { recursive: true });
|
|
303290
|
-
const installPath =
|
|
303300
|
+
const installPath = join84(dirs.versions, version2);
|
|
303291
303301
|
try {
|
|
303292
303302
|
await stat28(installPath);
|
|
303293
303303
|
} catch {
|
|
303294
303304
|
await writeFile20(installPath, "", { encoding: "utf8" });
|
|
303295
303305
|
}
|
|
303296
303306
|
return {
|
|
303297
|
-
stagingPath:
|
|
303307
|
+
stagingPath: join84(dirs.staging, version2),
|
|
303298
303308
|
installPath
|
|
303299
303309
|
};
|
|
303300
303310
|
}
|
|
@@ -303395,7 +303405,7 @@ async function atomicMoveToInstallPath(stagedBinaryPath, installPath) {
|
|
|
303395
303405
|
}
|
|
303396
303406
|
async function installVersionFromPackage(stagingPath, installPath) {
|
|
303397
303407
|
try {
|
|
303398
|
-
const nodeModulesDir =
|
|
303408
|
+
const nodeModulesDir = join84(stagingPath, "node_modules", "@anthropic-ai");
|
|
303399
303409
|
const entries = await readdir16(nodeModulesDir);
|
|
303400
303410
|
const nativePackage = entries.find((entry) => entry.startsWith("vivus-cli-native-"));
|
|
303401
303411
|
if (!nativePackage) {
|
|
@@ -303406,7 +303416,7 @@ async function installVersionFromPackage(stagingPath, installPath) {
|
|
|
303406
303416
|
const error41 = new Error("Could not find platform-specific native package");
|
|
303407
303417
|
throw error41;
|
|
303408
303418
|
}
|
|
303409
|
-
const stagedBinaryPath =
|
|
303419
|
+
const stagedBinaryPath = join84(nodeModulesDir, nativePackage, "cli");
|
|
303410
303420
|
try {
|
|
303411
303421
|
await stat28(stagedBinaryPath);
|
|
303412
303422
|
} catch {
|
|
@@ -303436,7 +303446,7 @@ async function installVersionFromBinary(stagingPath, installPath) {
|
|
|
303436
303446
|
try {
|
|
303437
303447
|
const platform5 = getPlatform3();
|
|
303438
303448
|
const binaryName = getBinaryName(platform5);
|
|
303439
|
-
const stagedBinaryPath =
|
|
303449
|
+
const stagedBinaryPath = join84(stagingPath, binaryName);
|
|
303440
303450
|
try {
|
|
303441
303451
|
await stat28(stagedBinaryPath);
|
|
303442
303452
|
} catch {
|
|
@@ -303505,8 +303515,8 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
|
|
|
303505
303515
|
const maxVersion = await getMaxVersion();
|
|
303506
303516
|
if (maxVersion && gt(version2, maxVersion)) {
|
|
303507
303517
|
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.
|
|
303518
|
+
if (gte("1.1.31+c38c44f", maxVersion)) {
|
|
303519
|
+
logForDebugging(`Native installer: current version ${"1.1.31+c38c44f"} is already at or above maxVersion ${maxVersion}, skipping update`);
|
|
303510
303520
|
logEvent("tengu_native_update_skipped_max_version", {
|
|
303511
303521
|
latency_ms: Date.now() - startTime,
|
|
303512
303522
|
max_version: maxVersion,
|
|
@@ -303517,7 +303527,7 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
|
|
|
303517
303527
|
version2 = maxVersion;
|
|
303518
303528
|
}
|
|
303519
303529
|
}
|
|
303520
|
-
if (!forceReinstall && version2 === "1.1.
|
|
303530
|
+
if (!forceReinstall && version2 === "1.1.31+c38c44f" && await versionIsAvailable(version2) && await isPossibleVivusBinary(executablePath)) {
|
|
303521
303531
|
logForDebugging(`Found ${version2} at ${executablePath}, skipping install`);
|
|
303522
303532
|
logEvent("tengu_native_update_complete", {
|
|
303523
303533
|
latency_ms: Date.now() - startTime,
|
|
@@ -303836,7 +303846,7 @@ async function getVersionFromSymlink(symlinkPath) {
|
|
|
303836
303846
|
}
|
|
303837
303847
|
function getLockFilePathFromVersionPath(dirs, versionPath) {
|
|
303838
303848
|
const versionName = basename17(versionPath);
|
|
303839
|
-
return
|
|
303849
|
+
return join84(dirs.locks, `${versionName}.lock`);
|
|
303840
303850
|
}
|
|
303841
303851
|
async function lockCurrentVersion() {
|
|
303842
303852
|
const dirs = getBaseDirectories();
|
|
@@ -303930,7 +303940,7 @@ async function cleanupOldVersions() {
|
|
|
303930
303940
|
if (!/^vivus\.exe\.old\.\d+$/.test(file2))
|
|
303931
303941
|
continue;
|
|
303932
303942
|
try {
|
|
303933
|
-
await unlink12(
|
|
303943
|
+
await unlink12(join84(executableDir, file2));
|
|
303934
303944
|
cleanedCount++;
|
|
303935
303945
|
} catch {}
|
|
303936
303946
|
}
|
|
@@ -303947,7 +303957,7 @@ async function cleanupOldVersions() {
|
|
|
303947
303957
|
const stagingEntries = await readdir16(dirs.staging);
|
|
303948
303958
|
let stagingCleanedCount = 0;
|
|
303949
303959
|
for (const entry of stagingEntries) {
|
|
303950
|
-
const stagingPath =
|
|
303960
|
+
const stagingPath = join84(dirs.staging, entry);
|
|
303951
303961
|
try {
|
|
303952
303962
|
const stats = await stat28(stagingPath);
|
|
303953
303963
|
if (stats.mtime.getTime() < oneHourAgo) {
|
|
@@ -303989,7 +303999,7 @@ async function cleanupOldVersions() {
|
|
|
303989
303999
|
const versionFiles = [];
|
|
303990
304000
|
let tempFilesCleanedCount = 0;
|
|
303991
304001
|
for (const entry of versionEntries) {
|
|
303992
|
-
const entryPath =
|
|
304002
|
+
const entryPath = join84(dirs.versions, entry);
|
|
303993
304003
|
if (/\.tmp\.\d+\.\d+$/.test(entry)) {
|
|
303994
304004
|
try {
|
|
303995
304005
|
const stats = await stat28(entryPath);
|
|
@@ -304181,9 +304191,9 @@ async function manualRemoveNpmPackage(packageName) {
|
|
|
304181
304191
|
}
|
|
304182
304192
|
}
|
|
304183
304193
|
if (getPlatform3().startsWith("win32")) {
|
|
304184
|
-
const binCmd =
|
|
304185
|
-
const binPs1 =
|
|
304186
|
-
const binExe =
|
|
304194
|
+
const binCmd = join84(globalPrefix, "vivus.cmd");
|
|
304195
|
+
const binPs1 = join84(globalPrefix, "vivus.ps1");
|
|
304196
|
+
const binExe = join84(globalPrefix, "vivus");
|
|
304187
304197
|
if (await tryRemove(binCmd, "bin script")) {
|
|
304188
304198
|
manuallyRemoved = true;
|
|
304189
304199
|
}
|
|
@@ -304194,14 +304204,14 @@ async function manualRemoveNpmPackage(packageName) {
|
|
|
304194
304204
|
manuallyRemoved = true;
|
|
304195
304205
|
}
|
|
304196
304206
|
} else {
|
|
304197
|
-
const binSymlink =
|
|
304207
|
+
const binSymlink = join84(globalPrefix, "bin", "vivus");
|
|
304198
304208
|
if (await tryRemove(binSymlink, "bin symlink")) {
|
|
304199
304209
|
manuallyRemoved = true;
|
|
304200
304210
|
}
|
|
304201
304211
|
}
|
|
304202
304212
|
if (manuallyRemoved) {
|
|
304203
304213
|
logForDebugging(`Successfully removed ${packageName} manually`);
|
|
304204
|
-
const nodeModulesPath = getPlatform3().startsWith("win32") ?
|
|
304214
|
+
const nodeModulesPath = getPlatform3().startsWith("win32") ? join84(globalPrefix, "node_modules", packageName) : join84(globalPrefix, "lib", "node_modules", packageName);
|
|
304205
304215
|
return {
|
|
304206
304216
|
success: true,
|
|
304207
304217
|
warning: `${packageName} executables removed, but node_modules directory was left intact for safety. You may manually delete it later at: ${nodeModulesPath}`
|
|
@@ -304260,7 +304270,7 @@ async function cleanupNpmInstallations() {
|
|
|
304260
304270
|
errors4.push(codePackageResult.error);
|
|
304261
304271
|
}
|
|
304262
304272
|
if ("") {}
|
|
304263
|
-
const localInstallDir =
|
|
304273
|
+
const localInstallDir = join84(homedir24(), ".vivus", "local");
|
|
304264
304274
|
try {
|
|
304265
304275
|
await rm5(localInstallDir, { recursive: true });
|
|
304266
304276
|
removed++;
|
|
@@ -305179,7 +305189,7 @@ function extractBashCommentLabel(command) {
|
|
|
305179
305189
|
|
|
305180
305190
|
// src/utils/plugins/lspPluginIntegration.ts
|
|
305181
305191
|
import { readFile as readFile25 } from "fs/promises";
|
|
305182
|
-
import { join as
|
|
305192
|
+
import { join as join85, relative as relative7, resolve as resolve23 } from "path";
|
|
305183
305193
|
function validatePathWithinPlugin(pluginPath, relativePath) {
|
|
305184
305194
|
const resolvedPluginPath = resolve23(pluginPath);
|
|
305185
305195
|
const resolvedFilePath = resolve23(pluginPath, relativePath);
|
|
@@ -305191,7 +305201,7 @@ function validatePathWithinPlugin(pluginPath, relativePath) {
|
|
|
305191
305201
|
}
|
|
305192
305202
|
async function loadPluginLspServers(plugin, errors4 = []) {
|
|
305193
305203
|
const servers = {};
|
|
305194
|
-
const lspJsonPath =
|
|
305204
|
+
const lspJsonPath = join85(plugin.path, ".lsp.json");
|
|
305195
305205
|
try {
|
|
305196
305206
|
const content = await readFile25(lspJsonPath, "utf-8");
|
|
305197
305207
|
const parsed = jsonParse(content);
|
|
@@ -309675,7 +309685,7 @@ function checkTeamMemSecrets(filePath, content) {
|
|
|
309675
309685
|
|
|
309676
309686
|
// src/utils/gitDiff.ts
|
|
309677
309687
|
import { access as access5, readFile as readFile26 } from "fs/promises";
|
|
309678
|
-
import { dirname as dirname31, join as
|
|
309688
|
+
import { dirname as dirname31, join as join86, relative as relative8, sep as sep12 } from "path";
|
|
309679
309689
|
async function fetchGitDiff() {
|
|
309680
309690
|
const isGit = await getIsGit();
|
|
309681
309691
|
if (!isGit)
|
|
@@ -309826,7 +309836,7 @@ async function isInTransientGitState() {
|
|
|
309826
309836
|
"CHERRY_PICK_HEAD",
|
|
309827
309837
|
"REVERT_HEAD"
|
|
309828
309838
|
];
|
|
309829
|
-
const results = await Promise.all(transientFiles.map((file2) => access5(
|
|
309839
|
+
const results = await Promise.all(transientFiles.map((file2) => access5(join86(gitDir, file2)).then(() => true).catch(() => false)));
|
|
309830
309840
|
return results.some(Boolean);
|
|
309831
309841
|
}
|
|
309832
309842
|
async function fetchUntrackedFiles(maxFiles) {
|
|
@@ -313076,9 +313086,9 @@ var init_FileWriteTool = __esm(() => {
|
|
|
313076
313086
|
});
|
|
313077
313087
|
|
|
313078
313088
|
// src/utils/plugins/orphanedPluginFilter.ts
|
|
313079
|
-
import { dirname as dirname34, isAbsolute as isAbsolute15, join as
|
|
313089
|
+
import { dirname as dirname34, isAbsolute as isAbsolute15, join as join87, normalize as normalize12, relative as relative11, sep as sep15 } from "path";
|
|
313080
313090
|
async function getGlobExclusionsForPluginCache(searchPath) {
|
|
313081
|
-
const cachePath = normalize12(
|
|
313091
|
+
const cachePath = normalize12(join87(getPluginsDirectory(), "cache"));
|
|
313082
313092
|
if (searchPath && !pathsOverlap(searchPath, cachePath)) {
|
|
313083
313093
|
return [];
|
|
313084
313094
|
}
|
|
@@ -313126,7 +313136,7 @@ var init_orphanedPluginFilter = __esm(() => {
|
|
|
313126
313136
|
});
|
|
313127
313137
|
|
|
313128
313138
|
// src/utils/glob.ts
|
|
313129
|
-
import { basename as basename19, dirname as dirname35, isAbsolute as isAbsolute16, join as
|
|
313139
|
+
import { basename as basename19, dirname as dirname35, isAbsolute as isAbsolute16, join as join88, sep as sep16 } from "path";
|
|
313130
313140
|
function extractGlobBaseDirectory(pattern) {
|
|
313131
313141
|
const globChars = /[*?[{]/;
|
|
313132
313142
|
const match = pattern.match(globChars);
|
|
@@ -313178,7 +313188,7 @@ async function glob(filePattern, cwd2, { limit, offset }, abortSignal, toolPermi
|
|
|
313178
313188
|
args.push("--glob", exclusion);
|
|
313179
313189
|
}
|
|
313180
313190
|
const allPaths = await ripGrep2(args, searchDir, abortSignal);
|
|
313181
|
-
const absolutePaths = allPaths.map((p) => isAbsolute16(p) ? p :
|
|
313191
|
+
const absolutePaths = allPaths.map((p) => isAbsolute16(p) ? p : join88(searchDir, p));
|
|
313182
313192
|
const truncated = absolutePaths.length > offset + limit;
|
|
313183
313193
|
const files = absolutePaths.slice(offset, offset + limit);
|
|
313184
313194
|
return { files, truncated };
|
|
@@ -336928,7 +336938,7 @@ __export(exports_teamHelpers, {
|
|
|
336928
336938
|
});
|
|
336929
336939
|
import { mkdirSync as mkdirSync4, readFileSync as readFileSync11, writeFileSync as writeFileSync3 } from "fs";
|
|
336930
336940
|
import { mkdir as mkdir21, readFile as readFile27, rm as rm6, writeFile as writeFile21 } from "fs/promises";
|
|
336931
|
-
import { join as
|
|
336941
|
+
import { join as join89 } from "path";
|
|
336932
336942
|
function sanitizeName(name) {
|
|
336933
336943
|
return name.replace(/[^a-zA-Z0-9]/g, "-").toLowerCase();
|
|
336934
336944
|
}
|
|
@@ -336936,10 +336946,10 @@ function sanitizeAgentName(name) {
|
|
|
336936
336946
|
return name.replace(/@/g, "-");
|
|
336937
336947
|
}
|
|
336938
336948
|
function getTeamDir(teamName) {
|
|
336939
|
-
return
|
|
336949
|
+
return join89(getTeamsDir(), sanitizeName(teamName));
|
|
336940
336950
|
}
|
|
336941
336951
|
function getTeamFilePath(teamName) {
|
|
336942
|
-
return
|
|
336952
|
+
return join89(getTeamDir(teamName), "config.json");
|
|
336943
336953
|
}
|
|
336944
336954
|
function readTeamFile(teamName) {
|
|
336945
336955
|
try {
|
|
@@ -337130,15 +337140,15 @@ async function setMemberActive(teamName, memberName, isActive) {
|
|
|
337130
337140
|
logForDebugging(`[TeammateTool] Set member ${memberName} in team ${teamName} to ${isActive ? "active" : "idle"}`);
|
|
337131
337141
|
}
|
|
337132
337142
|
async function destroyWorktree(worktreePath) {
|
|
337133
|
-
const gitFilePath =
|
|
337143
|
+
const gitFilePath = join89(worktreePath, ".git");
|
|
337134
337144
|
let mainRepoPath = null;
|
|
337135
337145
|
try {
|
|
337136
337146
|
const gitFileContent = (await readFile27(gitFilePath, "utf-8")).trim();
|
|
337137
337147
|
const match = gitFileContent.match(/^gitdir:\s*(.+)$/);
|
|
337138
337148
|
if (match && match[1]) {
|
|
337139
337149
|
const worktreeGitDir = match[1];
|
|
337140
|
-
const mainGitDir =
|
|
337141
|
-
mainRepoPath =
|
|
337150
|
+
const mainGitDir = join89(worktreeGitDir, "..", "..");
|
|
337151
|
+
mainRepoPath = join89(mainGitDir, "..");
|
|
337142
337152
|
}
|
|
337143
337153
|
} catch {}
|
|
337144
337154
|
if (mainRepoPath) {
|
|
@@ -338885,7 +338895,7 @@ var init_attachments = __esm(() => {
|
|
|
338885
338895
|
});
|
|
338886
338896
|
|
|
338887
338897
|
// src/utils/plugins/loadPluginCommands.ts
|
|
338888
|
-
import { basename as basename23, dirname as dirname37, join as
|
|
338898
|
+
import { basename as basename23, dirname as dirname37, join as join90 } from "path";
|
|
338889
338899
|
function isSkillFile(filePath) {
|
|
338890
338900
|
return /^skill\.md$/i.test(basename23(filePath));
|
|
338891
338901
|
}
|
|
@@ -339064,7 +339074,7 @@ function clearPluginCommandCache() {
|
|
|
339064
339074
|
async function loadSkillsFromDirectory(skillsPath, pluginName, sourceName, pluginManifest, pluginPath, loadedPaths) {
|
|
339065
339075
|
const fs8 = getFsImplementation();
|
|
339066
339076
|
const skills = [];
|
|
339067
|
-
const directSkillPath =
|
|
339077
|
+
const directSkillPath = join90(skillsPath, "SKILL.md");
|
|
339068
339078
|
let directSkillContent = null;
|
|
339069
339079
|
try {
|
|
339070
339080
|
directSkillContent = await fs8.readFile(directSkillPath, {
|
|
@@ -339115,8 +339125,8 @@ async function loadSkillsFromDirectory(skillsPath, pluginName, sourceName, plugi
|
|
|
339115
339125
|
if (!entry.isDirectory() && !entry.isSymbolicLink()) {
|
|
339116
339126
|
return;
|
|
339117
339127
|
}
|
|
339118
|
-
const skillDirPath =
|
|
339119
|
-
const skillFilePath =
|
|
339128
|
+
const skillDirPath = join90(skillsPath, entry.name);
|
|
339129
|
+
const skillFilePath = join90(skillDirPath, "SKILL.md");
|
|
339120
339130
|
let content;
|
|
339121
339131
|
try {
|
|
339122
339132
|
content = await fs8.readFile(skillFilePath, { encoding: "utf-8" });
|
|
@@ -339220,7 +339230,7 @@ var init_loadPluginCommands = __esm(() => {
|
|
|
339220
339230
|
if (plugin.commandsMetadata) {
|
|
339221
339231
|
for (const [name, metadata] of Object.entries(plugin.commandsMetadata)) {
|
|
339222
339232
|
if (metadata.source) {
|
|
339223
|
-
const fullMetadataPath =
|
|
339233
|
+
const fullMetadataPath = join90(plugin.path, metadata.source);
|
|
339224
339234
|
if (commandPath === fullMetadataPath) {
|
|
339225
339235
|
commandName = `${plugin.name}:${name}`;
|
|
339226
339236
|
metadataOverride = metadata;
|
|
@@ -339462,7 +339472,7 @@ var init_loadPluginOutputStyles = __esm(() => {
|
|
|
339462
339472
|
|
|
339463
339473
|
// src/utils/plugins/cacheUtils.ts
|
|
339464
339474
|
import { readdir as readdir18, rm as rm7, stat as stat30, unlink as unlink13, writeFile as writeFile22 } from "fs/promises";
|
|
339465
|
-
import { join as
|
|
339475
|
+
import { join as join91 } from "path";
|
|
339466
339476
|
function clearAllPluginCaches() {
|
|
339467
339477
|
clearPluginCache();
|
|
339468
339478
|
clearPluginCommandCache();
|
|
@@ -339499,11 +339509,11 @@ async function cleanupOrphanedPluginVersionsInBackground() {
|
|
|
339499
339509
|
const now2 = Date.now();
|
|
339500
339510
|
await Promise.all([...installedVersions].map((p) => removeOrphanedAtMarker(p)));
|
|
339501
339511
|
for (const marketplace of await readSubdirs(cachePath)) {
|
|
339502
|
-
const marketplacePath =
|
|
339512
|
+
const marketplacePath = join91(cachePath, marketplace);
|
|
339503
339513
|
for (const plugin of await readSubdirs(marketplacePath)) {
|
|
339504
|
-
const pluginPath =
|
|
339514
|
+
const pluginPath = join91(marketplacePath, plugin);
|
|
339505
339515
|
for (const version2 of await readSubdirs(pluginPath)) {
|
|
339506
|
-
const versionPath =
|
|
339516
|
+
const versionPath = join91(pluginPath, version2);
|
|
339507
339517
|
if (installedVersions.has(versionPath))
|
|
339508
339518
|
continue;
|
|
339509
339519
|
await processOrphanedPluginVersion(versionPath, now2);
|
|
@@ -339517,7 +339527,7 @@ async function cleanupOrphanedPluginVersionsInBackground() {
|
|
|
339517
339527
|
}
|
|
339518
339528
|
}
|
|
339519
339529
|
function getOrphanedAtPath(versionPath) {
|
|
339520
|
-
return
|
|
339530
|
+
return join91(versionPath, ORPHANED_AT_FILENAME2);
|
|
339521
339531
|
}
|
|
339522
339532
|
async function removeOrphanedAtMarker(versionPath) {
|
|
339523
339533
|
const orphanedAtPath = getOrphanedAtPath(versionPath);
|
|
@@ -339607,7 +339617,7 @@ var init_cacheUtils = __esm(() => {
|
|
|
339607
339617
|
|
|
339608
339618
|
// src/utils/plugins/officialMarketplaceGcs.ts
|
|
339609
339619
|
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
|
|
339620
|
+
import { dirname as dirname38, join as join92, resolve as resolve29, sep as sep18 } from "path";
|
|
339611
339621
|
async function fetchOfficialMarketplaceFromGcs(installLocation, marketplacesCacheDir) {
|
|
339612
339622
|
const cacheDir = resolve29(marketplacesCacheDir);
|
|
339613
339623
|
const resolvedLoc = resolve29(installLocation);
|
|
@@ -339630,7 +339640,7 @@ async function fetchOfficialMarketplaceFromGcs(installLocation, marketplacesCach
|
|
|
339630
339640
|
if (!sha) {
|
|
339631
339641
|
throw new Error("latest pointer returned empty body");
|
|
339632
339642
|
}
|
|
339633
|
-
const sentinelPath =
|
|
339643
|
+
const sentinelPath = join92(installLocation, ".gcs-sha");
|
|
339634
339644
|
const currentSha = await readFile28(sentinelPath, "utf8").then((s) => s.trim(), () => null);
|
|
339635
339645
|
if (currentSha === sha) {
|
|
339636
339646
|
outcome = "noop";
|
|
@@ -339653,7 +339663,7 @@ async function fetchOfficialMarketplaceFromGcs(installLocation, marketplacesCach
|
|
|
339653
339663
|
const rel = arcPath.slice(ARC_PREFIX.length);
|
|
339654
339664
|
if (!rel || rel.endsWith("/"))
|
|
339655
339665
|
continue;
|
|
339656
|
-
const dest =
|
|
339666
|
+
const dest = join92(staging, rel);
|
|
339657
339667
|
await mkdir22(dirname38(dest), { recursive: true });
|
|
339658
339668
|
await writeFile23(dest, data);
|
|
339659
339669
|
const mode = modes[arcPath];
|
|
@@ -339661,7 +339671,7 @@ async function fetchOfficialMarketplaceFromGcs(installLocation, marketplacesCach
|
|
|
339661
339671
|
await chmod8(dest, mode & 511).catch(() => {});
|
|
339662
339672
|
}
|
|
339663
339673
|
}
|
|
339664
|
-
await writeFile23(
|
|
339674
|
+
await writeFile23(join92(staging, ".gcs-sha"), sha);
|
|
339665
339675
|
await rm8(installLocation, { recursive: true, force: true });
|
|
339666
339676
|
await rename6(staging, installLocation);
|
|
339667
339677
|
outcome = "updated";
|
|
@@ -339728,12 +339738,12 @@ var init_officialMarketplaceGcs = __esm(() => {
|
|
|
339728
339738
|
|
|
339729
339739
|
// src/utils/plugins/marketplaceManager.ts
|
|
339730
339740
|
import { writeFile as writeFile24 } from "fs/promises";
|
|
339731
|
-
import { basename as basename25, dirname as dirname39, isAbsolute as isAbsolute19, join as
|
|
339741
|
+
import { basename as basename25, dirname as dirname39, isAbsolute as isAbsolute19, join as join93, resolve as resolve30, sep as sep19 } from "path";
|
|
339732
339742
|
function getKnownMarketplacesFile() {
|
|
339733
|
-
return
|
|
339743
|
+
return join93(getPluginsDirectory(), "known_marketplaces.json");
|
|
339734
339744
|
}
|
|
339735
339745
|
function getMarketplacesCacheDir() {
|
|
339736
|
-
return
|
|
339746
|
+
return join93(getPluginsDirectory(), "marketplaces");
|
|
339737
339747
|
}
|
|
339738
339748
|
function clearMarketplacesCache() {
|
|
339739
339749
|
getMarketplace.cache?.clear?.();
|
|
@@ -339820,7 +339830,7 @@ async function saveKnownMarketplacesConfig(config3) {
|
|
|
339820
339830
|
throw new ConfigParseError(`Invalid marketplace config: ${parsed.error.message}`, configFile, config3);
|
|
339821
339831
|
}
|
|
339822
339832
|
const fs8 = getFsImplementation();
|
|
339823
|
-
const dir =
|
|
339833
|
+
const dir = join93(configFile, "..");
|
|
339824
339834
|
await fs8.mkdir(dir);
|
|
339825
339835
|
writeFileSync_DEPRECATED(configFile, jsonStringify(parsed.data, null, 2), {
|
|
339826
339836
|
encoding: "utf-8",
|
|
@@ -339867,7 +339877,7 @@ async function registerSeedMarketplaces() {
|
|
|
339867
339877
|
return false;
|
|
339868
339878
|
}
|
|
339869
339879
|
async function readSeedKnownMarketplaces(seedDir) {
|
|
339870
|
-
const seedJsonPath =
|
|
339880
|
+
const seedJsonPath = join93(seedDir, "known_marketplaces.json");
|
|
339871
339881
|
try {
|
|
339872
339882
|
const content = await getFsImplementation().readFile(seedJsonPath, {
|
|
339873
339883
|
encoding: "utf-8"
|
|
@@ -339886,8 +339896,8 @@ async function readSeedKnownMarketplaces(seedDir) {
|
|
|
339886
339896
|
}
|
|
339887
339897
|
}
|
|
339888
339898
|
async function findSeedMarketplaceLocation(seedDir, name) {
|
|
339889
|
-
const dirCandidate =
|
|
339890
|
-
const jsonCandidate =
|
|
339899
|
+
const dirCandidate = join93(seedDir, "marketplaces", name);
|
|
339900
|
+
const jsonCandidate = join93(seedDir, "marketplaces", `${name}.json`);
|
|
339891
339901
|
for (const candidate of [dirCandidate, jsonCandidate]) {
|
|
339892
339902
|
try {
|
|
339893
339903
|
await readCachedMarketplace(candidate);
|
|
@@ -339939,7 +339949,7 @@ async function gitPull(cwd2, ref, options2) {
|
|
|
339939
339949
|
async function gitSubmoduleUpdate(cwd2, credentialArgs, env4, sparsePaths) {
|
|
339940
339950
|
if (sparsePaths && sparsePaths.length > 0)
|
|
339941
339951
|
return;
|
|
339942
|
-
const hasGitmodules = await getFsImplementation().stat(
|
|
339952
|
+
const hasGitmodules = await getFsImplementation().stat(join93(cwd2, ".gitmodules")).then(() => true, () => false);
|
|
339943
339953
|
if (!hasGitmodules)
|
|
339944
339954
|
return;
|
|
339945
339955
|
const result = await execFileNoThrowWithCwd(gitExe(), [
|
|
@@ -340301,7 +340311,7 @@ Technical details: ${error41.message}`);
|
|
|
340301
340311
|
}
|
|
340302
340312
|
logPluginFetch("marketplace_url", url3, "success", performance.now() - fetchStarted);
|
|
340303
340313
|
safeCallProgress(onProgress, "Saving marketplace to cache");
|
|
340304
|
-
const cacheDir =
|
|
340314
|
+
const cacheDir = join93(cachePath, "..");
|
|
340305
340315
|
await fs8.mkdir(cacheDir);
|
|
340306
340316
|
writeFileSync_DEPRECATED(cachePath, jsonStringify(result.data, null, 2), {
|
|
340307
340317
|
encoding: "utf-8",
|
|
@@ -340338,7 +340348,7 @@ async function loadAndCacheMarketplace(source, onProgress) {
|
|
|
340338
340348
|
try {
|
|
340339
340349
|
switch (source.source) {
|
|
340340
340350
|
case "url": {
|
|
340341
|
-
temporaryCachePath =
|
|
340351
|
+
temporaryCachePath = join93(cacheDir, `${tempName}.json`);
|
|
340342
340352
|
cleanupNeeded = true;
|
|
340343
340353
|
await cacheMarketplaceFromUrl(source.url, temporaryCachePath, source.headers, onProgress);
|
|
340344
340354
|
marketplacePath = temporaryCachePath;
|
|
@@ -340347,7 +340357,7 @@ async function loadAndCacheMarketplace(source, onProgress) {
|
|
|
340347
340357
|
case "github": {
|
|
340348
340358
|
const sshUrl = `git@github.com:${source.repo}.git`;
|
|
340349
340359
|
const httpsUrl = `https://github.com/${source.repo}.git`;
|
|
340350
|
-
temporaryCachePath =
|
|
340360
|
+
temporaryCachePath = join93(cacheDir, tempName);
|
|
340351
340361
|
cleanupNeeded = true;
|
|
340352
340362
|
let lastError = null;
|
|
340353
340363
|
const sshConfigured = await isGitHubSshLikelyConfigured();
|
|
@@ -340392,14 +340402,14 @@ async function loadAndCacheMarketplace(source, onProgress) {
|
|
|
340392
340402
|
if (lastError) {
|
|
340393
340403
|
throw lastError;
|
|
340394
340404
|
}
|
|
340395
|
-
marketplacePath =
|
|
340405
|
+
marketplacePath = join93(temporaryCachePath, source.path || ".vivus-plugin/marketplace.json");
|
|
340396
340406
|
break;
|
|
340397
340407
|
}
|
|
340398
340408
|
case "git": {
|
|
340399
|
-
temporaryCachePath =
|
|
340409
|
+
temporaryCachePath = join93(cacheDir, tempName);
|
|
340400
340410
|
cleanupNeeded = true;
|
|
340401
340411
|
await cacheMarketplaceFromGit(source.url, temporaryCachePath, source.ref, source.sparsePaths, onProgress);
|
|
340402
|
-
marketplacePath =
|
|
340412
|
+
marketplacePath = join93(temporaryCachePath, source.path || ".vivus-plugin/marketplace.json");
|
|
340403
340413
|
break;
|
|
340404
340414
|
}
|
|
340405
340415
|
case "npm": {
|
|
@@ -340414,8 +340424,8 @@ async function loadAndCacheMarketplace(source, onProgress) {
|
|
|
340414
340424
|
}
|
|
340415
340425
|
case "directory": {
|
|
340416
340426
|
const absPath = resolve30(source.path);
|
|
340417
|
-
const vivusPath =
|
|
340418
|
-
const claudePath =
|
|
340427
|
+
const vivusPath = join93(absPath, ".vivus-plugin", "marketplace.json");
|
|
340428
|
+
const claudePath = join93(absPath, ".claude-plugin", "marketplace.json");
|
|
340419
340429
|
try {
|
|
340420
340430
|
await fs8.stat(vivusPath);
|
|
340421
340431
|
marketplacePath = vivusPath;
|
|
@@ -340427,8 +340437,8 @@ async function loadAndCacheMarketplace(source, onProgress) {
|
|
|
340427
340437
|
break;
|
|
340428
340438
|
}
|
|
340429
340439
|
case "settings": {
|
|
340430
|
-
temporaryCachePath =
|
|
340431
|
-
marketplacePath =
|
|
340440
|
+
temporaryCachePath = join93(cacheDir, source.name);
|
|
340441
|
+
marketplacePath = join93(temporaryCachePath, ".vivus-plugin", "marketplace.json");
|
|
340432
340442
|
cleanupNeeded = false;
|
|
340433
340443
|
await fs8.mkdir(dirname39(marketplacePath));
|
|
340434
340444
|
await writeFile24(marketplacePath, jsonStringify({
|
|
@@ -340463,7 +340473,7 @@ async function loadAndCacheMarketplace(source, onProgress) {
|
|
|
340463
340473
|
}
|
|
340464
340474
|
throw new Error(`Failed to parse marketplace file at ${marketplacePath}: ${errorMessage(e)}`);
|
|
340465
340475
|
}
|
|
340466
|
-
const finalCachePath =
|
|
340476
|
+
const finalCachePath = join93(cacheDir, marketplace.name);
|
|
340467
340477
|
const resolvedFinal = resolve30(finalCachePath);
|
|
340468
340478
|
const resolvedCacheDir = resolve30(cacheDir);
|
|
340469
340479
|
if (!resolvedFinal.startsWith(resolvedCacheDir + sep19)) {
|
|
@@ -340584,9 +340594,9 @@ async function removeMarketplaceSource(name) {
|
|
|
340584
340594
|
await saveKnownMarketplacesConfig(config3);
|
|
340585
340595
|
const fs8 = getFsImplementation();
|
|
340586
340596
|
const cacheDir = getMarketplacesCacheDir();
|
|
340587
|
-
const cachePath =
|
|
340597
|
+
const cachePath = join93(cacheDir, name);
|
|
340588
340598
|
await fs8.rm(cachePath, { recursive: true, force: true });
|
|
340589
|
-
const jsonCachePath =
|
|
340599
|
+
const jsonCachePath = join93(cacheDir, `${name}.json`);
|
|
340590
340600
|
await fs8.rm(jsonCachePath, { force: true });
|
|
340591
340601
|
const editableSources = ["userSettings", "projectSettings", "localSettings"];
|
|
340592
340602
|
for (const source of editableSources) {
|
|
@@ -340637,7 +340647,7 @@ async function removeMarketplaceSource(name) {
|
|
|
340637
340647
|
logForDebugging(`Removed marketplace source: ${name}`);
|
|
340638
340648
|
}
|
|
340639
340649
|
async function readCachedMarketplace(installLocation) {
|
|
340640
|
-
const nestedPath =
|
|
340650
|
+
const nestedPath = join93(installLocation, ".vivus-plugin", "marketplace.json");
|
|
340641
340651
|
try {
|
|
340642
340652
|
return await parseFileWithSchema(nestedPath, PluginMarketplaceSchema());
|
|
340643
340653
|
} catch (e) {
|
|
@@ -340647,7 +340657,7 @@ async function readCachedMarketplace(installLocation) {
|
|
|
340647
340657
|
if (code !== "ENOENT" && code !== "ENOTDIR")
|
|
340648
340658
|
throw e;
|
|
340649
340659
|
}
|
|
340650
|
-
const claudePath =
|
|
340660
|
+
const claudePath = join93(installLocation, ".claude-plugin", "marketplace.json");
|
|
340651
340661
|
try {
|
|
340652
340662
|
return await parseFileWithSchema(claudePath, PluginMarketplaceSchema());
|
|
340653
340663
|
} catch (e) {
|
|
@@ -340947,12 +340957,12 @@ var init_marketplaceManager = __esm(() => {
|
|
|
340947
340957
|
});
|
|
340948
340958
|
|
|
340949
340959
|
// src/utils/plugins/installedPluginsManager.ts
|
|
340950
|
-
import { dirname as dirname40, join as
|
|
340960
|
+
import { dirname as dirname40, join as join94 } from "path";
|
|
340951
340961
|
function getInstalledPluginsFilePath() {
|
|
340952
|
-
return
|
|
340962
|
+
return join94(getPluginsDirectory(), "installed_plugins.json");
|
|
340953
340963
|
}
|
|
340954
340964
|
function getInstalledPluginsV2FilePath() {
|
|
340955
|
-
return
|
|
340965
|
+
return join94(getPluginsDirectory(), "installed_plugins_v2.json");
|
|
340956
340966
|
}
|
|
340957
340967
|
function migrateToSinglePluginFile() {
|
|
340958
340968
|
if (migrationCompleted) {
|
|
@@ -341020,12 +341030,12 @@ function cleanupLegacyCache(v2Data) {
|
|
|
341020
341030
|
continue;
|
|
341021
341031
|
}
|
|
341022
341032
|
const entry = dirent.name;
|
|
341023
|
-
const entryPath =
|
|
341033
|
+
const entryPath = join94(cachePath, entry);
|
|
341024
341034
|
const subEntries = fs8.readdirSync(entryPath);
|
|
341025
341035
|
const hasVersionedStructure = subEntries.some((subDirent) => {
|
|
341026
341036
|
if (!subDirent.isDirectory())
|
|
341027
341037
|
return false;
|
|
341028
|
-
const subPath =
|
|
341038
|
+
const subPath = join94(entryPath, subDirent.name);
|
|
341029
341039
|
const versionEntries = fs8.readdirSync(subPath);
|
|
341030
341040
|
return versionEntries.some((vDirent) => vDirent.isDirectory());
|
|
341031
341041
|
});
|
|
@@ -341280,7 +341290,7 @@ async function getGitCommitSha2(dirPath) {
|
|
|
341280
341290
|
}
|
|
341281
341291
|
function getPluginVersionFromManifest(pluginCachePath, pluginId) {
|
|
341282
341292
|
const fs8 = getFsImplementation();
|
|
341283
|
-
const manifestPath =
|
|
341293
|
+
const manifestPath = join94(pluginCachePath, ".vivus-plugin", "plugin.json");
|
|
341284
341294
|
try {
|
|
341285
341295
|
const manifestContent = fs8.readFileSync(manifestPath, { encoding: "utf-8" });
|
|
341286
341296
|
const manifest = jsonParse(manifestContent);
|
|
@@ -341374,13 +341384,13 @@ async function migrateFromEnabledPlugins() {
|
|
|
341374
341384
|
let version2 = "unknown";
|
|
341375
341385
|
let gitCommitSha = undefined;
|
|
341376
341386
|
if (typeof entry.source === "string") {
|
|
341377
|
-
installPath =
|
|
341387
|
+
installPath = join94(marketplaceInstallLocation, entry.source);
|
|
341378
341388
|
version2 = getPluginVersionFromManifest(installPath, pluginId);
|
|
341379
341389
|
gitCommitSha = await getGitCommitSha2(installPath);
|
|
341380
341390
|
} else {
|
|
341381
341391
|
const cachePath = getPluginCachePath();
|
|
341382
341392
|
const sanitizedName = pluginName.replace(/[^a-zA-Z0-9-_]/g, "-");
|
|
341383
|
-
const pluginCachePath =
|
|
341393
|
+
const pluginCachePath = join94(cachePath, sanitizedName);
|
|
341384
341394
|
let dirEntries;
|
|
341385
341395
|
try {
|
|
341386
341396
|
dirEntries = (await getFsImplementation().readdir(pluginCachePath)).map((e) => typeof e === "string" ? e : e.name);
|
|
@@ -341738,7 +341748,7 @@ __export(exports_commitAttribution, {
|
|
|
341738
341748
|
});
|
|
341739
341749
|
import { createHash as createHash19, randomUUID as randomUUID16 } from "crypto";
|
|
341740
341750
|
import { stat as stat31 } from "fs/promises";
|
|
341741
|
-
import { isAbsolute as isAbsolute20, join as
|
|
341751
|
+
import { isAbsolute as isAbsolute20, join as join95, relative as relative15, sep as sep21 } from "path";
|
|
341742
341752
|
function getAttributionRepoRoot() {
|
|
341743
341753
|
const cwd2 = getCwd();
|
|
341744
341754
|
return findGitRoot(cwd2) ?? getOriginalCwd();
|
|
@@ -341817,7 +341827,7 @@ function expandFilePath(filePath) {
|
|
|
341817
341827
|
if (isAbsolute20(filePath)) {
|
|
341818
341828
|
return filePath;
|
|
341819
341829
|
}
|
|
341820
|
-
return
|
|
341830
|
+
return join95(getAttributionRepoRoot(), filePath);
|
|
341821
341831
|
}
|
|
341822
341832
|
function createEmptyAttributionState() {
|
|
341823
341833
|
return {
|
|
@@ -341975,7 +341985,7 @@ async function calculateCommitAttribution(states, stagedFiles) {
|
|
|
341975
341985
|
if (isGeneratedFile(file2)) {
|
|
341976
341986
|
return { type: "generated", file: file2 };
|
|
341977
341987
|
}
|
|
341978
|
-
const absPath =
|
|
341988
|
+
const absPath = join95(cwd2, file2);
|
|
341979
341989
|
const fileState = mergedFileStates.get(file2);
|
|
341980
341990
|
const baseline = mergedBaselines.get(file2);
|
|
341981
341991
|
const fileSurface = states[0].surface;
|
|
@@ -342117,7 +342127,7 @@ async function isGitTransientState() {
|
|
|
342117
342127
|
];
|
|
342118
342128
|
const results = await Promise.all(indicators.map(async (indicator) => {
|
|
342119
342129
|
try {
|
|
342120
|
-
await stat31(
|
|
342130
|
+
await stat31(join95(gitDir, indicator));
|
|
342121
342131
|
return true;
|
|
342122
342132
|
} catch {
|
|
342123
342133
|
return false;
|
|
@@ -352254,16 +352264,16 @@ import {
|
|
|
352254
352264
|
basename as basename28,
|
|
352255
352265
|
dirname as dirname41,
|
|
352256
352266
|
isAbsolute as isAbsolute22,
|
|
352257
|
-
join as
|
|
352267
|
+
join as join96,
|
|
352258
352268
|
sep as pathSep,
|
|
352259
352269
|
relative as relative16
|
|
352260
352270
|
} from "path";
|
|
352261
352271
|
function getSkillsPath(source, dir) {
|
|
352262
352272
|
switch (source) {
|
|
352263
352273
|
case "policySettings":
|
|
352264
|
-
return
|
|
352274
|
+
return join96(getManagedFilePath(), ".vivus", dir);
|
|
352265
352275
|
case "userSettings":
|
|
352266
|
-
return
|
|
352276
|
+
return join96(getVivusConfigHomeDir(), dir);
|
|
352267
352277
|
case "projectSettings":
|
|
352268
352278
|
return `.vivus/${dir}`;
|
|
352269
352279
|
case "plugin":
|
|
@@ -352433,8 +352443,8 @@ async function loadSkillsFromSkillsDir(basePath, source) {
|
|
|
352433
352443
|
if (!entry.isDirectory() && !entry.isSymbolicLink()) {
|
|
352434
352444
|
return null;
|
|
352435
352445
|
}
|
|
352436
|
-
const skillDirPath =
|
|
352437
|
-
const skillFilePath =
|
|
352446
|
+
const skillDirPath = join96(basePath, entry.name);
|
|
352447
|
+
const skillFilePath = join96(skillDirPath, "SKILL.md");
|
|
352438
352448
|
let content;
|
|
352439
352449
|
try {
|
|
352440
352450
|
content = await fs8.readFile(skillFilePath, { encoding: "utf-8" });
|
|
@@ -352589,7 +352599,7 @@ async function discoverSkillDirsForPaths(filePaths, cwd2) {
|
|
|
352589
352599
|
for (const filePath of filePaths) {
|
|
352590
352600
|
let currentDir = dirname41(filePath);
|
|
352591
352601
|
while (currentDir.startsWith(resolvedCwd + pathSep)) {
|
|
352592
|
-
const skillDir =
|
|
352602
|
+
const skillDir = join96(currentDir, ".vivus", "skills");
|
|
352593
352603
|
if (!dynamicSkillDirs.has(skillDir)) {
|
|
352594
352604
|
dynamicSkillDirs.add(skillDir);
|
|
352595
352605
|
try {
|
|
@@ -352712,8 +352722,8 @@ var init_loadSkillsDir = __esm(() => {
|
|
|
352712
352722
|
init_types2();
|
|
352713
352723
|
import_ignore = __toESM(require_ignore(), 1);
|
|
352714
352724
|
getSkillDirCommands = memoize_default(async (cwd2) => {
|
|
352715
|
-
const userSkillsDir =
|
|
352716
|
-
const managedSkillsDir =
|
|
352725
|
+
const userSkillsDir = join96(getVivusConfigHomeDir(), "skills");
|
|
352726
|
+
const managedSkillsDir = join96(getManagedFilePath(), ".vivus", "skills");
|
|
352717
352727
|
const projectSkillsDirs = getProjectDirsUpToHome("skills", cwd2);
|
|
352718
352728
|
logForDebugging(`Loading skills from: managed=${managedSkillsDir}, user=${userSkillsDir}, project=[${projectSkillsDirs.join(", ")}]`);
|
|
352719
352729
|
const additionalDirs = getAdditionalDirectoriesForVivusMd();
|
|
@@ -352724,7 +352734,7 @@ var init_loadSkillsDir = __esm(() => {
|
|
|
352724
352734
|
logForDebugging(`[bare] Skipping skill dir discovery (${additionalDirs.length === 0 ? "no --add-dir" : "projectSettings disabled or skillsLocked"})`);
|
|
352725
352735
|
return [];
|
|
352726
352736
|
}
|
|
352727
|
-
const additionalSkillsNested2 = await Promise.all(additionalDirs.map((dir) => loadSkillsFromSkillsDir(
|
|
352737
|
+
const additionalSkillsNested2 = await Promise.all(additionalDirs.map((dir) => loadSkillsFromSkillsDir(join96(dir, ".vivus", "skills"), "projectSettings")));
|
|
352728
352738
|
return additionalSkillsNested2.flat().map((s) => s.skill);
|
|
352729
352739
|
}
|
|
352730
352740
|
const [
|
|
@@ -352737,7 +352747,7 @@ var init_loadSkillsDir = __esm(() => {
|
|
|
352737
352747
|
isEnvTruthy(process.env.VIVUS_CODE_DISABLE_POLICY_SKILLS) ? Promise.resolve([]) : loadSkillsFromSkillsDir(managedSkillsDir, "policySettings"),
|
|
352738
352748
|
isSettingSourceEnabled("userSettings") && !skillsLocked ? loadSkillsFromSkillsDir(userSkillsDir, "userSettings") : Promise.resolve([]),
|
|
352739
352749
|
projectSettingsEnabled ? Promise.all(projectSkillsDirs.map((dir) => loadSkillsFromSkillsDir(dir, "projectSettings"))) : Promise.resolve([]),
|
|
352740
|
-
projectSettingsEnabled ? Promise.all(additionalDirs.map((dir) => loadSkillsFromSkillsDir(
|
|
352750
|
+
projectSettingsEnabled ? Promise.all(additionalDirs.map((dir) => loadSkillsFromSkillsDir(join96(dir, ".vivus", "skills"), "projectSettings"))) : Promise.resolve([]),
|
|
352741
352751
|
skillsLocked ? Promise.resolve([]) : loadSkillsFromCommandsDir(cwd2)
|
|
352742
352752
|
]);
|
|
352743
352753
|
const allSkillsWithPaths = [
|
|
@@ -353845,7 +353855,7 @@ var init_toolSearch = __esm(() => {
|
|
|
353845
353855
|
// src/services/vcr.ts
|
|
353846
353856
|
import { createHash as createHash20, randomUUID as randomUUID18 } from "crypto";
|
|
353847
353857
|
import { mkdir as mkdir23, readFile as readFile29, writeFile as writeFile25 } from "fs/promises";
|
|
353848
|
-
import { dirname as dirname42, join as
|
|
353858
|
+
import { dirname as dirname42, join as join97 } from "path";
|
|
353849
353859
|
function shouldUseVCR() {
|
|
353850
353860
|
if (false) {}
|
|
353851
353861
|
if (process.env.USER_TYPE === "ant" && isEnvTruthy(process.env.FORCE_VCR)) {
|
|
@@ -353858,7 +353868,7 @@ async function withFixture(input, fixtureName, f) {
|
|
|
353858
353868
|
return await f();
|
|
353859
353869
|
}
|
|
353860
353870
|
const hash2 = createHash20("sha1").update(jsonStringify(input)).digest("hex").slice(0, 12);
|
|
353861
|
-
const filename =
|
|
353871
|
+
const filename = join97(process.env.VIVUS_CODE_TEST_FIXTURES_ROOT ?? getCwd(), `fixtures/${fixtureName}-${hash2}.json`);
|
|
353862
353872
|
try {
|
|
353863
353873
|
const cached3 = jsonParse(await readFile29(filename, { encoding: "utf8" }));
|
|
353864
353874
|
return cached3;
|
|
@@ -353892,7 +353902,7 @@ async function withVCR(messages, f) {
|
|
|
353892
353902
|
return true;
|
|
353893
353903
|
}));
|
|
353894
353904
|
const dehydratedInput = mapMessages(messagesForAPI.map((_) => _.message.content), dehydrateValue);
|
|
353895
|
-
const filename =
|
|
353905
|
+
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
353906
|
try {
|
|
353897
353907
|
const cached3 = jsonParse(await readFile29(filename, { encoding: "utf8" }));
|
|
353898
353908
|
cached3.output.forEach(addCachedCostToTotalSessionCost);
|
|
@@ -354618,7 +354628,7 @@ var init_postCompactCleanup = __esm(() => {
|
|
|
354618
354628
|
|
|
354619
354629
|
// src/services/SessionMemory/prompts.ts
|
|
354620
354630
|
import { readFile as readFile30 } from "fs/promises";
|
|
354621
|
-
import { join as
|
|
354631
|
+
import { join as join98 } from "path";
|
|
354622
354632
|
function getDefaultUpdatePrompt() {
|
|
354623
354633
|
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
354634
|
|
|
@@ -354659,7 +354669,7 @@ You ONLY update the actual content that comes AFTER these two preserved lines. T
|
|
|
354659
354669
|
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
354670
|
}
|
|
354661
354671
|
async function loadSessionMemoryTemplate() {
|
|
354662
|
-
const templatePath =
|
|
354672
|
+
const templatePath = join98(getVivusConfigHomeDir(), "session-memory", "config", "template.md");
|
|
354663
354673
|
try {
|
|
354664
354674
|
return await readFile30(templatePath, { encoding: "utf-8" });
|
|
354665
354675
|
} catch (e) {
|
|
@@ -354672,7 +354682,7 @@ async function loadSessionMemoryTemplate() {
|
|
|
354672
354682
|
}
|
|
354673
354683
|
}
|
|
354674
354684
|
async function loadSessionMemoryPrompt() {
|
|
354675
|
-
const promptPath =
|
|
354685
|
+
const promptPath = join98(getVivusConfigHomeDir(), "session-memory", "config", "prompt.md");
|
|
354676
354686
|
try {
|
|
354677
354687
|
return await readFile30(promptPath, { encoding: "utf-8" });
|
|
354678
354688
|
} catch (e) {
|
|
@@ -357948,7 +357958,7 @@ var init_consolidationPrompt = __esm(() => {
|
|
|
357948
357958
|
|
|
357949
357959
|
// src/utils/listSessionsImpl.ts
|
|
357950
357960
|
import { readdir as readdir19, stat as stat33 } from "fs/promises";
|
|
357951
|
-
import { basename as basename29, join as
|
|
357961
|
+
import { basename as basename29, join as join99 } from "path";
|
|
357952
357962
|
async function listCandidates(projectDir, doStat, projectPath) {
|
|
357953
357963
|
let names;
|
|
357954
357964
|
try {
|
|
@@ -357962,7 +357972,7 @@ async function listCandidates(projectDir, doStat, projectPath) {
|
|
|
357962
357972
|
const sessionId = validateUuid(name.slice(0, -6));
|
|
357963
357973
|
if (!sessionId)
|
|
357964
357974
|
return null;
|
|
357965
|
-
const filePath =
|
|
357975
|
+
const filePath = join99(projectDir, name);
|
|
357966
357976
|
if (!doStat)
|
|
357967
357977
|
return { sessionId, filePath, mtime: 0, projectPath };
|
|
357968
357978
|
try {
|
|
@@ -357981,9 +357991,9 @@ var init_listSessionsImpl = __esm(() => {
|
|
|
357981
357991
|
|
|
357982
357992
|
// src/services/autoDream/consolidationLock.ts
|
|
357983
357993
|
import { mkdir as mkdir24, readFile as readFile31, stat as stat34, unlink as unlink14, utimes, writeFile as writeFile26 } from "fs/promises";
|
|
357984
|
-
import { join as
|
|
357994
|
+
import { join as join100 } from "path";
|
|
357985
357995
|
function lockPath() {
|
|
357986
|
-
return
|
|
357996
|
+
return join100(getAutoMemPath(), LOCK_FILE);
|
|
357987
357997
|
}
|
|
357988
357998
|
async function readLastConsolidatedAt() {
|
|
357989
357999
|
try {
|
|
@@ -359435,7 +359445,7 @@ function getAnthropicEnvMetadata() {
|
|
|
359435
359445
|
function getBuildAgeMinutes() {
|
|
359436
359446
|
if (false)
|
|
359437
359447
|
;
|
|
359438
|
-
const buildTime = new Date("2026-06-23T19:
|
|
359448
|
+
const buildTime = new Date("2026-06-23T19:29:51.252Z").getTime();
|
|
359439
359449
|
if (isNaN(buildTime))
|
|
359440
359450
|
return;
|
|
359441
359451
|
return Math.floor((Date.now() - buildTime) / 60000);
|
|
@@ -360894,12 +360904,12 @@ var init_queryHelpers = __esm(() => {
|
|
|
360894
360904
|
import { randomUUID as randomUUID21 } from "crypto";
|
|
360895
360905
|
import { rm as rm9 } from "fs";
|
|
360896
360906
|
import { appendFile as appendFile5, copyFile as copyFile8, mkdir as mkdir25 } from "fs/promises";
|
|
360897
|
-
import { dirname as dirname43, isAbsolute as isAbsolute23, join as
|
|
360907
|
+
import { dirname as dirname43, isAbsolute as isAbsolute23, join as join101, relative as relative17 } from "path";
|
|
360898
360908
|
function safeRemoveOverlay(overlayPath) {
|
|
360899
360909
|
rm9(overlayPath, { recursive: true, force: true, maxRetries: 3, retryDelay: 100 }, () => {});
|
|
360900
360910
|
}
|
|
360901
360911
|
function getOverlayPath(id) {
|
|
360902
|
-
return
|
|
360912
|
+
return join101(getVivusTempDir(), "speculation", String(process.pid), id);
|
|
360903
360913
|
}
|
|
360904
360914
|
function denySpeculation(message, reason) {
|
|
360905
360915
|
return {
|
|
@@ -360911,8 +360921,8 @@ function denySpeculation(message, reason) {
|
|
|
360911
360921
|
async function copyOverlayToMain(overlayPath, writtenPaths, cwd2) {
|
|
360912
360922
|
let allCopied = true;
|
|
360913
360923
|
for (const rel of writtenPaths) {
|
|
360914
|
-
const src =
|
|
360915
|
-
const dest =
|
|
360924
|
+
const src = join101(overlayPath, rel);
|
|
360925
|
+
const dest = join101(cwd2, rel);
|
|
360916
360926
|
try {
|
|
360917
360927
|
await mkdir25(dirname43(dest), { recursive: true });
|
|
360918
360928
|
await copyFile8(src, dest);
|
|
@@ -361162,17 +361172,17 @@ async function startSpeculation(suggestionText, context, setAppState, isPipeline
|
|
|
361162
361172
|
}
|
|
361163
361173
|
if (isWriteTool) {
|
|
361164
361174
|
if (!writtenPathsRef.current.has(rel)) {
|
|
361165
|
-
const overlayFile =
|
|
361175
|
+
const overlayFile = join101(overlayPath, rel);
|
|
361166
361176
|
await mkdir25(dirname43(overlayFile), { recursive: true });
|
|
361167
361177
|
try {
|
|
361168
|
-
await copyFile8(
|
|
361178
|
+
await copyFile8(join101(cwd2, rel), overlayFile);
|
|
361169
361179
|
} catch {}
|
|
361170
361180
|
writtenPathsRef.current.add(rel);
|
|
361171
361181
|
}
|
|
361172
|
-
input = { ...input, [pathKey2]:
|
|
361182
|
+
input = { ...input, [pathKey2]: join101(overlayPath, rel) };
|
|
361173
361183
|
} else {
|
|
361174
361184
|
if (writtenPathsRef.current.has(rel)) {
|
|
361175
|
-
input = { ...input, [pathKey2]:
|
|
361185
|
+
input = { ...input, [pathKey2]: join101(overlayPath, rel) };
|
|
361176
361186
|
}
|
|
361177
361187
|
}
|
|
361178
361188
|
logForDebugging(`[Speculation] ${isWriteTool ? "Write" : "Read"} ${filePath} -> ${input[pathKey2]}`);
|
|
@@ -363405,10 +363415,10 @@ var init_filesApi = __esm(() => {
|
|
|
363405
363415
|
// src/utils/tempfile.ts
|
|
363406
363416
|
import { createHash as createHash22, randomUUID as randomUUID23 } from "crypto";
|
|
363407
363417
|
import { tmpdir as tmpdir7 } from "os";
|
|
363408
|
-
import { join as
|
|
363418
|
+
import { join as join103 } from "path";
|
|
363409
363419
|
function generateTempFilePath(prefix = "vivus-prompt", extension2 = ".md", options2) {
|
|
363410
363420
|
const id = options2?.contentHash ? createHash22("sha256").update(options2.contentHash).digest("hex").slice(0, 16) : randomUUID23();
|
|
363411
|
-
return
|
|
363421
|
+
return join103(tmpdir7(), `${prefix}-${id}${extension2}`);
|
|
363412
363422
|
}
|
|
363413
363423
|
var init_tempfile = () => {};
|
|
363414
363424
|
|
|
@@ -384399,14 +384409,14 @@ var require_turndown_cjs = __commonJS((exports, module) => {
|
|
|
384399
384409
|
} else if (node.nodeType === 1) {
|
|
384400
384410
|
replacement = replacementForNode.call(self2, node);
|
|
384401
384411
|
}
|
|
384402
|
-
return
|
|
384412
|
+
return join104(output, replacement);
|
|
384403
384413
|
}, "");
|
|
384404
384414
|
}
|
|
384405
384415
|
function postProcess(output) {
|
|
384406
384416
|
var self2 = this;
|
|
384407
384417
|
this.rules.forEach(function(rule) {
|
|
384408
384418
|
if (typeof rule.append === "function") {
|
|
384409
|
-
output =
|
|
384419
|
+
output = join104(output, rule.append(self2.options));
|
|
384410
384420
|
}
|
|
384411
384421
|
});
|
|
384412
384422
|
return output.replace(/^[\t\r\n]+/, "").replace(/[\t\r\n\s]+$/, "");
|
|
@@ -384419,7 +384429,7 @@ var require_turndown_cjs = __commonJS((exports, module) => {
|
|
|
384419
384429
|
content = content.trim();
|
|
384420
384430
|
return whitespace.leading + rule.replacement(content, node, this.options) + whitespace.trailing;
|
|
384421
384431
|
}
|
|
384422
|
-
function
|
|
384432
|
+
function join104(output, replacement) {
|
|
384423
384433
|
var s1 = trimTrailingNewlines(output);
|
|
384424
384434
|
var s2 = trimLeadingNewlines(replacement);
|
|
384425
384435
|
var nls = Math.max(output.length - s1.length, replacement.length - s2.length);
|
|
@@ -391852,9 +391862,9 @@ var init_TeamDeleteTool = __esm(() => {
|
|
|
391852
391862
|
|
|
391853
391863
|
// src/utils/concurrentSessions.ts
|
|
391854
391864
|
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
|
|
391865
|
+
import { join as join104 } from "path";
|
|
391856
391866
|
function getSessionsDir() {
|
|
391857
|
-
return
|
|
391867
|
+
return join104(getVivusConfigHomeDir(), "sessions");
|
|
391858
391868
|
}
|
|
391859
391869
|
function envSessionKind() {
|
|
391860
391870
|
if (false) {}
|
|
@@ -391865,7 +391875,7 @@ async function registerSession() {
|
|
|
391865
391875
|
return false;
|
|
391866
391876
|
const kind = envSessionKind() ?? "interactive";
|
|
391867
391877
|
const dir = getSessionsDir();
|
|
391868
|
-
const pidFile =
|
|
391878
|
+
const pidFile = join104(dir, `${process.pid}.json`);
|
|
391869
391879
|
registerCleanup(async () => {
|
|
391870
391880
|
try {
|
|
391871
391881
|
await unlink16(pidFile);
|
|
@@ -391894,7 +391904,7 @@ async function registerSession() {
|
|
|
391894
391904
|
}
|
|
391895
391905
|
}
|
|
391896
391906
|
async function updatePidFile(patch) {
|
|
391897
|
-
const pidFile =
|
|
391907
|
+
const pidFile = join104(getSessionsDir(), `${process.pid}.json`);
|
|
391898
391908
|
try {
|
|
391899
391909
|
const data = jsonParse(await readFile33(pidFile, "utf8"));
|
|
391900
391910
|
await writeFile29(pidFile, jsonStringify({ ...data, ...patch }));
|
|
@@ -391933,7 +391943,7 @@ async function countConcurrentSessions() {
|
|
|
391933
391943
|
if (isProcessRunning(pid)) {
|
|
391934
391944
|
count4++;
|
|
391935
391945
|
} else if (getPlatform() !== "wsl") {
|
|
391936
|
-
unlink16(
|
|
391946
|
+
unlink16(join104(dir, file2)).catch(() => {});
|
|
391937
391947
|
}
|
|
391938
391948
|
}
|
|
391939
391949
|
return count4;
|
|
@@ -393536,7 +393546,7 @@ var init_permissionSetup = __esm(() => {
|
|
|
393536
393546
|
import { statSync as statSync6 } from "fs";
|
|
393537
393547
|
import { lstat as lstat5, readdir as readdir21, readFile as readFile34, realpath as realpath11, stat as stat37 } from "fs/promises";
|
|
393538
393548
|
import { homedir as homedir28 } from "os";
|
|
393539
|
-
import { dirname as dirname45, join as
|
|
393549
|
+
import { dirname as dirname45, join as join105, resolve as resolve35, sep as sep24 } from "path";
|
|
393540
393550
|
function extractDescriptionFromMarkdown(content, defaultDescription = "Custom item") {
|
|
393541
393551
|
const lines = content.split(`
|
|
393542
393552
|
`);
|
|
@@ -393626,7 +393636,7 @@ function getProjectDirsUpToHome(subdir, cwd2) {
|
|
|
393626
393636
|
if (normalizePathForComparison(current) === normalizePathForComparison(home)) {
|
|
393627
393637
|
break;
|
|
393628
393638
|
}
|
|
393629
|
-
const vivusSubdir =
|
|
393639
|
+
const vivusSubdir = join105(current, ".vivus", subdir);
|
|
393630
393640
|
try {
|
|
393631
393641
|
statSync6(vivusSubdir);
|
|
393632
393642
|
dirs.push(vivusSubdir);
|
|
@@ -393673,7 +393683,7 @@ async function findMarkdownFilesNative(dir, signal) {
|
|
|
393673
393683
|
if (signal.aborted) {
|
|
393674
393684
|
break;
|
|
393675
393685
|
}
|
|
393676
|
-
const fullPath =
|
|
393686
|
+
const fullPath = join105(currentDir, entry.name);
|
|
393677
393687
|
try {
|
|
393678
393688
|
if (entry.isSymbolicLink()) {
|
|
393679
393689
|
try {
|
|
@@ -393759,16 +393769,16 @@ var init_markdownConfigLoader = __esm(() => {
|
|
|
393759
393769
|
];
|
|
393760
393770
|
loadMarkdownFilesForSubdir = memoize_default(async function(subdir, cwd2) {
|
|
393761
393771
|
const searchStartTime = Date.now();
|
|
393762
|
-
const userDir =
|
|
393763
|
-
const managedDir =
|
|
393772
|
+
const userDir = join105(getVivusConfigHomeDir(), subdir);
|
|
393773
|
+
const managedDir = join105(getManagedFilePath(), ".vivus", subdir);
|
|
393764
393774
|
const projectDirs = getProjectDirsUpToHome(subdir, cwd2);
|
|
393765
393775
|
const gitRoot = findGitRoot(cwd2);
|
|
393766
393776
|
const canonicalRoot = findCanonicalGitRoot(cwd2);
|
|
393767
393777
|
if (gitRoot && canonicalRoot && canonicalRoot !== gitRoot) {
|
|
393768
|
-
const worktreeSubdir = normalizePathForComparison(
|
|
393778
|
+
const worktreeSubdir = normalizePathForComparison(join105(gitRoot, ".vivus", subdir));
|
|
393769
393779
|
const worktreeHasSubdir = projectDirs.some((dir) => normalizePathForComparison(dir) === worktreeSubdir);
|
|
393770
393780
|
if (!worktreeHasSubdir) {
|
|
393771
|
-
const mainVivusSubdir =
|
|
393781
|
+
const mainVivusSubdir = join105(canonicalRoot, ".vivus", subdir);
|
|
393772
393782
|
if (!projectDirs.includes(mainVivusSubdir)) {
|
|
393773
393783
|
projectDirs.push(mainVivusSubdir);
|
|
393774
393784
|
}
|
|
@@ -401080,7 +401090,7 @@ import {
|
|
|
401080
401090
|
symlink as symlink5,
|
|
401081
401091
|
utimes as utimes2
|
|
401082
401092
|
} from "fs/promises";
|
|
401083
|
-
import { basename as basename33, dirname as dirname46, join as
|
|
401093
|
+
import { basename as basename33, dirname as dirname46, join as join106 } from "path";
|
|
401084
401094
|
function validateWorktreeSlug(slug) {
|
|
401085
401095
|
if (slug.length > MAX_WORKTREE_SLUG_LENGTH) {
|
|
401086
401096
|
throw new Error(`Invalid worktree name: must be ${MAX_WORKTREE_SLUG_LENGTH} characters or fewer (got ${slug.length})`);
|
|
@@ -401103,8 +401113,8 @@ async function symlinkDirectories(repoRootPath, worktreePath, dirsToSymlink) {
|
|
|
401103
401113
|
logForDebugging(`Skipping symlink for "${dir}": path traversal detected`, { level: "warn" });
|
|
401104
401114
|
continue;
|
|
401105
401115
|
}
|
|
401106
|
-
const sourcePath =
|
|
401107
|
-
const destPath =
|
|
401116
|
+
const sourcePath = join106(repoRootPath, dir);
|
|
401117
|
+
const destPath = join106(worktreePath, dir);
|
|
401108
401118
|
try {
|
|
401109
401119
|
await symlink5(sourcePath, destPath, "dir");
|
|
401110
401120
|
logForDebugging(`Symlinked ${dir} from main repository to worktree to avoid disk bloat`);
|
|
@@ -401128,7 +401138,7 @@ function generateTmuxSessionName(repoPath, branch) {
|
|
|
401128
401138
|
return combined.replace(/[/.]/g, "_");
|
|
401129
401139
|
}
|
|
401130
401140
|
function worktreesDir(repoRoot) {
|
|
401131
|
-
return
|
|
401141
|
+
return join106(repoRoot, ".vivus", "worktrees");
|
|
401132
401142
|
}
|
|
401133
401143
|
function flattenSlug(slug) {
|
|
401134
401144
|
return slug.replaceAll("/", "+");
|
|
@@ -401137,7 +401147,7 @@ function worktreeBranchName(slug) {
|
|
|
401137
401147
|
return `worktree-${flattenSlug(slug)}`;
|
|
401138
401148
|
}
|
|
401139
401149
|
function worktreePathFor(repoRoot, slug) {
|
|
401140
|
-
return
|
|
401150
|
+
return join106(worktreesDir(repoRoot), flattenSlug(slug));
|
|
401141
401151
|
}
|
|
401142
401152
|
async function getOrCreateWorktree(repoRoot, slug, options2) {
|
|
401143
401153
|
const worktreePath = worktreePathFor(repoRoot, slug);
|
|
@@ -401218,7 +401228,7 @@ async function getOrCreateWorktree(repoRoot, slug, options2) {
|
|
|
401218
401228
|
async function copyWorktreeIncludeFiles(repoRoot, worktreePath) {
|
|
401219
401229
|
let includeContent;
|
|
401220
401230
|
try {
|
|
401221
|
-
includeContent = await readFile35(
|
|
401231
|
+
includeContent = await readFile35(join106(repoRoot, ".worktreeinclude"), "utf-8");
|
|
401222
401232
|
} catch {
|
|
401223
401233
|
return [];
|
|
401224
401234
|
}
|
|
@@ -401273,8 +401283,8 @@ async function copyWorktreeIncludeFiles(repoRoot, worktreePath) {
|
|
|
401273
401283
|
}
|
|
401274
401284
|
const copied = [];
|
|
401275
401285
|
for (const relativePath of files) {
|
|
401276
|
-
const srcPath =
|
|
401277
|
-
const destPath =
|
|
401286
|
+
const srcPath = join106(repoRoot, relativePath);
|
|
401287
|
+
const destPath = join106(worktreePath, relativePath);
|
|
401278
401288
|
try {
|
|
401279
401289
|
await mkdir28(dirname46(destPath), { recursive: true });
|
|
401280
401290
|
await copyFile9(srcPath, destPath);
|
|
@@ -401290,9 +401300,9 @@ async function copyWorktreeIncludeFiles(repoRoot, worktreePath) {
|
|
|
401290
401300
|
}
|
|
401291
401301
|
async function performPostCreationSetup(repoRoot, worktreePath) {
|
|
401292
401302
|
const localSettingsRelativePath = getRelativeSettingsFilePathForSource("localSettings");
|
|
401293
|
-
const sourceSettingsLocal =
|
|
401303
|
+
const sourceSettingsLocal = join106(repoRoot, localSettingsRelativePath);
|
|
401294
401304
|
try {
|
|
401295
|
-
const destSettingsLocal =
|
|
401305
|
+
const destSettingsLocal = join106(worktreePath, localSettingsRelativePath);
|
|
401296
401306
|
await mkdirRecursive(dirname46(destSettingsLocal));
|
|
401297
401307
|
await copyFile9(sourceSettingsLocal, destSettingsLocal);
|
|
401298
401308
|
logForDebugging(`Copied settings.local.json to worktree: ${destSettingsLocal}`);
|
|
@@ -401302,8 +401312,8 @@ async function performPostCreationSetup(repoRoot, worktreePath) {
|
|
|
401302
401312
|
logForDebugging(`Failed to copy settings.local.json: ${e.message}`, { level: "warn" });
|
|
401303
401313
|
}
|
|
401304
401314
|
}
|
|
401305
|
-
const huskyPath =
|
|
401306
|
-
const gitHooksPath =
|
|
401315
|
+
const huskyPath = join106(repoRoot, ".husky");
|
|
401316
|
+
const gitHooksPath = join106(repoRoot, ".git", "hooks");
|
|
401307
401317
|
let hooksPath = null;
|
|
401308
401318
|
for (const candidatePath of [huskyPath, gitHooksPath]) {
|
|
401309
401319
|
try {
|
|
@@ -401578,7 +401588,7 @@ async function cleanupStaleAgentWorktrees(cutoffDate) {
|
|
|
401578
401588
|
if (!EPHEMERAL_WORKTREE_PATTERNS.some((p) => p.test(slug))) {
|
|
401579
401589
|
continue;
|
|
401580
401590
|
}
|
|
401581
|
-
const worktreePath =
|
|
401591
|
+
const worktreePath = join106(dir, slug);
|
|
401582
401592
|
if (currentPath === worktreePath) {
|
|
401583
401593
|
continue;
|
|
401584
401594
|
}
|
|
@@ -405789,7 +405799,7 @@ var init_permissions2 = __esm(() => {
|
|
|
405789
405799
|
// src/utils/permissions/filesystem.ts
|
|
405790
405800
|
import { randomBytes as randomBytes17 } from "crypto";
|
|
405791
405801
|
import { homedir as homedir29, tmpdir as tmpdir8 } from "os";
|
|
405792
|
-
import { join as
|
|
405802
|
+
import { join as join107, normalize as normalize14, posix as posix8, sep as sep25 } from "path";
|
|
405793
405803
|
function normalizeCaseForComparison2(path19) {
|
|
405794
405804
|
return path19.toLowerCase();
|
|
405795
405805
|
}
|
|
@@ -405798,11 +405808,11 @@ function getVivusSkillScope(filePath) {
|
|
|
405798
405808
|
const absolutePathLower = normalizeCaseForComparison2(absolutePath);
|
|
405799
405809
|
const bases = [
|
|
405800
405810
|
{
|
|
405801
|
-
dir: expandPath(
|
|
405811
|
+
dir: expandPath(join107(getOriginalCwd(), ".vivus", "skills")),
|
|
405802
405812
|
prefix: "/.vivus/skills/"
|
|
405803
405813
|
},
|
|
405804
405814
|
{
|
|
405805
|
-
dir: expandPath(
|
|
405815
|
+
dir: expandPath(join107(homedir29(), ".vivus", "skills")),
|
|
405806
405816
|
prefix: "~/.vivus/skills/"
|
|
405807
405817
|
}
|
|
405808
405818
|
];
|
|
@@ -405857,21 +405867,21 @@ function isVivusConfigFilePath(filePath) {
|
|
|
405857
405867
|
if (isVivusSettingsPath(filePath)) {
|
|
405858
405868
|
return true;
|
|
405859
405869
|
}
|
|
405860
|
-
const commandsDir =
|
|
405861
|
-
const agentsDir =
|
|
405862
|
-
const skillsDir =
|
|
405870
|
+
const commandsDir = join107(getOriginalCwd(), ".vivus", "commands");
|
|
405871
|
+
const agentsDir = join107(getOriginalCwd(), ".vivus", "agents");
|
|
405872
|
+
const skillsDir = join107(getOriginalCwd(), ".vivus", "skills");
|
|
405863
405873
|
return pathInWorkingPath(filePath, commandsDir) || pathInWorkingPath(filePath, agentsDir) || pathInWorkingPath(filePath, skillsDir);
|
|
405864
405874
|
}
|
|
405865
405875
|
function isSessionPlanFile(absolutePath) {
|
|
405866
|
-
const expectedPrefix =
|
|
405876
|
+
const expectedPrefix = join107(getPlansDirectory(), getPlanSlug());
|
|
405867
405877
|
const normalizedPath = normalize14(absolutePath);
|
|
405868
405878
|
return normalizedPath.startsWith(expectedPrefix) && normalizedPath.endsWith(".md");
|
|
405869
405879
|
}
|
|
405870
405880
|
function getSessionMemoryDir() {
|
|
405871
|
-
return
|
|
405881
|
+
return join107(getProjectDir2(getCwd()), getSessionId(), "session-memory") + sep25;
|
|
405872
405882
|
}
|
|
405873
405883
|
function getSessionMemoryPath() {
|
|
405874
|
-
return
|
|
405884
|
+
return join107(getSessionMemoryDir(), "summary.md");
|
|
405875
405885
|
}
|
|
405876
405886
|
function isSessionMemoryPath(absolutePath) {
|
|
405877
405887
|
const normalizedPath = normalize14(absolutePath);
|
|
@@ -405893,10 +405903,10 @@ function getVivusTempDirName() {
|
|
|
405893
405903
|
return `vivus-${uid}`;
|
|
405894
405904
|
}
|
|
405895
405905
|
function getProjectTempDir() {
|
|
405896
|
-
return
|
|
405906
|
+
return join107(getVivusTempDir(), sanitizePath2(getOriginalCwd())) + sep25;
|
|
405897
405907
|
}
|
|
405898
405908
|
function getScratchpadDir() {
|
|
405899
|
-
return
|
|
405909
|
+
return join107(getProjectTempDir(), getSessionId(), "scratchpad");
|
|
405900
405910
|
}
|
|
405901
405911
|
async function ensureScratchpadDir() {
|
|
405902
405912
|
if (!isScratchpadEnabled()) {
|
|
@@ -406474,7 +406484,7 @@ function checkEditableInternalPath(absolutePath, input) {
|
|
|
406474
406484
|
}
|
|
406475
406485
|
};
|
|
406476
406486
|
}
|
|
406477
|
-
if (normalizeCaseForComparison2(normalizedPath) === normalizeCaseForComparison2(
|
|
406487
|
+
if (normalizeCaseForComparison2(normalizedPath) === normalizeCaseForComparison2(join107(getOriginalCwd(), ".vivus", "launch.json"))) {
|
|
406478
406488
|
return {
|
|
406479
406489
|
behavior: "allow",
|
|
406480
406490
|
updatedInput: input,
|
|
@@ -406571,7 +406581,7 @@ function checkReadableInternalPath(absolutePath, input) {
|
|
|
406571
406581
|
}
|
|
406572
406582
|
};
|
|
406573
406583
|
}
|
|
406574
|
-
const tasksDir =
|
|
406584
|
+
const tasksDir = join107(getVivusConfigHomeDir(), "tasks") + sep25;
|
|
406575
406585
|
if (normalizedPath === tasksDir.slice(0, -1) || normalizedPath.startsWith(tasksDir)) {
|
|
406576
406586
|
return {
|
|
406577
406587
|
behavior: "allow",
|
|
@@ -406582,7 +406592,7 @@ function checkReadableInternalPath(absolutePath, input) {
|
|
|
406582
406592
|
}
|
|
406583
406593
|
};
|
|
406584
406594
|
}
|
|
406585
|
-
const teamsReadDir =
|
|
406595
|
+
const teamsReadDir = join107(getVivusConfigHomeDir(), "teams") + sep25;
|
|
406586
406596
|
if (normalizedPath === teamsReadDir.slice(0, -1) || normalizedPath.startsWith(teamsReadDir)) {
|
|
406587
406597
|
return {
|
|
406588
406598
|
behavior: "allow",
|
|
@@ -406655,11 +406665,11 @@ var init_filesystem = __esm(() => {
|
|
|
406655
406665
|
try {
|
|
406656
406666
|
resolvedBaseTmpDir = fs9.realpathSync(baseTmpDir);
|
|
406657
406667
|
} catch {}
|
|
406658
|
-
return
|
|
406668
|
+
return join107(resolvedBaseTmpDir, getVivusTempDirName()) + sep25;
|
|
406659
406669
|
});
|
|
406660
406670
|
getBundledSkillsRoot = memoize_default(function getBundledSkillsRoot2() {
|
|
406661
406671
|
const nonce = randomBytes17(16).toString("hex");
|
|
406662
|
-
return
|
|
406672
|
+
return join107(getVivusTempDir(), "bundled-skills", "1.1.31+c38c44f", nonce);
|
|
406663
406673
|
});
|
|
406664
406674
|
getResolvedWorkingDirPaths = memoize_default(getPathsForPermissionCheck);
|
|
406665
406675
|
});
|
|
@@ -406733,7 +406743,7 @@ var init_validation3 = __esm(() => {
|
|
|
406733
406743
|
});
|
|
406734
406744
|
|
|
406735
406745
|
// src/utils/suggestions/directoryCompletion.ts
|
|
406736
|
-
import { basename as basename34, dirname as dirname48, join as
|
|
406746
|
+
import { basename as basename34, dirname as dirname48, join as join108, sep as sep26 } from "path";
|
|
406737
406747
|
function parsePartialPath(partialPath, basePath) {
|
|
406738
406748
|
if (!partialPath) {
|
|
406739
406749
|
const directory2 = basePath || getCwd();
|
|
@@ -406757,7 +406767,7 @@ async function scanDirectory(dirPath) {
|
|
|
406757
406767
|
const entries = await fs9.readdir(dirPath);
|
|
406758
406768
|
const directories = entries.filter((entry) => entry.isDirectory() && !entry.name.startsWith(".")).map((entry) => ({
|
|
406759
406769
|
name: entry.name,
|
|
406760
|
-
path:
|
|
406770
|
+
path: join108(dirPath, entry.name),
|
|
406761
406771
|
type: "directory"
|
|
406762
406772
|
})).slice(0, 100);
|
|
406763
406773
|
directoryCache.set(dirPath, directories);
|
|
@@ -406794,7 +406804,7 @@ async function scanDirectoryForPaths(dirPath, includeHidden = false) {
|
|
|
406794
406804
|
const entries = await fs9.readdir(dirPath);
|
|
406795
406805
|
const paths2 = entries.filter((entry) => includeHidden || !entry.name.startsWith(".")).map((entry) => ({
|
|
406796
406806
|
name: entry.name,
|
|
406797
|
-
path:
|
|
406807
|
+
path: join108(dirPath, entry.name),
|
|
406798
406808
|
type: entry.isDirectory() ? "directory" : "file"
|
|
406799
406809
|
})).sort((a2, b) => {
|
|
406800
406810
|
if (a2.type === "directory" && b.type !== "directory")
|
|
@@ -408419,7 +408429,7 @@ function Feedback({
|
|
|
408419
408429
|
platform: env3.platform,
|
|
408420
408430
|
gitRepo: envInfo.isGit,
|
|
408421
408431
|
terminal: env3.terminal,
|
|
408422
|
-
version: "1.1.
|
|
408432
|
+
version: "1.1.31+c38c44f",
|
|
408423
408433
|
transcript: normalizeMessagesForAPI(messages),
|
|
408424
408434
|
errors: sanitizedErrors,
|
|
408425
408435
|
lastApiRequest: getLastAPIRequest(),
|
|
@@ -408611,7 +408621,7 @@ function Feedback({
|
|
|
408611
408621
|
", ",
|
|
408612
408622
|
env3.terminal,
|
|
408613
408623
|
", v",
|
|
408614
|
-
"1.1.
|
|
408624
|
+
"1.1.31+c38c44f"
|
|
408615
408625
|
]
|
|
408616
408626
|
}, undefined, true, undefined, this)
|
|
408617
408627
|
]
|
|
@@ -408717,7 +408727,7 @@ ${sanitizedDescription}
|
|
|
408717
408727
|
` + `**Environment Info**
|
|
408718
408728
|
` + `- Platform: ${env3.platform}
|
|
408719
408729
|
` + `- Terminal: ${env3.terminal}
|
|
408720
|
-
` + `- Version: ${"1.1.
|
|
408730
|
+
` + `- Version: ${"1.1.31+c38c44f"}
|
|
408721
408731
|
` + `- Feedback ID: ${feedbackId}
|
|
408722
408732
|
` + `
|
|
408723
408733
|
**Errors**
|
|
@@ -409629,7 +409639,7 @@ var init_fileSuggestions = __esm(() => {
|
|
|
409629
409639
|
});
|
|
409630
409640
|
|
|
409631
409641
|
// src/services/MagicDocs/prompts.ts
|
|
409632
|
-
import { join as
|
|
409642
|
+
import { join as join110 } from "path";
|
|
409633
409643
|
function getUpdatePromptTemplate() {
|
|
409634
409644
|
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
409645
|
|
|
@@ -409684,7 +409694,7 @@ REMEMBER: Only update if there is substantial new information. The Magic Doc hea
|
|
|
409684
409694
|
}
|
|
409685
409695
|
async function loadMagicDocsPrompt() {
|
|
409686
409696
|
const fs9 = getFsImplementation();
|
|
409687
|
-
const promptPath =
|
|
409697
|
+
const promptPath = join110(getVivusConfigHomeDir(), "magic-docs", "prompt.md");
|
|
409688
409698
|
try {
|
|
409689
409699
|
return await fs9.readFile(promptPath, { encoding: "utf-8" });
|
|
409690
409700
|
} catch {
|
|
@@ -410273,7 +410283,7 @@ __export(exports_copy, {
|
|
|
410273
410283
|
});
|
|
410274
410284
|
import { mkdir as mkdir29, writeFile as writeFile30 } from "fs/promises";
|
|
410275
410285
|
import { tmpdir as tmpdir9 } from "os";
|
|
410276
|
-
import { join as
|
|
410286
|
+
import { join as join111 } from "path";
|
|
410277
410287
|
function extractCodeBlocks(markdown) {
|
|
410278
410288
|
const tokens = marked.lexer(stripPromptXMLTags(markdown));
|
|
410279
410289
|
const blocks = [];
|
|
@@ -410315,7 +410325,7 @@ function fileExtension2(lang) {
|
|
|
410315
410325
|
return ".txt";
|
|
410316
410326
|
}
|
|
410317
410327
|
async function writeToFile(text2, filename) {
|
|
410318
|
-
const filePath =
|
|
410328
|
+
const filePath = join111(COPY_DIR, filename);
|
|
410319
410329
|
await mkdir29(COPY_DIR, {
|
|
410320
410330
|
recursive: true
|
|
410321
410331
|
});
|
|
@@ -410667,7 +410677,7 @@ var init_copy = __esm(() => {
|
|
|
410667
410677
|
import_compiler_runtime129 = __toESM(require_compiler_runtime(), 1);
|
|
410668
410678
|
import_react96 = __toESM(require_react(), 1);
|
|
410669
410679
|
jsx_dev_runtime165 = __toESM(require_jsx_dev_runtime(), 1);
|
|
410670
|
-
COPY_DIR =
|
|
410680
|
+
COPY_DIR = join111(tmpdir9(), "vivus");
|
|
410671
410681
|
});
|
|
410672
410682
|
|
|
410673
410683
|
// src/commands/copy/index.ts
|
|
@@ -410684,7 +410694,7 @@ var init_copy2 = __esm(() => {
|
|
|
410684
410694
|
|
|
410685
410695
|
// src/utils/desktopDeepLink.ts
|
|
410686
410696
|
import { readdir as readdir23 } from "fs/promises";
|
|
410687
|
-
import { join as
|
|
410697
|
+
import { join as join112 } from "path";
|
|
410688
410698
|
function isDevMode() {
|
|
410689
410699
|
if (true) {
|
|
410690
410700
|
return true;
|
|
@@ -410747,7 +410757,7 @@ async function getDesktopVersion() {
|
|
|
410747
410757
|
if (!localAppData) {
|
|
410748
410758
|
return null;
|
|
410749
410759
|
}
|
|
410750
|
-
const installDir =
|
|
410760
|
+
const installDir = join112(localAppData, "AnthropicVivus");
|
|
410751
410761
|
try {
|
|
410752
410762
|
const entries = await readdir23(installDir);
|
|
410753
410763
|
const versions2 = entries.filter((e) => e.startsWith("app-")).map((e) => e.slice(4)).filter((v) => import_semver7.coerce(v) !== null).sort((a2, b) => {
|
|
@@ -411849,7 +411859,7 @@ function buildPrimarySection() {
|
|
|
411849
411859
|
}, undefined, false, undefined, this);
|
|
411850
411860
|
return [{
|
|
411851
411861
|
label: "Version",
|
|
411852
|
-
value: "1.1.
|
|
411862
|
+
value: "1.1.31+c38c44f"
|
|
411853
411863
|
}, {
|
|
411854
411864
|
label: "Session name",
|
|
411855
411865
|
value: nameValue
|
|
@@ -415600,7 +415610,7 @@ function Config({
|
|
|
415600
415610
|
}
|
|
415601
415611
|
}, undefined, false, undefined, this)
|
|
415602
415612
|
}, undefined, false, undefined, this) : showSubmenu === "ChannelDowngrade" ? /* @__PURE__ */ jsx_dev_runtime178.jsxDEV(ChannelDowngradeDialog, {
|
|
415603
|
-
currentVersion: "1.1.
|
|
415613
|
+
currentVersion: "1.1.31+c38c44f",
|
|
415604
415614
|
onChoice: (choice) => {
|
|
415605
415615
|
setShowSubmenu(null);
|
|
415606
415616
|
setTabsHidden(false);
|
|
@@ -415612,7 +415622,7 @@ function Config({
|
|
|
415612
415622
|
autoUpdatesChannel: "stable"
|
|
415613
415623
|
};
|
|
415614
415624
|
if (choice === "stay") {
|
|
415615
|
-
newSettings.minimumVersion = "1.1.
|
|
415625
|
+
newSettings.minimumVersion = "1.1.31+c38c44f";
|
|
415616
415626
|
}
|
|
415617
415627
|
updateSettingsForSource("userSettings", newSettings);
|
|
415618
415628
|
setSettingsData((prev_27) => ({
|
|
@@ -421018,7 +421028,7 @@ var exports_Doctor = {};
|
|
|
421018
421028
|
__export(exports_Doctor, {
|
|
421019
421029
|
Doctor: () => Doctor
|
|
421020
421030
|
});
|
|
421021
|
-
import { join as
|
|
421031
|
+
import { join as join113 } from "path";
|
|
421022
421032
|
function DistTagsDisplay(t0) {
|
|
421023
421033
|
const $2 = import_compiler_runtime158.c(8);
|
|
421024
421034
|
const {
|
|
@@ -421148,8 +421158,8 @@ function Doctor(t0) {
|
|
|
421148
421158
|
t5 = () => {
|
|
421149
421159
|
getDoctorDiagnostic().then(setDiagnostic);
|
|
421150
421160
|
(async () => {
|
|
421151
|
-
const userAgentsDir =
|
|
421152
|
-
const projectAgentsDir =
|
|
421161
|
+
const userAgentsDir = join113(getVivusConfigHomeDir(), "agents");
|
|
421162
|
+
const projectAgentsDir = join113(getOriginalCwd(), ".vivus", "agents");
|
|
421153
421163
|
const {
|
|
421154
421164
|
activeAgents,
|
|
421155
421165
|
allAgents,
|
|
@@ -421172,7 +421182,7 @@ function Doctor(t0) {
|
|
|
421172
421182
|
}, async () => toolPermissionContext);
|
|
421173
421183
|
setContextWarnings(warnings);
|
|
421174
421184
|
if (isPidBasedLockingEnabled()) {
|
|
421175
|
-
const locksDir =
|
|
421185
|
+
const locksDir = join113(getXDGStateHome(), "vivus", "locks");
|
|
421176
421186
|
const staleLocksCleaned = cleanupStaleLocks(locksDir);
|
|
421177
421187
|
const locks = getAllLockInfo(locksDir);
|
|
421178
421188
|
setVersionLockInfo({
|
|
@@ -422049,7 +422059,7 @@ var init_versions3 = __esm(() => {
|
|
|
422049
422059
|
|
|
422050
422060
|
// src/components/memory/MemoryFileSelector.tsx
|
|
422051
422061
|
import { mkdir as mkdir30 } from "fs/promises";
|
|
422052
|
-
import { join as
|
|
422062
|
+
import { join as join114 } from "path";
|
|
422053
422063
|
function MemoryFileSelector(t0) {
|
|
422054
422064
|
const $2 = import_compiler_runtime159.c(58);
|
|
422055
422065
|
const {
|
|
@@ -422057,8 +422067,8 @@ function MemoryFileSelector(t0) {
|
|
|
422057
422067
|
onCancel
|
|
422058
422068
|
} = t0;
|
|
422059
422069
|
const existingMemoryFiles = import_react115.use(getMemoryFiles());
|
|
422060
|
-
const userMemoryPath =
|
|
422061
|
-
const projectMemoryPath =
|
|
422070
|
+
const userMemoryPath = join114(getVivusConfigHomeDir(), "VIVUS.md");
|
|
422071
|
+
const projectMemoryPath = join114(getOriginalCwd(), "VIVUS.md");
|
|
422062
422072
|
const hasUserMemory = existingMemoryFiles.some((f) => f.path === userMemoryPath);
|
|
422063
422073
|
const hasProjectMemory = existingMemoryFiles.some((f_0) => f_0.path === projectMemoryPath);
|
|
422064
422074
|
const allMemoryFiles = [...existingMemoryFiles.filter(_temp81).map(_temp230), ...hasUserMemory ? [] : [{
|
|
@@ -423698,7 +423708,7 @@ function HelpV2(t0) {
|
|
|
423698
423708
|
let t6;
|
|
423699
423709
|
if ($2[31] !== tabs) {
|
|
423700
423710
|
t6 = /* @__PURE__ */ jsx_dev_runtime205.jsxDEV(Tabs, {
|
|
423701
|
-
title: `Vivus v${"1.1.
|
|
423711
|
+
title: `Vivus v${"1.1.31+c38c44f"}`,
|
|
423702
423712
|
color: "professionalBlue",
|
|
423703
423713
|
defaultTab: "general",
|
|
423704
423714
|
children: tabs
|
|
@@ -432773,7 +432783,7 @@ __export(exports_pluginStartupCheck, {
|
|
|
432773
432783
|
findMissingPlugins: () => findMissingPlugins,
|
|
432774
432784
|
checkEnabledPlugins: () => checkEnabledPlugins
|
|
432775
432785
|
});
|
|
432776
|
-
import { join as
|
|
432786
|
+
import { join as join115 } from "path";
|
|
432777
432787
|
async function checkEnabledPlugins() {
|
|
432778
432788
|
const settings = getInitialSettings();
|
|
432779
432789
|
const enabledPlugins = [];
|
|
@@ -432908,7 +432918,7 @@ async function installSelectedPlugins(pluginsToInstall, onProgress, scope = "use
|
|
|
432908
432918
|
} else {
|
|
432909
432919
|
registerPluginInstallation({
|
|
432910
432920
|
pluginId,
|
|
432911
|
-
installPath:
|
|
432921
|
+
installPath: join115(marketplaceInstallLocation, entry.source),
|
|
432912
432922
|
version: entry.version
|
|
432913
432923
|
}, scope, projectPath);
|
|
432914
432924
|
}
|
|
@@ -433228,9 +433238,9 @@ var init_AddMarketplace = __esm(() => {
|
|
|
433228
433238
|
// src/utils/plugins/installCounts.ts
|
|
433229
433239
|
import { randomBytes as randomBytes18 } from "crypto";
|
|
433230
433240
|
import { readFile as readFile37, rename as rename7, unlink as unlink17, writeFile as writeFile33 } from "fs/promises";
|
|
433231
|
-
import { join as
|
|
433241
|
+
import { join as join116 } from "path";
|
|
433232
433242
|
function getInstallCountsCachePath() {
|
|
433233
|
-
return
|
|
433243
|
+
return join116(getPluginsDirectory(), INSTALL_COUNTS_CACHE_FILENAME);
|
|
433234
433244
|
}
|
|
433235
433245
|
async function loadInstallCountsCache() {
|
|
433236
433246
|
const cachePath = getInstallCountsCachePath();
|
|
@@ -435976,7 +435986,7 @@ var init_DiscoverPlugins = __esm(() => {
|
|
|
435976
435986
|
});
|
|
435977
435987
|
|
|
435978
435988
|
// src/services/plugins/pluginOperations.ts
|
|
435979
|
-
import { dirname as dirname51, join as
|
|
435989
|
+
import { dirname as dirname51, join as join117 } from "path";
|
|
435980
435990
|
function assertInstallableScope(scope) {
|
|
435981
435991
|
if (!VALID_INSTALLABLE_SCOPES.includes(scope)) {
|
|
435982
435992
|
throw new Error(`Invalid scope "${scope}". Must be one of: ${VALID_INSTALLABLE_SCOPES.join(", ")}`);
|
|
@@ -436454,7 +436464,7 @@ async function performPluginUpdate({
|
|
|
436454
436464
|
throw e;
|
|
436455
436465
|
}
|
|
436456
436466
|
const marketplaceDir = marketplaceStats.isDirectory() ? marketplaceInstallLocation : dirname51(marketplaceInstallLocation);
|
|
436457
|
-
sourcePath =
|
|
436467
|
+
sourcePath = join117(marketplaceDir, entry.source);
|
|
436458
436468
|
try {
|
|
436459
436469
|
await fs9.stat(sourcePath);
|
|
436460
436470
|
} catch (e) {
|
|
@@ -436469,8 +436479,8 @@ async function performPluginUpdate({
|
|
|
436469
436479
|
throw e;
|
|
436470
436480
|
}
|
|
436471
436481
|
let pluginManifest;
|
|
436472
|
-
const manifestPath =
|
|
436473
|
-
const claudeManifestPath =
|
|
436482
|
+
const manifestPath = join117(sourcePath, ".vivus-plugin", "plugin.json");
|
|
436483
|
+
const claudeManifestPath = join117(sourcePath, ".claude-plugin", "plugin.json");
|
|
436474
436484
|
try {
|
|
436475
436485
|
pluginManifest = await loadPluginManifest(manifestPath, entry.name, entry.source);
|
|
436476
436486
|
} catch {
|
|
@@ -437694,9 +437704,9 @@ var init_ManageMarketplaces = __esm(() => {
|
|
|
437694
437704
|
// src/utils/plugins/pluginFlagging.ts
|
|
437695
437705
|
import { randomBytes as randomBytes19 } from "crypto";
|
|
437696
437706
|
import { readFile as readFile38, rename as rename8, unlink as unlink18, writeFile as writeFile34 } from "fs/promises";
|
|
437697
|
-
import { join as
|
|
437707
|
+
import { join as join118 } from "path";
|
|
437698
437708
|
function getFlaggedPluginsPath() {
|
|
437699
|
-
return
|
|
437709
|
+
return join118(getPluginsDirectory(), FLAGGED_PLUGINS_FILENAME);
|
|
437700
437710
|
}
|
|
437701
437711
|
function parsePluginsData(content) {
|
|
437702
437712
|
const parsed = jsonParse(content);
|
|
@@ -447804,9 +447814,9 @@ ${args ? "Additional user input: " + args : ""}
|
|
|
447804
447814
|
|
|
447805
447815
|
// src/utils/releaseNotes.ts
|
|
447806
447816
|
import { mkdir as mkdir33, readFile as readFile41, writeFile as writeFile35 } from "fs/promises";
|
|
447807
|
-
import { dirname as dirname53, join as
|
|
447817
|
+
import { dirname as dirname53, join as join121 } from "path";
|
|
447808
447818
|
function getChangelogCachePath() {
|
|
447809
|
-
return
|
|
447819
|
+
return join121(getVivusConfigHomeDir(), "cache", "changelog.md");
|
|
447810
447820
|
}
|
|
447811
447821
|
async function migrateChangelogFromConfig() {
|
|
447812
447822
|
const config4 = getGlobalConfig();
|
|
@@ -447924,7 +447934,7 @@ function getAllReleaseNotes(changelogContent = getStoredChangelogFromMemory()) {
|
|
|
447924
447934
|
return [];
|
|
447925
447935
|
}
|
|
447926
447936
|
}
|
|
447927
|
-
async function checkForReleaseNotes(lastSeenVersion, currentVersion = "1.1.
|
|
447937
|
+
async function checkForReleaseNotes(lastSeenVersion, currentVersion = "1.1.31+c38c44f") {
|
|
447928
447938
|
if (process.env.USER_TYPE === "ant") {
|
|
447929
447939
|
const changelog = "";
|
|
447930
447940
|
if (changelog) {
|
|
@@ -447951,7 +447961,7 @@ async function checkForReleaseNotes(lastSeenVersion, currentVersion = "1.1.30+da
|
|
|
447951
447961
|
releaseNotes
|
|
447952
447962
|
};
|
|
447953
447963
|
}
|
|
447954
|
-
function checkForReleaseNotesSync(lastSeenVersion, currentVersion = "1.1.
|
|
447964
|
+
function checkForReleaseNotesSync(lastSeenVersion, currentVersion = "1.1.31+c38c44f") {
|
|
447955
447965
|
if (process.env.USER_TYPE === "ant") {
|
|
447956
447966
|
const changelog = "";
|
|
447957
447967
|
if (changelog) {
|
|
@@ -449121,7 +449131,7 @@ function getRecentActivitySync() {
|
|
|
449121
449131
|
return cachedActivity;
|
|
449122
449132
|
}
|
|
449123
449133
|
function getLogoDisplayData() {
|
|
449124
|
-
const version2 = process.env.DEMO_VERSION ?? "1.1.
|
|
449134
|
+
const version2 = process.env.DEMO_VERSION ?? "1.1.31+c38c44f";
|
|
449125
449135
|
const serverUrl = getDirectConnectServerUrl();
|
|
449126
449136
|
const displayPath = process.env.DEMO_VERSION ? "/code/vivus" : getDisplayPath(getCwd());
|
|
449127
449137
|
const cwd2 = serverUrl ? `${displayPath} in ${serverUrl.replace(/^https?:\/\//, "")}` : displayPath;
|
|
@@ -450648,7 +450658,7 @@ function LogoV2() {
|
|
|
450648
450658
|
if ($2[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
450649
450659
|
t2 = () => {
|
|
450650
450660
|
const currentConfig = getGlobalConfig();
|
|
450651
|
-
if (currentConfig.lastReleaseNotesSeen === "1.1.
|
|
450661
|
+
if (currentConfig.lastReleaseNotesSeen === "1.1.31+c38c44f") {
|
|
450652
450662
|
return;
|
|
450653
450663
|
}
|
|
450654
450664
|
saveGlobalConfig(_temp329);
|
|
@@ -451324,12 +451334,12 @@ function LogoV2() {
|
|
|
451324
451334
|
return t41;
|
|
451325
451335
|
}
|
|
451326
451336
|
function _temp329(current) {
|
|
451327
|
-
if (current.lastReleaseNotesSeen === "1.1.
|
|
451337
|
+
if (current.lastReleaseNotesSeen === "1.1.31+c38c44f") {
|
|
451328
451338
|
return current;
|
|
451329
451339
|
}
|
|
451330
451340
|
return {
|
|
451331
451341
|
...current,
|
|
451332
|
-
lastReleaseNotesSeen: "1.1.
|
|
451342
|
+
lastReleaseNotesSeen: "1.1.31+c38c44f"
|
|
451333
451343
|
};
|
|
451334
451344
|
}
|
|
451335
451345
|
function _temp245(s_0) {
|
|
@@ -464445,7 +464455,7 @@ __export(exports_thinkback, {
|
|
|
464445
464455
|
call: () => call40
|
|
464446
464456
|
});
|
|
464447
464457
|
import { readFile as readFile42 } from "fs/promises";
|
|
464448
|
-
import { join as
|
|
464458
|
+
import { join as join122 } from "path";
|
|
464449
464459
|
function getMarketplaceName() {
|
|
464450
464460
|
return OFFICIAL_MARKETPLACE_NAME;
|
|
464451
464461
|
}
|
|
@@ -464463,15 +464473,15 @@ async function getThinkbackSkillDir() {
|
|
|
464463
464473
|
if (!thinkbackPlugin) {
|
|
464464
464474
|
return null;
|
|
464465
464475
|
}
|
|
464466
|
-
const skillDir =
|
|
464476
|
+
const skillDir = join122(thinkbackPlugin.path, "skills", SKILL_NAME);
|
|
464467
464477
|
if (await pathExists(skillDir)) {
|
|
464468
464478
|
return skillDir;
|
|
464469
464479
|
}
|
|
464470
464480
|
return null;
|
|
464471
464481
|
}
|
|
464472
464482
|
async function playAnimation(skillDir) {
|
|
464473
|
-
const dataPath =
|
|
464474
|
-
const playerPath =
|
|
464483
|
+
const dataPath = join122(skillDir, "year_in_review.js");
|
|
464484
|
+
const playerPath = join122(skillDir, "player.js");
|
|
464475
464485
|
try {
|
|
464476
464486
|
await readFile42(dataPath);
|
|
464477
464487
|
} catch (e) {
|
|
@@ -464519,7 +464529,7 @@ async function playAnimation(skillDir) {
|
|
|
464519
464529
|
} catch {} finally {
|
|
464520
464530
|
inkInstance.exitAlternateScreen();
|
|
464521
464531
|
}
|
|
464522
|
-
const htmlPath =
|
|
464532
|
+
const htmlPath = join122(skillDir, "year_in_review.html");
|
|
464523
464533
|
if (await pathExists(htmlPath)) {
|
|
464524
464534
|
const platform5 = getPlatform();
|
|
464525
464535
|
const openCmd = platform5 === "macos" ? "open" : platform5 === "windows" ? "start" : "xdg-open";
|
|
@@ -464855,7 +464865,7 @@ function ThinkbackFlow(t0) {
|
|
|
464855
464865
|
if (!skillDir) {
|
|
464856
464866
|
return;
|
|
464857
464867
|
}
|
|
464858
|
-
const dataPath =
|
|
464868
|
+
const dataPath = join122(skillDir, "year_in_review.js");
|
|
464859
464869
|
pathExists(dataPath).then((exists) => {
|
|
464860
464870
|
logForDebugging(`Checking for ${dataPath}: ${exists ? "found" : "not found"}`);
|
|
464861
464871
|
setHasGenerated(exists);
|
|
@@ -465029,7 +465039,7 @@ var exports_thinkback_play = {};
|
|
|
465029
465039
|
__export(exports_thinkback_play, {
|
|
465030
465040
|
call: () => call41
|
|
465031
465041
|
});
|
|
465032
|
-
import { join as
|
|
465042
|
+
import { join as join123 } from "path";
|
|
465033
465043
|
function getPluginId2() {
|
|
465034
465044
|
const marketplaceName = process.env.USER_TYPE === "ant" ? INTERNAL_MARKETPLACE_NAME : OFFICIAL_MARKETPLACE_NAME;
|
|
465035
465045
|
return `thinkback@${marketplaceName}`;
|
|
@@ -465051,7 +465061,7 @@ async function call41() {
|
|
|
465051
465061
|
value: "Thinkback plugin installation path not found."
|
|
465052
465062
|
};
|
|
465053
465063
|
}
|
|
465054
|
-
const skillDir =
|
|
465064
|
+
const skillDir = join123(firstInstall.installPath, "skills", SKILL_NAME2);
|
|
465055
465065
|
const result = await playAnimation(skillDir);
|
|
465056
465066
|
return { type: "text", value: result.message };
|
|
465057
465067
|
}
|
|
@@ -471446,7 +471456,7 @@ var init_types12 = __esm(() => {
|
|
|
471446
471456
|
|
|
471447
471457
|
// src/components/agents/agentFileUtils.ts
|
|
471448
471458
|
import { mkdir as mkdir35, open as open13, unlink as unlink19 } from "fs/promises";
|
|
471449
|
-
import { join as
|
|
471459
|
+
import { join as join124 } from "path";
|
|
471450
471460
|
function formatAgentAsMarkdown(agentType, whenToUse, tools, systemPrompt, color3, model, memory2, effort) {
|
|
471451
471461
|
const escapedWhenToUse = whenToUse.replace(/\\/g, "\\\\").replace(/"/g, "\\\"").replace(/\n/g, "\\\\n");
|
|
471452
471462
|
const isAllTools = tools === undefined || tools.length === 1 && tools[0] === "*";
|
|
@@ -471473,26 +471483,26 @@ function getAgentDirectoryPath(location) {
|
|
|
471473
471483
|
case "flagSettings":
|
|
471474
471484
|
throw new Error(`Cannot get directory path for ${location} agents`);
|
|
471475
471485
|
case "userSettings":
|
|
471476
|
-
return
|
|
471486
|
+
return join124(getVivusConfigHomeDir(), AGENT_PATHS.AGENTS_DIR);
|
|
471477
471487
|
case "projectSettings":
|
|
471478
|
-
return
|
|
471488
|
+
return join124(getCwd(), AGENT_PATHS.FOLDER_NAME, AGENT_PATHS.AGENTS_DIR);
|
|
471479
471489
|
case "policySettings":
|
|
471480
|
-
return
|
|
471490
|
+
return join124(getManagedFilePath(), AGENT_PATHS.FOLDER_NAME, AGENT_PATHS.AGENTS_DIR);
|
|
471481
471491
|
case "localSettings":
|
|
471482
|
-
return
|
|
471492
|
+
return join124(getCwd(), AGENT_PATHS.FOLDER_NAME, AGENT_PATHS.AGENTS_DIR);
|
|
471483
471493
|
}
|
|
471484
471494
|
}
|
|
471485
471495
|
function getRelativeAgentDirectoryPath(location) {
|
|
471486
471496
|
switch (location) {
|
|
471487
471497
|
case "projectSettings":
|
|
471488
|
-
return
|
|
471498
|
+
return join124(".", AGENT_PATHS.FOLDER_NAME, AGENT_PATHS.AGENTS_DIR);
|
|
471489
471499
|
default:
|
|
471490
471500
|
return getAgentDirectoryPath(location);
|
|
471491
471501
|
}
|
|
471492
471502
|
}
|
|
471493
471503
|
function getNewAgentFilePath(agent) {
|
|
471494
471504
|
const dirPath = getAgentDirectoryPath(agent.source);
|
|
471495
|
-
return
|
|
471505
|
+
return join124(dirPath, `${agent.agentType}.md`);
|
|
471496
471506
|
}
|
|
471497
471507
|
function getActualAgentFilePath(agent) {
|
|
471498
471508
|
if (agent.source === "built-in") {
|
|
@@ -471503,14 +471513,14 @@ function getActualAgentFilePath(agent) {
|
|
|
471503
471513
|
}
|
|
471504
471514
|
const dirPath = getAgentDirectoryPath(agent.source);
|
|
471505
471515
|
const filename = agent.filename || agent.agentType;
|
|
471506
|
-
return
|
|
471516
|
+
return join124(dirPath, `${filename}.md`);
|
|
471507
471517
|
}
|
|
471508
471518
|
function getNewRelativeAgentFilePath(agent) {
|
|
471509
471519
|
if (agent.source === "built-in") {
|
|
471510
471520
|
return "Built-in";
|
|
471511
471521
|
}
|
|
471512
471522
|
const dirPath = getRelativeAgentDirectoryPath(agent.source);
|
|
471513
|
-
return
|
|
471523
|
+
return join124(dirPath, `${agent.agentType}.md`);
|
|
471514
471524
|
}
|
|
471515
471525
|
function getActualRelativeAgentFilePath(agent) {
|
|
471516
471526
|
if (isBuiltInAgent(agent)) {
|
|
@@ -471524,7 +471534,7 @@ function getActualRelativeAgentFilePath(agent) {
|
|
|
471524
471534
|
}
|
|
471525
471535
|
const dirPath = getRelativeAgentDirectoryPath(agent.source);
|
|
471526
471536
|
const filename = agent.filename || agent.agentType;
|
|
471527
|
-
return
|
|
471537
|
+
return join124(dirPath, `${filename}.md`);
|
|
471528
471538
|
}
|
|
471529
471539
|
async function ensureAgentDirectoryExists(source) {
|
|
471530
471540
|
const dirPath = getAgentDirectoryPath(source);
|
|
@@ -477536,7 +477546,7 @@ var init_rewind = __esm(() => {
|
|
|
477536
477546
|
// src/utils/heapDumpService.ts
|
|
477537
477547
|
import { createWriteStream as createWriteStream3, writeFileSync as writeFileSync4 } from "fs";
|
|
477538
477548
|
import { readdir as readdir26, readFile as readFile44, writeFile as writeFile37 } from "fs/promises";
|
|
477539
|
-
import { join as
|
|
477549
|
+
import { join as join125 } from "path";
|
|
477540
477550
|
import { pipeline as pipeline2 } from "stream/promises";
|
|
477541
477551
|
import {
|
|
477542
477552
|
getHeapSnapshot,
|
|
@@ -477626,7 +477636,7 @@ async function captureMemoryDiagnostics(trigger, dumpNumber = 0) {
|
|
|
477626
477636
|
smapsRollup,
|
|
477627
477637
|
platform: process.platform,
|
|
477628
477638
|
nodeVersion: process.version,
|
|
477629
|
-
ccVersion: "1.1.
|
|
477639
|
+
ccVersion: "1.1.31+c38c44f"
|
|
477630
477640
|
};
|
|
477631
477641
|
}
|
|
477632
477642
|
async function performHeapDump(trigger = "manual", dumpNumber = 0) {
|
|
@@ -477644,8 +477654,8 @@ async function performHeapDump(trigger = "manual", dumpNumber = 0) {
|
|
|
477644
477654
|
const suffix = dumpNumber > 0 ? `-dump${dumpNumber}` : "";
|
|
477645
477655
|
const heapFilename = `${sessionId}${suffix}.heapsnapshot`;
|
|
477646
477656
|
const diagFilename = `${sessionId}${suffix}-diagnostics.json`;
|
|
477647
|
-
const heapPath =
|
|
477648
|
-
const diagPath =
|
|
477657
|
+
const heapPath = join125(dumpDir, heapFilename);
|
|
477658
|
+
const diagPath = join125(dumpDir, diagFilename);
|
|
477649
477659
|
await writeFile37(diagPath, jsonStringify(diagnostics, null, 2), {
|
|
477650
477660
|
mode: 384
|
|
477651
477661
|
});
|
|
@@ -478212,7 +478222,7 @@ var init_bridge_kick = __esm(() => {
|
|
|
478212
478222
|
var call56 = async () => {
|
|
478213
478223
|
return {
|
|
478214
478224
|
type: "text",
|
|
478215
|
-
value: `${"1.1.
|
|
478225
|
+
value: `${"1.1.31+c38c44f"} (built ${"2026-06-23T19:29:51.252Z"})`
|
|
478216
478226
|
};
|
|
478217
478227
|
}, version2, version_default;
|
|
478218
478228
|
var init_version = __esm(() => {
|
|
@@ -479491,7 +479501,7 @@ var init_sandbox_toggle2 = __esm(() => {
|
|
|
479491
479501
|
|
|
479492
479502
|
// src/utils/vivusInChrome/setupPortable.ts
|
|
479493
479503
|
import { readdir as readdir27 } from "fs/promises";
|
|
479494
|
-
import { join as
|
|
479504
|
+
import { join as join126 } from "path";
|
|
479495
479505
|
function getExtensionIds() {
|
|
479496
479506
|
return process.env.USER_TYPE === "ant" ? [PROD_EXTENSION_ID, DEV_EXTENSION_ID, ANT_EXTENSION_ID] : [PROD_EXTENSION_ID];
|
|
479497
479507
|
}
|
|
@@ -479518,7 +479528,7 @@ async function detectExtensionInstallationPortable(browserPaths, log) {
|
|
|
479518
479528
|
}
|
|
479519
479529
|
for (const profile of profileDirs) {
|
|
479520
479530
|
for (const extensionId of extensionIds) {
|
|
479521
|
-
const extensionPath =
|
|
479531
|
+
const extensionPath = join126(browserBasePath, profile, "Extensions", extensionId);
|
|
479522
479532
|
try {
|
|
479523
479533
|
await readdir27(extensionPath);
|
|
479524
479534
|
log?.(`[Vivus in Chrome] Extension ${extensionId} found in ${browser} ${profile}`);
|
|
@@ -479542,7 +479552,7 @@ var init_setupPortable = __esm(() => {
|
|
|
479542
479552
|
// src/utils/vivusInChrome/setup.ts
|
|
479543
479553
|
import { chmod as chmod10, mkdir as mkdir36, readFile as readFile45, writeFile as writeFile38 } from "fs/promises";
|
|
479544
479554
|
import { homedir as homedir33 } from "os";
|
|
479545
|
-
import { join as
|
|
479555
|
+
import { join as join127 } from "path";
|
|
479546
479556
|
import { fileURLToPath as fileURLToPath7 } from "url";
|
|
479547
479557
|
function shouldEnableVivusInChrome(chromeFlag) {
|
|
479548
479558
|
if (getIsNonInteractiveSession() && chromeFlag !== true) {
|
|
@@ -479599,8 +479609,8 @@ function setupVivusInChrome() {
|
|
|
479599
479609
|
};
|
|
479600
479610
|
} else {
|
|
479601
479611
|
const __filename3 = fileURLToPath7(import.meta.url);
|
|
479602
|
-
const __dirname3 =
|
|
479603
|
-
const cliPath =
|
|
479612
|
+
const __dirname3 = join127(__filename3, "..");
|
|
479613
|
+
const cliPath = join127(__dirname3, "cli.js");
|
|
479604
479614
|
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
479615
|
const mcpConfig = {
|
|
479606
479616
|
[VIVUS_IN_CHROME_MCP_SERVER_NAME]: {
|
|
@@ -479622,8 +479632,8 @@ function getNativeMessagingHostsDirs() {
|
|
|
479622
479632
|
const platform5 = getPlatform();
|
|
479623
479633
|
if (platform5 === "windows") {
|
|
479624
479634
|
const home = homedir33();
|
|
479625
|
-
const appData = process.env.APPDATA ||
|
|
479626
|
-
return [
|
|
479635
|
+
const appData = process.env.APPDATA || join127(home, "AppData", "Local");
|
|
479636
|
+
return [join127(appData, "Vivus", "ChromeNativeHost")];
|
|
479627
479637
|
}
|
|
479628
479638
|
return getAllNativeMessagingHostsDirs().map(({ path: path23 }) => path23);
|
|
479629
479639
|
}
|
|
@@ -479648,7 +479658,7 @@ async function installChromeNativeHostManifest(manifestBinaryPath) {
|
|
|
479648
479658
|
const manifestContent = jsonStringify(manifest, null, 2);
|
|
479649
479659
|
let anyManifestUpdated = false;
|
|
479650
479660
|
for (const manifestDir of manifestDirs) {
|
|
479651
|
-
const manifestPath =
|
|
479661
|
+
const manifestPath = join127(manifestDir, NATIVE_HOST_MANIFEST_NAME);
|
|
479652
479662
|
const existingContent = await readFile45(manifestPath, "utf-8").catch(() => null);
|
|
479653
479663
|
if (existingContent === manifestContent) {
|
|
479654
479664
|
continue;
|
|
@@ -479663,7 +479673,7 @@ async function installChromeNativeHostManifest(manifestBinaryPath) {
|
|
|
479663
479673
|
}
|
|
479664
479674
|
}
|
|
479665
479675
|
if (getPlatform() === "windows") {
|
|
479666
|
-
const manifestPath =
|
|
479676
|
+
const manifestPath = join127(manifestDirs[0], NATIVE_HOST_MANIFEST_NAME);
|
|
479667
479677
|
registerWindowsNativeHosts(manifestPath);
|
|
479668
479678
|
}
|
|
479669
479679
|
if (anyManifestUpdated) {
|
|
@@ -479701,8 +479711,8 @@ function registerWindowsNativeHosts(manifestPath) {
|
|
|
479701
479711
|
}
|
|
479702
479712
|
async function createWrapperScript(command7) {
|
|
479703
479713
|
const platform5 = getPlatform();
|
|
479704
|
-
const chromeDir =
|
|
479705
|
-
const wrapperPath = platform5 === "windows" ?
|
|
479714
|
+
const chromeDir = join127(getVivusConfigHomeDir(), "chrome");
|
|
479715
|
+
const wrapperPath = platform5 === "windows" ? join127(chromeDir, "chrome-native-host.bat") : join127(chromeDir, "chrome-native-host");
|
|
479706
479716
|
const scriptContent = platform5 === "windows" ? `@echo off
|
|
479707
479717
|
REM Chrome native host wrapper script
|
|
479708
479718
|
REM Generated by Vivus - do not edit manually
|
|
@@ -480308,7 +480318,7 @@ var init_advisor2 = __esm(() => {
|
|
|
480308
480318
|
// src/skills/bundledSkills.ts
|
|
480309
480319
|
import { constants as fsConstants6 } from "fs";
|
|
480310
480320
|
import { mkdir as mkdir37, open as open14 } from "fs/promises";
|
|
480311
|
-
import { dirname as dirname54, isAbsolute as isAbsolute24, join as
|
|
480321
|
+
import { dirname as dirname54, isAbsolute as isAbsolute24, join as join128, normalize as normalize15, sep as pathSep2 } from "path";
|
|
480312
480322
|
function registerBundledSkill(definition) {
|
|
480313
480323
|
const { files: files2 } = definition;
|
|
480314
480324
|
let skillRoot;
|
|
@@ -480356,7 +480366,7 @@ function getBundledSkills() {
|
|
|
480356
480366
|
return [...bundledSkills];
|
|
480357
480367
|
}
|
|
480358
480368
|
function getBundledSkillExtractDir(skillName) {
|
|
480359
|
-
return
|
|
480369
|
+
return join128(getBundledSkillsRoot(), skillName);
|
|
480360
480370
|
}
|
|
480361
480371
|
async function extractBundledSkillFiles(skillName, files2) {
|
|
480362
480372
|
const dir = getBundledSkillExtractDir(skillName);
|
|
@@ -480398,7 +480408,7 @@ function resolveSkillFilePath(baseDir, relPath) {
|
|
|
480398
480408
|
if (isAbsolute24(normalized) || normalized.split(pathSep2).includes("..") || normalized.split("/").includes("..")) {
|
|
480399
480409
|
throw new Error(`bundled skill file path escapes skill dir: ${relPath}`);
|
|
480400
480410
|
}
|
|
480401
|
-
return
|
|
480411
|
+
return join128(baseDir, normalized);
|
|
480402
480412
|
}
|
|
480403
480413
|
function prependBaseDir(blocks, baseDir) {
|
|
480404
480414
|
const prefix = `Base directory for this skill: ${baseDir}
|
|
@@ -480759,7 +480769,7 @@ var init_exit2 = __esm(() => {
|
|
|
480759
480769
|
});
|
|
480760
480770
|
|
|
480761
480771
|
// src/components/ExportDialog.tsx
|
|
480762
|
-
import { join as
|
|
480772
|
+
import { join as join129 } from "path";
|
|
480763
480773
|
function ExportDialog({
|
|
480764
480774
|
content,
|
|
480765
480775
|
defaultFilename,
|
|
@@ -480792,7 +480802,7 @@ function ExportDialog({
|
|
|
480792
480802
|
};
|
|
480793
480803
|
const handleFilenameSubmit = () => {
|
|
480794
480804
|
const finalFilename = filename.endsWith(".txt") ? filename : filename.replace(/\.[^.]+$/, "") + ".txt";
|
|
480795
|
-
const filepath =
|
|
480805
|
+
const filepath = join129(getCwd(), finalFilename);
|
|
480796
480806
|
try {
|
|
480797
480807
|
writeFileSync_DEPRECATED(filepath, content, {
|
|
480798
480808
|
encoding: "utf-8",
|
|
@@ -481015,7 +481025,7 @@ __export(exports_export, {
|
|
|
481015
481025
|
extractFirstPrompt: () => extractFirstPrompt,
|
|
481016
481026
|
call: () => call62
|
|
481017
481027
|
});
|
|
481018
|
-
import { join as
|
|
481028
|
+
import { join as join130 } from "path";
|
|
481019
481029
|
function formatTimestamp(date6) {
|
|
481020
481030
|
const year = date6.getFullYear();
|
|
481021
481031
|
const month = String(date6.getMonth() + 1).padStart(2, "0");
|
|
@@ -481059,7 +481069,7 @@ async function call62(onDone, context2, args) {
|
|
|
481059
481069
|
const filename = args.trim();
|
|
481060
481070
|
if (filename) {
|
|
481061
481071
|
const finalFilename = filename.endsWith(".txt") ? filename : filename.replace(/\.[^.]+$/, "") + ".txt";
|
|
481062
|
-
const filepath =
|
|
481072
|
+
const filepath = join130(getCwd(), finalFilename);
|
|
481063
481073
|
try {
|
|
481064
481074
|
writeFileSync_DEPRECATED(filepath, content, {
|
|
481065
481075
|
encoding: "utf-8",
|
|
@@ -483212,7 +483222,7 @@ var require_asciichart = __commonJS((exports) => {
|
|
|
483212
483222
|
// src/utils/statsCache.ts
|
|
483213
483223
|
import { randomBytes as randomBytes20 } from "crypto";
|
|
483214
483224
|
import { open as open15 } from "fs/promises";
|
|
483215
|
-
import { join as
|
|
483225
|
+
import { join as join131 } from "path";
|
|
483216
483226
|
async function withStatsCacheLock(fn) {
|
|
483217
483227
|
while (statsCacheLockPromise) {
|
|
483218
483228
|
await statsCacheLockPromise;
|
|
@@ -483229,7 +483239,7 @@ async function withStatsCacheLock(fn) {
|
|
|
483229
483239
|
}
|
|
483230
483240
|
}
|
|
483231
483241
|
function getStatsCachePath() {
|
|
483232
|
-
return
|
|
483242
|
+
return join131(getVivusConfigHomeDir(), STATS_CACHE_FILENAME);
|
|
483233
483243
|
}
|
|
483234
483244
|
function getEmptyCache() {
|
|
483235
483245
|
return {
|
|
@@ -483897,12 +483907,12 @@ var init_ansiToPng = __esm(() => {
|
|
|
483897
483907
|
// src/utils/screenshotClipboard.ts
|
|
483898
483908
|
import { mkdir as mkdir38, unlink as unlink20, writeFile as writeFile39 } from "fs/promises";
|
|
483899
483909
|
import { tmpdir as tmpdir10 } from "os";
|
|
483900
|
-
import { join as
|
|
483910
|
+
import { join as join132 } from "path";
|
|
483901
483911
|
async function copyAnsiToClipboard(ansiText, options2) {
|
|
483902
483912
|
try {
|
|
483903
|
-
const tempDir =
|
|
483913
|
+
const tempDir = join132(tmpdir10(), "vivus-screenshots");
|
|
483904
483914
|
await mkdir38(tempDir, { recursive: true });
|
|
483905
|
-
const pngPath =
|
|
483915
|
+
const pngPath = join132(tempDir, `screenshot-${Date.now()}.png`);
|
|
483906
483916
|
const pngBuffer = ansiToPng(ansiText, options2);
|
|
483907
483917
|
await writeFile39(pngPath, pngBuffer);
|
|
483908
483918
|
const result = await copyPngToClipboard(pngPath);
|
|
@@ -483973,7 +483983,7 @@ var init_screenshotClipboard = __esm(() => {
|
|
|
483973
483983
|
|
|
483974
483984
|
// src/utils/stats.ts
|
|
483975
483985
|
import { open as open16 } from "fs/promises";
|
|
483976
|
-
import { basename as basename39, join as
|
|
483986
|
+
import { basename as basename39, join as join133, sep as sep31 } from "path";
|
|
483977
483987
|
async function processSessionFiles(sessionFiles, options2 = {}) {
|
|
483978
483988
|
const { fromDate, toDate } = options2;
|
|
483979
483989
|
const fs10 = getFsImplementation();
|
|
@@ -484151,17 +484161,17 @@ async function getAllSessionFiles() {
|
|
|
484151
484161
|
return [];
|
|
484152
484162
|
throw e;
|
|
484153
484163
|
}
|
|
484154
|
-
const projectDirs = allEntries.filter((dirent) => dirent.isDirectory()).map((dirent) =>
|
|
484164
|
+
const projectDirs = allEntries.filter((dirent) => dirent.isDirectory()).map((dirent) => join133(projectsDir, dirent.name));
|
|
484155
484165
|
const projectResults = await Promise.all(projectDirs.map(async (projectDir) => {
|
|
484156
484166
|
try {
|
|
484157
484167
|
const entries = await fs10.readdir(projectDir);
|
|
484158
|
-
const mainFiles = entries.filter((dirent) => dirent.isFile() && dirent.name.endsWith(".jsonl")).map((dirent) =>
|
|
484168
|
+
const mainFiles = entries.filter((dirent) => dirent.isFile() && dirent.name.endsWith(".jsonl")).map((dirent) => join133(projectDir, dirent.name));
|
|
484159
484169
|
const sessionDirs = entries.filter((dirent) => dirent.isDirectory());
|
|
484160
484170
|
const subagentResults = await Promise.all(sessionDirs.map(async (sessionDir) => {
|
|
484161
|
-
const subagentsDir =
|
|
484171
|
+
const subagentsDir = join133(projectDir, sessionDir.name, "subagents");
|
|
484162
484172
|
try {
|
|
484163
484173
|
const subagentEntries = await fs10.readdir(subagentsDir);
|
|
484164
|
-
return subagentEntries.filter((dirent) => dirent.isFile() && dirent.name.endsWith(".jsonl") && dirent.name.startsWith("agent-")).map((dirent) =>
|
|
484174
|
+
return subagentEntries.filter((dirent) => dirent.isFile() && dirent.name.endsWith(".jsonl") && dirent.name.startsWith("agent-")).map((dirent) => join133(subagentsDir, dirent.name));
|
|
484165
484175
|
} catch {
|
|
484166
484176
|
return [];
|
|
484167
484177
|
}
|
|
@@ -486041,7 +486051,7 @@ import {
|
|
|
486041
486051
|
writeFile as writeFile40
|
|
486042
486052
|
} from "fs/promises";
|
|
486043
486053
|
import { tmpdir as tmpdir11 } from "os";
|
|
486044
|
-
import { extname as extname12, join as
|
|
486054
|
+
import { extname as extname12, join as join134 } from "path";
|
|
486045
486055
|
function getAnalysisModel() {
|
|
486046
486056
|
return getDefaultOpusModel();
|
|
486047
486057
|
}
|
|
@@ -486049,13 +486059,13 @@ function getInsightsModel() {
|
|
|
486049
486059
|
return getDefaultOpusModel();
|
|
486050
486060
|
}
|
|
486051
486061
|
function getDataDir() {
|
|
486052
|
-
return
|
|
486062
|
+
return join134(getVivusConfigHomeDir(), "usage-data");
|
|
486053
486063
|
}
|
|
486054
486064
|
function getFacetsDir() {
|
|
486055
|
-
return
|
|
486065
|
+
return join134(getDataDir(), "facets");
|
|
486056
486066
|
}
|
|
486057
486067
|
function getSessionMetaDir() {
|
|
486058
|
-
return
|
|
486068
|
+
return join134(getDataDir(), "session-meta");
|
|
486059
486069
|
}
|
|
486060
486070
|
function getLanguageFromPath(filePath) {
|
|
486061
486071
|
const ext = extname12(filePath).toLowerCase();
|
|
@@ -486400,7 +486410,7 @@ async function formatTranscriptWithSummarization(log) {
|
|
|
486400
486410
|
`);
|
|
486401
486411
|
}
|
|
486402
486412
|
async function loadCachedFacets(sessionId) {
|
|
486403
|
-
const facetPath =
|
|
486413
|
+
const facetPath = join134(getFacetsDir(), `${sessionId}.json`);
|
|
486404
486414
|
try {
|
|
486405
486415
|
const content = await readFile46(facetPath, { encoding: "utf-8" });
|
|
486406
486416
|
const parsed = jsonParse(content);
|
|
@@ -486419,14 +486429,14 @@ async function saveFacets(facets) {
|
|
|
486419
486429
|
try {
|
|
486420
486430
|
await mkdir39(getFacetsDir(), { recursive: true });
|
|
486421
486431
|
} catch {}
|
|
486422
|
-
const facetPath =
|
|
486432
|
+
const facetPath = join134(getFacetsDir(), `${facets.session_id}.json`);
|
|
486423
486433
|
await writeFile40(facetPath, jsonStringify(facets, null, 2), {
|
|
486424
486434
|
encoding: "utf-8",
|
|
486425
486435
|
mode: 384
|
|
486426
486436
|
});
|
|
486427
486437
|
}
|
|
486428
486438
|
async function loadCachedSessionMeta(sessionId) {
|
|
486429
|
-
const metaPath =
|
|
486439
|
+
const metaPath = join134(getSessionMetaDir(), `${sessionId}.json`);
|
|
486430
486440
|
try {
|
|
486431
486441
|
const content = await readFile46(metaPath, { encoding: "utf-8" });
|
|
486432
486442
|
return jsonParse(content);
|
|
@@ -486438,7 +486448,7 @@ async function saveSessionMeta(meta) {
|
|
|
486438
486448
|
try {
|
|
486439
486449
|
await mkdir39(getSessionMetaDir(), { recursive: true });
|
|
486440
486450
|
} catch {}
|
|
486441
|
-
const metaPath =
|
|
486451
|
+
const metaPath = join134(getSessionMetaDir(), `${meta.session_id}.json`);
|
|
486442
486452
|
await writeFile40(metaPath, jsonStringify(meta, null, 2), {
|
|
486443
486453
|
encoding: "utf-8",
|
|
486444
486454
|
mode: 384
|
|
@@ -487495,7 +487505,7 @@ function generateHtmlReport(data, insights) {
|
|
|
487495
487505
|
</html>`;
|
|
487496
487506
|
}
|
|
487497
487507
|
function buildExportData(data, insights, facets, remoteStats) {
|
|
487498
|
-
const version3 = typeof MACRO !== "undefined" ? "1.1.
|
|
487508
|
+
const version3 = typeof MACRO !== "undefined" ? "1.1.31+c38c44f" : "unknown";
|
|
487499
487509
|
const remote_hosts_collected = remoteStats?.hosts.filter((h2) => h2.sessionCount > 0).map((h2) => h2.name);
|
|
487500
487510
|
const facets_summary = {
|
|
487501
487511
|
total: facets.size,
|
|
@@ -487546,7 +487556,7 @@ async function scanAllSessions() {
|
|
|
487546
487556
|
} catch {
|
|
487547
487557
|
return [];
|
|
487548
487558
|
}
|
|
487549
|
-
const projectDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) =>
|
|
487559
|
+
const projectDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join134(projectsDir, dirent.name));
|
|
487550
487560
|
const allSessions = [];
|
|
487551
487561
|
for (let i2 = 0;i2 < projectDirs.length; i2++) {
|
|
487552
487562
|
const sessionFiles = await getSessionFilesWithMtime(projectDirs[i2]);
|
|
@@ -487568,7 +487578,7 @@ async function scanAllSessions() {
|
|
|
487568
487578
|
async function generateUsageReport(options2) {
|
|
487569
487579
|
let remoteStats;
|
|
487570
487580
|
if (process.env.USER_TYPE === "ant" && options2?.collectRemote) {
|
|
487571
|
-
const destDir =
|
|
487581
|
+
const destDir = join134(getVivusConfigHomeDir(), "projects");
|
|
487572
487582
|
const { hosts, totalCopied } = await collectAllRemoteHostData(destDir);
|
|
487573
487583
|
remoteStats = { hosts, totalCopied };
|
|
487574
487584
|
}
|
|
@@ -487707,7 +487717,7 @@ async function generateUsageReport(options2) {
|
|
|
487707
487717
|
try {
|
|
487708
487718
|
await mkdir39(getDataDir(), { recursive: true });
|
|
487709
487719
|
} catch {}
|
|
487710
|
-
const htmlPath =
|
|
487720
|
+
const htmlPath = join134(getDataDir(), "report.html");
|
|
487711
487721
|
await writeFile40(htmlPath, htmlReport, {
|
|
487712
487722
|
encoding: "utf-8",
|
|
487713
487723
|
mode: 384
|
|
@@ -487803,13 +487813,13 @@ var init_insights = __esm(() => {
|
|
|
487803
487813
|
} : async () => 0;
|
|
487804
487814
|
collectFromRemoteHost = process.env.USER_TYPE === "ant" ? async (homespace, destDir) => {
|
|
487805
487815
|
const result = { copied: 0, skipped: 0 };
|
|
487806
|
-
const tempDir = await mkdtemp(
|
|
487816
|
+
const tempDir = await mkdtemp(join134(tmpdir11(), "vivus-hs-"));
|
|
487807
487817
|
try {
|
|
487808
487818
|
const scpResult = await execFileNoThrow("scp", ["-rq", `${homespace}.coder:/root/.vivus/projects/`, tempDir], { timeout: 300000 });
|
|
487809
487819
|
if (scpResult.code !== 0) {
|
|
487810
487820
|
return result;
|
|
487811
487821
|
}
|
|
487812
|
-
const projectsDir =
|
|
487822
|
+
const projectsDir = join134(tempDir, "projects");
|
|
487813
487823
|
let projectDirents;
|
|
487814
487824
|
try {
|
|
487815
487825
|
projectDirents = await readdir28(projectsDir, { withFileTypes: true });
|
|
@@ -487818,11 +487828,11 @@ var init_insights = __esm(() => {
|
|
|
487818
487828
|
}
|
|
487819
487829
|
await Promise.all(projectDirents.map(async (dirent) => {
|
|
487820
487830
|
const projectName = dirent.name;
|
|
487821
|
-
const projectPath =
|
|
487831
|
+
const projectPath = join134(projectsDir, projectName);
|
|
487822
487832
|
if (!dirent.isDirectory())
|
|
487823
487833
|
return;
|
|
487824
487834
|
const destProjectName = `${projectName}__${homespace}`;
|
|
487825
|
-
const destProjectPath =
|
|
487835
|
+
const destProjectPath = join134(destDir, destProjectName);
|
|
487826
487836
|
try {
|
|
487827
487837
|
await mkdir39(destProjectPath, { recursive: true });
|
|
487828
487838
|
} catch {}
|
|
@@ -487836,8 +487846,8 @@ var init_insights = __esm(() => {
|
|
|
487836
487846
|
const fileName = fileDirent.name;
|
|
487837
487847
|
if (!fileName.endsWith(".jsonl"))
|
|
487838
487848
|
return;
|
|
487839
|
-
const srcFile =
|
|
487840
|
-
const destFile =
|
|
487849
|
+
const srcFile = join134(projectPath, fileName);
|
|
487850
|
+
const destFile = join134(destProjectPath, fileName);
|
|
487841
487851
|
try {
|
|
487842
487852
|
await copyFile10(srcFile, destFile, fsConstants7.COPYFILE_EXCL);
|
|
487843
487853
|
result.copied++;
|
|
@@ -488783,7 +488793,7 @@ import {
|
|
|
488783
488793
|
unlink as unlink22,
|
|
488784
488794
|
writeFile as writeFile41
|
|
488785
488795
|
} from "fs/promises";
|
|
488786
|
-
import { basename as basename40, dirname as dirname56, join as
|
|
488796
|
+
import { basename as basename40, dirname as dirname56, join as join135 } from "path";
|
|
488787
488797
|
function isTranscriptMessage(entry) {
|
|
488788
488798
|
return entry.type === "user" || entry.type === "assistant" || entry.type === "attachment" || entry.type === "system";
|
|
488789
488799
|
}
|
|
@@ -488797,18 +488807,18 @@ function isEphemeralToolProgress(dataType) {
|
|
|
488797
488807
|
return typeof dataType === "string" && EPHEMERAL_PROGRESS_TYPES.has(dataType);
|
|
488798
488808
|
}
|
|
488799
488809
|
function getProjectsDir2() {
|
|
488800
|
-
return
|
|
488810
|
+
return join135(getVivusConfigHomeDir(), "projects");
|
|
488801
488811
|
}
|
|
488802
488812
|
function getTranscriptPath() {
|
|
488803
488813
|
const projectDir = getSessionProjectDir() ?? getProjectDir2(getOriginalCwd());
|
|
488804
|
-
return
|
|
488814
|
+
return join135(projectDir, `${getSessionId()}.jsonl`);
|
|
488805
488815
|
}
|
|
488806
488816
|
function getTranscriptPathForSession(sessionId) {
|
|
488807
488817
|
if (sessionId === getSessionId()) {
|
|
488808
488818
|
return getTranscriptPath();
|
|
488809
488819
|
}
|
|
488810
488820
|
const projectDir = getProjectDir2(getOriginalCwd());
|
|
488811
|
-
return
|
|
488821
|
+
return join135(projectDir, `${sessionId}.jsonl`);
|
|
488812
488822
|
}
|
|
488813
488823
|
function setAgentTranscriptSubdir(agentId, subdir) {
|
|
488814
488824
|
agentTranscriptSubdirs.set(agentId, subdir);
|
|
@@ -488820,8 +488830,8 @@ function getAgentTranscriptPath(agentId) {
|
|
|
488820
488830
|
const projectDir = getSessionProjectDir() ?? getProjectDir2(getOriginalCwd());
|
|
488821
488831
|
const sessionId = getSessionId();
|
|
488822
488832
|
const subdir = agentTranscriptSubdirs.get(agentId);
|
|
488823
|
-
const base2 = subdir ?
|
|
488824
|
-
return
|
|
488833
|
+
const base2 = subdir ? join135(projectDir, sessionId, "subagents", subdir) : join135(projectDir, sessionId, "subagents");
|
|
488834
|
+
return join135(base2, `agent-${agentId}.jsonl`);
|
|
488825
488835
|
}
|
|
488826
488836
|
function getAgentMetadataPath(agentId) {
|
|
488827
488837
|
return getAgentTranscriptPath(agentId).replace(/\.jsonl$/, ".meta.json");
|
|
@@ -488844,10 +488854,10 @@ async function readAgentMetadata(agentId) {
|
|
|
488844
488854
|
}
|
|
488845
488855
|
function getRemoteAgentsDir() {
|
|
488846
488856
|
const projectDir = getSessionProjectDir() ?? getProjectDir2(getOriginalCwd());
|
|
488847
|
-
return
|
|
488857
|
+
return join135(projectDir, getSessionId(), "remote-agents");
|
|
488848
488858
|
}
|
|
488849
488859
|
function getRemoteAgentMetadataPath(taskId) {
|
|
488850
|
-
return
|
|
488860
|
+
return join135(getRemoteAgentsDir(), `remote-agent-${taskId}.meta.json`);
|
|
488851
488861
|
}
|
|
488852
488862
|
async function writeRemoteAgentMetadata(taskId, metadata) {
|
|
488853
488863
|
const path23 = getRemoteAgentMetadataPath(taskId);
|
|
@@ -488890,7 +488900,7 @@ async function listRemoteAgentMetadata() {
|
|
|
488890
488900
|
if (!entry.isFile() || !entry.name.endsWith(".meta.json"))
|
|
488891
488901
|
continue;
|
|
488892
488902
|
try {
|
|
488893
|
-
const raw = await readFile47(
|
|
488903
|
+
const raw = await readFile47(join135(dir, entry.name), "utf-8");
|
|
488894
488904
|
results.push(JSON.parse(raw));
|
|
488895
488905
|
} catch (e) {
|
|
488896
488906
|
logForDebugging(`listRemoteAgentMetadata: skipping ${entry.name}: ${String(e)}`);
|
|
@@ -488900,7 +488910,7 @@ async function listRemoteAgentMetadata() {
|
|
|
488900
488910
|
}
|
|
488901
488911
|
function sessionIdExists(sessionId) {
|
|
488902
488912
|
const projectDir = getProjectDir2(getOriginalCwd());
|
|
488903
|
-
const sessionFile =
|
|
488913
|
+
const sessionFile = join135(projectDir, `${sessionId}.jsonl`);
|
|
488904
488914
|
const fs10 = getFsImplementation();
|
|
488905
488915
|
try {
|
|
488906
488916
|
fs10.statSync(sessionFile);
|
|
@@ -490869,7 +490879,7 @@ async function loadTranscriptFile(filePath, opts) {
|
|
|
490869
490879
|
};
|
|
490870
490880
|
}
|
|
490871
490881
|
async function loadSessionFile(sessionId) {
|
|
490872
|
-
const sessionFile =
|
|
490882
|
+
const sessionFile = join135(getSessionProjectDir() ?? getProjectDir2(getOriginalCwd()), `${sessionId}.jsonl`);
|
|
490873
490883
|
return loadTranscriptFile(sessionFile);
|
|
490874
490884
|
}
|
|
490875
490885
|
function clearSessionMessagesCache() {
|
|
@@ -490937,7 +490947,7 @@ async function loadAllProjectsMessageLogsFull(limit) {
|
|
|
490937
490947
|
} catch {
|
|
490938
490948
|
return [];
|
|
490939
490949
|
}
|
|
490940
|
-
const projectDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) =>
|
|
490950
|
+
const projectDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join135(projectsDir, dirent.name));
|
|
490941
490951
|
const logsPerProject = await Promise.all(projectDirs.map((projectDir) => getLogsWithoutIndex(projectDir, limit)));
|
|
490942
490952
|
const allLogs = logsPerProject.flat();
|
|
490943
490953
|
const deduped = new Map;
|
|
@@ -490962,7 +490972,7 @@ async function loadAllProjectsMessageLogsProgressive(limit, initialEnrichCount =
|
|
|
490962
490972
|
} catch {
|
|
490963
490973
|
return { logs: [], allStatLogs: [], nextIndex: 0 };
|
|
490964
490974
|
}
|
|
490965
|
-
const projectDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) =>
|
|
490975
|
+
const projectDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join135(projectsDir, dirent.name));
|
|
490966
490976
|
const rawLogs = [];
|
|
490967
490977
|
for (const projectDir of projectDirs) {
|
|
490968
490978
|
rawLogs.push(...await getSessionFilesLite(projectDir, limit));
|
|
@@ -491023,7 +491033,7 @@ async function getStatOnlyLogsForWorktrees(worktreePaths, limit) {
|
|
|
491023
491033
|
for (const { path: wtPath, prefix } of indexed) {
|
|
491024
491034
|
if (dirName === prefix || dirName.startsWith(prefix + "-")) {
|
|
491025
491035
|
seenDirs.add(dirName);
|
|
491026
|
-
allLogs.push(...await getSessionFilesLite(
|
|
491036
|
+
allLogs.push(...await getSessionFilesLite(join135(projectsDir, dirent.name), undefined, wtPath));
|
|
491027
491037
|
break;
|
|
491028
491038
|
}
|
|
491029
491039
|
}
|
|
@@ -491092,7 +491102,7 @@ async function loadSubagentTranscripts(agentIds) {
|
|
|
491092
491102
|
return transcripts;
|
|
491093
491103
|
}
|
|
491094
491104
|
async function loadAllSubagentTranscriptsFromDisk() {
|
|
491095
|
-
const subagentsDir =
|
|
491105
|
+
const subagentsDir = join135(getSessionProjectDir() ?? getProjectDir2(getOriginalCwd()), getSessionId(), "subagents");
|
|
491096
491106
|
let entries;
|
|
491097
491107
|
try {
|
|
491098
491108
|
entries = await readdir29(subagentsDir, { withFileTypes: true });
|
|
@@ -491220,7 +491230,7 @@ async function getSessionFilesWithMtime(projectDir) {
|
|
|
491220
491230
|
const sessionId = validateUuid2(basename40(dirent.name, ".jsonl"));
|
|
491221
491231
|
if (!sessionId)
|
|
491222
491232
|
continue;
|
|
491223
|
-
candidates.push({ sessionId, filePath:
|
|
491233
|
+
candidates.push({ sessionId, filePath: join135(projectDir, dirent.name) });
|
|
491224
491234
|
}
|
|
491225
491235
|
await Promise.all(candidates.map(async ({ sessionId, filePath }) => {
|
|
491226
491236
|
try {
|
|
@@ -491606,7 +491616,7 @@ var init_sessionStorage = __esm(() => {
|
|
|
491606
491616
|
init_settings2();
|
|
491607
491617
|
init_slowOperations();
|
|
491608
491618
|
init_uuid();
|
|
491609
|
-
VERSION5 = typeof MACRO !== "undefined" ? "1.1.
|
|
491619
|
+
VERSION5 = typeof MACRO !== "undefined" ? "1.1.31+c38c44f" : "unknown";
|
|
491610
491620
|
MAX_TOMBSTONE_REWRITE_BYTES = 50 * 1024 * 1024;
|
|
491611
491621
|
SKIP_FIRST_PROMPT_PATTERN = /^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/;
|
|
491612
491622
|
EPHEMERAL_PROGRESS_TYPES = new Set([
|
|
@@ -491618,7 +491628,7 @@ var init_sessionStorage = __esm(() => {
|
|
|
491618
491628
|
MAX_TRANSCRIPT_READ_BYTES = 50 * 1024 * 1024;
|
|
491619
491629
|
agentTranscriptSubdirs = new Map;
|
|
491620
491630
|
getProjectDir2 = memoize_default((projectDir) => {
|
|
491621
|
-
return
|
|
491631
|
+
return join135(getProjectsDir2(), sanitizePath2(projectDir));
|
|
491622
491632
|
});
|
|
491623
491633
|
METADATA_TYPE_MARKERS = [
|
|
491624
491634
|
'"type":"summary"',
|
|
@@ -491862,7 +491872,7 @@ import {
|
|
|
491862
491872
|
dirname as dirname57,
|
|
491863
491873
|
extname as extname13,
|
|
491864
491874
|
isAbsolute as isAbsolute25,
|
|
491865
|
-
join as
|
|
491875
|
+
join as join136,
|
|
491866
491876
|
parse as parse12,
|
|
491867
491877
|
relative as relative26,
|
|
491868
491878
|
sep as sep32
|
|
@@ -492107,7 +492117,7 @@ async function processMdRules({
|
|
|
492107
492117
|
throw e;
|
|
492108
492118
|
}
|
|
492109
492119
|
for (const entry of entries) {
|
|
492110
|
-
const entryPath =
|
|
492120
|
+
const entryPath = join136(rulesDir, entry.name);
|
|
492111
492121
|
const { resolvedPath: resolvedEntryPath, isSymlink: isSymlink2 } = safeResolvePath(fs10, entryPath);
|
|
492112
492122
|
const stats2 = isSymlink2 ? await fs10.stat(resolvedEntryPath) : null;
|
|
492113
492123
|
const isDirectory = stats2 ? stats2.isDirectory() : entry.isDirectory();
|
|
@@ -492178,16 +492188,16 @@ async function getManagedAndUserConditionalRules(targetPath, processedPaths) {
|
|
|
492178
492188
|
async function getMemoryFilesForNestedDirectory(dir, targetPath, processedPaths) {
|
|
492179
492189
|
const result = [];
|
|
492180
492190
|
if (isSettingSourceEnabled("projectSettings")) {
|
|
492181
|
-
const projectPath =
|
|
492191
|
+
const projectPath = join136(dir, "VIVUS.md");
|
|
492182
492192
|
result.push(...await processMemoryFile(projectPath, "Project", processedPaths, false));
|
|
492183
|
-
const dotVivusPath =
|
|
492193
|
+
const dotVivusPath = join136(dir, ".vivus", "VIVUS.md");
|
|
492184
492194
|
result.push(...await processMemoryFile(dotVivusPath, "Project", processedPaths, false));
|
|
492185
492195
|
}
|
|
492186
492196
|
if (isSettingSourceEnabled("localSettings")) {
|
|
492187
|
-
const localPath =
|
|
492197
|
+
const localPath = join136(dir, "VIVUS.local.md");
|
|
492188
492198
|
result.push(...await processMemoryFile(localPath, "Local", processedPaths, false));
|
|
492189
492199
|
}
|
|
492190
|
-
const rulesDir =
|
|
492200
|
+
const rulesDir = join136(dir, ".vivus", "rules");
|
|
492191
492201
|
const unconditionalProcessedPaths = new Set(processedPaths);
|
|
492192
492202
|
result.push(...await processMdRules({
|
|
492193
492203
|
rulesDir,
|
|
@@ -492203,7 +492213,7 @@ async function getMemoryFilesForNestedDirectory(dir, targetPath, processedPaths)
|
|
|
492203
492213
|
return result;
|
|
492204
492214
|
}
|
|
492205
492215
|
async function getConditionalRulesForCwdLevelDirectory(dir, targetPath, processedPaths) {
|
|
492206
|
-
const rulesDir =
|
|
492216
|
+
const rulesDir = join136(dir, ".vivus", "rules");
|
|
492207
492217
|
return processConditionedMdRules(targetPath, rulesDir, "Project", processedPaths, false);
|
|
492208
492218
|
}
|
|
492209
492219
|
async function processConditionedMdRules(targetPath, rulesDir, type, processedPaths, includeExternal) {
|
|
@@ -492448,11 +492458,11 @@ var init_vivusmd = __esm(() => {
|
|
|
492448
492458
|
for (const dir of dirs.reverse()) {
|
|
492449
492459
|
const skipProject = isNestedWorktree && pathInWorkingPath(dir, canonicalRoot) && !pathInWorkingPath(dir, gitRoot);
|
|
492450
492460
|
if (isSettingSourceEnabled("projectSettings") && !skipProject) {
|
|
492451
|
-
const projectPath =
|
|
492461
|
+
const projectPath = join136(dir, "VIVUS.md");
|
|
492452
492462
|
result.push(...await processMemoryFile(projectPath, "Project", processedPaths, includeExternal));
|
|
492453
|
-
const dotVivusPath =
|
|
492463
|
+
const dotVivusPath = join136(dir, ".vivus", "VIVUS.md");
|
|
492454
492464
|
result.push(...await processMemoryFile(dotVivusPath, "Project", processedPaths, includeExternal));
|
|
492455
|
-
const rulesDir =
|
|
492465
|
+
const rulesDir = join136(dir, ".vivus", "rules");
|
|
492456
492466
|
result.push(...await processMdRules({
|
|
492457
492467
|
rulesDir,
|
|
492458
492468
|
type: "Project",
|
|
@@ -492462,18 +492472,18 @@ var init_vivusmd = __esm(() => {
|
|
|
492462
492472
|
}));
|
|
492463
492473
|
}
|
|
492464
492474
|
if (isSettingSourceEnabled("localSettings")) {
|
|
492465
|
-
const localPath =
|
|
492475
|
+
const localPath = join136(dir, "VIVUS.local.md");
|
|
492466
492476
|
result.push(...await processMemoryFile(localPath, "Local", processedPaths, includeExternal));
|
|
492467
492477
|
}
|
|
492468
492478
|
}
|
|
492469
492479
|
if (isEnvTruthy(process.env.VIVUS_CODE_ADDITIONAL_DIRECTORIES_VIVUS_MD)) {
|
|
492470
492480
|
const additionalDirs = getAdditionalDirectoriesForVivusMd();
|
|
492471
492481
|
for (const dir of additionalDirs) {
|
|
492472
|
-
const projectPath =
|
|
492482
|
+
const projectPath = join136(dir, "VIVUS.md");
|
|
492473
492483
|
result.push(...await processMemoryFile(projectPath, "Project", processedPaths, includeExternal));
|
|
492474
|
-
const dotVivusPath =
|
|
492484
|
+
const dotVivusPath = join136(dir, ".vivus", "VIVUS.md");
|
|
492475
492485
|
result.push(...await processMemoryFile(dotVivusPath, "Project", processedPaths, includeExternal));
|
|
492476
|
-
const rulesDir =
|
|
492486
|
+
const rulesDir = join136(dir, ".vivus", "rules");
|
|
492477
492487
|
result.push(...await processMdRules({
|
|
492478
492488
|
rulesDir,
|
|
492479
492489
|
type: "Project",
|
|
@@ -493040,7 +493050,7 @@ __export(exports_upstreamproxy, {
|
|
|
493040
493050
|
});
|
|
493041
493051
|
import { mkdir as mkdir41, readFile as readFile48, unlink as unlink23, writeFile as writeFile42 } from "fs/promises";
|
|
493042
493052
|
import { homedir as homedir34 } from "os";
|
|
493043
|
-
import { join as
|
|
493053
|
+
import { join as join137 } from "path";
|
|
493044
493054
|
async function initUpstreamProxy(opts) {
|
|
493045
493055
|
if (!isEnvTruthy(process.env.VIVUS_CODE_REMOTE)) {
|
|
493046
493056
|
return state;
|
|
@@ -493061,7 +493071,7 @@ async function initUpstreamProxy(opts) {
|
|
|
493061
493071
|
}
|
|
493062
493072
|
setNonDumpable();
|
|
493063
493073
|
const baseUrl = opts?.ccrBaseUrl ?? process.env.ANTHROPIC_BASE_URL ?? "https://api.anthropic.com";
|
|
493064
|
-
const caBundlePath = opts?.caBundlePath ??
|
|
493074
|
+
const caBundlePath = opts?.caBundlePath ?? join137(homedir34(), ".ccr", "ca-bundle.crt");
|
|
493065
493075
|
const caOk = await downloadCaBundle(baseUrl, opts?.systemCaPath ?? SYSTEM_CA_BUNDLE, caBundlePath);
|
|
493066
493076
|
if (!caOk)
|
|
493067
493077
|
return state;
|
|
@@ -493161,7 +493171,7 @@ async function downloadCaBundle(baseUrl, systemCaPath, outPath) {
|
|
|
493161
493171
|
}
|
|
493162
493172
|
const ccrCa = await resp.text();
|
|
493163
493173
|
const systemCa = await readFile48(systemCaPath, "utf8").catch(() => "");
|
|
493164
|
-
await mkdir41(
|
|
493174
|
+
await mkdir41(join137(outPath, ".."), { recursive: true });
|
|
493165
493175
|
await writeFile42(outPath, systemCa + `
|
|
493166
493176
|
` + ccrCa, "utf8");
|
|
493167
493177
|
return true;
|
|
@@ -494478,7 +494488,7 @@ function buildSystemInitMessage(inputs) {
|
|
|
494478
494488
|
slash_commands: inputs.commands.filter((c4) => c4.userInvocable !== false).map((c4) => c4.name),
|
|
494479
494489
|
apiKeySource: getAnthropicApiKeyWithSource().source,
|
|
494480
494490
|
betas: getSdkBetas(),
|
|
494481
|
-
vivus_code_version: "1.1.
|
|
494491
|
+
vivus_code_version: "1.1.31+c38c44f",
|
|
494482
494492
|
output_style: outputStyle2,
|
|
494483
494493
|
agents: inputs.agents.map((agent) => agent.agentType),
|
|
494484
494494
|
skills: inputs.skills.filter((s) => s.userInvocable !== false).map((skill) => skill.name),
|
|
@@ -500858,7 +500868,7 @@ var init_ShowInIDEPrompt = __esm(() => {
|
|
|
500858
500868
|
|
|
500859
500869
|
// src/components/permissions/FilePermissionDialog/permissionOptions.tsx
|
|
500860
500870
|
import { homedir as homedir35 } from "os";
|
|
500861
|
-
import { basename as basename45, join as
|
|
500871
|
+
import { basename as basename45, join as join138, sep as sep33 } from "path";
|
|
500862
500872
|
function isInVivusFolder(filePath) {
|
|
500863
500873
|
const absolutePath = expandPath(filePath);
|
|
500864
500874
|
const vivusFolderPath = expandPath(`${getOriginalCwd()}/.vivus`);
|
|
@@ -500868,7 +500878,7 @@ function isInVivusFolder(filePath) {
|
|
|
500868
500878
|
}
|
|
500869
500879
|
function isInGlobalVivusFolder(filePath) {
|
|
500870
500880
|
const absolutePath = expandPath(filePath);
|
|
500871
|
-
const globalVivusFolderPath =
|
|
500881
|
+
const globalVivusFolderPath = join138(homedir35(), ".vivus");
|
|
500872
500882
|
const normalizedAbsolutePath = normalizeCaseForComparison2(absolutePath);
|
|
500873
500883
|
const normalizedGlobalVivusFolderPath = normalizeCaseForComparison2(globalVivusFolderPath);
|
|
500874
500884
|
return normalizedAbsolutePath.startsWith(normalizedGlobalVivusFolderPath + sep33.toLowerCase()) || normalizedAbsolutePath.startsWith(normalizedGlobalVivusFolderPath + "/");
|
|
@@ -509106,7 +509116,7 @@ var init_useVoiceEnabled = __esm(() => {
|
|
|
509106
509116
|
function getSemverPart(version3) {
|
|
509107
509117
|
return `${import_semver13.major(version3, { loose: true })}.${import_semver13.minor(version3, { loose: true })}.${import_semver13.patch(version3, { loose: true })}`;
|
|
509108
509118
|
}
|
|
509109
|
-
function useUpdateNotification(updatedVersion, initialVersion = "1.1.
|
|
509119
|
+
function useUpdateNotification(updatedVersion, initialVersion = "1.1.31+c38c44f") {
|
|
509110
509120
|
const [lastNotifiedSemver, setLastNotifiedSemver] = import_react228.useState(() => getSemverPart(initialVersion));
|
|
509111
509121
|
if (!updatedVersion) {
|
|
509112
509122
|
return null;
|
|
@@ -509146,7 +509156,7 @@ function AutoUpdater({
|
|
|
509146
509156
|
return;
|
|
509147
509157
|
}
|
|
509148
509158
|
if (false) {}
|
|
509149
|
-
const currentVersion = "1.1.
|
|
509159
|
+
const currentVersion = "1.1.31+c38c44f";
|
|
509150
509160
|
const channel = getInitialSettings()?.autoUpdatesChannel ?? "latest";
|
|
509151
509161
|
let latestVersion = await getLatestVersion(channel);
|
|
509152
509162
|
const isDisabled = isAutoUpdaterDisabled();
|
|
@@ -509359,12 +509369,12 @@ function NativeAutoUpdater({
|
|
|
509359
509369
|
logEvent("tengu_native_auto_updater_start", {});
|
|
509360
509370
|
try {
|
|
509361
509371
|
const maxVersion = await getMaxVersion();
|
|
509362
|
-
if (maxVersion && gt("1.1.
|
|
509372
|
+
if (maxVersion && gt("1.1.31+c38c44f", maxVersion)) {
|
|
509363
509373
|
const msg = await getMaxVersionMessage();
|
|
509364
509374
|
setMaxVersionIssue(msg ?? "affects your version");
|
|
509365
509375
|
}
|
|
509366
509376
|
const result = await installLatest(channel);
|
|
509367
|
-
const currentVersion = "1.1.
|
|
509377
|
+
const currentVersion = "1.1.31+c38c44f";
|
|
509368
509378
|
const latencyMs = Date.now() - startTime;
|
|
509369
509379
|
if (result.lockFailed) {
|
|
509370
509380
|
logEvent("tengu_native_auto_updater_lock_contention", {
|
|
@@ -509501,17 +509511,17 @@ function PackageManagerAutoUpdater(t0) {
|
|
|
509501
509511
|
const maxVersion = await getMaxVersion();
|
|
509502
509512
|
if (maxVersion && latest && gt(latest, maxVersion)) {
|
|
509503
509513
|
logForDebugging(`PackageManagerAutoUpdater: maxVersion ${maxVersion} is set, capping update from ${latest} to ${maxVersion}`);
|
|
509504
|
-
if (gte("1.1.
|
|
509505
|
-
logForDebugging(`PackageManagerAutoUpdater: current version ${"1.1.
|
|
509514
|
+
if (gte("1.1.31+c38c44f", maxVersion)) {
|
|
509515
|
+
logForDebugging(`PackageManagerAutoUpdater: current version ${"1.1.31+c38c44f"} is already at or above maxVersion ${maxVersion}, skipping update`);
|
|
509506
509516
|
setUpdateAvailable(false);
|
|
509507
509517
|
return;
|
|
509508
509518
|
}
|
|
509509
509519
|
latest = maxVersion;
|
|
509510
509520
|
}
|
|
509511
|
-
const hasUpdate = latest && !gte("1.1.
|
|
509521
|
+
const hasUpdate = latest && !gte("1.1.31+c38c44f", latest) && !shouldSkipVersion(latest);
|
|
509512
509522
|
setUpdateAvailable(!!hasUpdate);
|
|
509513
509523
|
if (hasUpdate) {
|
|
509514
|
-
logForDebugging(`PackageManagerAutoUpdater: Update available ${"1.1.
|
|
509524
|
+
logForDebugging(`PackageManagerAutoUpdater: Update available ${"1.1.31+c38c44f"} -> ${latest}`);
|
|
509515
509525
|
}
|
|
509516
509526
|
};
|
|
509517
509527
|
$2[0] = t1;
|
|
@@ -509545,7 +509555,7 @@ function PackageManagerAutoUpdater(t0) {
|
|
|
509545
509555
|
wrap: "truncate",
|
|
509546
509556
|
children: [
|
|
509547
509557
|
"currentVersion: ",
|
|
509548
|
-
"1.1.
|
|
509558
|
+
"1.1.31+c38c44f"
|
|
509549
509559
|
]
|
|
509550
509560
|
}, undefined, true, undefined, this);
|
|
509551
509561
|
$2[3] = verbose;
|
|
@@ -517475,7 +517485,7 @@ function buildStatusLineCommandInput(permissionMode, exceeds200kTokens, settings
|
|
|
517475
517485
|
project_dir: getOriginalCwd(),
|
|
517476
517486
|
added_dirs: addedDirs
|
|
517477
517487
|
},
|
|
517478
|
-
version: "1.1.
|
|
517488
|
+
version: "1.1.31+c38c44f",
|
|
517479
517489
|
output_style: {
|
|
517480
517490
|
name: outputStyleName
|
|
517481
517491
|
},
|
|
@@ -523571,9 +523581,9 @@ function initSkillImprovement() {
|
|
|
523571
523581
|
async function applySkillImprovement(skillName, updates) {
|
|
523572
523582
|
if (!skillName)
|
|
523573
523583
|
return;
|
|
523574
|
-
const { join:
|
|
523584
|
+
const { join: join139 } = await import("path");
|
|
523575
523585
|
const fs10 = await import("fs/promises");
|
|
523576
|
-
const filePath =
|
|
523586
|
+
const filePath = join139(getCwd(), ".vivus", "skills", skillName, "SKILL.md");
|
|
523577
523587
|
let currentContent;
|
|
523578
523588
|
try {
|
|
523579
523589
|
currentContent = await fs10.readFile(filePath, "utf-8");
|
|
@@ -523727,7 +523737,7 @@ function useMoreRight(_args) {
|
|
|
523727
523737
|
// src/utils/cleanup.ts
|
|
523728
523738
|
import * as fs10 from "fs/promises";
|
|
523729
523739
|
import { homedir as homedir36 } from "os";
|
|
523730
|
-
import { join as
|
|
523740
|
+
import { join as join139 } from "path";
|
|
523731
523741
|
function getCutoffDate() {
|
|
523732
523742
|
const settings = getSettings_DEPRECATED() || {};
|
|
523733
523743
|
const cleanupPeriodDays = settings.cleanupPeriodDays ?? DEFAULT_CLEANUP_PERIOD_DAYS;
|
|
@@ -523752,7 +523762,7 @@ async function cleanupOldFilesInDirectory(dirPath, cutoffDate, isMessagePath) {
|
|
|
523752
523762
|
try {
|
|
523753
523763
|
const timestamp = convertFileNameToDate(file2.name);
|
|
523754
523764
|
if (timestamp < cutoffDate) {
|
|
523755
|
-
await getFsImplementation().unlink(
|
|
523765
|
+
await getFsImplementation().unlink(join139(dirPath, file2.name));
|
|
523756
523766
|
if (isMessagePath) {
|
|
523757
523767
|
result.messages++;
|
|
523758
523768
|
} else {
|
|
@@ -523783,7 +523793,7 @@ async function cleanupOldMessageFiles() {
|
|
|
523783
523793
|
} catch {
|
|
523784
523794
|
return result;
|
|
523785
523795
|
}
|
|
523786
|
-
const mcpLogDirs = dirents.filter((dirent) => dirent.isDirectory() && dirent.name.startsWith("mcp-logs-")).map((dirent) =>
|
|
523796
|
+
const mcpLogDirs = dirents.filter((dirent) => dirent.isDirectory() && dirent.name.startsWith("mcp-logs-")).map((dirent) => join139(baseCachePath, dirent.name));
|
|
523787
523797
|
for (const mcpLogDir of mcpLogDirs) {
|
|
523788
523798
|
result = addCleanupResults(result, await cleanupOldFilesInDirectory(mcpLogDir, cutoffDate, true));
|
|
523789
523799
|
await tryRmdir(mcpLogDir, fsImpl);
|
|
@@ -523822,7 +523832,7 @@ async function cleanupOldSessionFiles() {
|
|
|
523822
523832
|
for (const projectDirent of projectDirents) {
|
|
523823
523833
|
if (!projectDirent.isDirectory())
|
|
523824
523834
|
continue;
|
|
523825
|
-
const projectDir =
|
|
523835
|
+
const projectDir = join139(projectsDir, projectDirent.name);
|
|
523826
523836
|
let entries;
|
|
523827
523837
|
try {
|
|
523828
523838
|
entries = await fsImpl.readdir(projectDir);
|
|
@@ -523836,15 +523846,15 @@ async function cleanupOldSessionFiles() {
|
|
|
523836
523846
|
continue;
|
|
523837
523847
|
}
|
|
523838
523848
|
try {
|
|
523839
|
-
if (await unlinkIfOld(
|
|
523849
|
+
if (await unlinkIfOld(join139(projectDir, entry.name), cutoffDate, fsImpl)) {
|
|
523840
523850
|
result.messages++;
|
|
523841
523851
|
}
|
|
523842
523852
|
} catch {
|
|
523843
523853
|
result.errors++;
|
|
523844
523854
|
}
|
|
523845
523855
|
} else if (entry.isDirectory()) {
|
|
523846
|
-
const sessionDir =
|
|
523847
|
-
const toolResultsDir =
|
|
523856
|
+
const sessionDir = join139(projectDir, entry.name);
|
|
523857
|
+
const toolResultsDir = join139(sessionDir, TOOL_RESULTS_SUBDIR);
|
|
523848
523858
|
let toolDirs;
|
|
523849
523859
|
try {
|
|
523850
523860
|
toolDirs = await fsImpl.readdir(toolResultsDir);
|
|
@@ -523855,14 +523865,14 @@ async function cleanupOldSessionFiles() {
|
|
|
523855
523865
|
for (const toolEntry of toolDirs) {
|
|
523856
523866
|
if (toolEntry.isFile()) {
|
|
523857
523867
|
try {
|
|
523858
|
-
if (await unlinkIfOld(
|
|
523868
|
+
if (await unlinkIfOld(join139(toolResultsDir, toolEntry.name), cutoffDate, fsImpl)) {
|
|
523859
523869
|
result.messages++;
|
|
523860
523870
|
}
|
|
523861
523871
|
} catch {
|
|
523862
523872
|
result.errors++;
|
|
523863
523873
|
}
|
|
523864
523874
|
} else if (toolEntry.isDirectory()) {
|
|
523865
|
-
const toolDirPath =
|
|
523875
|
+
const toolDirPath = join139(toolResultsDir, toolEntry.name);
|
|
523866
523876
|
let toolFiles;
|
|
523867
523877
|
try {
|
|
523868
523878
|
toolFiles = await fsImpl.readdir(toolDirPath);
|
|
@@ -523873,7 +523883,7 @@ async function cleanupOldSessionFiles() {
|
|
|
523873
523883
|
if (!tf.isFile())
|
|
523874
523884
|
continue;
|
|
523875
523885
|
try {
|
|
523876
|
-
if (await unlinkIfOld(
|
|
523886
|
+
if (await unlinkIfOld(join139(toolDirPath, tf.name), cutoffDate, fsImpl)) {
|
|
523877
523887
|
result.messages++;
|
|
523878
523888
|
}
|
|
523879
523889
|
} catch {
|
|
@@ -523905,7 +523915,7 @@ async function cleanupSingleDirectory(dirPath, extension2, removeEmptyDir = true
|
|
|
523905
523915
|
if (!dirent.isFile() || !dirent.name.endsWith(extension2))
|
|
523906
523916
|
continue;
|
|
523907
523917
|
try {
|
|
523908
|
-
if (await unlinkIfOld(
|
|
523918
|
+
if (await unlinkIfOld(join139(dirPath, dirent.name), cutoffDate, fsImpl)) {
|
|
523909
523919
|
result.messages++;
|
|
523910
523920
|
}
|
|
523911
523921
|
} catch {
|
|
@@ -523918,7 +523928,7 @@ async function cleanupSingleDirectory(dirPath, extension2, removeEmptyDir = true
|
|
|
523918
523928
|
return result;
|
|
523919
523929
|
}
|
|
523920
523930
|
function cleanupOldPlanFiles() {
|
|
523921
|
-
const plansDir =
|
|
523931
|
+
const plansDir = join139(getVivusConfigHomeDir(), "plans");
|
|
523922
523932
|
return cleanupSingleDirectory(plansDir, ".md");
|
|
523923
523933
|
}
|
|
523924
523934
|
async function cleanupOldFileHistoryBackups() {
|
|
@@ -523927,14 +523937,14 @@ async function cleanupOldFileHistoryBackups() {
|
|
|
523927
523937
|
const fsImpl = getFsImplementation();
|
|
523928
523938
|
try {
|
|
523929
523939
|
const configDir = getVivusConfigHomeDir();
|
|
523930
|
-
const fileHistoryStorageDir =
|
|
523940
|
+
const fileHistoryStorageDir = join139(configDir, "file-history");
|
|
523931
523941
|
let dirents;
|
|
523932
523942
|
try {
|
|
523933
523943
|
dirents = await fsImpl.readdir(fileHistoryStorageDir);
|
|
523934
523944
|
} catch {
|
|
523935
523945
|
return result;
|
|
523936
523946
|
}
|
|
523937
|
-
const fileHistorySessionsDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) =>
|
|
523947
|
+
const fileHistorySessionsDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join139(fileHistoryStorageDir, dirent.name));
|
|
523938
523948
|
await Promise.all(fileHistorySessionsDirs.map(async (fileHistorySessionDir) => {
|
|
523939
523949
|
try {
|
|
523940
523950
|
const stats2 = await fsImpl.stat(fileHistorySessionDir);
|
|
@@ -523961,14 +523971,14 @@ async function cleanupOldSessionEnvDirs() {
|
|
|
523961
523971
|
const fsImpl = getFsImplementation();
|
|
523962
523972
|
try {
|
|
523963
523973
|
const configDir = getVivusConfigHomeDir();
|
|
523964
|
-
const sessionEnvBaseDir =
|
|
523974
|
+
const sessionEnvBaseDir = join139(configDir, "session-env");
|
|
523965
523975
|
let dirents;
|
|
523966
523976
|
try {
|
|
523967
523977
|
dirents = await fsImpl.readdir(sessionEnvBaseDir);
|
|
523968
523978
|
} catch {
|
|
523969
523979
|
return result;
|
|
523970
523980
|
}
|
|
523971
|
-
const sessionEnvDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) =>
|
|
523981
|
+
const sessionEnvDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join139(sessionEnvBaseDir, dirent.name));
|
|
523972
523982
|
for (const sessionEnvDir of sessionEnvDirs) {
|
|
523973
523983
|
try {
|
|
523974
523984
|
const stats2 = await fsImpl.stat(sessionEnvDir);
|
|
@@ -523990,7 +524000,7 @@ async function cleanupOldDebugLogs() {
|
|
|
523990
524000
|
const cutoffDate = getCutoffDate();
|
|
523991
524001
|
const result = { messages: 0, errors: 0 };
|
|
523992
524002
|
const fsImpl = getFsImplementation();
|
|
523993
|
-
const debugDir =
|
|
524003
|
+
const debugDir = join139(getVivusConfigHomeDir(), "debug");
|
|
523994
524004
|
let dirents;
|
|
523995
524005
|
try {
|
|
523996
524006
|
dirents = await fsImpl.readdir(debugDir);
|
|
@@ -524002,7 +524012,7 @@ async function cleanupOldDebugLogs() {
|
|
|
524002
524012
|
continue;
|
|
524003
524013
|
}
|
|
524004
524014
|
try {
|
|
524005
|
-
if (await unlinkIfOld(
|
|
524015
|
+
if (await unlinkIfOld(join139(debugDir, dirent.name), cutoffDate, fsImpl)) {
|
|
524006
524016
|
result.messages++;
|
|
524007
524017
|
}
|
|
524008
524018
|
} catch {
|
|
@@ -524012,7 +524022,7 @@ async function cleanupOldDebugLogs() {
|
|
|
524012
524022
|
return result;
|
|
524013
524023
|
}
|
|
524014
524024
|
async function cleanupNpmCacheForAnthropicPackages() {
|
|
524015
|
-
const markerPath =
|
|
524025
|
+
const markerPath = join139(getVivusConfigHomeDir(), ".npm-cache-cleanup");
|
|
524016
524026
|
try {
|
|
524017
524027
|
const stat45 = await fs10.stat(markerPath);
|
|
524018
524028
|
if (Date.now() - stat45.mtimeMs < ONE_DAY_MS) {
|
|
@@ -524027,7 +524037,7 @@ async function cleanupNpmCacheForAnthropicPackages() {
|
|
|
524027
524037
|
return;
|
|
524028
524038
|
}
|
|
524029
524039
|
logForDebugging("npm cache cleanup: starting");
|
|
524030
|
-
const npmCachePath =
|
|
524040
|
+
const npmCachePath = join139(homedir36(), ".npm", "_cacache");
|
|
524031
524041
|
const NPM_CACHE_RETENTION_COUNT = 5;
|
|
524032
524042
|
const startTime = Date.now();
|
|
524033
524043
|
try {
|
|
@@ -524082,7 +524092,7 @@ async function cleanupNpmCacheForAnthropicPackages() {
|
|
|
524082
524092
|
}
|
|
524083
524093
|
}
|
|
524084
524094
|
async function cleanupOldVersionsThrottled() {
|
|
524085
|
-
const markerPath =
|
|
524095
|
+
const markerPath = join139(getVivusConfigHomeDir(), ".version-cleanup");
|
|
524086
524096
|
try {
|
|
524087
524097
|
const stat45 = await fs10.stat(markerPath);
|
|
524088
524098
|
if (Date.now() - stat45.mtimeMs < ONE_DAY_MS) {
|
|
@@ -527313,7 +527323,7 @@ __export(exports_asciicast, {
|
|
|
527313
527323
|
_resetRecordingStateForTesting: () => _resetRecordingStateForTesting
|
|
527314
527324
|
});
|
|
527315
527325
|
import { appendFile as appendFile6, rename as rename10 } from "fs/promises";
|
|
527316
|
-
import { basename as basename54, dirname as dirname58, join as
|
|
527326
|
+
import { basename as basename54, dirname as dirname58, join as join141 } from "path";
|
|
527317
527327
|
function getRecordFilePath() {
|
|
527318
527328
|
if (recordingState.filePath !== null) {
|
|
527319
527329
|
return recordingState.filePath;
|
|
@@ -527324,10 +527334,10 @@ function getRecordFilePath() {
|
|
|
527324
527334
|
if (!isEnvTruthy(process.env.VIVUS_CODE_TERMINAL_RECORDING)) {
|
|
527325
527335
|
return null;
|
|
527326
527336
|
}
|
|
527327
|
-
const projectsDir =
|
|
527328
|
-
const projectDir =
|
|
527337
|
+
const projectsDir = join141(getVivusConfigHomeDir(), "projects");
|
|
527338
|
+
const projectDir = join141(projectsDir, sanitizePath2(getOriginalCwd()));
|
|
527329
527339
|
recordingState.timestamp = Date.now();
|
|
527330
|
-
recordingState.filePath =
|
|
527340
|
+
recordingState.filePath = join141(projectDir, `${getSessionId()}-${recordingState.timestamp}.cast`);
|
|
527331
527341
|
return recordingState.filePath;
|
|
527332
527342
|
}
|
|
527333
527343
|
function _resetRecordingStateForTesting() {
|
|
@@ -527336,13 +527346,13 @@ function _resetRecordingStateForTesting() {
|
|
|
527336
527346
|
}
|
|
527337
527347
|
function getSessionRecordingPaths() {
|
|
527338
527348
|
const sessionId = getSessionId();
|
|
527339
|
-
const projectsDir =
|
|
527340
|
-
const projectDir =
|
|
527349
|
+
const projectsDir = join141(getVivusConfigHomeDir(), "projects");
|
|
527350
|
+
const projectDir = join141(projectsDir, sanitizePath2(getOriginalCwd()));
|
|
527341
527351
|
try {
|
|
527342
527352
|
const entries = getFsImplementation().readdirSync(projectDir);
|
|
527343
527353
|
const names = typeof entries[0] === "string" ? entries : entries.map((e) => e.name);
|
|
527344
527354
|
const files2 = names.filter((f) => f.startsWith(sessionId) && f.endsWith(".cast")).sort();
|
|
527345
|
-
return files2.map((f) =>
|
|
527355
|
+
return files2.map((f) => join141(projectDir, f));
|
|
527346
527356
|
} catch {
|
|
527347
527357
|
return [];
|
|
527348
527358
|
}
|
|
@@ -527352,9 +527362,9 @@ async function renameRecordingForSession() {
|
|
|
527352
527362
|
if (!oldPath || recordingState.timestamp === 0) {
|
|
527353
527363
|
return;
|
|
527354
527364
|
}
|
|
527355
|
-
const projectsDir =
|
|
527356
|
-
const projectDir =
|
|
527357
|
-
const newPath =
|
|
527365
|
+
const projectsDir = join141(getVivusConfigHomeDir(), "projects");
|
|
527366
|
+
const projectDir = join141(projectsDir, sanitizePath2(getOriginalCwd()));
|
|
527367
|
+
const newPath = join141(projectDir, `${getSessionId()}-${recordingState.timestamp}.cast`);
|
|
527358
527368
|
if (oldPath === newPath) {
|
|
527359
527369
|
return;
|
|
527360
527370
|
}
|
|
@@ -528975,7 +528985,7 @@ async function submitTranscriptShare(messages, trigger, appearanceId) {
|
|
|
528975
528985
|
} catch {}
|
|
528976
528986
|
const data = {
|
|
528977
528987
|
trigger,
|
|
528978
|
-
version: "1.1.
|
|
528988
|
+
version: "1.1.31+c38c44f",
|
|
528979
528989
|
platform: process.platform,
|
|
528980
528990
|
transcript,
|
|
528981
528991
|
subagentTranscripts: Object.keys(subagentTranscripts).length > 0 ? subagentTranscripts : undefined,
|
|
@@ -530261,7 +530271,7 @@ var init_useChromeExtensionNotification = __esm(() => {
|
|
|
530261
530271
|
});
|
|
530262
530272
|
|
|
530263
530273
|
// src/utils/plugins/officialMarketplaceStartupCheck.ts
|
|
530264
|
-
import { join as
|
|
530274
|
+
import { join as join142 } from "path";
|
|
530265
530275
|
function isOfficialMarketplaceAutoInstallDisabled() {
|
|
530266
530276
|
return isEnvTruthy(process.env.VIVUS_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALL);
|
|
530267
530277
|
}
|
|
@@ -530344,7 +530354,7 @@ async function checkAndInstallOfficialMarketplace() {
|
|
|
530344
530354
|
return { installed: false, skipped: true, reason: "policy_blocked" };
|
|
530345
530355
|
}
|
|
530346
530356
|
const cacheDir = getMarketplacesCacheDir();
|
|
530347
|
-
const installLocation =
|
|
530357
|
+
const installLocation = join142(cacheDir, OFFICIAL_MARKETPLACE_NAME);
|
|
530348
530358
|
const gcsSha = await fetchOfficialMarketplaceFromGcs(installLocation, cacheDir);
|
|
530349
530359
|
if (gcsSha !== null) {
|
|
530350
530360
|
const known = await loadKnownMarketplacesConfig();
|
|
@@ -533365,7 +533375,7 @@ var init_usePluginRecommendationBase = __esm(() => {
|
|
|
533365
533375
|
});
|
|
533366
533376
|
|
|
533367
533377
|
// src/hooks/useLspPluginRecommendation.tsx
|
|
533368
|
-
import { extname as extname15, join as
|
|
533378
|
+
import { extname as extname15, join as join143 } from "path";
|
|
533369
533379
|
function useLspPluginRecommendation() {
|
|
533370
533380
|
const $2 = import_compiler_runtime356.c(12);
|
|
533371
533381
|
const trackedFiles = useAppState(_temp244);
|
|
@@ -533450,7 +533460,7 @@ function useLspPluginRecommendation() {
|
|
|
533450
533460
|
case "yes": {
|
|
533451
533461
|
installPluginAndNotify(pluginId, pluginName, "lsp-plugin", addNotification, async (pluginData) => {
|
|
533452
533462
|
logForDebugging(`[useLspPluginRecommendation] Installing plugin: ${pluginId}`);
|
|
533453
|
-
const localSourcePath = typeof pluginData.entry.source === "string" ?
|
|
533463
|
+
const localSourcePath = typeof pluginData.entry.source === "string" ? join143(pluginData.marketplaceInstallLocation, pluginData.entry.source) : undefined;
|
|
533454
533464
|
await cacheAndRegisterPlugin(pluginId, pluginData.entry, "user", undefined, localSourcePath);
|
|
533455
533465
|
const settings = getSettingsForSource("userSettings");
|
|
533456
533466
|
updateSettingsForSource("userSettings", {
|
|
@@ -536294,7 +536304,7 @@ var exports_REPL = {};
|
|
|
536294
536304
|
__export(exports_REPL, {
|
|
536295
536305
|
REPL: () => REPL
|
|
536296
536306
|
});
|
|
536297
|
-
import { dirname as dirname60, join as
|
|
536307
|
+
import { dirname as dirname60, join as join144 } from "path";
|
|
536298
536308
|
import { tmpdir as tmpdir12 } from "os";
|
|
536299
536309
|
import { writeFile as writeFile44 } from "fs/promises";
|
|
536300
536310
|
import { randomUUID as randomUUID48 } from "crypto";
|
|
@@ -538890,7 +538900,7 @@ Note: ctrl + z now suspends Vivus, ctrl + _ undoes input.
|
|
|
538890
538900
|
const w = Math.max(80, (process.stdout.columns ?? 80) - 6);
|
|
538891
538901
|
const raw = await renderMessagesToPlainText(deferredMessages, tools, w);
|
|
538892
538902
|
const text2 = raw.replace(/[ \t]+$/gm, "");
|
|
538893
|
-
const path25 =
|
|
538903
|
+
const path25 = join144(tmpdir12(), `cc-transcript-${Date.now()}.txt`);
|
|
538894
538904
|
await writeFile44(path25, text2);
|
|
538895
538905
|
const opened = openFileInExternalEditor(path25);
|
|
538896
538906
|
setStatus(opened ? `opening ${path25}` : `wrote ${path25} · no $VISUAL/$EDITOR set`);
|
|
@@ -540394,7 +540404,7 @@ function WelcomeV2() {
|
|
|
540394
540404
|
dimColor: true,
|
|
540395
540405
|
children: [
|
|
540396
540406
|
"v",
|
|
540397
|
-
"1.1.
|
|
540407
|
+
"1.1.31+c38c44f",
|
|
540398
540408
|
" "
|
|
540399
540409
|
]
|
|
540400
540410
|
}, undefined, true, undefined, this)
|
|
@@ -540594,7 +540604,7 @@ function WelcomeV2() {
|
|
|
540594
540604
|
dimColor: true,
|
|
540595
540605
|
children: [
|
|
540596
540606
|
"v",
|
|
540597
|
-
"1.1.
|
|
540607
|
+
"1.1.31+c38c44f",
|
|
540598
540608
|
" "
|
|
540599
540609
|
]
|
|
540600
540610
|
}, undefined, true, undefined, this)
|
|
@@ -540820,7 +540830,7 @@ function AppleTerminalWelcomeV2(t0) {
|
|
|
540820
540830
|
dimColor: true,
|
|
540821
540831
|
children: [
|
|
540822
540832
|
"v",
|
|
540823
|
-
"1.1.
|
|
540833
|
+
"1.1.31+c38c44f",
|
|
540824
540834
|
" "
|
|
540825
540835
|
]
|
|
540826
540836
|
}, undefined, true, undefined, this);
|
|
@@ -541074,7 +541084,7 @@ function AppleTerminalWelcomeV2(t0) {
|
|
|
541074
541084
|
dimColor: true,
|
|
541075
541085
|
children: [
|
|
541076
541086
|
"v",
|
|
541077
|
-
"1.1.
|
|
541087
|
+
"1.1.31+c38c44f",
|
|
541078
541088
|
" "
|
|
541079
541089
|
]
|
|
541080
541090
|
}, undefined, true, undefined, this);
|
|
@@ -544090,12 +544100,12 @@ function cliOk(msg) {
|
|
|
544090
544100
|
}
|
|
544091
544101
|
|
|
544092
544102
|
// src/utils/errorLogSink.ts
|
|
544093
|
-
import { dirname as dirname62, join as
|
|
544103
|
+
import { dirname as dirname62, join as join145 } from "path";
|
|
544094
544104
|
function getErrorsPath() {
|
|
544095
|
-
return
|
|
544105
|
+
return join145(CACHE_PATHS.errors(), DATE + ".jsonl");
|
|
544096
544106
|
}
|
|
544097
544107
|
function getMCPLogsPath(serverName) {
|
|
544098
|
-
return
|
|
544108
|
+
return join145(CACHE_PATHS.mcpLogs(serverName), DATE + ".jsonl");
|
|
544099
544109
|
}
|
|
544100
544110
|
function createJsonlWriter(options2) {
|
|
544101
544111
|
const writer = createBufferedWriter(options2);
|
|
@@ -544139,7 +544149,7 @@ function appendToLog(path25, message) {
|
|
|
544139
544149
|
cwd: getFsImplementation().cwd(),
|
|
544140
544150
|
userType: process.env.USER_TYPE,
|
|
544141
544151
|
sessionId: getSessionId(),
|
|
544142
|
-
version: "1.1.
|
|
544152
|
+
version: "1.1.31+c38c44f"
|
|
544143
544153
|
};
|
|
544144
544154
|
getLogWriter(path25).write(messageWithTimestamp);
|
|
544145
544155
|
}
|
|
@@ -544438,7 +544448,7 @@ var init_sessionMemory = __esm(() => {
|
|
|
544438
544448
|
// src/utils/iTermBackup.ts
|
|
544439
544449
|
import { copyFile as copyFile11, stat as stat47 } from "fs/promises";
|
|
544440
544450
|
import { homedir as homedir38 } from "os";
|
|
544441
|
-
import { join as
|
|
544451
|
+
import { join as join146 } from "path";
|
|
544442
544452
|
function markITerm2SetupComplete() {
|
|
544443
544453
|
saveGlobalConfig((current) => ({
|
|
544444
544454
|
...current,
|
|
@@ -544453,7 +544463,7 @@ function getIterm2RecoveryInfo() {
|
|
|
544453
544463
|
};
|
|
544454
544464
|
}
|
|
544455
544465
|
function getITerm2PlistPath() {
|
|
544456
|
-
return
|
|
544466
|
+
return join146(homedir38(), "Library", "Preferences", "com.googlecode.iterm2.plist");
|
|
544457
544467
|
}
|
|
544458
544468
|
async function checkAndRestoreITerm2Backup() {
|
|
544459
544469
|
const { inProgress, backupPath } = getIterm2RecoveryInfo();
|
|
@@ -547818,7 +547828,7 @@ var init_idleTimeout = __esm(() => {
|
|
|
547818
547828
|
// src/bridge/inboundAttachments.ts
|
|
547819
547829
|
import { randomUUID as randomUUID51 } from "crypto";
|
|
547820
547830
|
import { mkdir as mkdir42, writeFile as writeFile46 } from "fs/promises";
|
|
547821
|
-
import { basename as basename55, join as
|
|
547831
|
+
import { basename as basename55, join as join147 } from "path";
|
|
547822
547832
|
function debug(msg) {
|
|
547823
547833
|
logForDebugging(`[bridge:inbound-attach] ${msg}`);
|
|
547824
547834
|
}
|
|
@@ -547834,7 +547844,7 @@ function sanitizeFileName(name) {
|
|
|
547834
547844
|
return base2 || "attachment";
|
|
547835
547845
|
}
|
|
547836
547846
|
function uploadsDir() {
|
|
547837
|
-
return
|
|
547847
|
+
return join147(getVivusConfigHomeDir(), "uploads", getSessionId());
|
|
547838
547848
|
}
|
|
547839
547849
|
async function resolveOne(att) {
|
|
547840
547850
|
const token = getBridgeAccessToken();
|
|
@@ -547863,7 +547873,7 @@ async function resolveOne(att) {
|
|
|
547863
547873
|
const safeName = sanitizeFileName(att.file_name);
|
|
547864
547874
|
const prefix = (att.file_uuid.slice(0, 8) || randomUUID51().slice(0, 8)).replace(/[^a-zA-Z0-9_-]/g, "_");
|
|
547865
547875
|
const dir = uploadsDir();
|
|
547866
|
-
const outPath =
|
|
547876
|
+
const outPath = join147(dir, `${prefix}-${safeName}`);
|
|
547867
547877
|
try {
|
|
547868
547878
|
await mkdir42(dir, { recursive: true });
|
|
547869
547879
|
await writeFile46(outPath, data);
|
|
@@ -547963,7 +547973,7 @@ var init_sessionUrl = __esm(() => {
|
|
|
547963
547973
|
|
|
547964
547974
|
// src/utils/plugins/zipCacheAdapters.ts
|
|
547965
547975
|
import { readFile as readFile50 } from "fs/promises";
|
|
547966
|
-
import { join as
|
|
547976
|
+
import { join as join148 } from "path";
|
|
547967
547977
|
async function readZipCacheKnownMarketplaces() {
|
|
547968
547978
|
try {
|
|
547969
547979
|
const content = await readFile50(getZipCacheKnownMarketplacesPath(), "utf-8");
|
|
@@ -547988,13 +547998,13 @@ async function saveMarketplaceJsonToZipCache(marketplaceName, installLocation) {
|
|
|
547988
547998
|
const content = await readMarketplaceJsonContent(installLocation);
|
|
547989
547999
|
if (content !== null) {
|
|
547990
548000
|
const relPath = getMarketplaceJsonRelativePath(marketplaceName);
|
|
547991
|
-
await atomicWriteToZipCache(
|
|
548001
|
+
await atomicWriteToZipCache(join148(zipCachePath, relPath), content);
|
|
547992
548002
|
}
|
|
547993
548003
|
}
|
|
547994
548004
|
async function readMarketplaceJsonContent(dir) {
|
|
547995
548005
|
const candidates = [
|
|
547996
|
-
|
|
547997
|
-
|
|
548006
|
+
join148(dir, ".vivus-plugin", "marketplace.json"),
|
|
548007
|
+
join148(dir, "marketplace.json"),
|
|
547998
548008
|
dir
|
|
547999
548009
|
];
|
|
548000
548010
|
for (const candidate of candidates) {
|
|
@@ -548124,8 +548134,8 @@ async function getEnvLessBridgeConfig() {
|
|
|
548124
548134
|
}
|
|
548125
548135
|
async function checkEnvLessBridgeMinVersion() {
|
|
548126
548136
|
const cfg = await getEnvLessBridgeConfig();
|
|
548127
|
-
if (cfg.min_version && lt("1.1.
|
|
548128
|
-
return `Your version of Vivus (${"1.1.
|
|
548137
|
+
if (cfg.min_version && lt("1.1.31+c38c44f", cfg.min_version)) {
|
|
548138
|
+
return `Your version of Vivus (${"1.1.31+c38c44f"}) is too old for Remote Control.
|
|
548129
548139
|
Version ${cfg.min_version} or higher is required. Run \`vivus update\` to update.`;
|
|
548130
548140
|
}
|
|
548131
548141
|
return null;
|
|
@@ -548453,9 +548463,9 @@ __export(exports_bridgePointer, {
|
|
|
548453
548463
|
BRIDGE_POINTER_TTL_MS: () => BRIDGE_POINTER_TTL_MS
|
|
548454
548464
|
});
|
|
548455
548465
|
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
|
|
548466
|
+
import { dirname as dirname63, join as join149 } from "path";
|
|
548457
548467
|
function getBridgePointerPath(dir) {
|
|
548458
|
-
return
|
|
548468
|
+
return join149(getProjectsDir(), sanitizePath2(dir), "bridge-pointer.json");
|
|
548459
548469
|
}
|
|
548460
548470
|
async function writeBridgePointer(dir, pointer) {
|
|
548461
548471
|
const path25 = getBridgePointerPath(dir);
|
|
@@ -548599,7 +548609,7 @@ async function initBridgeCore(params) {
|
|
|
548599
548609
|
const rawApi = createBridgeApiClient({
|
|
548600
548610
|
baseUrl,
|
|
548601
548611
|
getAccessToken,
|
|
548602
|
-
runnerVersion: "1.1.
|
|
548612
|
+
runnerVersion: "1.1.31+c38c44f",
|
|
548603
548613
|
onDebug: logForDebugging,
|
|
548604
548614
|
onAuth401,
|
|
548605
548615
|
getTrustedDeviceToken
|
|
@@ -554264,7 +554274,7 @@ async function startMCPServer(cwd3, debug2, verbose) {
|
|
|
554264
554274
|
setCwd(cwd3);
|
|
554265
554275
|
const server = new Server({
|
|
554266
554276
|
name: "vivus/tengu",
|
|
554267
|
-
version: "1.1.
|
|
554277
|
+
version: "1.1.31+c38c44f"
|
|
554268
554278
|
}, {
|
|
554269
554279
|
capabilities: {
|
|
554270
554280
|
tools: {}
|
|
@@ -554396,14 +554406,14 @@ __export(exports_vivusDesktop, {
|
|
|
554396
554406
|
});
|
|
554397
554407
|
import { readdir as readdir30, readFile as readFile53, stat as stat50 } from "fs/promises";
|
|
554398
554408
|
import { homedir as homedir39 } from "os";
|
|
554399
|
-
import { join as
|
|
554409
|
+
import { join as join150 } from "path";
|
|
554400
554410
|
async function getVivusDesktopConfigPath() {
|
|
554401
554411
|
const platform5 = getPlatform();
|
|
554402
554412
|
if (!SUPPORTED_PLATFORMS.includes(platform5)) {
|
|
554403
554413
|
throw new Error(`Unsupported platform: ${platform5} - Vivus Desktop integration only works on macOS and WSL.`);
|
|
554404
554414
|
}
|
|
554405
554415
|
if (platform5 === "macos") {
|
|
554406
|
-
return
|
|
554416
|
+
return join150(homedir39(), "Library", "Application Support", "Vivus", "vivus_desktop_config.json");
|
|
554407
554417
|
}
|
|
554408
554418
|
const windowsHome = process.env.USERPROFILE ? process.env.USERPROFILE.replace(/\\/g, "/") : null;
|
|
554409
554419
|
if (windowsHome) {
|
|
@@ -554422,7 +554432,7 @@ async function getVivusDesktopConfigPath() {
|
|
|
554422
554432
|
if (user.name === "Public" || user.name === "Default" || user.name === "Default User" || user.name === "All Users") {
|
|
554423
554433
|
continue;
|
|
554424
554434
|
}
|
|
554425
|
-
const potentialConfigPath =
|
|
554435
|
+
const potentialConfigPath = join150(usersDir, user.name, "AppData", "Roaming", "Vivus", "vivus_desktop_config.json");
|
|
554426
554436
|
try {
|
|
554427
554437
|
await stat50(potentialConfigPath);
|
|
554428
554438
|
return potentialConfigPath;
|
|
@@ -555331,12 +555341,12 @@ __export(exports_install, {
|
|
|
555331
555341
|
install: () => install
|
|
555332
555342
|
});
|
|
555333
555343
|
import { homedir as homedir40 } from "node:os";
|
|
555334
|
-
import { join as
|
|
555344
|
+
import { join as join151 } from "node:path";
|
|
555335
555345
|
function getInstallationPath2() {
|
|
555336
555346
|
const isWindows2 = env3.platform === "win32";
|
|
555337
555347
|
const homeDir = homedir40();
|
|
555338
555348
|
if (isWindows2) {
|
|
555339
|
-
const windowsPath =
|
|
555349
|
+
const windowsPath = join151(homeDir, ".local", "bin", "vivus.exe");
|
|
555340
555350
|
return windowsPath.replace(/\//g, "\\");
|
|
555341
555351
|
}
|
|
555342
555352
|
return "~/.local/bin/vivus";
|
|
@@ -555875,7 +555885,7 @@ __export(exports_update, {
|
|
|
555875
555885
|
});
|
|
555876
555886
|
async function update() {
|
|
555877
555887
|
logEvent("tengu_update_check", {});
|
|
555878
|
-
writeToStdout(`Current version: ${"1.1.
|
|
555888
|
+
writeToStdout(`Current version: ${"1.1.31+c38c44f"}
|
|
555879
555889
|
`);
|
|
555880
555890
|
const channel = getInitialSettings()?.autoUpdatesChannel ?? "latest";
|
|
555881
555891
|
writeToStdout(`Checking for updates to ${channel} version...
|
|
@@ -555950,8 +555960,8 @@ async function update() {
|
|
|
555950
555960
|
writeToStdout(`Vivus is managed by Homebrew.
|
|
555951
555961
|
`);
|
|
555952
555962
|
const latest = await getLatestVersion(channel);
|
|
555953
|
-
if (latest && !gte("1.1.
|
|
555954
|
-
writeToStdout(`Update available: ${"1.1.
|
|
555963
|
+
if (latest && !gte("1.1.31+c38c44f", latest)) {
|
|
555964
|
+
writeToStdout(`Update available: ${"1.1.31+c38c44f"} → ${latest}
|
|
555955
555965
|
`);
|
|
555956
555966
|
writeToStdout(`
|
|
555957
555967
|
`);
|
|
@@ -555967,8 +555977,8 @@ async function update() {
|
|
|
555967
555977
|
writeToStdout(`Vivus is managed by winget.
|
|
555968
555978
|
`);
|
|
555969
555979
|
const latest = await getLatestVersion(channel);
|
|
555970
|
-
if (latest && !gte("1.1.
|
|
555971
|
-
writeToStdout(`Update available: ${"1.1.
|
|
555980
|
+
if (latest && !gte("1.1.31+c38c44f", latest)) {
|
|
555981
|
+
writeToStdout(`Update available: ${"1.1.31+c38c44f"} → ${latest}
|
|
555972
555982
|
`);
|
|
555973
555983
|
writeToStdout(`
|
|
555974
555984
|
`);
|
|
@@ -555984,8 +555994,8 @@ async function update() {
|
|
|
555984
555994
|
writeToStdout(`Vivus is managed by apk.
|
|
555985
555995
|
`);
|
|
555986
555996
|
const latest = await getLatestVersion(channel);
|
|
555987
|
-
if (latest && !gte("1.1.
|
|
555988
|
-
writeToStdout(`Update available: ${"1.1.
|
|
555997
|
+
if (latest && !gte("1.1.31+c38c44f", latest)) {
|
|
555998
|
+
writeToStdout(`Update available: ${"1.1.31+c38c44f"} → ${latest}
|
|
555989
555999
|
`);
|
|
555990
556000
|
writeToStdout(`
|
|
555991
556001
|
`);
|
|
@@ -556050,11 +556060,11 @@ async function update() {
|
|
|
556050
556060
|
`);
|
|
556051
556061
|
await gracefulShutdown(1);
|
|
556052
556062
|
}
|
|
556053
|
-
if (result.latestVersion === "1.1.
|
|
556054
|
-
writeToStdout(source_default.green(`Vivus is up to date (${"1.1.
|
|
556063
|
+
if (result.latestVersion === "1.1.31+c38c44f") {
|
|
556064
|
+
writeToStdout(source_default.green(`Vivus is up to date (${"1.1.31+c38c44f"})`) + `
|
|
556055
556065
|
`);
|
|
556056
556066
|
} else {
|
|
556057
|
-
writeToStdout(source_default.green(`Successfully updated from ${"1.1.
|
|
556067
|
+
writeToStdout(source_default.green(`Successfully updated from ${"1.1.31+c38c44f"} to version ${result.latestVersion}`) + `
|
|
556058
556068
|
`);
|
|
556059
556069
|
await regenerateCompletionCache();
|
|
556060
556070
|
}
|
|
@@ -556111,12 +556121,12 @@ async function update() {
|
|
|
556111
556121
|
`);
|
|
556112
556122
|
await gracefulShutdown(1);
|
|
556113
556123
|
}
|
|
556114
|
-
if (latestVersion === "1.1.
|
|
556115
|
-
writeToStdout(source_default.green(`Vivus is up to date (${"1.1.
|
|
556124
|
+
if (latestVersion === "1.1.31+c38c44f") {
|
|
556125
|
+
writeToStdout(source_default.green(`Vivus is up to date (${"1.1.31+c38c44f"})`) + `
|
|
556116
556126
|
`);
|
|
556117
556127
|
await gracefulShutdown(0);
|
|
556118
556128
|
}
|
|
556119
|
-
writeToStdout(`New version available: ${latestVersion} (current: ${"1.1.
|
|
556129
|
+
writeToStdout(`New version available: ${latestVersion} (current: ${"1.1.31+c38c44f"})
|
|
556120
556130
|
`);
|
|
556121
556131
|
writeToStdout(`Installing update...
|
|
556122
556132
|
`);
|
|
@@ -556161,7 +556171,7 @@ async function update() {
|
|
|
556161
556171
|
logForDebugging(`update: Installation status: ${status2}`);
|
|
556162
556172
|
switch (status2) {
|
|
556163
556173
|
case "success":
|
|
556164
|
-
writeToStdout(source_default.green(`Successfully updated from ${"1.1.
|
|
556174
|
+
writeToStdout(source_default.green(`Successfully updated from ${"1.1.31+c38c44f"} to version ${latestVersion}`) + `
|
|
556165
556175
|
`);
|
|
556166
556176
|
await regenerateCompletionCache();
|
|
556167
556177
|
break;
|
|
@@ -557135,7 +557145,7 @@ function completeOnboarding() {
|
|
|
557135
557145
|
saveGlobalConfig((current) => ({
|
|
557136
557146
|
...current,
|
|
557137
557147
|
hasCompletedOnboarding: true,
|
|
557138
|
-
lastOnboardingVersion: "1.1.
|
|
557148
|
+
lastOnboardingVersion: "1.1.31+c38c44f"
|
|
557139
557149
|
}));
|
|
557140
557150
|
}
|
|
557141
557151
|
function showDialog(root2, renderer) {
|
|
@@ -561309,7 +561319,7 @@ ${customInstructions}` : customInstructions;
|
|
|
561309
561319
|
}
|
|
561310
561320
|
}
|
|
561311
561321
|
logForDiagnosticsNoPII("info", "started", {
|
|
561312
|
-
version: "1.1.
|
|
561322
|
+
version: "1.1.31+c38c44f",
|
|
561313
561323
|
is_native_binary: isInBundledMode()
|
|
561314
561324
|
});
|
|
561315
561325
|
registerCleanup(async () => {
|
|
@@ -562093,7 +562103,7 @@ Usage: vivus --remote "your task description"`, () => gracefulShutdown(1));
|
|
|
562093
562103
|
pendingHookMessages
|
|
562094
562104
|
}, renderAndRun);
|
|
562095
562105
|
}
|
|
562096
|
-
}).version("1.1.
|
|
562106
|
+
}).version("1.1.31+c38c44f (Vivus)", "-v, --version", "Output the version number");
|
|
562097
562107
|
program2.option("-w, --worktree [name]", "Create a new git worktree for this session (optionally specify a name)");
|
|
562098
562108
|
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
562109
|
if (canUserConfigureAdvisor()) {
|