@staff0rd/assist 0.1054.0 → 0.1056.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/dist/commands/sessions/web/bundle.js +420 -419
- package/dist/index.js +247 -218
- 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.1056.0",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -4277,6 +4277,110 @@ async function postItem(req, res) {
|
|
|
4277
4277
|
respondJson(res, 201, { id: formatItemId(id), name });
|
|
4278
4278
|
}
|
|
4279
4279
|
|
|
4280
|
+
// src/commands/backlog/web/postNoteDraft.ts
|
|
4281
|
+
import { z as z9 } from "zod";
|
|
4282
|
+
|
|
4283
|
+
// src/commands/sessions/daemon/readSocketLines.ts
|
|
4284
|
+
function readSocketLines(socket, onLine) {
|
|
4285
|
+
let buffer = "";
|
|
4286
|
+
socket.on("data", (chunk) => {
|
|
4287
|
+
buffer += chunk.toString("utf8");
|
|
4288
|
+
let newline = buffer.indexOf("\n");
|
|
4289
|
+
while (newline !== -1) {
|
|
4290
|
+
onLine(buffer.slice(0, newline));
|
|
4291
|
+
buffer = buffer.slice(newline + 1);
|
|
4292
|
+
newline = buffer.indexOf("\n");
|
|
4293
|
+
}
|
|
4294
|
+
});
|
|
4295
|
+
}
|
|
4296
|
+
|
|
4297
|
+
// src/commands/sessions/shared/requestSession.ts
|
|
4298
|
+
function parseIncoming(line, type) {
|
|
4299
|
+
try {
|
|
4300
|
+
const msg = JSON.parse(line);
|
|
4301
|
+
if (msg.type === "error" && (msg.message ?? "").includes(type))
|
|
4302
|
+
return { kind: "error", message: msg.message ?? `${type} failed` };
|
|
4303
|
+
if (msg.type !== "created" || !msg.sessionId) return null;
|
|
4304
|
+
return { kind: "created", sessionId: msg.sessionId };
|
|
4305
|
+
} catch {
|
|
4306
|
+
return null;
|
|
4307
|
+
}
|
|
4308
|
+
}
|
|
4309
|
+
function requestSession(message3) {
|
|
4310
|
+
return new Promise((resolve34, reject) => {
|
|
4311
|
+
connectToDaemon().then((socket) => {
|
|
4312
|
+
let settled = false;
|
|
4313
|
+
const finish2 = (error, sessionId2) => {
|
|
4314
|
+
if (settled) return;
|
|
4315
|
+
settled = true;
|
|
4316
|
+
socket.destroy();
|
|
4317
|
+
if (error) reject(error);
|
|
4318
|
+
else resolve34(sessionId2);
|
|
4319
|
+
};
|
|
4320
|
+
readSocketLines(socket, (line) => {
|
|
4321
|
+
const incoming = parseIncoming(line, message3.type);
|
|
4322
|
+
if (!incoming) return;
|
|
4323
|
+
if (incoming.kind === "error") finish2(new Error(incoming.message));
|
|
4324
|
+
else finish2(void 0, incoming.sessionId);
|
|
4325
|
+
});
|
|
4326
|
+
socket.on("error", (error) => finish2(error));
|
|
4327
|
+
socket.on(
|
|
4328
|
+
"close",
|
|
4329
|
+
() => finish2(new Error("daemon closed before the session was created"))
|
|
4330
|
+
);
|
|
4331
|
+
socket.write(`${JSON.stringify(message3)}
|
|
4332
|
+
`);
|
|
4333
|
+
}, reject);
|
|
4334
|
+
});
|
|
4335
|
+
}
|
|
4336
|
+
|
|
4337
|
+
// src/commands/sessions/shared/requestAssistSession.ts
|
|
4338
|
+
function requestAssistSession(assistArgs, cwd, options2) {
|
|
4339
|
+
return requestSession({
|
|
4340
|
+
type: "create-assist",
|
|
4341
|
+
assistArgs,
|
|
4342
|
+
cwd,
|
|
4343
|
+
inPlace: options2?.inPlace === true,
|
|
4344
|
+
launchedFrom: options2?.launchedFrom ?? process.env.ASSIST_SESSION_ID
|
|
4345
|
+
});
|
|
4346
|
+
}
|
|
4347
|
+
|
|
4348
|
+
// src/commands/sessions/web/getCwdParam.ts
|
|
4349
|
+
function getCwdParam(req, res) {
|
|
4350
|
+
const url = new URL(req.url ?? "/", "http://localhost");
|
|
4351
|
+
const cwd = url.searchParams.get("cwd");
|
|
4352
|
+
if (!cwd) {
|
|
4353
|
+
respondJson(res, 400, { error: "Missing cwd" });
|
|
4354
|
+
return null;
|
|
4355
|
+
}
|
|
4356
|
+
return cwd;
|
|
4357
|
+
}
|
|
4358
|
+
|
|
4359
|
+
// src/commands/backlog/web/postNoteDraft.ts
|
|
4360
|
+
var postNoteDraftSchema = z9.object({ text: z9.string().trim().min(1) });
|
|
4361
|
+
async function postNoteDraft(req, res) {
|
|
4362
|
+
const cwd = getCwdParam(req, res);
|
|
4363
|
+
if (!cwd) return;
|
|
4364
|
+
const parsed = postNoteDraftSchema.safeParse(
|
|
4365
|
+
await readJsonBody(req).catch(() => void 0)
|
|
4366
|
+
);
|
|
4367
|
+
if (!parsed.success) {
|
|
4368
|
+
respondJson(res, 400, { error: "Body must be { text: string }" });
|
|
4369
|
+
return;
|
|
4370
|
+
}
|
|
4371
|
+
try {
|
|
4372
|
+
const sessionId2 = await requestAssistSession(
|
|
4373
|
+
["draft", "--once", parsed.data.text],
|
|
4374
|
+
cwd
|
|
4375
|
+
);
|
|
4376
|
+
respondJson(res, 201, { sessionId: sessionId2 });
|
|
4377
|
+
} catch (error) {
|
|
4378
|
+
respondJson(res, 500, {
|
|
4379
|
+
error: error instanceof Error ? error.message : String(error)
|
|
4380
|
+
});
|
|
4381
|
+
}
|
|
4382
|
+
}
|
|
4383
|
+
|
|
4280
4384
|
// src/commands/backlog/updateStarred.ts
|
|
4281
4385
|
import { eq as eq16 } from "drizzle-orm";
|
|
4282
4386
|
async function updateStarred(orm, id, starred) {
|
|
@@ -4434,20 +4538,20 @@ async function browserRelay(req, res) {
|
|
|
4434
4538
|
}
|
|
4435
4539
|
|
|
4436
4540
|
// src/commands/sessions/web/clientErrors/clientErrorsSchema.ts
|
|
4437
|
-
import { z as
|
|
4438
|
-
var clientFailureSchema =
|
|
4439
|
-
at:
|
|
4440
|
-
kind:
|
|
4441
|
-
method:
|
|
4442
|
-
path:
|
|
4443
|
-
base:
|
|
4444
|
-
node:
|
|
4445
|
-
status:
|
|
4446
|
-
error:
|
|
4447
|
-
durationMs:
|
|
4541
|
+
import { z as z10 } from "zod";
|
|
4542
|
+
var clientFailureSchema = z10.object({
|
|
4543
|
+
at: z10.string(),
|
|
4544
|
+
kind: z10.enum(["error", "rejection", "caught"]).optional(),
|
|
4545
|
+
method: z10.string(),
|
|
4546
|
+
path: z10.string(),
|
|
4547
|
+
base: z10.string(),
|
|
4548
|
+
node: z10.string().optional(),
|
|
4549
|
+
status: z10.number().optional(),
|
|
4550
|
+
error: z10.string().optional(),
|
|
4551
|
+
durationMs: z10.number()
|
|
4448
4552
|
});
|
|
4449
|
-
var clientErrorsSchema =
|
|
4450
|
-
failures:
|
|
4553
|
+
var clientErrorsSchema = z10.object({
|
|
4554
|
+
failures: z10.array(clientFailureSchema).max(100)
|
|
4451
4555
|
});
|
|
4452
4556
|
|
|
4453
4557
|
// src/commands/sessions/web/clientErrors/clientErrors.ts
|
|
@@ -4581,17 +4685,6 @@ async function daemonLogTail(req, res) {
|
|
|
4581
4685
|
});
|
|
4582
4686
|
}
|
|
4583
4687
|
|
|
4584
|
-
// src/commands/sessions/web/getCwdParam.ts
|
|
4585
|
-
function getCwdParam(req, res) {
|
|
4586
|
-
const url = new URL(req.url ?? "/", "http://localhost");
|
|
4587
|
-
const cwd = url.searchParams.get("cwd");
|
|
4588
|
-
if (!cwd) {
|
|
4589
|
-
respondJson(res, 400, { error: "Missing cwd" });
|
|
4590
|
-
return null;
|
|
4591
|
-
}
|
|
4592
|
-
return cwd;
|
|
4593
|
-
}
|
|
4594
|
-
|
|
4595
4688
|
// src/commands/sessions/web/getSessionParam.ts
|
|
4596
4689
|
function getSessionParam(req) {
|
|
4597
4690
|
const url = new URL(req.url ?? "/", "http://localhost");
|
|
@@ -5154,13 +5247,13 @@ function docsFeedbackPrompt({
|
|
|
5154
5247
|
}
|
|
5155
5248
|
|
|
5156
5249
|
// src/commands/sessions/web/docsFeedback/docsFeedbackSchema.ts
|
|
5157
|
-
import { z as
|
|
5158
|
-
var docsFeedbackSchema =
|
|
5159
|
-
pageId:
|
|
5160
|
-
heading:
|
|
5161
|
-
source:
|
|
5162
|
-
selection:
|
|
5163
|
-
prompt:
|
|
5250
|
+
import { z as z11 } from "zod";
|
|
5251
|
+
var docsFeedbackSchema = z11.object({
|
|
5252
|
+
pageId: z11.string().min(1),
|
|
5253
|
+
heading: z11.string().min(1),
|
|
5254
|
+
source: z11.string().min(1),
|
|
5255
|
+
selection: z11.string().min(1),
|
|
5256
|
+
prompt: z11.string().trim().min(1)
|
|
5164
5257
|
});
|
|
5165
5258
|
|
|
5166
5259
|
// src/commands/sessions/web/docsFeedback/docsFeedback.ts
|
|
@@ -5276,71 +5369,6 @@ function getClones(req, res) {
|
|
|
5276
5369
|
});
|
|
5277
5370
|
}
|
|
5278
5371
|
|
|
5279
|
-
// src/commands/sessions/daemon/readSocketLines.ts
|
|
5280
|
-
function readSocketLines(socket, onLine) {
|
|
5281
|
-
let buffer = "";
|
|
5282
|
-
socket.on("data", (chunk) => {
|
|
5283
|
-
buffer += chunk.toString("utf8");
|
|
5284
|
-
let newline = buffer.indexOf("\n");
|
|
5285
|
-
while (newline !== -1) {
|
|
5286
|
-
onLine(buffer.slice(0, newline));
|
|
5287
|
-
buffer = buffer.slice(newline + 1);
|
|
5288
|
-
newline = buffer.indexOf("\n");
|
|
5289
|
-
}
|
|
5290
|
-
});
|
|
5291
|
-
}
|
|
5292
|
-
|
|
5293
|
-
// src/commands/sessions/shared/requestSession.ts
|
|
5294
|
-
function parseIncoming(line, type) {
|
|
5295
|
-
try {
|
|
5296
|
-
const msg = JSON.parse(line);
|
|
5297
|
-
if (msg.type === "error" && (msg.message ?? "").includes(type))
|
|
5298
|
-
return { kind: "error", message: msg.message ?? `${type} failed` };
|
|
5299
|
-
if (msg.type !== "created" || !msg.sessionId) return null;
|
|
5300
|
-
return { kind: "created", sessionId: msg.sessionId };
|
|
5301
|
-
} catch {
|
|
5302
|
-
return null;
|
|
5303
|
-
}
|
|
5304
|
-
}
|
|
5305
|
-
function requestSession(message3) {
|
|
5306
|
-
return new Promise((resolve34, reject) => {
|
|
5307
|
-
connectToDaemon().then((socket) => {
|
|
5308
|
-
let settled = false;
|
|
5309
|
-
const finish2 = (error, sessionId2) => {
|
|
5310
|
-
if (settled) return;
|
|
5311
|
-
settled = true;
|
|
5312
|
-
socket.destroy();
|
|
5313
|
-
if (error) reject(error);
|
|
5314
|
-
else resolve34(sessionId2);
|
|
5315
|
-
};
|
|
5316
|
-
readSocketLines(socket, (line) => {
|
|
5317
|
-
const incoming = parseIncoming(line, message3.type);
|
|
5318
|
-
if (!incoming) return;
|
|
5319
|
-
if (incoming.kind === "error") finish2(new Error(incoming.message));
|
|
5320
|
-
else finish2(void 0, incoming.sessionId);
|
|
5321
|
-
});
|
|
5322
|
-
socket.on("error", (error) => finish2(error));
|
|
5323
|
-
socket.on(
|
|
5324
|
-
"close",
|
|
5325
|
-
() => finish2(new Error("daemon closed before the session was created"))
|
|
5326
|
-
);
|
|
5327
|
-
socket.write(`${JSON.stringify(message3)}
|
|
5328
|
-
`);
|
|
5329
|
-
}, reject);
|
|
5330
|
-
});
|
|
5331
|
-
}
|
|
5332
|
-
|
|
5333
|
-
// src/commands/sessions/shared/requestAssistSession.ts
|
|
5334
|
-
function requestAssistSession(assistArgs, cwd, options2) {
|
|
5335
|
-
return requestSession({
|
|
5336
|
-
type: "create-assist",
|
|
5337
|
-
assistArgs,
|
|
5338
|
-
cwd,
|
|
5339
|
-
inPlace: options2?.inPlace === true,
|
|
5340
|
-
launchedFrom: options2?.launchedFrom ?? process.env.ASSIST_SESSION_ID
|
|
5341
|
-
});
|
|
5342
|
-
}
|
|
5343
|
-
|
|
5344
5372
|
// src/commands/sessions/web/fromGithub/launchFromGithub.ts
|
|
5345
5373
|
async function launchFromGithub(req, res, plan2, launch) {
|
|
5346
5374
|
allowExtensionOrigin(req, res);
|
|
@@ -10388,7 +10416,7 @@ async function failStaleJobRuns(db, { startedBefore, detail }) {
|
|
|
10388
10416
|
|
|
10389
10417
|
// src/commands/inbox/runInboxScanClaude.ts
|
|
10390
10418
|
import { spawn as spawn2 } from "child_process";
|
|
10391
|
-
import { z as
|
|
10419
|
+
import { z as z13 } from "zod";
|
|
10392
10420
|
|
|
10393
10421
|
// src/commands/review/attachLineParser.ts
|
|
10394
10422
|
function flushBuffer(buffer, onLine) {
|
|
@@ -10574,17 +10602,17 @@ function createScanUsageTracker() {
|
|
|
10574
10602
|
}
|
|
10575
10603
|
|
|
10576
10604
|
// src/commands/inbox/inboxScanSchema.ts
|
|
10577
|
-
import { z as
|
|
10578
|
-
var flaggedMessageSchema =
|
|
10579
|
-
source:
|
|
10580
|
-
messageId:
|
|
10581
|
-
sender:
|
|
10582
|
-
summary:
|
|
10583
|
-
link:
|
|
10584
|
-
receivedAt:
|
|
10605
|
+
import { z as z12 } from "zod";
|
|
10606
|
+
var flaggedMessageSchema = z12.object({
|
|
10607
|
+
source: z12.enum(["gmail", "slack"]),
|
|
10608
|
+
messageId: z12.string().min(1),
|
|
10609
|
+
sender: z12.string().min(1),
|
|
10610
|
+
summary: z12.string().min(1),
|
|
10611
|
+
link: z12.string().min(1),
|
|
10612
|
+
receivedAt: z12.string().optional()
|
|
10585
10613
|
});
|
|
10586
|
-
var inboxScanSchema =
|
|
10587
|
-
messages:
|
|
10614
|
+
var inboxScanSchema = z12.object({
|
|
10615
|
+
messages: z12.array(flaggedMessageSchema)
|
|
10588
10616
|
});
|
|
10589
10617
|
|
|
10590
10618
|
// src/commands/inbox/parseInboxScanOutput.ts
|
|
@@ -10713,7 +10741,7 @@ function buildInboxScanArgs(since) {
|
|
|
10713
10741
|
"stream-json",
|
|
10714
10742
|
"--verbose",
|
|
10715
10743
|
"--json-schema",
|
|
10716
|
-
JSON.stringify(
|
|
10744
|
+
JSON.stringify(z13.toJSONSchema(inboxScanSchema, { target: "draft-07" })),
|
|
10717
10745
|
"--",
|
|
10718
10746
|
buildInboxScanPrompt(since)
|
|
10719
10747
|
];
|
|
@@ -13528,6 +13556,7 @@ var routes2 = {
|
|
|
13528
13556
|
"GET /api/items": listItems,
|
|
13529
13557
|
"POST /api/items": postItem,
|
|
13530
13558
|
"GET /api/note-repos": getNoteRepos,
|
|
13559
|
+
"POST /api/note-draft": postNoteDraft,
|
|
13531
13560
|
"GET /api/backlog/summary": getBacklogSummary,
|
|
13532
13561
|
"GET /api/backlog/docs-refresh": getDocsRefresh,
|
|
13533
13562
|
"POST /api/backlog/docs-refresh": postDocsRefresh,
|
|
@@ -16314,12 +16343,12 @@ async function moveManualCheck(orm, item, fromIdx, checkIdx, toIdx) {
|
|
|
16314
16343
|
}
|
|
16315
16344
|
|
|
16316
16345
|
// src/commands/sessions/shared/askCheckInputSchema.ts
|
|
16317
|
-
import { z as
|
|
16318
|
-
var text17 =
|
|
16319
|
-
var askCheckInputSchema =
|
|
16346
|
+
import { z as z14 } from "zod";
|
|
16347
|
+
var text17 = z14.string().trim().min(1);
|
|
16348
|
+
var askCheckInputSchema = z14.object({
|
|
16320
16349
|
title: text17,
|
|
16321
|
-
steps:
|
|
16322
|
-
before:
|
|
16350
|
+
steps: z14.array(text17).min(1, "Give at least 1 step"),
|
|
16351
|
+
before: z14.array(text17).optional(),
|
|
16323
16352
|
changed: text17.optional()
|
|
16324
16353
|
});
|
|
16325
16354
|
var CHECK_RESULT_KEY = "result";
|
|
@@ -16653,23 +16682,23 @@ function rejectLongQuestions(questions) {
|
|
|
16653
16682
|
}
|
|
16654
16683
|
|
|
16655
16684
|
// src/commands/sessions/shared/askQuestionInputSchema.ts
|
|
16656
|
-
import { z as
|
|
16657
|
-
var askQuestionOptionSchema =
|
|
16658
|
-
label:
|
|
16659
|
-
description:
|
|
16660
|
-
preview:
|
|
16685
|
+
import { z as z15 } from "zod";
|
|
16686
|
+
var askQuestionOptionSchema = z15.object({
|
|
16687
|
+
label: z15.string().min(1),
|
|
16688
|
+
description: z15.string(),
|
|
16689
|
+
preview: z15.string().optional()
|
|
16661
16690
|
});
|
|
16662
|
-
var askQuestionSchema =
|
|
16663
|
-
question:
|
|
16664
|
-
header:
|
|
16665
|
-
multiSelect:
|
|
16666
|
-
options:
|
|
16691
|
+
var askQuestionSchema = z15.object({
|
|
16692
|
+
question: z15.string().min(1),
|
|
16693
|
+
header: z15.string().min(1),
|
|
16694
|
+
multiSelect: z15.boolean(),
|
|
16695
|
+
options: z15.array(askQuestionOptionSchema).min(2, "Each question needs at least 2 options").max(4, "Each question allows at most 4 options").refine(
|
|
16667
16696
|
(options2) => new Set(options2.map((option) => option.label)).size === options2.length,
|
|
16668
16697
|
"Option labels must be unique within a question"
|
|
16669
16698
|
)
|
|
16670
16699
|
});
|
|
16671
|
-
var askQuestionInputSchema =
|
|
16672
|
-
questions:
|
|
16700
|
+
var askQuestionInputSchema = z15.object({
|
|
16701
|
+
questions: z15.array(askQuestionSchema).min(1, "Ask at least 1 question").max(4, "Ask at most 4 questions").refine(
|
|
16673
16702
|
(questions) => new Set(questions.map((q) => q.question)).size === questions.length,
|
|
16674
16703
|
"Question texts must be unique"
|
|
16675
16704
|
)
|
|
@@ -18253,21 +18282,21 @@ async function list(options2) {
|
|
|
18253
18282
|
import chalk63 from "chalk";
|
|
18254
18283
|
|
|
18255
18284
|
// src/commands/backlog/propose/proposedItemSchema.ts
|
|
18256
|
-
import { z as
|
|
18257
|
-
var proposedPhaseSchema =
|
|
18258
|
-
name:
|
|
18285
|
+
import { z as z16 } from "zod";
|
|
18286
|
+
var proposedPhaseSchema = z16.strictObject({
|
|
18287
|
+
name: z16.string().trim().min(1, "phase name is required").refine(
|
|
18259
18288
|
(name) => name.toLowerCase() !== REVIEW_PHASE_NAME.toLowerCase(),
|
|
18260
18289
|
`"${REVIEW_PHASE_NAME}" is owned by the runner and appended to every plan automatically \u2014 remove this phase`
|
|
18261
18290
|
),
|
|
18262
|
-
tasks:
|
|
18263
|
-
manualChecks:
|
|
18291
|
+
tasks: z16.array(z16.string().trim().min(1)).min(1, "a phase needs at least one task"),
|
|
18292
|
+
manualChecks: z16.array(z16.string().trim().min(1)).default([])
|
|
18264
18293
|
});
|
|
18265
|
-
var proposedItemSchema =
|
|
18266
|
-
name:
|
|
18267
|
-
type:
|
|
18268
|
-
description:
|
|
18269
|
-
acceptanceCriteria:
|
|
18270
|
-
phases:
|
|
18294
|
+
var proposedItemSchema = z16.strictObject({
|
|
18295
|
+
name: z16.string().trim().min(1, "name is required"),
|
|
18296
|
+
type: z16.enum(["story", "bug"]),
|
|
18297
|
+
description: z16.string().optional(),
|
|
18298
|
+
acceptanceCriteria: z16.array(z16.string().trim().min(1)).default([]),
|
|
18299
|
+
phases: z16.array(proposedPhaseSchema).default([])
|
|
18271
18300
|
});
|
|
18272
18301
|
|
|
18273
18302
|
// src/commands/backlog/propose/readProposedItem.ts
|
|
@@ -19992,20 +20021,20 @@ async function persistPhaseSessionId(itemId2, phaseIdx, claudeSessionId) {
|
|
|
19992
20021
|
import { mkdirSync as mkdirSync14, readFileSync as readFileSync27, rmSync as rmSync4, writeFileSync as writeFileSync23 } from "fs";
|
|
19993
20022
|
import { homedir as homedir17 } from "os";
|
|
19994
20023
|
import { dirname as dirname28, join as join53 } from "path";
|
|
19995
|
-
import { z as
|
|
19996
|
-
var activitySchema =
|
|
19997
|
-
kind:
|
|
19998
|
-
harness:
|
|
19999
|
-
name:
|
|
20000
|
-
itemId:
|
|
20001
|
-
itemName:
|
|
20002
|
-
itemIds:
|
|
20003
|
-
phase:
|
|
20004
|
-
phaseName:
|
|
20005
|
-
totalPhases:
|
|
20006
|
-
claudeSessionId:
|
|
20007
|
-
watchState:
|
|
20008
|
-
startedAt:
|
|
20024
|
+
import { z as z17 } from "zod";
|
|
20025
|
+
var activitySchema = z17.object({
|
|
20026
|
+
kind: z17.enum(["command", "backlog"]),
|
|
20027
|
+
harness: z17.enum(["claude", "codex", "pi"]).optional(),
|
|
20028
|
+
name: z17.string().optional(),
|
|
20029
|
+
itemId: z17.number().optional(),
|
|
20030
|
+
itemName: z17.string().optional(),
|
|
20031
|
+
itemIds: z17.array(z17.number()).optional(),
|
|
20032
|
+
phase: z17.number().optional(),
|
|
20033
|
+
phaseName: z17.string().optional(),
|
|
20034
|
+
totalPhases: z17.number().optional(),
|
|
20035
|
+
claudeSessionId: z17.string().optional(),
|
|
20036
|
+
watchState: z17.enum(["waiting", "updating"]).optional(),
|
|
20037
|
+
startedAt: z17.number()
|
|
20009
20038
|
});
|
|
20010
20039
|
function activityPath(sessionId2) {
|
|
20011
20040
|
return join53(homedir17(), ".assist", "activity", `activity-${sessionId2}.json`);
|
|
@@ -21412,9 +21441,9 @@ function registerUpdateFieldCommand(cmd) {
|
|
|
21412
21441
|
import chalk109 from "chalk";
|
|
21413
21442
|
|
|
21414
21443
|
// src/commands/backlog/updatePlan/planUpdateSchema.ts
|
|
21415
|
-
import { z as
|
|
21416
|
-
var planUpdateSchema =
|
|
21417
|
-
phases:
|
|
21444
|
+
import { z as z18 } from "zod";
|
|
21445
|
+
var planUpdateSchema = z18.strictObject({
|
|
21446
|
+
phases: z18.array(proposedPhaseSchema).min(1, "a plan needs at least one phase")
|
|
21418
21447
|
});
|
|
21419
21448
|
|
|
21420
21449
|
// src/commands/backlog/updatePlan/readPlanUpdate.ts
|
|
@@ -26971,30 +27000,30 @@ import { dirname as dirname31, join as join72 } from "path";
|
|
|
26971
27000
|
import chalk163 from "chalk";
|
|
26972
27001
|
|
|
26973
27002
|
// src/commands/devlog/write/devEntryInputSchema.ts
|
|
26974
|
-
import { z as
|
|
26975
|
-
var oneLine =
|
|
26976
|
-
var isoDate =
|
|
27003
|
+
import { z as z19 } from "zod";
|
|
27004
|
+
var oneLine = z19.string().trim().min(1).refine((value) => !value.includes("\n"), "must be a single line");
|
|
27005
|
+
var isoDate = z19.string().regex(/^\d{4}-\d{2}-\d{2}$/, "must be a date like 2026-08-10");
|
|
26977
27006
|
var MAX_ITEM_LENGTH = 80;
|
|
26978
27007
|
var itemText = oneLine.refine(
|
|
26979
27008
|
(value) => value.length <= MAX_ITEM_LENGTH,
|
|
26980
27009
|
`must be a short changelog phrase (at most ${MAX_ITEM_LENGTH} characters)`
|
|
26981
27010
|
);
|
|
26982
|
-
var changeItems =
|
|
27011
|
+
var changeItems = z19.array(z19.object({ text: itemText, version: oneLine.optional() }).strict()).default([]);
|
|
26983
27012
|
function datesWithinWeek(week, dates) {
|
|
26984
27013
|
if (!isValidWeek(week)) return true;
|
|
26985
27014
|
const { start: start2, end } = isoWeekRange(week);
|
|
26986
27015
|
return start2 <= dates.first && dates.first <= dates.last && dates.last <= end;
|
|
26987
27016
|
}
|
|
26988
|
-
var devEntryInputSchema =
|
|
26989
|
-
week:
|
|
27017
|
+
var devEntryInputSchema = z19.object({
|
|
27018
|
+
week: z19.string().refine(isValidWeek, "must be an ISO week like 2026-W33"),
|
|
26990
27019
|
title: oneLine,
|
|
26991
|
-
dates:
|
|
26992
|
-
versions:
|
|
27020
|
+
dates: z19.object({ first: isoDate, last: isoDate }).strict(),
|
|
27021
|
+
versions: z19.object({ first: oneLine, last: oneLine }).strict().optional(),
|
|
26993
27022
|
aiGenerated: oneLine,
|
|
26994
27023
|
added: changeItems,
|
|
26995
27024
|
changed: changeItems,
|
|
26996
27025
|
fixed: changeItems,
|
|
26997
|
-
lede:
|
|
27026
|
+
lede: z19.string().trim().min(1)
|
|
26998
27027
|
}).strict().refine((entry) => datesWithinWeek(entry.week, entry.dates), {
|
|
26999
27028
|
message: "first and last must be in order and within the week",
|
|
27000
27029
|
path: ["dates"]
|
|
@@ -31423,39 +31452,39 @@ function stringOrUndefined(value) {
|
|
|
31423
31452
|
}
|
|
31424
31453
|
|
|
31425
31454
|
// src/commands/sessions/daemon/persistedSessionSchema.ts
|
|
31426
|
-
import { z as
|
|
31427
|
-
var persistedSessionSchema =
|
|
31428
|
-
id:
|
|
31429
|
-
name:
|
|
31430
|
-
title:
|
|
31431
|
-
generatedTitle:
|
|
31432
|
-
subtitle:
|
|
31433
|
-
commandType:
|
|
31434
|
-
harness:
|
|
31435
|
-
status:
|
|
31436
|
-
cwd:
|
|
31437
|
-
startedAt:
|
|
31438
|
-
runningMs:
|
|
31439
|
-
claudeSessionId:
|
|
31440
|
-
harnessSessionId:
|
|
31441
|
-
initialPrompt:
|
|
31442
|
-
runName:
|
|
31443
|
-
runArgs:
|
|
31444
|
-
assistArgs:
|
|
31455
|
+
import { z as z20 } from "zod";
|
|
31456
|
+
var persistedSessionSchema = z20.object({
|
|
31457
|
+
id: z20.string().optional(),
|
|
31458
|
+
name: z20.string(),
|
|
31459
|
+
title: z20.string().optional(),
|
|
31460
|
+
generatedTitle: z20.string().optional(),
|
|
31461
|
+
subtitle: z20.string().optional(),
|
|
31462
|
+
commandType: z20.enum(["claude", "run", "assist"]),
|
|
31463
|
+
harness: z20.enum(["claude", "codex", "pi"]).optional(),
|
|
31464
|
+
status: z20.enum(["running", "waiting", "done", "error", "stopped"]).optional(),
|
|
31465
|
+
cwd: z20.string(),
|
|
31466
|
+
startedAt: z20.number(),
|
|
31467
|
+
runningMs: z20.number().optional(),
|
|
31468
|
+
claudeSessionId: z20.string().optional(),
|
|
31469
|
+
harnessSessionId: z20.string().optional(),
|
|
31470
|
+
initialPrompt: z20.string().optional(),
|
|
31471
|
+
runName: z20.string().optional(),
|
|
31472
|
+
runArgs: z20.array(z20.string()).optional(),
|
|
31473
|
+
assistArgs: z20.array(z20.string()).optional(),
|
|
31445
31474
|
activity: activitySchema.optional(),
|
|
31446
|
-
starred:
|
|
31447
|
-
watcher:
|
|
31448
|
-
divergenceEscalation:
|
|
31449
|
-
design:
|
|
31450
|
-
auto:
|
|
31451
|
-
autoAdvance:
|
|
31452
|
-
autoApprove:
|
|
31453
|
-
reviewStarted:
|
|
31454
|
-
launchedFrom:
|
|
31455
|
-
pendingPrompts:
|
|
31456
|
-
interrupted:
|
|
31457
|
-
awaitingSeed:
|
|
31458
|
-
undurable:
|
|
31475
|
+
starred: z20.boolean().optional(),
|
|
31476
|
+
watcher: z20.boolean().optional(),
|
|
31477
|
+
divergenceEscalation: z20.boolean().optional(),
|
|
31478
|
+
design: z20.boolean().optional(),
|
|
31479
|
+
auto: z20.boolean().optional(),
|
|
31480
|
+
autoAdvance: z20.boolean().optional(),
|
|
31481
|
+
autoApprove: z20.boolean().optional(),
|
|
31482
|
+
reviewStarted: z20.boolean().optional(),
|
|
31483
|
+
launchedFrom: z20.string().optional(),
|
|
31484
|
+
pendingPrompts: z20.array(z20.string()).optional(),
|
|
31485
|
+
interrupted: z20.object({ reason: z20.string(), at: z20.number() }).optional(),
|
|
31486
|
+
awaitingSeed: z20.boolean().optional(),
|
|
31487
|
+
undurable: z20.object({ reason: z20.string(), removesTree: z20.boolean().optional() }).optional()
|
|
31459
31488
|
});
|
|
31460
31489
|
|
|
31461
31490
|
// src/commands/sessions/daemon/toPersistedSession.ts
|
|
@@ -40753,21 +40782,21 @@ function readJsonFile(path109) {
|
|
|
40753
40782
|
}
|
|
40754
40783
|
|
|
40755
40784
|
// src/commands/review/highLevel/parseHighLevelSlicesInput.ts
|
|
40756
|
-
import { z as
|
|
40757
|
-
var slicesSchema =
|
|
40758
|
-
|
|
40759
|
-
title:
|
|
40760
|
-
summary:
|
|
40761
|
-
hunks:
|
|
40785
|
+
import { z as z21 } from "zod";
|
|
40786
|
+
var slicesSchema = z21.array(
|
|
40787
|
+
z21.object({
|
|
40788
|
+
title: z21.string().min(1),
|
|
40789
|
+
summary: z21.string(),
|
|
40790
|
+
hunks: z21.array(z21.string())
|
|
40762
40791
|
})
|
|
40763
40792
|
);
|
|
40764
|
-
var manualTestingSchema =
|
|
40765
|
-
setup:
|
|
40766
|
-
steps:
|
|
40793
|
+
var manualTestingSchema = z21.object({
|
|
40794
|
+
setup: z21.array(z21.string()),
|
|
40795
|
+
steps: z21.array(z21.object({ action: z21.string(), expect: z21.string() }))
|
|
40767
40796
|
});
|
|
40768
|
-
var slicesInputSchema =
|
|
40797
|
+
var slicesInputSchema = z21.union([
|
|
40769
40798
|
slicesSchema.transform((slices) => ({ slices })),
|
|
40770
|
-
|
|
40799
|
+
z21.object({ slices: slicesSchema, manualTesting: manualTestingSchema })
|
|
40771
40800
|
]);
|
|
40772
40801
|
function parseHighLevelSlicesInput(raw) {
|
|
40773
40802
|
const parsed = slicesInputSchema.safeParse(raw);
|
|
@@ -46410,16 +46439,16 @@ function selectPassages(sources, selection) {
|
|
|
46410
46439
|
}
|
|
46411
46440
|
|
|
46412
46441
|
// src/commands/transcript/selectionSchema.ts
|
|
46413
|
-
import { z as
|
|
46414
|
-
var selectionSchema =
|
|
46415
|
-
keep:
|
|
46416
|
-
|
|
46417
|
-
file:
|
|
46418
|
-
from:
|
|
46419
|
-
to:
|
|
46442
|
+
import { z as z22 } from "zod";
|
|
46443
|
+
var selectionSchema = z22.strictObject({
|
|
46444
|
+
keep: z22.array(
|
|
46445
|
+
z22.strictObject({
|
|
46446
|
+
file: z22.string().trim().min(1, "file is required"),
|
|
46447
|
+
from: z22.string().trim().min(1, "from is required"),
|
|
46448
|
+
to: z22.string().trim().min(1, "to is required")
|
|
46420
46449
|
})
|
|
46421
46450
|
).min(1, "a selection needs at least one keep range"),
|
|
46422
|
-
removed:
|
|
46451
|
+
removed: z22.array(z22.string().trim().min(1)).default([])
|
|
46423
46452
|
});
|
|
46424
46453
|
|
|
46425
46454
|
// src/commands/transcript/widenAudienceInText.ts
|
|
@@ -49257,9 +49286,9 @@ async function refreshRepoConfigCacheOnStart() {
|
|
|
49257
49286
|
}
|
|
49258
49287
|
|
|
49259
49288
|
// src/commands/sessions/daemon/loadActiveSelection.ts
|
|
49260
|
-
import { z as
|
|
49289
|
+
import { z as z23 } from "zod";
|
|
49261
49290
|
var ACTIVE_FILE = "active.json";
|
|
49262
|
-
var activeSelectionSchema =
|
|
49291
|
+
var activeSelectionSchema = z23.record(z23.string(), z23.string());
|
|
49263
49292
|
function loadActiveSelection() {
|
|
49264
49293
|
const parsed = activeSelectionSchema.safeParse(
|
|
49265
49294
|
loadJson(ACTIVE_FILE)
|
|
@@ -51983,9 +52012,9 @@ function buildPrompt5(prompt) {
|
|
|
51983
52012
|
}
|
|
51984
52013
|
|
|
51985
52014
|
// src/commands/sessions/shared/loadSessionTitles.ts
|
|
51986
|
-
import { z as
|
|
52015
|
+
import { z as z24 } from "zod";
|
|
51987
52016
|
var TITLES_FILE = "session-titles.json";
|
|
51988
|
-
var sessionTitlesSchema =
|
|
52017
|
+
var sessionTitlesSchema = z24.record(z24.string(), z24.string());
|
|
51989
52018
|
function loadSessionTitles() {
|
|
51990
52019
|
const parsed = sessionTitlesSchema.safeParse(
|
|
51991
52020
|
loadJson(TITLES_FILE)
|