@dosu/cli 0.53.0-beta.2 → 0.53.0-beta.4
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/bin/dosu.js +140 -162
- package/package.json +1 -1
package/bin/dosu.js
CHANGED
|
@@ -5006,7 +5006,7 @@ function isNpxInvocation(channel = INSTALL_CHANNEL, env = process.env) {
|
|
|
5006
5006
|
function getVersionString() {
|
|
5007
5007
|
return `v${VERSION}`;
|
|
5008
5008
|
}
|
|
5009
|
-
var VERSION = "0.53.0-beta.
|
|
5009
|
+
var VERSION = "0.53.0-beta.4", INSTALL_CHANNEL = "npm";
|
|
5010
5010
|
|
|
5011
5011
|
// src/debug/logger.ts
|
|
5012
5012
|
import {
|
|
@@ -5328,10 +5328,22 @@ function visibleWidth(text) {
|
|
|
5328
5328
|
return text.replace(ANSI_PATTERN2, "").length;
|
|
5329
5329
|
}
|
|
5330
5330
|
function tabStrip(labels, active2, width, { spread = true } = {}) {
|
|
5331
|
+
if (!spread) {
|
|
5332
|
+
const cellW = Math.max(...labels.map(([, label]) => label.length)) + 2 * TAB_CELL_PAD;
|
|
5333
|
+
let row2 = "";
|
|
5334
|
+
let rule2 = "";
|
|
5335
|
+
for (const [id, label] of labels) {
|
|
5336
|
+
const left = Math.floor((cellW - label.length) / 2);
|
|
5337
|
+
const cell = " ".repeat(left) + label + " ".repeat(cellW - label.length - left);
|
|
5338
|
+
row2 += id === active2 ? brand(import_picocolors9.default.bold(cell)) : import_picocolors9.default.dim(cell);
|
|
5339
|
+
rule2 += id === active2 ? brand("━".repeat(cellW)) : import_picocolors9.default.dim("─".repeat(cellW));
|
|
5340
|
+
}
|
|
5341
|
+
return [row2, rule2];
|
|
5342
|
+
}
|
|
5331
5343
|
const GAP_MIN = 3;
|
|
5332
5344
|
const totalLen = labels.reduce((sum, [, label]) => sum + label.length, 0);
|
|
5333
5345
|
const slots = Math.max(1, labels.length - 1);
|
|
5334
|
-
const spare =
|
|
5346
|
+
const spare = Math.max(GAP_MIN * slots, width - totalLen);
|
|
5335
5347
|
const baseGap = Math.floor(spare / slots);
|
|
5336
5348
|
const bonus = spare % slots;
|
|
5337
5349
|
let row = "";
|
|
@@ -5353,8 +5365,7 @@ function tabStrip(labels, active2, width, { spread = true } = {}) {
|
|
|
5353
5365
|
}
|
|
5354
5366
|
col += label.length;
|
|
5355
5367
|
});
|
|
5356
|
-
const
|
|
5357
|
-
const tail = Math.max(0, ruleEnd - activeStart - activeLen);
|
|
5368
|
+
const tail = Math.max(0, width - activeStart - activeLen);
|
|
5358
5369
|
const rule = import_picocolors9.default.dim("─".repeat(activeStart)) + brand("━".repeat(activeLen)) + import_picocolors9.default.dim("─".repeat(tail));
|
|
5359
5370
|
return [row, rule];
|
|
5360
5371
|
}
|
|
@@ -5414,7 +5425,7 @@ function installCenteredLayout(stream = process.stdout) {
|
|
|
5414
5425
|
active = false;
|
|
5415
5426
|
};
|
|
5416
5427
|
}
|
|
5417
|
-
var import_picocolors9, ESC2, CONTENT_WIDTH = 64, TOKEN_PATTERN, COLUMN_RESET_FINALS, active = false, ANSI_PATTERN2;
|
|
5428
|
+
var import_picocolors9, ESC2, CONTENT_WIDTH = 64, TOKEN_PATTERN, COLUMN_RESET_FINALS, active = false, ANSI_PATTERN2, TAB_CELL_PAD = 2;
|
|
5418
5429
|
var init_layout = __esm(() => {
|
|
5419
5430
|
init_styles();
|
|
5420
5431
|
import_picocolors9 = __toESM(require_picocolors(), 1);
|
|
@@ -8422,6 +8433,8 @@ function loadSyncState(configDir = getConfigDir()) {
|
|
|
8422
8433
|
})) : [];
|
|
8423
8434
|
const rawRefusal = raw.last_refusal;
|
|
8424
8435
|
const lastRefusal = rawRefusal && typeof rawRefusal.at === "string" && typeof rawRefusal.outcome === "string" && typeof rawRefusal.message === "string" ? { at: rawRefusal.at, outcome: rawRefusal.outcome, message: rawRefusal.message } : undefined;
|
|
8436
|
+
const rawRun = raw.run;
|
|
8437
|
+
const run2 = rawRun && typeof rawRun.pid === "number" && typeof rawRun.started_at === "string" && typeof rawRun.baseline_mined === "number" && rawRun.baseline_mined >= 0 ? { pid: rawRun.pid, started_at: rawRun.started_at, baseline_mined: rawRun.baseline_mined } : undefined;
|
|
8425
8438
|
return {
|
|
8426
8439
|
schema_version: STATE_SCHEMA_VERSION,
|
|
8427
8440
|
watermark: typeof raw.watermark === "string" ? raw.watermark : null,
|
|
@@ -8432,6 +8445,7 @@ function loadSyncState(configDir = getConfigDir()) {
|
|
|
8432
8445
|
total_notes: typeof raw.total_notes === "number" && raw.total_notes >= 0 ? raw.total_notes : 0,
|
|
8433
8446
|
total_learning_tokens: typeof raw.total_learning_tokens === "number" && raw.total_learning_tokens >= 0 ? raw.total_learning_tokens : 0,
|
|
8434
8447
|
...lastRefusal ? { last_refusal: lastRefusal } : {},
|
|
8448
|
+
...run2 ? { run: run2 } : {},
|
|
8435
8449
|
...Array.isArray(raw.project_filter) ? {
|
|
8436
8450
|
project_filter: raw.project_filter.filter((p2) => typeof p2 === "string")
|
|
8437
8451
|
} : {}
|
|
@@ -9107,6 +9121,13 @@ async function runKnowledgeSync(options = {}) {
|
|
|
9107
9121
|
return { status: "skipped-lock", ...base };
|
|
9108
9122
|
}
|
|
9109
9123
|
try {
|
|
9124
|
+
if (state.run?.pid !== process.pid) {
|
|
9125
|
+
state.run = {
|
|
9126
|
+
pid: process.pid,
|
|
9127
|
+
started_at: now().toISOString(),
|
|
9128
|
+
baseline_mined: state.total_mined ?? 0
|
|
9129
|
+
};
|
|
9130
|
+
}
|
|
9110
9131
|
const worthMining = deps.worthMining ?? isWorthMining;
|
|
9111
9132
|
const examined = [];
|
|
9112
9133
|
const batch = [];
|
|
@@ -9399,20 +9420,12 @@ Read each session with read_session, decide what (if anything) is durable per yo
|
|
|
9399
9420
|
}
|
|
9400
9421
|
|
|
9401
9422
|
// src/miner/prompt-core.ts
|
|
9402
|
-
function extractMinerCore(markdown) {
|
|
9403
|
-
const start = markdown.indexOf(MINER_CORE_START);
|
|
9404
|
-
const end = markdown.indexOf(MINER_CORE_END);
|
|
9405
|
-
if (start === -1 || end === -1 || end <= start) {
|
|
9406
|
-
throw new Error(`miner-core markers not found (expected ${MINER_CORE_START} … ${MINER_CORE_END})`);
|
|
9407
|
-
}
|
|
9408
|
-
return markdown.slice(start + MINER_CORE_START.length, end).trim();
|
|
9409
|
-
}
|
|
9410
|
-
var MINER_CORE_START = "<!-- dosu:miner-core:start -->", MINER_CORE_END = "<!-- dosu:miner-core:end -->";
|
|
9411
|
-
|
|
9412
|
-
// src/miner/prompt-core.generated.ts
|
|
9413
9423
|
var MINER_CORE_RULES = `Rules — non-negotiable:
|
|
9414
|
-
1. Before writing anything, call read_knowledge with the candidate topic
|
|
9415
|
-
|
|
9424
|
+
1. Before writing anything, call read_knowledge with the candidate topic. If the same fact is
|
|
9425
|
+
already recorded, skip it — never write a duplicate or near-duplicate. If the topic exists but
|
|
9426
|
+
the session shows it has changed or been superseded, do write: a note stating the current state
|
|
9427
|
+
and what changed. Only restatements of already-recorded facts are duplicates; an update to an
|
|
9428
|
+
existing topic is not.
|
|
9416
9429
|
2. Write ONLY durable, non-obvious knowledge:
|
|
9417
9430
|
- decisions and their rationale (chose A over B because ...)
|
|
9418
9431
|
- non-obvious constraints (API, schema, RLS, feature flags, deploy quirks)
|
|
@@ -9440,43 +9453,6 @@ verified, omit both.
|
|
|
9440
9453
|
long verbatim transcript spans. Summarize in your own words.
|
|
9441
9454
|
9. A trivial session with no real user query is normal: skip it silently.`;
|
|
9442
9455
|
|
|
9443
|
-
// src/miner/prompt-source.ts
|
|
9444
|
-
import { readFileSync as readFileSync15 } from "node:fs";
|
|
9445
|
-
import { homedir as homedir5 } from "node:os";
|
|
9446
|
-
import { join as join14 } from "node:path";
|
|
9447
|
-
function candidateSkillPromptPaths(env = process.env) {
|
|
9448
|
-
const paths = [];
|
|
9449
|
-
if (env.DOSU_SKILL_REPO?.trim()) {
|
|
9450
|
-
paths.push(join14(env.DOSU_SKILL_REPO.trim(), "skills", SKILL_PROMPT_RELPATH));
|
|
9451
|
-
}
|
|
9452
|
-
paths.push(join14(homedir5(), ".agents", "skills", SKILL_PROMPT_RELPATH));
|
|
9453
|
-
const claudeConfigDir = env.CLAUDE_CONFIG_DIR?.trim() || join14(homedir5(), ".claude");
|
|
9454
|
-
paths.push(join14(claudeConfigDir, "skills", SKILL_PROMPT_RELPATH));
|
|
9455
|
-
paths.push(join14(homedir5(), ".codeium", "windsurf", "skills", SKILL_PROMPT_RELPATH));
|
|
9456
|
-
return paths;
|
|
9457
|
-
}
|
|
9458
|
-
function resolveMinerCoreRules(env = process.env) {
|
|
9459
|
-
for (const path3 of candidateSkillPromptPaths(env)) {
|
|
9460
|
-
let markdown;
|
|
9461
|
-
try {
|
|
9462
|
-
markdown = readFileSync15(path3, "utf-8");
|
|
9463
|
-
} catch {
|
|
9464
|
-
continue;
|
|
9465
|
-
}
|
|
9466
|
-
try {
|
|
9467
|
-
return { rules: extractMinerCore(markdown), source: path3 };
|
|
9468
|
-
} catch (err) {
|
|
9469
|
-
logger.debug("miner", `skipping unusable skill rules at ${path3}: ${err}`);
|
|
9470
|
-
}
|
|
9471
|
-
}
|
|
9472
|
-
return { rules: MINER_CORE_RULES, source: "bundled" };
|
|
9473
|
-
}
|
|
9474
|
-
var SKILL_PROMPT_RELPATH;
|
|
9475
|
-
var init_prompt_source = __esm(() => {
|
|
9476
|
-
init_logger();
|
|
9477
|
-
SKILL_PROMPT_RELPATH = join14("log-to-dosu-knowledge", "references", "miner-system-prompt.md");
|
|
9478
|
-
});
|
|
9479
|
-
|
|
9480
9456
|
// node_modules/@anthropic-ai/claude-agent-sdk/sdk.mjs
|
|
9481
9457
|
var exports_sdk = {};
|
|
9482
9458
|
__export(exports_sdk, {
|
|
@@ -71389,13 +71365,11 @@ async function runMiner(options) {
|
|
|
71389
71365
|
cliVersion: getVersionString(),
|
|
71390
71366
|
deploymentID: options.deploymentID
|
|
71391
71367
|
});
|
|
71392
|
-
const coreRules = resolveMinerCoreRules();
|
|
71393
|
-
logger.debug("miner", `write-knowledge rules source: ${coreRules.source}`);
|
|
71394
71368
|
try {
|
|
71395
71369
|
const run2 = query({
|
|
71396
71370
|
prompt: buildMinerPrompt(options.sessions),
|
|
71397
71371
|
options: {
|
|
71398
|
-
systemPrompt: buildMinerSystemPrompt(
|
|
71372
|
+
systemPrompt: buildMinerSystemPrompt(MINER_CORE_RULES),
|
|
71399
71373
|
env,
|
|
71400
71374
|
abortController: abort,
|
|
71401
71375
|
maxTurns: options.maxTurns ?? DEFAULT_MAX_TURNS,
|
|
@@ -71496,7 +71470,6 @@ var init_runner = __esm(() => {
|
|
|
71496
71470
|
init_conflicts();
|
|
71497
71471
|
init_env();
|
|
71498
71472
|
init_executable();
|
|
71499
|
-
init_prompt_source();
|
|
71500
71473
|
init_tools();
|
|
71501
71474
|
DEFAULT_TIMEOUT_MS2 = 30 * 60 * 1000;
|
|
71502
71475
|
GATEWAY_ERRORS = {
|
|
@@ -71516,17 +71489,17 @@ var init_runner = __esm(() => {
|
|
|
71516
71489
|
});
|
|
71517
71490
|
|
|
71518
71491
|
// src/version/skill-update-check.ts
|
|
71519
|
-
import { existsSync as existsSync17, mkdirSync as mkdirSync9, readFileSync as
|
|
71520
|
-
import { join as
|
|
71492
|
+
import { existsSync as existsSync17, mkdirSync as mkdirSync9, readFileSync as readFileSync17, writeFileSync as writeFileSync10 } from "node:fs";
|
|
71493
|
+
import { join as join19 } from "node:path";
|
|
71521
71494
|
function getCachePath2() {
|
|
71522
|
-
return
|
|
71495
|
+
return join19(getConfigDir(), CACHE_FILENAME3);
|
|
71523
71496
|
}
|
|
71524
71497
|
function readSkillCache() {
|
|
71525
71498
|
try {
|
|
71526
71499
|
const path3 = getCachePath2();
|
|
71527
71500
|
if (!existsSync17(path3))
|
|
71528
71501
|
return null;
|
|
71529
|
-
const data = JSON.parse(
|
|
71502
|
+
const data = JSON.parse(readFileSync17(path3, "utf-8"));
|
|
71530
71503
|
if (typeof data.lastCheck === "number" && typeof data.latestSha === "string" && typeof data.installedSha === "string") {
|
|
71531
71504
|
return data;
|
|
71532
71505
|
}
|
|
@@ -71614,8 +71587,8 @@ var init_skill_update_check = __esm(() => {
|
|
|
71614
71587
|
|
|
71615
71588
|
// src/commands/skill.ts
|
|
71616
71589
|
import { exec as exec2, execSync as execSync2 } from "node:child_process";
|
|
71617
|
-
import { homedir as
|
|
71618
|
-
import { join as
|
|
71590
|
+
import { homedir as homedir6 } from "node:os";
|
|
71591
|
+
import { join as join20 } from "node:path";
|
|
71619
71592
|
function skillAgentIDsForProviders(providerIDs) {
|
|
71620
71593
|
return [
|
|
71621
71594
|
...new Set(providerIDs.map((providerID) => SKILL_AGENT_BY_PROVIDER[providerID]).filter((agent) => Boolean(agent)))
|
|
@@ -71626,17 +71599,17 @@ function skillInstallTargetForProvider(providerID) {
|
|
|
71626
71599
|
if (!agentID)
|
|
71627
71600
|
return null;
|
|
71628
71601
|
if (agentID === "claude-code") {
|
|
71629
|
-
const claudeConfigDir = process.env.CLAUDE_CONFIG_DIR?.trim() ||
|
|
71630
|
-
return { path:
|
|
71602
|
+
const claudeConfigDir = process.env.CLAUDE_CONFIG_DIR?.trim() || join20(homedir6(), ".claude");
|
|
71603
|
+
return { path: join20(claudeConfigDir, "skills", SKILL_NAME), symlink: true };
|
|
71631
71604
|
}
|
|
71632
71605
|
if (agentID === "windsurf") {
|
|
71633
71606
|
return {
|
|
71634
|
-
path:
|
|
71607
|
+
path: join20(homedir6(), ".codeium", "windsurf", "skills", SKILL_NAME),
|
|
71635
71608
|
symlink: true
|
|
71636
71609
|
};
|
|
71637
71610
|
}
|
|
71638
71611
|
return {
|
|
71639
|
-
path:
|
|
71612
|
+
path: join20(homedir6(), ".agents", "skills", SKILL_NAME),
|
|
71640
71613
|
symlink: false
|
|
71641
71614
|
};
|
|
71642
71615
|
}
|
|
@@ -71798,14 +71771,14 @@ import {
|
|
|
71798
71771
|
existsSync as existsSync18,
|
|
71799
71772
|
lstatSync as lstatSync2,
|
|
71800
71773
|
mkdirSync as mkdirSync10,
|
|
71801
|
-
readFileSync as
|
|
71774
|
+
readFileSync as readFileSync18,
|
|
71802
71775
|
renameSync as renameSync5,
|
|
71803
71776
|
unlinkSync as unlinkSync3,
|
|
71804
71777
|
writeFileSync as writeFileSync11
|
|
71805
71778
|
} from "node:fs";
|
|
71806
|
-
import { join as
|
|
71779
|
+
import { join as join21 } from "node:path";
|
|
71807
71780
|
function getTelemetrySettingsPath() {
|
|
71808
|
-
return
|
|
71781
|
+
return join21(getConfigDir(), TELEMETRY_SETTINGS_FILENAME);
|
|
71809
71782
|
}
|
|
71810
71783
|
function loadTelemetrySettings() {
|
|
71811
71784
|
return readTelemetrySettings().settings;
|
|
@@ -71873,7 +71846,7 @@ function readTelemetrySettings() {
|
|
|
71873
71846
|
}
|
|
71874
71847
|
let content;
|
|
71875
71848
|
try {
|
|
71876
|
-
content =
|
|
71849
|
+
content = readFileSync18(path3, "utf-8");
|
|
71877
71850
|
} catch {
|
|
71878
71851
|
return { status: "error", settings: disabledTelemetrySettings() };
|
|
71879
71852
|
}
|
|
@@ -71951,7 +71924,7 @@ var init_settings = __esm(() => {
|
|
|
71951
71924
|
});
|
|
71952
71925
|
|
|
71953
71926
|
// src/telemetry/debug-id.ts
|
|
71954
|
-
var BUNDLE_DEBUG_ID_PLACEHOLDER = "
|
|
71927
|
+
var BUNDLE_DEBUG_ID_PLACEHOLDER = "6c656d2d-4b9b-0be3-6475-6e2164756e21";
|
|
71955
71928
|
|
|
71956
71929
|
// src/telemetry/telemetry.ts
|
|
71957
71930
|
import { randomUUID as randomUUID4 } from "node:crypto";
|
|
@@ -72819,7 +72792,7 @@ var init_antigravity = __esm(() => {
|
|
|
72819
72792
|
});
|
|
72820
72793
|
|
|
72821
72794
|
// src/mcp/providers/claude.ts
|
|
72822
|
-
import { join as
|
|
72795
|
+
import { join as join22 } from "node:path";
|
|
72823
72796
|
var ClaudeProvider = () => createJSONProvider({
|
|
72824
72797
|
providerName: "Claude Code",
|
|
72825
72798
|
providerID: "claude",
|
|
@@ -72828,24 +72801,24 @@ var ClaudeProvider = () => createJSONProvider({
|
|
|
72828
72801
|
paths: ["~/.claude"],
|
|
72829
72802
|
globalPath: "~/.claude.json",
|
|
72830
72803
|
topKey: "mcpServers",
|
|
72831
|
-
localConfigPath: (cwd) =>
|
|
72804
|
+
localConfigPath: (cwd) => join22(cwd, ".mcp.json")
|
|
72832
72805
|
});
|
|
72833
72806
|
var init_claude = __esm(() => {
|
|
72834
72807
|
init_base();
|
|
72835
72808
|
});
|
|
72836
72809
|
|
|
72837
72810
|
// src/mcp/providers/claude-desktop.ts
|
|
72838
|
-
import { join as
|
|
72811
|
+
import { join as join23 } from "node:path";
|
|
72839
72812
|
function configPath() {
|
|
72840
|
-
return
|
|
72813
|
+
return join23(appSupportDir(), "Claude", "claude_desktop_config.json");
|
|
72841
72814
|
}
|
|
72842
72815
|
var ClaudeDesktopProvider = () => ({
|
|
72843
72816
|
name: () => "Claude Desktop",
|
|
72844
72817
|
id: () => "claude-desktop",
|
|
72845
72818
|
supportsLocal: () => false,
|
|
72846
72819
|
priority: () => 2,
|
|
72847
|
-
detectPaths: () => [
|
|
72848
|
-
isInstalled: () => isInstalled([
|
|
72820
|
+
detectPaths: () => [join23(appSupportDir(), "Claude")],
|
|
72821
|
+
isInstalled: () => isInstalled([join23(appSupportDir(), "Claude")]),
|
|
72849
72822
|
globalConfigPath: () => configPath(),
|
|
72850
72823
|
isConfigured: () => isJSONKeyConfigured(configPath(), "mcpServers"),
|
|
72851
72824
|
install(cfg, global2) {
|
|
@@ -72875,14 +72848,14 @@ var init_claude_desktop = __esm(() => {
|
|
|
72875
72848
|
});
|
|
72876
72849
|
|
|
72877
72850
|
// src/mcp/providers/cline.ts
|
|
72878
|
-
import { join as
|
|
72879
|
-
var extensionDir = () =>
|
|
72851
|
+
import { join as join24 } from "node:path";
|
|
72852
|
+
var extensionDir = () => join24(appSupportDir(), "Code", "User", "globalStorage", "saoudrizwan.claude-dev"), ClineProvider = () => createJSONProvider({
|
|
72880
72853
|
providerName: "Cline",
|
|
72881
72854
|
providerID: "cline",
|
|
72882
72855
|
local: false,
|
|
72883
72856
|
priorityValue: 11,
|
|
72884
72857
|
paths: [extensionDir()],
|
|
72885
|
-
globalPath:
|
|
72858
|
+
globalPath: join24(extensionDir(), "settings", "cline_mcp_settings.json"),
|
|
72886
72859
|
topKey: "mcpServers",
|
|
72887
72860
|
buildServer: (cfg) => ({
|
|
72888
72861
|
url: mcpURL(cfg.active_account.target.deployment_id),
|
|
@@ -72898,7 +72871,7 @@ var init_cline = __esm(() => {
|
|
|
72898
72871
|
});
|
|
72899
72872
|
|
|
72900
72873
|
// src/mcp/providers/cline-cli.ts
|
|
72901
|
-
import { join as
|
|
72874
|
+
import { join as join25 } from "node:path";
|
|
72902
72875
|
function clineDir() {
|
|
72903
72876
|
return process.env.CLINE_DIR ?? expandHome("~/.cline");
|
|
72904
72877
|
}
|
|
@@ -72908,7 +72881,7 @@ var ClineCliProvider = () => createJSONProvider({
|
|
|
72908
72881
|
local: false,
|
|
72909
72882
|
priorityValue: 12,
|
|
72910
72883
|
paths: [clineDir()],
|
|
72911
|
-
globalPath:
|
|
72884
|
+
globalPath: join25(clineDir(), "data", "settings", "cline_mcp_settings.json"),
|
|
72912
72885
|
topKey: "mcpServers",
|
|
72913
72886
|
buildServer: (cfg) => ({
|
|
72914
72887
|
url: mcpURL(cfg.active_account.target.deployment_id),
|
|
@@ -72924,20 +72897,20 @@ var init_cline_cli = __esm(() => {
|
|
|
72924
72897
|
});
|
|
72925
72898
|
|
|
72926
72899
|
// src/mcp/providers/codex.ts
|
|
72927
|
-
import { existsSync as existsSync20, readFileSync as
|
|
72928
|
-
import { join as
|
|
72900
|
+
import { existsSync as existsSync20, readFileSync as readFileSync19 } from "node:fs";
|
|
72901
|
+
import { join as join26 } from "node:path";
|
|
72929
72902
|
function codexHome2() {
|
|
72930
72903
|
return process.env.CODEX_HOME ?? expandHome("~/.codex");
|
|
72931
72904
|
}
|
|
72932
72905
|
function getConfigPath2(global2) {
|
|
72933
72906
|
if (global2)
|
|
72934
|
-
return
|
|
72935
|
-
return
|
|
72907
|
+
return join26(codexHome2(), "config.toml");
|
|
72908
|
+
return join26(process.cwd(), ".codex", "config.toml");
|
|
72936
72909
|
}
|
|
72937
72910
|
function readTOML(path3) {
|
|
72938
72911
|
if (!existsSync20(path3))
|
|
72939
72912
|
return "";
|
|
72940
|
-
return
|
|
72913
|
+
return readFileSync19(path3, "utf-8");
|
|
72941
72914
|
}
|
|
72942
72915
|
function writeTOML(path3, content) {
|
|
72943
72916
|
writeSecureFile(path3, content);
|
|
@@ -73000,9 +72973,9 @@ var CodexProvider = () => ({
|
|
|
73000
72973
|
priority: () => 8,
|
|
73001
72974
|
detectPaths: () => ["~/.codex"],
|
|
73002
72975
|
isInstalled: () => isInstalled(["~/.codex"]),
|
|
73003
|
-
globalConfigPath: () =>
|
|
72976
|
+
globalConfigPath: () => join26(codexHome2(), "config.toml"),
|
|
73004
72977
|
isConfigured: () => {
|
|
73005
|
-
const content = readTOML(
|
|
72978
|
+
const content = readTOML(join26(codexHome2(), "config.toml"));
|
|
73006
72979
|
return content.includes("[mcp_servers.dosu]");
|
|
73007
72980
|
},
|
|
73008
72981
|
install(cfg, global2) {
|
|
@@ -73024,10 +72997,10 @@ var init_codex = __esm(() => {
|
|
|
73024
72997
|
});
|
|
73025
72998
|
|
|
73026
72999
|
// src/mcp/providers/copilot.ts
|
|
73027
|
-
import { join as
|
|
73000
|
+
import { join as join27 } from "node:path";
|
|
73028
73001
|
function globalPath() {
|
|
73029
73002
|
if (process.env.XDG_CONFIG_HOME) {
|
|
73030
|
-
return
|
|
73003
|
+
return join27(process.env.XDG_CONFIG_HOME, "mcp-config.json");
|
|
73031
73004
|
}
|
|
73032
73005
|
return expandHome("~/.copilot/mcp-config.json");
|
|
73033
73006
|
}
|
|
@@ -73058,7 +73031,7 @@ var CopilotProvider = () => ({
|
|
|
73058
73031
|
};
|
|
73059
73032
|
installJSONServer(globalPath(), "mcpServers", server);
|
|
73060
73033
|
} else {
|
|
73061
|
-
const configPath2 =
|
|
73034
|
+
const configPath2 = join27(process.cwd(), ".vscode", "mcp.json");
|
|
73062
73035
|
const server = {
|
|
73063
73036
|
type: "http",
|
|
73064
73037
|
url: url2,
|
|
@@ -73071,7 +73044,7 @@ var CopilotProvider = () => ({
|
|
|
73071
73044
|
if (global2) {
|
|
73072
73045
|
removeJSONServer(globalPath(), "mcpServers");
|
|
73073
73046
|
} else {
|
|
73074
|
-
const configPath2 =
|
|
73047
|
+
const configPath2 = join27(process.cwd(), ".vscode", "mcp.json");
|
|
73075
73048
|
removeJSONServer(configPath2, "servers");
|
|
73076
73049
|
}
|
|
73077
73050
|
}
|
|
@@ -73083,7 +73056,7 @@ var init_copilot = __esm(() => {
|
|
|
73083
73056
|
});
|
|
73084
73057
|
|
|
73085
73058
|
// src/mcp/providers/cursor.ts
|
|
73086
|
-
import { join as
|
|
73059
|
+
import { join as join28 } from "node:path";
|
|
73087
73060
|
var CursorProvider = () => createJSONProvider({
|
|
73088
73061
|
providerName: "Cursor",
|
|
73089
73062
|
providerID: "cursor",
|
|
@@ -73096,7 +73069,7 @@ var CursorProvider = () => createJSONProvider({
|
|
|
73096
73069
|
url: mcpURL(cfg.active_account.target.deployment_id),
|
|
73097
73070
|
headers: mcpHeaders(cfg.active_account.target.api_key)
|
|
73098
73071
|
}),
|
|
73099
|
-
localConfigPath: (cwd) =>
|
|
73072
|
+
localConfigPath: (cwd) => join28(cwd, ".cursor", "mcp.json")
|
|
73100
73073
|
});
|
|
73101
73074
|
var init_cursor = __esm(() => {
|
|
73102
73075
|
init_config_helpers();
|
|
@@ -73104,7 +73077,7 @@ var init_cursor = __esm(() => {
|
|
|
73104
73077
|
});
|
|
73105
73078
|
|
|
73106
73079
|
// src/mcp/providers/factory.ts
|
|
73107
|
-
import { join as
|
|
73080
|
+
import { join as join29 } from "node:path";
|
|
73108
73081
|
var FactoryProvider = () => createJSONProvider({
|
|
73109
73082
|
providerName: "Factory",
|
|
73110
73083
|
providerID: "factory",
|
|
@@ -73113,14 +73086,14 @@ var FactoryProvider = () => createJSONProvider({
|
|
|
73113
73086
|
paths: ["~/.factory"],
|
|
73114
73087
|
globalPath: "~/.factory/mcp.json",
|
|
73115
73088
|
topKey: "mcpServers",
|
|
73116
|
-
localConfigPath: (cwd) =>
|
|
73089
|
+
localConfigPath: (cwd) => join29(cwd, ".factory", "mcp.json")
|
|
73117
73090
|
});
|
|
73118
73091
|
var init_factory = __esm(() => {
|
|
73119
73092
|
init_base();
|
|
73120
73093
|
});
|
|
73121
73094
|
|
|
73122
73095
|
// src/mcp/providers/gemini.ts
|
|
73123
|
-
import { join as
|
|
73096
|
+
import { join as join30 } from "node:path";
|
|
73124
73097
|
var GeminiProvider = () => createJSONProvider({
|
|
73125
73098
|
providerName: "Gemini CLI",
|
|
73126
73099
|
providerID: "gemini",
|
|
@@ -73129,7 +73102,7 @@ var GeminiProvider = () => createJSONProvider({
|
|
|
73129
73102
|
paths: ["~/.gemini"],
|
|
73130
73103
|
globalPath: "~/.gemini/settings.json",
|
|
73131
73104
|
topKey: "mcpServers",
|
|
73132
|
-
localConfigPath: (cwd) =>
|
|
73105
|
+
localConfigPath: (cwd) => join30(cwd, ".gemini", "settings.json")
|
|
73133
73106
|
});
|
|
73134
73107
|
var init_gemini = __esm(() => {
|
|
73135
73108
|
init_base();
|
|
@@ -73180,7 +73153,7 @@ var init_manual = __esm(() => {
|
|
|
73180
73153
|
|
|
73181
73154
|
// src/mcp/providers/mcporter.ts
|
|
73182
73155
|
import { existsSync as existsSync21 } from "node:fs";
|
|
73183
|
-
import { join as
|
|
73156
|
+
import { join as join31 } from "node:path";
|
|
73184
73157
|
function resolveGlobalConfigPath() {
|
|
73185
73158
|
const jsonPath = expandHome("~/.mcporter/mcporter.json");
|
|
73186
73159
|
if (existsSync21(jsonPath))
|
|
@@ -73207,7 +73180,7 @@ var MCPorterProvider = () => ({
|
|
|
73207
73180
|
globalConfigPath: () => resolveGlobalConfigPath(),
|
|
73208
73181
|
isConfigured: () => isJSONKeyConfigured(resolveGlobalConfigPath(), "mcpServers"),
|
|
73209
73182
|
install(cfg, global2) {
|
|
73210
|
-
const configPath2 = global2 ? resolveGlobalConfigPath() :
|
|
73183
|
+
const configPath2 = global2 ? resolveGlobalConfigPath() : join31(process.cwd(), "config", "mcporter.json");
|
|
73211
73184
|
const server = {
|
|
73212
73185
|
type: "http",
|
|
73213
73186
|
url: mcpEndpoint4(cfg),
|
|
@@ -73216,7 +73189,7 @@ var MCPorterProvider = () => ({
|
|
|
73216
73189
|
installJSONServer(configPath2, "mcpServers", server);
|
|
73217
73190
|
},
|
|
73218
73191
|
remove(global2) {
|
|
73219
|
-
const configPath2 = global2 ? resolveGlobalConfigPath() :
|
|
73192
|
+
const configPath2 = global2 ? resolveGlobalConfigPath() : join31(process.cwd(), "config", "mcporter.json");
|
|
73220
73193
|
removeJSONServer(configPath2, "mcpServers");
|
|
73221
73194
|
}
|
|
73222
73195
|
});
|
|
@@ -73227,7 +73200,7 @@ var init_mcporter = __esm(() => {
|
|
|
73227
73200
|
});
|
|
73228
73201
|
|
|
73229
73202
|
// src/mcp/providers/opencode.ts
|
|
73230
|
-
import { join as
|
|
73203
|
+
import { join as join32 } from "node:path";
|
|
73231
73204
|
var OpenCodeProvider = () => createJSONProvider({
|
|
73232
73205
|
providerName: "OpenCode",
|
|
73233
73206
|
providerID: "opencode",
|
|
@@ -73242,7 +73215,7 @@ var OpenCodeProvider = () => createJSONProvider({
|
|
|
73242
73215
|
enabled: true,
|
|
73243
73216
|
headers: mcpHeaders(cfg.active_account.target.api_key)
|
|
73244
73217
|
}),
|
|
73245
|
-
localConfigPath: (cwd) =>
|
|
73218
|
+
localConfigPath: (cwd) => join32(cwd, "opencode.json")
|
|
73246
73219
|
});
|
|
73247
73220
|
var init_opencode = __esm(() => {
|
|
73248
73221
|
init_config_helpers();
|
|
@@ -73250,16 +73223,16 @@ var init_opencode = __esm(() => {
|
|
|
73250
73223
|
});
|
|
73251
73224
|
|
|
73252
73225
|
// src/mcp/providers/vscode.ts
|
|
73253
|
-
import { join as
|
|
73226
|
+
import { join as join33 } from "node:path";
|
|
73254
73227
|
var VSCodeProvider = () => createJSONProvider({
|
|
73255
73228
|
providerName: "VS Code",
|
|
73256
73229
|
providerID: "vscode",
|
|
73257
73230
|
local: true,
|
|
73258
73231
|
priorityValue: 6,
|
|
73259
|
-
paths: [
|
|
73260
|
-
globalPath:
|
|
73232
|
+
paths: [join33(appSupportDir(), "Code")],
|
|
73233
|
+
globalPath: join33(appSupportDir(), "Code", "User", "mcp.json"),
|
|
73261
73234
|
topKey: "servers",
|
|
73262
|
-
localConfigPath: (cwd) =>
|
|
73235
|
+
localConfigPath: (cwd) => join33(cwd, ".vscode", "mcp.json")
|
|
73263
73236
|
});
|
|
73264
73237
|
var init_vscode = __esm(() => {
|
|
73265
73238
|
init_detect();
|
|
@@ -73267,15 +73240,15 @@ var init_vscode = __esm(() => {
|
|
|
73267
73240
|
});
|
|
73268
73241
|
|
|
73269
73242
|
// src/mcp/providers/windsurf.ts
|
|
73270
|
-
import { homedir as
|
|
73271
|
-
import { join as
|
|
73243
|
+
import { homedir as homedir8 } from "node:os";
|
|
73244
|
+
import { join as join34 } from "node:path";
|
|
73272
73245
|
var WindsurfProvider = () => createJSONProvider({
|
|
73273
73246
|
providerName: "Windsurf",
|
|
73274
73247
|
providerID: "windsurf",
|
|
73275
73248
|
local: false,
|
|
73276
73249
|
priorityValue: 9,
|
|
73277
|
-
paths: [
|
|
73278
|
-
globalPath:
|
|
73250
|
+
paths: [join34(homedir8(), ".codeium", "windsurf")],
|
|
73251
|
+
globalPath: join34(homedir8(), ".codeium", "windsurf", "mcp_config.json"),
|
|
73279
73252
|
topKey: "mcpServers"
|
|
73280
73253
|
});
|
|
73281
73254
|
var init_windsurf = __esm(() => {
|
|
@@ -73284,12 +73257,12 @@ var init_windsurf = __esm(() => {
|
|
|
73284
73257
|
|
|
73285
73258
|
// src/mcp/providers/zed.ts
|
|
73286
73259
|
import { platform as platform3 } from "node:os";
|
|
73287
|
-
import { join as
|
|
73260
|
+
import { join as join35 } from "node:path";
|
|
73288
73261
|
function zedConfigDir() {
|
|
73289
73262
|
const os3 = platform3();
|
|
73290
73263
|
if (os3 === "darwin" || os3 === "win32")
|
|
73291
|
-
return
|
|
73292
|
-
return
|
|
73264
|
+
return join35(appSupportDir(), "Zed");
|
|
73265
|
+
return join35(appSupportDir(), "zed");
|
|
73293
73266
|
}
|
|
73294
73267
|
var ZedProvider = () => createJSONProvider({
|
|
73295
73268
|
providerName: "Zed",
|
|
@@ -73297,7 +73270,7 @@ var ZedProvider = () => createJSONProvider({
|
|
|
73297
73270
|
local: true,
|
|
73298
73271
|
priorityValue: 10,
|
|
73299
73272
|
paths: [zedConfigDir()],
|
|
73300
|
-
globalPath:
|
|
73273
|
+
globalPath: join35(zedConfigDir(), "settings.json"),
|
|
73301
73274
|
topKey: "context_servers",
|
|
73302
73275
|
buildServer: (cfg) => ({
|
|
73303
73276
|
source: "custom",
|
|
@@ -73305,7 +73278,7 @@ var ZedProvider = () => createJSONProvider({
|
|
|
73305
73278
|
url: mcpURL(cfg.active_account.target.deployment_id),
|
|
73306
73279
|
headers: mcpHeaders(cfg.active_account.target.api_key)
|
|
73307
73280
|
}),
|
|
73308
|
-
localConfigPath: (cwd) =>
|
|
73281
|
+
localConfigPath: (cwd) => join35(cwd, ".zed", "settings.json")
|
|
73309
73282
|
});
|
|
73310
73283
|
var init_zed = __esm(() => {
|
|
73311
73284
|
init_config_helpers();
|
|
@@ -73364,8 +73337,8 @@ var init_providers = __esm(() => {
|
|
|
73364
73337
|
});
|
|
73365
73338
|
|
|
73366
73339
|
// src/version/update-check.ts
|
|
73367
|
-
import { existsSync as existsSync22, mkdirSync as mkdirSync11, readFileSync as
|
|
73368
|
-
import { join as
|
|
73340
|
+
import { existsSync as existsSync22, mkdirSync as mkdirSync11, readFileSync as readFileSync20, writeFileSync as writeFileSync12 } from "node:fs";
|
|
73341
|
+
import { join as join36 } from "node:path";
|
|
73369
73342
|
function isValidVersion(value) {
|
|
73370
73343
|
return typeof value === "string" && SEMVER_PATTERN.test(value);
|
|
73371
73344
|
}
|
|
@@ -73387,14 +73360,14 @@ function isNewerVersion(latest, current) {
|
|
|
73387
73360
|
return false;
|
|
73388
73361
|
}
|
|
73389
73362
|
function getCachePath3() {
|
|
73390
|
-
return
|
|
73363
|
+
return join36(getConfigDir(), CACHE_FILENAME4);
|
|
73391
73364
|
}
|
|
73392
73365
|
function readCache() {
|
|
73393
73366
|
try {
|
|
73394
73367
|
const path3 = getCachePath3();
|
|
73395
73368
|
if (!existsSync22(path3))
|
|
73396
73369
|
return null;
|
|
73397
|
-
const data = JSON.parse(
|
|
73370
|
+
const data = JSON.parse(readFileSync20(path3, "utf-8"));
|
|
73398
73371
|
if (typeof data.lastCheck === "number" && isValidVersion(data.latestVersion)) {
|
|
73399
73372
|
return data;
|
|
73400
73373
|
}
|
|
@@ -73519,14 +73492,14 @@ var init_update_check = __esm(() => {
|
|
|
73519
73492
|
});
|
|
73520
73493
|
|
|
73521
73494
|
// src/rules/installer.ts
|
|
73522
|
-
import { existsSync as existsSync23, mkdirSync as mkdirSync12, readFileSync as
|
|
73523
|
-
import { homedir as
|
|
73524
|
-
import { dirname as dirname8, join as
|
|
73495
|
+
import { existsSync as existsSync23, mkdirSync as mkdirSync12, readFileSync as readFileSync21, unlinkSync as unlinkSync4, writeFileSync as writeFileSync13 } from "node:fs";
|
|
73496
|
+
import { homedir as homedir9 } from "node:os";
|
|
73497
|
+
import { dirname as dirname8, join as join37 } from "node:path";
|
|
73525
73498
|
function claudeConfigDir() {
|
|
73526
|
-
return process.env.CLAUDE_CONFIG_DIR ||
|
|
73499
|
+
return process.env.CLAUDE_CONFIG_DIR || join37(homedir9(), ".claude");
|
|
73527
73500
|
}
|
|
73528
73501
|
function codexHome3() {
|
|
73529
|
-
return process.env.CODEX_HOME ||
|
|
73502
|
+
return process.env.CODEX_HOME || join37(homedir9(), ".codex");
|
|
73530
73503
|
}
|
|
73531
73504
|
function isRuleAgent(agent) {
|
|
73532
73505
|
return Object.hasOwn(RULE_TARGETS, agent);
|
|
@@ -73560,7 +73533,7 @@ function writeIfChanged(path3, content) {
|
|
|
73560
73533
|
writeFileSync13(path3, content, "utf-8");
|
|
73561
73534
|
return "created";
|
|
73562
73535
|
}
|
|
73563
|
-
if (
|
|
73536
|
+
if (readFileSync21(path3, "utf-8") === content)
|
|
73564
73537
|
return "unchanged";
|
|
73565
73538
|
writeFileSync13(path3, content, "utf-8");
|
|
73566
73539
|
return "updated";
|
|
@@ -73595,7 +73568,7 @@ function upsertSection(path3, content) {
|
|
|
73595
73568
|
`, "utf-8");
|
|
73596
73569
|
return "created";
|
|
73597
73570
|
}
|
|
73598
|
-
const existing =
|
|
73571
|
+
const existing = readFileSync21(path3, "utf-8");
|
|
73599
73572
|
const lineEnding = lineEndingFor(existing);
|
|
73600
73573
|
const section = buildSection(content, lineEnding);
|
|
73601
73574
|
const location = findSection(existing);
|
|
@@ -73631,7 +73604,7 @@ function removeRuleForAgent(agent) {
|
|
|
73631
73604
|
unlinkSync4(path3);
|
|
73632
73605
|
return { agent, path: path3, action: "removed" };
|
|
73633
73606
|
}
|
|
73634
|
-
const existing =
|
|
73607
|
+
const existing = readFileSync21(path3, "utf-8");
|
|
73635
73608
|
const lineEnding = lineEndingFor(existing);
|
|
73636
73609
|
const location = findSection(existing);
|
|
73637
73610
|
if (!location)
|
|
@@ -73668,36 +73641,36 @@ var init_installer = __esm(() => {
|
|
|
73668
73641
|
RULE_TARGETS = {
|
|
73669
73642
|
claude: {
|
|
73670
73643
|
kind: "file",
|
|
73671
|
-
path: () =>
|
|
73644
|
+
path: () => join37(claudeConfigDir(), "rules", "dosu.md")
|
|
73672
73645
|
},
|
|
73673
73646
|
cursor: {
|
|
73674
73647
|
kind: "file",
|
|
73675
|
-
path: () =>
|
|
73648
|
+
path: () => join37(homedir9(), ".cursor", "rules", "dosu.mdc"),
|
|
73676
73649
|
cursorFrontmatter: true
|
|
73677
73650
|
},
|
|
73678
73651
|
codex: {
|
|
73679
73652
|
kind: "section",
|
|
73680
|
-
path: () =>
|
|
73653
|
+
path: () => join37(codexHome3(), "AGENTS.md")
|
|
73681
73654
|
},
|
|
73682
73655
|
opencode: {
|
|
73683
73656
|
kind: "section",
|
|
73684
|
-
path: () =>
|
|
73657
|
+
path: () => join37(homedir9(), ".config", "opencode", "AGENTS.md")
|
|
73685
73658
|
},
|
|
73686
73659
|
gemini: {
|
|
73687
73660
|
kind: "section",
|
|
73688
|
-
path: () =>
|
|
73661
|
+
path: () => join37(homedir9(), ".gemini", "GEMINI.md")
|
|
73689
73662
|
},
|
|
73690
73663
|
antigravity: {
|
|
73691
73664
|
kind: "section",
|
|
73692
|
-
path: () =>
|
|
73665
|
+
path: () => join37(homedir9(), ".gemini", "GEMINI.md")
|
|
73693
73666
|
}
|
|
73694
73667
|
};
|
|
73695
73668
|
});
|
|
73696
73669
|
|
|
73697
73670
|
// src/setup/agents-md-step.ts
|
|
73698
73671
|
import { execSync as execSync3 } from "node:child_process";
|
|
73699
|
-
import { existsSync as existsSync24, readFileSync as
|
|
73700
|
-
import { join as
|
|
73672
|
+
import { existsSync as existsSync24, readFileSync as readFileSync22, writeFileSync as writeFileSync14 } from "node:fs";
|
|
73673
|
+
import { join as join38 } from "node:path";
|
|
73701
73674
|
function inGitWorkTree(cwd = process.cwd()) {
|
|
73702
73675
|
try {
|
|
73703
73676
|
const stdout2 = execSync3("git rev-parse --is-inside-work-tree", {
|
|
@@ -73711,10 +73684,10 @@ function inGitWorkTree(cwd = process.cwd()) {
|
|
|
73711
73684
|
}
|
|
73712
73685
|
function dosuAgentsSectionState(cwd = process.cwd()) {
|
|
73713
73686
|
try {
|
|
73714
|
-
const path3 =
|
|
73687
|
+
const path3 = join38(cwd, "AGENTS.md");
|
|
73715
73688
|
if (!existsSync24(path3))
|
|
73716
73689
|
return "missing";
|
|
73717
|
-
const content =
|
|
73690
|
+
const content = readFileSync22(path3, "utf-8");
|
|
73718
73691
|
const startMatch = content.match(SECTION_START_RE);
|
|
73719
73692
|
if (!startMatch || !content.includes(DOSU_SECTION_END))
|
|
73720
73693
|
return "missing";
|
|
@@ -73749,14 +73722,14 @@ function findSection2(content) {
|
|
|
73749
73722
|
return { start, end };
|
|
73750
73723
|
}
|
|
73751
73724
|
function upsertDosuAgentsSection(cwd = process.cwd(), content = FALLBACK_DOSU_RULE) {
|
|
73752
|
-
const path3 =
|
|
73725
|
+
const path3 = join38(cwd, "AGENTS.md");
|
|
73753
73726
|
if (!existsSync24(path3)) {
|
|
73754
73727
|
const section2 = buildDosuAgentsSection(content);
|
|
73755
73728
|
writeFileSync14(path3, `${section2}
|
|
73756
73729
|
`);
|
|
73757
73730
|
return { path: path3, action: "created" };
|
|
73758
73731
|
}
|
|
73759
|
-
const existing =
|
|
73732
|
+
const existing = readFileSync22(path3, "utf-8");
|
|
73760
73733
|
const lineEnding = lineEndingFor2(existing);
|
|
73761
73734
|
const section = renderDosuAgentsSection(content, lineEnding);
|
|
73762
73735
|
const location = findSection2(existing);
|
|
@@ -73850,7 +73823,7 @@ var init_alt_screen = __esm(() => {
|
|
|
73850
73823
|
});
|
|
73851
73824
|
|
|
73852
73825
|
// src/tui/activity-view.ts
|
|
73853
|
-
import { readFileSync as
|
|
73826
|
+
import { readFileSync as readFileSync23 } from "node:fs";
|
|
73854
73827
|
function reduceActivityViewKey(key) {
|
|
73855
73828
|
if (key === "q" || key === ESC7 || key === CTRL_C4)
|
|
73856
73829
|
return "back";
|
|
@@ -74095,7 +74068,7 @@ function renderActivityFrame(status, activity, width, backlog = null, pane = DEF
|
|
|
74095
74068
|
}
|
|
74096
74069
|
function defaultReadLog2() {
|
|
74097
74070
|
try {
|
|
74098
|
-
return
|
|
74071
|
+
return readFileSync23(logger.getLogPath(), "utf-8");
|
|
74099
74072
|
} catch {
|
|
74100
74073
|
return "";
|
|
74101
74074
|
}
|
|
@@ -74140,7 +74113,12 @@ function runActivityView(io2 = {}) {
|
|
|
74140
74113
|
const draw = () => {
|
|
74141
74114
|
status = getStatus();
|
|
74142
74115
|
if (status.running) {
|
|
74143
|
-
|
|
74116
|
+
const run2 = status.state.run;
|
|
74117
|
+
if (run2 && run2.pid === status.pid) {
|
|
74118
|
+
minedBeforeRun = run2.baseline_mined;
|
|
74119
|
+
} else {
|
|
74120
|
+
minedBeforeRun ??= status.state.total_mined ?? 0;
|
|
74121
|
+
}
|
|
74144
74122
|
} else {
|
|
74145
74123
|
minedBeforeRun = null;
|
|
74146
74124
|
}
|
|
@@ -76560,7 +76538,7 @@ __export(exports_tui, {
|
|
|
76560
76538
|
runTUI: () => runTUI,
|
|
76561
76539
|
handleLogout: () => handleLogout
|
|
76562
76540
|
});
|
|
76563
|
-
import { homedir as
|
|
76541
|
+
import { homedir as homedir10 } from "node:os";
|
|
76564
76542
|
import { basename as basename4 } from "node:path";
|
|
76565
76543
|
function bannerContext(cfg) {
|
|
76566
76544
|
let webAppHost = "app.dosu.dev";
|
|
@@ -76786,7 +76764,7 @@ async function runSettings(cfg) {
|
|
|
76786
76764
|
}
|
|
76787
76765
|
}
|
|
76788
76766
|
function displayDir(dir) {
|
|
76789
|
-
const home =
|
|
76767
|
+
const home = homedir10();
|
|
76790
76768
|
return dir === home ? "~" : dir.startsWith(`${home}/`) ? `~${dir.slice(home.length)}` : dir;
|
|
76791
76769
|
}
|
|
76792
76770
|
function discoverProjectDirs() {
|
|
@@ -77526,7 +77504,7 @@ import {
|
|
|
77526
77504
|
constants as constants3,
|
|
77527
77505
|
fstatSync,
|
|
77528
77506
|
openSync as openSync5,
|
|
77529
|
-
readFileSync as
|
|
77507
|
+
readFileSync as readFileSync24,
|
|
77530
77508
|
readSync as readSync4,
|
|
77531
77509
|
unlinkSync as unlinkSync5
|
|
77532
77510
|
} from "node:fs";
|
|
@@ -80661,8 +80639,8 @@ init_status();
|
|
|
80661
80639
|
init_sync();
|
|
80662
80640
|
var import_picocolors18 = __toESM(require_picocolors(), 1);
|
|
80663
80641
|
import { existsSync as existsSync16 } from "node:fs";
|
|
80664
|
-
import { homedir as
|
|
80665
|
-
import { delimiter as delimiter4, join as
|
|
80642
|
+
import { homedir as homedir5 } from "node:os";
|
|
80643
|
+
import { delimiter as delimiter4, join as join18 } from "node:path";
|
|
80666
80644
|
function requireConfig7() {
|
|
80667
80645
|
const cfg = requireLoginConfig();
|
|
80668
80646
|
if (!cfg.active_account?.target?.org_id || !cfg.active_account?.target?.space_id) {
|
|
@@ -80809,7 +80787,7 @@ function printSyncStatus(status, now = new Date) {
|
|
|
80809
80787
|
const wm2 = status.state.watermark;
|
|
80810
80788
|
console.log(` Mined through: ${wm2 ? `${wm2} (${formatAge(wm2, now)})` : "nothing mined yet"}`);
|
|
80811
80789
|
if (status.state.project_filter?.length) {
|
|
80812
|
-
const home =
|
|
80790
|
+
const home = homedir5();
|
|
80813
80791
|
const scope = status.state.project_filter.map((dir) => dir.startsWith(`${home}/`) ? `~${dir.slice(home.length)}` : dir).join(", ");
|
|
80814
80792
|
console.log(` Mining scope: ${scope}`);
|
|
80815
80793
|
}
|
|
@@ -80977,7 +80955,7 @@ function reportHookFailure(agent, err) {
|
|
|
80977
80955
|
}
|
|
80978
80956
|
function dosuOnPath() {
|
|
80979
80957
|
const bin = process.platform === "win32" ? "dosu.cmd" : "dosu";
|
|
80980
|
-
return (process.env.PATH ?? "").split(delimiter4).some((dir) => dir !== "" && existsSync16(
|
|
80958
|
+
return (process.env.PATH ?? "").split(delimiter4).some((dir) => dir !== "" && existsSync16(join18(dir, bin)));
|
|
80981
80959
|
}
|
|
80982
80960
|
|
|
80983
80961
|
// src/commands/libraries.ts
|
|
@@ -81317,7 +81295,7 @@ init_dist();
|
|
|
81317
81295
|
init_commander();
|
|
81318
81296
|
init_trpc();
|
|
81319
81297
|
var import_picocolors22 = __toESM(require_picocolors(), 1);
|
|
81320
|
-
import { readFileSync as
|
|
81298
|
+
import { readFileSync as readFileSync16 } from "node:fs";
|
|
81321
81299
|
function requireConfig10() {
|
|
81322
81300
|
return requireLoginConfig();
|
|
81323
81301
|
}
|
|
@@ -81493,7 +81471,7 @@ function reviewCommand() {
|
|
|
81493
81471
|
let body = opts.body;
|
|
81494
81472
|
if (opts.bodyFile) {
|
|
81495
81473
|
try {
|
|
81496
|
-
body =
|
|
81474
|
+
body = readFileSync16(opts.bodyFile, "utf-8");
|
|
81497
81475
|
} catch (err) {
|
|
81498
81476
|
console.error(import_picocolors22.default.red(`Failed to read --body-file: ${err.message}`));
|
|
81499
81477
|
process.exit(1);
|
|
@@ -81991,7 +81969,7 @@ init_skill();
|
|
|
81991
81969
|
var import_picocolors28 = __toESM(require_picocolors(), 1);
|
|
81992
81970
|
import { spawnSync } from "node:child_process";
|
|
81993
81971
|
import { realpathSync as realpathSync2 } from "node:fs";
|
|
81994
|
-
import { homedir as
|
|
81972
|
+
import { homedir as homedir7 } from "node:os";
|
|
81995
81973
|
import { posix, win32 as win322 } from "node:path";
|
|
81996
81974
|
var PACKAGE_NAME = "@dosu/cli";
|
|
81997
81975
|
var LATEST_PACKAGE = `${PACKAGE_NAME}@latest`;
|
|
@@ -82068,7 +82046,7 @@ function packageRoots(manager, platform3, comSpec, env, cwd) {
|
|
|
82068
82046
|
manager === "npm" ? path3.join(lines[0], "@dosu", "cli") : path3.join(lines[0], "node_modules", "@dosu", "cli")
|
|
82069
82047
|
];
|
|
82070
82048
|
}
|
|
82071
|
-
function owningPackageManager(entrypoint, platform3, comSpec, env = process.env, cwd =
|
|
82049
|
+
function owningPackageManager(entrypoint, platform3, comSpec, env = process.env, cwd = homedir7()) {
|
|
82072
82050
|
const path3 = platform3 === "win32" ? win322 : posix;
|
|
82073
82051
|
if (!entrypoint || !path3.isAbsolute(entrypoint))
|
|
82074
82052
|
return null;
|
|
@@ -82121,7 +82099,7 @@ Or install Dosu globally with your package manager:`);
|
|
|
82121
82099
|
function runUpgrade(channel = INSTALL_CHANNEL, options = {}) {
|
|
82122
82100
|
const platform3 = options.platform ?? process.platform;
|
|
82123
82101
|
const env = options.env ?? process.env;
|
|
82124
|
-
const cwd = options.cwd ??
|
|
82102
|
+
const cwd = options.cwd ?? homedir7();
|
|
82125
82103
|
let manager = null;
|
|
82126
82104
|
if (channel === "npm") {
|
|
82127
82105
|
if (isNpxInvocation(channel, env)) {
|
|
@@ -82637,7 +82615,7 @@ Use 'dosu mcp add <agent>' to add Dosu MCP to a tool.`);
|
|
|
82637
82615
|
}
|
|
82638
82616
|
if (opts.follow) {
|
|
82639
82617
|
try {
|
|
82640
|
-
const lines =
|
|
82618
|
+
const lines = readFileSync24(logPath, "utf-8").split(`
|
|
82641
82619
|
`);
|
|
82642
82620
|
if (lines.at(-1) === "")
|
|
82643
82621
|
lines.pop();
|
|
@@ -82653,7 +82631,7 @@ Use 'dosu mcp add <agent>' to add Dosu MCP to a tool.`);
|
|
|
82653
82631
|
if (opts.tail !== undefined) {
|
|
82654
82632
|
const n5 = typeof opts.tail === "string" ? parseInt(opts.tail, 10) || 50 : 50;
|
|
82655
82633
|
try {
|
|
82656
|
-
const content =
|
|
82634
|
+
const content = readFileSync24(logPath, "utf-8");
|
|
82657
82635
|
const lines = content.split(`
|
|
82658
82636
|
`);
|
|
82659
82637
|
console.log(lines.slice(-n5).join(`
|
|
@@ -82724,4 +82702,4 @@ execute().catch((err) => {
|
|
|
82724
82702
|
process.exit(1);
|
|
82725
82703
|
});
|
|
82726
82704
|
|
|
82727
|
-
//# debugId=
|
|
82705
|
+
//# debugId=6c656d2d-4b9b-0be3-6475-6e2164756e21
|