@staff0rd/assist 0.974.2 → 0.976.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/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.976.0",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -4232,6 +4232,47 @@ async function browserRelay(req, res) {
|
|
|
4232
4232
|
}
|
|
4233
4233
|
}
|
|
4234
4234
|
|
|
4235
|
+
// src/commands/sessions/web/clientErrors/clientErrorsSchema.ts
|
|
4236
|
+
import { z as z8 } from "zod";
|
|
4237
|
+
var clientFailureSchema = z8.object({
|
|
4238
|
+
at: z8.string(),
|
|
4239
|
+
kind: z8.enum(["error", "rejection"]).optional(),
|
|
4240
|
+
method: z8.string(),
|
|
4241
|
+
path: z8.string(),
|
|
4242
|
+
base: z8.string(),
|
|
4243
|
+
node: z8.string().optional(),
|
|
4244
|
+
status: z8.number().optional(),
|
|
4245
|
+
error: z8.string().optional(),
|
|
4246
|
+
durationMs: z8.number()
|
|
4247
|
+
});
|
|
4248
|
+
var clientErrorsSchema = z8.object({
|
|
4249
|
+
failures: z8.array(clientFailureSchema).max(100)
|
|
4250
|
+
});
|
|
4251
|
+
|
|
4252
|
+
// src/commands/sessions/web/clientErrors/clientErrors.ts
|
|
4253
|
+
function formatClientFailure(failure) {
|
|
4254
|
+
if (failure.kind)
|
|
4255
|
+
return `client: ${failure.kind === "error" ? "uncaught error" : "unhandled rejection"} on ${failure.path}: ${failure.error ?? "unknown error"} at ${failure.at}`;
|
|
4256
|
+
const target = failure.node ? `node=${failure.node} via ${failure.base}` : failure.base;
|
|
4257
|
+
const outcome = [
|
|
4258
|
+
failure.status === void 0 ? void 0 : `HTTP ${failure.status}`,
|
|
4259
|
+
failure.error
|
|
4260
|
+
].filter(Boolean).join(" ");
|
|
4261
|
+
return `client: ${failure.method} ${failure.path} -> ${target} failed: ${outcome || "unknown error"} (${failure.durationMs}ms) at ${failure.at}`;
|
|
4262
|
+
}
|
|
4263
|
+
async function clientErrors(req, res) {
|
|
4264
|
+
const parsed = clientErrorsSchema.safeParse(
|
|
4265
|
+
await readJsonBody(req).catch(() => void 0)
|
|
4266
|
+
);
|
|
4267
|
+
if (!parsed.success) {
|
|
4268
|
+
respondJson(res, 400, { error: "Invalid client errors body" });
|
|
4269
|
+
return;
|
|
4270
|
+
}
|
|
4271
|
+
for (const failure of parsed.data.failures)
|
|
4272
|
+
console.log(formatClientFailure(failure));
|
|
4273
|
+
respondJson(res, 200, { received: parsed.data.failures.length });
|
|
4274
|
+
}
|
|
4275
|
+
|
|
4235
4276
|
// src/commands/sessions/shared/readLogTail.ts
|
|
4236
4277
|
import { closeSync as closeSync2, fstatSync, openSync as openSync2, readSync } from "fs";
|
|
4237
4278
|
var MAX_TAIL_BYTES = 4 * 1024 * 1024;
|
|
@@ -4719,13 +4760,13 @@ function docsFeedbackPrompt({
|
|
|
4719
4760
|
}
|
|
4720
4761
|
|
|
4721
4762
|
// src/commands/sessions/web/docsFeedback/docsFeedbackSchema.ts
|
|
4722
|
-
import { z as
|
|
4723
|
-
var docsFeedbackSchema =
|
|
4724
|
-
pageId:
|
|
4725
|
-
heading:
|
|
4726
|
-
source:
|
|
4727
|
-
selection:
|
|
4728
|
-
prompt:
|
|
4763
|
+
import { z as z9 } from "zod";
|
|
4764
|
+
var docsFeedbackSchema = z9.object({
|
|
4765
|
+
pageId: z9.string().min(1),
|
|
4766
|
+
heading: z9.string().min(1),
|
|
4767
|
+
source: z9.string().min(1),
|
|
4768
|
+
selection: z9.string().min(1),
|
|
4769
|
+
prompt: z9.string().trim().min(1)
|
|
4729
4770
|
});
|
|
4730
4771
|
|
|
4731
4772
|
// src/commands/sessions/web/docsFeedback/docsFeedback.ts
|
|
@@ -12527,6 +12568,7 @@ var routes2 = {
|
|
|
12527
12568
|
"POST /api/sessions/docs-feedback": docsFeedback,
|
|
12528
12569
|
"OPTIONS /api/sessions/docs-feedback": sessionFromGithubPreflight,
|
|
12529
12570
|
"POST /api/browser": browserRelay,
|
|
12571
|
+
"POST /api/client-errors": clientErrors,
|
|
12530
12572
|
"POST /api/open-in-code": openInCode,
|
|
12531
12573
|
"POST /api/pr-preview/upload-image": uploadPrImage,
|
|
12532
12574
|
"GET /api/pr-preview/image": previewImage,
|
|
@@ -15290,23 +15332,23 @@ ${issues}`);
|
|
|
15290
15332
|
}
|
|
15291
15333
|
|
|
15292
15334
|
// src/commands/sessions/shared/askQuestionInputSchema.ts
|
|
15293
|
-
import { z as
|
|
15294
|
-
var askQuestionOptionSchema =
|
|
15295
|
-
label:
|
|
15296
|
-
description:
|
|
15297
|
-
preview:
|
|
15335
|
+
import { z as z10 } from "zod";
|
|
15336
|
+
var askQuestionOptionSchema = z10.object({
|
|
15337
|
+
label: z10.string().min(1),
|
|
15338
|
+
description: z10.string(),
|
|
15339
|
+
preview: z10.string().optional()
|
|
15298
15340
|
});
|
|
15299
|
-
var askQuestionSchema =
|
|
15300
|
-
question:
|
|
15301
|
-
header:
|
|
15302
|
-
multiSelect:
|
|
15303
|
-
options:
|
|
15341
|
+
var askQuestionSchema = z10.object({
|
|
15342
|
+
question: z10.string().min(1),
|
|
15343
|
+
header: z10.string().min(1),
|
|
15344
|
+
multiSelect: z10.boolean(),
|
|
15345
|
+
options: z10.array(askQuestionOptionSchema).min(2, "Each question needs at least 2 options").max(4, "Each question allows at most 4 options").refine(
|
|
15304
15346
|
(options2) => new Set(options2.map((option) => option.label)).size === options2.length,
|
|
15305
15347
|
"Option labels must be unique within a question"
|
|
15306
15348
|
)
|
|
15307
15349
|
});
|
|
15308
|
-
var askQuestionInputSchema =
|
|
15309
|
-
questions:
|
|
15350
|
+
var askQuestionInputSchema = z10.object({
|
|
15351
|
+
questions: z10.array(askQuestionSchema).min(1, "Ask at least 1 question").max(4, "Ask at most 4 questions").refine(
|
|
15310
15352
|
(questions) => new Set(questions.map((q) => q.question)).size === questions.length,
|
|
15311
15353
|
"Question texts must be unique"
|
|
15312
15354
|
)
|
|
@@ -16951,21 +16993,21 @@ async function list(options2) {
|
|
|
16951
16993
|
import chalk62 from "chalk";
|
|
16952
16994
|
|
|
16953
16995
|
// src/commands/backlog/propose/proposedItemSchema.ts
|
|
16954
|
-
import { z as
|
|
16955
|
-
var proposedPhaseSchema =
|
|
16956
|
-
name:
|
|
16996
|
+
import { z as z11 } from "zod";
|
|
16997
|
+
var proposedPhaseSchema = z11.strictObject({
|
|
16998
|
+
name: z11.string().trim().min(1, "phase name is required").refine(
|
|
16957
16999
|
(name) => name.toLowerCase() !== REVIEW_PHASE_NAME.toLowerCase(),
|
|
16958
17000
|
`"${REVIEW_PHASE_NAME}" is owned by the runner and appended to every plan automatically \u2014 remove this phase`
|
|
16959
17001
|
),
|
|
16960
|
-
tasks:
|
|
16961
|
-
manualChecks:
|
|
17002
|
+
tasks: z11.array(z11.string().trim().min(1)).min(1, "a phase needs at least one task"),
|
|
17003
|
+
manualChecks: z11.array(z11.string().trim().min(1)).default([])
|
|
16962
17004
|
});
|
|
16963
|
-
var proposedItemSchema =
|
|
16964
|
-
name:
|
|
16965
|
-
type:
|
|
16966
|
-
description:
|
|
16967
|
-
acceptanceCriteria:
|
|
16968
|
-
phases:
|
|
17005
|
+
var proposedItemSchema = z11.strictObject({
|
|
17006
|
+
name: z11.string().trim().min(1, "name is required"),
|
|
17007
|
+
type: z11.enum(["story", "bug"]),
|
|
17008
|
+
description: z11.string().optional(),
|
|
17009
|
+
acceptanceCriteria: z11.array(z11.string().trim().min(1)).default([]),
|
|
17010
|
+
phases: z11.array(proposedPhaseSchema).default([])
|
|
16969
17011
|
});
|
|
16970
17012
|
|
|
16971
17013
|
// src/commands/backlog/propose/readProposedItem.ts
|
|
@@ -18465,19 +18507,19 @@ async function persistPhaseSessionId(itemId2, phaseIdx, claudeSessionId) {
|
|
|
18465
18507
|
import { mkdirSync as mkdirSync13, readFileSync as readFileSync26, rmSync as rmSync4, writeFileSync as writeFileSync22 } from "fs";
|
|
18466
18508
|
import { homedir as homedir16 } from "os";
|
|
18467
18509
|
import { dirname as dirname26, join as join48 } from "path";
|
|
18468
|
-
import { z as
|
|
18469
|
-
var activitySchema =
|
|
18470
|
-
kind:
|
|
18471
|
-
harness:
|
|
18472
|
-
name:
|
|
18473
|
-
itemId:
|
|
18474
|
-
itemName:
|
|
18475
|
-
phase:
|
|
18476
|
-
phaseName:
|
|
18477
|
-
totalPhases:
|
|
18478
|
-
claudeSessionId:
|
|
18479
|
-
watchState:
|
|
18480
|
-
startedAt:
|
|
18510
|
+
import { z as z12 } from "zod";
|
|
18511
|
+
var activitySchema = z12.object({
|
|
18512
|
+
kind: z12.enum(["command", "backlog"]),
|
|
18513
|
+
harness: z12.enum(["claude", "codex", "pi"]).optional(),
|
|
18514
|
+
name: z12.string().optional(),
|
|
18515
|
+
itemId: z12.number().optional(),
|
|
18516
|
+
itemName: z12.string().optional(),
|
|
18517
|
+
phase: z12.number().optional(),
|
|
18518
|
+
phaseName: z12.string().optional(),
|
|
18519
|
+
totalPhases: z12.number().optional(),
|
|
18520
|
+
claudeSessionId: z12.string().optional(),
|
|
18521
|
+
watchState: z12.enum(["waiting", "updating"]).optional(),
|
|
18522
|
+
startedAt: z12.number()
|
|
18481
18523
|
});
|
|
18482
18524
|
function activityPath(sessionId) {
|
|
18483
18525
|
return join48(homedir16(), ".assist", "activity", `activity-${sessionId}.json`);
|
|
@@ -19843,9 +19885,9 @@ function registerUpdateFieldCommand(cmd) {
|
|
|
19843
19885
|
import chalk107 from "chalk";
|
|
19844
19886
|
|
|
19845
19887
|
// src/commands/backlog/updatePlan/planUpdateSchema.ts
|
|
19846
|
-
import { z as
|
|
19847
|
-
var planUpdateSchema =
|
|
19848
|
-
phases:
|
|
19888
|
+
import { z as z13 } from "zod";
|
|
19889
|
+
var planUpdateSchema = z13.strictObject({
|
|
19890
|
+
phases: z13.array(proposedPhaseSchema).min(1, "a plan needs at least one phase")
|
|
19849
19891
|
});
|
|
19850
19892
|
|
|
19851
19893
|
// src/commands/backlog/updatePlan/readPlanUpdate.ts
|
|
@@ -28683,7 +28725,7 @@ async function writeInboxLastScan(orm, at2) {
|
|
|
28683
28725
|
// src/commands/inbox/runInboxScanClaude.ts
|
|
28684
28726
|
import { execFile as execFile12 } from "child_process";
|
|
28685
28727
|
import { promisify as promisify12 } from "util";
|
|
28686
|
-
import { z as
|
|
28728
|
+
import { z as z15 } from "zod";
|
|
28687
28729
|
|
|
28688
28730
|
// src/commands/inbox/buildInboxScanPrompt.ts
|
|
28689
28731
|
function buildInboxScanPrompt(since) {
|
|
@@ -28719,17 +28761,17 @@ function buildInboxScanPrompt(since) {
|
|
|
28719
28761
|
}
|
|
28720
28762
|
|
|
28721
28763
|
// src/commands/inbox/inboxScanSchema.ts
|
|
28722
|
-
import { z as
|
|
28723
|
-
var flaggedMessageSchema =
|
|
28724
|
-
source:
|
|
28725
|
-
messageId:
|
|
28726
|
-
sender:
|
|
28727
|
-
summary:
|
|
28728
|
-
link:
|
|
28729
|
-
receivedAt:
|
|
28764
|
+
import { z as z14 } from "zod";
|
|
28765
|
+
var flaggedMessageSchema = z14.object({
|
|
28766
|
+
source: z14.enum(["gmail", "slack"]),
|
|
28767
|
+
messageId: z14.string().min(1),
|
|
28768
|
+
sender: z14.string().min(1),
|
|
28769
|
+
summary: z14.string().min(1),
|
|
28770
|
+
link: z14.string().min(1),
|
|
28771
|
+
receivedAt: z14.string().optional()
|
|
28730
28772
|
});
|
|
28731
|
-
var inboxScanSchema =
|
|
28732
|
-
messages:
|
|
28773
|
+
var inboxScanSchema = z14.object({
|
|
28774
|
+
messages: z14.array(flaggedMessageSchema)
|
|
28733
28775
|
});
|
|
28734
28776
|
|
|
28735
28777
|
// src/commands/inbox/inboxScanTools.ts
|
|
@@ -28798,7 +28840,7 @@ function buildInboxScanArgs(since) {
|
|
|
28798
28840
|
"--output-format",
|
|
28799
28841
|
"json",
|
|
28800
28842
|
"--json-schema",
|
|
28801
|
-
JSON.stringify(
|
|
28843
|
+
JSON.stringify(z15.toJSONSchema(inboxScanSchema, { target: "draft-07" })),
|
|
28802
28844
|
"--",
|
|
28803
28845
|
buildInboxScanPrompt(since)
|
|
28804
28846
|
];
|
|
@@ -29249,39 +29291,39 @@ function stringOrUndefined(value) {
|
|
|
29249
29291
|
}
|
|
29250
29292
|
|
|
29251
29293
|
// src/commands/sessions/daemon/persistedSessionSchema.ts
|
|
29252
|
-
import { z as
|
|
29253
|
-
var persistedSessionSchema =
|
|
29254
|
-
id:
|
|
29255
|
-
name:
|
|
29256
|
-
title:
|
|
29257
|
-
generatedTitle:
|
|
29258
|
-
subtitle:
|
|
29259
|
-
commandType:
|
|
29260
|
-
harness:
|
|
29261
|
-
status:
|
|
29262
|
-
cwd:
|
|
29263
|
-
startedAt:
|
|
29264
|
-
runningMs:
|
|
29265
|
-
claudeSessionId:
|
|
29266
|
-
harnessSessionId:
|
|
29267
|
-
initialPrompt:
|
|
29268
|
-
runName:
|
|
29269
|
-
runArgs:
|
|
29270
|
-
assistArgs:
|
|
29294
|
+
import { z as z16 } from "zod";
|
|
29295
|
+
var persistedSessionSchema = z16.object({
|
|
29296
|
+
id: z16.string().optional(),
|
|
29297
|
+
name: z16.string(),
|
|
29298
|
+
title: z16.string().optional(),
|
|
29299
|
+
generatedTitle: z16.string().optional(),
|
|
29300
|
+
subtitle: z16.string().optional(),
|
|
29301
|
+
commandType: z16.enum(["claude", "run", "assist"]),
|
|
29302
|
+
harness: z16.enum(["claude", "codex", "pi"]).optional(),
|
|
29303
|
+
status: z16.enum(["running", "waiting", "done", "error", "stopped"]).optional(),
|
|
29304
|
+
cwd: z16.string(),
|
|
29305
|
+
startedAt: z16.number(),
|
|
29306
|
+
runningMs: z16.number().optional(),
|
|
29307
|
+
claudeSessionId: z16.string().optional(),
|
|
29308
|
+
harnessSessionId: z16.string().optional(),
|
|
29309
|
+
initialPrompt: z16.string().optional(),
|
|
29310
|
+
runName: z16.string().optional(),
|
|
29311
|
+
runArgs: z16.array(z16.string()).optional(),
|
|
29312
|
+
assistArgs: z16.array(z16.string()).optional(),
|
|
29271
29313
|
activity: activitySchema.optional(),
|
|
29272
|
-
starred:
|
|
29273
|
-
watcher:
|
|
29274
|
-
divergenceEscalation:
|
|
29275
|
-
design:
|
|
29276
|
-
auto:
|
|
29277
|
-
autoAdvance:
|
|
29278
|
-
autoApprove:
|
|
29279
|
-
reviewStarted:
|
|
29280
|
-
launchedFrom:
|
|
29281
|
-
pendingPrompts:
|
|
29282
|
-
interrupted:
|
|
29283
|
-
awaitingSeed:
|
|
29284
|
-
undurable:
|
|
29314
|
+
starred: z16.boolean().optional(),
|
|
29315
|
+
watcher: z16.boolean().optional(),
|
|
29316
|
+
divergenceEscalation: z16.boolean().optional(),
|
|
29317
|
+
design: z16.boolean().optional(),
|
|
29318
|
+
auto: z16.boolean().optional(),
|
|
29319
|
+
autoAdvance: z16.boolean().optional(),
|
|
29320
|
+
autoApprove: z16.boolean().optional(),
|
|
29321
|
+
reviewStarted: z16.boolean().optional(),
|
|
29322
|
+
launchedFrom: z16.string().optional(),
|
|
29323
|
+
pendingPrompts: z16.array(z16.string()).optional(),
|
|
29324
|
+
interrupted: z16.object({ reason: z16.string(), at: z16.number() }).optional(),
|
|
29325
|
+
awaitingSeed: z16.boolean().optional(),
|
|
29326
|
+
undurable: z16.object({ reason: z16.string(), removesTree: z16.boolean().optional() }).optional()
|
|
29285
29327
|
});
|
|
29286
29328
|
|
|
29287
29329
|
// src/commands/sessions/daemon/toPersistedSession.ts
|
|
@@ -43838,16 +43880,16 @@ function selectPassages(sources, selection) {
|
|
|
43838
43880
|
}
|
|
43839
43881
|
|
|
43840
43882
|
// src/commands/transcript/selectionSchema.ts
|
|
43841
|
-
import { z as
|
|
43842
|
-
var selectionSchema =
|
|
43843
|
-
keep:
|
|
43844
|
-
|
|
43845
|
-
file:
|
|
43846
|
-
from:
|
|
43847
|
-
to:
|
|
43883
|
+
import { z as z17 } from "zod";
|
|
43884
|
+
var selectionSchema = z17.strictObject({
|
|
43885
|
+
keep: z17.array(
|
|
43886
|
+
z17.strictObject({
|
|
43887
|
+
file: z17.string().trim().min(1, "file is required"),
|
|
43888
|
+
from: z17.string().trim().min(1, "from is required"),
|
|
43889
|
+
to: z17.string().trim().min(1, "to is required")
|
|
43848
43890
|
})
|
|
43849
43891
|
).min(1, "a selection needs at least one keep range"),
|
|
43850
|
-
removed:
|
|
43892
|
+
removed: z17.array(z17.string().trim().min(1)).default([])
|
|
43851
43893
|
});
|
|
43852
43894
|
|
|
43853
43895
|
// src/commands/transcript/widenAudienceInText.ts
|
|
@@ -46485,9 +46527,9 @@ async function refreshRepoConfigCacheOnStart() {
|
|
|
46485
46527
|
}
|
|
46486
46528
|
|
|
46487
46529
|
// src/commands/sessions/daemon/loadActiveSelection.ts
|
|
46488
|
-
import { z as
|
|
46530
|
+
import { z as z18 } from "zod";
|
|
46489
46531
|
var ACTIVE_FILE = "active.json";
|
|
46490
|
-
var activeSelectionSchema =
|
|
46532
|
+
var activeSelectionSchema = z18.record(z18.string(), z18.string());
|
|
46491
46533
|
function loadActiveSelection() {
|
|
46492
46534
|
const parsed = activeSelectionSchema.safeParse(
|
|
46493
46535
|
loadJson(ACTIVE_FILE)
|
|
@@ -49009,9 +49051,9 @@ function buildPrompt5(prompt) {
|
|
|
49009
49051
|
}
|
|
49010
49052
|
|
|
49011
49053
|
// src/commands/sessions/shared/loadSessionTitles.ts
|
|
49012
|
-
import { z as
|
|
49054
|
+
import { z as z19 } from "zod";
|
|
49013
49055
|
var TITLES_FILE = "session-titles.json";
|
|
49014
|
-
var sessionTitlesSchema =
|
|
49056
|
+
var sessionTitlesSchema = z19.record(z19.string(), z19.string());
|
|
49015
49057
|
function loadSessionTitles() {
|
|
49016
49058
|
const parsed = sessionTitlesSchema.safeParse(
|
|
49017
49059
|
loadJson(TITLES_FILE)
|