@staff0rd/assist 0.607.0 → 0.608.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/README.md +2 -0
- package/claude/commands/slack-post.md +37 -0
- package/claude/settings.json +2 -0
- package/dist/commands/sessions/web/bundle.js +2 -2
- package/dist/index.js +160 -84
- 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.
|
|
9
|
+
version: "0.608.0",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -31100,6 +31100,79 @@ function registerSignal(program2) {
|
|
|
31100
31100
|
});
|
|
31101
31101
|
}
|
|
31102
31102
|
|
|
31103
|
+
// src/commands/slack/postSlackMessage.ts
|
|
31104
|
+
import { mkdirSync as mkdirSync22, writeFileSync as writeFileSync42 } from "fs";
|
|
31105
|
+
|
|
31106
|
+
// src/commands/slack/reviewProposedSlackMessage.ts
|
|
31107
|
+
import { randomUUID as randomUUID17 } from "crypto";
|
|
31108
|
+
async function reviewProposedSlackMessage(channel, body, working) {
|
|
31109
|
+
const sessionId = process.env.ASSIST_SESSION_ID;
|
|
31110
|
+
if (process.env.ASSIST_SESSION !== "1" || !sessionId) return body;
|
|
31111
|
+
const decision = await awaitPreviewApproval(
|
|
31112
|
+
"Slack message preview",
|
|
31113
|
+
{
|
|
31114
|
+
sessionId,
|
|
31115
|
+
requestId: randomUUID17(),
|
|
31116
|
+
title: `Post to ${channel}`,
|
|
31117
|
+
body,
|
|
31118
|
+
prNumber: null,
|
|
31119
|
+
kind: "slack-post"
|
|
31120
|
+
},
|
|
31121
|
+
{
|
|
31122
|
+
saveEditedBody: working.save,
|
|
31123
|
+
rejectionAdvice: `Nothing was posted to ${channel}. The previewed markdown is at ${working.path}: revise that file in place and re-run this command to preview the revision.`
|
|
31124
|
+
}
|
|
31125
|
+
);
|
|
31126
|
+
return decision.body ?? body;
|
|
31127
|
+
}
|
|
31128
|
+
|
|
31129
|
+
// src/commands/slack/slackWorkingFile.ts
|
|
31130
|
+
import { join as join73 } from "path";
|
|
31131
|
+
function slackWorkingFile(channel) {
|
|
31132
|
+
const slug = channel.replace(/^[#@]/, "").toLowerCase().replace(/[^a-z0-9._-]+/g, "-").replace(/^-+|-+$/g, "") || "channel";
|
|
31133
|
+
const dir = join73(getStoreDir(), "slack");
|
|
31134
|
+
return { dir, bodyPath: join73(dir, `${slug}.md`) };
|
|
31135
|
+
}
|
|
31136
|
+
|
|
31137
|
+
// src/commands/slack/postSlackMessage.ts
|
|
31138
|
+
var USAGE5 = "Usage: assist slack post <channel> --body <body|->";
|
|
31139
|
+
async function postSlackMessage(channelArg, options2) {
|
|
31140
|
+
const channel = channelArg.trim();
|
|
31141
|
+
const body = options2.body?.trim();
|
|
31142
|
+
if (!channel || !body) {
|
|
31143
|
+
console.error(USAGE5);
|
|
31144
|
+
process.exit(1);
|
|
31145
|
+
}
|
|
31146
|
+
const { dir, bodyPath } = slackWorkingFile(channel);
|
|
31147
|
+
mkdirSync22(dir, { recursive: true });
|
|
31148
|
+
const write = (text18) => writeFileSync42(bodyPath, `${text18}
|
|
31149
|
+
`);
|
|
31150
|
+
write(body);
|
|
31151
|
+
const approved = await reviewProposedSlackMessage(channel, body, {
|
|
31152
|
+
path: bodyPath,
|
|
31153
|
+
save: write
|
|
31154
|
+
});
|
|
31155
|
+
write(approved);
|
|
31156
|
+
console.log(`Approved for ${channel}. The body to post is at:`);
|
|
31157
|
+
console.log(bodyPath);
|
|
31158
|
+
}
|
|
31159
|
+
|
|
31160
|
+
// src/commands/registerSlack.ts
|
|
31161
|
+
function registerSlack(program2) {
|
|
31162
|
+
const slackCommand = program2.command("slack").description("Slack utilities");
|
|
31163
|
+
slackCommand.command("post <channel>").description(
|
|
31164
|
+
"Preview a markdown message bound for a Slack channel (body of - reads it from stdin)"
|
|
31165
|
+
).option("--body <body>", "Message body (- reads it from stdin)").addHelpText(
|
|
31166
|
+
"after",
|
|
31167
|
+
"\nThe command does not post: Slack is reachable only over MCP, so it previews the message and hands the approved body back for /slack-post to send.\nIn an assist web session the body is previewed for approve/reject first (with inline comments). On approval the approved body \u2014 including any edit made in the pane \u2014 is written to a working file under ~/.assist/slack/ and its path printed on the last line. On rejection nothing is handed back: the command exits non-zero with the reason and any inline comments, leaving the previewed markdown in the working file to revise in place.\nOutside a web session there is no preview and the body passes straight through.\nslack_send_message accepts standard markdown as it is \u2014 bold, italic, code, blockquotes, lists, links, code blocks, tables and headers \u2014 capped at 5000 characters."
|
|
31168
|
+
).action(async (channel, options2) => {
|
|
31169
|
+
await postSlackMessage(channel, {
|
|
31170
|
+
...options2,
|
|
31171
|
+
body: options2.body ? await readBodyArgument(options2.body) : void 0
|
|
31172
|
+
});
|
|
31173
|
+
});
|
|
31174
|
+
}
|
|
31175
|
+
|
|
31103
31176
|
// src/commands/sql/sqlAuth.ts
|
|
31104
31177
|
import chalk220 from "chalk";
|
|
31105
31178
|
|
|
@@ -32132,20 +32205,20 @@ async function configure() {
|
|
|
32132
32205
|
|
|
32133
32206
|
// src/commands/transcript/list.ts
|
|
32134
32207
|
import { existsSync as existsSync72, readdirSync as readdirSync20, statSync as statSync11 } from "fs";
|
|
32135
|
-
import { join as
|
|
32208
|
+
import { join as join84 } from "path";
|
|
32136
32209
|
function list4() {
|
|
32137
32210
|
const { vttDir } = getTranscriptConfig();
|
|
32138
32211
|
if (!existsSync72(vttDir)) return;
|
|
32139
32212
|
for (const entry of readdirSync20(vttDir)) {
|
|
32140
32213
|
if (!entry.endsWith(".vtt")) continue;
|
|
32141
|
-
if (statSync11(
|
|
32214
|
+
if (statSync11(join84(vttDir, entry)).isDirectory()) continue;
|
|
32142
32215
|
console.log(entry);
|
|
32143
32216
|
}
|
|
32144
32217
|
}
|
|
32145
32218
|
|
|
32146
32219
|
// src/commands/transcript/move.ts
|
|
32147
|
-
import { existsSync as existsSync73, mkdirSync as
|
|
32148
|
-
import { basename as basename21, join as
|
|
32220
|
+
import { existsSync as existsSync73, mkdirSync as mkdirSync28, renameSync as renameSync2, writeFileSync as writeFileSync46 } from "fs";
|
|
32221
|
+
import { basename as basename21, join as join85 } from "path";
|
|
32149
32222
|
|
|
32150
32223
|
// src/commands/transcript/convertVttToMarkdown.ts
|
|
32151
32224
|
function convertVttToMarkdown(inputPath) {
|
|
@@ -32155,9 +32228,9 @@ function convertVttToMarkdown(inputPath) {
|
|
|
32155
32228
|
// src/commands/transcript/move.ts
|
|
32156
32229
|
var DATE_REGEX = /^\d{4}-\d{2}-\d{2}$/;
|
|
32157
32230
|
function archiveRawVtt(vttDir, sourcePath, filename) {
|
|
32158
|
-
const processedDir =
|
|
32159
|
-
|
|
32160
|
-
renameSync2(sourcePath,
|
|
32231
|
+
const processedDir = join85(vttDir, "processed");
|
|
32232
|
+
mkdirSync28(processedDir, { recursive: true });
|
|
32233
|
+
renameSync2(sourcePath, join85(processedDir, filename));
|
|
32161
32234
|
}
|
|
32162
32235
|
function move(file, options2) {
|
|
32163
32236
|
const { date, client } = options2;
|
|
@@ -32167,19 +32240,19 @@ function move(file, options2) {
|
|
|
32167
32240
|
}
|
|
32168
32241
|
const { vttDir, transcriptsDir, summaryDir } = getTranscriptConfig();
|
|
32169
32242
|
const filename = basename21(file);
|
|
32170
|
-
const sourcePath =
|
|
32243
|
+
const sourcePath = join85(vttDir, filename);
|
|
32171
32244
|
if (!existsSync73(sourcePath)) {
|
|
32172
32245
|
console.error(`Error: VTT file not found: ${sourcePath}`);
|
|
32173
32246
|
process.exit(1);
|
|
32174
32247
|
}
|
|
32175
32248
|
const base = basename21(filename, ".vtt").replace(/ Transcription$/, "");
|
|
32176
32249
|
const outputName = `${date} ${base}.md`;
|
|
32177
|
-
const formattedDir =
|
|
32178
|
-
|
|
32179
|
-
const formattedPath =
|
|
32180
|
-
|
|
32250
|
+
const formattedDir = join85(transcriptsDir, client);
|
|
32251
|
+
mkdirSync28(formattedDir, { recursive: true });
|
|
32252
|
+
const formattedPath = join85(formattedDir, outputName);
|
|
32253
|
+
writeFileSync46(formattedPath, convertVttToMarkdown(sourcePath), "utf8");
|
|
32181
32254
|
archiveRawVtt(vttDir, sourcePath, filename);
|
|
32182
|
-
const summaryPath =
|
|
32255
|
+
const summaryPath = join85(summaryDir, client, outputName);
|
|
32183
32256
|
console.log(`Formatted transcript: ${formattedPath}`);
|
|
32184
32257
|
console.log(`Summary target: ${summaryPath}`);
|
|
32185
32258
|
}
|
|
@@ -32262,38 +32335,38 @@ function registerVerify(program2) {
|
|
|
32262
32335
|
|
|
32263
32336
|
// src/commands/voice/devices.ts
|
|
32264
32337
|
import { spawnSync as spawnSync9 } from "child_process";
|
|
32265
|
-
import { join as
|
|
32338
|
+
import { join as join87 } from "path";
|
|
32266
32339
|
|
|
32267
32340
|
// src/commands/voice/shared.ts
|
|
32268
32341
|
import { homedir as homedir25 } from "os";
|
|
32269
|
-
import { dirname as dirname36, join as
|
|
32342
|
+
import { dirname as dirname36, join as join86 } from "path";
|
|
32270
32343
|
import { fileURLToPath as fileURLToPath9 } from "url";
|
|
32271
32344
|
var __dirname6 = dirname36(fileURLToPath9(import.meta.url));
|
|
32272
|
-
var VOICE_DIR =
|
|
32345
|
+
var VOICE_DIR = join86(homedir25(), ".assist", "voice");
|
|
32273
32346
|
var voicePaths = {
|
|
32274
32347
|
dir: VOICE_DIR,
|
|
32275
|
-
pid:
|
|
32276
|
-
log:
|
|
32277
|
-
venv:
|
|
32278
|
-
lock:
|
|
32348
|
+
pid: join86(VOICE_DIR, "voice.pid"),
|
|
32349
|
+
log: join86(VOICE_DIR, "voice.log"),
|
|
32350
|
+
venv: join86(VOICE_DIR, ".venv"),
|
|
32351
|
+
lock: join86(VOICE_DIR, "voice.lock")
|
|
32279
32352
|
};
|
|
32280
32353
|
function getPythonDir() {
|
|
32281
|
-
return
|
|
32354
|
+
return join86(__dirname6, "commands", "voice", "python");
|
|
32282
32355
|
}
|
|
32283
32356
|
function getVenvPython() {
|
|
32284
|
-
return process.platform === "win32" ?
|
|
32357
|
+
return process.platform === "win32" ? join86(voicePaths.venv, "Scripts", "python.exe") : join86(voicePaths.venv, "bin", "python");
|
|
32285
32358
|
}
|
|
32286
32359
|
function getLockDir() {
|
|
32287
32360
|
const config = loadConfig();
|
|
32288
32361
|
return config.voice?.lockDir ?? VOICE_DIR;
|
|
32289
32362
|
}
|
|
32290
32363
|
function getLockFile() {
|
|
32291
|
-
return
|
|
32364
|
+
return join86(getLockDir(), "voice.lock");
|
|
32292
32365
|
}
|
|
32293
32366
|
|
|
32294
32367
|
// src/commands/voice/devices.ts
|
|
32295
32368
|
function devices() {
|
|
32296
|
-
const script =
|
|
32369
|
+
const script = join87(getPythonDir(), "list_devices.py");
|
|
32297
32370
|
spawnSync9(getVenvPython(), [script], { stdio: "inherit" });
|
|
32298
32371
|
}
|
|
32299
32372
|
|
|
@@ -32327,13 +32400,13 @@ function logs(options2) {
|
|
|
32327
32400
|
|
|
32328
32401
|
// src/commands/voice/setup.ts
|
|
32329
32402
|
import { spawnSync as spawnSync10 } from "child_process";
|
|
32330
|
-
import { mkdirSync as
|
|
32331
|
-
import { join as
|
|
32403
|
+
import { mkdirSync as mkdirSync30 } from "fs";
|
|
32404
|
+
import { join as join89 } from "path";
|
|
32332
32405
|
|
|
32333
32406
|
// src/commands/voice/checkLockFile.ts
|
|
32334
32407
|
import { execSync as execSync58 } from "child_process";
|
|
32335
|
-
import { existsSync as existsSync75, mkdirSync as
|
|
32336
|
-
import { join as
|
|
32408
|
+
import { existsSync as existsSync75, mkdirSync as mkdirSync29, readFileSync as readFileSync57, writeFileSync as writeFileSync47 } from "fs";
|
|
32409
|
+
import { join as join88 } from "path";
|
|
32337
32410
|
function isProcessAlive2(pid) {
|
|
32338
32411
|
try {
|
|
32339
32412
|
process.kill(pid, 0);
|
|
@@ -32370,8 +32443,8 @@ function bootstrapVenv() {
|
|
|
32370
32443
|
}
|
|
32371
32444
|
function writeLockFile(pid) {
|
|
32372
32445
|
const lockFile = getLockFile();
|
|
32373
|
-
|
|
32374
|
-
|
|
32446
|
+
mkdirSync29(join88(lockFile, ".."), { recursive: true });
|
|
32447
|
+
writeFileSync47(
|
|
32375
32448
|
lockFile,
|
|
32376
32449
|
JSON.stringify({
|
|
32377
32450
|
pid,
|
|
@@ -32383,10 +32456,10 @@ function writeLockFile(pid) {
|
|
|
32383
32456
|
|
|
32384
32457
|
// src/commands/voice/setup.ts
|
|
32385
32458
|
function setup() {
|
|
32386
|
-
|
|
32459
|
+
mkdirSync30(voicePaths.dir, { recursive: true });
|
|
32387
32460
|
bootstrapVenv();
|
|
32388
32461
|
console.log("\nDownloading models...\n");
|
|
32389
|
-
const script =
|
|
32462
|
+
const script = join89(getPythonDir(), "setup_models.py");
|
|
32390
32463
|
const result = spawnSync10(getVenvPython(), [script], {
|
|
32391
32464
|
stdio: "inherit",
|
|
32392
32465
|
env: { ...process.env, VOICE_LOG_FILE: voicePaths.log }
|
|
@@ -32399,8 +32472,8 @@ function setup() {
|
|
|
32399
32472
|
|
|
32400
32473
|
// src/commands/voice/start.ts
|
|
32401
32474
|
import { spawn as spawn8 } from "child_process";
|
|
32402
|
-
import { mkdirSync as
|
|
32403
|
-
import { join as
|
|
32475
|
+
import { mkdirSync as mkdirSync31, writeFileSync as writeFileSync48 } from "fs";
|
|
32476
|
+
import { join as join90 } from "path";
|
|
32404
32477
|
|
|
32405
32478
|
// src/commands/voice/buildDaemonEnv.ts
|
|
32406
32479
|
function buildDaemonEnv(options2) {
|
|
@@ -32428,17 +32501,17 @@ function spawnBackground(python, script, env) {
|
|
|
32428
32501
|
console.error("Failed to start voice daemon");
|
|
32429
32502
|
process.exit(1);
|
|
32430
32503
|
}
|
|
32431
|
-
|
|
32504
|
+
writeFileSync48(voicePaths.pid, String(pid));
|
|
32432
32505
|
writeLockFile(pid);
|
|
32433
32506
|
console.log(`Voice daemon started (PID ${pid})`);
|
|
32434
32507
|
}
|
|
32435
32508
|
function start2(options2) {
|
|
32436
|
-
|
|
32509
|
+
mkdirSync31(voicePaths.dir, { recursive: true });
|
|
32437
32510
|
checkLockFile();
|
|
32438
32511
|
bootstrapVenv();
|
|
32439
32512
|
const debug = options2.debug || options2.foreground || process.platform === "win32";
|
|
32440
32513
|
const env = buildDaemonEnv({ debug });
|
|
32441
|
-
const script =
|
|
32514
|
+
const script = join90(getPythonDir(), "voice_daemon.py");
|
|
32442
32515
|
const python = getVenvPython();
|
|
32443
32516
|
if (options2.foreground) {
|
|
32444
32517
|
spawnForeground(python, script, env);
|
|
@@ -32569,11 +32642,11 @@ function changedPaths(from, cwd) {
|
|
|
32569
32642
|
}
|
|
32570
32643
|
|
|
32571
32644
|
// src/commands/watch/readBuiltVersion.ts
|
|
32572
|
-
import { join as
|
|
32645
|
+
import { join as join91 } from "path";
|
|
32573
32646
|
function readBuiltVersion(cwd) {
|
|
32574
32647
|
try {
|
|
32575
32648
|
const root = runGit3(["rev-parse", "--show-toplevel"], cwd);
|
|
32576
|
-
return readPackageJson(
|
|
32649
|
+
return readPackageJson(join91(root, "package.json")).version ?? "unknown";
|
|
32577
32650
|
} catch {
|
|
32578
32651
|
return "unknown";
|
|
32579
32652
|
}
|
|
@@ -32934,13 +33007,13 @@ import { existsSync as existsSync80 } from "fs";
|
|
|
32934
33007
|
// src/commands/run/resolveCommand.ts
|
|
32935
33008
|
import { execFileSync as execFileSync16 } from "child_process";
|
|
32936
33009
|
import { existsSync as existsSync79 } from "fs";
|
|
32937
|
-
import { dirname as dirname37, join as
|
|
33010
|
+
import { dirname as dirname37, join as join92, resolve as resolve20 } from "path";
|
|
32938
33011
|
function resolveCommand2(command) {
|
|
32939
33012
|
if (process.platform !== "win32" || command !== "bash") return command;
|
|
32940
33013
|
try {
|
|
32941
33014
|
const gitPath = execFileSync16("where", ["git"], { encoding: "utf8" }).trim().split("\r\n")[0];
|
|
32942
33015
|
const gitRoot = resolve20(dirname37(gitPath), "..");
|
|
32943
|
-
const gitBash =
|
|
33016
|
+
const gitBash = join92(gitRoot, "bin", "bash.exe");
|
|
32944
33017
|
if (existsSync79(gitBash)) return gitBash;
|
|
32945
33018
|
} catch {
|
|
32946
33019
|
return command;
|
|
@@ -33368,7 +33441,7 @@ async function auth() {
|
|
|
33368
33441
|
// src/commands/roam/postRoamActivity.ts
|
|
33369
33442
|
import { execFileSync as execFileSync18 } from "child_process";
|
|
33370
33443
|
import { readdirSync as readdirSync21, readFileSync as readFileSync60, statSync as statSync12 } from "fs";
|
|
33371
|
-
import { join as
|
|
33444
|
+
import { join as join93 } from "path";
|
|
33372
33445
|
function findPortFile(roamDir) {
|
|
33373
33446
|
let entries;
|
|
33374
33447
|
try {
|
|
@@ -33377,7 +33450,7 @@ function findPortFile(roamDir) {
|
|
|
33377
33450
|
return void 0;
|
|
33378
33451
|
}
|
|
33379
33452
|
const candidates = entries.filter((name) => /^roam-local-api(-[^.]+)?\.port$/.test(name)).map((name) => {
|
|
33380
|
-
const path90 =
|
|
33453
|
+
const path90 = join93(roamDir, name);
|
|
33381
33454
|
try {
|
|
33382
33455
|
return { path: path90, mtimeMs: statSync12(path90).mtimeMs };
|
|
33383
33456
|
} catch {
|
|
@@ -33394,7 +33467,7 @@ var PID_BY_APP = {
|
|
|
33394
33467
|
function postRoamActivity(app, event) {
|
|
33395
33468
|
const appData = process.env.APPDATA;
|
|
33396
33469
|
if (!appData) return;
|
|
33397
|
-
const portFile = findPortFile(
|
|
33470
|
+
const portFile = findPortFile(join93(appData, "Roam"));
|
|
33398
33471
|
if (!portFile) return;
|
|
33399
33472
|
let port;
|
|
33400
33473
|
try {
|
|
@@ -33529,8 +33602,8 @@ async function run3(name, args) {
|
|
|
33529
33602
|
}
|
|
33530
33603
|
|
|
33531
33604
|
// src/commands/run/add.ts
|
|
33532
|
-
import { mkdirSync as
|
|
33533
|
-
import { join as
|
|
33605
|
+
import { mkdirSync as mkdirSync32, writeFileSync as writeFileSync49 } from "fs";
|
|
33606
|
+
import { join as join94 } from "path";
|
|
33534
33607
|
|
|
33535
33608
|
// src/commands/run/extractOption.ts
|
|
33536
33609
|
function extractOption(args, flag) {
|
|
@@ -33591,16 +33664,16 @@ function saveNewRunConfig(name, command, args, cwd) {
|
|
|
33591
33664
|
saveConfig(config);
|
|
33592
33665
|
}
|
|
33593
33666
|
function createCommandFile(name) {
|
|
33594
|
-
const dir =
|
|
33595
|
-
|
|
33667
|
+
const dir = join94(".claude", "commands");
|
|
33668
|
+
mkdirSync32(dir, { recursive: true });
|
|
33596
33669
|
const content = `---
|
|
33597
33670
|
description: Run ${name}
|
|
33598
33671
|
---
|
|
33599
33672
|
|
|
33600
33673
|
Run \`assist run ${name} $ARGUMENTS 2>&1\`.
|
|
33601
33674
|
`;
|
|
33602
|
-
const filePath =
|
|
33603
|
-
|
|
33675
|
+
const filePath = join94(dir, `${name}.md`);
|
|
33676
|
+
writeFileSync49(filePath, content);
|
|
33604
33677
|
console.log(`Created command file: ${filePath}`);
|
|
33605
33678
|
}
|
|
33606
33679
|
function add3() {
|
|
@@ -33656,7 +33729,7 @@ function link2() {
|
|
|
33656
33729
|
|
|
33657
33730
|
// src/commands/run/remove.ts
|
|
33658
33731
|
import { existsSync as existsSync81, unlinkSync as unlinkSync21 } from "fs";
|
|
33659
|
-
import { join as
|
|
33732
|
+
import { join as join95 } from "path";
|
|
33660
33733
|
function findRemoveIndex() {
|
|
33661
33734
|
const idx = process.argv.indexOf("remove");
|
|
33662
33735
|
if (idx === -1 || idx + 1 >= process.argv.length) return -1;
|
|
@@ -33671,7 +33744,7 @@ function parseRemoveName() {
|
|
|
33671
33744
|
return process.argv[idx + 1];
|
|
33672
33745
|
}
|
|
33673
33746
|
function deleteCommandFile(name) {
|
|
33674
|
-
const filePath =
|
|
33747
|
+
const filePath = join95(".claude", "commands", `${name}.md`);
|
|
33675
33748
|
if (existsSync81(filePath)) {
|
|
33676
33749
|
unlinkSync21(filePath);
|
|
33677
33750
|
console.log(`Deleted command file: ${filePath}`);
|
|
@@ -33717,9 +33790,9 @@ function registerRun(program2) {
|
|
|
33717
33790
|
|
|
33718
33791
|
// src/commands/screenshot/index.ts
|
|
33719
33792
|
import { execSync as execSync60 } from "child_process";
|
|
33720
|
-
import { existsSync as existsSync82, mkdirSync as
|
|
33793
|
+
import { existsSync as existsSync82, mkdirSync as mkdirSync33, unlinkSync as unlinkSync22, writeFileSync as writeFileSync50 } from "fs";
|
|
33721
33794
|
import { tmpdir as tmpdir9 } from "os";
|
|
33722
|
-
import { join as
|
|
33795
|
+
import { join as join96, resolve as resolve21 } from "path";
|
|
33723
33796
|
import chalk227 from "chalk";
|
|
33724
33797
|
|
|
33725
33798
|
// src/commands/screenshot/captureWindowPs1.ts
|
|
@@ -33850,14 +33923,14 @@ Write-Output $OutputPath
|
|
|
33850
33923
|
// src/commands/screenshot/index.ts
|
|
33851
33924
|
function buildOutputPath(outputDir, processName) {
|
|
33852
33925
|
if (!existsSync82(outputDir)) {
|
|
33853
|
-
|
|
33926
|
+
mkdirSync33(outputDir, { recursive: true });
|
|
33854
33927
|
}
|
|
33855
33928
|
const timestamp6 = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
|
|
33856
33929
|
return resolve21(outputDir, `${processName}-${timestamp6}.png`);
|
|
33857
33930
|
}
|
|
33858
33931
|
function runPowerShellScript(processName, outputPath) {
|
|
33859
|
-
const scriptPath =
|
|
33860
|
-
|
|
33932
|
+
const scriptPath = join96(tmpdir9(), `assist-screenshot-${Date.now()}.ps1`);
|
|
33933
|
+
writeFileSync50(scriptPath, captureWindowPs1, "utf8");
|
|
33861
33934
|
try {
|
|
33862
33935
|
execSync60(
|
|
33863
33936
|
`powershell -NoProfile -ExecutionPolicy Bypass -File "${scriptPath}" -ProcessName "${processName}" -OutputPath "${outputPath}"`,
|
|
@@ -34090,7 +34163,7 @@ function requestDrain(socket, lines2) {
|
|
|
34090
34163
|
}
|
|
34091
34164
|
|
|
34092
34165
|
// src/commands/sessions/daemon/runDaemon.ts
|
|
34093
|
-
import { mkdirSync as
|
|
34166
|
+
import { mkdirSync as mkdirSync37 } from "fs";
|
|
34094
34167
|
|
|
34095
34168
|
// src/commands/sessions/daemon/createAutoExit.ts
|
|
34096
34169
|
var DEFAULT_GRACE_MS = 6e4;
|
|
@@ -34344,7 +34417,7 @@ var ClientHub = class extends Set {
|
|
|
34344
34417
|
};
|
|
34345
34418
|
|
|
34346
34419
|
// src/commands/sessions/daemon/createSession.ts
|
|
34347
|
-
import { randomUUID as
|
|
34420
|
+
import { randomUUID as randomUUID18 } from "crypto";
|
|
34348
34421
|
|
|
34349
34422
|
// src/commands/sessions/daemon/sessionBase.ts
|
|
34350
34423
|
function sessionBase(id, status3) {
|
|
@@ -34540,7 +34613,7 @@ function spawnRun(opts) {
|
|
|
34540
34613
|
function createSession(id, { prompt, cwd, design, auto, harness, holdPty } = {}) {
|
|
34541
34614
|
if (harness && harness !== "claude")
|
|
34542
34615
|
return createHarnessSession(id, harness, prompt, cwd, holdPty);
|
|
34543
|
-
const claudeSessionId =
|
|
34616
|
+
const claudeSessionId = randomUUID18();
|
|
34544
34617
|
return {
|
|
34545
34618
|
...sessionBase(id, prompt ? "running" : "waiting"),
|
|
34546
34619
|
name: `Session ${id}`,
|
|
@@ -34605,12 +34678,12 @@ import { basename as basename22 } from "path";
|
|
|
34605
34678
|
|
|
34606
34679
|
// src/commands/sessions/daemon/worktree/deleteStrandedTree.ts
|
|
34607
34680
|
import { existsSync as existsSync86 } from "fs";
|
|
34608
|
-
import { join as
|
|
34681
|
+
import { join as join99 } from "path";
|
|
34609
34682
|
|
|
34610
34683
|
// src/commands/sessions/daemon/worktree/deleteTreeDirectly.ts
|
|
34611
34684
|
import { statSync as statSync14 } from "fs";
|
|
34612
34685
|
import { rm as rm4 } from "fs/promises";
|
|
34613
|
-
import { join as
|
|
34686
|
+
import { join as join98 } from "path";
|
|
34614
34687
|
async function deleteTreeDirectly(clone, worktreePath, why) {
|
|
34615
34688
|
if (holdsAGitDirectoryRatherThanALink(worktreePath)) {
|
|
34616
34689
|
const refusal = "it is a clone of its own, not a linked worktree";
|
|
@@ -34638,7 +34711,7 @@ async function deleteTreeDirectly(clone, worktreePath, why) {
|
|
|
34638
34711
|
return { removed: true };
|
|
34639
34712
|
}
|
|
34640
34713
|
function holdsAGitDirectoryRatherThanALink(worktreePath) {
|
|
34641
|
-
return statSync14(
|
|
34714
|
+
return statSync14(join98(worktreePath, ".git"), {
|
|
34642
34715
|
throwIfNoEntry: false
|
|
34643
34716
|
})?.isDirectory() === true;
|
|
34644
34717
|
}
|
|
@@ -34674,7 +34747,7 @@ async function deleteStrandedTree(clone, worktreePath, cause) {
|
|
|
34674
34747
|
);
|
|
34675
34748
|
}
|
|
34676
34749
|
function strandedReason(worktreePath, cause) {
|
|
34677
|
-
if (!existsSync86(
|
|
34750
|
+
if (!existsSync86(join99(worktreePath, ".git")))
|
|
34678
34751
|
return "its .git link is already gone";
|
|
34679
34752
|
if (/not a working tree|not a git repository/i.test(reason2(cause)))
|
|
34680
34753
|
return "git no longer recognises it as a working tree";
|
|
@@ -35140,7 +35213,8 @@ var PREVIEW_KINDS = [
|
|
|
35140
35213
|
"github-issue",
|
|
35141
35214
|
"github-issue-comment",
|
|
35142
35215
|
"github-issue-edit",
|
|
35143
|
-
"miro-board"
|
|
35216
|
+
"miro-board",
|
|
35217
|
+
"slack-post"
|
|
35144
35218
|
];
|
|
35145
35219
|
function isPreviewKind(value) {
|
|
35146
35220
|
return PREVIEW_KINDS.includes(value);
|
|
@@ -35164,6 +35238,7 @@ function previewTargetLabel(kind, itemType, prNumber, draft) {
|
|
|
35164
35238
|
if (kind === "github-issue-edit") return "github issue edit";
|
|
35165
35239
|
if (kind === "github-issue") return "github issue";
|
|
35166
35240
|
if (kind === "miro-board") return "miro anchors";
|
|
35241
|
+
if (kind === "slack-post") return "slack post";
|
|
35167
35242
|
if (kind === "backlog-item") return `backlog ${itemType}`;
|
|
35168
35243
|
if (prNumber !== null) return `edit #${prNumber}`;
|
|
35169
35244
|
return draft ? "create draft" : "create";
|
|
@@ -35433,7 +35508,7 @@ function handleFailedResume(session, exitCode, onStatusChange) {
|
|
|
35433
35508
|
}
|
|
35434
35509
|
|
|
35435
35510
|
// src/commands/sessions/daemon/watchActivity.ts
|
|
35436
|
-
import { existsSync as existsSync90, mkdirSync as
|
|
35511
|
+
import { existsSync as existsSync90, mkdirSync as mkdirSync34, watch as watch2 } from "fs";
|
|
35437
35512
|
import { dirname as dirname39 } from "path";
|
|
35438
35513
|
|
|
35439
35514
|
// src/commands/sessions/daemon/applyActivityToSession.ts
|
|
@@ -35498,7 +35573,7 @@ function watchActivity(session, notify2, onClaudeSessionId) {
|
|
|
35498
35573
|
const path90 = activityPath(session.id);
|
|
35499
35574
|
const dir = dirname39(path90);
|
|
35500
35575
|
try {
|
|
35501
|
-
|
|
35576
|
+
mkdirSync34(dir, { recursive: true });
|
|
35502
35577
|
} catch {
|
|
35503
35578
|
return;
|
|
35504
35579
|
}
|
|
@@ -35701,10 +35776,10 @@ function headContainsSessionId(filePath, claudeSessionId) {
|
|
|
35701
35776
|
}
|
|
35702
35777
|
|
|
35703
35778
|
// src/commands/sessions/daemon/ensureProjectDirExists.ts
|
|
35704
|
-
import { mkdirSync as
|
|
35779
|
+
import { mkdirSync as mkdirSync35 } from "fs";
|
|
35705
35780
|
function ensureProjectDirExists(dir, sessionId) {
|
|
35706
35781
|
try {
|
|
35707
|
-
|
|
35782
|
+
mkdirSync35(dir, { recursive: true });
|
|
35708
35783
|
return true;
|
|
35709
35784
|
} catch (error) {
|
|
35710
35785
|
daemonLog(
|
|
@@ -36653,7 +36728,7 @@ function codexRespawnPlan(session) {
|
|
|
36653
36728
|
}
|
|
36654
36729
|
|
|
36655
36730
|
// src/commands/sessions/daemon/interactiveRespawnPlan.ts
|
|
36656
|
-
import { randomUUID as
|
|
36731
|
+
import { randomUUID as randomUUID19 } from "crypto";
|
|
36657
36732
|
function interactiveRespawnPlan(session, resumes) {
|
|
36658
36733
|
const { claudeSessionId, cwd, initialPrompt, design, auto } = session;
|
|
36659
36734
|
if (!resumes) return null;
|
|
@@ -36673,7 +36748,7 @@ function interactiveRespawnPlan(session, resumes) {
|
|
|
36673
36748
|
return null;
|
|
36674
36749
|
}
|
|
36675
36750
|
function freshClaudePlan(session, prompt, cwd) {
|
|
36676
|
-
const claudeSessionId =
|
|
36751
|
+
const claudeSessionId = randomUUID19();
|
|
36677
36752
|
return {
|
|
36678
36753
|
spawn: () => {
|
|
36679
36754
|
session.claudeSessionId = claudeSessionId;
|
|
@@ -37558,10 +37633,10 @@ function startReusedRunPty(session, assistArgs, itemId2, hold, clients, onStatus
|
|
|
37558
37633
|
}
|
|
37559
37634
|
|
|
37560
37635
|
// src/commands/sessions/daemon/createWatcherSession.ts
|
|
37561
|
-
import { randomUUID as
|
|
37636
|
+
import { randomUUID as randomUUID20 } from "crypto";
|
|
37562
37637
|
var WATCH_PROMPT = "/watch";
|
|
37563
37638
|
function createWatcherSession(id, cwd) {
|
|
37564
|
-
const claudeSessionId =
|
|
37639
|
+
const claudeSessionId = randomUUID20();
|
|
37565
37640
|
return {
|
|
37566
37641
|
...sessionBase(id, "running"),
|
|
37567
37642
|
name: `Session ${id}`,
|
|
@@ -38785,8 +38860,8 @@ function resumeSession(id, sessionId, cwd, name, holdPty, harness) {
|
|
|
38785
38860
|
import { existsSync as existsSync96 } from "fs";
|
|
38786
38861
|
|
|
38787
38862
|
// src/commands/sessions/daemon/worktree/carryTranscriptToTree.ts
|
|
38788
|
-
import { copyFileSync as copyFileSync7, existsSync as existsSync95, mkdirSync as
|
|
38789
|
-
import { join as
|
|
38863
|
+
import { copyFileSync as copyFileSync7, existsSync as existsSync95, mkdirSync as mkdirSync36 } from "fs";
|
|
38864
|
+
import { join as join101 } from "path";
|
|
38790
38865
|
function carryTranscriptToTree(claudeSessionId, fromCwd, toCwd) {
|
|
38791
38866
|
const dir = projectDirForCwd(toCwd);
|
|
38792
38867
|
if (dir === projectDirForCwd(fromCwd)) {
|
|
@@ -38795,7 +38870,7 @@ function carryTranscriptToTree(claudeSessionId, fromCwd, toCwd) {
|
|
|
38795
38870
|
);
|
|
38796
38871
|
return;
|
|
38797
38872
|
}
|
|
38798
|
-
const dest =
|
|
38873
|
+
const dest = join101(dir, `${claudeSessionId}.jsonl`);
|
|
38799
38874
|
if (existsSync95(dest)) {
|
|
38800
38875
|
daemonLog(`transcript ${claudeSessionId} already present in ${dir}`);
|
|
38801
38876
|
return;
|
|
@@ -38808,7 +38883,7 @@ function carryTranscriptToTree(claudeSessionId, fromCwd, toCwd) {
|
|
|
38808
38883
|
return;
|
|
38809
38884
|
}
|
|
38810
38885
|
try {
|
|
38811
|
-
|
|
38886
|
+
mkdirSync36(dir, { recursive: true });
|
|
38812
38887
|
copyFileSync7(source, dest);
|
|
38813
38888
|
daemonLog(
|
|
38814
38889
|
`transcript ${source} copied to ${dest} so ${toCwd} can resume it`
|
|
@@ -39433,7 +39508,7 @@ function handleConnection(socket, manager) {
|
|
|
39433
39508
|
}
|
|
39434
39509
|
|
|
39435
39510
|
// src/commands/sessions/daemon/onListening.ts
|
|
39436
|
-
import { unlinkSync as unlinkSync23, writeFileSync as
|
|
39511
|
+
import { unlinkSync as unlinkSync23, writeFileSync as writeFileSync51 } from "fs";
|
|
39437
39512
|
|
|
39438
39513
|
// src/commands/sessions/daemon/startPidFileWatchdog.ts
|
|
39439
39514
|
import { readFileSync as readFileSync64 } from "fs";
|
|
@@ -39455,7 +39530,7 @@ function ownsPidFile() {
|
|
|
39455
39530
|
|
|
39456
39531
|
// src/commands/sessions/daemon/onListening.ts
|
|
39457
39532
|
function onListening(manager, checkAutoExit) {
|
|
39458
|
-
|
|
39533
|
+
writeFileSync51(daemonPaths.pid, String(process.pid));
|
|
39459
39534
|
startPidFileWatchdog(() => {
|
|
39460
39535
|
daemonLog("lost daemon.pid ownership; shutting down sessions and exiting");
|
|
39461
39536
|
void manager.flushActiveMs().finally(() => {
|
|
@@ -39642,7 +39717,7 @@ async function recoverFromAddrInUse(server, manager, checkAutoExit) {
|
|
|
39642
39717
|
|
|
39643
39718
|
// src/commands/sessions/daemon/runDaemon.ts
|
|
39644
39719
|
async function runDaemon() {
|
|
39645
|
-
|
|
39720
|
+
mkdirSync37(daemonPaths.dir, { recursive: true });
|
|
39646
39721
|
daemonLog(
|
|
39647
39722
|
`starting (reason: ${process.env.ASSIST_DAEMON_SPAWN_REASON ?? "manual"})`
|
|
39648
39723
|
);
|
|
@@ -39922,9 +39997,9 @@ function buildLimitsSegment(rateLimits) {
|
|
|
39922
39997
|
|
|
39923
39998
|
// src/commands/readGitBranch.ts
|
|
39924
39999
|
import { readFileSync as readFileSync66, statSync as statSync16 } from "fs";
|
|
39925
|
-
import { isAbsolute as isAbsolute5, join as
|
|
40000
|
+
import { isAbsolute as isAbsolute5, join as join102, resolve as resolve23 } from "path";
|
|
39926
40001
|
function resolveGitDir(cwd) {
|
|
39927
|
-
const dotGit =
|
|
40002
|
+
const dotGit = join102(cwd, ".git");
|
|
39928
40003
|
let stat4;
|
|
39929
40004
|
try {
|
|
39930
40005
|
stat4 = statSync16(dotGit);
|
|
@@ -39954,7 +40029,7 @@ function readGitBranch(cwd) {
|
|
|
39954
40029
|
}
|
|
39955
40030
|
let head;
|
|
39956
40031
|
try {
|
|
39957
|
-
head = readFileSync66(
|
|
40032
|
+
head = readFileSync66(join102(gitDir, "HEAD"), "utf8");
|
|
39958
40033
|
} catch {
|
|
39959
40034
|
return null;
|
|
39960
40035
|
}
|
|
@@ -40144,6 +40219,7 @@ registerNetcap(program);
|
|
|
40144
40219
|
registerCriteriaExtension(program);
|
|
40145
40220
|
registerRavendb(program);
|
|
40146
40221
|
registerSeq(program);
|
|
40222
|
+
registerSlack(program);
|
|
40147
40223
|
registerSql(program);
|
|
40148
40224
|
registerTranscript(program);
|
|
40149
40225
|
registerVoice(program);
|