frizz-server 0.13.8 → 0.13.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.
Files changed (92) hide show
  1. package/dist/claude-agent-broker.js +14659 -14376
  2. package/dist/dev-child.js +135 -105
  3. package/package.json +1 -1
  4. package/web-dist/assets/{TerminalPane-CgFt4ple.js → TerminalPane-uhdLUx67.js} +1 -1
  5. package/web-dist/assets/{abnfDiagram-VRR7QNED-DoVWUENi.js → abnfDiagram-VRR7QNED-gpWvs3KP.js} +1 -1
  6. package/web-dist/assets/architecture-TIHT7OUA-DjmwW7vl.js +1 -0
  7. package/web-dist/assets/{architectureDiagram-ZJ3FMSHR-BE2vu5s4.js → architectureDiagram-ZJ3FMSHR-Di1xsjNG.js} +1 -1
  8. package/web-dist/assets/{blockDiagram-677ZJIJ3-D6LvUZ6S.js → blockDiagram-677ZJIJ3-CO85-Qea.js} +1 -1
  9. package/web-dist/assets/{c4Diagram-LMCZKHZV-BDZel4B4.js → c4Diagram-LMCZKHZV-B32PSJlR.js} +1 -1
  10. package/web-dist/assets/channel-2QEC6BP8.js +1 -0
  11. package/web-dist/assets/{chunk-32BRIVSS-fmjhgloi.js → chunk-32BRIVSS-B-7ltfTH.js} +1 -1
  12. package/web-dist/assets/{chunk-52WLFC77-sfh419xE.js → chunk-52WLFC77-B68qDE3i.js} +1 -1
  13. package/web-dist/assets/{chunk-C7G6YPKG-D-LGx-oa.js → chunk-C7G6YPKG-9I1vJXzs.js} +1 -1
  14. package/web-dist/assets/{chunk-EX3LRPZG-DriDj_NL.js → chunk-EX3LRPZG-50O1GLJq.js} +1 -1
  15. package/web-dist/assets/{chunk-FWX5IMBZ-DetgkllZ.js → chunk-FWX5IMBZ-DavZMlKl.js} +2 -2
  16. package/web-dist/assets/{chunk-HOUHSVGY-CDGGE0PL.js → chunk-HOUHSVGY-BGjNDQbr.js} +1 -1
  17. package/web-dist/assets/{chunk-ICXQ74PX-CIgu37mb.js → chunk-ICXQ74PX-D4yFEGU8.js} +1 -1
  18. package/web-dist/assets/{chunk-MOJQB5TN-BNj77oeQ.js → chunk-MOJQB5TN-CsQKxzjy.js} +1 -1
  19. package/web-dist/assets/{chunk-OGEWGWER-BRoVc26C.js → chunk-OGEWGWER-B2ujmhTF.js} +1 -1
  20. package/web-dist/assets/{chunk-PUDLZKDR-B9bHTS14.js → chunk-PUDLZKDR-B_Cnk_kp.js} +1 -1
  21. package/web-dist/assets/{chunk-Q4XR5HBZ-CjqwAtw6.js → chunk-Q4XR5HBZ-CNJi7ivq.js} +1 -1
  22. package/web-dist/assets/{chunk-V7JOEXUC-ClYL5Jo9.js → chunk-V7JOEXUC-qL-RXxQy.js} +1 -1
  23. package/web-dist/assets/{chunk-VAUOI2AC-DsyULg7-.js → chunk-VAUOI2AC-C_AO-SE_.js} +1 -1
  24. package/web-dist/assets/{chunk-VR4S4FIN-x_8ywB7J.js → chunk-VR4S4FIN-NU1W8e1J.js} +1 -1
  25. package/web-dist/assets/{chunk-WYO6CB5R-BDWUsOuN.js → chunk-WYO6CB5R-B3l7AohL.js} +1 -1
  26. package/web-dist/assets/{chunk-ZGVPDNZ5-wAbPuGaE.js → chunk-ZGVPDNZ5-gw3883_4.js} +1 -1
  27. package/web-dist/assets/classDiagram-OUVF2IWQ-BZmKD91m.js +1 -0
  28. package/web-dist/assets/classDiagram-v2-EOCWNBFH-BZmKD91m.js +1 -0
  29. package/web-dist/assets/{cynefin-VYW2F7L2-DLLNSytS.js → cynefin-VYW2F7L2-IYSCSMTe.js} +1 -1
  30. package/web-dist/assets/{cynefinDiagram-TSTJHNR4-6kBJrScm.js → cynefinDiagram-TSTJHNR4-CP8LReQc.js} +1 -1
  31. package/web-dist/assets/{dagre-VKFMJZFB-Z_OVqFBK.js → dagre-VKFMJZFB-C_cDOY4h.js} +1 -1
  32. package/web-dist/assets/{diagram-FQU43EPY-C_nG5FUG.js → diagram-FQU43EPY-Bdt-bbPx.js} +1 -1
  33. package/web-dist/assets/{diagram-G47NLZAW-CYQTveO9.js → diagram-G47NLZAW-D4bM_nDs.js} +1 -1
  34. package/web-dist/assets/{diagram-NH7WQ7WH-C2DkBAm5.js → diagram-NH7WQ7WH-_TSAwrFN.js} +1 -1
  35. package/web-dist/assets/{diagram-OA4YK3LP-CSDwzhMR.js → diagram-OA4YK3LP-DWpUifZA.js} +1 -1
  36. package/web-dist/assets/{diagram-WEI45ONY-R1MvefNj.js → diagram-WEI45ONY-29lN_-MQ.js} +1 -1
  37. package/web-dist/assets/{ebnfDiagram-CCIWWBDH-DBXUjfz2.js → ebnfDiagram-CCIWWBDH-vNac3Nkb.js} +1 -1
  38. package/web-dist/assets/{erDiagram-Q63AITRT-D2XH_vxG.js → erDiagram-Q63AITRT-Q8Lyeen0.js} +1 -1
  39. package/web-dist/assets/eventmodeling-45OFAUF4-DOaq-8am.js +1 -0
  40. package/web-dist/assets/flowDiagram-23GEKE2U-DIB-knUj.js +1 -0
  41. package/web-dist/assets/{ganttDiagram-NO4QXBWP-BqJqGmJu.js → ganttDiagram-NO4QXBWP-wqnUf4eS.js} +1 -1
  42. package/web-dist/assets/{gitGraph-TEB2WS4Q-BpED4Y4w.js → gitGraph-TEB2WS4Q-Dp2PnWq2.js} +1 -1
  43. package/web-dist/assets/{gitGraphDiagram-IHSO6WYX-CpCzUYgA.js → gitGraphDiagram-IHSO6WYX-BxGiqVQZ.js} +1 -1
  44. package/web-dist/assets/index-CzN-tCOl.css +1 -0
  45. package/web-dist/assets/{index-vTgjYcOv.js → index-DqXGLIwz.js} +98 -98
  46. package/web-dist/assets/{info-DKCQHKI2-Bm1fWKNN.js → info-DKCQHKI2-BhzY4Uni.js} +1 -1
  47. package/web-dist/assets/{infoDiagram-FWYZ7A6U-C61BGKNf.js → infoDiagram-FWYZ7A6U-DOAJbOl-.js} +1 -1
  48. package/web-dist/assets/{ishikawaDiagram-FXEZZL3T-0Fmof1Bc.js → ishikawaDiagram-FXEZZL3T-mBZHeiuC.js} +1 -1
  49. package/web-dist/assets/{journeyDiagram-5HDEW3XC-DHuJoS_U.js → journeyDiagram-5HDEW3XC-BIN13T_S.js} +1 -1
  50. package/web-dist/assets/{kanban-definition-HUTT4EX6-ClLsOpPq.js → kanban-definition-HUTT4EX6-BXIeyjSB.js} +1 -1
  51. package/web-dist/assets/{line-BQNlaa-L.js → line-CXrqIQ_6.js} +1 -1
  52. package/web-dist/assets/{mermaid-parser.core-Dhg0FCF0.js → mermaid-parser.core-B-ewc93S.js} +3 -3
  53. package/web-dist/assets/{mermaid.core-OSL7u28D.js → mermaid.core-4Ulv5sd_.js} +3 -3
  54. package/web-dist/assets/{mindmap-definition-LN4V7U3C-CMh2RRdG.js → mindmap-definition-LN4V7U3C-CUlmsgpu.js} +1 -1
  55. package/web-dist/assets/{packet-7NZHBO7P-DqizytaZ.js → packet-7NZHBO7P-DOU_OPIg.js} +1 -1
  56. package/web-dist/assets/{pegDiagram-2B236MQR-C_xsQ7ey.js → pegDiagram-2B236MQR-ClVC15zM.js} +1 -1
  57. package/web-dist/assets/{pie-RZYD4A2V-Dg0NeJ6P.js → pie-RZYD4A2V-9fj9kCZg.js} +1 -1
  58. package/web-dist/assets/{pieDiagram-ENE6RG2P-B2przwvg.js → pieDiagram-ENE6RG2P-BQAuzbqi.js} +1 -1
  59. package/web-dist/assets/{quadrantDiagram-ABIIQ3AL-B5xLDvCk.js → quadrantDiagram-ABIIQ3AL-B6v8OzIX.js} +1 -1
  60. package/web-dist/assets/{radar-I7S5WNFK-DItULivd.js → radar-I7S5WNFK-ggR6yaoH.js} +1 -1
  61. package/web-dist/assets/{railroad-3IZDKUUU-BVSgw6fD.js → railroad-3IZDKUUU-NRPKG8Tz.js} +1 -1
  62. package/web-dist/assets/railroad-abnf-AHOZXSZD-icGR3Mej.js +1 -0
  63. package/web-dist/assets/railroad-ebnf-EBAXGLYW-7uKDbF2e.js +1 -0
  64. package/web-dist/assets/railroad-peg-LSFZ7HO6-CJwY09fs.js +1 -0
  65. package/web-dist/assets/{railroadDiagram-RFXS5EU6-DQh-iy6H.js → railroadDiagram-RFXS5EU6-CIJqRzYi.js} +1 -1
  66. package/web-dist/assets/{requirementDiagram-TGXJPOKE-B2bjpE-s.js → requirementDiagram-TGXJPOKE-7Dvam68t.js} +1 -1
  67. package/web-dist/assets/{sankeyDiagram-HTMAVEWB-C-vr6CRd.js → sankeyDiagram-HTMAVEWB-BYX8p13G.js} +1 -1
  68. package/web-dist/assets/{sequenceDiagram-DBY2YBRQ-C48rDu8k.js → sequenceDiagram-DBY2YBRQ-Bmqmc3Hh.js} +1 -1
  69. package/web-dist/assets/{stateDiagram-2N3HPSRC-BEHBNPlt.js → stateDiagram-2N3HPSRC-Cv1jr6R9.js} +1 -1
  70. package/web-dist/assets/stateDiagram-v2-6OUMAXLB-CWOLQn_o.js +1 -0
  71. package/web-dist/assets/{swimlanes-5IMT3BWC-BK0pUXUO.js → swimlanes-5IMT3BWC-BHlN3gYO.js} +1 -1
  72. package/web-dist/assets/swimlanesDiagram-G3AALYLV-cd1Z89Mn.js +8 -0
  73. package/web-dist/assets/{timeline-definition-FHXFAJF6-CQ3rH4CA.js → timeline-definition-FHXFAJF6-DO8eivQs.js} +1 -1
  74. package/web-dist/assets/{treeView-QDETBFTQ-DrgwDaib.js → treeView-QDETBFTQ-DOmZ_jrX.js} +1 -1
  75. package/web-dist/assets/{treemap-6X3UGDF4-CGlOb_mN.js → treemap-6X3UGDF4-BsObxxTm.js} +1 -1
  76. package/web-dist/assets/{vennDiagram-L72KCM5P-BB9TjfQX.js → vennDiagram-L72KCM5P-BRy9Xi2q.js} +1 -1
  77. package/web-dist/assets/{wardley-OPB4EBWU-C8EK8ow0.js → wardley-OPB4EBWU-BYP-hY4S.js} +1 -1
  78. package/web-dist/assets/{wardleyDiagram-EHGQE667-CUeOWZBB.js → wardleyDiagram-EHGQE667-BQVbSUex.js} +1 -1
  79. package/web-dist/assets/{xychartDiagram-FW5EYKEG-8ZymnyMt.js → xychartDiagram-FW5EYKEG-tK-MC6wE.js} +1 -1
  80. package/web-dist/index.html +2 -2
  81. package/web-dist/assets/architecture-TIHT7OUA-DJ_aT0bS.js +0 -1
  82. package/web-dist/assets/channel-D3v1O4Wy.js +0 -1
  83. package/web-dist/assets/classDiagram-OUVF2IWQ-LvSRVuLl.js +0 -1
  84. package/web-dist/assets/classDiagram-v2-EOCWNBFH-LvSRVuLl.js +0 -1
  85. package/web-dist/assets/eventmodeling-45OFAUF4-DQtNFbyn.js +0 -1
  86. package/web-dist/assets/flowDiagram-23GEKE2U-DPAGYT4s.js +0 -1
  87. package/web-dist/assets/index-DfJaB5hp.css +0 -1
  88. package/web-dist/assets/railroad-abnf-AHOZXSZD-Du1T7UC_.js +0 -1
  89. package/web-dist/assets/railroad-ebnf-EBAXGLYW-Ck5QAc8a.js +0 -1
  90. package/web-dist/assets/railroad-peg-LSFZ7HO6-CA1OLi4_.js +0 -1
  91. package/web-dist/assets/stateDiagram-v2-6OUMAXLB-BiZG09Uh.js +0 -1
  92. package/web-dist/assets/swimlanesDiagram-G3AALYLV-CenRab4t.js +0 -8
