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