appostle-installer 0.0.21 → 0.0.22

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/worker.js CHANGED
@@ -3975,7 +3975,9 @@ var BrandEntrySchema = z10.object({
3975
3975
  variables: z10.array(BrandVariableSchema).optional().default([]),
3976
3976
  path: z10.string(),
3977
3977
  modifiedAt: z10.string(),
3978
- size: z10.number()
3978
+ size: z10.number(),
3979
+ /** Raw markdown body (frontmatter stripped). Optional, fed by the scanner. */
3980
+ body: z10.string().optional()
3979
3981
  });
3980
3982
  var BrandFrontmatterSchema = z10.object({
3981
3983
  description: z10.string().optional(),
@@ -4152,6 +4154,22 @@ var BrandGenerateWireframeResponseSchema = z10.object({
4152
4154
  error: z10.string().nullable()
4153
4155
  })
4154
4156
  });
4157
+ var BrandAnalyzePhotographyRequestSchema = z10.object({
4158
+ type: z10.literal("brands/analyze-photography"),
4159
+ requestId: z10.string(),
4160
+ workspaceRoot: z10.string(),
4161
+ brandPath: z10.string(),
4162
+ brief: z10.string(),
4163
+ referenceDescriptions: z10.array(z10.string()).optional()
4164
+ });
4165
+ var BrandAnalyzePhotographyResponseSchema = z10.object({
4166
+ type: z10.literal("brands/analyze-photography/response"),
4167
+ payload: z10.object({
4168
+ requestId: z10.string(),
4169
+ updatedCount: z10.number(),
4170
+ error: z10.string().nullable()
4171
+ })
4172
+ });
4155
4173
  var RightFontEntrySchema = z10.object({
4156
4174
  id: z10.string(),
4157
4175
  name: z10.string(),
@@ -6273,6 +6291,7 @@ var SessionInboundMessageSchema = z11.discriminatedUnion("type", [
6273
6291
  BrandGenerateLayoutRequestSchema,
6274
6292
  BrandLayoutQaNextRequestSchema,
6275
6293
  BrandGenerateWireframeRequestSchema,
6294
+ BrandAnalyzePhotographyRequestSchema,
6276
6295
  RightFontLibraryRequestSchema,
6277
6296
  GoogleFontsCatalogRequestSchema,
6278
6297
  GoogleFontsDownloadRequestSchema,
@@ -7909,6 +7928,7 @@ var SessionOutboundMessageSchema = z11.discriminatedUnion("type", [
7909
7928
  BrandGenerateLayoutResponseSchema,
7910
7929
  BrandLayoutQaNextResponseSchema,
7911
7930
  BrandGenerateWireframeResponseSchema,
7931
+ BrandAnalyzePhotographyResponseSchema,
7912
7932
  RightFontLibraryResponseSchema,
7913
7933
  GoogleFontsCatalogResponseSchema,
7914
7934
  GoogleFontsDownloadResponseSchema,
@@ -8157,7 +8177,7 @@ import { exec } from "node:child_process";
8157
8177
  import { promisify as promisify3 } from "util";
8158
8178
  import { join as join16, resolve as resolve10, sep as sep2 } from "path";
8159
8179
  import { homedir as homedir6, hostname as osHostname } from "node:os";
8160
- import { z as z39 } from "zod";
8180
+ import { z as z40 } from "zod";
8161
8181
 
8162
8182
  // ../server/src/server/persisted-config.ts
8163
8183
  import { existsSync as existsSync4, mkdirSync as mkdirSync4, readFileSync as readFileSync3, writeFileSync as writeFileSync2 } from "node:fs";
@@ -22192,6 +22212,12 @@ ${error.stack ?? ""}` : JSON.stringify(error);
22192
22212
  buildStructuredToolResult(server, tool4, output, input) {
22193
22213
  const normalizedServer = server.toLowerCase();
22194
22214
  const normalizedTool = tool4.toLowerCase();
22215
+ if (normalizedTool === "mcp__playwright__browser_take_screenshot" || normalizedTool === "browser_take_screenshot") {
22216
+ const imageOutput = this.tryInlinePlaywrightScreenshot(output, input);
22217
+ if (imageOutput) {
22218
+ return { output: imageOutput };
22219
+ }
22220
+ }
22195
22221
  if (normalizedServer.includes("bash") || normalizedServer.includes("shell") || normalizedServer.includes("command") || normalizedTool.includes("bash") || normalizedTool.includes("shell") || normalizedTool.includes("command") || input && (typeof input.command === "string" || Array.isArray(input.command))) {
22196
22222
  const command = this.extractCommandText(input ?? {}) ?? "command";
22197
22223
  return {
@@ -22233,8 +22259,46 @@ ${error.stack ?? ""}` : JSON.stringify(error);
22233
22259
  };
22234
22260
  }
22235
22261
  }
22262
+ if (normalizedServer === "playwright" && normalizedTool === "browser_take_screenshot") {
22263
+ const imageDetail = this.tryReadPlaywrightScreenshot(output, input);
22264
+ if (imageDetail) return imageDetail;
22265
+ }
22236
22266
  return void 0;
22237
22267
  }
22268
+ /**
22269
+ * Playwright MCP's `browser_take_screenshot` saves the image to a local file
22270
+ * and returns a markdown link (`[Screenshot of viewport](./file.png)`).
22271
+ * Extract the path, resolve it against the agent CWD, read the bytes, and
22272
+ * return an image ToolCallDetail so the client renders it inline.
22273
+ */
22274
+ tryReadPlaywrightScreenshot(output, input) {
22275
+ let filePath;
22276
+ if (input && typeof input.filename === "string") {
22277
+ filePath = input.filename;
22278
+ }
22279
+ if (!filePath) {
22280
+ const match = output.match(/\[Screenshot[^\]]*\]\(([^)]+)\)/i);
22281
+ if (match?.[1]) {
22282
+ filePath = match[1];
22283
+ }
22284
+ }
22285
+ if (!filePath) return void 0;
22286
+ const cwd = this.config.cwd;
22287
+ if (!cwd) return void 0;
22288
+ const abs = path9.isAbsolute(filePath) ? filePath : path9.resolve(cwd, filePath);
22289
+ try {
22290
+ const buf = fs4.readFileSync(abs);
22291
+ const ext = path9.extname(abs).toLowerCase();
22292
+ const mime = ext === ".jpeg" || ext === ".jpg" ? "image/jpeg" : "image/png";
22293
+ return {
22294
+ type: "image",
22295
+ toolName: "mcp__playwright__browser_take_screenshot",
22296
+ images: [{ mimeType: mime, data: buf.toString("base64") }]
22297
+ };
22298
+ } catch {
22299
+ return void 0;
22300
+ }
22301
+ }
22238
22302
  mapPartialEvent(event, options) {
22239
22303
  if (event.type === "content_block_start") {
22240
22304
  const block = isClaudeContentChunk2(event.content_block) ? event.content_block : null;
@@ -22407,6 +22471,44 @@ ${error.stack ?? ""}` : JSON.stringify(error);
22407
22471
  }
22408
22472
  return input;
22409
22473
  }
22474
+ /**
22475
+ * Playwright MCP returns `### Result\n- [Screenshot of viewport](./foo.png)`
22476
+ * and writes the file to disk instead of inlining the image. Resolve that
22477
+ * path against the agent cwd and turn the file into an Anthropic-style
22478
+ * image content block array, so downstream `extractImageToolDetail`
22479
+ * promotes the tool call to a renderable `image` detail.
22480
+ *
22481
+ * Returns `null` when the path cannot be resolved/read safely; the caller
22482
+ * then falls back to the default text output behavior.
22483
+ */
22484
+ tryInlinePlaywrightScreenshot(output, input) {
22485
+ const cwd = this.config.cwd;
22486
+ if (!cwd) return null;
22487
+ let relPath;
22488
+ if (input && typeof input.filename === "string" && input.filename.length > 0) {
22489
+ relPath = input.filename;
22490
+ } else {
22491
+ const match = output.match(/\[Screenshot[^\]]*\]\(([^)]+)\)/);
22492
+ if (match?.[1]) {
22493
+ relPath = match[1];
22494
+ }
22495
+ }
22496
+ if (!relPath) return null;
22497
+ const resolved = path9.resolve(cwd, relPath);
22498
+ const cwdReal = path9.resolve(cwd);
22499
+ if (!resolved.startsWith(cwdReal + path9.sep) && resolved !== cwdReal) {
22500
+ return null;
22501
+ }
22502
+ let buf;
22503
+ try {
22504
+ buf = fs4.readFileSync(resolved);
22505
+ } catch {
22506
+ return null;
22507
+ }
22508
+ const ext = path9.extname(resolved).toLowerCase();
22509
+ const mimeType = ext === ".jpg" || ext === ".jpeg" ? "image/jpeg" : ext === ".webp" ? "image/webp" : ext === ".gif" ? "image/gif" : "image/png";
22510
+ return [{ type: "image", mimeType, data: buf.toString("base64") }];
22511
+ }
22410
22512
  areToolInputsEqual(left, right) {
22411
22513
  if (!left) {
22412
22514
  return false;
@@ -33722,18 +33824,7 @@ function buildHandoffMcpServer(callerAgentId, options) {
33722
33824
  );
33723
33825
  const reportTool = tool2(
33724
33826
  "report",
33725
- [
33726
- "Send a curated message from this handoff child session back to its parent.",
33727
- "Use this when the user types `>report` \u2014 they want to deliver a specific update",
33728
- "to the parent right now, in their own words.",
33729
- "",
33730
- "Independent of the automatic on-finish notification: the parent still receives",
33731
- "the auto-return when this child eventually finishes. You can call this tool any",
33732
- "number of times over the lifetime of the handoff \u2014 each call is a separate",
33733
- "update.",
33734
- "",
33735
- "Only works in sessions that were spawned via `handoff`. Errors otherwise."
33736
- ].join("\n"),
33827
+ '**ALWAYS call this tool as your final action before finishing your task, to deliver your findings to the parent agent.** Without this call, the parent only receives a content-free "finished" notification and is blind to whatever you did or learned. The first sentence of your report should be a one-line verdict; the rest can fill in detail. Also call this tool any time the user explicitly types `>report` mid-task to send an interim update \u2014 the auto-return on session end is independent from manual reports, and you can call it any number of times over the session\'s lifetime. Only works in sessions that were spawned via `handoff`; errors otherwise.',
33737
33828
  {
33738
33829
  message: z33.string().min(1).describe(
33739
33830
  "The curated report to deliver to the parent session. Self-contained: the parent does not see this conversation's timeline."
@@ -40159,10 +40250,12 @@ async function readBrandsFromDir(scope, dir) {
40159
40250
  continue;
40160
40251
  }
40161
40252
  let parsed;
40253
+ let body = "";
40162
40254
  try {
40163
40255
  const text = await fs14.readFile(fullPath, "utf8");
40164
- const { rawFrontmatterLines, hadFrontmatter } = parseBrandFile(text);
40256
+ const { rawFrontmatterLines, body: parsedBody, hadFrontmatter } = parseBrandFile(text);
40165
40257
  parsed = hadFrontmatter ? parseFrontmatter2(rawFrontmatterLines) : { description: "", variables: [] };
40258
+ body = parsedBody;
40166
40259
  } catch {
40167
40260
  parsed = { description: "", variables: [] };
40168
40261
  }
@@ -40174,7 +40267,8 @@ async function readBrandsFromDir(scope, dir) {
40174
40267
  variables: parsed.variables,
40175
40268
  path: fullPath,
40176
40269
  modifiedAt: stat10.mtime.toISOString(),
40177
- size: stat10.size
40270
+ size: stat10.size,
40271
+ body
40178
40272
  });
40179
40273
  }
40180
40274
  results.sort((a, b) => a.name.localeCompare(b.name));
@@ -40613,11 +40707,132 @@ async function generateAndApplyBrandTokens(options) {
40613
40707
  return { generatedCount: acceptedUpdates.size };
40614
40708
  }
40615
40709
 
40710
+ // ../server/src/server/brand/photography-analyzer.ts
40711
+ import { z as z38 } from "zod";
40712
+ var PhotographyResponseSchema = z38.object({
40713
+ dna: z38.string().min(1),
40714
+ dials: z38.record(z38.string(), z38.string())
40715
+ });
40716
+ function buildPrompt3(args) {
40717
+ const dialLines = args.selectVars.map((v) => {
40718
+ const options = (v.options ?? []).join(", ");
40719
+ return `- ${v.key} (${v.label || v.key}): current="${v.value || "(unset)"}" options=[${options}]`;
40720
+ }).join("\n");
40721
+ const refSection = args.referenceDescriptions.length > 0 ? [
40722
+ "",
40723
+ "Reference image filenames/descriptions provided by the user:",
40724
+ ...args.referenceDescriptions.map((r) => `- ${r}`)
40725
+ ].join("\n") : "";
40726
+ return [
40727
+ "You are a photography director analyzing a brand's photographic identity.",
40728
+ "The user has provided a brief describing the visual direction they want.",
40729
+ "Your job is to:",
40730
+ "1. Write a rich, specific Style DNA (2-3 sentences describing the photographic",
40731
+ " identity in concrete visual terms \u2014 lighting quality, tonal mood, depth",
40732
+ " characteristics, color rendering. No marketing fluff.)",
40733
+ "2. Pre-dial every camera control to match that style direction.",
40734
+ " ONLY use values that appear in the options list for each dial.",
40735
+ "",
40736
+ "User brief:",
40737
+ args.brief,
40738
+ refSection,
40739
+ "",
40740
+ "Camera dials (key, current value, valid options):",
40741
+ dialLines,
40742
+ "",
40743
+ "Return JSON only with the shape:",
40744
+ '{ "dna": "Rich style DNA description...", "dials": { "key": "value", ... } }',
40745
+ "",
40746
+ "Rules:",
40747
+ "- The dna field must be a non-empty string, 2-3 sentences.",
40748
+ "- Every value in dials must be one of the listed options for that key.",
40749
+ "- Include ALL dial keys in dials, even if you keep the current value.",
40750
+ "- Do not invent new keys. Do not output anything outside the JSON."
40751
+ ].filter((line) => line !== "").join("\n");
40752
+ }
40753
+ async function analyzeAndApplyPhotographyStyle(options) {
40754
+ const { agentManager, workspaceRoot, brandPath, brief, referenceDescriptions, logger } = options;
40755
+ const brands = await listBrands({ workspaceRoot });
40756
+ const photoBrand = brands.find((b) => b.path === brandPath) ?? null;
40757
+ if (!photoBrand) {
40758
+ throw new Error(`Brand file not found at ${brandPath}`);
40759
+ }
40760
+ const allVars = photoBrand.variables;
40761
+ const selectVars = allVars.filter(
40762
+ (v) => v.type === "select" && v.options && v.options.length > 0
40763
+ );
40764
+ if (selectVars.length === 0) {
40765
+ throw new Error("No camera dials found in photography brand file");
40766
+ }
40767
+ const validOptions = /* @__PURE__ */ new Map();
40768
+ for (const v of selectVars) {
40769
+ validOptions.set(v.key, new Set(v.options ?? []));
40770
+ }
40771
+ const agentPrompt = buildPrompt3({
40772
+ brief,
40773
+ referenceDescriptions: referenceDescriptions ?? [],
40774
+ selectVars
40775
+ });
40776
+ let response;
40777
+ try {
40778
+ response = await generateStructuredAgentResponseWithFallback({
40779
+ manager: agentManager,
40780
+ cwd: workspaceRoot,
40781
+ prompt: agentPrompt,
40782
+ schema: PhotographyResponseSchema,
40783
+ schemaName: "PhotographyAnalysis",
40784
+ maxRetries: 2,
40785
+ providers: DEFAULT_STRUCTURED_GENERATION_PROVIDERS,
40786
+ agentConfigOverrides: {
40787
+ title: "Photography style analyzer",
40788
+ internal: true
40789
+ }
40790
+ });
40791
+ } catch (error) {
40792
+ if (error instanceof StructuredAgentResponseError || error instanceof StructuredAgentFallbackError) {
40793
+ logger.warn({ err: error, brandPath }, "Structured photography analysis failed");
40794
+ throw new Error("Photography analysis failed \u2014 the agent did not return valid JSON");
40795
+ }
40796
+ throw error;
40797
+ }
40798
+ const acceptedUpdates = /* @__PURE__ */ new Map();
40799
+ for (const [key, value] of Object.entries(response.dials)) {
40800
+ if (typeof value !== "string") continue;
40801
+ const trimmed = value.trim();
40802
+ const opts = validOptions.get(key);
40803
+ if (!opts) continue;
40804
+ if (!opts.has(trimmed)) continue;
40805
+ acceptedUpdates.set(key, trimmed);
40806
+ }
40807
+ acceptedUpdates.set("photo.dna", response.dna);
40808
+ acceptedUpdates.set("photo.brief", brief);
40809
+ const nextVariables = allVars.map((v) => {
40810
+ const update = acceptedUpdates.get(v.key);
40811
+ if (update === void 0) return v;
40812
+ return { ...v, value: update };
40813
+ });
40814
+ await writeBrandFrontmatter(
40815
+ {
40816
+ path: brandPath,
40817
+ frontmatter: {
40818
+ description: photoBrand.description,
40819
+ variables: nextVariables
40820
+ }
40821
+ },
40822
+ workspaceRoot
40823
+ );
40824
+ logger.info(
40825
+ { brandPath, updatedCount: acceptedUpdates.size },
40826
+ "photography-analyzer: applied style analysis"
40827
+ );
40828
+ return { updatedCount: acceptedUpdates.size };
40829
+ }
40830
+
40616
40831
  // ../server/src/server/brand/layout-generator.ts
40617
40832
  import { promises as fs15 } from "node:fs";
40618
40833
  import path23 from "node:path";
40619
40834
  import { fileURLToPath as fileURLToPath3 } from "node:url";
40620
- import { z as z38 } from "zod";
40835
+ import { z as z39 } from "zod";
40621
40836
  var QA_FILENAME = "layout-qa.md";
40622
40837
  var PROMPT_FILENAME = "layout-prompt.md";
40623
40838
  var MAX_LOOKUP_LEVELS = 10;
@@ -40652,34 +40867,34 @@ async function writeRoleFile(workspaceRoot, content) {
40652
40867
  await fs15.mkdir(path23.dirname(filePath), { recursive: true });
40653
40868
  await fs15.writeFile(filePath, content, "utf8");
40654
40869
  }
40655
- var QaNextResponseSchema = z38.object({
40656
- done: z38.boolean(),
40657
- question: z38.string().optional(),
40658
- options: z38.array(z38.string()).optional(),
40659
- roleDocument: z38.string().optional()
40660
- });
40661
- var RefinementResponseSchema = z38.object({
40662
- roleDocument: z38.string()
40663
- });
40664
- var WireframeBlockSchema = z38.object({
40665
- type: z38.enum(["headline", "subheadline", "text", "image", "cta", "spacer"]),
40666
- widthFraction: z38.number(),
40667
- heightVh: z38.number()
40668
- });
40669
- var WireframeSectionSchema = z38.object({
40670
- type: z38.enum(["hero", "features", "content", "cta", "footer", "divider"]),
40671
- widthMode: z38.enum(["full-bleed", "contained"]),
40672
- heightVh: z38.number(),
40673
- arrangement: z38.enum(["single-column", "split", "asymmetric-grid", "bento", "stacked"]),
40674
- blocks: z38.array(WireframeBlockSchema),
40675
- bg: z38.enum(["neutral", "alt", "accent", "image"]),
40676
- gapAfterVh: z38.number()
40677
- });
40678
- var WireframeDataSchema = z38.object({
40679
- viewport: z38.object({ width: z38.number(), height: z38.number() }),
40680
- maxWidth: z38.number(),
40681
- pageBg: z38.string(),
40682
- sections: z38.array(WireframeSectionSchema)
40870
+ var QaNextResponseSchema = z39.object({
40871
+ done: z39.boolean(),
40872
+ question: z39.string().optional(),
40873
+ options: z39.array(z39.string()).optional(),
40874
+ roleDocument: z39.string().optional()
40875
+ });
40876
+ var RefinementResponseSchema = z39.object({
40877
+ roleDocument: z39.string()
40878
+ });
40879
+ var WireframeBlockSchema = z39.object({
40880
+ type: z39.enum(["headline", "subheadline", "text", "image", "cta", "spacer"]),
40881
+ widthFraction: z39.number(),
40882
+ heightVh: z39.number()
40883
+ });
40884
+ var WireframeSectionSchema = z39.object({
40885
+ type: z39.enum(["hero", "features", "content", "cta", "footer", "divider"]),
40886
+ widthMode: z39.enum(["full-bleed", "contained"]),
40887
+ heightVh: z39.number(),
40888
+ arrangement: z39.enum(["single-column", "split", "asymmetric-grid", "bento", "stacked"]),
40889
+ blocks: z39.array(WireframeBlockSchema),
40890
+ bg: z39.enum(["neutral", "alt", "accent", "image"]),
40891
+ gapAfterVh: z39.number()
40892
+ });
40893
+ var WireframeDataSchema = z39.object({
40894
+ viewport: z39.object({ width: z39.number(), height: z39.number() }),
40895
+ maxWidth: z39.number(),
40896
+ pageBg: z39.string(),
40897
+ sections: z39.array(WireframeSectionSchema)
40683
40898
  });
40684
40899
  function buildFullBrandContext(allBrands) {
40685
40900
  const lines = [];
@@ -42364,7 +42579,7 @@ var MIN_STREAMING_SEGMENT_DURATION_MS = 1e3;
42364
42579
  var MIN_STREAMING_SEGMENT_BYTES = Math.round(
42365
42580
  PCM_BYTES_PER_MS * MIN_STREAMING_SEGMENT_DURATION_MS
42366
42581
  );
42367
- var AgentIdSchema2 = z39.string().uuid();
42582
+ var AgentIdSchema2 = z40.string().uuid();
42368
42583
  var VOICE_INTERRUPT_CONFIRMATION_MS = 500;
42369
42584
  var VoiceFeatureUnavailableError = class extends Error {
42370
42585
  constructor(context) {
@@ -43745,6 +43960,9 @@ var Session = class _Session {
43745
43960
  case "brands/generate-wireframe":
43746
43961
  await this.handleBrandGenerateWireframeRequest(msg);
43747
43962
  break;
43963
+ case "brands/analyze-photography":
43964
+ await this.handleBrandAnalyzePhotographyRequest(msg);
43965
+ break;
43748
43966
  case "rightfont/library":
43749
43967
  await this.handleRightFontLibraryRequest(msg);
43750
43968
  break;
@@ -45404,8 +45622,8 @@ var Session = class _Session {
45404
45622
  }
45405
45623
  async generateCommitMessage(cwd) {
45406
45624
  const files = await listUncommittedFiles(cwd);
45407
- const schema = z39.object({
45408
- message: z39.string().min(1).max(100).describe(
45625
+ const schema = z40.object({
45626
+ message: z40.string().min(1).max(100).describe(
45409
45627
  "Short feature-level summary, lowercase, imperative mood, no trailing period, no filename references."
45410
45628
  )
45411
45629
  });
@@ -45450,9 +45668,9 @@ var Session = class _Session {
45450
45668
  },
45451
45669
  { appostleHome: this.appostleHome }
45452
45670
  );
45453
- const schema = z39.object({
45454
- title: z39.string().min(1).max(72),
45455
- body: z39.string().min(1)
45671
+ const schema = z40.object({
45672
+ title: z40.string().min(1).max(72),
45673
+ body: z40.string().min(1)
45456
45674
  });
45457
45675
  const fileList = diff.structured && diff.structured.length > 0 ? [
45458
45676
  "Files changed:",
@@ -50944,6 +51162,38 @@ ${details}`.trim());
50944
51162
  });
50945
51163
  }
50946
51164
  }
51165
+ async handleBrandAnalyzePhotographyRequest(request) {
51166
+ const { requestId, workspaceRoot, brandPath, brief, referenceDescriptions } = request;
51167
+ try {
51168
+ const result = await analyzeAndApplyPhotographyStyle({
51169
+ agentManager: this.agentManager,
51170
+ workspaceRoot: expandTilde(workspaceRoot),
51171
+ brandPath: expandTilde(brandPath),
51172
+ brief,
51173
+ referenceDescriptions,
51174
+ logger: this.sessionLogger
51175
+ });
51176
+ this.emit({
51177
+ type: "brands/analyze-photography/response",
51178
+ payload: {
51179
+ requestId,
51180
+ updatedCount: result.updatedCount,
51181
+ error: null
51182
+ }
51183
+ });
51184
+ } catch (error) {
51185
+ const message = error instanceof Error ? error.message : String(error);
51186
+ this.sessionLogger.error({ err: error, brandPath }, "Failed to analyze photography style");
51187
+ this.emit({
51188
+ type: "brands/analyze-photography/response",
51189
+ payload: {
51190
+ requestId,
51191
+ updatedCount: 0,
51192
+ error: message
51193
+ }
51194
+ });
51195
+ }
51196
+ }
50947
51197
  async handleRightFontLibraryRequest(request) {
50948
51198
  const { requestId, libraryPath } = request;
50949
51199
  try {
@@ -53808,7 +54058,7 @@ import { pipeline } from "node:stream/promises";
53808
54058
  import { spawn as spawn7 } from "node:child_process";
53809
54059
 
53810
54060
  // ../server/src/server/speech/providers/local/sherpa/model-catalog.ts
53811
- import { z as z40 } from "zod";
54061
+ import { z as z41 } from "zod";
53812
54062
  var SHERPA_ONNX_MODEL_CATALOG = {
53813
54063
  "zipformer-bilingual-zh-en-2023-02-20": {
53814
54064
  kind: "stt-online",
@@ -53901,7 +54151,7 @@ function buildAliasMap(modelIds) {
53901
54151
  }
53902
54152
  function createAliasedModelIdSchema(params) {
53903
54153
  const validIds = new Set(params.modelIds);
53904
- return z40.string().trim().toLowerCase().refine(
54154
+ return z41.string().trim().toLowerCase().refine(
53905
54155
  (value) => validIds.has(value) || Object.prototype.hasOwnProperty.call(params.aliases, value),
53906
54156
  {
53907
54157
  message: "Invalid model id"
@@ -55533,20 +55783,20 @@ async function initializeLocalSpeechServices(params) {
55533
55783
  }
55534
55784
 
55535
55785
  // ../server/src/server/speech/providers/openai/config.ts
55536
- import { z as z41 } from "zod";
55786
+ import { z as z42 } from "zod";
55537
55787
  var DEFAULT_OPENAI_REALTIME_TRANSCRIPTION_MODEL = "gpt-4o-transcribe";
55538
55788
  var DEFAULT_OPENAI_TTS_MODEL = "tts-1";
55539
- var OpenAiTtsVoiceSchema = z41.enum(["alloy", "echo", "fable", "onyx", "nova", "shimmer"]);
55540
- var OpenAiTtsModelSchema = z41.enum(["tts-1", "tts-1-hd"]);
55541
- var NumberLikeSchema = z41.union([z41.number(), z41.string().trim().min(1)]);
55542
- var OptionalFiniteNumberSchema = NumberLikeSchema.pipe(z41.coerce.number().finite()).optional();
55543
- var OptionalTrimmedStringSchema = z41.string().trim().optional().transform((value) => value && value.length > 0 ? value : void 0);
55544
- var OpenAiSpeechResolutionSchema = z41.object({
55789
+ var OpenAiTtsVoiceSchema = z42.enum(["alloy", "echo", "fable", "onyx", "nova", "shimmer"]);
55790
+ var OpenAiTtsModelSchema = z42.enum(["tts-1", "tts-1-hd"]);
55791
+ var NumberLikeSchema = z42.union([z42.number(), z42.string().trim().min(1)]);
55792
+ var OptionalFiniteNumberSchema = NumberLikeSchema.pipe(z42.coerce.number().finite()).optional();
55793
+ var OptionalTrimmedStringSchema = z42.string().trim().optional().transform((value) => value && value.length > 0 ? value : void 0);
55794
+ var OpenAiSpeechResolutionSchema = z42.object({
55545
55795
  apiKey: OptionalTrimmedStringSchema,
55546
55796
  sttConfidenceThreshold: OptionalFiniteNumberSchema,
55547
55797
  sttModel: OptionalTrimmedStringSchema,
55548
- ttsVoice: z41.string().trim().toLowerCase().pipe(OpenAiTtsVoiceSchema).default("alloy"),
55549
- ttsModel: z41.string().trim().toLowerCase().pipe(OpenAiTtsModelSchema).default(DEFAULT_OPENAI_TTS_MODEL),
55798
+ ttsVoice: z42.string().trim().toLowerCase().pipe(OpenAiTtsVoiceSchema).default("alloy"),
55799
+ ttsModel: z42.string().trim().toLowerCase().pipe(OpenAiTtsModelSchema).default(DEFAULT_OPENAI_TTS_MODEL),
55550
55800
  realtimeTranscriptionModel: OptionalTrimmedStringSchema.default(
55551
55801
  DEFAULT_OPENAI_REALTIME_TRANSCRIPTION_MODEL
55552
55802
  )
@@ -56660,70 +56910,70 @@ function createSpeechService(params) {
56660
56910
  import { randomUUID as randomUUID12 } from "node:crypto";
56661
56911
  import { promises as fs16 } from "node:fs";
56662
56912
  import path28 from "node:path";
56663
- import { z as z42 } from "zod";
56664
- var SERIALIZABLE_CONFIG_SCHEMA = z42.object({
56665
- title: z42.string().nullable().optional(),
56666
- modeId: z42.string().nullable().optional(),
56667
- model: z42.string().nullable().optional(),
56668
- thinkingOptionId: z42.string().nullable().optional(),
56669
- featureValues: z42.record(z42.unknown()).nullable().optional(),
56670
- extra: z42.record(z42.any()).nullable().optional(),
56671
- systemPrompt: z42.string().nullable().optional(),
56672
- mcpServers: z42.record(z42.any()).nullable().optional()
56913
+ import { z as z43 } from "zod";
56914
+ var SERIALIZABLE_CONFIG_SCHEMA = z43.object({
56915
+ title: z43.string().nullable().optional(),
56916
+ modeId: z43.string().nullable().optional(),
56917
+ model: z43.string().nullable().optional(),
56918
+ thinkingOptionId: z43.string().nullable().optional(),
56919
+ featureValues: z43.record(z43.unknown()).nullable().optional(),
56920
+ extra: z43.record(z43.any()).nullable().optional(),
56921
+ systemPrompt: z43.string().nullable().optional(),
56922
+ mcpServers: z43.record(z43.any()).nullable().optional()
56673
56923
  }).nullable().optional();
56674
- var PERSISTENCE_HANDLE_SCHEMA = z42.object({
56675
- provider: z42.string(),
56676
- sessionId: z42.string(),
56677
- nativeHandle: z42.any().optional(),
56678
- metadata: z42.record(z42.any()).optional()
56924
+ var PERSISTENCE_HANDLE_SCHEMA = z43.object({
56925
+ provider: z43.string(),
56926
+ sessionId: z43.string(),
56927
+ nativeHandle: z43.any().optional(),
56928
+ metadata: z43.record(z43.any()).optional()
56679
56929
  }).nullable().optional();
56680
- var STORED_AGENT_SCHEMA = z42.object({
56681
- id: z42.string(),
56682
- provider: z42.string(),
56683
- cwd: z42.string(),
56684
- createdAt: z42.string(),
56685
- updatedAt: z42.string(),
56686
- lastActivityAt: z42.string().optional(),
56687
- lastUserMessageAt: z42.string().nullable().optional(),
56688
- title: z42.string().nullable().optional(),
56689
- labels: z42.record(z42.string()).default({}),
56930
+ var STORED_AGENT_SCHEMA = z43.object({
56931
+ id: z43.string(),
56932
+ provider: z43.string(),
56933
+ cwd: z43.string(),
56934
+ createdAt: z43.string(),
56935
+ updatedAt: z43.string(),
56936
+ lastActivityAt: z43.string().optional(),
56937
+ lastUserMessageAt: z43.string().nullable().optional(),
56938
+ title: z43.string().nullable().optional(),
56939
+ labels: z43.record(z43.string()).default({}),
56690
56940
  lastStatus: AgentStatusSchema.default("closed"),
56691
- lastModeId: z42.string().nullable().optional(),
56941
+ lastModeId: z43.string().nullable().optional(),
56692
56942
  config: SERIALIZABLE_CONFIG_SCHEMA,
56693
- runtimeInfo: z42.object({
56694
- provider: z42.string(),
56695
- sessionId: z42.string().nullable(),
56696
- model: z42.string().nullable().optional(),
56697
- thinkingOptionId: z42.string().nullable().optional(),
56698
- modeId: z42.string().nullable().optional(),
56699
- extra: z42.record(z42.unknown()).optional()
56943
+ runtimeInfo: z43.object({
56944
+ provider: z43.string(),
56945
+ sessionId: z43.string().nullable(),
56946
+ model: z43.string().nullable().optional(),
56947
+ thinkingOptionId: z43.string().nullable().optional(),
56948
+ modeId: z43.string().nullable().optional(),
56949
+ extra: z43.record(z43.unknown()).optional()
56700
56950
  }).optional(),
56701
- features: z42.array(AgentFeatureSchema).optional(),
56951
+ features: z43.array(AgentFeatureSchema).optional(),
56702
56952
  persistence: PERSISTENCE_HANDLE_SCHEMA,
56703
- lastError: z42.string().nullable().optional(),
56704
- requiresAttention: z42.boolean().optional(),
56705
- attentionReason: z42.enum(["finished", "error", "permission"]).nullable().optional(),
56706
- attentionTimestamp: z42.string().nullable().optional(),
56707
- internal: z42.boolean().optional(),
56708
- archivedAt: z42.string().nullable().optional(),
56953
+ lastError: z43.string().nullable().optional(),
56954
+ requiresAttention: z43.boolean().optional(),
56955
+ attentionReason: z43.enum(["finished", "error", "permission"]).nullable().optional(),
56956
+ attentionTimestamp: z43.string().nullable().optional(),
56957
+ internal: z43.boolean().optional(),
56958
+ archivedAt: z43.string().nullable().optional(),
56709
56959
  // Fork lineage (optional for backward compat with pre-fork records).
56710
- parentAgentId: z42.string().optional(),
56711
- forkedFromMessageUuid: z42.string().optional(),
56960
+ parentAgentId: z43.string().optional(),
56961
+ forkedFromMessageUuid: z43.string().optional(),
56712
56962
  // Multi-tenant session isolation: the auth-server user-id that created
56713
56963
  // (and therefore owns) this agent + the additive ACL of other users
56714
56964
  // granted access. Both optional/null-default for backward compatibility
56715
56965
  // with pre-Phase-2c records — those load with `null` owner and stay
56716
56966
  // visible to every connecting user (matches today's single-tenant
56717
56967
  // behavior). Set on new agents at create time via Session.ownerUserId.
56718
- ownerUserId: z42.string().nullable().optional(),
56719
- sharedWithUserIds: z42.array(z42.string()).default([]),
56968
+ ownerUserId: z43.string().nullable().optional(),
56969
+ sharedWithUserIds: z43.array(z43.string()).default([]),
56720
56970
  // Owner's display username — needed on resume to route to the correct
56721
56971
  // `CLAUDE_CONFIG_DIR` via `ensureClaudeProfile(username)` for agents
56722
56972
  // created by a shared (non-owner) user. Without this, a resumed shared-
56723
56973
  // user agent would silently fall back to the daemon owner's Claude
56724
56974
  // profile/subscription. Optional — pre-Phase-3 records rehydrate without
56725
56975
  // per-user profile routing.
56726
- ownerUsername: z42.string().optional()
56976
+ ownerUsername: z43.string().optional()
56727
56977
  });
56728
56978
  function parseStoredAgentRecord(value) {
56729
56979
  return STORED_AGENT_SCHEMA.parse(value);
@@ -56967,7 +57217,7 @@ async function writeFileAtomically(targetPath, payload) {
56967
57217
 
56968
57218
  // ../server/src/server/agent/mcp-server.ts
56969
57219
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
56970
- import { z as z43 } from "zod";
57220
+ import { z as z44 } from "zod";
56971
57221
 
56972
57222
  // ../server/src/server/json-utils.ts
56973
57223
  function ensureValidJson(value) {
@@ -57100,16 +57350,16 @@ function resolveChildAgentCwd(params) {
57100
57350
  }
57101
57351
  return resolvePathFromBase(params.parentCwd, requestedCwd);
57102
57352
  }
57103
- var TerminalSummarySchema = z43.object({
57104
- id: z43.string(),
57105
- name: z43.string(),
57106
- cwd: z43.string()
57353
+ var TerminalSummarySchema = z44.object({
57354
+ id: z44.string(),
57355
+ name: z44.string(),
57356
+ cwd: z44.string()
57107
57357
  });
57108
- var WorktreeSummarySchema = z43.object({
57109
- path: z43.string(),
57110
- createdAt: z43.string(),
57111
- branchName: z43.string().optional(),
57112
- head: z43.string().optional()
57358
+ var WorktreeSummarySchema = z44.object({
57359
+ path: z44.string(),
57360
+ createdAt: z44.string(),
57361
+ branchName: z44.string().optional(),
57362
+ head: z44.string().optional()
57113
57363
  });
57114
57364
  function resolveTerminalKeyToken(key, literal) {
57115
57365
  if (literal) {
@@ -57246,48 +57496,48 @@ async function createAgentMcpServer(options) {
57246
57496
  };
57247
57497
  };
57248
57498
  const agentToAgentInputSchema = {
57249
- cwd: z43.string().optional().describe("Optional working directory. Defaults to the caller agent working directory."),
57250
- title: z43.string().trim().min(1, "Title is required").max(60, "Title must be 60 characters or fewer").describe("Short descriptive title (<= 60 chars) summarizing the agent's focus."),
57499
+ cwd: z44.string().optional().describe("Optional working directory. Defaults to the caller agent working directory."),
57500
+ title: z44.string().trim().min(1, "Title is required").max(60, "Title must be 60 characters or fewer").describe("Short descriptive title (<= 60 chars) summarizing the agent's focus."),
57251
57501
  provider: AgentProviderEnum.optional().describe(
57252
57502
  "Optional agent implementation to spawn. Defaults to 'claude'."
57253
57503
  ),
57254
- model: z43.string().optional().describe("Model to use (e.g. claude-sonnet-4-20250514)"),
57255
- thinking: z43.string().optional().describe("Thinking option ID"),
57256
- labels: z43.record(z43.string(), z43.string()).optional().describe("Labels to set on the agent"),
57257
- initialPrompt: z43.string().trim().min(1, "initialPrompt is required").describe("Required first task to run immediately after creation."),
57258
- background: z43.boolean().optional().default(false).describe(
57504
+ model: z44.string().optional().describe("Model to use (e.g. claude-sonnet-4-20250514)"),
57505
+ thinking: z44.string().optional().describe("Thinking option ID"),
57506
+ labels: z44.record(z44.string(), z44.string()).optional().describe("Labels to set on the agent"),
57507
+ initialPrompt: z44.string().trim().min(1, "initialPrompt is required").describe("Required first task to run immediately after creation."),
57508
+ background: z44.boolean().optional().default(false).describe(
57259
57509
  "Run agent in background. If false (default), waits for completion or permission request. If true, returns immediately."
57260
57510
  ),
57261
- notifyOnFinish: z43.boolean().optional().default(false).describe(
57511
+ notifyOnFinish: z44.boolean().optional().default(false).describe(
57262
57512
  "Send a notification prompt to the caller agent when this agent finishes, errors, or needs permission. Requires a caller agent context."
57263
57513
  )
57264
57514
  };
57265
57515
  const topLevelInputSchema = {
57266
- cwd: z43.string().describe("Required working directory for the agent (absolute, relative, or ~)."),
57267
- title: z43.string().trim().min(1, "Title is required").max(60, "Title must be 60 characters or fewer").describe("Short descriptive title (<= 60 chars) summarizing the agent's focus."),
57516
+ cwd: z44.string().describe("Required working directory for the agent (absolute, relative, or ~)."),
57517
+ title: z44.string().trim().min(1, "Title is required").max(60, "Title must be 60 characters or fewer").describe("Short descriptive title (<= 60 chars) summarizing the agent's focus."),
57268
57518
  provider: AgentProviderEnum.optional().describe(
57269
57519
  "Optional agent implementation to spawn. Defaults to 'claude'."
57270
57520
  ),
57271
- model: z43.string().optional().describe("Model to use (e.g. claude-sonnet-4-20250514)"),
57272
- thinking: z43.string().optional().describe("Thinking option ID"),
57273
- labels: z43.record(z43.string(), z43.string()).optional().describe("Labels to set on the agent"),
57274
- initialPrompt: z43.string().trim().min(1, "initialPrompt is required").describe("Required first task to run immediately after creation."),
57275
- mode: z43.string().optional().describe("Optional session mode to configure before the first run."),
57276
- worktreeName: z43.string().optional().describe("Optional git worktree branch name (lowercase alphanumerics + hyphen)."),
57277
- baseBranch: z43.string().optional().describe("Required when worktreeName is set: the base branch to diff/merge against."),
57278
- refName: z43.string().min(1).optional().describe("Optional source ref for worktree creation."),
57279
- action: z43.enum(["branch-off", "checkout"]).optional().describe("Optional worktree creation action."),
57280
- githubPrNumber: z43.number().int().positive().optional().describe("Optional GitHub pull request number to checkout."),
57281
- background: z43.boolean().optional().default(false).describe(
57521
+ model: z44.string().optional().describe("Model to use (e.g. claude-sonnet-4-20250514)"),
57522
+ thinking: z44.string().optional().describe("Thinking option ID"),
57523
+ labels: z44.record(z44.string(), z44.string()).optional().describe("Labels to set on the agent"),
57524
+ initialPrompt: z44.string().trim().min(1, "initialPrompt is required").describe("Required first task to run immediately after creation."),
57525
+ mode: z44.string().optional().describe("Optional session mode to configure before the first run."),
57526
+ worktreeName: z44.string().optional().describe("Optional git worktree branch name (lowercase alphanumerics + hyphen)."),
57527
+ baseBranch: z44.string().optional().describe("Required when worktreeName is set: the base branch to diff/merge against."),
57528
+ refName: z44.string().min(1).optional().describe("Optional source ref for worktree creation."),
57529
+ action: z44.enum(["branch-off", "checkout"]).optional().describe("Optional worktree creation action."),
57530
+ githubPrNumber: z44.number().int().positive().optional().describe("Optional GitHub pull request number to checkout."),
57531
+ background: z44.boolean().optional().default(false).describe(
57282
57532
  "Run agent in background. If false (default), waits for completion or permission request. If true, returns immediately."
57283
57533
  ),
57284
- notifyOnFinish: z43.boolean().optional().default(false).describe(
57534
+ notifyOnFinish: z44.boolean().optional().default(false).describe(
57285
57535
  "Send a notification prompt to the caller agent when this agent finishes, errors, or needs permission. Requires a caller agent context."
57286
57536
  )
57287
57537
  };
57288
57538
  const createAgentInputSchema = callerAgentId ? agentToAgentInputSchema : topLevelInputSchema;
57289
- const agentToAgentCreateAgentArgsSchema = z43.object(agentToAgentInputSchema);
57290
- const topLevelCreateAgentArgsSchema = z43.object(topLevelInputSchema);
57539
+ const agentToAgentCreateAgentArgsSchema = z44.object(agentToAgentInputSchema);
57540
+ const topLevelCreateAgentArgsSchema = z44.object(topLevelInputSchema);
57291
57541
  if (options.voiceOnly || options.enableVoiceTools || callerContext?.enableVoiceTools) {
57292
57542
  server.registerTool(
57293
57543
  "speak",
@@ -57295,10 +57545,10 @@ async function createAgentMcpServer(options) {
57295
57545
  title: "Speak",
57296
57546
  description: "Speak text to the user via daemon-managed voice output. Blocks until playback completes.",
57297
57547
  inputSchema: {
57298
- text: z43.string().trim().min(1, "text is required").max(4e3, "text must be 4000 characters or fewer")
57548
+ text: z44.string().trim().min(1, "text is required").max(4e3, "text must be 4000 characters or fewer")
57299
57549
  },
57300
57550
  outputSchema: {
57301
- ok: z43.boolean()
57551
+ ok: z44.boolean()
57302
57552
  }
57303
57553
  },
57304
57554
  async (args, context) => {
@@ -57331,19 +57581,19 @@ async function createAgentMcpServer(options) {
57331
57581
  description: "Create a new Claude or Codex agent tied to a working directory. Optionally run an initial prompt immediately or create a git worktree for the agent.",
57332
57582
  inputSchema: createAgentInputSchema,
57333
57583
  outputSchema: {
57334
- agentId: z43.string(),
57584
+ agentId: z44.string(),
57335
57585
  type: AgentProviderEnum,
57336
57586
  status: AgentStatusEnum,
57337
- cwd: z43.string(),
57338
- currentModeId: z43.string().nullable(),
57339
- availableModes: z43.array(
57340
- z43.object({
57341
- id: z43.string(),
57342
- label: z43.string(),
57343
- description: z43.string().nullable().optional()
57587
+ cwd: z44.string(),
57588
+ currentModeId: z44.string().nullable(),
57589
+ availableModes: z44.array(
57590
+ z44.object({
57591
+ id: z44.string(),
57592
+ label: z44.string(),
57593
+ description: z44.string().nullable().optional()
57344
57594
  })
57345
57595
  ),
57346
- lastMessage: z43.string().nullable().optional(),
57596
+ lastMessage: z44.string().nullable().optional(),
57347
57597
  permission: AgentPermissionRequestPayloadSchema.nullable().optional()
57348
57598
  }
57349
57599
  },
@@ -57530,13 +57780,13 @@ async function createAgentMcpServer(options) {
57530
57780
  title: "Wait for agent",
57531
57781
  description: "Block until the agent requests permission or the current run completes. Returns the pending permission (if any) and recent activity summary.",
57532
57782
  inputSchema: {
57533
- agentId: z43.string().describe("Agent identifier returned by the create_agent tool")
57783
+ agentId: z44.string().describe("Agent identifier returned by the create_agent tool")
57534
57784
  },
57535
57785
  outputSchema: {
57536
- agentId: z43.string(),
57786
+ agentId: z44.string(),
57537
57787
  status: AgentStatusEnum,
57538
57788
  permission: AgentPermissionRequestPayloadSchema.nullable(),
57539
- lastMessage: z43.string().nullable()
57789
+ lastMessage: z44.string().nullable()
57540
57790
  }
57541
57791
  },
57542
57792
  async ({ agentId }, { signal }) => {
@@ -57597,20 +57847,20 @@ async function createAgentMcpServer(options) {
57597
57847
  title: "Send agent prompt",
57598
57848
  description: "Send a task to a running agent. Returns immediately after the agent begins processing.",
57599
57849
  inputSchema: {
57600
- agentId: z43.string(),
57601
- prompt: z43.string(),
57602
- sessionMode: z43.string().optional().describe("Optional mode to set before running the prompt."),
57603
- background: z43.boolean().optional().default(false).describe(
57850
+ agentId: z44.string(),
57851
+ prompt: z44.string(),
57852
+ sessionMode: z44.string().optional().describe("Optional mode to set before running the prompt."),
57853
+ background: z44.boolean().optional().default(false).describe(
57604
57854
  "Run agent in background. If false (default), waits for completion or permission request. If true, returns immediately."
57605
57855
  ),
57606
- notifyOnFinish: z43.boolean().optional().default(false).describe(
57856
+ notifyOnFinish: z44.boolean().optional().default(false).describe(
57607
57857
  "Send a notification prompt to the caller agent when this agent finishes, errors, or needs permission."
57608
57858
  )
57609
57859
  },
57610
57860
  outputSchema: {
57611
- success: z43.boolean(),
57861
+ success: z44.boolean(),
57612
57862
  status: AgentStatusEnum,
57613
- lastMessage: z43.string().nullable().optional(),
57863
+ lastMessage: z44.string().nullable().optional(),
57614
57864
  permission: AgentPermissionRequestPayloadSchema.nullable().optional()
57615
57865
  }
57616
57866
  },
@@ -57674,7 +57924,7 @@ async function createAgentMcpServer(options) {
57674
57924
  title: "Get agent status",
57675
57925
  description: "Return the latest snapshot for an agent, including lifecycle state, capabilities, and pending permissions.",
57676
57926
  inputSchema: {
57677
- agentId: z43.string()
57927
+ agentId: z44.string()
57678
57928
  },
57679
57929
  outputSchema: {
57680
57930
  status: AgentStatusEnum,
@@ -57721,10 +57971,10 @@ async function createAgentMcpServer(options) {
57721
57971
  title: "List agents",
57722
57972
  description: "List all live agents managed by the server.",
57723
57973
  inputSchema: {
57724
- includeArchived: z43.boolean().optional().default(false)
57974
+ includeArchived: z44.boolean().optional().default(false)
57725
57975
  },
57726
57976
  outputSchema: {
57727
- agents: z43.array(AgentSnapshotPayloadSchema)
57977
+ agents: z44.array(AgentSnapshotPayloadSchema)
57728
57978
  }
57729
57979
  },
57730
57980
  async ({ includeArchived }) => {
@@ -57749,10 +57999,10 @@ async function createAgentMcpServer(options) {
57749
57999
  title: "Cancel agent run",
57750
58000
  description: "Abort the agent's current run but keep the agent alive for future tasks.",
57751
58001
  inputSchema: {
57752
- agentId: z43.string()
58002
+ agentId: z44.string()
57753
58003
  },
57754
58004
  outputSchema: {
57755
- success: z43.boolean()
58005
+ success: z44.boolean()
57756
58006
  }
57757
58007
  },
57758
58008
  async ({ agentId }) => {
@@ -57772,10 +58022,10 @@ async function createAgentMcpServer(options) {
57772
58022
  title: "Archive agent",
57773
58023
  description: "Archive an agent (soft-delete). The agent is interrupted if running and removed from the active list.",
57774
58024
  inputSchema: {
57775
- agentId: z43.string()
58025
+ agentId: z44.string()
57776
58026
  },
57777
58027
  outputSchema: {
57778
- success: z43.boolean()
58028
+ success: z44.boolean()
57779
58029
  }
57780
58030
  },
57781
58031
  async ({ agentId }) => {
@@ -57793,10 +58043,10 @@ async function createAgentMcpServer(options) {
57793
58043
  title: "Kill agent",
57794
58044
  description: "Terminate an agent session permanently.",
57795
58045
  inputSchema: {
57796
- agentId: z43.string()
58046
+ agentId: z44.string()
57797
58047
  },
57798
58048
  outputSchema: {
57799
- success: z43.boolean()
58049
+ success: z44.boolean()
57800
58050
  }
57801
58051
  },
57802
58052
  async ({ agentId }) => {
@@ -57814,12 +58064,12 @@ async function createAgentMcpServer(options) {
57814
58064
  title: "Update agent",
57815
58065
  description: "Update an agent name and/or labels.",
57816
58066
  inputSchema: {
57817
- agentId: z43.string(),
57818
- name: z43.string().optional(),
57819
- labels: z43.record(z43.string(), z43.string()).optional().describe("Labels to set on the agent")
58067
+ agentId: z44.string(),
58068
+ name: z44.string().optional(),
58069
+ labels: z44.record(z44.string(), z44.string()).optional().describe("Labels to set on the agent")
57820
58070
  },
57821
58071
  outputSchema: {
57822
- success: z43.boolean()
58072
+ success: z44.boolean()
57823
58073
  }
57824
58074
  },
57825
58075
  async ({ agentId, name, labels }) => {
@@ -57851,11 +58101,11 @@ async function createAgentMcpServer(options) {
57851
58101
  title: "List terminals",
57852
58102
  description: "List terminals for a working directory or across all working directories.",
57853
58103
  inputSchema: {
57854
- cwd: z43.string().optional().describe("Optional working directory. Defaults to the caller agent cwd."),
57855
- all: z43.boolean().optional().describe("List terminals across all working directories.")
58104
+ cwd: z44.string().optional().describe("Optional working directory. Defaults to the caller agent cwd."),
58105
+ all: z44.boolean().optional().describe("List terminals across all working directories.")
57856
58106
  },
57857
58107
  outputSchema: {
57858
- terminals: z43.array(TerminalSummarySchema)
58108
+ terminals: z44.array(TerminalSummarySchema)
57859
58109
  }
57860
58110
  },
57861
58111
  async ({ cwd, all }) => {
@@ -57889,8 +58139,8 @@ async function createAgentMcpServer(options) {
57889
58139
  title: "Create terminal",
57890
58140
  description: "Create a terminal session for a working directory.",
57891
58141
  inputSchema: {
57892
- cwd: z43.string().optional().describe("Optional working directory. Defaults to the caller agent cwd."),
57893
- name: z43.string().optional().describe("Optional terminal name.")
58142
+ cwd: z44.string().optional().describe("Optional working directory. Defaults to the caller agent cwd."),
58143
+ name: z44.string().optional().describe("Optional terminal name.")
57894
58144
  },
57895
58145
  outputSchema: TerminalSummarySchema.shape
57896
58146
  },
@@ -57918,10 +58168,10 @@ async function createAgentMcpServer(options) {
57918
58168
  title: "Kill terminal",
57919
58169
  description: "Kill an existing terminal session.",
57920
58170
  inputSchema: {
57921
- terminalId: z43.string()
58171
+ terminalId: z44.string()
57922
58172
  },
57923
58173
  outputSchema: {
57924
- success: z43.boolean()
58174
+ success: z44.boolean()
57925
58175
  }
57926
58176
  },
57927
58177
  async ({ terminalId }) => {
@@ -57945,16 +58195,16 @@ async function createAgentMcpServer(options) {
57945
58195
  title: "Capture terminal",
57946
58196
  description: "Capture plain-text terminal output lines from a terminal session.",
57947
58197
  inputSchema: {
57948
- terminalId: z43.string(),
57949
- start: z43.number().optional(),
57950
- end: z43.number().optional(),
57951
- scrollback: z43.boolean().optional(),
57952
- stripAnsi: z43.boolean().optional().default(true)
58198
+ terminalId: z44.string(),
58199
+ start: z44.number().optional(),
58200
+ end: z44.number().optional(),
58201
+ scrollback: z44.boolean().optional(),
58202
+ stripAnsi: z44.boolean().optional().default(true)
57953
58203
  },
57954
58204
  outputSchema: {
57955
- terminalId: z43.string(),
57956
- lines: z43.array(z43.string()),
57957
- totalLines: z43.number().int().nonnegative()
58205
+ terminalId: z44.string(),
58206
+ lines: z44.array(z44.string()),
58207
+ totalLines: z44.number().int().nonnegative()
57958
58208
  }
57959
58209
  },
57960
58210
  async ({ terminalId, start, end, scrollback, stripAnsi: stripAnsi3 = true }) => {
@@ -57986,12 +58236,12 @@ async function createAgentMcpServer(options) {
57986
58236
  title: "Send terminal keys",
57987
58237
  description: "Send literal text or special key tokens to a terminal session.",
57988
58238
  inputSchema: {
57989
- terminalId: z43.string(),
57990
- keys: z43.string(),
57991
- literal: z43.boolean().optional()
58239
+ terminalId: z44.string(),
58240
+ keys: z44.string(),
58241
+ literal: z44.boolean().optional()
57992
58242
  },
57993
58243
  outputSchema: {
57994
- success: z43.boolean()
58244
+ success: z44.boolean()
57995
58245
  }
57996
58246
  },
57997
58247
  async ({ terminalId, keys, literal = false }) => {
@@ -58018,17 +58268,17 @@ async function createAgentMcpServer(options) {
58018
58268
  title: "Create schedule",
58019
58269
  description: "Create a recurring schedule that runs on an agent or a new agent.",
58020
58270
  inputSchema: {
58021
- prompt: z43.string().trim().min(1, "prompt is required"),
58022
- every: z43.string().optional(),
58023
- cron: z43.string().optional(),
58024
- name: z43.string().optional(),
58025
- target: z43.enum(["self", "new-agent"]).optional(),
58271
+ prompt: z44.string().trim().min(1, "prompt is required"),
58272
+ every: z44.string().optional(),
58273
+ cron: z44.string().optional(),
58274
+ name: z44.string().optional(),
58275
+ target: z44.enum(["self", "new-agent"]).optional(),
58026
58276
  provider: AgentProviderEnum.optional().describe(
58027
58277
  "Provider, or provider/model (for example: codex or codex/gpt-5.4)."
58028
58278
  ),
58029
- cwd: z43.string().optional(),
58030
- maxRuns: z43.number().int().positive().optional(),
58031
- expiresIn: z43.string().optional()
58279
+ cwd: z44.string().optional(),
58280
+ maxRuns: z44.number().int().positive().optional(),
58281
+ expiresIn: z44.string().optional()
58032
58282
  },
58033
58283
  outputSchema: ScheduleSummarySchema.shape
58034
58284
  },
@@ -58070,7 +58320,7 @@ async function createAgentMcpServer(options) {
58070
58320
  description: "List all schedules managed by the daemon.",
58071
58321
  inputSchema: {},
58072
58322
  outputSchema: {
58073
- schedules: z43.array(ScheduleSummarySchema)
58323
+ schedules: z44.array(ScheduleSummarySchema)
58074
58324
  }
58075
58325
  },
58076
58326
  async () => {
@@ -58092,7 +58342,7 @@ async function createAgentMcpServer(options) {
58092
58342
  title: "Inspect schedule",
58093
58343
  description: "Inspect a schedule and its run history.",
58094
58344
  inputSchema: {
58095
- id: z43.string()
58345
+ id: z44.string()
58096
58346
  },
58097
58347
  outputSchema: StoredScheduleSchema.shape
58098
58348
  },
@@ -58113,10 +58363,10 @@ async function createAgentMcpServer(options) {
58113
58363
  title: "Pause schedule",
58114
58364
  description: "Pause an active schedule.",
58115
58365
  inputSchema: {
58116
- id: z43.string()
58366
+ id: z44.string()
58117
58367
  },
58118
58368
  outputSchema: {
58119
- success: z43.boolean()
58369
+ success: z44.boolean()
58120
58370
  }
58121
58371
  },
58122
58372
  async ({ id }) => {
@@ -58136,10 +58386,10 @@ async function createAgentMcpServer(options) {
58136
58386
  title: "Resume schedule",
58137
58387
  description: "Resume a paused schedule.",
58138
58388
  inputSchema: {
58139
- id: z43.string()
58389
+ id: z44.string()
58140
58390
  },
58141
58391
  outputSchema: {
58142
- success: z43.boolean()
58392
+ success: z44.boolean()
58143
58393
  }
58144
58394
  },
58145
58395
  async ({ id }) => {
@@ -58159,10 +58409,10 @@ async function createAgentMcpServer(options) {
58159
58409
  title: "Delete schedule",
58160
58410
  description: "Delete a schedule permanently.",
58161
58411
  inputSchema: {
58162
- id: z43.string()
58412
+ id: z44.string()
58163
58413
  },
58164
58414
  outputSchema: {
58165
- success: z43.boolean()
58415
+ success: z44.boolean()
58166
58416
  }
58167
58417
  },
58168
58418
  async ({ id }) => {
@@ -58183,7 +58433,7 @@ async function createAgentMcpServer(options) {
58183
58433
  description: "List available agent providers and their modes.",
58184
58434
  inputSchema: {},
58185
58435
  outputSchema: {
58186
- providers: z43.array(ProviderSummarySchema)
58436
+ providers: z44.array(ProviderSummarySchema)
58187
58437
  }
58188
58438
  },
58189
58439
  async () => ({
@@ -58210,8 +58460,8 @@ async function createAgentMcpServer(options) {
58210
58460
  provider: AgentProviderEnum
58211
58461
  },
58212
58462
  outputSchema: {
58213
- provider: z43.string(),
58214
- models: z43.array(AgentModelSchema)
58463
+ provider: z44.string(),
58464
+ models: z44.array(AgentModelSchema)
58215
58465
  }
58216
58466
  },
58217
58467
  async ({ provider }) => {
@@ -58238,10 +58488,10 @@ async function createAgentMcpServer(options) {
58238
58488
  title: "List worktrees",
58239
58489
  description: "List Appostle-managed git worktrees for a repository.",
58240
58490
  inputSchema: {
58241
- cwd: z43.string().optional().describe("Optional repository cwd. Defaults to the caller agent cwd.")
58491
+ cwd: z44.string().optional().describe("Optional repository cwd. Defaults to the caller agent cwd.")
58242
58492
  },
58243
58493
  outputSchema: {
58244
- worktrees: z43.array(WorktreeSummarySchema)
58494
+ worktrees: z44.array(WorktreeSummarySchema)
58245
58495
  }
58246
58496
  },
58247
58497
  async ({ cwd }) => {
@@ -58262,16 +58512,16 @@ async function createAgentMcpServer(options) {
58262
58512
  title: "Create worktree",
58263
58513
  description: "Create a Appostle-managed git worktree.",
58264
58514
  inputSchema: {
58265
- cwd: z43.string().optional().describe("Optional repository cwd. Defaults to the caller agent cwd."),
58266
- branchName: z43.string().optional(),
58267
- baseBranch: z43.string().optional(),
58268
- refName: z43.string().min(1).optional(),
58269
- action: z43.enum(["branch-off", "checkout"]).optional(),
58270
- githubPrNumber: z43.number().int().positive().optional()
58515
+ cwd: z44.string().optional().describe("Optional repository cwd. Defaults to the caller agent cwd."),
58516
+ branchName: z44.string().optional(),
58517
+ baseBranch: z44.string().optional(),
58518
+ refName: z44.string().min(1).optional(),
58519
+ action: z44.enum(["branch-off", "checkout"]).optional(),
58520
+ githubPrNumber: z44.number().int().positive().optional()
58271
58521
  },
58272
58522
  outputSchema: {
58273
- branchName: z43.string(),
58274
- worktreePath: z43.string()
58523
+ branchName: z44.string(),
58524
+ worktreePath: z44.string()
58275
58525
  }
58276
58526
  },
58277
58527
  async ({ cwd, branchName, baseBranch, refName, action, githubPrNumber }) => {
@@ -58308,12 +58558,12 @@ async function createAgentMcpServer(options) {
58308
58558
  title: "Archive worktree",
58309
58559
  description: "Delete a Appostle-managed git worktree.",
58310
58560
  inputSchema: {
58311
- cwd: z43.string().optional().describe("Optional repository cwd. Defaults to the caller agent cwd."),
58312
- worktreePath: z43.string().optional(),
58313
- worktreeSlug: z43.string().optional()
58561
+ cwd: z44.string().optional().describe("Optional repository cwd. Defaults to the caller agent cwd."),
58562
+ worktreePath: z44.string().optional(),
58563
+ worktreeSlug: z44.string().optional()
58314
58564
  },
58315
58565
  outputSchema: {
58316
- success: z43.boolean()
58566
+ success: z44.boolean()
58317
58567
  }
58318
58568
  },
58319
58569
  async ({ cwd, worktreePath, worktreeSlug }) => {
@@ -58335,14 +58585,14 @@ async function createAgentMcpServer(options) {
58335
58585
  title: "Get agent activity",
58336
58586
  description: "Return recent agent timeline entries as a curated summary.",
58337
58587
  inputSchema: {
58338
- agentId: z43.string(),
58339
- limit: z43.number().optional().describe("Optional limit for number of activities to include (most recent first).")
58588
+ agentId: z44.string(),
58589
+ limit: z44.number().optional().describe("Optional limit for number of activities to include (most recent first).")
58340
58590
  },
58341
58591
  outputSchema: {
58342
- agentId: z43.string(),
58343
- updateCount: z43.number(),
58344
- currentModeId: z43.string().nullable(),
58345
- content: z43.string()
58592
+ agentId: z44.string(),
58593
+ updateCount: z44.number(),
58594
+ currentModeId: z44.string().nullable(),
58595
+ content: z44.string()
58346
58596
  }
58347
58597
  },
58348
58598
  async ({ agentId, limit }) => {
@@ -58383,12 +58633,12 @@ ${curatedContent}`;
58383
58633
  title: "Set agent session mode",
58384
58634
  description: "Switch the agent's session mode (plan, bypassPermissions, read-only, auto, etc.).",
58385
58635
  inputSchema: {
58386
- agentId: z43.string(),
58387
- modeId: z43.string()
58636
+ agentId: z44.string(),
58637
+ modeId: z44.string()
58388
58638
  },
58389
58639
  outputSchema: {
58390
- success: z43.boolean(),
58391
- newMode: z43.string()
58640
+ success: z44.boolean(),
58641
+ newMode: z44.string()
58392
58642
  }
58393
58643
  },
58394
58644
  async ({ agentId, modeId }) => {
@@ -58406,9 +58656,9 @@ ${curatedContent}`;
58406
58656
  description: "Return all pending permission requests across all agents with the normalized payloads.",
58407
58657
  inputSchema: {},
58408
58658
  outputSchema: {
58409
- permissions: z43.array(
58410
- z43.object({
58411
- agentId: z43.string(),
58659
+ permissions: z44.array(
58660
+ z44.object({
58661
+ agentId: z44.string(),
58412
58662
  status: AgentStatusEnum,
58413
58663
  request: AgentPermissionRequestPayloadSchema
58414
58664
  })
@@ -58436,12 +58686,12 @@ ${curatedContent}`;
58436
58686
  title: "Respond to permission",
58437
58687
  description: "Approve or deny a pending permission request with an AgentManager-compatible response payload.",
58438
58688
  inputSchema: {
58439
- agentId: z43.string(),
58440
- requestId: z43.string(),
58689
+ agentId: z44.string(),
58690
+ requestId: z44.string(),
58441
58691
  response: AgentPermissionResponseSchema
58442
58692
  },
58443
58693
  outputSchema: {
58444
- success: z43.boolean()
58694
+ success: z44.boolean()
58445
58695
  }
58446
58696
  },
58447
58697
  async ({ agentId, requestId, response }) => {
@@ -58764,81 +59014,81 @@ var CheckoutDiffManager = class {
58764
59014
  import { randomUUID as randomUUID13 } from "node:crypto";
58765
59015
  import { promises as fs17 } from "node:fs";
58766
59016
  import path30 from "node:path";
58767
- import { z as z44 } from "zod";
59017
+ import { z as z45 } from "zod";
58768
59018
  var LOOP_ID_LENGTH = 8;
58769
59019
  var DEFAULT_LOOP_PROVIDER = "claude";
58770
59020
  var MAX_VERIFY_OUTPUT_BYTES = 64 * 1024;
58771
- var LoopVerifyPromptSchema = z44.object({
58772
- passed: z44.boolean(),
58773
- reason: z44.string().min(1)
58774
- });
58775
- var LoopLogEntrySchema2 = z44.object({
58776
- seq: z44.number().int().positive(),
58777
- timestamp: z44.string(),
58778
- iteration: z44.number().int().positive().nullable(),
58779
- source: z44.enum(["loop", "worker", "verifier", "verify-check"]),
58780
- level: z44.enum(["info", "error"]),
58781
- text: z44.string()
58782
- });
58783
- var LoopVerifyCheckResultSchema2 = z44.object({
58784
- command: z44.string(),
58785
- exitCode: z44.number().int(),
58786
- passed: z44.boolean(),
58787
- stdout: z44.string(),
58788
- stderr: z44.string(),
58789
- startedAt: z44.string(),
58790
- completedAt: z44.string()
58791
- });
58792
- var LoopVerifyPromptResultSchema2 = z44.object({
58793
- passed: z44.boolean(),
58794
- reason: z44.string(),
58795
- verifierAgentId: z44.string().nullable(),
58796
- startedAt: z44.string(),
58797
- completedAt: z44.string()
58798
- });
58799
- var LoopIterationRecordSchema2 = z44.object({
58800
- index: z44.number().int().positive(),
58801
- workerAgentId: z44.string().nullable(),
58802
- workerStartedAt: z44.string(),
58803
- workerCompletedAt: z44.string().nullable(),
58804
- verifierAgentId: z44.string().nullable(),
58805
- status: z44.enum(["running", "succeeded", "failed", "stopped"]),
58806
- workerOutcome: z44.enum(["completed", "failed", "canceled"]).nullable(),
58807
- failureReason: z44.string().nullable(),
58808
- verifyChecks: z44.array(LoopVerifyCheckResultSchema2),
59021
+ var LoopVerifyPromptSchema = z45.object({
59022
+ passed: z45.boolean(),
59023
+ reason: z45.string().min(1)
59024
+ });
59025
+ var LoopLogEntrySchema2 = z45.object({
59026
+ seq: z45.number().int().positive(),
59027
+ timestamp: z45.string(),
59028
+ iteration: z45.number().int().positive().nullable(),
59029
+ source: z45.enum(["loop", "worker", "verifier", "verify-check"]),
59030
+ level: z45.enum(["info", "error"]),
59031
+ text: z45.string()
59032
+ });
59033
+ var LoopVerifyCheckResultSchema2 = z45.object({
59034
+ command: z45.string(),
59035
+ exitCode: z45.number().int(),
59036
+ passed: z45.boolean(),
59037
+ stdout: z45.string(),
59038
+ stderr: z45.string(),
59039
+ startedAt: z45.string(),
59040
+ completedAt: z45.string()
59041
+ });
59042
+ var LoopVerifyPromptResultSchema2 = z45.object({
59043
+ passed: z45.boolean(),
59044
+ reason: z45.string(),
59045
+ verifierAgentId: z45.string().nullable(),
59046
+ startedAt: z45.string(),
59047
+ completedAt: z45.string()
59048
+ });
59049
+ var LoopIterationRecordSchema2 = z45.object({
59050
+ index: z45.number().int().positive(),
59051
+ workerAgentId: z45.string().nullable(),
59052
+ workerStartedAt: z45.string(),
59053
+ workerCompletedAt: z45.string().nullable(),
59054
+ verifierAgentId: z45.string().nullable(),
59055
+ status: z45.enum(["running", "succeeded", "failed", "stopped"]),
59056
+ workerOutcome: z45.enum(["completed", "failed", "canceled"]).nullable(),
59057
+ failureReason: z45.string().nullable(),
59058
+ verifyChecks: z45.array(LoopVerifyCheckResultSchema2),
58809
59059
  verifyPrompt: LoopVerifyPromptResultSchema2.nullable()
58810
59060
  });
58811
- var LoopRecordSchema2 = z44.object({
58812
- id: z44.string(),
58813
- name: z44.string().nullable(),
58814
- prompt: z44.string(),
58815
- cwd: z44.string(),
58816
- provider: z44.string(),
58817
- model: z44.string().nullable(),
58818
- workerProvider: z44.string().nullable(),
58819
- workerModel: z44.string().nullable(),
58820
- verifierProvider: z44.string().nullable(),
58821
- verifierModel: z44.string().nullable(),
58822
- verifyPrompt: z44.string().nullable(),
58823
- verifyChecks: z44.array(z44.string()),
58824
- archive: z44.boolean(),
58825
- sleepMs: z44.number().int().nonnegative(),
58826
- maxIterations: z44.number().int().positive().nullable(),
58827
- maxTimeMs: z44.number().int().positive().nullable(),
58828
- status: z44.enum(["running", "succeeded", "failed", "stopped"]),
58829
- createdAt: z44.string(),
58830
- updatedAt: z44.string(),
58831
- startedAt: z44.string(),
58832
- completedAt: z44.string().nullable(),
58833
- stopRequestedAt: z44.string().nullable(),
58834
- iterations: z44.array(LoopIterationRecordSchema2),
58835
- logs: z44.array(LoopLogEntrySchema2),
58836
- nextLogSeq: z44.number().int().positive(),
58837
- activeIteration: z44.number().int().positive().nullable(),
58838
- activeWorkerAgentId: z44.string().nullable(),
58839
- activeVerifierAgentId: z44.string().nullable()
58840
- });
58841
- var StoredLoopsSchema = z44.array(LoopRecordSchema2);
59061
+ var LoopRecordSchema2 = z45.object({
59062
+ id: z45.string(),
59063
+ name: z45.string().nullable(),
59064
+ prompt: z45.string(),
59065
+ cwd: z45.string(),
59066
+ provider: z45.string(),
59067
+ model: z45.string().nullable(),
59068
+ workerProvider: z45.string().nullable(),
59069
+ workerModel: z45.string().nullable(),
59070
+ verifierProvider: z45.string().nullable(),
59071
+ verifierModel: z45.string().nullable(),
59072
+ verifyPrompt: z45.string().nullable(),
59073
+ verifyChecks: z45.array(z45.string()),
59074
+ archive: z45.boolean(),
59075
+ sleepMs: z45.number().int().nonnegative(),
59076
+ maxIterations: z45.number().int().positive().nullable(),
59077
+ maxTimeMs: z45.number().int().positive().nullable(),
59078
+ status: z45.enum(["running", "succeeded", "failed", "stopped"]),
59079
+ createdAt: z45.string(),
59080
+ updatedAt: z45.string(),
59081
+ startedAt: z45.string(),
59082
+ completedAt: z45.string().nullable(),
59083
+ stopRequestedAt: z45.string().nullable(),
59084
+ iterations: z45.array(LoopIterationRecordSchema2),
59085
+ logs: z45.array(LoopLogEntrySchema2),
59086
+ nextLogSeq: z45.number().int().positive(),
59087
+ activeIteration: z45.number().int().positive().nullable(),
59088
+ activeWorkerAgentId: z45.string().nullable(),
59089
+ activeVerifierAgentId: z45.string().nullable()
59090
+ });
59091
+ var StoredLoopsSchema = z45.array(LoopRecordSchema2);
58842
59092
  function nowIso() {
58843
59093
  return (/* @__PURE__ */ new Date()).toISOString();
58844
59094
  }
@@ -60033,8 +60283,8 @@ import { randomUUID as randomUUID15 } from "node:crypto";
60033
60283
  // ../server/src/server/quest/store.ts
60034
60284
  import { promises as fs18 } from "node:fs";
60035
60285
  import path31 from "node:path";
60036
- import { z as z45 } from "zod";
60037
- var StoredQuestsSchema = z45.array(QuestRecordSchema);
60286
+ import { z as z46 } from "zod";
60287
+ var StoredQuestsSchema = z46.array(QuestRecordSchema);
60038
60288
  var QuestStore = class {
60039
60289
  constructor(options) {
60040
60290
  this.filePath = path31.join(options.appostleHome, "quests", "quests.json");
@@ -60138,7 +60388,7 @@ function getRulesForKind(kind) {
60138
60388
  }
60139
60389
 
60140
60390
  // ../server/src/server/quest/quest-metadata-generator.ts
60141
- import { z as z46 } from "zod";
60391
+ import { z as z47 } from "zod";
60142
60392
  var MAX_AUTO_QUEST_NAME_CHARS = 40;
60143
60393
  function hasExplicitName(name) {
60144
60394
  return Boolean(name && name.trim().length > 0);
@@ -60150,7 +60400,7 @@ function normalizeAutoName(name) {
60150
60400
  }
60151
60401
  return normalized.slice(0, MAX_AUTO_QUEST_NAME_CHARS).trim() || null;
60152
60402
  }
60153
- function buildPrompt3(prompt) {
60403
+ function buildPrompt4(prompt) {
60154
60404
  return [
60155
60405
  "Generate a short label for a multi-agent quest based on the user prompt.",
60156
60406
  `Name: short descriptive label (<= ${MAX_AUTO_QUEST_NAME_CHARS} chars).`,
@@ -60168,8 +60418,8 @@ async function generateAndApplyQuestMetadata(options) {
60168
60418
  if (hasExplicitName(options.explicitName)) {
60169
60419
  return;
60170
60420
  }
60171
- const schema = z46.object({
60172
- name: z46.string().min(1).max(MAX_AUTO_QUEST_NAME_CHARS)
60421
+ const schema = z47.object({
60422
+ name: z47.string().min(1).max(MAX_AUTO_QUEST_NAME_CHARS)
60173
60423
  });
60174
60424
  const generator = options.deps?.generateStructuredAgentResponseWithFallback ?? generateStructuredAgentResponseWithFallback;
60175
60425
  let result;
@@ -60177,7 +60427,7 @@ async function generateAndApplyQuestMetadata(options) {
60177
60427
  result = await generator({
60178
60428
  manager: options.questService.agentManager,
60179
60429
  cwd: options.cwd,
60180
- prompt: buildPrompt3(prompt),
60430
+ prompt: buildPrompt4(prompt),
60181
60431
  schema,
60182
60432
  schemaName: "QuestMetadata",
60183
60433
  maxRetries: 2,
@@ -60849,12 +61099,12 @@ import { fileURLToPath as fileURLToPath5 } from "node:url";
60849
61099
 
60850
61100
  // ../server/src/server/quest/orchestrator-mcp.ts
60851
61101
  import { createSdkMcpServer as createSdkMcpServer2, tool as tool3 } from "@anthropic-ai/claude-agent-sdk";
60852
- import { z as z47 } from "zod";
61102
+ import { z as z48 } from "zod";
60853
61103
  var HANDOFF_INPUT_SHAPE = {
60854
- rolePath: z47.string().min(1).describe(
61104
+ rolePath: z48.string().min(1).describe(
60855
61105
  "Absolute filesystem path to the role .md file the worker should adopt as its system prompt. Must be one of the role file paths listed in your team roster \u2014 do not invent paths."
60856
61106
  ),
60857
- task: z47.string().min(1).describe(
61107
+ task: z48.string().min(1).describe(
60858
61108
  "Concrete, self-contained instruction for the worker. The worker has its own toolbelt and reads the role at rolePath as its system prompt \u2014 write the task as a normal user message describing what to do, what inputs to read, and where to write outputs. Reference the hivemind doc by absolute path if relevant."
60859
61109
  )
60860
61110
  };
@@ -62576,13 +62826,13 @@ function createTerminalManager() {
62576
62826
  }
62577
62827
 
62578
62828
  // ../server/src/shared/connection-offer.ts
62579
- import { z as z48 } from "zod";
62580
- var ConnectionOfferV2Schema = z48.object({
62581
- v: z48.literal(2),
62582
- serverId: z48.string().min(1),
62583
- daemonPublicKeyB64: z48.string().min(1),
62584
- relay: z48.object({
62585
- endpoint: z48.string().min(1)
62829
+ import { z as z49 } from "zod";
62830
+ var ConnectionOfferV2Schema = z49.object({
62831
+ v: z49.literal(2),
62832
+ serverId: z49.string().min(1),
62833
+ daemonPublicKeyB64: z49.string().min(1),
62834
+ relay: z49.object({
62835
+ endpoint: z49.string().min(1)
62586
62836
  })
62587
62837
  });
62588
62838
 
@@ -64212,21 +64462,21 @@ async function closeAllAgents(logger, agentManager) {
64212
64462
 
64213
64463
  // ../server/src/server/config.ts
64214
64464
  import path37 from "node:path";
64215
- import { z as z52 } from "zod";
64465
+ import { z as z53 } from "zod";
64216
64466
 
64217
64467
  // ../server/src/server/speech/speech-config-resolver.ts
64218
- import { z as z51 } from "zod";
64468
+ import { z as z52 } from "zod";
64219
64469
 
64220
64470
  // ../server/src/server/speech/providers/local/config.ts
64221
64471
  import path36 from "node:path";
64222
- import { z as z49 } from "zod";
64472
+ import { z as z50 } from "zod";
64223
64473
  var DEFAULT_LOCAL_MODELS_SUBDIR = path36.join("models", "local-speech");
64224
- var NumberLikeSchema2 = z49.union([z49.number(), z49.string().trim().min(1)]);
64225
- var OptionalFiniteNumberSchema2 = NumberLikeSchema2.pipe(z49.coerce.number().finite()).optional();
64226
- var OptionalIntegerSchema = NumberLikeSchema2.pipe(z49.coerce.number().int()).optional();
64227
- var LocalSpeechResolutionSchema = z49.object({
64228
- includeProviderConfig: z49.boolean(),
64229
- modelsDir: z49.string().trim().min(1),
64474
+ var NumberLikeSchema2 = z50.union([z50.number(), z50.string().trim().min(1)]);
64475
+ var OptionalFiniteNumberSchema2 = NumberLikeSchema2.pipe(z50.coerce.number().finite()).optional();
64476
+ var OptionalIntegerSchema = NumberLikeSchema2.pipe(z50.coerce.number().int()).optional();
64477
+ var LocalSpeechResolutionSchema = z50.object({
64478
+ includeProviderConfig: z50.boolean(),
64479
+ modelsDir: z50.string().trim().min(1),
64230
64480
  dictationLocalSttModel: LocalSttModelIdSchema.default(DEFAULT_LOCAL_STT_MODEL),
64231
64481
  voiceLocalSttModel: LocalSttModelIdSchema.default(DEFAULT_LOCAL_STT_MODEL),
64232
64482
  voiceLocalTtsModel: LocalTtsModelIdSchema.default(DEFAULT_LOCAL_TTS_MODEL),
@@ -64282,17 +64532,17 @@ function resolveLocalSpeechConfig(params) {
64282
64532
  }
64283
64533
 
64284
64534
  // ../server/src/server/speech/speech-types.ts
64285
- import { z as z50 } from "zod";
64286
- var SpeechProviderIdSchema2 = z50.enum(["openai", "local"]);
64287
- var RequestedSpeechProviderSchema = z50.object({
64535
+ import { z as z51 } from "zod";
64536
+ var SpeechProviderIdSchema2 = z51.enum(["openai", "local"]);
64537
+ var RequestedSpeechProviderSchema = z51.object({
64288
64538
  provider: SpeechProviderIdSchema2,
64289
- explicit: z50.boolean(),
64290
- enabled: z50.boolean().optional()
64539
+ explicit: z51.boolean(),
64540
+ enabled: z51.boolean().optional()
64291
64541
  });
64292
64542
 
64293
64543
  // ../server/src/server/speech/speech-config-resolver.ts
64294
- var OptionalSpeechProviderSchema = z51.string().trim().toLowerCase().pipe(SpeechProviderIdSchema2).optional();
64295
- var OptionalBooleanFlagSchema = z51.union([z51.boolean(), z51.string().trim().toLowerCase()]).optional().transform((value) => {
64544
+ var OptionalSpeechProviderSchema = z52.string().trim().toLowerCase().pipe(SpeechProviderIdSchema2).optional();
64545
+ var OptionalBooleanFlagSchema = z52.union([z52.boolean(), z52.string().trim().toLowerCase()]).optional().transform((value) => {
64296
64546
  if (typeof value === "boolean") {
64297
64547
  return value;
64298
64548
  }
@@ -64307,7 +64557,7 @@ var OptionalBooleanFlagSchema = z51.union([z51.boolean(), z51.string().trim().to
64307
64557
  }
64308
64558
  return void 0;
64309
64559
  });
64310
- var RequestedSpeechProvidersSchema = z51.object({
64560
+ var RequestedSpeechProvidersSchema = z52.object({
64311
64561
  dictationStt: OptionalSpeechProviderSchema.default("local"),
64312
64562
  voiceTurnDetection: OptionalSpeechProviderSchema.default("local"),
64313
64563
  voiceStt: OptionalSpeechProviderSchema.default("local"),
@@ -64416,9 +64666,9 @@ function parseBooleanEnv(value) {
64416
64666
  }
64417
64667
  return void 0;
64418
64668
  }
64419
- var OptionalVoiceLlmProviderSchema = z52.union([z52.string(), z52.null(), z52.undefined()]).transform(
64669
+ var OptionalVoiceLlmProviderSchema = z53.union([z53.string(), z53.null(), z53.undefined()]).transform(
64420
64670
  (value) => typeof value === "string" ? value.trim().toLowerCase() : null
64421
- ).pipe(z52.union([AgentProviderSchema, z52.null()]));
64671
+ ).pipe(z53.union([AgentProviderSchema, z53.null()]));
64422
64672
  function parseOptionalVoiceLlmProvider(value) {
64423
64673
  const parsed = OptionalVoiceLlmProviderSchema.safeParse(value);
64424
64674
  return parsed.success ? parsed.data : null;