@staff0rd/assist 0.1121.2 → 0.1123.0
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/{claude → agent}/commands/add-rule.md +12 -6
- package/dist/built-version +1 -1
- package/dist/commands/sessions/web/bundle.js +409 -409
- package/dist/index.js +198 -152
- package/package.json +2 -1
- /package/{claude → agent}/commands/add-command.md +0 -0
- /package/{claude → agent}/commands/ask.md +0 -0
- /package/{claude → agent}/commands/branch.md +0 -0
- /package/{claude → agent}/commands/bug.md +0 -0
- /package/{claude → agent}/commands/close.md +0 -0
- /package/{claude → agent}/commands/comment.md +0 -0
- /package/{claude → agent}/commands/commit.md +0 -0
- /package/{claude → agent}/commands/design.md +0 -0
- /package/{claude → agent}/commands/devlog.md +0 -0
- /package/{claude → agent}/commands/draft.md +0 -0
- /package/{claude → agent}/commands/extension.md +0 -0
- /package/{claude → agent}/commands/fix-conflict.md +0 -0
- /package/{claude → agent}/commands/fix-rules.md +0 -0
- /package/{claude → agent}/commands/forward-comments.md +0 -0
- /package/{claude → agent}/commands/github.md +0 -0
- /package/{claude → agent}/commands/inspect.md +0 -0
- /package/{claude → agent}/commands/jira.md +0 -0
- /package/{claude → agent}/commands/miro.md +0 -0
- /package/{claude → agent}/commands/next.md +0 -0
- /package/{claude → agent}/commands/pr.md +0 -0
- /package/{claude → agent}/commands/prompts.md +0 -0
- /package/{claude → agent}/commands/prs-slack.md +0 -0
- /package/{claude → agent}/commands/prs-status.md +0 -0
- /package/{claude → agent}/commands/raven.md +0 -0
- /package/{claude → agent}/commands/refactor.md +0 -0
- /package/{claude → agent}/commands/refine.md +0 -0
- /package/{claude → agent}/commands/releases-configure.md +0 -0
- /package/{claude → agent}/commands/rename.md +0 -0
- /package/{claude → agent}/commands/restructure.md +0 -0
- /package/{claude → agent}/commands/review-config.md +0 -0
- /package/{claude → agent}/commands/review-high-level.md +0 -0
- /package/{claude → agent}/commands/review-pr-comments.md +0 -0
- /package/{claude → agent}/commands/run-logs.md +0 -0
- /package/{claude → agent}/commands/screenshot.md +0 -0
- /package/{claude → agent}/commands/seq.md +0 -0
- /package/{claude → agent}/commands/show.md +0 -0
- /package/{claude → agent}/commands/slack-post.md +0 -0
- /package/{claude → agent}/commands/sql.md +0 -0
- /package/{claude → agent}/commands/supabase.md +0 -0
- /package/{claude → agent}/commands/sync.md +0 -0
- /package/{claude → agent}/commands/test-cover.md +0 -0
- /package/{claude → agent}/commands/test-review.md +0 -0
- /package/{claude → agent}/commands/transcripts.md +0 -0
- /package/{claude → agent}/commands/verify-new.md +0 -0
- /package/{claude → agent}/commands/verify.md +0 -0
- /package/{claude → agent}/design-system-prompt.md +0 -0
- /package/{claude → agent}/skills/accessibility-audit.md +0 -0
- /package/{claude → agent}/skills/ai-slop-check.md +0 -0
- /package/{claude → agent}/skills/component-extract.md +0 -0
- /package/{claude → agent}/skills/design-system-extract.md +0 -0
- /package/{claude → agent}/skills/discovery-questions.md +0 -0
- /package/{claude → agent}/skills/frontend-aesthetic-direction.md +0 -0
- /package/{claude → agent}/skills/generate-variations.md +0 -0
- /package/{claude → agent}/skills/hierarchy-rhythm-review.md +0 -0
- /package/{claude → agent}/skills/interaction-states-pass.md +0 -0
- /package/{claude → agent}/skills/make-a-deck.md +0 -0
- /package/{claude → agent}/skills/make-a-prototype.md +0 -0
- /package/{claude → agent}/skills/make-tweakable.md +0 -0
- /package/{claude → agent}/skills/polish-pass.md +0 -0
- /package/{claude → agent}/skills/wireframe.md +0 -0
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.
|
|
9
|
+
version: "0.1123.0",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -16,6 +16,7 @@ var package_default = {
|
|
|
16
16
|
},
|
|
17
17
|
files: [
|
|
18
18
|
"dist",
|
|
19
|
+
"agent",
|
|
19
20
|
"claude",
|
|
20
21
|
"codex",
|
|
21
22
|
"pi",
|
|
@@ -12545,7 +12546,11 @@ function peerTimeoutFor(pathname) {
|
|
|
12545
12546
|
}
|
|
12546
12547
|
|
|
12547
12548
|
// src/commands/sessions/web/isQuietPoll.ts
|
|
12548
|
-
var POLLED_PATHS = /* @__PURE__ */ new Set([
|
|
12549
|
+
var POLLED_PATHS = /* @__PURE__ */ new Set([
|
|
12550
|
+
"/api/git-status",
|
|
12551
|
+
"/api/updates",
|
|
12552
|
+
"/api/updates/history"
|
|
12553
|
+
]);
|
|
12549
12554
|
function isQuietPoll(pathname, status2) {
|
|
12550
12555
|
return POLLED_PATHS.has(pathname) && status2 >= 200 && status2 < 300;
|
|
12551
12556
|
}
|
|
@@ -17792,6 +17797,11 @@ async function updatesControl(req, res) {
|
|
|
17792
17797
|
respondJson(res, 200, { ok: true });
|
|
17793
17798
|
}
|
|
17794
17799
|
|
|
17800
|
+
// src/commands/sessions/web/updates/updateHistory.ts
|
|
17801
|
+
function updateHistory(_req, res) {
|
|
17802
|
+
respondJson(res, 200, { history: readUpdateHistory(getInstallDir()) });
|
|
17803
|
+
}
|
|
17804
|
+
|
|
17795
17805
|
// src/commands/sessions/web/updates/requestViaLink.ts
|
|
17796
17806
|
import { randomUUID as randomUUID3 } from "crypto";
|
|
17797
17807
|
var LINK_REPLY_TIMEOUT_MS = 8e3;
|
|
@@ -18185,6 +18195,7 @@ var routes2 = {
|
|
|
18185
18195
|
"POST /api/testflight/testers": postTestflightTester,
|
|
18186
18196
|
"GET /api/updates": updates,
|
|
18187
18197
|
"POST /api/updates/control": updatesControl,
|
|
18198
|
+
"GET /api/updates/history": updateHistory,
|
|
18188
18199
|
[`GET ${LINK_UPDATE_STATUS_PATH}`]: linkUpdateStatus,
|
|
18189
18200
|
[`POST ${RESTART_WEB_VIA_LINK_PATH}`]: restartWebViaLink
|
|
18190
18201
|
};
|
|
@@ -29153,17 +29164,17 @@ function routeCodexRpcLine(line, pending) {
|
|
|
29153
29164
|
}
|
|
29154
29165
|
|
|
29155
29166
|
// src/commands/sync/watchCodexAppServer.ts
|
|
29156
|
-
function watchCodexAppServer(child2,
|
|
29167
|
+
function watchCodexAppServer(child2, fail14) {
|
|
29157
29168
|
let stderr = "";
|
|
29158
29169
|
child2.stderr.on("data", (chunk2) => {
|
|
29159
29170
|
stderr += chunk2;
|
|
29160
29171
|
});
|
|
29161
|
-
child2.on("error",
|
|
29172
|
+
child2.on("error", fail14);
|
|
29162
29173
|
child2.stdin.on("error", () => {
|
|
29163
29174
|
});
|
|
29164
29175
|
child2.on(
|
|
29165
29176
|
"exit",
|
|
29166
|
-
(code) =>
|
|
29177
|
+
(code) => fail14(
|
|
29167
29178
|
new Error(
|
|
29168
29179
|
`codex app-server exited (${code})${stderr.trim() ? `: ${stderr.trim()}` : ""}`
|
|
29169
29180
|
)
|
|
@@ -50009,50 +50020,85 @@ function addRule(text18, options2) {
|
|
|
50009
50020
|
}
|
|
50010
50021
|
|
|
50011
50022
|
// src/commands/rules/addUserRule.ts
|
|
50023
|
+
import chalk280 from "chalk";
|
|
50024
|
+
|
|
50025
|
+
// src/commands/rules/addToRepoDb.ts
|
|
50026
|
+
import chalk279 from "chalk";
|
|
50027
|
+
|
|
50028
|
+
// src/commands/rules/appendRule.ts
|
|
50029
|
+
function appendRule(current2, rule) {
|
|
50030
|
+
return [...Array.isArray(current2) ? current2 : [], rule];
|
|
50031
|
+
}
|
|
50032
|
+
|
|
50033
|
+
// src/commands/rules/failRule.ts
|
|
50012
50034
|
import chalk278 from "chalk";
|
|
50013
|
-
function
|
|
50035
|
+
function failRule(message4) {
|
|
50014
50036
|
console.error(chalk278.red(message4));
|
|
50015
50037
|
process.exitCode = 1;
|
|
50016
50038
|
}
|
|
50017
|
-
|
|
50018
|
-
|
|
50039
|
+
|
|
50040
|
+
// src/commands/rules/addToRepoDb.ts
|
|
50041
|
+
async function addToRepoDb(rule, repo, cwd) {
|
|
50042
|
+
const repoName = typeof repo === "string" ? repo : void 0;
|
|
50043
|
+
const { block } = await resolveSharedRepoBlock(await getDb(), repoName, cwd);
|
|
50044
|
+
const advice = block.advice;
|
|
50045
|
+
const result = await applySharedRepoConfigSet(
|
|
50046
|
+
"advice.rules",
|
|
50047
|
+
appendRule(advice?.rules, rule),
|
|
50048
|
+
repoName,
|
|
50049
|
+
cwd
|
|
50050
|
+
);
|
|
50051
|
+
if (!result.ok) return failRule(result.errors.join("\n"));
|
|
50052
|
+
console.log(
|
|
50053
|
+
`Added ${chalk279.cyan(rule.title)} to advice.rules in repo (db): ${result.label}`
|
|
50054
|
+
);
|
|
50019
50055
|
}
|
|
50020
|
-
|
|
50021
|
-
|
|
50022
|
-
|
|
50056
|
+
|
|
50057
|
+
// src/commands/rules/userRuleOptionsError.ts
|
|
50058
|
+
function userRuleOptionsError(options2) {
|
|
50059
|
+
const targets = [
|
|
50060
|
+
options2.user && "--user",
|
|
50061
|
+
options2.node && "--node",
|
|
50062
|
+
options2.repo !== void 0 && "--repo"
|
|
50063
|
+
].filter(Boolean);
|
|
50064
|
+
if (targets.length > 1)
|
|
50065
|
+
return `${targets.join(", ")} each write advice.rules in a different scope (user (db), user (node), repo (db)); pass one`;
|
|
50023
50066
|
if (options2.scope !== void 0)
|
|
50024
|
-
return
|
|
50067
|
+
return `${targets[0]} writes advice.rules, not a CLAUDE.md, and cannot be combined with --scope`;
|
|
50025
50068
|
return void 0;
|
|
50026
50069
|
}
|
|
50070
|
+
|
|
50071
|
+
// src/commands/rules/addUserRule.ts
|
|
50027
50072
|
async function addToUserDb(rule) {
|
|
50028
|
-
const result = await applyUserConfigSet(
|
|
50029
|
-
|
|
50030
|
-
rule
|
|
50031
|
-
|
|
50032
|
-
if (!result.ok) return
|
|
50033
|
-
console.log(`Added ${
|
|
50073
|
+
const result = await applyUserConfigSet(
|
|
50074
|
+
"advice.rules",
|
|
50075
|
+
(current2) => appendRule(current2, rule)
|
|
50076
|
+
);
|
|
50077
|
+
if (!result.ok) return failRule(result.errors.join("\n"));
|
|
50078
|
+
console.log(`Added ${chalk280.cyan(rule.title)} to advice.rules in user (db)`);
|
|
50034
50079
|
}
|
|
50035
50080
|
function addToUserNode(rule, globalConfigPath) {
|
|
50036
50081
|
const advice = loadGlobalConfigRaw(globalConfigPath).advice;
|
|
50037
50082
|
const result = applyConfigSet(
|
|
50038
50083
|
"advice.rules",
|
|
50039
|
-
|
|
50084
|
+
appendRule(advice?.rules, rule),
|
|
50040
50085
|
true,
|
|
50041
50086
|
process.cwd(),
|
|
50042
50087
|
globalConfigPath
|
|
50043
50088
|
);
|
|
50044
|
-
if (!result.ok) return
|
|
50089
|
+
if (!result.ok) return failRule(result.errors.join("\n"));
|
|
50045
50090
|
console.log(
|
|
50046
|
-
`Added ${
|
|
50091
|
+
`Added ${chalk280.cyan(rule.title)} to advice.rules in user (node) (${globalConfigFileLabel(globalConfigPath)})`
|
|
50047
50092
|
);
|
|
50048
50093
|
}
|
|
50049
|
-
async function addUserRule(text18, options2, globalConfigPath = getGlobalConfigPath()) {
|
|
50050
|
-
const error =
|
|
50051
|
-
if (error) return
|
|
50094
|
+
async function addUserRule(text18, options2, globalConfigPath = getGlobalConfigPath(), cwd = process.cwd()) {
|
|
50095
|
+
const error = userRuleOptionsError(options2);
|
|
50096
|
+
if (error) return failRule(error);
|
|
50052
50097
|
const rule = { title: options2.title?.trim() ?? "", text: text18.trim() };
|
|
50053
50098
|
if (rule.text === "" || rule.title === "")
|
|
50054
|
-
return
|
|
50099
|
+
return failRule("advice.rules entries need both rule text and --title");
|
|
50055
50100
|
if (options2.user) return addToUserDb(rule);
|
|
50101
|
+
if (options2.repo !== void 0) return addToRepoDb(rule, options2.repo, cwd);
|
|
50056
50102
|
addToUserNode(rule, globalConfigPath);
|
|
50057
50103
|
}
|
|
50058
50104
|
|
|
@@ -50073,8 +50119,11 @@ function registerRulesAdd(rulesCommand) {
|
|
|
50073
50119
|
).option(
|
|
50074
50120
|
"--node",
|
|
50075
50121
|
"As --user, but append to advice.rules in user (node), this node's ~/.assist.yml"
|
|
50122
|
+
).option(
|
|
50123
|
+
"--repo [name]",
|
|
50124
|
+
"As --user, but append to advice.rules in repo (db), the shared per-repo override every node sees, for the current repo or the named one"
|
|
50076
50125
|
).action(
|
|
50077
|
-
(text18, options2) => options2.user || options2.node ? addUserRule(text18, options2) : addRule(text18, options2)
|
|
50126
|
+
(text18, options2) => options2.user || options2.node || options2.repo !== void 0 ? addUserRule(text18, options2) : addRule(text18, options2)
|
|
50078
50127
|
),
|
|
50079
50128
|
"/add-rule and /fix-rules"
|
|
50080
50129
|
);
|
|
@@ -50098,7 +50147,7 @@ function registerRules(program) {
|
|
|
50098
50147
|
}
|
|
50099
50148
|
|
|
50100
50149
|
// src/commands/seq/seqAuth.ts
|
|
50101
|
-
import
|
|
50150
|
+
import chalk282 from "chalk";
|
|
50102
50151
|
|
|
50103
50152
|
// src/commands/seq/loadConnections.ts
|
|
50104
50153
|
function loadConnections2() {
|
|
@@ -50127,10 +50176,10 @@ function setDefaultConnection(name2) {
|
|
|
50127
50176
|
}
|
|
50128
50177
|
|
|
50129
50178
|
// src/shared/assertUniqueName.ts
|
|
50130
|
-
import
|
|
50179
|
+
import chalk281 from "chalk";
|
|
50131
50180
|
function assertUniqueName(existingNames, name2) {
|
|
50132
50181
|
if (existingNames.includes(name2)) {
|
|
50133
|
-
console.error(
|
|
50182
|
+
console.error(chalk281.red(`Connection "${name2}" already exists.`));
|
|
50134
50183
|
process.exit(1);
|
|
50135
50184
|
}
|
|
50136
50185
|
}
|
|
@@ -50148,16 +50197,16 @@ async function promptConnection2(existingNames) {
|
|
|
50148
50197
|
var seqAuth = createConnectionAuth({
|
|
50149
50198
|
load: loadConnections2,
|
|
50150
50199
|
save: saveConnections2,
|
|
50151
|
-
format: (c) => `${
|
|
50200
|
+
format: (c) => `${chalk282.bold(c.name)} ${c.url}`,
|
|
50152
50201
|
promptNew: promptConnection2,
|
|
50153
50202
|
onFirst: (c) => setDefaultConnection(c.name)
|
|
50154
50203
|
});
|
|
50155
50204
|
|
|
50156
50205
|
// src/commands/seq/seqQuery.ts
|
|
50157
|
-
import
|
|
50206
|
+
import chalk286 from "chalk";
|
|
50158
50207
|
|
|
50159
50208
|
// src/commands/seq/fetchSeq.ts
|
|
50160
|
-
import
|
|
50209
|
+
import chalk283 from "chalk";
|
|
50161
50210
|
async function fetchSeq(conn, path128, params) {
|
|
50162
50211
|
const url = `${conn.url}${path128}?${params}`;
|
|
50163
50212
|
const response = await fetch(url, {
|
|
@@ -50168,7 +50217,7 @@ async function fetchSeq(conn, path128, params) {
|
|
|
50168
50217
|
});
|
|
50169
50218
|
if (!response.ok) {
|
|
50170
50219
|
const body = await response.text();
|
|
50171
|
-
console.error(
|
|
50220
|
+
console.error(chalk283.red(`Seq returned ${response.status}: ${body}`));
|
|
50172
50221
|
process.exit(1);
|
|
50173
50222
|
}
|
|
50174
50223
|
return response;
|
|
@@ -50227,23 +50276,23 @@ async function fetchSeqEvents(conn, params) {
|
|
|
50227
50276
|
}
|
|
50228
50277
|
|
|
50229
50278
|
// src/commands/seq/formatEvent.ts
|
|
50230
|
-
import
|
|
50279
|
+
import chalk284 from "chalk";
|
|
50231
50280
|
function levelColor(level) {
|
|
50232
50281
|
switch (level) {
|
|
50233
50282
|
case "Fatal":
|
|
50234
|
-
return
|
|
50283
|
+
return chalk284.bgRed.white;
|
|
50235
50284
|
case "Error":
|
|
50236
|
-
return
|
|
50285
|
+
return chalk284.red;
|
|
50237
50286
|
case "Warning":
|
|
50238
|
-
return
|
|
50287
|
+
return chalk284.yellow;
|
|
50239
50288
|
case "Information":
|
|
50240
|
-
return
|
|
50289
|
+
return chalk284.cyan;
|
|
50241
50290
|
case "Debug":
|
|
50242
|
-
return
|
|
50291
|
+
return chalk284.gray;
|
|
50243
50292
|
case "Verbose":
|
|
50244
|
-
return
|
|
50293
|
+
return chalk284.dim;
|
|
50245
50294
|
default:
|
|
50246
|
-
return
|
|
50295
|
+
return chalk284.white;
|
|
50247
50296
|
}
|
|
50248
50297
|
}
|
|
50249
50298
|
function levelAbbrev(level) {
|
|
@@ -50284,12 +50333,12 @@ function formatTimestamp(iso) {
|
|
|
50284
50333
|
function formatEvent(event) {
|
|
50285
50334
|
const color = levelColor(event.Level);
|
|
50286
50335
|
const abbrev = levelAbbrev(event.Level);
|
|
50287
|
-
const ts10 =
|
|
50336
|
+
const ts10 = chalk284.dim(formatTimestamp(event.Timestamp));
|
|
50288
50337
|
const msg = renderMessage(event);
|
|
50289
50338
|
const lines = [`${ts10} ${color(`[${abbrev}]`)} ${msg}`];
|
|
50290
50339
|
if (event.Exception) {
|
|
50291
50340
|
for (const line of event.Exception.split("\n")) {
|
|
50292
|
-
lines.push(
|
|
50341
|
+
lines.push(chalk284.red(` ${line}`));
|
|
50293
50342
|
}
|
|
50294
50343
|
}
|
|
50295
50344
|
return lines.join("\n");
|
|
@@ -50322,11 +50371,11 @@ function rejectTimestampFilter(filter) {
|
|
|
50322
50371
|
}
|
|
50323
50372
|
|
|
50324
50373
|
// src/shared/resolveNamedConnection.ts
|
|
50325
|
-
import
|
|
50374
|
+
import chalk285 from "chalk";
|
|
50326
50375
|
function resolveNamedConnection(connections, requested, defaultName, kind, authCommand) {
|
|
50327
50376
|
if (connections.length === 0) {
|
|
50328
50377
|
console.error(
|
|
50329
|
-
|
|
50378
|
+
chalk285.red(
|
|
50330
50379
|
`No ${kind} connections configured. Run '${authCommand}' first.`
|
|
50331
50380
|
)
|
|
50332
50381
|
);
|
|
@@ -50335,7 +50384,7 @@ function resolveNamedConnection(connections, requested, defaultName, kind, authC
|
|
|
50335
50384
|
const target = requested ?? defaultName ?? connections[0].name;
|
|
50336
50385
|
const connection = connections.find((c) => c.name === target);
|
|
50337
50386
|
if (!connection) {
|
|
50338
|
-
console.error(
|
|
50387
|
+
console.error(chalk285.red(`${kind} connection "${target}" not found.`));
|
|
50339
50388
|
process.exit(1);
|
|
50340
50389
|
}
|
|
50341
50390
|
return connection;
|
|
@@ -50364,7 +50413,7 @@ async function seqQuery(filter, options2) {
|
|
|
50364
50413
|
new URLSearchParams({ filter, count: String(count10) })
|
|
50365
50414
|
);
|
|
50366
50415
|
if (events.length === 0) {
|
|
50367
|
-
console.log(
|
|
50416
|
+
console.log(chalk286.yellow("No events found."));
|
|
50368
50417
|
return;
|
|
50369
50418
|
}
|
|
50370
50419
|
if (options2.json) {
|
|
@@ -50375,11 +50424,11 @@ async function seqQuery(filter, options2) {
|
|
|
50375
50424
|
for (const event of chronological) {
|
|
50376
50425
|
console.log(formatEvent(event));
|
|
50377
50426
|
}
|
|
50378
|
-
console.log(
|
|
50427
|
+
console.log(chalk286.dim(`
|
|
50379
50428
|
${events.length} events`));
|
|
50380
50429
|
if (events.length >= count10) {
|
|
50381
50430
|
console.log(
|
|
50382
|
-
|
|
50431
|
+
chalk286.yellow(
|
|
50383
50432
|
`Results limited to ${count10}. Use --count to retrieve more.`
|
|
50384
50433
|
)
|
|
50385
50434
|
);
|
|
@@ -50387,10 +50436,10 @@ ${events.length} events`));
|
|
|
50387
50436
|
}
|
|
50388
50437
|
|
|
50389
50438
|
// src/shared/setNamedDefaultConnection.ts
|
|
50390
|
-
import
|
|
50439
|
+
import chalk287 from "chalk";
|
|
50391
50440
|
function setNamedDefaultConnection(connections, name2, setDefault, kind) {
|
|
50392
50441
|
if (!connections.find((c) => c.name === name2)) {
|
|
50393
|
-
console.error(
|
|
50442
|
+
console.error(chalk287.red(`Connection "${name2}" not found.`));
|
|
50394
50443
|
process.exit(1);
|
|
50395
50444
|
}
|
|
50396
50445
|
setDefault(name2);
|
|
@@ -50641,7 +50690,7 @@ function registerSlack(program) {
|
|
|
50641
50690
|
}
|
|
50642
50691
|
|
|
50643
50692
|
// src/commands/sql/sqlAuth.ts
|
|
50644
|
-
import
|
|
50693
|
+
import chalk289 from "chalk";
|
|
50645
50694
|
|
|
50646
50695
|
// src/commands/sql/loadConnections.ts
|
|
50647
50696
|
function loadConnections3() {
|
|
@@ -50670,7 +50719,7 @@ function setDefaultConnection2(name2) {
|
|
|
50670
50719
|
}
|
|
50671
50720
|
|
|
50672
50721
|
// src/commands/sql/promptConnection.ts
|
|
50673
|
-
import
|
|
50722
|
+
import chalk288 from "chalk";
|
|
50674
50723
|
async function promptConnection3(existingNames) {
|
|
50675
50724
|
const name2 = await promptInput("name", "Connection name:", "default");
|
|
50676
50725
|
assertUniqueName(existingNames, name2);
|
|
@@ -50678,7 +50727,7 @@ async function promptConnection3(existingNames) {
|
|
|
50678
50727
|
const portStr = await promptInput("port", "Port:", "1433");
|
|
50679
50728
|
const port = Number.parseInt(portStr, 10);
|
|
50680
50729
|
if (!Number.isFinite(port)) {
|
|
50681
|
-
console.error(
|
|
50730
|
+
console.error(chalk288.red(`Invalid port "${portStr}".`));
|
|
50682
50731
|
process.exit(1);
|
|
50683
50732
|
}
|
|
50684
50733
|
const user = await promptInput("user", "User:");
|
|
@@ -50691,13 +50740,13 @@ async function promptConnection3(existingNames) {
|
|
|
50691
50740
|
var sqlAuth = createConnectionAuth({
|
|
50692
50741
|
load: loadConnections3,
|
|
50693
50742
|
save: saveConnections3,
|
|
50694
|
-
format: (c) => `${
|
|
50743
|
+
format: (c) => `${chalk289.bold(c.name)} ${c.server}:${c.port}/${c.database} (${c.user})`,
|
|
50695
50744
|
promptNew: promptConnection3,
|
|
50696
50745
|
onFirst: (c) => setDefaultConnection2(c.name)
|
|
50697
50746
|
});
|
|
50698
50747
|
|
|
50699
50748
|
// src/commands/sql/printTable.ts
|
|
50700
|
-
import
|
|
50749
|
+
import chalk290 from "chalk";
|
|
50701
50750
|
function formatCell(value) {
|
|
50702
50751
|
if (value === null || value === void 0) return "";
|
|
50703
50752
|
if (value instanceof Date) return value.toISOString();
|
|
@@ -50706,7 +50755,7 @@ function formatCell(value) {
|
|
|
50706
50755
|
}
|
|
50707
50756
|
function printTable(rows) {
|
|
50708
50757
|
if (rows.length === 0) {
|
|
50709
|
-
console.log(
|
|
50758
|
+
console.log(chalk290.yellow("(no rows)"));
|
|
50710
50759
|
return;
|
|
50711
50760
|
}
|
|
50712
50761
|
const columns = Object.keys(rows[0]);
|
|
@@ -50714,13 +50763,13 @@ function printTable(rows) {
|
|
|
50714
50763
|
(col) => Math.max(col.length, ...rows.map((r) => formatCell(r[col]).length))
|
|
50715
50764
|
);
|
|
50716
50765
|
const header = columns.map((c, i) => c.padEnd(widths[i])).join(" ");
|
|
50717
|
-
console.log(
|
|
50718
|
-
console.log(
|
|
50766
|
+
console.log(chalk290.dim(header));
|
|
50767
|
+
console.log(chalk290.dim("-".repeat(header.length)));
|
|
50719
50768
|
for (const row2 of rows) {
|
|
50720
50769
|
const line = columns.map((c, i) => formatCell(row2[c]).padEnd(widths[i])).join(" ");
|
|
50721
50770
|
console.log(line);
|
|
50722
50771
|
}
|
|
50723
|
-
console.log(
|
|
50772
|
+
console.log(chalk290.dim(`
|
|
50724
50773
|
${rows.length} row${rows.length === 1 ? "" : "s"}`));
|
|
50725
50774
|
}
|
|
50726
50775
|
|
|
@@ -50780,7 +50829,7 @@ async function sqlColumns(table, connectionName) {
|
|
|
50780
50829
|
}
|
|
50781
50830
|
|
|
50782
50831
|
// src/commands/sql/sqlMutate.ts
|
|
50783
|
-
import
|
|
50832
|
+
import chalk291 from "chalk";
|
|
50784
50833
|
|
|
50785
50834
|
// src/commands/sql/isMutation.ts
|
|
50786
50835
|
var MUTATION_KEYWORDS = [
|
|
@@ -50814,7 +50863,7 @@ function isMutation(sql33) {
|
|
|
50814
50863
|
async function sqlMutate(query, connectionName) {
|
|
50815
50864
|
if (!isMutation(query)) {
|
|
50816
50865
|
console.error(
|
|
50817
|
-
|
|
50866
|
+
chalk291.red(
|
|
50818
50867
|
"assist sql mutate refuses non-mutating statements. Use `assist sql query` instead."
|
|
50819
50868
|
)
|
|
50820
50869
|
);
|
|
@@ -50824,18 +50873,18 @@ async function sqlMutate(query, connectionName) {
|
|
|
50824
50873
|
const pool = await sqlConnect(conn);
|
|
50825
50874
|
try {
|
|
50826
50875
|
const result = await pool.request().query(query);
|
|
50827
|
-
console.log(
|
|
50876
|
+
console.log(chalk291.dim(`${result.rowsAffected.join(", ")} row(s) affected`));
|
|
50828
50877
|
} finally {
|
|
50829
50878
|
await pool.close();
|
|
50830
50879
|
}
|
|
50831
50880
|
}
|
|
50832
50881
|
|
|
50833
50882
|
// src/commands/sql/sqlQuery.ts
|
|
50834
|
-
import
|
|
50883
|
+
import chalk292 from "chalk";
|
|
50835
50884
|
async function sqlQuery(query, connectionName) {
|
|
50836
50885
|
if (isMutation(query)) {
|
|
50837
50886
|
console.error(
|
|
50838
|
-
|
|
50887
|
+
chalk292.red(
|
|
50839
50888
|
"assist sql query refuses mutating statements. Use `assist sql mutate` instead."
|
|
50840
50889
|
)
|
|
50841
50890
|
);
|
|
@@ -50850,7 +50899,7 @@ async function sqlQuery(query, connectionName) {
|
|
|
50850
50899
|
printTable(rows);
|
|
50851
50900
|
} else {
|
|
50852
50901
|
console.log(
|
|
50853
|
-
|
|
50902
|
+
chalk292.dim(`${result.rowsAffected.join(", ")} row(s) affected`)
|
|
50854
50903
|
);
|
|
50855
50904
|
}
|
|
50856
50905
|
} finally {
|
|
@@ -50922,11 +50971,11 @@ import * as fs56 from "fs";
|
|
|
50922
50971
|
import * as fs52 from "fs";
|
|
50923
50972
|
|
|
50924
50973
|
// src/commands/sync/resolveSyncConflicts.ts
|
|
50925
|
-
import
|
|
50974
|
+
import chalk293 from "chalk";
|
|
50926
50975
|
async function resolveSyncConflicts(conflicts, yes) {
|
|
50927
50976
|
if (conflicts.length === 0) return [];
|
|
50928
50977
|
console.log(
|
|
50929
|
-
|
|
50978
|
+
chalk293.yellow(
|
|
50930
50979
|
`
|
|
50931
50980
|
\u26A0\uFE0F ${conflicts.length} file(s) exist that assist sync did not write:`
|
|
50932
50981
|
)
|
|
@@ -50935,7 +50984,7 @@ async function resolveSyncConflicts(conflicts, yes) {
|
|
|
50935
50984
|
console.log(` ${action} ${target}`);
|
|
50936
50985
|
}
|
|
50937
50986
|
const confirmed = !yes && await promptConfirm(
|
|
50938
|
-
|
|
50987
|
+
chalk293.red("Replace them with assist's versions?"),
|
|
50939
50988
|
false
|
|
50940
50989
|
);
|
|
50941
50990
|
if (confirmed) return conflicts;
|
|
@@ -51236,8 +51285,8 @@ function renderHarnessPaths(content, harness) {
|
|
|
51236
51285
|
}
|
|
51237
51286
|
|
|
51238
51287
|
// src/commands/sync/syncClaudeCommands.ts
|
|
51239
|
-
function syncClaudeCommands(
|
|
51240
|
-
const sourceDir = path113.join(
|
|
51288
|
+
function syncClaudeCommands(agentDir, targetBase, files) {
|
|
51289
|
+
const sourceDir = path113.join(agentDir, "commands");
|
|
51241
51290
|
const names = markdownNames(sourceDir);
|
|
51242
51291
|
for (const name2 of names) {
|
|
51243
51292
|
const content = fs60.readFileSync(path113.join(sourceDir, `${name2}.md`), "utf8");
|
|
@@ -51349,13 +51398,13 @@ ${content}`
|
|
|
51349
51398
|
}
|
|
51350
51399
|
|
|
51351
51400
|
// src/commands/sync/installDesignResources.ts
|
|
51352
|
-
function installDesignResources(
|
|
51401
|
+
function installDesignResources(agentDir, harness, files) {
|
|
51353
51402
|
const { homeDir, sync: sync2 } = harness;
|
|
51354
51403
|
files.write(
|
|
51355
51404
|
path116.join(homeDir, sync2.designPromptDest),
|
|
51356
|
-
fs63.readFileSync(path116.join(
|
|
51405
|
+
fs63.readFileSync(path116.join(agentDir, "design-system-prompt.md"), "utf8")
|
|
51357
51406
|
);
|
|
51358
|
-
const skillsSource = path116.join(
|
|
51407
|
+
const skillsSource = path116.join(agentDir, "skills");
|
|
51359
51408
|
const names = markdownNames(skillsSource);
|
|
51360
51409
|
for (const name2 of names) {
|
|
51361
51410
|
const content = fs63.readFileSync(
|
|
@@ -51373,8 +51422,8 @@ function installDesignResources(claudeDir, harness, files) {
|
|
|
51373
51422
|
// src/commands/sync/installHarnessCommands.ts
|
|
51374
51423
|
import * as fs64 from "fs";
|
|
51375
51424
|
import * as path117 from "path";
|
|
51376
|
-
function installHarnessCommands(
|
|
51377
|
-
const commandsSource = path117.join(
|
|
51425
|
+
function installHarnessCommands(agentDir, harness, transform, files) {
|
|
51426
|
+
const commandsSource = path117.join(agentDir, "commands");
|
|
51378
51427
|
const sourceFiles = fs64.readdirSync(commandsSource);
|
|
51379
51428
|
const names = [];
|
|
51380
51429
|
for (const file of sourceFiles) {
|
|
@@ -51420,20 +51469,16 @@ async function syncCodexHooks(sourcePath) {
|
|
|
51420
51469
|
}
|
|
51421
51470
|
|
|
51422
51471
|
// src/commands/sync/syncCodex.ts
|
|
51423
|
-
async function syncCodex(
|
|
51472
|
+
async function syncCodex(agentDir, files, options2) {
|
|
51424
51473
|
if (!isHarnessAvailable("codex")) return;
|
|
51425
51474
|
const { total: total2, names } = installHarnessCommands(
|
|
51426
|
-
|
|
51475
|
+
agentDir,
|
|
51427
51476
|
harnesses.codex,
|
|
51428
51477
|
commandToSkill,
|
|
51429
51478
|
files
|
|
51430
51479
|
);
|
|
51431
|
-
const designSkills = installDesignResources(
|
|
51432
|
-
|
|
51433
|
-
harnesses.codex,
|
|
51434
|
-
files
|
|
51435
|
-
);
|
|
51436
|
-
await syncCodexHooks(path119.join(claudeDir, "..", "codex", "config.toml"));
|
|
51480
|
+
const designSkills = installDesignResources(agentDir, harnesses.codex, files);
|
|
51481
|
+
await syncCodexHooks(path119.join(agentDir, "..", "codex", "config.toml"));
|
|
51437
51482
|
console.log(`Synced ${total2} skill(s) to ~/.codex/skills`);
|
|
51438
51483
|
console.log(
|
|
51439
51484
|
`Synced the design system prompt and ${designSkills.length} design skill(s) for Codex`
|
|
@@ -51454,15 +51499,15 @@ async function syncCodex(claudeDir, files, options2) {
|
|
|
51454
51499
|
// src/commands/sync/syncDesign.ts
|
|
51455
51500
|
import * as fs66 from "fs";
|
|
51456
51501
|
import * as path120 from "path";
|
|
51457
|
-
function syncDesign(
|
|
51502
|
+
function syncDesign(agentDir, targetBase, files) {
|
|
51458
51503
|
files.write(
|
|
51459
51504
|
path120.join(targetBase, "design-system-prompt.md"),
|
|
51460
|
-
fs66.readFileSync(path120.join(
|
|
51505
|
+
fs66.readFileSync(path120.join(agentDir, "design-system-prompt.md"), "utf8")
|
|
51461
51506
|
);
|
|
51462
51507
|
console.log(
|
|
51463
51508
|
"Copied design-system-prompt.md to ~/.claude/design-system-prompt.md"
|
|
51464
51509
|
);
|
|
51465
|
-
const skillsSource = path120.join(
|
|
51510
|
+
const skillsSource = path120.join(agentDir, "skills");
|
|
51466
51511
|
const skillsTarget = path120.join(targetBase, "skills");
|
|
51467
51512
|
const entries = fs66.readdirSync(skillsSource, { withFileTypes: true }).filter(
|
|
51468
51513
|
(entry) => !entry.isDirectory() || fs66.existsSync(path120.join(skillsSource, entry.name, "SKILL.md"))
|
|
@@ -51501,16 +51546,16 @@ ${frontmatterYaml}---
|
|
|
51501
51546
|
|
|
51502
51547
|
${body.replace(/^\r?\n+/, "")}`;
|
|
51503
51548
|
}
|
|
51504
|
-
function syncPi(
|
|
51549
|
+
function syncPi(agentDir, files, options2) {
|
|
51505
51550
|
if (!isHarnessAvailable("pi")) return;
|
|
51506
51551
|
const { synced, names } = installHarnessCommands(
|
|
51507
|
-
|
|
51552
|
+
agentDir,
|
|
51508
51553
|
harnesses.pi,
|
|
51509
51554
|
commandToPrompt,
|
|
51510
51555
|
files
|
|
51511
51556
|
);
|
|
51512
|
-
const designSkills = installDesignResources(
|
|
51513
|
-
syncPiHooks(path121.join(
|
|
51557
|
+
const designSkills = installDesignResources(agentDir, harnesses.pi, files);
|
|
51558
|
+
syncPiHooks(path121.join(agentDir, "..", "pi"));
|
|
51514
51559
|
console.log(`Synced ${synced} prompt(s) to ~/.pi/agent/prompts`);
|
|
51515
51560
|
console.log(
|
|
51516
51561
|
`Synced the design system prompt and ${designSkills.length} design skill(s) to ~/.pi/agent/assist`
|
|
@@ -51530,7 +51575,7 @@ function syncPi(claudeDir, files, options2) {
|
|
|
51530
51575
|
// src/commands/sync/syncSettings.ts
|
|
51531
51576
|
import * as fs68 from "fs";
|
|
51532
51577
|
import * as path123 from "path";
|
|
51533
|
-
import
|
|
51578
|
+
import chalk294 from "chalk";
|
|
51534
51579
|
|
|
51535
51580
|
// src/commands/sync/mergeSettings.ts
|
|
51536
51581
|
function isPlainObject7(value) {
|
|
@@ -51599,7 +51644,7 @@ async function syncSettings(claudeDir, targetBase, options2) {
|
|
|
51599
51644
|
if (mergedContent !== normalizedTarget) {
|
|
51600
51645
|
if (!options2?.yes) {
|
|
51601
51646
|
console.log(
|
|
51602
|
-
|
|
51647
|
+
chalk294.yellow(
|
|
51603
51648
|
"\n\u26A0\uFE0F Warning: settings.json differs from existing file"
|
|
51604
51649
|
)
|
|
51605
51650
|
);
|
|
@@ -51607,7 +51652,7 @@ async function syncSettings(claudeDir, targetBase, options2) {
|
|
|
51607
51652
|
printDiff(targetContent, mergedContent);
|
|
51608
51653
|
printAutoConfirmHint();
|
|
51609
51654
|
const confirm = await promptConfirm(
|
|
51610
|
-
|
|
51655
|
+
chalk294.red("Write merged settings.json?"),
|
|
51611
51656
|
false
|
|
51612
51657
|
);
|
|
51613
51658
|
if (!confirm) {
|
|
@@ -51628,20 +51673,21 @@ async function sync(options2) {
|
|
|
51628
51673
|
const config = loadConfig();
|
|
51629
51674
|
const yes = options2?.yes ?? config.sync.autoConfirm;
|
|
51630
51675
|
const prune = { prune: options2?.prune, force: options2?.force };
|
|
51676
|
+
const agentDir = path124.join(__dirname6, "..", "agent");
|
|
51631
51677
|
const claudeDir = path124.join(__dirname6, "..", "claude");
|
|
51632
51678
|
const targetBase = path124.join(os6.homedir(), ".claude");
|
|
51633
51679
|
const files = createSyncFiles([
|
|
51634
51680
|
...syncManifest.load(),
|
|
51635
51681
|
...retiredOwnedPaths()
|
|
51636
51682
|
]);
|
|
51637
|
-
const commandNames = syncClaudeCommands(
|
|
51638
|
-
const designSkillNames = syncDesign(
|
|
51683
|
+
const commandNames = syncClaudeCommands(agentDir, targetBase, files);
|
|
51684
|
+
const designSkillNames = syncDesign(agentDir, targetBase, files);
|
|
51639
51685
|
await syncSettings(claudeDir, targetBase, {
|
|
51640
51686
|
yes,
|
|
51641
51687
|
preferences: config.sync.preferences
|
|
51642
51688
|
});
|
|
51643
|
-
await syncCodex(
|
|
51644
|
-
syncPi(
|
|
51689
|
+
await syncCodex(agentDir, files, prune);
|
|
51690
|
+
syncPi(agentDir, files, prune);
|
|
51645
51691
|
reportRetiredAgentsFiles();
|
|
51646
51692
|
pruneClaude(targetBase, [...commandNames, ...designSkillNames], prune, files);
|
|
51647
51693
|
await files.finish(yes);
|
|
@@ -51650,10 +51696,10 @@ async function sync(options2) {
|
|
|
51650
51696
|
// src/commands/registerSync.ts
|
|
51651
51697
|
function registerSync(program) {
|
|
51652
51698
|
const syncCommand = program.command("sync").description(
|
|
51653
|
-
"Install commands as ~/.
|
|
51699
|
+
"Install commands as ~/.agent/skills/<name>/SKILL.md, so they take precedence over a project skill of the same name, and delete any ~/.agent/commands/<name>.md an earlier sync copied; when codex is detected, also install commands as ~/.codex/skills/<name>/SKILL.md and register the assist codex-hook in ~/.codex/config.toml, which auto-approves read-only commands and injects the repo's composed advice on SessionStart; when pi is detected, also install commands as ~/.pi/agent/prompts/<name>.md and install the assist extensions into ~/.pi/agent/extensions, which gate permissions and inject the same advice. No global instructions file is written \u2014 every harness composes its own from assist advise at session start, and any ~/.claude/CLAUDE.md, ~/.codex/AGENTS.md or ~/.pi/agent/AGENTS.md an earlier sync left behind is named so you can remove it. A target that exists and was not written by sync is never overwritten or deleted without confirmation; with --yes it is left in place and reported. With --prune, also report files an earlier sync wrote that assist no longer ships, and with --prune --force remove them"
|
|
51654
51700
|
).option("-y, --yes", "Overwrite settings.json without prompting").option(
|
|
51655
51701
|
"--prune",
|
|
51656
|
-
"After syncing, list files an earlier sync wrote (recorded in ~/.assist/sync-manifest.json) whose name is no longer in the repo's
|
|
51702
|
+
"After syncing, list files an earlier sync wrote (recorded in ~/.assist/sync-manifest.json) whose name is no longer in the repo's agent/commands/*.md set; files sync did not write are listed separately and never removed"
|
|
51657
51703
|
).option(
|
|
51658
51704
|
"--force",
|
|
51659
51705
|
"With --prune, remove the listed orphaned files; a claude or codex skill directory is removed only when SKILL.md is its sole content. Errors without --prune"
|
|
@@ -51668,17 +51714,17 @@ function registerSync(program) {
|
|
|
51668
51714
|
}
|
|
51669
51715
|
|
|
51670
51716
|
// src/commands/testflight/testflightAdd.ts
|
|
51671
|
-
import
|
|
51717
|
+
import chalk295 from "chalk";
|
|
51672
51718
|
async function testflightAdd(email, options2) {
|
|
51673
51719
|
try {
|
|
51674
51720
|
const config = readTestflightConfig(loadConfig());
|
|
51675
51721
|
const { message: message4, waiting: waiting2 } = await addTesterOutcome(config, email, {
|
|
51676
51722
|
internal: options2.internal
|
|
51677
51723
|
});
|
|
51678
|
-
console.log(waiting2 ?
|
|
51724
|
+
console.log(waiting2 ? chalk295.yellow(message4) : chalk295.green(message4));
|
|
51679
51725
|
} catch (error) {
|
|
51680
51726
|
if (!(error instanceof TestflightError)) throw error;
|
|
51681
|
-
console.error(
|
|
51727
|
+
console.error(chalk295.red(error.message));
|
|
51682
51728
|
process.exit(1);
|
|
51683
51729
|
}
|
|
51684
51730
|
}
|
|
@@ -53540,20 +53586,20 @@ function restartAdvice(paths) {
|
|
|
53540
53586
|
// src/commands/watch/syncAdvice.ts
|
|
53541
53587
|
var rules = [
|
|
53542
53588
|
{
|
|
53543
|
-
matches: (path128) => path128.startsWith("
|
|
53544
|
-
reason: "
|
|
53589
|
+
matches: (path128) => path128.startsWith("agent/commands/"),
|
|
53590
|
+
reason: "agent/commands changed"
|
|
53545
53591
|
},
|
|
53546
53592
|
{
|
|
53547
|
-
matches: (path128) => path128.startsWith("
|
|
53548
|
-
reason: "
|
|
53593
|
+
matches: (path128) => path128.startsWith("agent/skills/"),
|
|
53594
|
+
reason: "agent/skills changed"
|
|
53549
53595
|
},
|
|
53550
53596
|
{
|
|
53551
53597
|
matches: (path128) => path128 === "claude/settings.json",
|
|
53552
53598
|
reason: "claude/settings.json changed"
|
|
53553
53599
|
},
|
|
53554
53600
|
{
|
|
53555
|
-
matches: (path128) => path128 === "
|
|
53556
|
-
reason: "
|
|
53601
|
+
matches: (path128) => path128 === "agent/design-system-prompt.md",
|
|
53602
|
+
reason: "agent/design-system-prompt.md changed"
|
|
53557
53603
|
},
|
|
53558
53604
|
{
|
|
53559
53605
|
matches: (path128) => path128.startsWith("codex/"),
|
|
@@ -54330,7 +54376,7 @@ function parseEnvPairs(pairs) {
|
|
|
54330
54376
|
}
|
|
54331
54377
|
|
|
54332
54378
|
// src/commands/run/parseParamSpecs.ts
|
|
54333
|
-
function
|
|
54379
|
+
function fail12(spec) {
|
|
54334
54380
|
console.error(
|
|
54335
54381
|
`--param must be <name>, <name>! or <name>=<default>, got "${spec}"`
|
|
54336
54382
|
);
|
|
@@ -54340,14 +54386,14 @@ function parseParamSpec(spec) {
|
|
|
54340
54386
|
const eq60 = spec.indexOf("=");
|
|
54341
54387
|
const name2 = eq60 === -1 ? spec : spec.slice(0, eq60);
|
|
54342
54388
|
if (eq60 !== -1) {
|
|
54343
|
-
if (eq60 === 0 || name2.endsWith("!"))
|
|
54389
|
+
if (eq60 === 0 || name2.endsWith("!")) fail12(spec);
|
|
54344
54390
|
return { name: name2, default: spec.slice(eq60 + 1) };
|
|
54345
54391
|
}
|
|
54346
54392
|
if (name2.endsWith("!")) {
|
|
54347
|
-
if (name2.length === 1)
|
|
54393
|
+
if (name2.length === 1) fail12(spec);
|
|
54348
54394
|
return { name: name2.slice(0, -1), required: true };
|
|
54349
54395
|
}
|
|
54350
|
-
if (name2.length === 0)
|
|
54396
|
+
if (name2.length === 0) fail12(spec);
|
|
54351
54397
|
return { name: name2 };
|
|
54352
54398
|
}
|
|
54353
54399
|
function parseParamSpecs(specs) {
|
|
@@ -54656,18 +54702,18 @@ function registerRun(program) {
|
|
|
54656
54702
|
}
|
|
54657
54703
|
|
|
54658
54704
|
// src/commands/sessions/nodes/formatLink.ts
|
|
54659
|
-
import
|
|
54705
|
+
import chalk296 from "chalk";
|
|
54660
54706
|
var STATE_COLOURS = {
|
|
54661
|
-
connected:
|
|
54662
|
-
connecting:
|
|
54663
|
-
disconnected:
|
|
54664
|
-
"version-blocked":
|
|
54707
|
+
connected: chalk296.green,
|
|
54708
|
+
connecting: chalk296.yellow,
|
|
54709
|
+
disconnected: chalk296.red,
|
|
54710
|
+
"version-blocked": chalk296.red
|
|
54665
54711
|
};
|
|
54666
54712
|
function formatLink(link3) {
|
|
54667
|
-
const colour = STATE_COLOURS[link3.state] ??
|
|
54713
|
+
const colour = STATE_COLOURS[link3.state] ?? chalk296.white;
|
|
54668
54714
|
const peer = link3.peerVersion ? ` peer ${link3.peerVersion}` : "";
|
|
54669
54715
|
const error = link3.error ? `
|
|
54670
|
-
${
|
|
54716
|
+
${chalk296.dim(`last error${link3.errorAt ? ` ${link3.errorAt}` : ""}: ${link3.error}`)}` : "";
|
|
54671
54717
|
return ` ${link3.name} ${colour(link3.state)} ${link3.url}${peer}${error}`;
|
|
54672
54718
|
}
|
|
54673
54719
|
|
|
@@ -56269,7 +56315,7 @@ import { fileURLToPath as fileURLToPath11 } from "url";
|
|
|
56269
56315
|
var __filename6 = fileURLToPath11(import.meta.url);
|
|
56270
56316
|
var __dirname7 = path127.dirname(__filename6);
|
|
56271
56317
|
function designSystemPromptPath() {
|
|
56272
|
-
return path127.join(__dirname7, "..", "
|
|
56318
|
+
return path127.join(__dirname7, "..", "agent", "design-system-prompt.md");
|
|
56273
56319
|
}
|
|
56274
56320
|
|
|
56275
56321
|
// src/commands/sessions/daemon/sessionModeLaunch.ts
|
|
@@ -62308,7 +62354,7 @@ function creator(isNew, spawn14) {
|
|
|
62308
62354
|
}
|
|
62309
62355
|
sendTo(client, { type: "created", sessionId: result, isNew, traceId });
|
|
62310
62356
|
};
|
|
62311
|
-
const
|
|
62357
|
+
const fail14 = (client, d, error) => {
|
|
62312
62358
|
const reason4 = error instanceof Error ? error.message : String(error);
|
|
62313
62359
|
daemonLog(`${d.type} failed: ${reason4}`);
|
|
62314
62360
|
reply2(client, d, { error: `${d.type} failed: ${reason4}` });
|
|
@@ -62319,13 +62365,13 @@ function creator(isNew, spawn14) {
|
|
|
62319
62365
|
try {
|
|
62320
62366
|
result = spawn14(m, d);
|
|
62321
62367
|
} catch (error) {
|
|
62322
|
-
|
|
62368
|
+
fail14(client, d, error);
|
|
62323
62369
|
return;
|
|
62324
62370
|
}
|
|
62325
62371
|
if (result instanceof Promise)
|
|
62326
62372
|
result.then(
|
|
62327
62373
|
(resolved) => reply2(client, d, resolved),
|
|
62328
|
-
(error) =>
|
|
62374
|
+
(error) => fail14(client, d, error)
|
|
62329
62375
|
);
|
|
62330
62376
|
else reply2(client, d, result);
|
|
62331
62377
|
};
|
|
@@ -63480,7 +63526,7 @@ async function closeSession2() {
|
|
|
63480
63526
|
}
|
|
63481
63527
|
|
|
63482
63528
|
// src/commands/sessions/nodes/listNodes.ts
|
|
63483
|
-
import
|
|
63529
|
+
import chalk297 from "chalk";
|
|
63484
63530
|
async function nodesReport() {
|
|
63485
63531
|
const live = await queryNodes();
|
|
63486
63532
|
if (live)
|
|
@@ -63497,10 +63543,10 @@ async function listNodes(options2) {
|
|
|
63497
63543
|
console.log(JSON.stringify(report, null, 2));
|
|
63498
63544
|
return;
|
|
63499
63545
|
}
|
|
63500
|
-
console.log(`${report.local} ${
|
|
63546
|
+
console.log(`${report.local} ${chalk297.dim("(this node)")}`);
|
|
63501
63547
|
if (!report.daemonRunning)
|
|
63502
|
-
console.log(
|
|
63503
|
-
if (report.links.length === 0) console.log(
|
|
63548
|
+
console.log(chalk297.dim(" daemon not running; showing configured links"));
|
|
63549
|
+
if (report.links.length === 0) console.log(chalk297.dim(" no links"));
|
|
63504
63550
|
for (const link3 of report.links) console.log(formatLink(link3));
|
|
63505
63551
|
}
|
|
63506
63552
|
|
|
@@ -63522,7 +63568,7 @@ async function findUnlinkedWindowsNode(health2, platform = detectPlatform()) {
|
|
|
63522
63568
|
}
|
|
63523
63569
|
|
|
63524
63570
|
// src/commands/sessions/nodes/printReport.ts
|
|
63525
|
-
import
|
|
63571
|
+
import chalk298 from "chalk";
|
|
63526
63572
|
function printReport(report) {
|
|
63527
63573
|
if (report.links.length === 0) {
|
|
63528
63574
|
console.log(`${report.local} has no links`);
|
|
@@ -63536,11 +63582,11 @@ function printReport(report) {
|
|
|
63536
63582
|
for (const diagnosis of report.links) printDiagnosis(diagnosis);
|
|
63537
63583
|
}
|
|
63538
63584
|
function printDiagnosis(diagnosis) {
|
|
63539
|
-
console.log(`${
|
|
63585
|
+
console.log(`${chalk298.bold(diagnosis.name)} ${chalk298.dim(diagnosis.url)}`);
|
|
63540
63586
|
for (const hop of diagnosis.hops) {
|
|
63541
|
-
const mark = hop.ok ?
|
|
63587
|
+
const mark = hop.ok ? chalk298.green("\u2713") : chalk298.red("\u2717");
|
|
63542
63588
|
console.log(` ${mark} ${hop.hop.padEnd(9)} ${hop.detail ?? hop.error}`);
|
|
63543
|
-
if (hop.remediation) console.log(` ${
|
|
63589
|
+
if (hop.remediation) console.log(` ${chalk298.yellow(hop.remediation)}`);
|
|
63544
63590
|
}
|
|
63545
63591
|
}
|
|
63546
63592
|
|
|
@@ -63612,14 +63658,14 @@ function registerDiagnoseCommands(nodes, calledBy5) {
|
|
|
63612
63658
|
}
|
|
63613
63659
|
|
|
63614
63660
|
// src/commands/sessions/nodes/linkNode.ts
|
|
63615
|
-
import
|
|
63661
|
+
import chalk301 from "chalk";
|
|
63616
63662
|
|
|
63617
63663
|
// src/commands/sessions/nodes/notifyDaemonLinks.ts
|
|
63618
|
-
import
|
|
63664
|
+
import chalk299 from "chalk";
|
|
63619
63665
|
async function notifyDaemonLinks() {
|
|
63620
63666
|
if (!await isDaemonRunning()) {
|
|
63621
63667
|
console.log(
|
|
63622
|
-
|
|
63668
|
+
chalk299.yellow(
|
|
63623
63669
|
"The sessions daemon is not running; it loads the links when it starts."
|
|
63624
63670
|
)
|
|
63625
63671
|
);
|
|
@@ -63627,11 +63673,11 @@ async function notifyDaemonLinks() {
|
|
|
63627
63673
|
}
|
|
63628
63674
|
try {
|
|
63629
63675
|
await sendToDaemonAwaitAck({ type: "reload-links" });
|
|
63630
|
-
console.log(
|
|
63676
|
+
console.log(chalk299.dim("The sessions daemon reloaded its links."));
|
|
63631
63677
|
} catch (error) {
|
|
63632
63678
|
const message4 = error instanceof Error ? error.message : String(error);
|
|
63633
63679
|
console.log(
|
|
63634
|
-
|
|
63680
|
+
chalk299.yellow(
|
|
63635
63681
|
`Could not notify the sessions daemon (${message4}); run \`assist daemon restart\` to apply the change.`
|
|
63636
63682
|
)
|
|
63637
63683
|
);
|
|
@@ -63639,7 +63685,7 @@ async function notifyDaemonLinks() {
|
|
|
63639
63685
|
}
|
|
63640
63686
|
|
|
63641
63687
|
// src/commands/sessions/nodes/readLinks.ts
|
|
63642
|
-
import
|
|
63688
|
+
import chalk300 from "chalk";
|
|
63643
63689
|
|
|
63644
63690
|
// src/commands/sessions/nodes/writeLinks.ts
|
|
63645
63691
|
async function writeLinks(links2) {
|
|
@@ -63662,7 +63708,7 @@ async function readLinks() {
|
|
|
63662
63708
|
await writeLinks(links2);
|
|
63663
63709
|
const dropped = stored.filter((link3) => !link3.url).map((link3) => link3.name);
|
|
63664
63710
|
console.log(
|
|
63665
|
-
|
|
63711
|
+
chalk300.yellow(`Removed ${dropped.join(", ")}: ${SSH_LINK_RETIRED}`)
|
|
63666
63712
|
);
|
|
63667
63713
|
return links2;
|
|
63668
63714
|
}
|
|
@@ -63718,7 +63764,7 @@ async function linkNode(name2, url, options2) {
|
|
|
63718
63764
|
throw new Error(`${name2} is this node; link to a different node`);
|
|
63719
63765
|
const link3 = await buildLink(name2, url, options2);
|
|
63720
63766
|
await writeLinks([...others, link3]);
|
|
63721
|
-
console.log(
|
|
63767
|
+
console.log(chalk301.green(`Linked ${name2} (${link3.url})`));
|
|
63722
63768
|
await notifyDaemonLinks();
|
|
63723
63769
|
}
|
|
63724
63770
|
|
|
@@ -63783,14 +63829,14 @@ function startPeerAction(name2, action) {
|
|
|
63783
63829
|
const line = `nodes ${action} ${name2} trace=${traceId}`;
|
|
63784
63830
|
console.log(line);
|
|
63785
63831
|
appendDaemonLog(line);
|
|
63786
|
-
const
|
|
63832
|
+
const fail14 = async (summary, error) => new Error(await describeFailure(name2, summary, error));
|
|
63787
63833
|
return {
|
|
63788
63834
|
spec,
|
|
63789
63835
|
traceId,
|
|
63790
|
-
fail:
|
|
63836
|
+
fail: fail14,
|
|
63791
63837
|
async awaitReturn(sawDown, timeoutMs = RETURN_TIMEOUT_MS) {
|
|
63792
63838
|
const link3 = await awaitLinkReturn(name2, { sawDown, timeoutMs });
|
|
63793
|
-
if (!link3) throw await
|
|
63839
|
+
if (!link3) throw await fail14(`${name2} did not come back`);
|
|
63794
63840
|
return link3;
|
|
63795
63841
|
}
|
|
63796
63842
|
};
|
|
@@ -63901,16 +63947,16 @@ function registerPeerActionCommands(nodes, calledBy5) {
|
|
|
63901
63947
|
}
|
|
63902
63948
|
|
|
63903
63949
|
// src/commands/sessions/nodes/unlinkNode.ts
|
|
63904
|
-
import
|
|
63950
|
+
import chalk302 from "chalk";
|
|
63905
63951
|
async function unlinkNode(name2) {
|
|
63906
63952
|
const links2 = await readLinks();
|
|
63907
63953
|
const remaining = links2.filter((link3) => link3.name !== name2);
|
|
63908
63954
|
if (remaining.length === links2.length) {
|
|
63909
|
-
console.log(
|
|
63955
|
+
console.log(chalk302.yellow(`No link named ${name2}`));
|
|
63910
63956
|
return;
|
|
63911
63957
|
}
|
|
63912
63958
|
await writeLinks(remaining);
|
|
63913
|
-
console.log(
|
|
63959
|
+
console.log(chalk302.green(`Unlinked ${name2}`));
|
|
63914
63960
|
await notifyDaemonLinks();
|
|
63915
63961
|
}
|
|
63916
63962
|
|
|
@@ -63984,9 +64030,9 @@ function resolveTarget4(sessionId2, server) {
|
|
|
63984
64030
|
async function sessionOutput(sessionId2, options2) {
|
|
63985
64031
|
const count10 = Number.parseInt(options2.lines, 10);
|
|
63986
64032
|
if (!Number.isInteger(count10) || count10 < 1)
|
|
63987
|
-
return
|
|
64033
|
+
return fail13(`-n must be a positive integer, got ${options2.lines}`);
|
|
63988
64034
|
const target = resolveTarget4(sessionId2, options2.server);
|
|
63989
|
-
if (typeof target === "string") return
|
|
64035
|
+
if (typeof target === "string") return fail13(target);
|
|
63990
64036
|
try {
|
|
63991
64037
|
const {
|
|
63992
64038
|
sessionId: id,
|
|
@@ -63999,10 +64045,10 @@ async function sessionOutput(sessionId2, options2) {
|
|
|
63999
64045
|
);
|
|
64000
64046
|
for (const line of lastLines(scrollback, count10)) console.log(line);
|
|
64001
64047
|
} catch (error) {
|
|
64002
|
-
|
|
64048
|
+
fail13(error instanceof Error ? error.message : String(error));
|
|
64003
64049
|
}
|
|
64004
64050
|
}
|
|
64005
|
-
function
|
|
64051
|
+
function fail13(message4) {
|
|
64006
64052
|
console.error(message4);
|
|
64007
64053
|
process.exitCode = 1;
|
|
64008
64054
|
}
|
|
@@ -64159,10 +64205,10 @@ function createProgram() {
|
|
|
64159
64205
|
}
|
|
64160
64206
|
|
|
64161
64207
|
// src/reportCliError.ts
|
|
64162
|
-
import
|
|
64208
|
+
import chalk303 from "chalk";
|
|
64163
64209
|
function reportCliError(error) {
|
|
64164
64210
|
if (error instanceof InvalidItemIdError || error instanceof AmbiguousRepoConfigError || error instanceof UnknownRepoConfigError || error instanceof MissingRunCwdError || error instanceof MiroExtractError || error instanceof MissingDatabaseUrlError || error instanceof DatabaseConnectionError) {
|
|
64165
|
-
console.error(
|
|
64211
|
+
console.error(chalk303.red(error.message));
|
|
64166
64212
|
} else {
|
|
64167
64213
|
console.error(error);
|
|
64168
64214
|
}
|