@staff0rd/assist 0.882.0 → 0.883.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.882.0",
9
+ version: "0.883.0",
10
10
  type: "module",
11
11
  main: "dist/index.js",
12
12
  bin: {
@@ -4966,6 +4966,116 @@ async function diffScopes(req, res) {
4966
4966
  respondJson(res, 200, { commits: commits2, branchBase: base });
4967
4967
  }
4968
4968
 
4969
+ // src/commands/sessions/daemon/requestDaemonReply.ts
4970
+ import { createInterface as createInterface3 } from "readline";
4971
+ var QUERY_TIMEOUT_MS = 3e3;
4972
+ async function requestDaemonReply(request, replyType, timeoutMs = QUERY_TIMEOUT_MS) {
4973
+ let socket;
4974
+ try {
4975
+ socket = await connectToDaemon();
4976
+ } catch {
4977
+ return void 0;
4978
+ }
4979
+ return new Promise((resolve30) => {
4980
+ const finish2 = (result) => {
4981
+ clearTimeout(timer);
4982
+ socket.destroy();
4983
+ resolve30(result);
4984
+ };
4985
+ const timer = setTimeout(() => finish2(void 0), timeoutMs);
4986
+ const lines2 = createInterface3({ input: socket });
4987
+ lines2.on("error", () => {
4988
+ });
4989
+ lines2.on("line", (line) => {
4990
+ try {
4991
+ const data = JSON.parse(line);
4992
+ if (data.type === replyType) finish2(data);
4993
+ } catch {
4994
+ }
4995
+ });
4996
+ socket.on("error", () => finish2(void 0));
4997
+ socket.write(`${JSON.stringify(request)}
4998
+ `);
4999
+ });
5000
+ }
5001
+
5002
+ // src/commands/sessions/web/fromGithub/allowExtensionOrigin.ts
5003
+ var EXTENSION_ORIGIN = /^(moz|chrome)-extension:\/\/[^/]+$/;
5004
+ function allowExtensionOrigin(req, res) {
5005
+ const origin = req.headers.origin;
5006
+ if (!origin || !EXTENSION_ORIGIN.test(origin)) return;
5007
+ res.setHeader("Access-Control-Allow-Origin", origin);
5008
+ res.setHeader("Access-Control-Allow-Methods", "POST");
5009
+ res.setHeader("Access-Control-Allow-Headers", "Content-Type");
5010
+ res.setHeader("Vary", "Origin");
5011
+ }
5012
+
5013
+ // src/commands/sessions/web/readJsonBody.ts
5014
+ async function readJsonBody(req) {
5015
+ const chunks = [];
5016
+ for await (const chunk of req) chunks.push(chunk);
5017
+ return JSON.parse(Buffer.concat(chunks).toString("utf8"));
5018
+ }
5019
+
5020
+ // src/commands/sessions/web/docsFeedback/docsFeedbackPrompt.ts
5021
+ function docsFeedbackPrompt({
5022
+ pageId,
5023
+ heading: heading2,
5024
+ source,
5025
+ selection,
5026
+ prompt
5027
+ }) {
5028
+ const quoted = selection.trim().split(/\r?\n/).map((line) => `> ${line}`).join("\n");
5029
+ return [
5030
+ `Docs feedback on page \`${pageId}\`, section "${heading2}" (${source}):`,
5031
+ quoted,
5032
+ prompt.trim()
5033
+ ].join("\n\n");
5034
+ }
5035
+
5036
+ // src/commands/sessions/web/docsFeedback/docsFeedbackSchema.ts
5037
+ import { z as z7 } from "zod";
5038
+ var docsFeedbackSchema = z7.object({
5039
+ sessionId: z7.string().optional(),
5040
+ pageId: z7.string().min(1),
5041
+ heading: z7.string().min(1),
5042
+ source: z7.string().min(1),
5043
+ selection: z7.string().min(1),
5044
+ prompt: z7.string().trim().min(1)
5045
+ });
5046
+
5047
+ // src/commands/sessions/web/docsFeedback/docsFeedback.ts
5048
+ async function docsFeedback(req, res) {
5049
+ allowExtensionOrigin(req, res);
5050
+ const parsed = docsFeedbackSchema.safeParse(
5051
+ await readJsonBody(req).catch(() => void 0)
5052
+ );
5053
+ if (!parsed.success) {
5054
+ respondJson(res, 400, { error: "Invalid docs feedback body" });
5055
+ return;
5056
+ }
5057
+ const { sessionId } = parsed.data;
5058
+ if (!sessionId) {
5059
+ respondJson(res, 404, {
5060
+ error: "This docs preview was not started from an assist session"
5061
+ });
5062
+ return;
5063
+ }
5064
+ const reply2 = await requestDaemonReply(
5065
+ { type: "type-prompt", sessionId, text: docsFeedbackPrompt(parsed.data) },
5066
+ "type-prompt-result"
5067
+ );
5068
+ if (!reply2) {
5069
+ respondJson(res, 504, { error: "assist daemon did not answer" });
5070
+ return;
5071
+ }
5072
+ if (!reply2.ok) {
5073
+ respondJson(res, 404, { error: reply2.message });
5074
+ return;
5075
+ }
5076
+ respondJson(res, 200, { message: reply2.message });
5077
+ }
5078
+
4969
5079
  // src/commands/sessions/web/fileContent.ts
4970
5080
  import { readFile, stat } from "fs/promises";
4971
5081
 
@@ -5090,24 +5200,6 @@ function requestAssistSession(assistArgs, cwd, options2) {
5090
5200
  });