package/dist/dev-child.js CHANGED
@@ -15290,7 +15290,9 @@ var init_src = __esm({
15290
15290
  SetThreadProfileInput = external_exports.object({
15291
15291
  slug: ThreadSlug,
15292
15292
  model: external_exports.string().trim().min(1).max(200),
15293
- effort: external_exports.string().trim().min(1).max(100)
15293
+ // Absent ONLY for an ACP thread, whose model slug (`acp:<agent>@<model>`) carries no effort axis; the
15294
+ // router refuses a Claude/Codex profile without one rather than storing "".
15295
+ effort: external_exports.string().trim().min(1).max(100).optional()
15294
15296
  }).strict();
15295
15297
  SetThreadProfileResult = external_exports.object({
15296
15298
  effect: external_exports.enum(["applied", "next-resume"])
@@ -26616,13 +26618,13 @@ function searchPath2(env) {
26616
26618
  function vendoredNativeBeside(launcherJs, arch, access) {
26617
26619
  const triple = WINDOWS_TRIPLE[arch];
26618
26620
  if (!triple) return void 0;
26619
- const { dirname: dirname26, join: join49 } = win322;
26620
- const pkgRoot = dirname26(dirname26(launcherJs));
26621
+ const { dirname: dirname27, join: join49 } = win322;
26622
+ const pkgRoot = dirname27(dirname27(launcherJs));
26621
26623
  const platformPkg = `codex-win32-${arch}`;
26622
26624
  const vendorRoots = [
26623
26625
  join49(pkgRoot, "node_modules", "@openai", platformPkg, "vendor"),
26624
26626
  // nested under the package
26625
- join49(dirname26(pkgRoot), platformPkg, "vendor"),
26627
+ join49(dirname27(pkgRoot), platformPkg, "vendor"),
26626
26628
  // hoisted beside it: <prefix>\node_modules\@openai\<pkg>
26627
26629
  join49(pkgRoot, "vendor")
26628
26630
  // the pre-platform-package layout, binaries inside @openai/codex itself
@@ -32451,11 +32453,11 @@ var init_codex_app_server = __esm({
32451
32453
  init_logging();
32452
32454
  CODEX_APP_SERVER_PROVIDER = "codex-app-server";
32453
32455
  CODEX_NATIVE_LISTEN_FLAG = "FRIZZ_CODEX_NATIVE_LISTEN";
32454
- CODEX_APP_SERVER_SUPPORTED_VERSION = "0.154.0";
32456
+ CODEX_APP_SERVER_SUPPORTED_VERSION = "0.155.0";
32455
32457
  CODEX_APP_SERVER_PROTOCOL_REVISION = Object.freeze({
32456
32458
  packageVersion: CODEX_APP_SERVER_SUPPORTED_VERSION,
32457
- sourceTag: "rust-v0.154.0",
32458
- sourceCommit: "6b9826e3aa83b1a5947db50f4332cb9c65f1b340"
32459
+ sourceTag: "rust-v0.155.0",
32460
+ sourceCommit: "f0a1b8f0849d90960bc406b848f32e5a129b0457"
32459
32461
  });
32460
32462
  PROTOCOL_FINGERPRINT = [
32461
32463
  CODEX_APP_SERVER_PROTOCOL_REVISION.sourceTag,
@@ -35204,11 +35206,21 @@ var init_quota = __esm({
35204
35206
  }
35205
35207
  });
35206
35208
 
35209
+ // packages/server/src/local-path.ts
35210
+ function normalizeLocalPath(path3, platform3 = process.platform) {
35211
+ return platform3 === "win32" ? path3.replace(/^\/([a-zA-Z]:[\\/])/, "$1") : path3;
35212
+ }
35213
+ var init_local_path = __esm({
35214
+ "packages/server/src/local-path.ts"() {
35215
+ "use strict";
35216
+ }
35217
+ });
35218
+
35207
35219
  // packages/server/src/local-file.ts
35208
35220
  import { spawn as spawn5 } from "node:child_process";
35209
35221
  import { existsSync as existsSync8, readFileSync as readFileSync18, realpathSync as realpathSync6, statSync as statSync13 } from "node:fs";
35210
35222
  import { homedir as homedir11 } from "node:os";
35211
- import { isAbsolute as isAbsolute4, join as join26, resolve as resolve5, sep as sep2 } from "node:path";
35223
+ import { dirname as dirname10, isAbsolute as isAbsolute4, join as join26, resolve as resolve5, sep as sep2 } from "node:path";
35212
35224
  function isUnder(real, root) {
35213
35225
  let rootReal;
35214
35226
  try {
@@ -35216,9 +35228,25 @@ function isUnder(real, root) {
35216
35228
  } catch {
35217
35229
  return false;
35218
35230
  }
35219
- return real === rootReal || real.startsWith(rootReal.endsWith(sep2) ? rootReal : rootReal + sep2);
35231
+ if (process.platform !== "win32") {
35232
+ return real === rootReal || real.startsWith(rootReal.endsWith(sep2) ? rootReal : rootReal + sep2);
35233
+ }
35234
+ try {
35235
+ const trusted = statSync13(rootReal, { bigint: true });
35236
+ if (!trusted.isDirectory() || trusted.ino === 0n) return false;
35237
+ for (let ancestor = real; ; ) {
35238
+ const actual = statSync13(ancestor, { bigint: true });
35239
+ if (actual.dev === trusted.dev && actual.ino === trusted.ino) return true;
35240
+ const parent = dirname10(ancestor);
35241
+ if (parent === ancestor) return false;
35242
+ ancestor = parent;
35243
+ }
35244
+ } catch {
35245
+ return false;
35246
+ }
35220
35247
  }
35221
35248
  function resolveLocalFile(rawPath, roots) {
35249
+ rawPath = normalizeLocalPath(rawPath);
35222
35250
  if (!isAbsolute4(rawPath)) throw new Error("Local path must be absolute");
35223
35251
  let real;
35224
35252
  try {
@@ -35323,6 +35351,7 @@ var MARKDOWN_FILE_EXT, MARKDOWN_READ_LIMIT, WINDOWS_EDITOR_EXE;
35323
35351
  var init_local_file = __esm({
35324
35352
  "packages/server/src/local-file.ts"() {
35325
35353
  "use strict";
35354
+ init_local_path();
35326
35355
  MARKDOWN_FILE_EXT = /\.(?:md|mdx|markdown)$/i;
35327
35356
  MARKDOWN_READ_LIMIT = 1024 * 1024;
35328
35357
  WINDOWS_EDITOR_EXE = {
@@ -35366,7 +35395,7 @@ var init_thread_links = __esm({
35366
35395
  // packages/server/src/frizz.ts
35367
35396
  import { execFile as execFile6 } from "node:child_process";
35368
35397
  import { lstatSync as lstatSync2, realpathSync as realpathSync7 } from "node:fs";
35369
- import { basename as basename5, dirname as dirname10, join as join27, resolve as resolve6 } from "node:path";
35398
+ import { basename as basename5, dirname as dirname11, join as join27, resolve as resolve6 } from "node:path";
35370
35399
  import { promisify as promisify5 } from "node:util";
35371
35400
  function frizzScriptsDir() {
35372
35401
  if (process.env.FRIZZ_SCRIPTS_DIR) return process.env.FRIZZ_SCRIPTS_DIR;
@@ -35379,7 +35408,7 @@ function directFrizzRoot(projectDir) {
35379
35408
  const stat2 = lstatSync2(path3);
35380
35409
  if (!stat2.isDirectory() || stat2.isSymbolicLink()) return null;
35381
35410
  const real = realpathSync7(path3);
35382
- return dirname10(real) === projectRoot && basename5(real) === ".frizz" ? real : null;
35411
+ return dirname11(real) === projectRoot && basename5(real) === ".frizz" ? real : null;
35383
35412
  } catch {
35384
35413
  return null;
35385
35414
  }
@@ -35655,17 +35684,17 @@ var init_project_mcp_servers = __esm({
35655
35684
 
35656
35685
  // packages/server/src/worker-plugin-dir.ts
35657
35686
  import { existsSync as existsSync9 } from "node:fs";
35658
- import { dirname as dirname11, join as join29 } from "node:path";
35687
+ import { dirname as dirname12, join as join29 } from "node:path";
35659
35688
  import { fileURLToPath as fileURLToPath3 } from "node:url";
35660
35689
  function resolveWorkerPluginDir(moduleUrl = import.meta.url, env = process.env) {
35661
35690
  const override = env.FRIZZ_WORKER_PLUGIN_DIR;
35662
35691
  if (override && existsSync9(join29(override, ".claude-plugin", "plugin.json")))
35663
35692
  return override;
35664
- let current = dirname11(fileURLToPath3(moduleUrl));
35693
+ let current = dirname12(fileURLToPath3(moduleUrl));
35665
35694
  for (; ; ) {
35666
35695
  const candidate = join29(current, "cc-worker");
35667
35696
  if (existsSync9(join29(candidate, ".claude-plugin", "plugin.json"))) return candidate;
35668
- const parent = dirname11(current);
35697
+ const parent = dirname12(current);
35669
35698
  if (parent === current) return void 0;
35670
35699
  current = parent;
35671
35700
  }
@@ -37638,7 +37667,7 @@ var init_claude_agent_broker_bridge = __esm({
37638
37667
 
37639
37668
  // packages/server/src/dispatch.ts
37640
37669
  import { closeSync as closeSync12, constants as constants2, existsSync as existsSync10, fstatSync as fstatSync2, lstatSync as lstatSync3, openSync as openSync13, readFileSync as readFileSync20, realpathSync as realpathSync8, statSync as statSync15, writeFileSync as writeFileSync10, mkdirSync as mkdirSync13, rmSync as rmSync9 } from "node:fs";
37641
- import { basename as basename6, join as join31, dirname as dirname12 } from "node:path";
37670
+ import { basename as basename6, join as join31, dirname as dirname13 } from "node:path";
37642
37671
  import { createHash as createHash11, randomUUID as randomUUID13 } from "node:crypto";
37643
37672
  function fallbackTitle(prompt) {
37644
37673
  const firstLine2 = prompt.trim().split("\n", 1)[0].trim();
@@ -37678,12 +37707,12 @@ function resolveLegacyThreadFile(projectDir, value) {
37678
37707
  const frizzStat = lstatSync3(frizzPath);
37679
37708
  if (!frizzStat.isDirectory() || frizzStat.isSymbolicLink()) return null;
37680
37709
  const realFrizz = realpathSync8(frizzPath);
37681
- if (dirname12(realFrizz) !== projectRoot || basename6(realFrizz) !== ".frizz") return null;
37710
+ if (dirname13(realFrizz) !== projectRoot || basename6(realFrizz) !== ".frizz") return null;
37682
37711
  const path3 = join31(realFrizz, `${parsed.data}.md`);
37683
37712
  const before = lstatSync3(path3);
37684
37713
  if (!before.isFile() || before.isSymbolicLink()) return null;
37685
37714
  const realPath = realpathSync8(path3);
37686
- if (dirname12(realPath) !== realFrizz || basename6(realPath) !== `${parsed.data}.md`) return null;
37715
+ if (dirname13(realPath) !== realFrizz || basename6(realPath) !== `${parsed.data}.md`) return null;
37687
37716
  let contents;
37688
37717
  let openedBefore;
37689
37718
  let openedAfter;
@@ -37733,7 +37762,7 @@ function ensureSafeDirectDirectory(parent, name) {
37733
37762
  const stat2 = lstatSync3(path3);
37734
37763
  if (!stat2.isDirectory() || stat2.isSymbolicLink()) throw new Error("unsafe project directory");
37735
37764
  const real = realpathSync8(path3);
37736
- if (dirname12(real) !== parent || basename6(real) !== name) throw new Error("unsafe project directory");
37765
+ if (dirname13(real) !== parent || basename6(real) !== name) throw new Error("unsafe project directory");
37737
37766
  return real;
37738
37767
  }
37739
37768
  function scratchDirRelPath(sessionId) {
@@ -37766,7 +37795,7 @@ function codexScratchpadHookConfig(hookScript, sessionId) {
37766
37795
  }
37767
37796
  ]
37768
37797
  });
37769
- const bashBackgroundHook = join31(dirname12(hookScript), "bash-background.mjs");
37798
+ const bashBackgroundHook = join31(dirname13(hookScript), "bash-background.mjs");
37770
37799
  return {
37771
37800
  bypass_hook_trust: true,
37772
37801
  hooks: {
@@ -38441,7 +38470,7 @@ import {
38441
38470
  watch as fsWatch
38442
38471
  } from "node:fs";
38443
38472
  import { homedir as homedir14 } from "node:os";
38444
- import { dirname as dirname13, join as join32 } from "node:path";
38473
+ import { dirname as dirname14, join as join32 } from "node:path";
38445
38474
  import watcher from "@parcel/watcher";
38446
38475
  function appServerTurnStalled(liveness, lastActivityAt, nowMs) {
38447
38476
  if (!liveness) return false;
@@ -38490,7 +38519,7 @@ function registeredLegacyFileIsTerminal(projectDir, slug) {
38490
38519
  return status === "done" || status === "dismissed";
38491
38520
  }
38492
38521
  function isBoardRelevantFrizzPath(roots, path3) {
38493
- return path3.endsWith(".md") && roots.has(dirname13(path3));
38522
+ return path3.endsWith(".md") && roots.has(dirname14(path3));
38494
38523
  }
38495
38524
  function futureSnooze(row, nowMs) {
38496
38525
  const parsed = SnoozeUntil.safeParse(row.snoozed_until);
@@ -42307,7 +42336,7 @@ var init_claude = __esm({
42307
42336
 
42308
42337
  // packages/server/src/backend/acp-transcript.ts
42309
42338
  import { appendFileSync as appendFileSync3, existsSync as existsSync12, mkdirSync as mkdirSync14, readFileSync as readFileSync21 } from "node:fs";
42310
- import { dirname as dirname14, join as join34 } from "node:path";
42339
+ import { dirname as dirname15, join as join34 } from "node:path";
42311
42340
  function acpTranscriptPath(stateDir, sessionId) {
42312
42341
  return join34(stateDir, ACP_TRANSCRIPT_DIR, `${sessionId}.jsonl`);
42313
42342
  }
@@ -42486,13 +42515,6 @@ function projectAcpTranscript(raw2, identityPrefix = "acp") {
42486
42515
  }
42487
42516
  return out;
42488
42517
  }
42489
- function readAcpTranscriptFile(absPath, nativeId = absPath) {
42490
- try {
42491
- return projectAcpTranscript(readFileSync21(absPath, "utf8"), `acp:${nativeId}`);
42492
- } catch {
42493
- return [];
42494
- }
42495
- }
42496
42518
  var ACP_TRANSCRIPT_DIR, EVENT_KINDS, AcpTranscriptWriter, TOOL_TEXT_MAX;
42497
42519
  var init_acp_transcript = __esm({
42498
42520
  "packages/server/src/backend/acp-transcript.ts"() {
@@ -42517,7 +42539,7 @@ var init_acp_transcript = __esm({
42517
42539
  AcpTranscriptWriter = class {
42518
42540
  constructor(path3) {
42519
42541
  this.path = path3;
42520
- mkdirSync14(dirname14(path3), { recursive: true });
42542
+ mkdirSync14(dirname15(path3), { recursive: true });
42521
42543
  if (!existsSync12(path3)) appendFileSync3(path3, "");
42522
42544
  }
42523
42545
  append(record) {
@@ -43236,6 +43258,17 @@ var init_acp_bridge = __esm({
43236
43258
  if (live.turn) live.conn.notify("session/cancel", { sessionId: live.acpSessionId });
43237
43259
  void live.conn.close(reason === "shutdown" ? 1e3 : 3e3);
43238
43260
  }
43261
+ /** Switch a LIVE session's model (`session/set_config_option`); `applied: false` when the session is
43262
+ * not open, in which case the caller's stored slug reaches the agent on the next open. A refusal is
43263
+ * written to the transcript as a note, exactly as on open, and still counts as applied: the agent
43264
+ * answered, and the note says what it runs on. */
43265
+ async setModel(threadSlug, sessionId, modelId) {
43266
+ const live = this.sessions.get(sessionId);
43267
+ if (!live || live.slug !== threadSlug || live.exited || live.conn.closed) return { applied: false };
43268
+ const problem = await this.applyModel(live, modelId);
43269
+ if (problem) live.writer.append({ kind: "acp-note", at: this.now(), text: problem });
43270
+ return { applied: true, ...live.model ? { model: live.model } : {} };
43271
+ }
43239
43272
  turnLiveness(threadSlug, sessionId) {
43240
43273
  const live = this.sessions.get(sessionId);
43241
43274
  if (!live || live.slug !== threadSlug) return void 0;
@@ -43763,7 +43796,7 @@ var init_stale_socket_sweep = __esm({
43763
43796
  // packages/server/src/orphan-reaper.ts
43764
43797
  import { execFileSync as execFileSync4 } from "node:child_process";
43765
43798
  import { readFileSync as readFileSync22 } from "node:fs";
43766
- import { dirname as dirname15 } from "node:path";
43799
+ import { dirname as dirname16 } from "node:path";
43767
43800
  function firstTokenBasename(command) {
43768
43801
  const first = command.trimStart().split(/\s+/, 1)[0] ?? "";
43769
43802
  const slash = first.lastIndexOf("/");
@@ -43991,7 +44024,7 @@ function sweepOrphansOnce(deps = {}) {
43991
44024
  }
43992
44025
  function sweepStaleBrokerSockets() {
43993
44026
  try {
43994
- sweepStaleSockets({ dir: dirname15(claudeBrokerSocketPath("", "")), prefix: CLAUDE_BROKER_SOCKET_PREFIX });
44027
+ sweepStaleSockets({ dir: dirname16(claudeBrokerSocketPath("", "")), prefix: CLAUDE_BROKER_SOCKET_PREFIX });
43995
44028
  } catch {
43996
44029
  }
43997
44030
  }
@@ -47435,7 +47468,7 @@ var init_server = __esm({
47435
47468
 
47436
47469
  // packages/server/src/repair.ts
47437
47470
  import { existsSync as existsSync13, readFileSync as readFileSync23, writeFileSync as writeFileSync11 } from "node:fs";
47438
- import { basename as basename7, dirname as dirname16, resolve as resolve8 } from "node:path";
47471
+ import { basename as basename7, dirname as dirname17, resolve as resolve8 } from "node:path";
47439
47472
  function quoteValue(v) {
47440
47473
  if (/^[\w./#:+-]+$/.test(v)) return v;
47441
47474
  return `"${v.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"`;
@@ -47447,7 +47480,7 @@ function deriveTitle(body, slug) {
47447
47480
  function repairThreadFile(frizzDir, file) {
47448
47481
  const root = resolve8(frizzDir);
47449
47482
  const abs = resolve8(root, file);
47450
- if (dirname16(abs) !== root) throw new RepairError(`refusing to repair "${file}": not directly under .frizz/`);
47483
+ if (dirname17(abs) !== root) throw new RepairError(`refusing to repair "${file}": not directly under .frizz/`);
47451
47484
  if (!abs.endsWith(".md")) throw new RepairError(`refusing to repair "${file}": not a .md thread file`);
47452
47485
  if (!existsSync13(abs)) throw new RepairError(`no thread file to repair: ${basename7(abs)}`);
47453
47486
  const content = readFileSync23(abs, "utf8");
@@ -49217,6 +49250,17 @@ function parseCodexTranscript(raw2, identityPrefix = "codex") {
49217
49250
  return latestTranscriptWindow(out);
49218
49251
  }
49219
49252
  function latestWindowStart(messages) {
49253
+ return byteBoundedStart(messages, countBoundedStart(messages));
49254
+ }
49255
+ function byteBoundedStart(messages, start) {
49256
+ let bytes = 0;
49257
+ for (let i = messages.length - 1; i >= start; i--) {
49258
+ bytes += messageBytes(messages[i]);
49259
+ if (bytes > LATEST_WINDOW_MAX_BYTES) return Math.min(i + 1, messages.length - 1);
49260
+ }
49261
+ return start;
49262
+ }
49263
+ function countBoundedStart(messages) {
49220
49264
  const tail = Math.max(0, messages.length - MAX_MESSAGES);
49221
49265
  if (tail === 0) return 0;
49222
49266
  let boundary = -1;
@@ -50177,7 +50221,7 @@ function emptyTranscriptPage(source) {
50177
50221
  editedFiles: []
50178
50222
  };
50179
50223
  }
50180
- function readLatestThreadTranscriptPage(project, storage, slug, backendFor) {
50224
+ function readLatestThreadTranscriptPage(project, storage, slug, backendFor, opts = {}) {
50181
50225
  let source = sourceForThread(project, storage, slug, backendFor);
50182
50226
  if (!source) return emptyTranscriptPage();
50183
50227
  let snapshot = fixedSnapshot(source);
@@ -50213,7 +50257,7 @@ function readLatestThreadTranscriptPage(project, storage, slug, backendFor) {
50213
50257
  // ones inside this checkout belong on the rail (edited-files.ts). Then git drops whatever the
50214
50258
  // repository would not carry — scratch, build output — leaving the rail an account of repo work
50215
50259
  // (repo-files.ts).
50216
- editedFiles: repoCarriedEditedFiles(project.dir, editedFilesOf(projected, project.dir))
50260
+ ...opts.editedFiles === false ? {} : { editedFiles: repoCarriedEditedFiles(project.dir, editedFilesOf(projected, project.dir)) }
50217
50261
  };
50218
50262
  }
50219
50263
  function readEarlierThreadTranscriptPage(project, storage, slug, cursor, backendFor) {
@@ -50252,41 +50296,6 @@ function readCodexTranscriptFile(absPath, nativeId = absPath) {
50252
50296
  return [];
50253
50297
  }
50254
50298
  }
50255
- function readThreadTranscript(project, storage, slug, backendFor) {
50256
- const row = storage.getSession(slug);
50257
- if (row) {
50258
- if (row.backend === "acp") {
50259
- const path3 = backendFor?.("acp")?.transcriptPath(row.session_id);
50260
- const acpLedger = parseDeliveryLedger(row.delivery_ledger);
50261
- return projectDeliveryLedger(path3 ? readAcpTranscriptFile(path3, row.session_id) : [], acpLedger);
50262
- }
50263
- if (row.backend === "codex") {
50264
- const backend = backendFor?.("codex") ?? defaultCodexBackend();
50265
- const nativeId = row.agent_session_id ?? row.session_id;
50266
- const path3 = backend.transcriptPath(nativeId);
50267
- const codexLedger = parseDeliveryLedger(row.delivery_ledger);
50268
- return projectDeliveryLedger(path3 ? readCodexTranscriptFile(path3, nativeId) : [], codexLedger);
50269
- }
50270
- const ledger = parseDeliveryLedger(row.delivery_ledger);
50271
- const msgs = readTranscript(project, row.transcript_id ?? row.session_id);
50272
- if (msgs.length || row.transcript_id) return projectDeliveryLedger(msgs, ledger);
50273
- if (Date.now() - Date.parse(row.spawned_at) < DISCOVERY_GRACE_MS) return projectDeliveryLedger(msgs, ledger);
50274
- const exclude = /* @__PURE__ */ new Set();
50275
- for (const r of storage.allSessions()) {
50276
- if (r.slug === row.slug) continue;
50277
- exclude.add(r.session_id);
50278
- if (r.transcript_id) exclude.add(r.transcript_id);
50279
- }
50280
- const found = discoverTranscriptId(logDirOf(project), row.session_id, { exclude });
50281
- return projectDeliveryLedger(found ? readTranscript(project, found) : msgs, ledger);
50282
- }
50283
- if (FOREIGN_SESSION_ID_RE.test(slug)) {
50284
- const source = sourceForThread(project, storage, slug, backendFor);
50285
- if (!source) return [];
50286
- return source.backend === "codex" ? readCodexTranscriptFile(source.path, slug) : readTranscript(project, slug);
50287
- }
50288
- return [];
50289
- }
50290
50299
  function projectTranscriptAgentLifecycles(messages, lookup) {
50291
50300
  const cache2 = /* @__PURE__ */ new Map();
50292
50301
  const projectTool = (tool) => {
@@ -50355,7 +50364,7 @@ function readTranscriptFile(absPath) {
50355
50364
  return [];
50356
50365
  }
50357
50366
  }
50358
- var MAX_MESSAGES, LATEST_WINDOW_ASK_REACH_ITEMS, LATEST_WINDOW_ASK_REACH_BYTES, REST_LABEL, LEGACY_TASK_MARKER, LEGACY_BANNER_PREAMBLE, COMMAND_NAME_RE, COMMAND_ARGS_RE, PEER_SESSION_PREAMBLE, CLAUDE_COORDINATOR_INSTRUCTION_PREFIX, CLAUDE_COORDINATOR_INSTRUCTION_SUFFIX, CLAUDE_PEER_INSTRUCTION_PREFIX, QUEUED_STALE_MS, EDIT_CAP, TRUNC_MARKER, ENCRYPTED_PAYLOAD, AGENT_PROMPT_CAP, SEND_BODY_CAP, COMMAND_CAP, TOOL_INPUT_CAP, READ_LINE_CAP, READ_BYTE_CAP, IMAGE_MEDIA_EXT, SCREENSHOT_CACHE_DIR, SCREENSHOT_CACHE_MAX, SCREENSHOT_MAX_BASE64, screenshotTmpSeq, SENT_IMAGE_MAX_BYTES, SENT_FILES_MAX, TODO_ROWS_MAX, TODO_TEXT_CAP, TRANSCRIPT_CACHE_CAP, transcriptCache, PARSE_VERIFY_SAMPLE, TRANSCRIPT_DECODE_WINDOW, FOREIGN_SESSION_ID_RE, MAX_PINNED_BACKGROUND_OPERATIONS, CAPTION_MAX, _defaultCodexBackend, TRANSCRIPT_EARLIER_MAX_ITEMS, TRANSCRIPT_EARLIER_MAX_BYTES, fullDigestCache, FULL_DIGEST_CACHE_CAP, EMPTY_RETIRED_OPS;
50367
+ var MAX_MESSAGES, LATEST_WINDOW_ASK_REACH_ITEMS, LATEST_WINDOW_ASK_REACH_BYTES, LATEST_WINDOW_MAX_BYTES, REST_LABEL, LEGACY_TASK_MARKER, LEGACY_BANNER_PREAMBLE, COMMAND_NAME_RE, COMMAND_ARGS_RE, PEER_SESSION_PREAMBLE, CLAUDE_COORDINATOR_INSTRUCTION_PREFIX, CLAUDE_COORDINATOR_INSTRUCTION_SUFFIX, CLAUDE_PEER_INSTRUCTION_PREFIX, QUEUED_STALE_MS, EDIT_CAP, TRUNC_MARKER, ENCRYPTED_PAYLOAD, AGENT_PROMPT_CAP, SEND_BODY_CAP, COMMAND_CAP, TOOL_INPUT_CAP, READ_LINE_CAP, READ_BYTE_CAP, IMAGE_MEDIA_EXT, SCREENSHOT_CACHE_DIR, SCREENSHOT_CACHE_MAX, SCREENSHOT_MAX_BASE64, screenshotTmpSeq, SENT_IMAGE_MAX_BYTES, SENT_FILES_MAX, TODO_ROWS_MAX, TODO_TEXT_CAP, TRANSCRIPT_CACHE_CAP, transcriptCache, PARSE_VERIFY_SAMPLE, TRANSCRIPT_DECODE_WINDOW, FOREIGN_SESSION_ID_RE, MAX_PINNED_BACKGROUND_OPERATIONS, CAPTION_MAX, _defaultCodexBackend, TRANSCRIPT_EARLIER_MAX_ITEMS, TRANSCRIPT_EARLIER_MAX_BYTES, fullDigestCache, FULL_DIGEST_CACHE_CAP, EMPTY_RETIRED_OPS;
50359
50368
  var init_transcript = __esm({
50360
50369
  "packages/server/src/transcript.ts"() {
50361
50370
  "use strict";
@@ -50376,6 +50385,7 @@ var init_transcript = __esm({
50376
50385
  MAX_MESSAGES = 300;
50377
50386
  LATEST_WINDOW_ASK_REACH_ITEMS = 100;
50378
50387
  LATEST_WINDOW_ASK_REACH_BYTES = 512 * 1024;
50388
+ LATEST_WINDOW_MAX_BYTES = 3 * 1024 * 1024;
50379
50389
  REST_LABEL = "Agent rested";
50380
50390
  LEGACY_TASK_MARKER = "\nTASK:\n";
50381
50391
  LEGACY_BANNER_PREAMBLE = "Everything ABOVE this line is frizz system orientation. Everything BELOW the `TASK:` marker is the human operator's own prompt, verbatim.";
@@ -51151,7 +51161,7 @@ var init_directory_picker = __esm({
51151
51161
  import { readFileSync as readFileSync26, statSync as statSync19 } from "node:fs";
51152
51162
  import { join as join39, resolve as resolve9 } from "node:path";
51153
51163
  import { randomUUID as randomUUID16 } from "node:crypto";
51154
- import { basename as basename9, dirname as dirname17 } from "node:path";
51164
+ import { basename as basename9, dirname as dirname18 } from "node:path";
51155
51165
  import { existsSync as existsSync15, mkdirSync as mkdirSync17, rmSync as rmSync10, writeFileSync as writeFileSync13 } from "node:fs";
51156
51166
  import { homedir as homedir17 } from "node:os";
51157
51167
  function validateGithubDispatchProfile(input) {
@@ -51351,7 +51361,7 @@ function storeProjectIcon(id, name, bytes) {
51351
51361
  if (!entry) throw new Error("No such project.");
51352
51362
  if (bytes.length === 0) throw new Error("That file is empty.");
51353
51363
  const path3 = customIconPath(id, `.${extension2}`);
51354
- mkdirSync17(dirname17(path3), { recursive: true });
51364
+ mkdirSync17(dirname18(path3), { recursive: true });
51355
51365
  writeFileSync13(path3, bytes);
51356
51366
  if (!imageDimensions(path3)) {
51357
51367
  rmSync10(path3, { force: true });
@@ -52304,7 +52314,16 @@ ${gapNote}` : input.message;
52304
52314
  const thread = (await ctx.board.snapshot()).threads.find((candidate) => candidate.id === input.slug);
52305
52315
  if (!thread || thread.foreign || thread.kind !== "session") throw new Error(`thread ${input.slug} is not editable`);
52306
52316
  const profRow = ctx.storage.getSession(input.slug);
52307
- if (profRow?.backend === "acp") throw new Error("An ACP agent chooses its own model; Frizz offers no profile for it yet");
52317
+ if (profRow?.backend === "acp") {
52318
+ if (acpAgentIdFromModel(input.model) !== acpAgentIdFromModel(profRow.model ?? "")) {
52319
+ throw new Error("An ACP thread's agent cannot change; pick a model of the same agent");
52320
+ }
52321
+ ctx.storage.setProfile(input.slug, input.model, "");
52322
+ const live = ctx.acpBridge ? await ctx.acpBridge.setModel(input.slug, profRow.session_id, acpModelIdFromModel(input.model)) : { applied: false };
52323
+ ctx.board.refresh();
52324
+ return { effect: live.applied ? "applied" : "next-resume" };
52325
+ }
52326
+ if (!input.effort) throw new Error(`effort is required for a ${profRow?.backend ?? "claude"} thread`);
52308
52327
  if (profRow?.backend === "codex") {
52309
52328
  ctx.storage.setProfile(input.slug, input.model, input.effort);
52310
52329
  ctx.board.refresh();
@@ -53865,6 +53884,7 @@ var init_compression = __esm({
53865
53884
  import { readFileSync as readFileSync27, realpathSync as realpathSync11, statSync as statSync20 } from "node:fs";
53866
53885
  import { extname as extname2, isAbsolute as isAbsolute7 } from "node:path";
53867
53886
  function resolveLocalImage(rawPath) {
53887
+ if (rawPath) rawPath = normalizeLocalPath(rawPath);
53868
53888
  if (!rawPath || !isAbsolute7(rawPath)) return { status: 400 };
53869
53889
  const contentType = IMAGE_CONTENT_TYPE[extname2(rawPath).toLowerCase()];
53870
53890
  if (!contentType) return { status: 400 };
@@ -53885,6 +53905,7 @@ var IMAGE_CONTENT_TYPE;
53885
53905
  var init_local_image = __esm({
53886
53906
  "packages/server/src/local-image.ts"() {
53887
53907
  "use strict";
53908
+ init_local_path();
53888
53909
  IMAGE_CONTENT_TYPE = {
53889
53910
  ".png": "image/png",
53890
53911
  ".jpg": "image/jpeg",
@@ -53898,7 +53919,7 @@ var init_local_image = __esm({
53898
53919
  // packages/server/src/project-icon.ts
53899
53920
  import { readFileSync as readFileSync28, readdirSync as readdirSync10, realpathSync as realpathSync12, statSync as statSync21 } from "node:fs";
53900
53921
  import { homedir as homedir18 } from "node:os";
53901
- import { basename as basename10, dirname as dirname18, extname as extname3, join as join40, relative as relative2, sep as sep3 } from "node:path";
53922
+ import { basename as basename10, dirname as dirname19, extname as extname3, join as join40, relative as relative2, sep as sep3 } from "node:path";
53902
53923
  function normalizeStem(stem) {
53903
53924
  const sized = stem.toLowerCase().replace(/[@-]\d+(\.\d+)?x(\d+)?$/u, "").replace(/[-_]\d{2,4}$/u, "");
53904
53925
  const normalized = sized.replace(VARIANT_SUFFIX, "");
@@ -53963,7 +53984,7 @@ function manifestIcons(manifestPath) {
53963
53984
  return [];
53964
53985
  }
53965
53986
  if (!Array.isArray(parsed?.icons)) return [];
53966
- const directory = dirname18(manifestPath);
53987
+ const directory = dirname19(manifestPath);
53967
53988
  return parsed.icons.map((icon) => typeof icon?.src === "string" ? icon.src : void 0).filter((src) => !!src && !/^(https?:)?\/\//u.test(src) && !src.startsWith("data:")).map((src) => join40(directory, src.replace(/[?#].*$/u, "").replace(/^\//u, "")));
53968
53989
  }
53969
53990
  function projectIconCandidates(root) {
@@ -53986,7 +54007,7 @@ function projectIconCandidates(root) {
53986
54007
  for (const icon of manifestIcons(join40(directory, name))) {
53987
54008
  if (MEASURABLE_IMAGE_EXTENSIONS.has(extname3(icon).toLowerCase())) {
53988
54009
  fromManifest.add(icon);
53989
- files.push({ path: icon, directory: dirname18(icon) });
54010
+ files.push({ path: icon, directory: dirname19(icon) });
53990
54011
  }
53991
54012
  }
53992
54013
  continue;
@@ -54902,10 +54923,19 @@ function isWsPath(url) {
54902
54923
  }
54903
54924
  function makeTranscriptReader(project, storage, backendFor, lifecycleFor, peerNameFor, ownerGone) {
54904
54925
  return (slug) => {
54905
- const messages = readThreadTranscript(project, storage, slug, backendFor);
54906
- const named = peerNameFor ? projectTranscriptPeerNames(messages, (taskId) => peerNameFor(slug, taskId)) : messages;
54926
+ const page = readLatestThreadTranscriptPage(project, storage, slug, backendFor, { editedFiles: false });
54927
+ const named = peerNameFor ? projectTranscriptPeerNames(page.messages, (taskId) => peerNameFor(slug, taskId)) : page.messages;
54907
54928
  const projected = lifecycleFor ? projectTranscriptAgentLifecycles(named, (id) => lifecycleFor(slug, id)) : named;
54908
- return projectRetiredBackgroundOps(projected, retiredOpsFor(storage, slug), ownerGone?.(slug) ?? false);
54929
+ const messages = projectRetiredBackgroundOps(projected, retiredOpsFor(storage, slug), ownerGone?.(slug) ?? false);
54930
+ return {
54931
+ messages,
54932
+ page: {
54933
+ beforeCursor: page.beforeCursor,
54934
+ hasEarlier: page.hasEarlier,
54935
+ reachedTurnBoundary: page.reachedTurnBoundary,
54936
+ transcriptKey: page.transcriptKey
54937
+ }
54938
+ };
54909
54939
  };
54910
54940
  }
54911
54941
  function createAppSocketServer(deps) {
@@ -55186,9 +55216,9 @@ function createAppSocketServer(deps) {
55186
55216
  if (cached2) return { kind: "ready", snapshot: cached2 };
55187
55217
  const reservation = reserveTranscriptRead(origin);
55188
55218
  if (reservation.kind === "limited") return reservation;
55189
- const messages = readTranscript2(slug);
55190
- if (!messages) return { kind: "unavailable" };
55191
- const frame = encodeMsg({ t: "transcript", slug, messages });
55219
+ const read = readTranscript2(slug);
55220
+ if (!read) return { kind: "unavailable" };
55221
+ const frame = encodeMsg(read.page ? { t: "transcript", slug, messages: read.messages, page: read.page } : { t: "transcript", slug, messages: read.messages });
55192
55222
  if (!frame) return { kind: "unavailable" };
55193
55223
  if (frame.bytes > maxLogicalFrameBytes) return { kind: "oversized", actualBytes: frame.bytes };
55194
55224
  const snapshot = { frame, sig: frameSignature(frame), weight: snapshotWeight(frame) };
@@ -55749,7 +55779,7 @@ var init_app_socket = __esm({
55749
55779
 
55750
55780
  // packages/server/src/local-file-watch.ts
55751
55781
  import { statSync as statSync23, watch } from "node:fs";
55752
- import { basename as basename11, dirname as dirname19 } from "node:path";
55782
+ import { basename as basename11, dirname as dirname20 } from "node:path";
55753
55783
  function stampOf(path3) {
55754
55784
  try {
55755
55785
  const s = statSync23(path3, { bigint: true });
@@ -55772,7 +55802,7 @@ function watchLocalFile(path3, onChange) {
55772
55802
  let entry = entries.get(path3);
55773
55803
  if (!entry) {
55774
55804
  const name = basename11(path3);
55775
- const watcher2 = watch(dirname19(path3), { persistent: false }, (_event, changed) => {
55805
+ const watcher2 = watch(dirname20(path3), { persistent: false }, (_event, changed) => {
55776
55806
  if (changed !== null && changed !== void 0 && changed.toString() !== name) return;
55777
55807
  const current = entries.get(path3);
55778
55808
  if (!current) return;
@@ -55809,7 +55839,7 @@ var init_local_file_watch = __esm({
55809
55839
 
55810
55840
  // packages/server/src/boot-progress.ts
55811
55841
  import { mkdirSync as mkdirSync19, readFileSync as readFileSync30, renameSync as renameSync10, rmSync as rmSync11, writeFileSync as writeFileSync15 } from "node:fs";
55812
- import { basename as basename12, dirname as dirname20, join as join43 } from "node:path";
55842
+ import { basename as basename12, dirname as dirname21, join as join43 } from "node:path";
55813
55843
  function bootProgressPath(stateDir) {
55814
55844
  return join43(stateDir, BOOT_PROGRESS_NAME);
55815
55845
  }
@@ -55831,8 +55861,8 @@ function createBootProgressPublisher(stateDir, minIntervalMs = 200) {
55831
55861
  lastAt = now;
55832
55862
  step++;
55833
55863
  try {
55834
- mkdirSync19(dirname20(path3), { recursive: true, mode: 448 });
55835
- const temp = join43(dirname20(path3), `.${basename12(path3)}.${process.pid}.tmp`);
55864
+ mkdirSync19(dirname21(path3), { recursive: true, mode: 448 });
55865
+ const temp = join43(dirname21(path3), `.${basename12(path3)}.${process.pid}.tmp`);
55836
55866
  writeFileSync15(temp, `${JSON.stringify({ pid: process.pid, step, phase, at: new Date(now).toISOString() })}
55837
55867
  `, "utf8");
55838
55868
  renameSync10(temp, path3);
@@ -55859,12 +55889,12 @@ var init_boot_progress = __esm({
55859
55889
 
55860
55890
  // packages/server/src/runtime-lease.ts
55861
55891
  import { existsSync as existsSync16, mkdirSync as mkdirSync20, readdirSync as readdirSync12, readFileSync as readFileSync31, unlinkSync as unlinkSync6, writeFileSync as writeFileSync16 } from "node:fs";
55862
- import { dirname as dirname21, join as join44 } from "node:path";
55892
+ import { dirname as dirname22, join as join44 } from "node:path";
55863
55893
  function runtimeVersionDir(bin) {
55864
- let dir = dirname21(bin);
55894
+ let dir = dirname22(bin);
55865
55895
  for (let step = 0; step < MAX_ASCENT; step++) {
55866
55896
  if (existsSync16(join44(dir, PROVISIONED_MARKER))) return dir;
55867
- const parent = dirname21(dir);
55897
+ const parent = dirname22(dir);
55868
55898
  if (parent === dir) return void 0;
55869
55899
  dir = parent;
55870
55900
  }
@@ -55884,7 +55914,7 @@ function leaseRuntime(bin, role) {
55884
55914
  };
55885
55915
  const path3 = join44(versionDir, LEASES_DIR, `${process.pid}.json`);
55886
55916
  try {
55887
- mkdirSync20(dirname21(path3), { recursive: true });
55917
+ mkdirSync20(dirname22(path3), { recursive: true });
55888
55918
  const lease = { pid: process.pid, role, bin, at: (/* @__PURE__ */ new Date()).toISOString() };
55889
55919
  writeFileSync16(path3, JSON.stringify(lease));
55890
55920
  } catch {
@@ -55954,7 +55984,7 @@ import {
55954
55984
  writeFileSync as writeFileSync17,
55955
55985
  writeSync as writeSync2
55956
55986
  } from "node:fs";
55957
- import { dirname as dirname22, isAbsolute as isAbsolute8, join as join45, normalize, relative as relative3, sep as sep5 } from "node:path";
55987
+ import { dirname as dirname23, isAbsolute as isAbsolute8, join as join45, normalize, relative as relative3, sep as sep5 } from "node:path";
55958
55988
  import { Readable, Transform, Writable as Writable3 } from "node:stream";
55959
55989
  import { pipeline } from "node:stream/promises";
55960
55990
  import { createGunzip } from "node:zlib";
@@ -56215,8 +56245,8 @@ var init_runtimes = __esm({
56215
56245
  init_codex_app_server();
56216
56246
  init_frizz_paths();
56217
56247
  init_runtime_lease();
56218
- CLAUDE_AGENT_SDK_VERSION = "0.3.273";
56219
- CLAUDE_CODE_VERSION = "2.1.273";
56248
+ CLAUDE_AGENT_SDK_VERSION = "0.3.275";
56249
+ CLAUDE_CODE_VERSION = "2.1.275";
56220
56250
  CODEX_VERSION = CODEX_APP_SERVER_SUPPORTED_VERSION;
56221
56251
  RUNTIMES_MODE_ENV = "FRIZZ_RUNTIMES";
56222
56252
  RUNTIMES_DIR_ENV = "FRIZZ_RUNTIMES_DIR";
@@ -56313,7 +56343,7 @@ var init_runtimes = __esm({
56313
56343
  case "7": {
56314
56344
  const file = safeEntryPath(this.dest, name);
56315
56345
  if (!file) return;
56316
- mkdirSync21(dirname22(file), { recursive: true });
56346
+ mkdirSync21(dirname23(file), { recursive: true });
56317
56347
  this.fd = openSync17(file, "w", octal(header, 100, 8) & 511 || 420);
56318
56348
  this.written.push(file);
56319
56349
  return;
@@ -56891,12 +56921,12 @@ var init_legacy_project_db = __esm({
56891
56921
 
56892
56922
  // packages/server/src/frizz-db.ts
56893
56923
  import { existsSync as existsSync18, mkdirSync as mkdirSync22, readdirSync as readdirSync14, renameSync as renameSync12, statSync as statSync25 } from "node:fs";
56894
- import { basename as basename13, dirname as dirname23, join as join46 } from "node:path";
56924
+ import { basename as basename13, dirname as dirname24, join as join46 } from "node:path";
56895
56925
  function frizzDatabaseLocation(options) {
56896
56926
  if (options.stateDir !== void 0) {
56897
- const projectsDir = dirname23(options.stateDir);
56927
+ const projectsDir = dirname24(options.stateDir);
56898
56928
  if (basename13(projectsDir) === "projects") {
56899
- return { path: options.path ?? join46(dirname23(projectsDir), "ui.db"), projectsDir };
56929
+ return { path: options.path ?? join46(dirname24(projectsDir), "ui.db"), projectsDir };
56900
56930
  }
56901
56931
  return { path: options.path ?? join46(options.stateDir, "ui.db"), projectsDir: void 0 };
56902
56932
  }
@@ -56920,7 +56950,7 @@ function ensureFrizzSchema(db) {
56920
56950
  }
56921
56951
  function openFrizzDatabase(options = {}) {
56922
56952
  const { path: path3, projectsDir } = frizzDatabaseLocation(options);
56923
- mkdirSync22(dirname23(path3), { recursive: true });
56953
+ mkdirSync22(dirname24(path3), { recursive: true });
56924
56954
  const db = new sqlite_default(path3);
56925
56955
  db.pragma("busy_timeout = 5000");
56926
56956
  db.pragma("journal_mode = WAL");
@@ -57144,7 +57174,7 @@ var init_tenant_prime = __esm({
57144
57174
  // packages/server/src/project-teardown.ts
57145
57175
  import { rmSync as rmSync13 } from "node:fs";
57146
57176
  import { homedir as homedir19 } from "node:os";
57147
- import { dirname as dirname24, resolve as resolve10 } from "node:path";
57177
+ import { dirname as dirname25, resolve as resolve10 } from "node:path";
57148
57178
  async function stopProjectWorkers(ctx) {
57149
57179
  let stopped = 0;
57150
57180
  for (const row of ctx.storage.allSessions()) {
@@ -57164,7 +57194,7 @@ function deleteProjectState(projectId, home = homedir19()) {
57164
57194
  if (!/^[\w.-]+$/u.test(projectId) || projectId === "." || projectId === "..") {
57165
57195
  throw new Error(`Refusing to delete state for a malformed project id: ${projectId}`);
57166
57196
  }
57167
- if (dirname24(resolve10(target)) !== resolve10(dirname24(projectStateDir("x", home)))) {
57197
+ if (dirname25(resolve10(target)) !== resolve10(dirname25(projectStateDir("x", home)))) {
57168
57198
  throw new Error(`Refusing to delete ${target} \u2014 it is not a project state directory`);
57169
57199
  }
57170
57200
  rmSync13(target, { recursive: true, force: true });
@@ -57194,7 +57224,7 @@ __export(index_exports, {
57194
57224
  });
57195
57225
  import { createServer } from "node:http";
57196
57226
  import { readFileSync as readFileSync33, existsSync as existsSync19, statSync as statSync26 } from "node:fs";
57197
- import { dirname as dirname25, join as join47, resolve as resolve11, extname as extname4, posix as posix2, sep as sep6 } from "node:path";
57227
+ import { dirname as dirname26, join as join47, resolve as resolve11, extname as extname4, posix as posix2, sep as sep6 } from "node:path";
57198
57228
  function readServerAddressHolder(path3) {
57199
57229
  try {
57200
57230
  const value = JSON.parse(readFileSync33(path3, "utf8"));
@@ -57605,7 +57635,7 @@ async function startServer(opts = {}) {
57605
57635
  if (statusPath && statusIdentity) runtime.removeStatus(statusPath, statusIdentity);
57606
57636
  if (statusPath && statusIdentity) {
57607
57637
  try {
57608
- runtime.removeStatus(serverAddressPathForStateDir(dirname25(statusPath)), statusIdentity);
57638
+ runtime.removeStatus(serverAddressPathForStateDir(dirname26(statusPath)), statusIdentity);
57609
57639
  } catch {
57610
57640
  }
57611
57641
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "frizz-server",
3
- "version": "0.13.8",
3
+ "version": "0.13.9",
4
4
  "private": false,
5
5
  "description": "Replaceable Frizz server runtime",
6
6
  "license": "MIT",