appostle-installer 0.0.7 → 0.0.9

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/appostle.js CHANGED
@@ -1664,7 +1664,8 @@ function toAgentPayload(agent, options) {
1664
1664
  pendingPermissions: sanitizePendingPermissions(agent.pendingPermissions),
1665
1665
  persistence: sanitizePersistenceHandle(agent.persistence),
1666
1666
  title: options?.title ?? null,
1667
- labels: agent.labels
1667
+ labels: agent.labels,
1668
+ internal: agent.internal
1668
1669
  };
1669
1670
  const usage = sanitizeUsage(agent.lastUsage);
1670
1671
  if (usage !== void 0) {
@@ -1734,7 +1735,8 @@ function buildStoredAgentPayload(record, providerRegistry, logger) {
1734
1735
  attentionReason: record.attentionReason ?? null,
1735
1736
  attentionTimestamp: record.attentionTimestamp ?? null,
1736
1737
  archivedAt: record.archivedAt ?? null,
1737
- labels: record.labels
1738
+ labels: record.labels,
1739
+ internal: record.internal
1738
1740
  };
1739
1741
  }
1740
1742
  function resolveStoredAgentPayloadUpdatedAt(record) {
@@ -1783,34 +1785,42 @@ function cloneAvailableModes(modes) {
1783
1785
  function normalizeFeatures(features) {
1784
1786
  return Array.isArray(features) ? features.map((feature) => ({ ...feature })) : [];
1785
1787
  }
1786
- function sanitizeOptionalJson(value) {
1788
+ var SANITIZE_MAX_DEPTH = 32;
1789
+ function sanitizeOptionalJson(value, seen = /* @__PURE__ */ new WeakSet(), depth = 0) {
1787
1790
  if (value === void 0) {
1788
1791
  return void 0;
1789
1792
  }
1790
1793
  if (value === null) {
1791
1794
  return null;
1792
1795
  }
1793
- if (Array.isArray(value)) {
1794
- const sanitized = value.map((item) => sanitizeOptionalJson(item)).filter((item) => item !== void 0);
1795
- return sanitized;
1796
+ if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
1797
+ return value;
1796
1798
  }
1797
1799
  if (value instanceof Date) {
1798
1800
  return value.toISOString();
1799
1801
  }
1800
- if (typeof value === "object") {
1801
- const result = {};
1802
- for (const [key, val] of Object.entries(value)) {
1803
- const sanitized = sanitizeOptionalJson(val);
1804
- if (sanitized !== void 0) {
1805
- result[key] = sanitized;
1806
- }
1807
- }
1808
- return Object.keys(result).length ? result : void 0;
1802
+ if (typeof value !== "object") {
1803
+ return void 0;
1809
1804
  }
1810
- if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
1811
- return value;
1805
+ if (depth >= SANITIZE_MAX_DEPTH) {
1806
+ return void 0;
1812
1807
  }
1813
- return void 0;
1808
+ if (seen.has(value)) {
1809
+ return void 0;
1810
+ }
1811
+ seen.add(value);
1812
+ if (Array.isArray(value)) {
1813
+ const sanitized = value.map((item) => sanitizeOptionalJson(item, seen, depth + 1)).filter((item) => item !== void 0);
1814
+ return sanitized;
1815
+ }
1816
+ const result = {};
1817
+ for (const [key, val] of Object.entries(value)) {
1818
+ const sanitized = sanitizeOptionalJson(val, seen, depth + 1);
1819
+ if (sanitized !== void 0) {
1820
+ result[key] = sanitized;
1821
+ }
1822
+ }
1823
+ return Object.keys(result).length ? result : void 0;
1814
1824
  }
1815
1825
  function isJsonObject(value) {
1816
1826
  return typeof value === "object" && value !== null && !Array.isArray(value);
@@ -1871,6 +1881,34 @@ function sanitizeUsage(value) {
1871
1881
  } else if (contextWindowUsedTokens !== void 0 && contextWindowUsedTokens !== null) {
1872
1882
  return void 0;
1873
1883
  }
1884
+ const rateLimits = sanitized.rateLimits;
1885
+ if (Array.isArray(rateLimits)) {
1886
+ const VALID_RATE_LIMIT_TYPES = /* @__PURE__ */ new Set([
1887
+ "five_hour",
1888
+ "seven_day",
1889
+ "seven_day_opus",
1890
+ "seven_day_sonnet",
1891
+ "overage"
1892
+ ]);
1893
+ const sanitizedRateLimits = [];
1894
+ for (const entry of rateLimits) {
1895
+ if (!entry || typeof entry !== "object") continue;
1896
+ const { rateLimitType, utilization, resetsAt } = entry;
1897
+ if (typeof rateLimitType !== "string" || !VALID_RATE_LIMIT_TYPES.has(rateLimitType)) continue;
1898
+ if (typeof utilization !== "number" || !Number.isFinite(utilization)) continue;
1899
+ const limit = {
1900
+ rateLimitType,
1901
+ utilization
1902
+ };
1903
+ if (typeof resetsAt === "number" && Number.isFinite(resetsAt)) {
1904
+ limit.resetsAt = resetsAt;
1905
+ }
1906
+ sanitizedRateLimits.push(limit);
1907
+ }
1908
+ if (sanitizedRateLimits.length > 0) {
1909
+ result.rateLimits = sanitizedRateLimits;
1910
+ }
1911
+ }
1874
1912
  return Object.keys(result).length ? result : void 0;
1875
1913
  }
1876
1914
  function sanitizeRuntimeInfo(runtimeInfo) {
@@ -2647,6 +2685,13 @@ var QuestRecordSchema = z8.object({
2647
2685
  cwd: z8.string(),
2648
2686
  /** User's task prompt — fed to every card unless overridden per-card. */
2649
2687
  prompt: z8.string(),
2688
+ /**
2689
+ * Short auto-generated label for the quest, derived from the user prompt by a
2690
+ * small internal metadata agent (mirrors how single-agent sessions get a
2691
+ * title). Empty string until generation finishes (or if it fails). Optional +
2692
+ * default so old persisted records remain valid.
2693
+ */
2694
+ name: z8.string().optional().default(""),
2650
2695
  defaultProvider: AgentProviderSchema,
2651
2696
  defaultModel: z8.string().nullable(),
2652
2697
  termination: QuestTerminationSchema,
@@ -2717,6 +2762,8 @@ var QuestListItemSchema = z9.object({
2717
2762
  status: QuestStatusSchema,
2718
2763
  cwd: z9.string(),
2719
2764
  prompt: z9.string(),
2765
+ /** Auto-generated short label. Optional for backward compat with old daemons. */
2766
+ name: z9.string().optional().default(""),
2720
2767
  createdAt: z9.string(),
2721
2768
  updatedAt: z9.string()
2722
2769
  });
@@ -3068,13 +3115,25 @@ var AgentCapabilityFlagsSchema = z10.object({
3068
3115
  supportsReasoningStream: z10.boolean(),
3069
3116
  supportsToolInvocations: z10.boolean()
3070
3117
  });
3118
+ var AgentRateLimitSchema = z10.object({
3119
+ rateLimitType: z10.enum([
3120
+ "five_hour",
3121
+ "seven_day",
3122
+ "seven_day_opus",
3123
+ "seven_day_sonnet",
3124
+ "overage"
3125
+ ]),
3126
+ utilization: z10.number(),
3127
+ resetsAt: z10.number().optional()
3128
+ });
3071
3129
  var AgentUsageSchema = z10.object({
3072
3130
  inputTokens: z10.number().optional(),
3073
3131
  cachedInputTokens: z10.number().optional(),
3074
3132
  outputTokens: z10.number().optional(),
3075
3133
  totalCostUsd: z10.number().optional(),
3076
3134
  contextWindowMaxTokens: z10.number().optional(),
3077
- contextWindowUsedTokens: z10.number().optional()
3135
+ contextWindowUsedTokens: z10.number().optional(),
3136
+ rateLimits: z10.array(AgentRateLimitSchema).optional()
3078
3137
  });
3079
3138
  var McpStdioServerConfigSchema = z10.object({
3080
3139
  type: z10.literal("stdio"),
@@ -3460,7 +3519,15 @@ var AgentSnapshotPayloadSchema = z10.object({
3460
3519
  archivedAt: z10.string().nullable().optional(),
3461
3520
  // Fork lineage — optional for backward compat with pre-fork agents.
3462
3521
  parentAgentId: z10.string().optional(),
3463
- forkedFromMessageUuid: z10.string().optional()
3522
+ forkedFromMessageUuid: z10.string().optional(),
3523
+ /**
3524
+ * True when the agent is a system-spawned helper (orchestrator queens,
3525
+ * handoff workers). Optional for backward compat — older clients ignore
3526
+ * the field. Newer clients filter these out of workspace tab lists / agent
3527
+ * lists at display time. The agent itself is a real, full-featured session
3528
+ * in every other respect; `internal` is a UI visibility hint, nothing more.
3529
+ */
3530
+ internal: z10.boolean().optional()
3464
3531
  });
3465
3532
  var VoiceAudioChunkMessageSchema = z10.object({
3466
3533
  type: z10.literal("voice_audio_chunk"),
@@ -16691,6 +16758,8 @@ function toClaudeSdkMcpConfig(config) {
16691
16758
  url: config.url,
16692
16759
  headers: config.headers
16693
16760
  };
16761
+ case "sdk":
16762
+ return config.config;
16694
16763
  }
16695
16764
  }
16696
16765
  var homeMcpServersCache = null;
@@ -18610,6 +18679,43 @@ ${error.stack ?? ""}` : JSON.stringify(error);
18610
18679
  }
18611
18680
  break;
18612
18681
  }
18682
+ case "rate_limit_event": {
18683
+ const info = message.rate_limit_info;
18684
+ if (info && typeof info === "object") {
18685
+ const { rateLimitType, utilization, resetsAt } = info;
18686
+ const VALID_TYPES = /* @__PURE__ */ new Set([
18687
+ "five_hour",
18688
+ "seven_day",
18689
+ "seven_day_opus",
18690
+ "seven_day_sonnet",
18691
+ "overage"
18692
+ ]);
18693
+ if (typeof rateLimitType === "string" && VALID_TYPES.has(rateLimitType) && typeof utilization === "number") {
18694
+ const rateLimit = {
18695
+ rateLimitType,
18696
+ utilization
18697
+ };
18698
+ if (typeof resetsAt === "number") {
18699
+ rateLimit.resetsAt = resetsAt;
18700
+ }
18701
+ const existingLimits = this.lastRateLimits ?? [];
18702
+ const updated = existingLimits.filter((l) => l.rateLimitType !== rateLimitType);
18703
+ updated.push(rateLimit);
18704
+ this.lastRateLimits = updated;
18705
+ const usage = {
18706
+ rateLimits: updated
18707
+ };
18708
+ if (this.lastContextWindowMaxTokens !== void 0) {
18709
+ usage.contextWindowMaxTokens = this.lastContextWindowMaxTokens;
18710
+ }
18711
+ if (this.lastContextWindowUsedTokens !== void 0) {
18712
+ usage.contextWindowUsedTokens = this.lastContextWindowUsedTokens;
18713
+ }
18714
+ events.push({ type: "usage_updated", provider: "claude", usage });
18715
+ }
18716
+ }
18717
+ break;
18718
+ }
18613
18719
  default:
18614
18720
  break;
18615
18721
  }
@@ -18718,6 +18824,9 @@ ${error.stack ?? ""}` : JSON.stringify(error);
18718
18824
  outputTokens: message.usage.output_tokens,
18719
18825
  totalCostUsd: message.total_cost_usd
18720
18826
  };
18827
+ if (this.lastRateLimits !== void 0) {
18828
+ usage.rateLimits = this.lastRateLimits;
18829
+ }
18721
18830
  const contextWindowMaxTokens = extractContextWindowSize(modelUsage ?? message.modelUsage);
18722
18831
  if (contextWindowMaxTokens !== void 0) {
18723
18832
  this.lastContextWindowMaxTokens = contextWindowMaxTokens;
@@ -19087,10 +19196,10 @@ ${error.stack ?? ""}` : JSON.stringify(error);
19087
19196
  return void 0;
19088
19197
  }
19089
19198
  const server = entry?.server ?? block.server ?? "tool";
19090
- const tool = entry?.name ?? block.tool_name ?? "tool";
19199
+ const tool2 = entry?.name ?? block.tool_name ?? "tool";
19091
19200
  const content = coerceToolResultContentToString(block.content);
19092
19201
  const input = entry?.input;
19093
- const structured = this.buildStructuredToolResult(server, tool, content, input);
19202
+ const structured = this.buildStructuredToolResult(server, tool2, content, input);
19094
19203
  if (structured) {
19095
19204
  return structured;
19096
19205
  }
@@ -19107,9 +19216,9 @@ ${error.stack ?? ""}` : JSON.stringify(error);
19107
19216
  }
19108
19217
  return Object.keys(result).length > 0 ? result : void 0;
19109
19218
  }
19110
- buildStructuredToolResult(server, tool, output, input) {
19219
+ buildStructuredToolResult(server, tool2, output, input) {
19111
19220
  const normalizedServer = server.toLowerCase();
19112
- const normalizedTool = tool.toLowerCase();
19221
+ const normalizedTool = tool2.toLowerCase();
19113
19222
  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))) {
19114
19223
  const command = this.extractCommandText(input ?? {}) ?? "command";
19115
19224
  return {
@@ -20423,8 +20532,8 @@ function resolveStatus(rawStatus, error, output) {
20423
20532
  }
20424
20533
  return output !== null && output !== void 0 ? "completed" : "running";
20425
20534
  }
20426
- function buildMcpToolName(server, tool) {
20427
- const trimmedTool = tool.trim();
20535
+ function buildMcpToolName(server, tool2) {
20536
+ const trimmedTool = tool2.trim();
20428
20537
  if (!trimmedTool) {
20429
20538
  return "tool";
20430
20539
  }
@@ -20594,11 +20703,11 @@ function mapFileChangeItem(item, options) {
20594
20703
  };
20595
20704
  }
20596
20705
  function mapMcpToolCallItem(item, options) {
20597
- const tool = item.tool.trim();
20598
- if (!tool) {
20706
+ const tool2 = item.tool.trim();
20707
+ if (!tool2) {
20599
20708
  return null;
20600
20709
  }
20601
- const name = buildMcpToolName(item.server, tool);
20710
+ const name = buildMcpToolName(item.server, tool2);
20602
20711
  const input = item.arguments ?? null;
20603
20712
  const output = item.result ?? null;
20604
20713
  const error = item.error ?? null;
@@ -21559,6 +21668,8 @@ function toCodexMcpConfig(config) {
21559
21668
  url: config.url,
21560
21669
  http_headers: config.headers
21561
21670
  };
21671
+ case "sdk":
21672
+ return null;
21562
21673
  }
21563
21674
  }
21564
21675
  var CodexAppServerClient = class {
@@ -23701,7 +23812,8 @@ var CodexAppServerAgentSession = class {
23701
23812
  if (this.config.mcpServers) {
23702
23813
  const mcpServers = {};
23703
23814
  for (const [name, serverConfig] of Object.entries(this.config.mcpServers)) {
23704
- mcpServers[name] = toCodexMcpConfig(serverConfig);
23815
+ const codexConfig = toCodexMcpConfig(serverConfig);
23816
+ if (codexConfig) mcpServers[name] = codexConfig;
23705
23817
  }
23706
23818
  innerConfig.mcp_servers = mcpServers;
23707
23819
  }
@@ -25747,9 +25859,10 @@ function normalizeMcpServers(servers) {
25747
25859
  if (!servers) {
25748
25860
  return [];
25749
25861
  }
25750
- return Object.entries(servers).map(([name, config]) => {
25862
+ const out = [];
25863
+ for (const [name, config] of Object.entries(servers)) {
25751
25864
  if (config.type === "stdio") {
25752
- return {
25865
+ out.push({
25753
25866
  name,
25754
25867
  command: config.command,
25755
25868
  args: config.args ?? [],
@@ -25757,29 +25870,35 @@ function normalizeMcpServers(servers) {
25757
25870
  name: envName,
25758
25871
  value
25759
25872
  }))
25760
- };
25873
+ });
25874
+ continue;
25761
25875
  }
25762
25876
  if (config.type === "http") {
25763
- return {
25877
+ out.push({
25764
25878
  type: "http",
25765
25879
  name,
25766
25880
  url: config.url,
25767
25881
  headers: Object.entries(config.headers ?? {}).map(([headerName, value]) => ({
25768
25882
  name: headerName,
25769
- value
25883
+ value: String(value)
25770
25884
  }))
25771
- };
25885
+ });
25886
+ continue;
25772
25887
  }
25773
- return {
25774
- type: "sse",
25775
- name,
25776
- url: config.url,
25777
- headers: Object.entries(config.headers ?? {}).map(([headerName, value]) => ({
25778
- name: headerName,
25779
- value
25780
- }))
25781
- };
25782
- });
25888
+ if (config.type === "sse") {
25889
+ out.push({
25890
+ type: "sse",
25891
+ name,
25892
+ url: config.url,
25893
+ headers: Object.entries(config.headers ?? {}).map(([headerName, value]) => ({
25894
+ name: headerName,
25895
+ value: String(value)
25896
+ }))
25897
+ });
25898
+ continue;
25899
+ }
25900
+ }
25901
+ return out;
25783
25902
  }
25784
25903
  function toACPContentBlocks(prompt) {
25785
25904
  if (typeof prompt === "string") {
@@ -26610,12 +26729,15 @@ function toOpenCodeMcpConfig(config) {
26610
26729
  enabled: true
26611
26730
  };
26612
26731
  }
26613
- return {
26614
- type: "remote",
26615
- url: config.url,
26616
- ...config.headers ? { headers: config.headers } : {},
26617
- enabled: true
26618
- };
26732
+ if (config.type === "http" || config.type === "sse") {
26733
+ return {
26734
+ type: "remote",
26735
+ url: config.url,
26736
+ ...config.headers ? { headers: config.headers } : {},
26737
+ enabled: true
26738
+ };
26739
+ }
26740
+ return null;
26619
26741
  }
26620
26742
  function stringifyUnknownError(error) {
26621
26743
  if (typeof error === "string") {
@@ -27558,7 +27680,7 @@ function translateOpenCodeEvent(event, state) {
27558
27680
  break;
27559
27681
  }
27560
27682
  const metadata = readOpenCodeRecord(event.properties.metadata);
27561
- const tool = readOpenCodeRecord(event.properties.tool);
27683
+ const tool2 = readOpenCodeRecord(event.properties.tool);
27562
27684
  const patterns = Array.isArray(event.properties.patterns) ? event.properties.patterns.filter((value) => typeof value === "string") : [];
27563
27685
  const command = readPermissionField(metadata, PERMISSION_COMMAND_KEYS);
27564
27686
  const cwd = readPermissionField(metadata, PERMISSION_CWD_KEYS);
@@ -27566,7 +27688,7 @@ function translateOpenCodeEvent(event, state) {
27566
27688
  const input = buildOpenCodePermissionInput({
27567
27689
  patterns,
27568
27690
  metadata,
27569
- tool,
27691
+ tool: tool2,
27570
27692
  command
27571
27693
  });
27572
27694
  const detail = buildOpenCodePermissionDetail({
@@ -28314,6 +28436,7 @@ var OpenCodeAgentSession = class {
28314
28436
  async configureMcpServers(mcpServers) {
28315
28437
  for (const [name, serverConfig] of Object.entries(mcpServers)) {
28316
28438
  const mappedConfig = toOpenCodeMcpConfig(serverConfig);
28439
+ if (!mappedConfig) continue;
28317
28440
  await this.registerMcpServer(name, mappedConfig);
28318
28441
  }
28319
28442
  }
@@ -39368,7 +39491,7 @@ ${details}`.trim());
39368
39491
  );
39369
39492
  const registryRecords = await this.agentStorage.list();
39370
39493
  const liveIds = new Set(agentSnapshots.map((a) => a.id));
39371
- const persistedAgents = registryRecords.filter((record) => !liveIds.has(record.id) && !record.internal).map((record) => this.buildStoredAgentPayload(record));
39494
+ const persistedAgents = registryRecords.filter((record) => !liveIds.has(record.id)).map((record) => this.buildStoredAgentPayload(record));
39372
39495
  let agents = [...liveAgents, ...persistedAgents];
39373
39496
  agents = agents.filter((agent) => this.isProviderVisibleToClient(agent.provider));
39374
39497
  if (filter?.labels) {
@@ -41970,6 +42093,7 @@ ${details}`.trim());
41970
42093
  status: w.status,
41971
42094
  cwd: w.cwd,
41972
42095
  prompt: w.prompt,
42096
+ name: w.name,
41973
42097
  createdAt: w.createdAt,
41974
42098
  updatedAt: w.updatedAt
41975
42099
  }));
@@ -43044,6 +43168,64 @@ var StoredLoopsSchema = z39.array(LoopRecordSchema2);
43044
43168
  import { z as z40 } from "zod";
43045
43169
  var StoredQuestsSchema = z40.array(QuestRecordSchema);
43046
43170
 
43171
+ // ../server/src/server/quest/quest-metadata-generator.ts
43172
+ import { z as z41 } from "zod";
43173
+
43174
+ // ../server/src/server/quest/orchestrator-mcp.ts
43175
+ import { createSdkMcpServer, tool } from "@anthropic-ai/claude-agent-sdk";
43176
+ import { z as z42 } from "zod";
43177
+ var HANDOFF_INPUT_SHAPE = {
43178
+ rolePath: z42.string().min(1).describe(
43179
+ "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."
43180
+ ),
43181
+ task: z42.string().min(1).describe(
43182
+ "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."
43183
+ )
43184
+ };
43185
+
43186
+ // ../server/src/server/quest/runner-orchestrator.ts
43187
+ var FALLBACK_QUEEN_PROMPT_TEMPLATE = [
43188
+ "you are going to send out agents, but first you get aquanted with 'the team'",
43189
+ "You don't go do the work yourself!",
43190
+ "",
43191
+ "this team has very deep knowledge of the task at hand. they have very detailed skills and output prefs so they are smarter than you. don't assume otherwise.",
43192
+ "",
43193
+ "the team is split up in categories. you will try to consolidate all of their knowledge into an approach for the task below.",
43194
+ "",
43195
+ "",
43196
+ "The team:",
43197
+ "",
43198
+ "{{team}}",
43199
+ "",
43200
+ "===",
43201
+ "",
43202
+ "The task at hand:",
43203
+ "",
43204
+ "",
43205
+ ">>>>>",
43206
+ "{{task}}",
43207
+ "<<<<<<<<<<",
43208
+ "",
43209
+ "Again, whatever you are thinking of now I repeat: You don't go do the work yourself!",
43210
+ "What your job IS tho:",
43211
+ "",
43212
+ "Now you have full knowledge of what the user wants and how he composed his 'team'",
43213
+ "you do not delegate this team as subagents but you spawn new handoff sessions, you decide on what can be done in paralel and what needs to happen before the next can start. stage. the amount of handof sessions you spawn is equal to the amount of team entries in your prompt.",
43214
+ "",
43215
+ "",
43216
+ "",
43217
+ "We are going to use a hivemind dock in the repo.",
43218
+ "What you can do, is now startup that hivemind doc in /.hivemind/orchestrator-{{questId}}.md",
43219
+ "",
43220
+ "",
43221
+ "You instruct every handoff with a clear instruction on it's task.",
43222
+ "But you also make sure that each handoff knows the greater context of the end goal and knows of the existence of the hivemind document.",
43223
+ "it should know that it can write to it but first needs to check if there are no conflicts.",
43224
+ "",
43225
+ "",
43226
+ "do not use subagents because these are emphetic. we need full sessions."
43227
+ ].join("\n");
43228
+
43047
43229
  // ../server/src/server/quest/runner-ralph.ts
43048
43230
  import { promisify as promisify4 } from "node:util";
43049
43231
  import { execFile as execFile3 } from "node:child_process";
@@ -43051,13 +43233,13 @@ var execFileAsync3 = promisify4(execFile3);
43051
43233
  var MAX_VERIFY_OUTPUT_BYTES2 = 64 * 1024;
43052
43234
 
43053
43235
  // ../server/src/shared/connection-offer.ts
43054
- import { z as z41 } from "zod";
43055
- var ConnectionOfferV2Schema = z41.object({
43056
- v: z41.literal(2),
43057
- serverId: z41.string().min(1),
43058
- daemonPublicKeyB64: z41.string().min(1),
43059
- relay: z41.object({
43060
- endpoint: z41.string().min(1)
43236
+ import { z as z43 } from "zod";
43237
+ var ConnectionOfferV2Schema = z43.object({
43238
+ v: z43.literal(2),
43239
+ serverId: z43.string().min(1),
43240
+ daemonPublicKeyB64: z43.string().min(1),
43241
+ relay: z43.object({
43242
+ endpoint: z43.string().min(1)
43061
43243
  })
43062
43244
  });
43063
43245
 
@@ -43091,21 +43273,21 @@ function isRelayClientWebSocketUrl(url) {
43091
43273
 
43092
43274
  // ../server/src/server/config.ts
43093
43275
  import path17 from "node:path";
43094
- import { z as z45 } from "zod";
43276
+ import { z as z47 } from "zod";
43095
43277
 
43096
43278
  // ../server/src/server/speech/speech-config-resolver.ts
43097
- import { z as z44 } from "zod";
43279
+ import { z as z46 } from "zod";
43098
43280
 
43099
43281
  // ../server/src/server/speech/providers/local/config.ts
43100
43282
  import path16 from "node:path";
43101
- import { z as z42 } from "zod";
43283
+ import { z as z44 } from "zod";
43102
43284
  var DEFAULT_LOCAL_MODELS_SUBDIR = path16.join("models", "local-speech");
43103
- var NumberLikeSchema2 = z42.union([z42.number(), z42.string().trim().min(1)]);
43104
- var OptionalFiniteNumberSchema2 = NumberLikeSchema2.pipe(z42.coerce.number().finite()).optional();
43105
- var OptionalIntegerSchema = NumberLikeSchema2.pipe(z42.coerce.number().int()).optional();
43106
- var LocalSpeechResolutionSchema = z42.object({
43107
- includeProviderConfig: z42.boolean(),
43108
- modelsDir: z42.string().trim().min(1),
43285
+ var NumberLikeSchema2 = z44.union([z44.number(), z44.string().trim().min(1)]);
43286
+ var OptionalFiniteNumberSchema2 = NumberLikeSchema2.pipe(z44.coerce.number().finite()).optional();
43287
+ var OptionalIntegerSchema = NumberLikeSchema2.pipe(z44.coerce.number().int()).optional();
43288
+ var LocalSpeechResolutionSchema = z44.object({
43289
+ includeProviderConfig: z44.boolean(),
43290
+ modelsDir: z44.string().trim().min(1),
43109
43291
  dictationLocalSttModel: LocalSttModelIdSchema.default(DEFAULT_LOCAL_STT_MODEL),
43110
43292
  voiceLocalSttModel: LocalSttModelIdSchema.default(DEFAULT_LOCAL_STT_MODEL),
43111
43293
  voiceLocalTtsModel: LocalTtsModelIdSchema.default(DEFAULT_LOCAL_TTS_MODEL),
@@ -43161,17 +43343,17 @@ function resolveLocalSpeechConfig(params) {
43161
43343
  }
43162
43344
 
43163
43345
  // ../server/src/server/speech/speech-types.ts
43164
- import { z as z43 } from "zod";
43165
- var SpeechProviderIdSchema2 = z43.enum(["openai", "local"]);
43166
- var RequestedSpeechProviderSchema = z43.object({
43346
+ import { z as z45 } from "zod";
43347
+ var SpeechProviderIdSchema2 = z45.enum(["openai", "local"]);
43348
+ var RequestedSpeechProviderSchema = z45.object({
43167
43349
  provider: SpeechProviderIdSchema2,
43168
- explicit: z43.boolean(),
43169
- enabled: z43.boolean().optional()
43350
+ explicit: z45.boolean(),
43351
+ enabled: z45.boolean().optional()
43170
43352
  });
43171
43353
 
43172
43354
  // ../server/src/server/speech/speech-config-resolver.ts
43173
- var OptionalSpeechProviderSchema = z44.string().trim().toLowerCase().pipe(SpeechProviderIdSchema2).optional();
43174
- var OptionalBooleanFlagSchema = z44.union([z44.boolean(), z44.string().trim().toLowerCase()]).optional().transform((value) => {
43355
+ var OptionalSpeechProviderSchema = z46.string().trim().toLowerCase().pipe(SpeechProviderIdSchema2).optional();
43356
+ var OptionalBooleanFlagSchema = z46.union([z46.boolean(), z46.string().trim().toLowerCase()]).optional().transform((value) => {
43175
43357
  if (typeof value === "boolean") {
43176
43358
  return value;
43177
43359
  }
@@ -43186,7 +43368,7 @@ var OptionalBooleanFlagSchema = z44.union([z44.boolean(), z44.string().trim().to
43186
43368
  }
43187
43369
  return void 0;
43188
43370
  });
43189
- var RequestedSpeechProvidersSchema = z44.object({
43371
+ var RequestedSpeechProvidersSchema = z46.object({
43190
43372
  dictationStt: OptionalSpeechProviderSchema.default("local"),
43191
43373
  voiceTurnDetection: OptionalSpeechProviderSchema.default("local"),
43192
43374
  voiceStt: OptionalSpeechProviderSchema.default("local"),
@@ -43295,9 +43477,9 @@ function parseBooleanEnv(value) {
43295
43477
  }
43296
43478
  return void 0;
43297
43479
  }
43298
- var OptionalVoiceLlmProviderSchema = z45.union([z45.string(), z45.null(), z45.undefined()]).transform(
43480
+ var OptionalVoiceLlmProviderSchema = z47.union([z47.string(), z47.null(), z47.undefined()]).transform(
43299
43481
  (value) => typeof value === "string" ? value.trim().toLowerCase() : null
43300
- ).pipe(z45.union([AgentProviderSchema, z45.null()]));
43482
+ ).pipe(z47.union([AgentProviderSchema, z47.null()]));
43301
43483
  function parseOptionalVoiceLlmProvider(value) {
43302
43484
  const parsed = OptionalVoiceLlmProviderSchema.safeParse(value);
43303
43485
  return parsed.success ? parsed.data : null;