@staff0rd/assist 0.932.3 → 0.932.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/README.md +0 -1
- package/claude/skills/review-ci/scripts/review.mjs +93 -93
- package/dist/commands/sessions/web/bundle.js +1 -1
- package/dist/index.js +185 -382
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { Command } from "commander";
|
|
|
6
6
|
// package.json
|
|
7
7
|
var package_default = {
|
|
8
8
|
name: "@staff0rd/assist",
|
|
9
|
-
version: "0.932.
|
|
9
|
+
version: "0.932.4",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -309,13 +309,13 @@ function buildUrl(port, initialPath) {
|
|
|
309
309
|
const base = `http://localhost:${port}`;
|
|
310
310
|
return initialPath ? `${base}${initialPath}` : base;
|
|
311
311
|
}
|
|
312
|
-
function startWebServer(
|
|
312
|
+
function startWebServer(label, port, handler, initialPath, open = true) {
|
|
313
313
|
const url = buildUrl(port, initialPath);
|
|
314
314
|
const server = createServer((req, res) => {
|
|
315
315
|
runHandler(handler, req, res, port);
|
|
316
316
|
});
|
|
317
317
|
server.listen(port, "127.0.0.1", () => {
|
|
318
|
-
console.log(chalk.green(`${
|
|
318
|
+
console.log(chalk.green(`${label}: ${url}`));
|
|
319
319
|
console.log(chalk.dim("Press Ctrl+C to stop"));
|
|
320
320
|
if (open) {
|
|
321
321
|
openBrowser(url);
|
|
@@ -827,6 +827,7 @@ function stripLegacyConfigKeys(config) {
|
|
|
827
827
|
if (stripped.repos) stripped.repos = stripRepos(stripped.repos);
|
|
828
828
|
delete stripped.backlog;
|
|
829
829
|
delete stripped.cliReadVerbs;
|
|
830
|
+
delete stripped.roam;
|
|
830
831
|
const news = stripped.news;
|
|
831
832
|
if (news && typeof news === "object" && "feeds" in news) {
|
|
832
833
|
const { feeds: _feeds, ...rest } = news;
|
|
@@ -952,15 +953,15 @@ var NAMED_KEYS = [
|
|
|
952
953
|
];
|
|
953
954
|
function hotkeyKeyCode(token) {
|
|
954
955
|
if (/^[a-z]$/i.test(token)) {
|
|
955
|
-
const
|
|
956
|
-
return { code: `Key${
|
|
956
|
+
const label = token.toUpperCase();
|
|
957
|
+
return { code: `Key${label}`, label };
|
|
957
958
|
}
|
|
958
959
|
if (/^\d$/.test(token)) return { code: `Digit${token}`, label: token };
|
|
959
960
|
const punctuation = PUNCTUATION_CODES[token];
|
|
960
961
|
if (punctuation) return { code: punctuation, label: token };
|
|
961
962
|
if (/^F([1-9]|1[0-2])$/i.test(token)) {
|
|
962
|
-
const
|
|
963
|
-
return { code:
|
|
963
|
+
const label = token.toUpperCase();
|
|
964
|
+
return { code: label, label };
|
|
964
965
|
}
|
|
965
966
|
const named = NAMED_KEYS.find(
|
|
966
967
|
(name) => name.toLowerCase() === token.toLowerCase()
|
|
@@ -1185,13 +1186,6 @@ var assistConfigShape = {
|
|
|
1185
1186
|
jira: z6.strictObject({
|
|
1186
1187
|
acField: z6.string().default("customfield_11937")
|
|
1187
1188
|
}).optional(),
|
|
1188
|
-
roam: z6.strictObject({
|
|
1189
|
-
clientId: secretConfigValue(z6.string()),
|
|
1190
|
-
clientSecret: secretConfigValue(z6.string()),
|
|
1191
|
-
accessToken: secretConfigValue(z6.string()).optional(),
|
|
1192
|
-
refreshToken: secretConfigValue(z6.string()).optional(),
|
|
1193
|
-
tokenExpiresAt: z6.number().optional()
|
|
1194
|
-
}).optional(),
|
|
1195
1189
|
slack: z6.strictObject({
|
|
1196
1190
|
channel: z6.string().optional()
|
|
1197
1191
|
}).optional(),
|
|
@@ -5426,7 +5420,7 @@ var SUPPORTED = /* @__PURE__ */ new Set([
|
|
|
5426
5420
|
"Address Comments (auto)"
|
|
5427
5421
|
]);
|
|
5428
5422
|
var azureDevopsPrActions = prActions.filter(
|
|
5429
|
-
({ label
|
|
5423
|
+
({ label }) => SUPPORTED.has(label)
|
|
5430
5424
|
);
|
|
5431
5425
|
|
|
5432
5426
|
// src/shared/azureDevops/isAllowedAzureDevopsPrArgs.ts
|
|
@@ -6524,35 +6518,6 @@ var reviewConfigHelp = [
|
|
|
6524
6518
|
}
|
|
6525
6519
|
];
|
|
6526
6520
|
|
|
6527
|
-
// src/commands/roam/roamConfigHelp.ts
|
|
6528
|
-
var roamConfigHelp = [
|
|
6529
|
-
{
|
|
6530
|
-
key: "roam.clientId",
|
|
6531
|
-
setter: "assist roam auth",
|
|
6532
|
-
note: "OAuth client ID (written by the auth flow)"
|
|
6533
|
-
},
|
|
6534
|
-
{
|
|
6535
|
-
key: "roam.clientSecret",
|
|
6536
|
-
setter: "assist roam auth",
|
|
6537
|
-
note: "OAuth client secret (written by the auth flow)"
|
|
6538
|
-
},
|
|
6539
|
-
{
|
|
6540
|
-
key: "roam.accessToken",
|
|
6541
|
-
setter: "assist roam auth",
|
|
6542
|
-
note: "OAuth access token (managed by the auth flow)"
|
|
6543
|
-
},
|
|
6544
|
-
{
|
|
6545
|
-
key: "roam.refreshToken",
|
|
6546
|
-
setter: "assist roam auth",
|
|
6547
|
-
note: "OAuth refresh token (managed by the auth flow)"
|
|
6548
|
-
},
|
|
6549
|
-
{
|
|
6550
|
-
key: "roam.tokenExpiresAt",
|
|
6551
|
-
setter: "assist roam auth",
|
|
6552
|
-
note: "access-token expiry epoch (managed by the auth flow)"
|
|
6553
|
-
}
|
|
6554
|
-
];
|
|
6555
|
-
|
|
6556
6521
|
// src/commands/sync/printAutoConfirmHint.ts
|
|
6557
6522
|
import chalk9 from "chalk";
|
|
6558
6523
|
var autoConfirmHintCommand = "assist config set sync.autoConfirm true --global";
|
|
@@ -6859,7 +6824,6 @@ var configHelpEntries = [
|
|
|
6859
6824
|
...refactorConfigHelp,
|
|
6860
6825
|
...releasesConfigHelp,
|
|
6861
6826
|
...reviewConfigHelp,
|
|
6862
|
-
...roamConfigHelp,
|
|
6863
6827
|
...runConfigHelp,
|
|
6864
6828
|
...seqConfigHelp,
|
|
6865
6829
|
...sessionsConfigHelp,
|
|
@@ -7989,7 +7953,7 @@ async function fetchAssignedIssues(cwd, entry) {
|
|
|
7989
7953
|
createdAt: issue.createdAt,
|
|
7990
7954
|
author: issue.author?.login ?? "unknown",
|
|
7991
7955
|
labels: (issue.labels ?? []).flatMap(
|
|
7992
|
-
(
|
|
7956
|
+
(label) => label.name ? [label.name] : []
|
|
7993
7957
|
)
|
|
7994
7958
|
}));
|
|
7995
7959
|
}
|
|
@@ -8343,7 +8307,7 @@ function isPickable(filter) {
|
|
|
8343
8307
|
const type = issue.issueType?.name?.toLowerCase();
|
|
8344
8308
|
if (type && excludedTypes.has(type)) return false;
|
|
8345
8309
|
return !(issue.labels?.nodes ?? []).some(
|
|
8346
|
-
(
|
|
8310
|
+
(label) => label?.name && excludedLabels.has(label.name.toLowerCase())
|
|
8347
8311
|
);
|
|
8348
8312
|
};
|
|
8349
8313
|
}
|
|
@@ -8362,7 +8326,7 @@ function toPickup(node, board, order) {
|
|
|
8362
8326
|
createdAt: issue.createdAt ?? "",
|
|
8363
8327
|
author: issue.author?.login ?? "unknown",
|
|
8364
8328
|
labels: (issue.labels?.nodes ?? []).flatMap(
|
|
8365
|
-
(
|
|
8329
|
+
(label) => label?.name ? [label.name] : []
|
|
8366
8330
|
),
|
|
8367
8331
|
project: board.project,
|
|
8368
8332
|
projectTitle: board.title,
|
|
@@ -9193,8 +9157,8 @@ var LINKED_FROM_HEADER = "x-assist-linked-from";
|
|
|
9193
9157
|
function forwardToPeer(req, res, node, url) {
|
|
9194
9158
|
const started = Date.now();
|
|
9195
9159
|
const traceId = newTraceId();
|
|
9196
|
-
const
|
|
9197
|
-
const log2 = (outcome) => console.log(`${
|
|
9160
|
+
const label = `link ${node} http: ${req.method} ${url.pathname} trace=${traceId}`;
|
|
9161
|
+
const log2 = (outcome) => console.log(`${label} -> ${outcome} (${Date.now() - started}ms)`);
|
|
9198
9162
|
const send = url.protocol === "https:" ? httpsRequest : httpRequest;
|
|
9199
9163
|
return new Promise((resolve31) => {
|
|
9200
9164
|
const upstream = send(
|
|
@@ -10946,8 +10910,8 @@ function resolveNamedRepoWriteLabel(globalRaw, name, source = "~/.assist.yml") {
|
|
|
10946
10910
|
// src/commands/config/resolveSharedRepoBlock.ts
|
|
10947
10911
|
async function resolveSharedRepoBlock(orm, repoName, cwd) {
|
|
10948
10912
|
const shared = { repos: await listRepoConfigs(orm) };
|
|
10949
|
-
const
|
|
10950
|
-
return { label
|
|
10913
|
+
const label = repoName === void 0 ? currentRepoLabel(shared, getCurrentOrigin(cwd)) : resolveNamedRepoWriteLabel(shared, repoName, SHARED_REPO_CONFIG_SOURCE);
|
|
10914
|
+
return { label, block: shared.repos[label] ?? {} };
|
|
10951
10915
|
}
|
|
10952
10916
|
function currentRepoLabel(shared, origin) {
|
|
10953
10917
|
return matchRepoConfigKey(shared, origin, SHARED_REPO_CONFIG_SOURCE) ?? origin;
|
|
@@ -10989,8 +10953,8 @@ async function refreshRepoConfigCache(orm) {
|
|
|
10989
10953
|
}
|
|
10990
10954
|
|
|
10991
10955
|
// src/commands/config/saveSharedRepoBlock.ts
|
|
10992
|
-
async function saveSharedRepoBlock(orm,
|
|
10993
|
-
await saveRepoConfig(orm,
|
|
10956
|
+
async function saveSharedRepoBlock(orm, label, block) {
|
|
10957
|
+
await saveRepoConfig(orm, label, block);
|
|
10994
10958
|
await refreshRepoConfigCache(orm);
|
|
10995
10959
|
}
|
|
10996
10960
|
|
|
@@ -10999,12 +10963,12 @@ async function applySharedRepoConfigSet(key, coerced, repoName, cwd = process.cw
|
|
|
10999
10963
|
const globalOnly = globalOnlyRepoKeyError(key, "Set");
|
|
11000
10964
|
if (globalOnly) return globalOnly;
|
|
11001
10965
|
const orm = await getDb();
|
|
11002
|
-
const { label
|
|
10966
|
+
const { label, block } = await resolveSharedRepoBlock(orm, repoName, cwd);
|
|
11003
10967
|
const updatedBlock = setNestedValue(block, key, coerced);
|
|
11004
10968
|
const validation = validateConfig(updatedBlock, key, repoConfigSchema);
|
|
11005
10969
|
if (!validation.ok) return validation;
|
|
11006
|
-
await saveSharedRepoBlock(orm,
|
|
11007
|
-
return { ok: true, target: "repo", label
|
|
10970
|
+
await saveSharedRepoBlock(orm, label, updatedBlock);
|
|
10971
|
+
return { ok: true, target: "repo", label };
|
|
11008
10972
|
}
|
|
11009
10973
|
|
|
11010
10974
|
// src/commands/sessions/web/applyScopedConfigSet.ts
|
|
@@ -11205,11 +11169,11 @@ async function applySharedRepoConfigUnset(key, repoName, cwd = process.cwd()) {
|
|
|
11205
11169
|
const globalOnly = globalOnlyRepoKeyError(key, "Unset");
|
|
11206
11170
|
if (globalOnly) return globalOnly;
|
|
11207
11171
|
const orm = await getDb();
|
|
11208
|
-
const { label
|
|
11172
|
+
const { label, block } = await resolveSharedRepoBlock(orm, repoName, cwd);
|
|
11209
11173
|
const unset = unsetRepoBlockKey(block, key);
|
|
11210
11174
|
if (!unset.ok) return unset;
|
|
11211
|
-
if (unset.removed) await saveSharedRepoBlock(orm,
|
|
11212
|
-
return { ok: true, target: "repo", label
|
|
11175
|
+
if (unset.removed) await saveSharedRepoBlock(orm, label, unset.block);
|
|
11176
|
+
return { ok: true, target: "repo", label, removed: unset.removed };
|
|
11213
11177
|
}
|
|
11214
11178
|
|
|
11215
11179
|
// src/commands/sessions/web/applyScopedConfigUnset.ts
|
|
@@ -11958,10 +11922,10 @@ function renderRestartMenu(items2, selected) {
|
|
|
11958
11922
|
const pointer = active ? chalk12.cyan("\u276F ") : " ";
|
|
11959
11923
|
const number = chalk12.dim(`${i + 1}. `);
|
|
11960
11924
|
const note = item.note ? chalk12.dim(` (${item.note})`) : "";
|
|
11961
|
-
let
|
|
11962
|
-
if (item.disabled)
|
|
11963
|
-
else if (active)
|
|
11964
|
-
lines2.push(`${pointer}${number}${
|
|
11925
|
+
let label = item.label;
|
|
11926
|
+
if (item.disabled) label = chalk12.dim(label);
|
|
11927
|
+
else if (active) label = chalk12.cyan.bold(label);
|
|
11928
|
+
lines2.push(`${pointer}${number}${label}${note}`);
|
|
11965
11929
|
});
|
|
11966
11930
|
lines2.push(chalk12.dim("\u2191/\u2193 move \xB7 1-3 jump \xB7 enter select \xB7 esc close"));
|
|
11967
11931
|
return lines2.join("\n");
|
|
@@ -13834,7 +13798,7 @@ var keyboardInput = () => {
|
|
|
13834
13798
|
};
|
|
13835
13799
|
function renderLineChart({
|
|
13836
13800
|
title,
|
|
13837
|
-
label
|
|
13801
|
+
label,
|
|
13838
13802
|
seriesTitle,
|
|
13839
13803
|
labels,
|
|
13840
13804
|
values,
|
|
@@ -13850,7 +13814,7 @@ function renderLineChart({
|
|
|
13850
13814
|
});
|
|
13851
13815
|
const grid = new contrib.grid({ rows: 1, cols: 1, screen });
|
|
13852
13816
|
const line = grid.set(0, 0, 1, 1, contrib.line, {
|
|
13853
|
-
label: ` ${
|
|
13817
|
+
label: ` ${label} (press q to close) `,
|
|
13854
13818
|
showLegend: true,
|
|
13855
13819
|
legend: { width: Math.max(12, seriesTitle.length + 2) },
|
|
13856
13820
|
xLabelPadding: 3,
|
|
@@ -14073,10 +14037,10 @@ function renderAdviceBody(fragment, context) {
|
|
|
14073
14037
|
// src/commands/advise/adviceConditions.ts
|
|
14074
14038
|
import { existsSync as existsSync36 } from "fs";
|
|
14075
14039
|
import { join as join40 } from "path";
|
|
14076
|
-
function repoFile(file,
|
|
14040
|
+
function repoFile(file, label) {
|
|
14077
14041
|
return {
|
|
14078
|
-
whenMet: `the repo has ${
|
|
14079
|
-
whenUnmet: `the repo has no ${
|
|
14042
|
+
whenMet: `the repo has ${label}`,
|
|
14043
|
+
whenUnmet: `the repo has no ${label}`,
|
|
14080
14044
|
matches: ({ rootDir }) => existsSync36(join40(rootDir, file))
|
|
14081
14045
|
};
|
|
14082
14046
|
}
|
|
@@ -14875,13 +14839,13 @@ function parseChartSeries(lines2) {
|
|
|
14875
14839
|
if (parts.length < 2) {
|
|
14876
14840
|
throw new Error(`Expected a label and a value, got: ${trimmed}`);
|
|
14877
14841
|
}
|
|
14878
|
-
const
|
|
14842
|
+
const label = parts.slice(0, -1).join(" ");
|
|
14879
14843
|
const raw = parts[parts.length - 1];
|
|
14880
14844
|
const value = Number(raw);
|
|
14881
14845
|
if (!Number.isFinite(value)) {
|
|
14882
14846
|
throw new Error(`Value "${raw}" is not numeric, on line: ${trimmed}`);
|
|
14883
14847
|
}
|
|
14884
|
-
points.push({ label
|
|
14848
|
+
points.push({ label, value });
|
|
14885
14849
|
}
|
|
14886
14850
|
return points;
|
|
14887
14851
|
}
|
|
@@ -15182,7 +15146,7 @@ import { eq as eq24 } from "drizzle-orm";
|
|
|
15182
15146
|
// src/commands/backlog/beginAssociation.ts
|
|
15183
15147
|
import chalk42 from "chalk";
|
|
15184
15148
|
import { eq as eq23 } from "drizzle-orm";
|
|
15185
|
-
async function beginAssociation(id, options2, clearPatch,
|
|
15149
|
+
async function beginAssociation(id, options2, clearPatch, label) {
|
|
15186
15150
|
const found = await findOneItem(id);
|
|
15187
15151
|
if (!found) {
|
|
15188
15152
|
process.exitCode = 1;
|
|
@@ -15194,7 +15158,7 @@ async function beginAssociation(id, options2, clearPatch, label2) {
|
|
|
15194
15158
|
await orm.update(items).set(clearPatch).where(eq23(items.id, itemId2));
|
|
15195
15159
|
console.log(
|
|
15196
15160
|
chalk42.green(
|
|
15197
|
-
`Cleared ${
|
|
15161
|
+
`Cleared ${label} association on item ${formatItemId(itemId2)}.`
|
|
15198
15162
|
)
|
|
15199
15163
|
);
|
|
15200
15164
|
return null;
|
|
@@ -16211,14 +16175,14 @@ async function reviewProposal(item, sessionId, confirmed) {
|
|
|
16211
16175
|
}
|
|
16212
16176
|
|
|
16213
16177
|
// src/commands/review/startChainedSession.ts
|
|
16214
|
-
async function startChainedSession(
|
|
16178
|
+
async function startChainedSession(label, start2) {
|
|
16215
16179
|
if (process.env.ASSIST_SESSION !== "1") return;
|
|
16216
16180
|
try {
|
|
16217
16181
|
await start2();
|
|
16218
|
-
console.log(`Started ${
|
|
16182
|
+
console.log(`Started ${label}.`);
|
|
16219
16183
|
} catch (error) {
|
|
16220
16184
|
console.error(
|
|
16221
|
-
`Warning: could not start ${
|
|
16185
|
+
`Warning: could not start ${label}: ${error instanceof Error ? error.message : String(error)}`
|
|
16222
16186
|
);
|
|
16223
16187
|
}
|
|
16224
16188
|
}
|
|
@@ -18002,11 +17966,11 @@ async function phaseDone(id, phase, summary) {
|
|
|
18002
17966
|
if (phaseNumber === void 0) return;
|
|
18003
17967
|
const phaseIndex = phaseNumber - 1;
|
|
18004
17968
|
const itemId2 = parseItemId(id);
|
|
18005
|
-
const
|
|
17969
|
+
const label = formatItemId(itemId2);
|
|
18006
17970
|
const { orm } = await getReady();
|
|
18007
17971
|
const item = await loadItem(orm, itemId2);
|
|
18008
17972
|
if (item === void 0) {
|
|
18009
|
-
console.log(chalk79.red(`Item ${
|
|
17973
|
+
console.log(chalk79.red(`Item ${label} not found.`));
|
|
18010
17974
|
return;
|
|
18011
17975
|
}
|
|
18012
17976
|
function signal() {
|
|
@@ -18019,7 +17983,7 @@ async function phaseDone(id, phase, summary) {
|
|
|
18019
17983
|
if (item.status === "done") {
|
|
18020
17984
|
signal();
|
|
18021
17985
|
console.log(
|
|
18022
|
-
chalk79.dim(`Item ${
|
|
17986
|
+
chalk79.dim(`Item ${label} already done, skipping phase advance.`)
|
|
18023
17987
|
);
|
|
18024
17988
|
return;
|
|
18025
17989
|
}
|
|
@@ -18030,7 +17994,7 @@ async function phaseDone(id, phase, summary) {
|
|
|
18030
17994
|
await setCurrentPhase(id, phaseNumber + 1);
|
|
18031
17995
|
signal();
|
|
18032
17996
|
console.log(
|
|
18033
|
-
chalk79.green(`Phase ${phaseNumber} of item ${
|
|
17997
|
+
chalk79.green(`Phase ${phaseNumber} of item ${label} marked as complete.`)
|
|
18034
17998
|
);
|
|
18035
17999
|
}
|
|
18036
18000
|
|
|
@@ -18098,30 +18062,30 @@ async function surfaceCreatedItem(slashCommand, id) {
|
|
|
18098
18062
|
import chalk81 from "chalk";
|
|
18099
18063
|
async function tryRunById(id, options2) {
|
|
18100
18064
|
const numericId = parseItemId(id);
|
|
18101
|
-
const
|
|
18065
|
+
const label = formatItemId(numericId);
|
|
18102
18066
|
const { orm } = await getReady();
|
|
18103
18067
|
const item = await loadItem(orm, numericId);
|
|
18104
18068
|
if (!item) {
|
|
18105
|
-
console.log(chalk81.red(`Item ${
|
|
18069
|
+
console.log(chalk81.red(`Item ${label} not found.`));
|
|
18106
18070
|
return false;
|
|
18107
18071
|
}
|
|
18108
18072
|
if (item.status === "done") {
|
|
18109
|
-
console.log(chalk81.red(`Item ${
|
|
18073
|
+
console.log(chalk81.red(`Item ${label} is already done.`));
|
|
18110
18074
|
return false;
|
|
18111
18075
|
}
|
|
18112
18076
|
if (item.status === "wontdo") {
|
|
18113
|
-
console.log(chalk81.red(`Item ${
|
|
18077
|
+
console.log(chalk81.red(`Item ${label} is marked won't do.`));
|
|
18114
18078
|
return false;
|
|
18115
18079
|
}
|
|
18116
18080
|
const hasDeps = (item.links ?? []).some((l) => l.type === "depends-on");
|
|
18117
18081
|
if (hasDeps && isBlocked(item, await loadItemSummaries(orm, getOrigin()))) {
|
|
18118
18082
|
console.log(
|
|
18119
|
-
chalk81.red(`Item ${
|
|
18083
|
+
chalk81.red(`Item ${label} is blocked by unresolved dependencies.`)
|
|
18120
18084
|
);
|
|
18121
18085
|
return false;
|
|
18122
18086
|
}
|
|
18123
18087
|
console.log(chalk81.bold(`
|
|
18124
|
-
Running backlog item ${
|
|
18088
|
+
Running backlog item ${label}...
|
|
18125
18089
|
`));
|
|
18126
18090
|
await run2(id, options2);
|
|
18127
18091
|
return true;
|
|
@@ -18640,15 +18604,15 @@ async function findPhase(id, phase) {
|
|
|
18640
18604
|
}
|
|
18641
18605
|
|
|
18642
18606
|
// src/commands/backlog/update/parseListIndex.ts
|
|
18643
|
-
function parseListIndex(raw, length,
|
|
18607
|
+
function parseListIndex(raw, length, label) {
|
|
18644
18608
|
if (!/^\d+$/.test(raw)) {
|
|
18645
|
-
return { ok: false, error: `${
|
|
18609
|
+
return { ok: false, error: `${label} must be a positive integer.` };
|
|
18646
18610
|
}
|
|
18647
18611
|
const index2 = Number.parseInt(raw, 10);
|
|
18648
18612
|
if (index2 < 1 || index2 > length) {
|
|
18649
18613
|
return {
|
|
18650
18614
|
ok: false,
|
|
18651
|
-
error: `${
|
|
18615
|
+
error: `${label} ${index2} is out of range (1-${length}).`
|
|
18652
18616
|
};
|
|
18653
18617
|
}
|
|
18654
18618
|
return { ok: true, index: index2 };
|
|
@@ -19366,8 +19330,8 @@ function printPhaseTasks(phase) {
|
|
|
19366
19330
|
function phaseHeader(index2, name, isCurrent) {
|
|
19367
19331
|
const phaseNumber = index2 + 1;
|
|
19368
19332
|
const marker2 = isCurrent ? chalk108.green("\u25B6 ") : " ";
|
|
19369
|
-
const
|
|
19370
|
-
return `${marker2}${
|
|
19333
|
+
const label = isCurrent ? chalk108.green.bold(`Phase ${phaseNumber}: ${name}`) : `${chalk108.bold(`Phase ${phaseNumber}:`)} ${name}`;
|
|
19334
|
+
return `${marker2}${label}`;
|
|
19371
19335
|
}
|
|
19372
19336
|
function printPhaseSessions(sessions) {
|
|
19373
19337
|
if (sessions.length === 0) return;
|
|
@@ -20691,10 +20655,10 @@ function runHelp(args) {
|
|
|
20691
20655
|
var SAFETY_DEPTH = 10;
|
|
20692
20656
|
var CONCURRENCY = 8;
|
|
20693
20657
|
var interactive = !isClaudeCode();
|
|
20694
|
-
function showProgress(p,
|
|
20658
|
+
function showProgress(p, label) {
|
|
20695
20659
|
if (!interactive) return;
|
|
20696
20660
|
const pct = Math.round(p.done / p.total * 100);
|
|
20697
|
-
process.stderr.write(`\r\x1B[K[${pct}%] Scanning ${
|
|
20661
|
+
process.stderr.write(`\r\x1B[K[${pct}%] Scanning ${label}...`);
|
|
20698
20662
|
}
|
|
20699
20663
|
async function resolveCommand2(cli, path108, description, depth, p) {
|
|
20700
20664
|
showProgress(p, path108.join(" "));
|
|
@@ -20940,8 +20904,8 @@ function denyList() {
|
|
|
20940
20904
|
for (const rule of merged) {
|
|
20941
20905
|
const inProject = projectPatterns.has(rule.pattern);
|
|
20942
20906
|
const inGlobal = globalPatterns.has(rule.pattern);
|
|
20943
|
-
const
|
|
20944
|
-
console.log(`${chalk112.red(rule.pattern)} \u2192 ${rule.message}${
|
|
20907
|
+
const label = inProject && inGlobal ? chalk112.dim(" (project, overrides global)") : inGlobal ? chalk112.dim(" (global)") : "";
|
|
20908
|
+
console.log(`${chalk112.red(rule.pattern)} \u2192 ${rule.message}${label}`);
|
|
20945
20909
|
}
|
|
20946
20910
|
}
|
|
20947
20911
|
|
|
@@ -22959,8 +22923,8 @@ async function browserInspect(selector, options2) {
|
|
|
22959
22923
|
url: options2.url,
|
|
22960
22924
|
...query
|
|
22961
22925
|
});
|
|
22962
|
-
const
|
|
22963
|
-
for (const line of formatInspectMatches(result,
|
|
22926
|
+
const label = options2.text ? `text ${JSON.stringify(options2.text)}` : `selector ${selector}`;
|
|
22927
|
+
for (const line of formatInspectMatches(result, label)) console.log(line);
|
|
22964
22928
|
}
|
|
22965
22929
|
|
|
22966
22930
|
// src/commands/browser/browserSnapshot.ts
|
|
@@ -24250,8 +24214,8 @@ function printNodes(nodes, prefix2) {
|
|
|
24250
24214
|
const connector = isLast ? "\u2514\u2500\u2500 " : "\u251C\u2500\u2500 ";
|
|
24251
24215
|
const childPrefix = isLast ? " " : "\u2502 ";
|
|
24252
24216
|
const isMissing = nodes[i].relativePath.startsWith("[MISSING]");
|
|
24253
|
-
const
|
|
24254
|
-
console.log(`${prefix2}${connector}${
|
|
24217
|
+
const label = isMissing ? chalk157.red(nodes[i].relativePath) : nodes[i].relativePath;
|
|
24218
|
+
console.log(`${prefix2}${connector}${label}`);
|
|
24255
24219
|
printNodes(nodes[i].children, prefix2 + childPrefix);
|
|
24256
24220
|
}
|
|
24257
24221
|
}
|
|
@@ -25700,11 +25664,11 @@ function applyFixStructurePlan(plan2) {
|
|
|
25700
25664
|
}
|
|
25701
25665
|
if (labelRemovals.length > 0) {
|
|
25702
25666
|
writeLineNow(
|
|
25703
|
-
`${where} removing ${labelRemovals.map((
|
|
25667
|
+
`${where} removing ${labelRemovals.map((label) => label.name).join(", ")}`
|
|
25704
25668
|
);
|
|
25705
25669
|
removeIssueLabels(
|
|
25706
25670
|
entry.issue.id,
|
|
25707
|
-
labelRemovals.map((
|
|
25671
|
+
labelRemovals.map((label) => label.id)
|
|
25708
25672
|
);
|
|
25709
25673
|
}
|
|
25710
25674
|
}
|
|
@@ -25736,8 +25700,8 @@ function describe3(entry) {
|
|
|
25736
25700
|
`${where} is still ${entry.typeChange.from ?? "untyped"}, not ${entry.typeChange.to}`
|
|
25737
25701
|
);
|
|
25738
25702
|
}
|
|
25739
|
-
for (const
|
|
25740
|
-
notes.push(`${where} still carries ${
|
|
25703
|
+
for (const label of entry.labelRemovals) {
|
|
25704
|
+
notes.push(`${where} still carries ${label.name}`);
|
|
25741
25705
|
}
|
|
25742
25706
|
return notes;
|
|
25743
25707
|
}
|
|
@@ -25782,7 +25746,7 @@ function parseIssueNode(node) {
|
|
|
25782
25746
|
title: raw.title,
|
|
25783
25747
|
repo,
|
|
25784
25748
|
typeName: raw.issueType?.name ?? null,
|
|
25785
|
-
labels: (raw.labels?.nodes ?? []).filter((
|
|
25749
|
+
labels: (raw.labels?.nodes ?? []).filter((label) => label !== null),
|
|
25786
25750
|
childIds: (raw.subIssues?.nodes ?? []).filter((child) => child !== null).map((child) => child.id)
|
|
25787
25751
|
};
|
|
25788
25752
|
}
|
|
@@ -25813,7 +25777,7 @@ function fetchRootIssue(target) {
|
|
|
25813
25777
|
function matchedLabels(labels, stripLabels) {
|
|
25814
25778
|
if (stripLabels.length === 0) return [];
|
|
25815
25779
|
const wanted = new Set(stripLabels.map((name) => name.trim().toLowerCase()));
|
|
25816
|
-
return labels.filter((
|
|
25780
|
+
return labels.filter((label) => wanted.has(label.name.trim().toLowerCase()));
|
|
25817
25781
|
}
|
|
25818
25782
|
|
|
25819
25783
|
// src/commands/github/issue/fixStructure/normaliseTypeName.ts
|
|
@@ -26015,8 +25979,8 @@ function annotate(entry) {
|
|
|
26015
25979
|
} else {
|
|
26016
25980
|
notes.push(chalk170.dim(entry.issue.typeName ?? "no type"));
|
|
26017
25981
|
}
|
|
26018
|
-
for (const
|
|
26019
|
-
notes.push(chalk170.yellow(`-${
|
|
25982
|
+
for (const label of entry.labelRemovals) {
|
|
25983
|
+
notes.push(chalk170.yellow(`-${label.name}`));
|
|
26020
25984
|
}
|
|
26021
25985
|
return notes;
|
|
26022
25986
|
}
|
|
@@ -26289,7 +26253,7 @@ var minGhAttachVersion = "2.99.0";
|
|
|
26289
26253
|
|
|
26290
26254
|
// src/commands/github/issue/collectLabels.ts
|
|
26291
26255
|
function collectLabels(value, previous) {
|
|
26292
|
-
const added = value.split(",").map((
|
|
26256
|
+
const added = value.split(",").map((label) => label.trim()).filter((label) => label.length > 0);
|
|
26293
26257
|
return [...previous, ...added];
|
|
26294
26258
|
}
|
|
26295
26259
|
|
|
@@ -26533,11 +26497,11 @@ function matchLabel(names, wanted) {
|
|
|
26533
26497
|
}
|
|
26534
26498
|
function resolveIssueLabels(target, wanted) {
|
|
26535
26499
|
const names = readRepoLabels(target);
|
|
26536
|
-
return wanted.map((
|
|
26537
|
-
const match = matchLabel(names,
|
|
26500
|
+
return wanted.map((label) => {
|
|
26501
|
+
const match = matchLabel(names, label);
|
|
26538
26502
|
if (!match) {
|
|
26539
26503
|
throw new Error(
|
|
26540
|
-
`${target.owner}/${target.repo} has no ${
|
|
26504
|
+
`${target.owner}/${target.repo} has no ${label} label. It has ${names.join(", ")}`
|
|
26541
26505
|
);
|
|
26542
26506
|
}
|
|
26543
26507
|
return match;
|
|
@@ -26825,7 +26789,7 @@ function runGhWithAttachments(args, attachments) {
|
|
|
26825
26789
|
function runGhIssueCreate(title, body, repo, metadata2, attachments = []) {
|
|
26826
26790
|
const args = ["issue", "create", "--title", title, "--body", body];
|
|
26827
26791
|
if (repo) args.push("--repo", repo);
|
|
26828
|
-
for (const
|
|
26792
|
+
for (const label of metadata2?.labels ?? []) args.push("--label", label);
|
|
26829
26793
|
if (metadata2?.milestone) args.push("--milestone", metadata2.milestone);
|
|
26830
26794
|
args.push(...attachArgs(attachments));
|
|
26831
26795
|
return runGhWithAttachments(args, attachments);
|
|
@@ -27259,9 +27223,9 @@ function toIssueProjectItem(node) {
|
|
|
27259
27223
|
}
|
|
27260
27224
|
|
|
27261
27225
|
// src/commands/github/issue/parseIssueProjectItems.ts
|
|
27262
|
-
function parseIssueProjectItems(raw,
|
|
27226
|
+
function parseIssueProjectItems(raw, label) {
|
|
27263
27227
|
const issue = JSON.parse(raw).data?.repository?.issue;
|
|
27264
|
-
if (!issue?.id) throw new Error(`No issue ${
|
|
27228
|
+
if (!issue?.id) throw new Error(`No issue ${label} could be read`);
|
|
27265
27229
|
const items2 = (issue.projectItems?.nodes ?? []).map(toIssueProjectItem).filter((item) => item !== void 0);
|
|
27266
27230
|
return { issueId: issue.id, items: items2 };
|
|
27267
27231
|
}
|
|
@@ -30665,10 +30629,10 @@ function agentFooter(unresolvedCount) {
|
|
|
30665
30629
|
import chalk189 from "chalk";
|
|
30666
30630
|
var plain = (text17) => text17;
|
|
30667
30631
|
function colouredState(state) {
|
|
30668
|
-
const
|
|
30669
|
-
if (state === "APPROVED") return chalk189.green(
|
|
30670
|
-
if (state === "CHANGES_REQUESTED") return chalk189.red(
|
|
30671
|
-
return chalk189.yellow(
|
|
30632
|
+
const label = `[${state}]`;
|
|
30633
|
+
if (state === "APPROVED") return chalk189.green(label);
|
|
30634
|
+
if (state === "CHANGES_REQUESTED") return chalk189.red(label);
|
|
30635
|
+
return chalk189.yellow(label);
|
|
30672
30636
|
}
|
|
30673
30637
|
function commentStyle() {
|
|
30674
30638
|
if (isClaudeCode()) {
|
|
@@ -31237,8 +31201,8 @@ function isFile2(path108) {
|
|
|
31237
31201
|
}
|
|
31238
31202
|
}
|
|
31239
31203
|
function parseScreenshotSpec(spec) {
|
|
31240
|
-
const [
|
|
31241
|
-
const [group, caption] = splitOnce(
|
|
31204
|
+
const [label, rawPath] = splitOnce(spec, "=") ?? ["", spec];
|
|
31205
|
+
const [group, caption] = splitOnce(label, "/") ?? ["", label];
|
|
31242
31206
|
const path108 = resolve23(rawPath.trim());
|
|
31243
31207
|
const ext = extname5(path108).replace(/^\./, "").toLowerCase();
|
|
31244
31208
|
if (!isFile2(path108))
|
|
@@ -32401,10 +32365,10 @@ async function readTime(target, options2 = {}) {
|
|
|
32401
32365
|
prose + code * CODE_WORDS_PER_PROSE_WORD,
|
|
32402
32366
|
wordsPerMinute
|
|
32403
32367
|
);
|
|
32404
|
-
const
|
|
32368
|
+
const label = words === 1 ? "word" : "words";
|
|
32405
32369
|
const verdict = seconds > budgetSeconds ? ` \xB7 over the ~${formatReadDuration(budgetSeconds)} budget` : "";
|
|
32406
32370
|
console.log(
|
|
32407
|
-
`${words} ${
|
|
32371
|
+
`${words} ${label} \xB7 ~${formatReadDuration(seconds)} read${verdict}`
|
|
32408
32372
|
);
|
|
32409
32373
|
}
|
|
32410
32374
|
function resolveBudget(budget) {
|
|
@@ -32864,10 +32828,10 @@ async function ravendbQuery(connectionName, collection, options2) {
|
|
|
32864
32828
|
// src/commands/registerRavendb.ts
|
|
32865
32829
|
function registerRavendb(program) {
|
|
32866
32830
|
const cmd = program.command("ravendb").description("RavenDB query utilities");
|
|
32867
|
-
const
|
|
32868
|
-
|
|
32869
|
-
|
|
32870
|
-
|
|
32831
|
+
const auth = cmd.command("auth").description("Configure a named RavenDB connection");
|
|
32832
|
+
auth.command("add").description("Add a new connection").action(() => ravendbAuth.add());
|
|
32833
|
+
auth.command("list").description("List configured connections").action(() => ravendbAuth.list());
|
|
32834
|
+
auth.command("remove <name>").description("Remove a configured connection").action((name) => ravendbAuth.remove(name));
|
|
32871
32835
|
cmd.command("set-connection <name>").description("Set the default connection").action((name) => ravendbSetConnection(name));
|
|
32872
32836
|
cmd.command("query [connection] [collection]").description("Query a RavenDB collection").option("--page-size <n>", "Documents per page", "25").option(
|
|
32873
32837
|
"--sort <field>",
|
|
@@ -33003,11 +32967,11 @@ async function writeConfigKeys(writes, scope, cwd = process.cwd()) {
|
|
|
33003
32967
|
}
|
|
33004
32968
|
async function writeRepoBlock(writes, cwd) {
|
|
33005
32969
|
const orm = await getDb();
|
|
33006
|
-
const { label
|
|
32970
|
+
const { label, block } = await resolveSharedRepoBlock(orm, void 0, cwd);
|
|
33007
32971
|
const applied = applyConfigWrites(block, writes, repoConfigSchema);
|
|
33008
32972
|
if (!applied.ok) return applied;
|
|
33009
|
-
await saveSharedRepoBlock(orm,
|
|
33010
|
-
return { ok: true, target: `${SHARED_REPO_CONFIG_SOURCE}, repo: ${
|
|
32973
|
+
await saveSharedRepoBlock(orm, label, applied.updated);
|
|
32974
|
+
return { ok: true, target: `${SHARED_REPO_CONFIG_SOURCE}, repo: ${label}` };
|
|
33011
32975
|
}
|
|
33012
32976
|
|
|
33013
32977
|
// src/commands/releases/declaredStreamsInScope.ts
|
|
@@ -33723,9 +33687,9 @@ var LEVEL_COLOR = {
|
|
|
33723
33687
|
};
|
|
33724
33688
|
function formatLimit(pct, resetsAt, windowSeconds, fallbackLabel, now) {
|
|
33725
33689
|
const level = rateLimitLevel(pct, resetsAt, windowSeconds, now);
|
|
33726
|
-
const
|
|
33690
|
+
const label = LEVEL_COLOR[level](`${Math.round(pct)}%`);
|
|
33727
33691
|
const timeLabel = resetsAt ? formatRateLimitTimeLeft(resetsAt, now) : fallbackLabel;
|
|
33728
|
-
return `${
|
|
33692
|
+
return `${label} (${timeLabel})`;
|
|
33729
33693
|
}
|
|
33730
33694
|
function buildLimitsSegment(rateLimits) {
|
|
33731
33695
|
const fiveHrPct = rateLimits?.five_hour?.used_percentage;
|
|
@@ -33820,14 +33784,14 @@ function formatNumber(num) {
|
|
|
33820
33784
|
return num.toLocaleString("en-US");
|
|
33821
33785
|
}
|
|
33822
33786
|
function colorizePercent(pct) {
|
|
33823
|
-
const
|
|
33787
|
+
const label = `${Math.round(pct)}%`;
|
|
33824
33788
|
switch (contextLevel(pct)) {
|
|
33825
33789
|
case "red":
|
|
33826
|
-
return chalk212.red(
|
|
33790
|
+
return chalk212.red(label);
|
|
33827
33791
|
case "yellow":
|
|
33828
|
-
return chalk212.yellow(
|
|
33792
|
+
return chalk212.yellow(label);
|
|
33829
33793
|
default:
|
|
33830
|
-
return
|
|
33794
|
+
return label;
|
|
33831
33795
|
}
|
|
33832
33796
|
}
|
|
33833
33797
|
async function statusLine() {
|
|
@@ -36496,19 +36460,19 @@ function nodesOf(at2, prefix2) {
|
|
|
36496
36460
|
return [...dirs.sort(byName), ...files.sort(byName)];
|
|
36497
36461
|
}
|
|
36498
36462
|
function collapsedDirNode(name, at2, prefix2) {
|
|
36499
|
-
let
|
|
36463
|
+
let label = name;
|
|
36500
36464
|
let path108 = prefix2 ? `${prefix2}/${name}` : name;
|
|
36501
36465
|
let node = at2;
|
|
36502
36466
|
while (node.files.length === 0 && node.dirs.size === 1) {
|
|
36503
36467
|
const [childName, child] = [...node.dirs][0];
|
|
36504
|
-
|
|
36468
|
+
label = `${label}/${childName}`;
|
|
36505
36469
|
path108 = `${path108}/${childName}`;
|
|
36506
36470
|
node = child;
|
|
36507
36471
|
}
|
|
36508
36472
|
const children = nodesOf(node, path108);
|
|
36509
36473
|
return {
|
|
36510
36474
|
kind: "dir",
|
|
36511
|
-
name:
|
|
36475
|
+
name: label,
|
|
36512
36476
|
path: path108,
|
|
36513
36477
|
additions: sum(children, "additions"),
|
|
36514
36478
|
deletions: sum(children, "deletions"),
|
|
@@ -38095,8 +38059,8 @@ function total(usages) {
|
|
|
38095
38059
|
format(sumOf(reported, (u) => u.cacheWrite))
|
|
38096
38060
|
];
|
|
38097
38061
|
}
|
|
38098
|
-
function row2(
|
|
38099
|
-
return `| ${
|
|
38062
|
+
function row2(label, values) {
|
|
38063
|
+
return `| ${label} | ${values.join(" | ")} |`;
|
|
38100
38064
|
}
|
|
38101
38065
|
function buildTokenUsageTable(usages) {
|
|
38102
38066
|
return [
|
|
@@ -38606,13 +38570,13 @@ function formatToolText(name, tool, summary) {
|
|
|
38606
38570
|
|
|
38607
38571
|
// src/commands/review/reportReviewerToolUse.ts
|
|
38608
38572
|
function reportReviewerToolUse(name, use, spinner, model) {
|
|
38609
|
-
const
|
|
38573
|
+
const label = reviewerLabel(name, model);
|
|
38610
38574
|
if (spinner) {
|
|
38611
|
-
spinner.text = formatToolText(
|
|
38575
|
+
spinner.text = formatToolText(label, use.tool, use.summary);
|
|
38612
38576
|
return;
|
|
38613
38577
|
}
|
|
38614
38578
|
const suffix = use.summary ? `: ${use.summary}` : "";
|
|
38615
|
-
console.log(`[${
|
|
38579
|
+
console.log(`[${label}] ${use.tool}${suffix}`);
|
|
38616
38580
|
}
|
|
38617
38581
|
|
|
38618
38582
|
// src/commands/review/createClaudeLineHandler.ts
|
|
@@ -38642,16 +38606,16 @@ function summariseStderr(stderr) {
|
|
|
38642
38606
|
return trimmed.length > SUMMARY_MAX_LEN ? `${trimmed.slice(0, SUMMARY_MAX_LEN - 1)}\u2026` : trimmed;
|
|
38643
38607
|
}
|
|
38644
38608
|
function finaliseReviewerSpinner(spinner, outcome) {
|
|
38645
|
-
const
|
|
38609
|
+
const label = reviewerLabel(outcome.name, outcome.model);
|
|
38646
38610
|
const elapsed = Math.round(outcome.elapsedMs / 1e3);
|
|
38647
38611
|
if (outcome.exitCode === 0) {
|
|
38648
|
-
spinner.succeed(`${
|
|
38612
|
+
spinner.succeed(`${label} \u2014 done in ${elapsed}s`);
|
|
38649
38613
|
return;
|
|
38650
38614
|
}
|
|
38651
38615
|
const summary = summariseStderr(outcome.stderr ?? "");
|
|
38652
38616
|
const suffix = summary ? `: ${summary}` : "";
|
|
38653
38617
|
spinner.fail(
|
|
38654
|
-
`${
|
|
38618
|
+
`${label} \u2014 failed in ${elapsed}s (exit ${outcome.exitCode})${suffix}`
|
|
38655
38619
|
);
|
|
38656
38620
|
}
|
|
38657
38621
|
|
|
@@ -39322,9 +39286,9 @@ function createUi(spinnerUi) {
|
|
|
39322
39286
|
function finishUi(ui, ok) {
|
|
39323
39287
|
if (!ui.elapsed) return;
|
|
39324
39288
|
const seconds = Math.round((Date.now() - ui.startedAt) / 1e3);
|
|
39325
|
-
const
|
|
39326
|
-
if (ok) ui.elapsed.succeed(
|
|
39327
|
-
else ui.elapsed.fail(
|
|
39289
|
+
const label = `total: ${seconds}s`;
|
|
39290
|
+
if (ok) ui.elapsed.succeed(label);
|
|
39291
|
+
else ui.elapsed.fail(label);
|
|
39328
39292
|
}
|
|
39329
39293
|
async function runReviewPipeline(paths, options2) {
|
|
39330
39294
|
const cachedClaude = cachedReviewerResult("claude", paths.claudePath);
|
|
@@ -39356,8 +39320,8 @@ var FILE_HEADER2 = /^\+\+\+ (?:b\/)?(.+)$/;
|
|
|
39356
39320
|
var HUNK_HEADER4 = /^@@ -\d+(?:,\d+)? \+(\d+)(?:,\d+)? @@/;
|
|
39357
39321
|
var GUTTER_WIDTH = 6;
|
|
39358
39322
|
function gutter(lineNumber) {
|
|
39359
|
-
const
|
|
39360
|
-
return `${
|
|
39323
|
+
const label = lineNumber === null ? "" : String(lineNumber);
|
|
39324
|
+
return `${label.padStart(GUTTER_WIDTH, " ")} `;
|
|
39361
39325
|
}
|
|
39362
39326
|
function annotateDiffWithLineNumbers(diff3) {
|
|
39363
39327
|
let inFile = false;
|
|
@@ -40360,8 +40324,8 @@ function listRules(target, options2 = {}) {
|
|
|
40360
40324
|
const resolved = path89.resolve(target ?? process.cwd());
|
|
40361
40325
|
const rules2 = readScopedRules(resolved);
|
|
40362
40326
|
if (rules2.length === 0) {
|
|
40363
|
-
const
|
|
40364
|
-
console.log(chalk246.gray(`No rules in scope for ${
|
|
40327
|
+
const label = path89.relative(process.cwd(), resolved) || ".";
|
|
40328
|
+
console.log(chalk246.gray(`No rules in scope for ${label}`));
|
|
40365
40329
|
return;
|
|
40366
40330
|
}
|
|
40367
40331
|
const base = findRepoRoot(scopeDirectory(resolved));
|
|
@@ -40725,10 +40689,10 @@ function seqSetConnection(name) {
|
|
|
40725
40689
|
// src/commands/registerSeq.ts
|
|
40726
40690
|
function registerSeq(program) {
|
|
40727
40691
|
const cmd = program.command("seq").description("Seq log query utilities");
|
|
40728
|
-
const
|
|
40729
|
-
|
|
40730
|
-
|
|
40731
|
-
|
|
40692
|
+
const auth = cmd.command("auth").description("Configure a Seq connection");
|
|
40693
|
+
auth.command("add").description("Add a new connection").action(() => seqAuth.add());
|
|
40694
|
+
auth.command("list").description("List configured connections").action(() => seqAuth.list());
|
|
40695
|
+
auth.command("remove <name>").description("Remove a configured connection").action((name) => seqAuth.remove(name));
|
|
40732
40696
|
cmd.command("set-connection <name>").description("Set the default Seq connection").action((name) => seqSetConnection(name));
|
|
40733
40697
|
cmd.command("query <filter>").description("Query Seq events with a filter expression").option("-c, --connection <name>", "Connection to use").option("-n, --count <n>", "Number of events to fetch", "50").option(
|
|
40734
40698
|
"--from <date>",
|
|
@@ -41254,10 +41218,10 @@ async function sqlTables(connectionName) {
|
|
|
41254
41218
|
// src/commands/registerSql.ts
|
|
41255
41219
|
function registerSql(program) {
|
|
41256
41220
|
const cmd = program.command("sql").description("MSSQL query utilities");
|
|
41257
|
-
const
|
|
41258
|
-
|
|
41259
|
-
|
|
41260
|
-
|
|
41221
|
+
const auth = cmd.command("auth").description("Configure a SQL connection");
|
|
41222
|
+
auth.command("add").description("Add a new connection").action(() => sqlAuth.add());
|
|
41223
|
+
auth.command("list").description("List configured connections").action(() => sqlAuth.list());
|
|
41224
|
+
auth.command("remove <name>").description("Remove a configured connection").action((name) => sqlAuth.remove(name));
|
|
41261
41225
|
cmd.command("set-connection <name>").description("Set the default SQL connection").action((name) => sqlSetConnection(name));
|
|
41262
41226
|
cmd.command("query <sql> [connection]").description("Execute a read-only SQL query (rejects mutating statements)").action(
|
|
41263
41227
|
(query, connection) => sqlQuery(query, connection)
|
|
@@ -41351,27 +41315,27 @@ function unexpectedContent(skillDir) {
|
|
|
41351
41315
|
}
|
|
41352
41316
|
|
|
41353
41317
|
// src/commands/sync/reportPrune.ts
|
|
41354
|
-
function reportPrune(
|
|
41318
|
+
function reportPrune(label, result, force) {
|
|
41355
41319
|
if (result.orphans.length === 0) {
|
|
41356
|
-
console.log(`No orphaned commands in ${
|
|
41320
|
+
console.log(`No orphaned commands in ${label}`);
|
|
41357
41321
|
} else if (force) {
|
|
41358
41322
|
for (const name of result.removed) {
|
|
41359
|
-
console.log(`Removed ${name} from ${
|
|
41323
|
+
console.log(`Removed ${name} from ${label}`);
|
|
41360
41324
|
}
|
|
41361
41325
|
} else {
|
|
41362
|
-
console.log(`Orphaned commands in ${
|
|
41326
|
+
console.log(`Orphaned commands in ${label} (run with --force to remove):`);
|
|
41363
41327
|
for (const name of result.orphans) {
|
|
41364
41328
|
console.log(` ${name}`);
|
|
41365
41329
|
}
|
|
41366
41330
|
}
|
|
41367
41331
|
if (result.skipped.length > 0) {
|
|
41368
|
-
console.log(`Left in place in ${
|
|
41332
|
+
console.log(`Left in place in ${label} (not written by sync):`);
|
|
41369
41333
|
for (const { name, reason: reason4 } of result.skipped) {
|
|
41370
41334
|
console.log(` ${name} - ${reason4}`);
|
|
41371
41335
|
}
|
|
41372
41336
|
}
|
|
41373
41337
|
if (result.unmanaged.length === 0) return;
|
|
41374
|
-
console.log(`Not managed by sync in ${
|
|
41338
|
+
console.log(`Not managed by sync in ${label} (never removed):`);
|
|
41375
41339
|
for (const name of result.unmanaged) {
|
|
41376
41340
|
console.log(` ${name}`);
|
|
41377
41341
|
}
|
|
@@ -42033,8 +41997,8 @@ function askQuestion(rl, question) {
|
|
|
42033
41997
|
}
|
|
42034
41998
|
|
|
42035
41999
|
// src/commands/transcript/configure.ts
|
|
42036
|
-
function buildPrompt4(
|
|
42037
|
-
return current ? `${
|
|
42000
|
+
function buildPrompt4(label, current) {
|
|
42001
|
+
return current ? `${label} [${current}]: ` : `${label}: `;
|
|
42038
42002
|
}
|
|
42039
42003
|
function printExisting(existing) {
|
|
42040
42004
|
console.log("Current configuration:");
|
|
@@ -42390,10 +42354,10 @@ function registerTranscript(program) {
|
|
|
42390
42354
|
}
|
|
42391
42355
|
|
|
42392
42356
|
// src/commands/verify/reportVerifyProblems.ts
|
|
42393
|
-
function verifySection(
|
|
42357
|
+
function verifySection(label, entries) {
|
|
42394
42358
|
if (entries.length === 0) return void 0;
|
|
42395
42359
|
const list6 = entries.sort().map((entry) => ` ${entry}`).join("\n");
|
|
42396
|
-
return `${
|
|
42360
|
+
return `${label}:
|
|
42397
42361
|
${list6}`;
|
|
42398
42362
|
}
|
|
42399
42363
|
function reportVerifyProblems(problems, success) {
|
|
@@ -43896,165 +43860,6 @@ function registerWatch(program) {
|
|
|
43896
43860
|
);
|
|
43897
43861
|
}
|
|
43898
43862
|
|
|
43899
|
-
// src/commands/roam/auth.ts
|
|
43900
|
-
import { randomBytes } from "crypto";
|
|
43901
|
-
import chalk260 from "chalk";
|
|
43902
|
-
|
|
43903
|
-
// src/commands/roam/waitForCallback.ts
|
|
43904
|
-
import { createServer as createServer3 } from "http";
|
|
43905
|
-
function respondHtml(res, status2, title) {
|
|
43906
|
-
res.writeHead(status2, { "Content-Type": "text/html" });
|
|
43907
|
-
res.end(
|
|
43908
|
-
`<html><body><h1>${title}</h1><p>You can close this tab.</p></body></html>`
|
|
43909
|
-
);
|
|
43910
|
-
}
|
|
43911
|
-
function extractCode(url, expectedState) {
|
|
43912
|
-
const error = url.searchParams.get("error");
|
|
43913
|
-
if (error) throw new Error(`Authorization denied: ${error}`);
|
|
43914
|
-
const state = url.searchParams.get("state");
|
|
43915
|
-
if (state !== expectedState)
|
|
43916
|
-
throw new Error("State mismatch \u2014 possible CSRF attack");
|
|
43917
|
-
const code = url.searchParams.get("code");
|
|
43918
|
-
if (!code) throw new Error("No authorization code received");
|
|
43919
|
-
return code;
|
|
43920
|
-
}
|
|
43921
|
-
function waitForCallback(port, expectedState) {
|
|
43922
|
-
return new Promise((resolve31, reject) => {
|
|
43923
|
-
const timeout = setTimeout(() => {
|
|
43924
|
-
server.close();
|
|
43925
|
-
reject(new Error("Authorization timed out after 120 seconds"));
|
|
43926
|
-
}, 12e4);
|
|
43927
|
-
const server = createServer3((req, res) => {
|
|
43928
|
-
const url = new URL(req.url ?? "/", `http://localhost:${port}`);
|
|
43929
|
-
if (url.pathname !== "/callback") {
|
|
43930
|
-
res.writeHead(404);
|
|
43931
|
-
res.end();
|
|
43932
|
-
return;
|
|
43933
|
-
}
|
|
43934
|
-
clearTimeout(timeout);
|
|
43935
|
-
try {
|
|
43936
|
-
const code = extractCode(url, expectedState);
|
|
43937
|
-
respondHtml(res, 200, "Authorization successful!");
|
|
43938
|
-
server.close();
|
|
43939
|
-
resolve31(code);
|
|
43940
|
-
} catch (error) {
|
|
43941
|
-
respondHtml(res, 400, error.message);
|
|
43942
|
-
server.close();
|
|
43943
|
-
reject(error);
|
|
43944
|
-
}
|
|
43945
|
-
});
|
|
43946
|
-
server.listen(port);
|
|
43947
|
-
});
|
|
43948
|
-
}
|
|
43949
|
-
|
|
43950
|
-
// src/commands/roam/authorizeInBrowser.ts
|
|
43951
|
-
var PORT = 14523;
|
|
43952
|
-
var REDIRECT_URI = `http://localhost:${PORT}/callback`;
|
|
43953
|
-
var SCOPES = "user:read meetings:read transcript:read user:read.email";
|
|
43954
|
-
function buildAuthorizeUrl(clientId, state) {
|
|
43955
|
-
const params = new URLSearchParams({
|
|
43956
|
-
client_id: clientId,
|
|
43957
|
-
redirect_uri: REDIRECT_URI,
|
|
43958
|
-
response_type: "code",
|
|
43959
|
-
scope: SCOPES,
|
|
43960
|
-
state
|
|
43961
|
-
});
|
|
43962
|
-
return `https://ro.am/oauth/authorize?${params}`;
|
|
43963
|
-
}
|
|
43964
|
-
async function authorizeInBrowser(clientId, state) {
|
|
43965
|
-
openBrowser(buildAuthorizeUrl(clientId, state));
|
|
43966
|
-
const code = await waitForCallback(PORT, state);
|
|
43967
|
-
return { code, redirectUri: REDIRECT_URI };
|
|
43968
|
-
}
|
|
43969
|
-
|
|
43970
|
-
// src/commands/roam/exchangeToken.ts
|
|
43971
|
-
async function exchangeToken(params) {
|
|
43972
|
-
const body = new URLSearchParams({
|
|
43973
|
-
grant_type: "authorization_code",
|
|
43974
|
-
code: params.code,
|
|
43975
|
-
client_id: params.clientId,
|
|
43976
|
-
client_secret: params.clientSecret,
|
|
43977
|
-
redirect_uri: params.redirectUri
|
|
43978
|
-
});
|
|
43979
|
-
const response = await fetch("https://ro.am/oauth/token", {
|
|
43980
|
-
method: "POST",
|
|
43981
|
-
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
|
43982
|
-
body: body.toString()
|
|
43983
|
-
});
|
|
43984
|
-
if (!response.ok) {
|
|
43985
|
-
const text17 = await response.text();
|
|
43986
|
-
throw new Error(`Token exchange failed (${response.status}): ${text17}`);
|
|
43987
|
-
}
|
|
43988
|
-
return response.json();
|
|
43989
|
-
}
|
|
43990
|
-
|
|
43991
|
-
// src/commands/roam/promptCredentials.ts
|
|
43992
|
-
import enquirer10 from "enquirer";
|
|
43993
|
-
function censor(value) {
|
|
43994
|
-
const visible = value.slice(-4);
|
|
43995
|
-
return `${"*".repeat(value.length - 4)}${visible}`;
|
|
43996
|
-
}
|
|
43997
|
-
function label(name, existing) {
|
|
43998
|
-
return existing ? `${name} (${censor(existing)})` : name;
|
|
43999
|
-
}
|
|
44000
|
-
async function promptField(name, existing) {
|
|
44001
|
-
const { value } = await enquirer10.prompt({
|
|
44002
|
-
type: "input",
|
|
44003
|
-
name: "value",
|
|
44004
|
-
message: `${label(name, existing)}:`,
|
|
44005
|
-
validate: (v) => v.trim().length > 0 || !!existing || `${name} is required`
|
|
44006
|
-
});
|
|
44007
|
-
return value.trim() || existing || "";
|
|
44008
|
-
}
|
|
44009
|
-
async function promptCredentials2(existing) {
|
|
44010
|
-
const clientId = await promptField("Client ID", existing?.clientId);
|
|
44011
|
-
const clientSecret = await promptField(
|
|
44012
|
-
"Client Secret",
|
|
44013
|
-
existing?.clientSecret
|
|
44014
|
-
);
|
|
44015
|
-
if (!clientId || !clientSecret) {
|
|
44016
|
-
throw new Error("Client ID and Client Secret are required");
|
|
44017
|
-
}
|
|
44018
|
-
return { clientId, clientSecret };
|
|
44019
|
-
}
|
|
44020
|
-
|
|
44021
|
-
// src/commands/roam/auth.ts
|
|
44022
|
-
async function auth() {
|
|
44023
|
-
const config = loadGlobalConfigRaw();
|
|
44024
|
-
const { clientId, clientSecret } = await promptCredentials2(
|
|
44025
|
-
config.roam
|
|
44026
|
-
);
|
|
44027
|
-
const existingRoam = config.roam ?? {};
|
|
44028
|
-
config.roam = { ...existingRoam, clientId, clientSecret };
|
|
44029
|
-
saveGlobalConfig(config);
|
|
44030
|
-
const state = randomBytes(16).toString("hex");
|
|
44031
|
-
console.log(
|
|
44032
|
-
chalk260.yellow("\nEnsure this Redirect URI is set in your Roam OAuth app:")
|
|
44033
|
-
);
|
|
44034
|
-
console.log(chalk260.white("http://localhost:14523/callback\n"));
|
|
44035
|
-
console.log(chalk260.blue("Opening browser for authorization..."));
|
|
44036
|
-
console.log(chalk260.dim("Waiting for authorization callback..."));
|
|
44037
|
-
const { code, redirectUri } = await authorizeInBrowser(clientId, state);
|
|
44038
|
-
console.log(chalk260.dim("Exchanging code for tokens..."));
|
|
44039
|
-
const tokens = await exchangeToken({
|
|
44040
|
-
code,
|
|
44041
|
-
clientId,
|
|
44042
|
-
clientSecret,
|
|
44043
|
-
redirectUri
|
|
44044
|
-
});
|
|
44045
|
-
config.roam = {
|
|
44046
|
-
clientId,
|
|
44047
|
-
clientSecret,
|
|
44048
|
-
accessToken: tokens.access_token,
|
|
44049
|
-
refreshToken: tokens.refresh_token,
|
|
44050
|
-
tokenExpiresAt: Date.now() + tokens.expires_in * 1e3
|
|
44051
|
-
};
|
|
44052
|
-
saveGlobalConfig(config);
|
|
44053
|
-
console.log(
|
|
44054
|
-
chalk260.green("Roam credentials and tokens saved to ~/.assist.yml")
|
|
44055
|
-
);
|
|
44056
|
-
}
|
|
44057
|
-
|
|
44058
43863
|
// src/commands/roam/postRoamActivity.ts
|
|
44059
43864
|
import { execFileSync as execFileSync32 } from "child_process";
|
|
44060
43865
|
import { readdirSync as readdirSync23, readFileSync as readFileSync65, statSync as statSync13 } from "fs";
|
|
@@ -44127,12 +43932,10 @@ async function stopCodexIcon() {
|
|
|
44127
43932
|
// src/commands/roam/registerRoam.ts
|
|
44128
43933
|
function registerRoam(program) {
|
|
44129
43934
|
const roamCommand = program.command("roam").description("Roam Research utilities");
|
|
44130
|
-
roamCommand.command("auth").description("Configure Roam API credentials").action(auth);
|
|
44131
43935
|
roamCommand.command("show-claude-code-icon").description("Forward Claude Code hook activity to Roam local API").action(showClaudeCodeIcon);
|
|
44132
43936
|
roamCommand.command("stop-claude-code-icon").description("Signal Claude Code session stop to Roam local API").action(stopClaudeCodeIcon);
|
|
44133
43937
|
roamCommand.command("show-codex-icon").description("Forward Codex hook activity to Roam local API").action(showCodexIcon);
|
|
44134
43938
|
roamCommand.command("stop-codex-icon").description("Signal Codex session stop to Roam local API").action(stopCodexIcon);
|
|
44135
|
-
configHelp(roamCommand, roamConfigHelp);
|
|
44136
43939
|
}
|
|
44137
43940
|
|
|
44138
43941
|
// src/commands/run/formatConfiguredCommands.ts
|
|
@@ -44275,13 +44078,13 @@ import { join as join103 } from "path";
|
|
|
44275
44078
|
// src/commands/run/editRepoRunList.ts
|
|
44276
44079
|
async function editRepoRunList(repoName, cwd, edit2) {
|
|
44277
44080
|
const orm = await getDb();
|
|
44278
|
-
const { label
|
|
44279
|
-
const run4 = edit2(block.run ?? [],
|
|
44081
|
+
const { label, block } = await resolveSharedRepoBlock(orm, repoName, cwd);
|
|
44082
|
+
const run4 = edit2(block.run ?? [], label);
|
|
44280
44083
|
const updated2 = { ...block, run: run4 };
|
|
44281
44084
|
const validation = validateConfig(updated2, "run", repoConfigSchema);
|
|
44282
44085
|
if (!validation.ok) exitWithConfigErrors(validation.errors);
|
|
44283
|
-
await saveSharedRepoBlock(orm,
|
|
44284
|
-
return
|
|
44086
|
+
await saveSharedRepoBlock(orm, label, updated2);
|
|
44087
|
+
return label;
|
|
44285
44088
|
}
|
|
44286
44089
|
|
|
44287
44090
|
// src/commands/run/ensureNoDuplicateRun.ts
|
|
@@ -44458,12 +44261,12 @@ async function add4() {
|
|
|
44458
44261
|
const entry = buildRunEntry(name, command, args, options2);
|
|
44459
44262
|
const display = formatDisplay(command, args);
|
|
44460
44263
|
if (repo !== void 0) {
|
|
44461
|
-
const
|
|
44264
|
+
const label = await addRepoRunConfig(
|
|
44462
44265
|
entry,
|
|
44463
44266
|
typeof repo === "string" ? repo : void 0
|
|
44464
44267
|
);
|
|
44465
44268
|
console.log(
|
|
44466
|
-
`Added run configuration: ${name} -> ${display} (repo: ${
|
|
44269
|
+
`Added run configuration: ${name} -> ${display} (repo: ${label})`
|
|
44467
44270
|
);
|
|
44468
44271
|
return;
|
|
44469
44272
|
}
|
|
@@ -44562,9 +44365,9 @@ function isNamed(entry, name) {
|
|
|
44562
44365
|
return "name" in entry && entry.name === name;
|
|
44563
44366
|
}
|
|
44564
44367
|
function removeRepoRunConfig(name, repoName, cwd = process.cwd()) {
|
|
44565
|
-
return editRepoRunList(repoName, cwd, (runList,
|
|
44368
|
+
return editRepoRunList(repoName, cwd, (runList, label) => {
|
|
44566
44369
|
if (!runList.some((r) => isNamed(r, name))) {
|
|
44567
|
-
console.error(`Run configuration "${name}" not found in repo ${
|
|
44370
|
+
console.error(`Run configuration "${name}" not found in repo ${label}`);
|
|
44568
44371
|
process.exit(1);
|
|
44569
44372
|
}
|
|
44570
44373
|
return runList.filter((r) => !isNamed(r, name));
|
|
@@ -44592,11 +44395,11 @@ function removeProjectRunConfig(name) {
|
|
|
44592
44395
|
}
|
|
44593
44396
|
async function remove2(name, options2 = {}) {
|
|
44594
44397
|
if (options2.repo !== void 0) {
|
|
44595
|
-
const
|
|
44398
|
+
const label = await removeRepoRunConfig(
|
|
44596
44399
|
name,
|
|
44597
44400
|
typeof options2.repo === "string" ? options2.repo : void 0
|
|
44598
44401
|
);
|
|
44599
|
-
console.log(`Removed run configuration: ${name} (repo: ${
|
|
44402
|
+
console.log(`Removed run configuration: ${name} (repo: ${label})`);
|
|
44600
44403
|
return;
|
|
44601
44404
|
}
|
|
44602
44405
|
removeProjectRunConfig(name);
|
|
@@ -44627,18 +44430,18 @@ function registerRun(program) {
|
|
|
44627
44430
|
}
|
|
44628
44431
|
|
|
44629
44432
|
// src/commands/sessions/nodes/formatLink.ts
|
|
44630
|
-
import
|
|
44433
|
+
import chalk260 from "chalk";
|
|
44631
44434
|
var STATE_COLOURS = {
|
|
44632
|
-
connected:
|
|
44633
|
-
connecting:
|
|
44634
|
-
disconnected:
|
|
44635
|
-
"version-blocked":
|
|
44435
|
+
connected: chalk260.green,
|
|
44436
|
+
connecting: chalk260.yellow,
|
|
44437
|
+
disconnected: chalk260.red,
|
|
44438
|
+
"version-blocked": chalk260.red
|
|
44636
44439
|
};
|
|
44637
44440
|
function formatLink(link3) {
|
|
44638
|
-
const colour = STATE_COLOURS[link3.state] ??
|
|
44441
|
+
const colour = STATE_COLOURS[link3.state] ?? chalk260.white;
|
|
44639
44442
|
const peer = link3.peerVersion ? ` peer ${link3.peerVersion}` : "";
|
|
44640
44443
|
const error = link3.error ? `
|
|
44641
|
-
${
|
|
44444
|
+
${chalk260.dim(`last error${link3.errorAt ? ` ${link3.errorAt}` : ""}: ${link3.error}`)}` : "";
|
|
44642
44445
|
return ` ${link3.name} ${colour(link3.state)} ${link3.url}${peer}${error}`;
|
|
44643
44446
|
}
|
|
44644
44447
|
|
|
@@ -47146,13 +46949,13 @@ function parsePreviewMetadata(value) {
|
|
|
47146
46949
|
if (!Array.isArray(value)) return void 0;
|
|
47147
46950
|
const items2 = value.flatMap((entry) => {
|
|
47148
46951
|
const {
|
|
47149
|
-
label
|
|
46952
|
+
label,
|
|
47150
46953
|
value: text17,
|
|
47151
46954
|
url
|
|
47152
46955
|
} = entry ?? {};
|
|
47153
|
-
if (typeof
|
|
46956
|
+
if (typeof label !== "string" || typeof text17 !== "string") return [];
|
|
47154
46957
|
return [
|
|
47155
|
-
typeof url === "string" ? { label
|
|
46958
|
+
typeof url === "string" ? { label, value: text17, url } : { label, value: text17 }
|
|
47156
46959
|
];
|
|
47157
46960
|
});
|
|
47158
46961
|
return items2.length > 0 ? items2 : void 0;
|
|
@@ -49034,12 +48837,12 @@ var portWaitTiming = { pollMs: 500, timeoutMs: 3e4 };
|
|
|
49034
48837
|
function awaitServerPort(session, port, deps2) {
|
|
49035
48838
|
const { sessions, clients, onStatusChange, notify: notify2 } = deps2;
|
|
49036
48839
|
const deadline = Date.now() + portWaitTiming.timeoutMs;
|
|
49037
|
-
const
|
|
48840
|
+
const label = `session ${session.id} ("${session.name}")`;
|
|
49038
48841
|
const tick = () => {
|
|
49039
48842
|
if (!session.pendingStart || sessions.get(session.id) !== session) return;
|
|
49040
48843
|
const holder = findPortHolderPid(port);
|
|
49041
48844
|
if (holder === void 0) {
|
|
49042
|
-
daemonLog(`${
|
|
48845
|
+
daemonLog(`${label} port ${port} freed`);
|
|
49043
48846
|
startHeldSession(
|
|
49044
48847
|
session,
|
|
49045
48848
|
sessions,
|
|
@@ -49055,7 +48858,7 @@ function awaitServerPort(session, port, deps2) {
|
|
|
49055
48858
|
return;
|
|
49056
48859
|
}
|
|
49057
48860
|
daemonLog(
|
|
49058
|
-
`${
|
|
48861
|
+
`${label} gave up waiting for port ${port} after ${portWaitTiming.timeoutMs}ms`
|
|
49059
48862
|
);
|
|
49060
48863
|
refuseSpawn(
|
|
49061
48864
|
session,
|
|
@@ -50205,13 +50008,13 @@ async function collectHistory(linked) {
|
|
|
50205
50008
|
}
|
|
50206
50009
|
|
|
50207
50010
|
// src/commands/sessions/daemon/links/guardLinkCallback.ts
|
|
50208
|
-
function guardLinkCallback(
|
|
50011
|
+
function guardLinkCallback(label, callback) {
|
|
50209
50012
|
return (...args) => {
|
|
50210
50013
|
try {
|
|
50211
50014
|
callback(...args);
|
|
50212
50015
|
} catch (error) {
|
|
50213
50016
|
daemonLog(
|
|
50214
|
-
`${
|
|
50017
|
+
`${label} threw; ignored so the daemon keeps running: ${error instanceof Error ? error.message : String(error)}`
|
|
50215
50018
|
);
|
|
50216
50019
|
}
|
|
50217
50020
|
};
|
|
@@ -50244,8 +50047,8 @@ function linkDeps(options2, callbacks) {
|
|
|
50244
50047
|
var MAX_FAILURES = 3;
|
|
50245
50048
|
var BACKOFF_MS = 6e4;
|
|
50246
50049
|
var LaunchCircuitBreaker = class {
|
|
50247
|
-
constructor(
|
|
50248
|
-
this.label =
|
|
50050
|
+
constructor(label) {
|
|
50051
|
+
this.label = label;
|
|
50249
50052
|
}
|
|
50250
50053
|
failures = 0;
|
|
50251
50054
|
until = 0;
|
|
@@ -50529,9 +50332,9 @@ var relayOutput = (state, msg) => {
|
|
|
50529
50332
|
appendScrollback(state, sessionId, msg.data);
|
|
50530
50333
|
broadcastToViewers(state, { type: "output", sessionId, data: msg.data });
|
|
50531
50334
|
};
|
|
50532
|
-
var relayToCreator = (
|
|
50335
|
+
var relayToCreator = (label) => (state, msg) => {
|
|
50533
50336
|
daemonLog(
|
|
50534
|
-
`link ${state.node} ws: ${
|
|
50337
|
+
`link ${state.node} ws: ${label} ${msg.sessionId ?? msg.message}`
|
|
50535
50338
|
);
|
|
50536
50339
|
const client = takePendingCreator(state);
|
|
50537
50340
|
const reply2 = msg.type === "created" ? { ...msg, sessionId: nsId(state, msg) } : msg;
|
|
@@ -52385,7 +52188,7 @@ async function closeSession() {
|
|
|
52385
52188
|
}
|
|
52386
52189
|
|
|
52387
52190
|
// src/commands/sessions/nodes/listNodes.ts
|
|
52388
|
-
import
|
|
52191
|
+
import chalk261 from "chalk";
|
|
52389
52192
|
async function nodesReport() {
|
|
52390
52193
|
const live = await queryNodes();
|
|
52391
52194
|
if (live)
|
|
@@ -52402,10 +52205,10 @@ async function listNodes(options2) {
|
|
|
52402
52205
|
console.log(JSON.stringify(report, null, 2));
|
|
52403
52206
|
return;
|
|
52404
52207
|
}
|
|
52405
|
-
console.log(`${report.local} ${
|
|
52208
|
+
console.log(`${report.local} ${chalk261.dim("(this node)")}`);
|
|
52406
52209
|
if (!report.daemonRunning)
|
|
52407
|
-
console.log(
|
|
52408
|
-
if (report.links.length === 0) console.log(
|
|
52210
|
+
console.log(chalk261.dim(" daemon not running; showing configured links"));
|
|
52211
|
+
if (report.links.length === 0) console.log(chalk261.dim(" no links"));
|
|
52409
52212
|
for (const link3 of report.links) console.log(formatLink(link3));
|
|
52410
52213
|
}
|
|
52411
52214
|
|
|
@@ -52427,7 +52230,7 @@ async function findUnlinkedWindowsNode(health2, platform = detectPlatform()) {
|
|
|
52427
52230
|
}
|
|
52428
52231
|
|
|
52429
52232
|
// src/commands/sessions/nodes/printReport.ts
|
|
52430
|
-
import
|
|
52233
|
+
import chalk262 from "chalk";
|
|
52431
52234
|
function printReport(report) {
|
|
52432
52235
|
if (report.links.length === 0) {
|
|
52433
52236
|
console.log(`${report.local} has no links`);
|
|
@@ -52441,11 +52244,11 @@ function printReport(report) {
|
|
|
52441
52244
|
for (const diagnosis of report.links) printDiagnosis(diagnosis);
|
|
52442
52245
|
}
|
|
52443
52246
|
function printDiagnosis(diagnosis) {
|
|
52444
|
-
console.log(`${
|
|
52247
|
+
console.log(`${chalk262.bold(diagnosis.name)} ${chalk262.dim(diagnosis.url)}`);
|
|
52445
52248
|
for (const hop of diagnosis.hops) {
|
|
52446
|
-
const mark = hop.ok ?
|
|
52249
|
+
const mark = hop.ok ? chalk262.green("\u2713") : chalk262.red("\u2717");
|
|
52447
52250
|
console.log(` ${mark} ${hop.hop.padEnd(9)} ${hop.detail ?? hop.error}`);
|
|
52448
|
-
if (hop.remediation) console.log(` ${
|
|
52251
|
+
if (hop.remediation) console.log(` ${chalk262.yellow(hop.remediation)}`);
|
|
52449
52252
|
}
|
|
52450
52253
|
}
|
|
52451
52254
|
|
|
@@ -52517,14 +52320,14 @@ function registerDiagnoseCommands(nodes, calledBy4) {
|
|
|
52517
52320
|
}
|
|
52518
52321
|
|
|
52519
52322
|
// src/commands/sessions/nodes/linkNode.ts
|
|
52520
|
-
import
|
|
52323
|
+
import chalk265 from "chalk";
|
|
52521
52324
|
|
|
52522
52325
|
// src/commands/sessions/nodes/notifyDaemonLinks.ts
|
|
52523
|
-
import
|
|
52326
|
+
import chalk263 from "chalk";
|
|
52524
52327
|
async function notifyDaemonLinks() {
|
|
52525
52328
|
if (!await isDaemonRunning()) {
|
|
52526
52329
|
console.log(
|
|
52527
|
-
|
|
52330
|
+
chalk263.yellow(
|
|
52528
52331
|
"The sessions daemon is not running; it loads the links when it starts."
|
|
52529
52332
|
)
|
|
52530
52333
|
);
|
|
@@ -52532,11 +52335,11 @@ async function notifyDaemonLinks() {
|
|
|
52532
52335
|
}
|
|
52533
52336
|
try {
|
|
52534
52337
|
await sendToDaemonAwaitAck({ type: "reload-links" });
|
|
52535
|
-
console.log(
|
|
52338
|
+
console.log(chalk263.dim("The sessions daemon reloaded its links."));
|
|
52536
52339
|
} catch (error) {
|
|
52537
52340
|
const message3 = error instanceof Error ? error.message : String(error);
|
|
52538
52341
|
console.log(
|
|
52539
|
-
|
|
52342
|
+
chalk263.yellow(
|
|
52540
52343
|
`Could not notify the sessions daemon (${message3}); run \`assist daemon restart\` to apply the change.`
|
|
52541
52344
|
)
|
|
52542
52345
|
);
|
|
@@ -52544,7 +52347,7 @@ async function notifyDaemonLinks() {
|
|
|
52544
52347
|
}
|
|
52545
52348
|
|
|
52546
52349
|
// src/commands/sessions/nodes/readLinks.ts
|
|
52547
|
-
import
|
|
52350
|
+
import chalk264 from "chalk";
|
|
52548
52351
|
|
|
52549
52352
|
// src/commands/sessions/nodes/writeLinks.ts
|
|
52550
52353
|
async function writeLinks(links2) {
|
|
@@ -52567,7 +52370,7 @@ async function readLinks() {
|
|
|
52567
52370
|
await writeLinks(links2);
|
|
52568
52371
|
const dropped = stored.filter((link3) => !link3.url).map((link3) => link3.name);
|
|
52569
52372
|
console.log(
|
|
52570
|
-
|
|
52373
|
+
chalk264.yellow(`Removed ${dropped.join(", ")}: ${SSH_LINK_RETIRED}`)
|
|
52571
52374
|
);
|
|
52572
52375
|
return links2;
|
|
52573
52376
|
}
|
|
@@ -52623,7 +52426,7 @@ async function linkNode(name, url, options2) {
|
|
|
52623
52426
|
throw new Error(`${name} is this node; link to a different node`);
|
|
52624
52427
|
const link3 = await buildLink(name, url, options2);
|
|
52625
52428
|
await writeLinks([...others, link3]);
|
|
52626
|
-
console.log(
|
|
52429
|
+
console.log(chalk265.green(`Linked ${name} (${link3.url})`));
|
|
52627
52430
|
await notifyDaemonLinks();
|
|
52628
52431
|
}
|
|
52629
52432
|
|
|
@@ -52806,16 +52609,16 @@ function registerPeerActionCommands(nodes, calledBy4) {
|
|
|
52806
52609
|
}
|
|
52807
52610
|
|
|
52808
52611
|
// src/commands/sessions/nodes/unlinkNode.ts
|
|
52809
|
-
import
|
|
52612
|
+
import chalk266 from "chalk";
|
|
52810
52613
|
async function unlinkNode(name) {
|
|
52811
52614
|
const links2 = await readLinks();
|
|
52812
52615
|
const remaining = links2.filter((link3) => link3.name !== name);
|
|
52813
52616
|
if (remaining.length === links2.length) {
|
|
52814
|
-
console.log(
|
|
52617
|
+
console.log(chalk266.yellow(`No link named ${name}`));
|
|
52815
52618
|
return;
|
|
52816
52619
|
}
|
|
52817
52620
|
await writeLinks(remaining);
|
|
52818
|
-
console.log(
|
|
52621
|
+
console.log(chalk266.green(`Unlinked ${name}`));
|
|
52819
52622
|
await notifyDaemonLinks();
|
|
52820
52623
|
}
|
|
52821
52624
|
|
|
@@ -53050,10 +52853,10 @@ function createProgram() {
|
|
|
53050
52853
|
}
|
|
53051
52854
|
|
|
53052
52855
|
// src/reportCliError.ts
|
|
53053
|
-
import
|
|
52856
|
+
import chalk267 from "chalk";
|
|
53054
52857
|
function reportCliError(error) {
|
|
53055
52858
|
if (error instanceof InvalidItemIdError || error instanceof AmbiguousRepoConfigError || error instanceof UnknownRepoConfigError || error instanceof MissingRunCwdError || error instanceof MiroExtractError) {
|
|
53056
|
-
console.error(
|
|
52859
|
+
console.error(chalk267.red(error.message));
|
|
53057
52860
|
} else {
|
|
53058
52861
|
console.error(error);
|
|
53059
52862
|
}
|