5091
5201
  }
5092
5202
 
5093
- // src/commands/sessions/web/readJsonBody.ts
5094
- async function readJsonBody(req) {
5095
- const chunks = [];
5096
- for await (const chunk of req) chunks.push(chunk);
5097
- return JSON.parse(Buffer.concat(chunks).toString("utf8"));
5098
- }
5099
-
5100
- // src/commands/sessions/web/fromGithub/allowExtensionOrigin.ts
5101
- var EXTENSION_ORIGIN = /^(moz|chrome)-extension:\/\/[^/]+$/;
5102
- function allowExtensionOrigin(req, res) {
5103
- const origin = req.headers.origin;
5104
- if (!origin || !EXTENSION_ORIGIN.test(origin)) return;
5105
- res.setHeader("Access-Control-Allow-Origin", origin);
5106
- res.setHeader("Access-Control-Allow-Methods", "POST");
5107
- res.setHeader("Access-Control-Allow-Headers", "Content-Type");
5108
- res.setHeader("Vary", "Origin");
5109
- }
5110
-
5111
5203
  // src/commands/sessions/web/fromGithub/launchFromGithub.ts
5112
5204
  async function launchFromGithub(req, res, plan2, launch) {
5113
5205
  allowExtensionOrigin(req, res);
@@ -7130,39 +7222,6 @@ function describeProtocolGap(node, msg) {
7130
7222
  return `no common protocol: ${node} ${msg.version} speaks ${formatRange(peer)}, this node ${ASSIST_VERSION} speaks ${formatRange(local)}; update ${behind} and restart it when convenient \u2014 the link reconnects once the ranges overlap`;
7131
7223
  }
7132
7224
 
7133
- // src/commands/sessions/daemon/requestDaemonReply.ts
7134
- import { createInterface as createInterface3 } from "readline";
7135
- var QUERY_TIMEOUT_MS = 3e3;
7136
- async function requestDaemonReply(request, replyType, timeoutMs = QUERY_TIMEOUT_MS) {
7137
- let socket;
7138
- try {
7139
- socket = await connectToDaemon();
7140
- } catch {
7141
- return void 0;
7142
- }
7143
- return new Promise((resolve30) => {
7144
- const finish2 = (result) => {
7145
- clearTimeout(timer);
7146
- socket.destroy();
7147
- resolve30(result);
7148
- };
7149
- const timer = setTimeout(() => finish2(void 0), timeoutMs);
7150
- const lines2 = createInterface3({ input: socket });
7151
- lines2.on("error", () => {
7152
- });
7153
- lines2.on("line", (line) => {
7154
- try {
7155
- const data = JSON.parse(line);
7156
- if (data.type === replyType) finish2(data);
7157
- } catch {
7158
- }
7159
- });
7160
- socket.on("error", () => finish2(void 0));
7161
- socket.write(`${JSON.stringify(request)}
7162
- `);
7163
- });
7164
- }
7165
-
7166
7225
  // src/commands/sessions/nodes/queryNodes.ts
7167
7226
  function queryNodes() {
7168
7227
  return requestDaemonReply({ type: "nodes" }, "nodes");
@@ -11333,6 +11392,8 @@ var routes2 = {
11333
11392
  "OPTIONS /api/sessions/from-github": sessionFromGithubPreflight,
11334
11393
  "POST /api/sessions/review-from-github": reviewFromGithub,
11335
11394
  "OPTIONS /api/sessions/review-from-github": sessionFromGithubPreflight,
11395
+ "POST /api/sessions/docs-feedback": docsFeedback,
11396
+ "OPTIONS /api/sessions/docs-feedback": sessionFromGithubPreflight,
11336
11397
  "POST /api/open-in-code": openInCode,
11337
11398
  "POST /api/pr-preview/upload-image": uploadPrImage,
11338
11399
  "GET /api/pr-preview/image": previewImage,
@@ -15689,21 +15750,21 @@ ${issues}`);
15689
15750
  }
15690
15751
 
15691
15752
  // src/commands/backlog/propose/proposedItemSchema.ts
15692
- import { z as z7 } from "zod";
15693
- var proposedPhaseSchema = z7.strictObject({
15694
- name: z7.string().trim().min(1, "phase name is required").refine(
15753
+ import { z as z8 } from "zod";
15754
+ var proposedPhaseSchema = z8.strictObject({
15755
+ name: z8.string().trim().min(1, "phase name is required").refine(
15695
15756
  (name) => name.toLowerCase() !== REVIEW_PHASE_NAME.toLowerCase(),
15696
15757
  `"${REVIEW_PHASE_NAME}" is owned by the runner and appended to every plan automatically \u2014 remove this phase`
15697
15758
  ),
15698
- tasks: z7.array(z7.string().trim().min(1)).min(1, "a phase needs at least one task"),
15699
- manualChecks: z7.array(z7.string().trim().min(1)).default([])
15759
+ tasks: z8.array(z8.string().trim().min(1)).min(1, "a phase needs at least one task"),
15760
+ manualChecks: z8.array(z8.string().trim().min(1)).default([])
15700
15761
  });
15701
- var proposedItemSchema = z7.strictObject({
15702
- name: z7.string().trim().min(1, "name is required"),
15703
- type: z7.enum(["story", "bug"]),
15704
- description: z7.string().optional(),
15705
- acceptanceCriteria: z7.array(z7.string().trim().min(1)).default([]),
15706
- phases: z7.array(proposedPhaseSchema).default([])
15762
+ var proposedItemSchema = z8.strictObject({
15763
+ name: z8.string().trim().min(1, "name is required"),
15764
+ type: z8.enum(["story", "bug"]),
15765
+ description: z8.string().optional(),
15766
+ acceptanceCriteria: z8.array(z8.string().trim().min(1)).default([]),
15767
+ phases: z8.array(proposedPhaseSchema).default([])
15707
15768
  });
15708
15769
 
15709
15770
  // src/commands/backlog/propose/readProposedItem.ts
@@ -17161,19 +17222,19 @@ async function persistPhaseSessionId(itemId2, phaseIdx, claudeSessionId) {
17161
17222
  import { mkdirSync as mkdirSync12, readFileSync as readFileSync26, rmSync as rmSync4, writeFileSync as writeFileSync22 } from "fs";
17162
17223
  import { homedir as homedir16 } from "os";
17163
17224
  import { dirname as dirname25, join as join48 } from "path";
17164
- import { z as z8 } from "zod";
17165
- var activitySchema = z8.object({
17166
- kind: z8.enum(["command", "backlog"]),
17167
- harness: z8.enum(["claude", "codex", "pi"]).optional(),
17168
- name: z8.string().optional(),
17169
- itemId: z8.number().optional(),
17170
- itemName: z8.string().optional(),
17171
- phase: z8.number().optional(),
17172
- phaseName: z8.string().optional(),
17173
- totalPhases: z8.number().optional(),
17174
- claudeSessionId: z8.string().optional(),
17175
- watchState: z8.enum(["waiting", "updating"]).optional(),
17176
- startedAt: z8.number()
17225
+ import { z as z9 } from "zod";
17226
+ var activitySchema = z9.object({
17227
+ kind: z9.enum(["command", "backlog"]),
17228
+ harness: z9.enum(["claude", "codex", "pi"]).optional(),
17229
+ name: z9.string().optional(),
17230
+ itemId: z9.number().optional(),
17231
+ itemName: z9.string().optional(),
17232
+ phase: z9.number().optional(),
17233
+ phaseName: z9.string().optional(),
17234
+ totalPhases: z9.number().optional(),
17235
+ claudeSessionId: z9.string().optional(),
17236
+ watchState: z9.enum(["waiting", "updating"]).optional(),
17237
+ startedAt: z9.number()
17177
17238
  });
17178
17239
  function activityPath(sessionId) {
17179
17240
  return join48(homedir16(), ".assist", "activity", `activity-${sessionId}.json`);
@@ -18719,9 +18780,9 @@ async function update(id, options2) {
18719
18780
  import chalk111 from "chalk";
18720
18781
 
18721
18782
  // src/commands/backlog/updatePlan/planUpdateSchema.ts
18722
- import { z as z9 } from "zod";
18723
- var planUpdateSchema = z9.strictObject({
18724
- phases: z9.array(proposedPhaseSchema).min(1, "a plan needs at least one phase")
18783
+ import { z as z10 } from "zod";
18784
+ var planUpdateSchema = z10.strictObject({
18785
+ phases: z10.array(proposedPhaseSchema).min(1, "a plan needs at least one phase")
18725
18786
  });
18726
18787
 
18727
18788
  // src/commands/backlog/updatePlan/readPlanUpdate.ts
@@ -27514,38 +27575,38 @@ function stringOrUndefined(value) {
27514
27575
  }
27515
27576
 
27516
27577
  // src/commands/sessions/daemon/persistedSessionSchema.ts
27517
- import { z as z10 } from "zod";
27518
- var persistedSessionSchema = z10.object({
27519
- id: z10.string().optional(),
27520
- name: z10.string(),
27521
- title: z10.string().optional(),
27522
- generatedTitle: z10.string().optional(),
27523
- subtitle: z10.string().optional(),
27524
- commandType: z10.enum(["claude", "run", "assist"]),
27525
- harness: z10.enum(["claude", "codex", "pi"]).optional(),
27526
- status: z10.enum(["running", "waiting", "done", "error", "stopped"]).optional(),
27527
- cwd: z10.string(),
27528
- startedAt: z10.number(),
27529
- runningMs: z10.number().optional(),
27530
- claudeSessionId: z10.string().optional(),
27531
- harnessSessionId: z10.string().optional(),
27532
- initialPrompt: z10.string().optional(),
27533
- runName: z10.string().optional(),
27534
- runArgs: z10.array(z10.string()).optional(),
27535
- assistArgs: z10.array(z10.string()).optional(),
27578
+ import { z as z11 } from "zod";
27579
+ var persistedSessionSchema = z11.object({
27580
+ id: z11.string().optional(),
27581
+ name: z11.string(),
27582
+ title: z11.string().optional(),
27583
+ generatedTitle: z11.string().optional(),
27584
+ subtitle: z11.string().optional(),
27585
+ commandType: z11.enum(["claude", "run", "assist"]),
27586
+ harness: z11.enum(["claude", "codex", "pi"]).optional(),
27587
+ status: z11.enum(["running", "waiting", "done", "error", "stopped"]).optional(),
27588
+ cwd: z11.string(),
27589
+ startedAt: z11.number(),
27590
+ runningMs: z11.number().optional(),
27591
+ claudeSessionId: z11.string().optional(),
27592
+ harnessSessionId: z11.string().optional(),
27593
+ initialPrompt: z11.string().optional(),
27594
+ runName: z11.string().optional(),
27595
+ runArgs: z11.array(z11.string()).optional(),
27596
+ assistArgs: z11.array(z11.string()).optional(),
27536
27597
  activity: activitySchema.optional(),
27537
- starred: z10.boolean().optional(),
27538
- watcher: z10.boolean().optional(),
27539
- divergenceEscalation: z10.boolean().optional(),
27540
- design: z10.boolean().optional(),
27541
- auto: z10.boolean().optional(),
27542
- autoAdvance: z10.boolean().optional(),
27543
- autoApprove: z10.boolean().optional(),
27544
- reviewStarted: z10.boolean().optional(),
27545
- launchedFrom: z10.string().optional(),
27546
- interrupted: z10.object({ reason: z10.string(), at: z10.number() }).optional(),
27547
- awaitingSeed: z10.boolean().optional(),
27548
- undurable: z10.object({ reason: z10.string(), removesTree: z10.boolean().optional() }).optional()
27598
+ starred: z11.boolean().optional(),
27599
+ watcher: z11.boolean().optional(),
27600
+ divergenceEscalation: z11.boolean().optional(),
27601
+ design: z11.boolean().optional(),
27602
+ auto: z11.boolean().optional(),
27603
+ autoAdvance: z11.boolean().optional(),
27604
+ autoApprove: z11.boolean().optional(),
27605
+ reviewStarted: z11.boolean().optional(),
27606
+ launchedFrom: z11.string().optional(),
27607
+ interrupted: z11.object({ reason: z11.string(), at: z11.number() }).optional(),
27608
+ awaitingSeed: z11.boolean().optional(),
27609
+ undurable: z11.object({ reason: z11.string(), removesTree: z11.boolean().optional() }).optional()
27549
27610
  });
27550
27611
 
27551
27612
  // src/commands/sessions/daemon/toPersistedSession.ts
@@ -41479,16 +41540,16 @@ function selectPassages(sources, selection) {
41479
41540
  }
41480
41541
 
41481
41542
  // src/commands/transcript/selectionSchema.ts
41482
- import { z as z11 } from "zod";
41483
- var selectionSchema = z11.strictObject({
41484
- keep: z11.array(
41485
- z11.strictObject({
41486
- file: z11.string().trim().min(1, "file is required"),
41487
- from: z11.string().trim().min(1, "from is required"),
41488
- to: z11.string().trim().min(1, "to is required")
41543
+ import { z as z12 } from "zod";
41544
+ var selectionSchema = z12.strictObject({
41545
+ keep: z12.array(
41546
+ z12.strictObject({
41547
+ file: z12.string().trim().min(1, "file is required"),
41548
+ from: z12.string().trim().min(1, "from is required"),
41549
+ to: z12.string().trim().min(1, "to is required")
41489
41550
  })
41490
41551
  ).min(1, "a selection needs at least one keep range"),
41491
- removed: z11.array(z11.string().trim().min(1)).default([])
41552
+ removed: z12.array(z12.string().trim().min(1)).default([])
41492
41553
  });
41493
41554
 
41494
41555
  // src/commands/transcript/widenAudienceInText.ts
@@ -44136,9 +44197,9 @@ async function refreshRepoConfigCacheOnStart() {
44136
44197
  }
44137
44198
 
44138
44199
  // src/commands/sessions/daemon/loadActiveSelection.ts
44139
- import { z as z12 } from "zod";
44200
+ import { z as z13 } from "zod";
44140
44201
  var ACTIVE_FILE = "active.json";
44141
- var activeSelectionSchema = z12.record(z12.string(), z12.string());
44202
+ var activeSelectionSchema = z13.record(z13.string(), z13.string());
44142
44203
  function loadActiveSelection() {
44143
44204
  const parsed = activeSelectionSchema.safeParse(
44144
44205
  loadJson(ACTIVE_FILE)
@@ -44458,6 +44519,33 @@ function isInactiveViewer(s, { viewerId, claim }) {
44458
44519
  return s.activeViewer !== viewerId;
44459
44520
  }
44460
44521
 
44522
+ // src/commands/sessions/shared/pasteAndSubmit/bracketedPaste.ts
44523
+ var ESC3 = String.fromCharCode(27);
44524
+ var PASTE_START = `${ESC3}[200~`;
44525
+ var PASTE_END = `${ESC3}[201~`;
44526
+ var SUBMIT = "\r";
44527
+ function bracketedPaste(text18) {
44528
+ return `${PASTE_START}${text18.replace(/\r?\n/g, SUBMIT)}${PASTE_END}`;
44529
+ }
44530
+
44531
+ // src/commands/sessions/shared/pasteAndSubmit.ts
44532
+ var SUBMIT_DELAY_MS = 150;
44533
+ function pasteAndSubmit(sendInput, sessionId, text18) {
44534
+ sendInput(sessionId, bracketedPaste(text18));
44535
+ setTimeout(() => sendInput(sessionId, SUBMIT), SUBMIT_DELAY_MS);
44536
+ }
44537
+
44538
+ // src/commands/sessions/daemon/typePromptIntoSession.ts
44539
+ function typePromptIntoSession(sessions, id, text18, write) {
44540
+ const session = sessions.get(id);
44541
+ if (!session) return `assist session ${id} was not found`;
44542
+ if (session.status === "done" || !session.pty)
44543
+ return `assist session ${id} has ended`;
44544
+ pasteAndSubmit(write, id, text18);
44545
+ daemonLog(`session ${id} typed prompt (${text18.length} chars)`);
44546
+ return void 0;
44547
+ }
44548
+
44461
44549
  // src/commands/sessions/daemon/ViewerConnections.ts
44462
44550
  var ViewerConnections = class {
44463
44551
  byClient = /* @__PURE__ */ new Map();
@@ -44482,18 +44570,18 @@ var ViewerConnections = class {
44482
44570
  };
44483
44571
 
44484
44572
  // src/commands/sessions/daemon/isTerminalResponse.ts
44485
- var ESC3 = String.raw`\x1b`;
44486
- var ST = String.raw`(?:\x07|${ESC3}\\)`;
44573
+ var ESC4 = String.raw`\x1b`;
44574
+ var ST = String.raw`(?:\x07|${ESC4}\\)`;
44487
44575
  var RESPONSE = [
44488
- String.raw`${ESC3}\[[?>=]?[\d;]*c`,
44489
- String.raw`${ESC3}\[\??[\d;]*R`,
44490
- String.raw`${ESC3}\[\??\d*n`,
44491
- String.raw`${ESC3}\[\??[\d;]*\$y`,
44492
- String.raw`${ESC3}\[[\d;]*t`,
44493
- String.raw`${ESC3}\[\?\d*u`,
44494
- String.raw`${ESC3}\[[IO]`,
44495
- String.raw`${ESC3}\][^\x07\x1b]*${ST}`,
44496
- String.raw`${ESC3}P[^\x1b]*${ESC3}\\`
44576
+ String.raw`${ESC4}\[[?>=]?[\d;]*c`,
44577
+ String.raw`${ESC4}\[\??[\d;]*R`,
44578
+ String.raw`${ESC4}\[\??\d*n`,
44579
+ String.raw`${ESC4}\[\??[\d;]*\$y`,
44580
+ String.raw`${ESC4}\[[\d;]*t`,
44581
+ String.raw`${ESC4}\[\?\d*u`,
44582
+ String.raw`${ESC4}\[[IO]`,
44583
+ String.raw`${ESC4}\][^\x07\x1b]*${ST}`,
44584
+ String.raw`${ESC4}P[^\x1b]*${ESC4}\\`
44497
44585
  ].join("|");
44498
44586
  var ONLY_RESPONSES = new RegExp(`^(?:${RESPONSE})+$`);
44499
44587
  function isTerminalResponse(data) {
@@ -44583,6 +44671,14 @@ var SessionIo = class {
44583
44671
  onClaim: this.notify
44584
44672
  });
44585
44673
  }
44674
+ typePrompt(id, text18) {
44675
+ return typePromptIntoSession(
44676
+ this.sessions,
44677
+ id,
44678
+ text18,
44679
+ (target, data) => this.write(target, data, {})
44680
+ );
44681
+ }
44586
44682
  resize(id, cols, rows, viewer) {
44587
44683
  resizeSession(this.sessions, id, cols, rows, {
44588
44684
  ...viewer,
@@ -46307,9 +46403,9 @@ function buildPrompt5(prompt) {
46307
46403
  }
46308
46404
 
46309
46405
  // src/commands/sessions/shared/loadSessionTitles.ts
46310
- import { z as z13 } from "zod";
46406
+ import { z as z14 } from "zod";
46311
46407
  var TITLES_FILE = "session-titles.json";
46312
- var sessionTitlesSchema = z13.record(z13.string(), z13.string());
46408
+ var sessionTitlesSchema = z14.record(z14.string(), z14.string());
46313
46409
  function loadSessionTitles() {
46314
46410
  const parsed = sessionTitlesSchema.safeParse(
46315
46411
  loadJson(TITLES_FILE)
@@ -50737,6 +50833,18 @@ function handleSetStatus(client, m, d) {
50737
50833
  if (d.ack) sendTo(client, { type: "ack", sessionId: d.sessionId });
50738
50834
  }
50739
50835
 
50836
+ // src/commands/sessions/daemon/handleTypePrompt.ts
50837
+ var handleTypePrompt = (client, m, d) => {
50838
+ const sessionId = String(d.sessionId);
50839
+ const refused = m.io.typePrompt(sessionId, String(d.text ?? ""));
50840
+ if (refused) daemonLog(`type-prompt refused: ${refused}`);
50841
+ sendTo(client, {
50842
+ type: "type-prompt-result",
50843
+ ok: !refused,
50844
+ message: refused ?? `Sent to assist session ${sessionId}`
50845
+ });
50846
+ };
50847
+
50740
50848
  // src/commands/sessions/shared/parseTranscript.ts
50741
50849
  import * as fs57 from "fs";
50742
50850
 
@@ -51068,6 +51176,7 @@ var messageHandlers = {
51068
51176
  ),
51069
51177
  "codex-usage": handleCodexUsage,
51070
51178
  ...viewerHandlers,
51179
+ "type-prompt": handleTypePrompt,
51071
51180
  retry: routed((client, m, d) => {
51072
51181
  const conflict = m.retrySession(d.sessionId, d.replace === true);
51073
51182
  if (conflict)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@staff0rd/assist",
3
- "version": "0.882.0",
3
+ "version": "0.883.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "bin": {