glimmervoid 0.52.3-next.807 → 0.52.3-next.809

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 (174) hide show
  1. package/dist/bin/glimmervoid.js +18 -18
  2. package/dist/chunks/{adapters-25aeu1R1.js → adapters-Bg-l7NBf.js} +7 -7
  3. package/dist/chunks/{adapters-tSIHq8Hn.js → adapters-CegV3T42.js} +1 -1
  4. package/dist/chunks/agent-api-cli-BNz1cOp2.js +1 -0
  5. package/dist/chunks/{agent-api-cli-DxO9ELoI.js → agent-api-cli-BkLD2K18.js} +18 -8
  6. package/dist/chunks/{agent-api-core-D1r58EPG.js → agent-api-core-CADmSdvT.js} +14 -4
  7. package/dist/chunks/{agent-setup-cli-DxA0bzwQ.js → agent-setup-cli-D7XCboR8.js} +1 -1
  8. package/dist/chunks/{config-BpqtJgTB.js → config-CdUCPp52.js} +2 -2
  9. package/dist/chunks/config-store-BG2_KF9v.js +1 -0
  10. package/dist/chunks/{config-store-D2MGO82q.js → config-store-RJTZlSL9.js} +3 -3
  11. package/dist/chunks/{control-messages-BvSNTMsJ.js → control-messages-Cx_1p9iz.js} +2 -28
  12. package/dist/chunks/{grok-DYY5s6MU.js → grok-DA9Dmmu3.js} +1 -1
  13. package/dist/chunks/{host-cli-BGje0wht.js → host-cli-CbCKHk5C.js} +3 -3
  14. package/dist/chunks/{host-registry-core-DdbIz-3r.js → host-registry-core-Cj9x_2Yr.js} +1 -1
  15. package/dist/chunks/kimi-CZSsNDJi.js +1 -0
  16. package/dist/chunks/{kimi-DFDGODAS.js → kimi-Ck2t9UVT.js} +2 -2
  17. package/dist/chunks/{main-CffIYtny.js → main-BDFQ_0lM.js} +432 -199
  18. package/dist/chunks/{pack-agent-Cysyv1Fs.js → pack-agent-D9TcEpR3.js} +5 -5
  19. package/dist/chunks/{pack-bridge-Bu5URQmU.js → pack-bridge-BKP_4o4G.js} +1 -1
  20. package/dist/chunks/{pack-files-D-DwYbEb.js → pack-files-Cquc-WhV.js} +3 -3
  21. package/dist/chunks/{packs-cli-qgNBE8ex.js → packs-cli-B8AP2zKu.js} +5 -5
  22. package/dist/chunks/{pair-cli-Ce8qbGau.js → pair-cli-DJWfqOj3.js} +2 -2
  23. package/dist/chunks/{pr-flows-cli-naSqKYEq.js → pr-flows-cli-NUyOxO9a.js} +6 -6
  24. package/dist/chunks/{pr-flows-core-BozpyjPp.js → pr-flows-core-C5EdQcdl.js} +1 -1
  25. package/dist/chunks/{pr-flows-external-DcCUz1_Q.js → pr-flows-external-Bwwtnh-u.js} +3 -3
  26. package/dist/chunks/{remote-config-BGSn0ai8.js → remote-config-BxXgPLrF.js} +1 -1
  27. package/dist/chunks/{session-CHI_Z8jB.js → session-C0cPFaQs.js} +23 -41
  28. package/dist/chunks/{settings-cli-Lmz4s3z3.js → settings-cli-Ce4-Yr_8.js} +5 -5
  29. package/dist/chunks/settings-cli-DdSs9MOa.js +1 -0
  30. package/dist/chunks/{settings-readout-core-CmLHyRuh.js → settings-readout-core-O6-uLAi3.js} +2 -2
  31. package/dist/chunks/{spawn-env-BzXNL1C6.js → spawn-env-CapiuFtq.js} +1 -1
  32. package/dist/chunks/{ssh-sign-cli-SSrsdcXY.js → ssh-sign-cli-zx7cdsL_.js} +2 -2
  33. package/dist/chunks/{watch-cli-DEbQ_ctx.js → watch-cli-CMxNbyZx.js} +1 -1
  34. package/dist/chunks/{watchee-settings-CilMSdQX.js → watchee-settings-CjkenTD8.js} +3 -3
  35. package/dist/chunks/{whiteboard-svg-core-pcQJ3as0.js → whiteboard-svg-core-CFm2oj-T.js} +58 -347
  36. package/dist/client/assets/{action-status-6VD8SEPk.js → action-status-CgUlY1YC.js} +1 -1
  37. package/dist/client/assets/action-status-CgUlY1YC.js.br +0 -0
  38. package/dist/client/assets/{agent-mark-BeBq-V4v.js → agent-mark-THy-kVQg.js} +1 -1
  39. package/dist/client/assets/agent-mark-THy-kVQg.js.br +0 -0
  40. package/dist/client/assets/{arena-panel-V5Tbj_Yo.js → arena-panel-HS-Ic5pF.js} +2 -2
  41. package/dist/client/assets/arena-panel-HS-Ic5pF.js.br +0 -0
  42. package/dist/client/assets/{benchmark-panel-B2xbVPFv.js → benchmark-panel-DvYTVuxO.js} +1 -1
  43. package/dist/client/assets/benchmark-panel-DvYTVuxO.js.br +0 -0
  44. package/dist/client/assets/boards-view-CLz0huLQ.js +2 -0
  45. package/dist/client/assets/boards-view-CLz0huLQ.js.br +0 -0
  46. package/dist/client/assets/boards-view-DKK7CYMF.css +1 -0
  47. package/dist/client/assets/boards-view-DKK7CYMF.css.br +0 -0
  48. package/dist/client/assets/button-DOiRqykb.js +1 -0
  49. package/dist/client/assets/button-DOiRqykb.js.br +0 -0
  50. package/dist/client/assets/{card-actions-Bquhy4Ng.js → card-actions-D7SrqW9f.js} +1 -1
  51. package/dist/client/assets/{card-registry-BbWUj8eF.js → card-registry-DdJYrnbX.js} +1 -1
  52. package/dist/client/assets/card-registry-DdJYrnbX.js.br +0 -0
  53. package/dist/client/assets/community-panel-C1ZnZmyC.js +1 -0
  54. package/dist/client/assets/community-panel-C1ZnZmyC.js.br +0 -0
  55. package/dist/client/assets/{control-ws-Bz4VldcE.js → control-ws-C9XYFFfj.js} +1 -1
  56. package/dist/client/assets/control-ws-C9XYFFfj.js.br +0 -0
  57. package/dist/client/assets/{dialogs-CNXRUEVH.js → dialogs-CFFU4wdM.js} +2 -2
  58. package/dist/client/assets/dialogs-CFFU4wdM.js.br +0 -0
  59. package/dist/client/assets/doc-editor-ui-B2minZMx.js +4 -0
  60. package/dist/client/assets/doc-editor-ui-B2minZMx.js.br +0 -0
  61. package/dist/client/assets/{feature-hint-CrYKKsYJ.js → feature-hint-CY5bwdoa.js} +1 -1
  62. package/dist/client/assets/feature-hint-CY5bwdoa.js.br +0 -0
  63. package/dist/client/assets/{first-run-checklist-CXHVi07U.js → first-run-checklist-Cve6sTAe.js} +1 -1
  64. package/dist/client/assets/first-run-checklist-Cve6sTAe.js.br +0 -0
  65. package/dist/client/assets/{hooks-panel-BBRrv3BH.js → hooks-panel-C2gUg-Tf.js} +1 -1
  66. package/dist/client/assets/hooks-panel-C2gUg-Tf.js.br +0 -0
  67. package/dist/client/assets/index-CoTWg1Fo.js +75 -0
  68. package/dist/client/assets/index-CoTWg1Fo.js.br +0 -0
  69. package/dist/client/assets/issues-panel-DaFkHMzP.js +1 -0
  70. package/dist/client/assets/issues-panel-DaFkHMzP.js.br +0 -0
  71. package/dist/client/assets/{lane-read-token-step-D8-yF1HL.js → lane-read-token-step-C_S545ce.js} +5 -5
  72. package/dist/client/assets/lane-read-token-step-C_S545ce.js.br +0 -0
  73. package/dist/client/assets/layout-worker-Cz085QBZ.js +113 -0
  74. package/dist/client/assets/layout-worker-Cz085QBZ.js.br +0 -0
  75. package/dist/client/assets/{menu-XYP16XJ3.js → menu-Dazd3nW4.js} +1 -1
  76. package/dist/client/assets/menu-Dazd3nW4.js.br +0 -0
  77. package/dist/client/assets/{modal-DWUonmkq.js → modal-B4PM2625.js} +1 -1
  78. package/dist/client/assets/modal-B4PM2625.js.br +0 -0
  79. package/dist/client/assets/my-prs-panel-CPRpiJiG.js +1 -0
  80. package/dist/client/assets/my-prs-panel-CPRpiJiG.js.br +0 -0
  81. package/dist/client/assets/{nyan-cat-D6avoFIB.js → nyan-cat-BTHG0UUv.js} +1 -1
  82. package/dist/client/assets/nyan-cat-BTHG0UUv.js.br +0 -0
  83. package/dist/client/assets/phone-shell-C43cJPVc.js +1 -0
  84. package/dist/client/assets/phone-shell-C43cJPVc.js.br +0 -0
  85. package/dist/client/assets/{plan-face-BWQDW5yg.js → plan-face-CNBCZxLX.js} +1 -1
  86. package/dist/client/assets/plan-face-CNBCZxLX.js.br +0 -0
  87. package/dist/client/assets/{plan-render-Bi-S0TBf.js → plan-render-LqcxVigZ.js} +1 -1
  88. package/dist/client/assets/plan-render-LqcxVigZ.js.br +0 -0
  89. package/dist/client/assets/{pr-queue-columns-C00BNwlj.js → pr-queue-columns-CzkapYZn.js} +1 -1
  90. package/dist/client/assets/pr-queue-columns-CzkapYZn.js.br +0 -0
  91. package/dist/client/assets/{pr-status-icon-B24mi7ku.js → pr-status-icon-2dbYpTqp.js} +1 -1
  92. package/dist/client/assets/pr-status-icon-2dbYpTqp.js.br +0 -0
  93. package/dist/client/assets/{radar-panel-nK-caoXd.js → radar-panel-DFrSdu-f.js} +1 -1
  94. package/dist/client/assets/radar-panel-DFrSdu-f.js.br +0 -0
  95. package/dist/client/assets/{repo-roots-adder-WHgRDCGZ.js → repo-roots-adder-D8YNdS3c.js} +1 -1
  96. package/dist/client/assets/repo-roots-adder-D8YNdS3c.js.br +0 -0
  97. package/dist/client/assets/{resume-dialog-t0YcfWJU.js → resume-dialog-CirMYf43.js} +1 -1
  98. package/dist/client/assets/resume-dialog-CirMYf43.js.br +0 -0
  99. package/dist/client/assets/{review-queue-panel-CsIIqoWR.js → review-queue-panel-DUlerBsN.js} +1 -1
  100. package/dist/client/assets/review-queue-panel-DUlerBsN.js.br +0 -0
  101. package/dist/client/assets/{session-actions-VGj22OAx.js → session-actions-BKJSUQcv.js} +2 -2
  102. package/dist/client/assets/session-actions-BKJSUQcv.js.br +0 -0
  103. package/dist/client/assets/{session-row-B1uShpcX.js → session-row-DEOAjVZN.js} +1 -1
  104. package/dist/client/assets/session-row-DEOAjVZN.js.br +0 -0
  105. package/dist/client/assets/{session-tick-BwkhB4Mf.js → session-tick-DkL0Rymq.js} +1 -1
  106. package/dist/client/assets/session-tick-DkL0Rymq.js.br +0 -0
  107. package/dist/client/assets/{settings-panel-j9Iuyd1b.js → settings-panel-DqO2JCXH.js} +4 -4
  108. package/dist/client/assets/settings-panel-DqO2JCXH.js.br +0 -0
  109. package/dist/client/assets/{setup-step-4aJmqI4U.js → setup-step-C6Me6J42.js} +1 -1
  110. package/dist/client/assets/setup-step-C6Me6J42.js.br +0 -0
  111. package/dist/client/assets/{trace-panel-DwXYQ3bb.js → trace-panel-D6LbAUay.js} +1 -1
  112. package/dist/client/assets/trace-panel-D6LbAUay.js.br +0 -0
  113. package/dist/client/assets/{usage-panel-cVBMbNyb.js → usage-panel-Cgwhpoqh.js} +1 -1
  114. package/dist/client/assets/usage-panel-Cgwhpoqh.js.br +0 -0
  115. package/dist/client/assets/{your-day-tip-gf3QBghQ.js → your-day-tip-D5XAfj4s.js} +1 -1
  116. package/dist/client/assets/your-day-tip-D5XAfj4s.js.br +0 -0
  117. package/dist/client/index.html +13 -13
  118. package/dist/client/index.html.br +0 -0
  119. package/dist/server/index.js +1 -1
  120. package/package.json +1 -1
  121. package/dist/chunks/agent-api-cli-GWVoS8eq.js +0 -1
  122. package/dist/chunks/config-store-B04kHfV9.js +0 -1
  123. package/dist/chunks/kimi-BLxL43sg.js +0 -1
  124. package/dist/chunks/settings-cli-eeiKjxlK.js +0 -1
  125. package/dist/client/assets/action-status-6VD8SEPk.js.br +0 -0
  126. package/dist/client/assets/agent-mark-BeBq-V4v.js.br +0 -0
  127. package/dist/client/assets/arena-panel-V5Tbj_Yo.js.br +0 -0
  128. package/dist/client/assets/benchmark-panel-B2xbVPFv.js.br +0 -0
  129. package/dist/client/assets/boards-view-Cow7wU-q.css +0 -1
  130. package/dist/client/assets/boards-view-Cow7wU-q.css.br +0 -0
  131. package/dist/client/assets/boards-view-MjirXJTB.js +0 -1
  132. package/dist/client/assets/boards-view-MjirXJTB.js.br +0 -0
  133. package/dist/client/assets/button-vYyhxkGP.js +0 -1
  134. package/dist/client/assets/button-vYyhxkGP.js.br +0 -0
  135. package/dist/client/assets/card-registry-BbWUj8eF.js.br +0 -0
  136. package/dist/client/assets/community-panel-D9KDQN8W.js +0 -1
  137. package/dist/client/assets/community-panel-D9KDQN8W.js.br +0 -0
  138. package/dist/client/assets/control-ws-Bz4VldcE.js.br +0 -0
  139. package/dist/client/assets/dialogs-CNXRUEVH.js.br +0 -0
  140. package/dist/client/assets/doc-editor-ui-CqNqh0ir.js +0 -4
  141. package/dist/client/assets/doc-editor-ui-CqNqh0ir.js.br +0 -0
  142. package/dist/client/assets/feature-hint-CrYKKsYJ.js.br +0 -0
  143. package/dist/client/assets/first-run-checklist-CXHVi07U.js.br +0 -0
  144. package/dist/client/assets/hooks-panel-BBRrv3BH.js.br +0 -0
  145. package/dist/client/assets/index-DuCio7TX.js +0 -75
  146. package/dist/client/assets/index-DuCio7TX.js.br +0 -0
  147. package/dist/client/assets/issues-panel-DrUbPOHu.js +0 -1
  148. package/dist/client/assets/issues-panel-DrUbPOHu.js.br +0 -0
  149. package/dist/client/assets/lane-read-token-step-D8-yF1HL.js.br +0 -0
  150. package/dist/client/assets/layout-worker-CtFkxf46.js +0 -113
  151. package/dist/client/assets/layout-worker-CtFkxf46.js.br +0 -0
  152. package/dist/client/assets/menu-XYP16XJ3.js.br +0 -0
  153. package/dist/client/assets/modal-DWUonmkq.js.br +0 -0
  154. package/dist/client/assets/my-prs-panel-BU3eG0B9.js +0 -1
  155. package/dist/client/assets/my-prs-panel-BU3eG0B9.js.br +0 -0
  156. package/dist/client/assets/nyan-cat-D6avoFIB.js.br +0 -0
  157. package/dist/client/assets/phone-shell-BKn3gg4n.js +0 -1
  158. package/dist/client/assets/phone-shell-BKn3gg4n.js.br +0 -0
  159. package/dist/client/assets/plan-face-BWQDW5yg.js.br +0 -0
  160. package/dist/client/assets/plan-render-Bi-S0TBf.js.br +0 -0
  161. package/dist/client/assets/pr-queue-columns-C00BNwlj.js.br +0 -3
  162. package/dist/client/assets/pr-status-icon-B24mi7ku.js.br +0 -0
  163. package/dist/client/assets/radar-panel-nK-caoXd.js.br +0 -0
  164. package/dist/client/assets/repo-roots-adder-WHgRDCGZ.js.br +0 -0
  165. package/dist/client/assets/resume-dialog-t0YcfWJU.js.br +0 -0
  166. package/dist/client/assets/review-queue-panel-CsIIqoWR.js.br +0 -0
  167. package/dist/client/assets/session-actions-VGj22OAx.js.br +0 -0
  168. package/dist/client/assets/session-row-B1uShpcX.js.br +0 -0
  169. package/dist/client/assets/session-tick-BwkhB4Mf.js.br +0 -0
  170. package/dist/client/assets/settings-panel-j9Iuyd1b.js.br +0 -0
  171. package/dist/client/assets/setup-step-4aJmqI4U.js.br +0 -3
  172. package/dist/client/assets/trace-panel-DwXYQ3bb.js.br +0 -0
  173. package/dist/client/assets/usage-panel-cVBMbNyb.js.br +0 -0
  174. package/dist/client/assets/your-day-tip-gf3QBghQ.js.br +0 -0
@@ -1,42 +1,42 @@
1
- import { $ as codexSessionIdFromPath, $t as removalsJournalPath, A as pickNewestPublished, At as vendorUsageEntry, B as planUploadRetention, Bt as agentHookGroupOf, C as decideUpdateStatus, Ct as identityFromRelPath, D as parseRegistryDeprecation, Dt as parseUsageLine, E as normalizeUpdateChannel, Et as parseJsonLine, F as decideUploadType, Ft as generateToken, G as containmentRefusalReason, Gt as readStoredHooks, H as TRACE_TAIL_SCAN_BYTES, Ht as hooksForProject, I as exceedsUploadCap, It as sweepOrphans, J as resumeOffsetFrom, Jt as makeHostScratchDirectory, K as isOversizedPartialLine, Kt as removeHook, L as framePathPaste, Lt as writeSessionSettings, M as openContainedFile, Mt as HOOK_EVENTS, N as MAX_UPLOAD_BYTES, Nt as PLAN_HOLD_RELEASE_MS, O as parseRegistryLatest, Ot as shouldReplace, P as buildUploadFilename, Pt as buildHookSettings, Q as codexRootCandidates, Qt as recordSweptPath, R as imageMimeForUploadFilename, Rt as HOOK_EVENT_CATALOG, S as decideInstallFlavor, St as foldReplacementIntoGenerationRollup, T as normalizeSha, Tt as mergeGenerationRollups, U as committedOffsetFromTraceTailOrNull, Ut as normalizeHook, V as MAX_TRANSCRIPT_READ_BYTES, Vt as appendUserHooks, W as completeLineBytes, Wt as rawStoredHooks, X as codexFallbackRoots, Xt as appendRemovalRecord, Y as withCommittedOffset, Yt as sweepOrphanedHostScratch, Z as codexHomes, Zt as appendRemovalRecordSync, _ as folderTrustRoot, _t as addEntryToTotals, a as customAgentFingerprint, at as isUsageFile, b as requestCodexAppServer, bt as expandAdvisorIterations, c as hookProfileOf, ct as projectDirCandidates, d as isKnownAgentId, dt as sessionsRootCandidates, en as listClaudeGlobalConfigPathCandidates, et as continuationDelayMs, f as listAgentIds, ft as shouldEvaluateDespiteIoFailures, g as setCustomAgents, gt as parseKimiUsageLine, h as resolveAdapter, ht as kimiDedupIdentity, i as commandFor, it as grokHomes, j as shortSha, jt as claudeCode, k as parseResolvedSha, kt as totalTokensOf$1, l as isBuiltInAgentId, lt as resolveProjectsDirs, m as resetCommandCache, mt as splitLines, n as DEFAULT_AGENT_ID$1, nt as dedupeCodexFiles, o as describeAgentResolvability, ot as kimiHomes, p as projectHookConfigRelPaths, pt as shouldPersistWarehouse, q as planContiguousRead, qt as upsertHook, r as cachedAgentResolvability, rt as expandTilde, s as getAdapter, st as passOutcome, tt as decideFileRead, u as isFirstClassAgent, ut as scopedClaudeRoots, v as codex, vt as dedupKeys, w as isCheckFresh, wt as isWithinGenerationRecencyWindow, x as NODE_PTY_INSTALL_SCRIPT_FLAG, xt as foldEntryIntoGenerationRollup, y as readHostCodexVersion, yt as emptyTotals, z as isSafePathSegment, zt as ID_RE } from "./adapters-25aeu1R1.js";
2
- import { $ as buildExceptionProperties, B as isExperimentalSetting, D as SETTINGS_INDEX, E as validateSettingsBlock, G as parseDataAttach, J as TELEMETRY_BATCH_URL, K as parseDataClientMessage, L as valueAtPath, Q as buildBrowserExceptionProperties, T as settingsBlockSpecFor, U as LOGGED_FAST_CLOSE_COUNTS, V as DEEP_HISTORY_SCROLLBACK_LINES, W as describeDataAttach, X as adapterBucket, Y as TELEMETRY_FLAGS_URL, Z as buildAiGenerationEvents, _ as sessionIdFromBranch, _t as stableConfigKey, a as generateProjectId, at as decideRemoteTelemetryState, ct as nodeMajorVersion, d as DEFAULT_CONFIG, dt as DashboardTelemetryReport, et as buildPersonProperties, f as DEFAULT_BRANCH_GC_PREFIXES, ft as PendingCrashReport, g as planWorktreeGc, h as planBranchGc, i as ensureProjectIds, it as decideIsDevInstall, lt as parsePosthogReleaseId, m as matchedPrefix, mt as TelemetryState, n as createConfigStore, nt as claudeAccountUuidOf, o as glimmervoidHomeDir, ot as decideTelemetryConsent, p as isGcCandidateWorktree, pt as TELEMETRY_EVENT_SCHEMAS, q as FIRST_RUN_NOTICE, r as ABORT_CONFIG_SAVE, rt as codexUserIdOf, st as exceptionFingerprint, tt as classifySessionExit, ut as resolveProjectToken, v as usablePrefixes, w as mergeSettingsBlock, y as worktreeIntegrationTips } from "./config-store-D2MGO82q.js";
1
+ import { $ as codexSessionIdFromPath, $t as removalsJournalPath, A as pickNewestPublished, At as vendorUsageEntry, B as planUploadRetention, Bt as agentHookGroupOf, C as decideUpdateStatus, Ct as identityFromRelPath, D as parseRegistryDeprecation, Dt as parseUsageLine, E as normalizeUpdateChannel, Et as parseJsonLine, F as decideUploadType, Ft as generateToken, G as containmentRefusalReason, Gt as readStoredHooks, H as TRACE_TAIL_SCAN_BYTES, Ht as hooksForProject, I as exceedsUploadCap, It as sweepOrphans, J as resumeOffsetFrom, Jt as makeHostScratchDirectory, K as isOversizedPartialLine, Kt as removeHook, L as framePathPaste, Lt as writeSessionSettings, M as openContainedFile, Mt as HOOK_EVENTS, N as MAX_UPLOAD_BYTES, Nt as PLAN_HOLD_RELEASE_MS, O as parseRegistryLatest, Ot as shouldReplace, P as buildUploadFilename, Pt as buildHookSettings, Q as codexRootCandidates, Qt as recordSweptPath, R as imageMimeForUploadFilename, Rt as HOOK_EVENT_CATALOG, S as decideInstallFlavor, St as foldReplacementIntoGenerationRollup, T as normalizeSha, Tt as mergeGenerationRollups, U as committedOffsetFromTraceTailOrNull, Ut as normalizeHook, V as MAX_TRANSCRIPT_READ_BYTES, Vt as appendUserHooks, W as completeLineBytes, Wt as rawStoredHooks, X as codexFallbackRoots, Xt as appendRemovalRecord, Y as withCommittedOffset, Yt as sweepOrphanedHostScratch, Z as codexHomes, Zt as appendRemovalRecordSync, _ as folderTrustRoot, _t as addEntryToTotals, a as customAgentFingerprint, at as isUsageFile, b as requestCodexAppServer, bt as expandAdvisorIterations, c as hookProfileOf, ct as projectDirCandidates, d as isKnownAgentId, dt as sessionsRootCandidates, en as listClaudeGlobalConfigPathCandidates, et as continuationDelayMs, f as listAgentIds, ft as shouldEvaluateDespiteIoFailures, g as setCustomAgents, gt as parseKimiUsageLine, h as resolveAdapter, ht as kimiDedupIdentity, i as commandFor, it as grokHomes, j as shortSha, jt as claudeCode, k as parseResolvedSha, kt as totalTokensOf$1, l as isBuiltInAgentId, lt as resolveProjectsDirs, m as resetCommandCache, mt as splitLines, n as DEFAULT_AGENT_ID$1, nt as dedupeCodexFiles, o as describeAgentResolvability, ot as kimiHomes, p as projectHookConfigRelPaths, pt as shouldPersistWarehouse, q as planContiguousRead, qt as upsertHook, r as cachedAgentResolvability, rt as expandTilde, s as getAdapter, st as passOutcome, tt as decideFileRead, u as isFirstClassAgent, ut as scopedClaudeRoots, v as codex, vt as dedupKeys, w as isCheckFresh, wt as isWithinGenerationRecencyWindow, x as NODE_PTY_INSTALL_SCRIPT_FLAG, xt as foldEntryIntoGenerationRollup, y as readHostCodexVersion, yt as emptyTotals, z as isSafePathSegment, zt as ID_RE } from "./adapters-Bg-l7NBf.js";
2
+ import { $ as buildExceptionProperties, B as isExperimentalSetting, D as SETTINGS_INDEX, E as validateSettingsBlock, G as parseDataAttach, J as TELEMETRY_BATCH_URL, K as parseDataClientMessage, L as valueAtPath, Q as buildBrowserExceptionProperties, T as settingsBlockSpecFor, U as LOGGED_FAST_CLOSE_COUNTS, V as DEEP_HISTORY_SCROLLBACK_LINES, W as describeDataAttach, X as adapterBucket, Y as TELEMETRY_FLAGS_URL, Z as buildAiGenerationEvents, _ as sessionIdFromBranch, _t as stableConfigKey, a as generateProjectId, at as decideRemoteTelemetryState, ct as nodeMajorVersion, d as DEFAULT_CONFIG, dt as DashboardTelemetryReport, et as buildPersonProperties, f as DEFAULT_BRANCH_GC_PREFIXES, ft as PendingCrashReport, g as planWorktreeGc, h as planBranchGc, i as ensureProjectIds, it as decideIsDevInstall, lt as parsePosthogReleaseId, m as matchedPrefix, mt as TelemetryState, n as createConfigStore, nt as claudeAccountUuidOf, o as glimmervoidHomeDir, ot as decideTelemetryConsent, p as isGcCandidateWorktree, pt as TELEMETRY_EVENT_SCHEMAS, q as FIRST_RUN_NOTICE, r as ABORT_CONFIG_SAVE, rt as codexUserIdOf, st as exceptionFingerprint, tt as classifySessionExit, ut as resolveProjectToken, v as usablePrefixes, w as mergeSettingsBlock, y as worktreeIntegrationTips } from "./config-store-RJTZlSL9.js";
3
3
  import { C as parseCgroupBytes, S as memoryReserveBytes, T as parseMemAvailableBytes, _ as createSpawnGate, a as jsonStateLoadError, b as cgroupLimitBytes, c as loadedJsonValue, d as writeJsonAtomicSync, f as writeTextAtomic, g as createSerialQueue, h as createMemoryAdmission, i as createJsonStateWriter, m as createKeyedSerialQueue, n as appendJsonLines, o as loadJsonStateFile, p as writeTextAtomicSync, r as createJsonStateStore, s as loadJsonStateFileSync, t as appendJsonLine, u as writeJsonAtomic, v as isQueueAdmissionTimeout, w as parseCgroupV2Path, x as headroomFromReadings, y as cgroupAncestorPaths } from "./json-file-BkbEyRoH.js";
4
4
  import { a as sanitizeWorktreeName, i as safePathSegment, n as equalsIgnoringCaseOnWindows, r as isPathInside, t as caseFoldedPathKey } from "./paths-C2u2R_6l.js";
5
5
  import { o as isMissingFileError, r as errorMessage, t as errorCode } from "./text-BDF4aFhQ.js";
6
6
  import { a as unrefTimer, i as DEFAULT_TIMER_FNS, n as comparableDirectoryPath, r as isSameDirectoryPath, t as canonicalizePath } from "./canonical-paths-tdQPG3Kv.js";
7
- import { i as resolveArgvCommandMatches, t as kimi } from "./kimi-DFDGODAS.js";
7
+ import { i as resolveArgvCommandMatches, t as kimi } from "./kimi-Ck2t9UVT.js";
8
8
  import { c as runCommandSafely$1, i as execFileSync, l as spawn, n as execFile, r as execFileAsync, s as refuseLaunchesOf, t as assertLaunchable } from "./child-process-safe-NR7PjPcL.js";
9
- import { Bt as HookEnvelope, C as BenchmarkId, D as BenchmarkSuite, E as BenchmarkStatus, Et as USAGE_INTEGER_RANGES, F as CommunityState, Gt as CoherenceJournalOutput, Ht as MAX_RAW_LINE_CHARS, I as CommunityVerdict, It as IssuesState, Jt as CHANGES_POLL_INTERVAL_MS, Kt as ChangeMap, L as DISCORD_CHANNEL_NAME_RE, Lt as IssuesStatus, M as CommunityActionRequest, N as CommunityDraft, Nt as IssueKey, P as CommunityItem, R as SKILL_NAME_RE, S as BenchmarkCase, T as BenchmarkRun, U as GithubPrsFrame, Ut as TraceCheckpoint, Vt as SessionSetup, W as comparablePrKey, Wt as TraceRecord, Xt as CLIENT_LOG_TEXT_MAX_CHARS, Y as WorkflowsState, Zt as CONTROL_FRAME_MAX_BYTES, _n as planTitle, an as pullRequestKeyFromReference, c as HINT_FEATURES, cn as UpdateJournal, dn as PLAN_HOOK_OUTPUT_MAX_CHARS, f as JudgeResult, fn as PLAN_RESULT_HOOK_EVENT, g as RaceSpec, gn as parseExitPlanModeHookPayload, h as RaceRecord, hn as PlanRevision, j as PrCheckoutCaseInput, l as HINT_VIEW_BY_FEATURE, ln as PLAN_BODY_CAP_BYTES, mn as PlanDecision, n as PackApproveRequest, o as HubPhoneAlertFrame, pn as PLAN_TOOL_NAME, q as WorkflowsSettings, qt as changeMapFactId, r as HUB_PHONE_ALERT_TEXT_MAX, s as FeatureHintState, t as ClientMessage, un as PLAN_HOOK_EVENT, v as CATALOG_AGENT_IDS, w as BenchmarkJudgement, x as BenchmarkActionRequest, y as DEFAULT_MODELS } from "./control-messages-BvSNTMsJ.js";
10
- import { $t as TeamReviewActionRequest, An as PrFlowSaveRuleRequest, B as SshSignRequest, Bn as prActionReportPath, C as CONVERSATION_TOOL_RESULT_HOOK_EVENT, Ct as MyPrMergeWhenReadyRequest, E as REQUEST_USER_INPUT_TOOL_NAME, F as SSH_SIGN_BODY_CAP_BYTES, Ft as CommitSha$1, Gn as shortSha$1, H as TaskTitle, Jt as ReviewDraft, K as Board, Kn as GH_SEGMENT, M as SESSION_NAME_RULE_TEXT, N as SHOWN_FILE_CAP_BYTES, Nn as PrFlowsSettings, P as SIGN_URL_ENV, Pn as PrFlowsState, S as CONVERSATION_PERMISSION_HOOK_EVENT, Sn as PrFlowDisposeRequest, T as ConversationQuestion, Tn as PrFlowItemRequest, W as BOARD_MEDIA_MAX_EDGE_PX, Wn as HEX_SHA_RE, X as Box, Yn as repoParts, _ as AgentSettingsRequest, at as WHITEBOARD_LIMITS, b as COHERENCE_HOOKS_INACTIVE, bn as PrFlowApproveRequest, bt as MyPrMergeRequest, c as AgentCloseRequest, ct as Wire, d as AgentPacksRequest, dn as hasStandingViewerApproval, dt as LinkedPr, er as BADGE_LABELS, et as Frame, f as AgentPullRequestRequest, fn as PR_ACTION_REPORT_BODY_CAP_BYTES, gt as MyPrKeepMergeableRequest, hn as PR_ACTION_TOKEN_ENV, i as ASK_USER_QUESTION_TOOL_NAME, in as TeamReviewStatus, ir as STATES, it as WHITEBOARD_ASSET_ROUTE, j as SESSION_NAME_PATTERN, k as SESSION_DOC_BODY_CAP_BYTES, kn as PrFlowRule, kt as MyPrsSnapshot, l as AgentEditRequest, lt as sparseBoardRecord, mn as PR_ACTION_REPORT_URL_ENV, nr as MERGEABLE_LIVE_STATES, nt as Op, o as AgentAttentionRequest, pn as PR_ACTION_REPORT_ROUTE, q as BoardRecord, r as AGENT_URL_ENV, rn as TeamReviewStateEntry, rr as RESTARTABLE_STATES, tr as KILLABLE_STATES, tt as Note, ut as sparseBoardReply, v as AgentSpawnRequest, vn as PrActionReportBody, x as CONVERSATION_APPROVAL_SUMMARY_MAX_CHARS, y as AgentWhyRequest, yn as PrActionRunRequest } from "./session-CHI_Z8jB.js";
9
+ import { Bt as HookEnvelope, C as BenchmarkId, D as BenchmarkSuite, E as BenchmarkStatus, Et as USAGE_INTEGER_RANGES, F as CommunityState, Gt as CoherenceJournalOutput, Ht as MAX_RAW_LINE_CHARS, I as CommunityVerdict, It as IssuesState, Jt as CHANGES_POLL_INTERVAL_MS, Kt as ChangeMap, L as DISCORD_CHANNEL_NAME_RE, Lt as IssuesStatus, M as CommunityActionRequest, N as CommunityDraft, Nt as IssueKey, P as CommunityItem, R as SKILL_NAME_RE, S as BenchmarkCase, T as BenchmarkRun, U as GithubPrsFrame, Ut as TraceCheckpoint, Vt as SessionSetup, W as comparablePrKey, Wt as TraceRecord, Xt as CLIENT_LOG_TEXT_MAX_CHARS, Y as WorkflowsState, Zt as CONTROL_FRAME_MAX_BYTES, _n as planTitle, an as pullRequestKeyFromReference, c as HINT_FEATURES, cn as UpdateJournal, dn as PLAN_HOOK_OUTPUT_MAX_CHARS, f as JudgeResult, fn as PLAN_RESULT_HOOK_EVENT, g as RaceSpec, gn as parseExitPlanModeHookPayload, h as RaceRecord, hn as PlanRevision, j as PrCheckoutCaseInput, l as HINT_VIEW_BY_FEATURE, ln as PLAN_BODY_CAP_BYTES, mn as PlanDecision, n as PackApproveRequest, o as HubPhoneAlertFrame, pn as PLAN_TOOL_NAME, q as WorkflowsSettings, qt as changeMapFactId, r as HUB_PHONE_ALERT_TEXT_MAX, s as FeatureHintState, t as ClientMessage, un as PLAN_HOOK_EVENT, v as CATALOG_AGENT_IDS, w as BenchmarkJudgement, x as BenchmarkActionRequest, y as DEFAULT_MODELS } from "./control-messages-Cx_1p9iz.js";
10
+ import { $ as Box, B as SshSignRequest, C as CONVERSATION_TOOL_RESULT_HOOK_EVENT, Cn as PrFlowApproveRequest, Ct as MyPrMergeRequest, E as REQUEST_USER_INPUT_TOOL_NAME, Et as MyPrMergeWhenReadyRequest, F as SSH_SIGN_BODY_CAP_BYTES, G as BOARD_MEDIA_MAX_EDGE_PX, H as TaskTitle, In as PrFlowsSettings, Jn as shortSha$1, K as BOARD_PAGE_ESCAPE_MESSAGE, Ln as PrFlowsState, M as SESSION_NAME_RULE_TEXT, Mn as PrFlowRule, Mt as MyPrsSnapshot, N as SHOWN_FILE_CAP_BYTES, Nn as PrFlowSaveRuleRequest, On as PrFlowItemRequest, P as SIGN_URL_ENV, Qn as repoParts, Rt as CommitSha$1, S as CONVERSATION_PERMISSION_HOOK_EVENT, Sn as PrActionRunRequest, T as ConversationQuestion, Tn as PrFlowDisposeRequest, Un as prActionReportPath, W as BOARD_DOC_CAP_BYTES, X as BoardRecord, Y as Board, Yn as GH_SEGMENT, Zt as ReviewDraft, _ as AgentSettingsRequest, _n as PR_ACTION_REPORT_URL_ENV, ar as MERGEABLE_LIVE_STATES, at as Op, b as COHERENCE_HOOKS_INACTIVE, c as AgentCloseRequest, ct as WHITEBOARD_LIMITS, d as AgentPacksRequest, dt as Wire, f as AgentPullRequestRequest, ft as sparseBoardRecord, gn as PR_ACTION_REPORT_ROUTE, hn as PR_ACTION_REPORT_BODY_CAP_BYTES, i as ASK_USER_QUESTION_TOOL_NAME, ir as KILLABLE_STATES, it as Note, j as SESSION_NAME_PATTERN, k as SESSION_DOC_BODY_CAP_BYTES, l as AgentEditRequest, mn as hasStandingViewerApproval, mt as LinkedPr, nn as TeamReviewActionRequest, o as AgentAttentionRequest, on as TeamReviewStateEntry, or as RESTARTABLE_STATES, pt as sparseBoardReply, qn as HEX_SHA_RE, r as AGENT_URL_ENV, rr as BADGE_LABELS, rt as Frame, sn as TeamReviewStatus, sr as STATES, st as WHITEBOARD_ASSET_ROUTE, v as AgentSpawnRequest, vn as PR_ACTION_TOKEN_ENV, x as CONVERSATION_APPROVAL_SUMMARY_MAX_CHARS, xn as PrActionReportBody, y as AgentWhyRequest, yt as MyPrKeepMergeableRequest } from "./session-C0cPFaQs.js";
11
11
  import { a as QUESTION_ANSWERED_NOTIFY_CATEGORY, c as QuestionManagerSettings, i as ManagerLaneResult, n as MANAGER_DECISION_EVENT, r as ManagerDecision, t as MANAGER_DECISION_AUDIT_KIND } from "./question-manager-C_RzS1Ot.js";
12
12
  import { n as promptContextReplyOf, o as toolHookContextReplyOf, r as refocusReplyFor, t as REFOCUS_NOTE } from "./refocus-core-DlEDNY3E.js";
13
- import { $ as promptHintFor, A as isSelfWakePrompt, B as pickAutoResume, C as cleanTaskPrompt, D as extractNotifiedTaskIds, E as extractHookTaskTitle, F as resolveTaskTitle, G as listRepoConversations, H as resumePromptFor, I as seedTaskTitleSources, J as nextSuggestedName, K as listRepoWorktreePaths, L as AUTO_CONTINUE_PROMPT, M as parseRefinedSessionName, N as parseRefinedTaskTitle, O as extractOscTaskTitle, P as resolveRefocusTaskTitle, Q as permitsHelpCommand, R as RESUME_ID_RE, S as chooseRefinedSessionName, T as extractAiTitle, U as shouldAdoptReportedResumeId, V as resolveResumeTarget, W as claudeProjectsDir, Y as describeSessionLimits, Z as hintFor, _ as projectReviewDetail, a as checkAgentReply, b as buildPersistedTaskTitle, c as deriveChildSessionName, d as describePushLanding, et as routeAgentNotes, f as describeRoleRefusal, g as projectMyPrs, h as parseAgentVerb, j as isSubstantivePrompt, k as extractPromptTaskTitle, l as describeChildEndNote, n as REFUSAL_REASON, nt as toolHookFactsOf, o as decideAgentRequest, p as describeUnpushedCloseRefusal, q as isAutoNameOf, s as decideSpawnAllowance, tt as supervisionLine, u as describeKeptChildAttention, v as projectReviews, w as decideTaskTitleRefinement, x as buildTaskTitleRefinementPrompt, y as tokensMatch, z as isConversationReplacedAtStartup } from "./agent-api-core-D1r58EPG.js";
13
+ import { $ as promptHintFor, A as isSelfWakePrompt, B as pickAutoResume, C as cleanTaskPrompt, D as extractNotifiedTaskIds, E as extractHookTaskTitle, F as resolveTaskTitle, G as listRepoConversations, H as resumePromptFor, I as seedTaskTitleSources, J as nextSuggestedName, K as listRepoWorktreePaths, L as AUTO_CONTINUE_PROMPT, M as parseRefinedSessionName, N as parseRefinedTaskTitle, O as extractOscTaskTitle, P as resolveRefocusTaskTitle, Q as permitsHelpCommand, R as RESUME_ID_RE, S as chooseRefinedSessionName, T as extractAiTitle, U as shouldAdoptReportedResumeId, V as resolveResumeTarget, W as claudeProjectsDir, Y as describeSessionLimits, Z as hintFor, _ as projectReviewDetail, a as checkAgentReply, b as buildPersistedTaskTitle, c as deriveChildSessionName, d as describePushLanding, et as routeAgentNotes, f as describeRoleRefusal, g as projectMyPrs, h as parseAgentVerb, j as isSubstantivePrompt, k as extractPromptTaskTitle, l as describeChildEndNote, n as REFUSAL_REASON, nt as toolHookFactsOf, o as decideAgentRequest, p as describeUnpushedCloseRefusal, q as isAutoNameOf, s as decideSpawnAllowance, tt as supervisionLine, u as describeKeptChildAttention, v as projectReviews, w as decideTaskTitleRefinement, x as buildTaskTitleRefinementPrompt, y as tokensMatch, z as isConversationReplacedAtStartup } from "./agent-api-core-CADmSdvT.js";
14
14
  import { a as mcpLaunchFor, o as parsePresentedCredential } from "./agent-config-BJVJpVzX.js";
15
- import { a as layoutBoardWithMemory, i as layoutBoard, l as planSteps$1, n as escapeMarkup, o as cappedWarnings, r as isStackedPanel, s as dependencyWireId, t as boardSvgDocument, u as stepBoxesOf } from "./whiteboard-svg-core-pcQJ3as0.js";
16
- import { a as ConfigUpdate, c as SHELL_AGENT_ID, f as USAGE_COST_MODES, n as BUILTIN_AGENT_IDS, p as USAGE_VENDOR_KEYS, r as BrowserConfig, s as RUNTIME_CONFIG_SCALAR_KEYS, u as configIssueMessage } from "./config-BpqtJgTB.js";
17
- import { _ as decideHostAllowed, c as approvedPackPanels, d as packRow, f as pendingPackNote, g as readCappedBody, h as parseJsonBody$1, l as approvedPackThemes, m as decodeHeaderText, n as readPacksForAgent, p as declaredContentLength, u as packFileHeaders } from "./pack-agent-Cysyv1Fs.js";
15
+ import { a as layoutBoardWithMemory, i as layoutBoard, l as planSteps$1, n as escapeMarkup, o as cappedWarnings, r as isStackedPanel, s as dependencyWireId, t as boardSvgDocument, u as stepBoxesOf } from "./whiteboard-svg-core-CFm2oj-T.js";
16
+ import { a as ConfigUpdate, c as SHELL_AGENT_ID, f as USAGE_COST_MODES, n as BUILTIN_AGENT_IDS, p as USAGE_VENDOR_KEYS, r as BrowserConfig, s as RUNTIME_CONFIG_SCALAR_KEYS, u as configIssueMessage } from "./config-CdUCPp52.js";
17
+ import { _ as decideHostAllowed, c as approvedPackPanels, d as packRow, f as pendingPackNote, g as readCappedBody, h as parseJsonBody$1, l as approvedPackThemes, m as decodeHeaderText, n as readPacksForAgent, p as declaredContentLength, u as packFileHeaders } from "./pack-agent-D9TcEpR3.js";
18
18
  import { a as formatSshPublicKey, c as orderAgentSockets, i as commitSigningShimText, l as parseSshPublicKey, n as NO_AGENT_HOLDS_KEY, o as isForwardedAgentDirName, r as agentListsKey, s as isSignableGitObject, t as COMMIT_SIGNING_SHIM_NAME, u as wellKnownAgentSocketPaths } from "./ssh-signing-core-C7Dohjcn.js";
19
- import { a as createPairingsStore, c as defaultSeenPath, d as deviceNameFromUserAgent, f as hashSecret, i as configSiblingPath, l as DEFAULT_DEVICE_MAX_AGE_MS, n as normalizeRemoteConfig, o as createSeenStore, r as validateRemoteConfig, s as defaultPairingsPath, t as decideBindHost, u as decideDeviceAuth } from "./remote-config-BGSn0ai8.js";
19
+ import { a as createPairingsStore, c as defaultSeenPath, d as deviceNameFromUserAgent, f as hashSecret, i as configSiblingPath, l as DEFAULT_DEVICE_MAX_AGE_MS, n as normalizeRemoteConfig, o as createSeenStore, r as validateRemoteConfig, s as defaultPairingsPath, t as decideBindHost, u as decideDeviceAuth } from "./remote-config-BxXgPLrF.js";
20
20
  import { a as examplePacksDir, c as resolveFfmpegPath, i as clientDir, l as resolvePackageBin, n as bundled, o as packageRoot, r as cliPath, s as relayPath, t as assetRoot } from "./runtime-paths-YS6tWGDa.js";
21
21
  import { n as shellQuote } from "./hook-command-core-Bu5xBKp3.js";
22
22
  import { c as realAgentHome, d as createHeldSessionTempFolder, f as releaseSessionLock, m as trashSessionTempFolderOnceUnheld, n as generatedAgentHomePath, p as sessionIdOfLockFile, u as releaseUnheldAgentHomeSecrets } from "./agent-home-SIFHgJP-.js";
23
- import { $ as stampStageSince, $n as issueKey, $r as codexMcpServers, $t as reReviewResult, A as keepMergeableAttemptKey, Ai as isWatcherJobKind, An as PENDING_FIX_TTL_MS, Ar as parseKimiModels, At as earlierReviewToKeep, B as mergeQueuePositions, Bn as buildIssueSessionPrompt, Br as shouldAutoResolveThread, Bt as markDraftStale, C as autoRebaseRecord, Ci as restartDelayMs, Cn as fencedUntrusted, Cr as validateIssueRef, Ct as applyReviewProgress, D as isFailedAttemptRetryDue, Dn as FIX_VERDICTS, Dr as launchArgs, Dt as commentableLines, E as emptyMyPrsLaneState, Ei as WATCHER_JOB_KINDS, En as withoutControlCharacters, Er as choiceSelection, Et as canPost, F as keepMergeablePrompt, Fn as RADAR_UNTRUSTED_SOURCE, Fr as answeredViewerThreads, Ft as hasViewerReviewedAt, G as prunedFailedAutoRebaseAttempts, Gn as dailyVolumeSeries, Gr as UNTRUSTED_PREAMBLE, Gt as parseReviewReport, H as mergedSinceDate, Hn as claimPendingFix, Hr as threadJudgePatch, I as keepMergeablePushArgs, In as appendInvestigation, Ir as buildThreadJudgeRequest, It as invalidComments, J as pushFailureReason, Jn as decideJobMode, Jr as ACCEPT_EDITS_MODE, Jt as prHeadRef, K as prunedKeepMergeableState, Kn as decideFixHandoff, Kr as UNTRUSTED_REF_MAX_CHARS, Kt as postedReviewBody, L as keepMergeablePushTarget, Ln as approvedFixSessionPrompt, Lr as hasPresentableThreads, Lt as isPostableStatus, M as keepMergeableFixesToCancel, Mn as RADAR_REPORT_FILENAME, Mr as THREAD_JUDGE_BACKOFF_MS, Mt as eventForAction, N as keepMergeableHandoff, Nn as RADAR_RESULT_FILENAME, Nr as THREAD_JUDGE_ITEM_MAX_CHARS, Nt as githubRepoSlugFromRemote, O as isHeadPushedByKeepMergeable, On as INVESTIGATIONS_KEY, Or as parseClaudeInitialize, Ot as diffHeaderPath, P as keepMergeablePermissions, Pn as RADAR_UNTRUSTED_ITEM_MAX_CHARS, Pr as THREAD_PLACEHOLDER_ERROR, Pt as githubReviewsFrom, Q as sortedMyPrs, Qn as isAbsolutePathish, Qr as codexLaneMcpPosture, Qt as priorReviewFor, R as keepMergeableTimeoutSeconds, Rn as belowMinimumInvestigationChange, Rr as isThreadPlaceholderDraft, Rt as isSameGithubReviews, S as autoRebaseAttemptKey, Sn as bulletsIn, Sr as validateInvestigationId, St as advanceAwakeElapsed, T as currentKeepMergeableAttempt, Tn as sectionAfter$1, Tr as readGithubTeams, Tt as buildReviewPrompt, U as myPrsShouldStart, Un as classifyIssueChange, Ur as viewerThreadTally, Ut as parseFindingLine, V as mergeQueuePrsToMerge, Vn as claimExpiredPendingFixes, Vr as shouldJudgeThread, Vt as notMineDraft, W as myPrsStatus, Wn as dailyVolumeQuery, Wr as UNTRUSTED_PAYLOAD_FILENAME, Wt as parsePostingPlan, X as shouldFixMergeability, Xn as fixDetailLine, Xr as LANE_CONFIG_EDIT_DENY_RULES, Xt as prSessionName, Y as readMyPrsFeatureSettings, Yn as decideVanishedEntry, Yr as CLOSED_LANE_ACCESS_CONFIG, Yt as prKey, Z as shouldRebaseMyPr, Zn as investigationTrigger, Zr as buildLanePermissions, Zt as prSessionPrompt, _ as MY_PRS_FIX_PROMPT_FILENAME, _n as startReviewProgress, _r as slotDeferredInvestigationChange, _t as REVIEW_TIMEOUT_SECONDS, a as createPrGh, ai as laneMcpConfig, an as resumeDecision, ar as normalizePrTitle, at as myPrMergeRefusal, b as MY_PRS_STATE_FILENAME, bn as uiFilesOf, br as unarchivedInvestigations, bt as TEAM_REVIEW_STATE_FILENAME, c as runGh, ci as withAllowRules, cn as reviewSnapshotFromGithubPr, cr as pingFor, ct as HUNK_HEADER, d as githubStoreRateLimitedError, dn as reviewerFor, dr as pruneInvestigations, dt as REVIEW_AGENT_ADAPTER_ID, ei as findPosthogServer, en as readTeamReviewSettings, er as issueUrl, et as toMyPrsWireStatus, f as isBotAuthor, fn as sectionAfter, fr as radarUntrustedItems, ft as REVIEW_BOOTSTRAP_PROMPT, g as MY_PRS_FIX_CHECKOUT_DIRNAME, gi as secondaryRateLimitWaitMs, gn as shouldPruneEntry$1, gr as scrubForPaste, gt as REVIEW_RESUME_PROMPT, h as MY_PRS_FIX_BOOTSTRAP_PROMPT, hi as createTickLoop, hn as shouldAutoReview, hr as sanitizeSessionName, ht as REVIEW_REPORT_FILENAME, i as writeWatcheeSettings, ii as laneAccessEnvBlocker, in as restoreDraftAtReviewedHead, ir as normalizePrBody, it as myPrFromGithubPr, j as keepMergeableClaudeArgs, jn as RADAR_EXCEPTION_EVENTS_QUERY, jr as selectionArgs, jt as errorDraft, k as isMovedBranchPushRejection, ki as WatcherJobEnvelope, kn as JOB_MODES, kr as parseCodexModels, kt as draftsNewestFirst, l as runGit, li as withLaneAccessRules, ln as reviewUntrustedItems, lr as planInvestigations, lt as PROGRESS_EMIT_INTERVAL_MS, m as MY_PRS_FIX_BASE_BRANCH, mi as createLaneRunner, mn as sessionLinkedToPr, mr as resolvePosthogHost, mt as REVIEW_PROMPT_FILENAME, ni as laneAccess, nn as remergeGitEnvPrefix, nr as nextState, nt as withAutoRebase, o as gitCommandFailure, oi as laneMcpPosture, on as resumeTimeoutMs, or as pendingFixesDropped, pi as WATCHER_HOME_ENV, pn as selectCandidates, pr as resolveIssueProject, pt as REVIEW_POSTING_FILENAME, q as prunedMergeQueueKeys, qn as decideIssueAction, qr as UntrustedPayload, qt as prBaseRef, r as watcherHomeDir, ri as laneAccessConfigOf, rn as remoteMatchesGithubRepo, rr as normalizeJobMode, rt as withStageSince, s as runCommand, si as readOnlyGitAllowRules, sn as reviewAttemptsAfter, sr as pickDirectoryForProjectName, st as DEFAULT_REVIEWER, ti as kimiLaneMcpPosture, tn as readyDraft, tr as markInvestigationArchived, tt as truncatedSearchNote, u as createGithubStorePoller, ui as GITHUB_RATE_LIMIT_WINDOW_MS, un as reviewerAgentArgs, ur as projectParentDirs, ut as REMERGE_OBJECTS_DIRNAME, v as MY_PRS_FIX_WORK_BRANCH, vn as teamReviewStatus, vr as summaryLineFromReportText, vt as REVIEW_UNTRUSTED_ITEM_MAX_CHARS, w as consecutiveKeepMergeableAttempts, wi as watcherChildInboxUrl, wn as parsePostingFile, wr as nulSeparatedPaths, wt as askedForRefusal, x as MyPrsLaneState, xi as nextCrashCount, xn as watcherFeedError, xr as underlyingInvestigationChange, xt as absolutePathReadRule, y as MY_PRS_LANE_ID, yn as triagePr, yr as toCount, yt as TEAM_REVIEW_LANE_ID, z as mergeAttemptKey, zn as buildInvestigationRecord, zr as parseThreadJudgeResult, zt as isUnreviewedDraft } from "./watchee-settings-CilMSdQX.js";
23
+ import { $ as stampStageSince, $n as issueKey, $r as codexMcpServers, $t as reReviewResult, A as keepMergeableAttemptKey, Ai as isWatcherJobKind, An as PENDING_FIX_TTL_MS, Ar as parseKimiModels, At as earlierReviewToKeep, B as mergeQueuePositions, Bn as buildIssueSessionPrompt, Br as shouldAutoResolveThread, Bt as markDraftStale, C as autoRebaseRecord, Ci as restartDelayMs, Cn as fencedUntrusted, Cr as validateIssueRef, Ct as applyReviewProgress, D as isFailedAttemptRetryDue, Dn as FIX_VERDICTS, Dr as launchArgs, Dt as commentableLines, E as emptyMyPrsLaneState, Ei as WATCHER_JOB_KINDS, En as withoutControlCharacters, Er as choiceSelection, Et as canPost, F as keepMergeablePrompt, Fn as RADAR_UNTRUSTED_SOURCE, Fr as answeredViewerThreads, Ft as hasViewerReviewedAt, G as prunedFailedAutoRebaseAttempts, Gn as dailyVolumeSeries, Gr as UNTRUSTED_PREAMBLE, Gt as parseReviewReport, H as mergedSinceDate, Hn as claimPendingFix, Hr as threadJudgePatch, I as keepMergeablePushArgs, In as appendInvestigation, Ir as buildThreadJudgeRequest, It as invalidComments, J as pushFailureReason, Jn as decideJobMode, Jr as ACCEPT_EDITS_MODE, Jt as prHeadRef, K as prunedKeepMergeableState, Kn as decideFixHandoff, Kr as UNTRUSTED_REF_MAX_CHARS, Kt as postedReviewBody, L as keepMergeablePushTarget, Ln as approvedFixSessionPrompt, Lr as hasPresentableThreads, Lt as isPostableStatus, M as keepMergeableFixesToCancel, Mn as RADAR_REPORT_FILENAME, Mr as THREAD_JUDGE_BACKOFF_MS, Mt as eventForAction, N as keepMergeableHandoff, Nn as RADAR_RESULT_FILENAME, Nr as THREAD_JUDGE_ITEM_MAX_CHARS, Nt as githubRepoSlugFromRemote, O as isHeadPushedByKeepMergeable, On as INVESTIGATIONS_KEY, Or as parseClaudeInitialize, Ot as diffHeaderPath, P as keepMergeablePermissions, Pn as RADAR_UNTRUSTED_ITEM_MAX_CHARS, Pr as THREAD_PLACEHOLDER_ERROR, Pt as githubReviewsFrom, Q as sortedMyPrs, Qn as isAbsolutePathish, Qr as codexLaneMcpPosture, Qt as priorReviewFor, R as keepMergeableTimeoutSeconds, Rn as belowMinimumInvestigationChange, Rr as isThreadPlaceholderDraft, Rt as isSameGithubReviews, S as autoRebaseAttemptKey, Sn as bulletsIn, Sr as validateInvestigationId, St as advanceAwakeElapsed, T as currentKeepMergeableAttempt, Tn as sectionAfter$1, Tr as readGithubTeams, Tt as buildReviewPrompt, U as myPrsShouldStart, Un as classifyIssueChange, Ur as viewerThreadTally, Ut as parseFindingLine, V as mergeQueuePrsToMerge, Vn as claimExpiredPendingFixes, Vr as shouldJudgeThread, Vt as notMineDraft, W as myPrsStatus, Wn as dailyVolumeQuery, Wr as UNTRUSTED_PAYLOAD_FILENAME, Wt as parsePostingPlan, X as shouldFixMergeability, Xn as fixDetailLine, Xr as LANE_CONFIG_EDIT_DENY_RULES, Xt as prSessionName, Y as readMyPrsFeatureSettings, Yn as decideVanishedEntry, Yr as CLOSED_LANE_ACCESS_CONFIG, Yt as prKey, Z as shouldRebaseMyPr, Zn as investigationTrigger, Zr as buildLanePermissions, Zt as prSessionPrompt, _ as MY_PRS_FIX_PROMPT_FILENAME, _n as startReviewProgress, _r as slotDeferredInvestigationChange, _t as REVIEW_TIMEOUT_SECONDS, a as createPrGh, ai as laneMcpConfig, an as resumeDecision, ar as normalizePrTitle, at as myPrMergeRefusal, b as MY_PRS_STATE_FILENAME, bn as uiFilesOf, br as unarchivedInvestigations, bt as TEAM_REVIEW_STATE_FILENAME, c as runGh, ci as withAllowRules, cn as reviewSnapshotFromGithubPr, cr as pingFor, ct as HUNK_HEADER, d as githubStoreRateLimitedError, dn as reviewerFor, dr as pruneInvestigations, dt as REVIEW_AGENT_ADAPTER_ID, ei as findPosthogServer, en as readTeamReviewSettings, er as issueUrl, et as toMyPrsWireStatus, f as isBotAuthor, fn as sectionAfter, fr as radarUntrustedItems, ft as REVIEW_BOOTSTRAP_PROMPT, g as MY_PRS_FIX_CHECKOUT_DIRNAME, gi as secondaryRateLimitWaitMs, gn as shouldPruneEntry$1, gr as scrubForPaste, gt as REVIEW_RESUME_PROMPT, h as MY_PRS_FIX_BOOTSTRAP_PROMPT, hi as createTickLoop, hn as shouldAutoReview, hr as sanitizeSessionName, ht as REVIEW_REPORT_FILENAME, i as writeWatcheeSettings, ii as laneAccessEnvBlocker, in as restoreDraftAtReviewedHead, ir as normalizePrBody, it as myPrFromGithubPr, j as keepMergeableClaudeArgs, jn as RADAR_EXCEPTION_EVENTS_QUERY, jr as selectionArgs, jt as errorDraft, k as isMovedBranchPushRejection, ki as WatcherJobEnvelope, kn as JOB_MODES, kr as parseCodexModels, kt as draftsNewestFirst, l as runGit, li as withLaneAccessRules, ln as reviewUntrustedItems, lr as planInvestigations, lt as PROGRESS_EMIT_INTERVAL_MS, m as MY_PRS_FIX_BASE_BRANCH, mi as createLaneRunner, mn as sessionLinkedToPr, mr as resolvePosthogHost, mt as REVIEW_PROMPT_FILENAME, ni as laneAccess, nn as remergeGitEnvPrefix, nr as nextState, nt as withAutoRebase, o as gitCommandFailure, oi as laneMcpPosture, on as resumeTimeoutMs, or as pendingFixesDropped, pi as WATCHER_HOME_ENV, pn as selectCandidates, pr as resolveIssueProject, pt as REVIEW_POSTING_FILENAME, q as prunedMergeQueueKeys, qn as decideIssueAction, qr as UntrustedPayload, qt as prBaseRef, r as watcherHomeDir, ri as laneAccessConfigOf, rn as remoteMatchesGithubRepo, rr as normalizeJobMode, rt as withStageSince, s as runCommand, si as readOnlyGitAllowRules, sn as reviewAttemptsAfter, sr as pickDirectoryForProjectName, st as DEFAULT_REVIEWER, ti as kimiLaneMcpPosture, tn as readyDraft, tr as markInvestigationArchived, tt as truncatedSearchNote, u as createGithubStorePoller, ui as GITHUB_RATE_LIMIT_WINDOW_MS, un as reviewerAgentArgs, ur as projectParentDirs, ut as REMERGE_OBJECTS_DIRNAME, v as MY_PRS_FIX_WORK_BRANCH, vn as teamReviewStatus, vr as summaryLineFromReportText, vt as REVIEW_UNTRUSTED_ITEM_MAX_CHARS, w as consecutiveKeepMergeableAttempts, wi as watcherChildInboxUrl, wn as parsePostingFile, wr as nulSeparatedPaths, wt as askedForRefusal, x as MyPrsLaneState, xi as nextCrashCount, xn as watcherFeedError, xr as underlyingInvestigationChange, xt as absolutePathReadRule, y as MY_PRS_LANE_ID, yn as triagePr, yr as toCount, yt as TEAM_REVIEW_LANE_ID, z as mergeAttemptKey, zn as buildInvestigationRecord, zr as parseThreadJudgeResult, zt as isUnreviewedDraft } from "./watchee-settings-CjkenTD8.js";
24
24
  import { a as rawTextOr, i as positiveNumberOr, n as isRecord$1, o as textOr, r as numberOr, t as coercedNumberOr } from "./coerce-D6vRlIGO.js";
25
25
  import { C as createTsconfigPathsResolver, E as resolveExtendsPath, T as parseTsconfigJsonc, d as KIMI_HOME_PROFILE, i as AGENT_HOME_PROFILES, w as matchPathPatterns } from "./agent-home-core-fVTGZwNk.js";
26
- import { n as configFileViewOf, u as readSettingsForAgent } from "./settings-readout-core-CmLHyRuh.js";
26
+ import { n as configFileViewOf, u as readSettingsForAgent } from "./settings-readout-core-O6-uLAi3.js";
27
27
  import { n as parseJsonRecord, t as parseJsonOrNull } from "./json-core-B1ov-SNz.js";
28
28
  import { t as HOOK_TOOLS } from "./hook-tools-CytPV0RW.js";
29
29
  import { a as showHomeAsTilde, i as sanitizeOneLine, n as requireExecutableSpawnHelper, r as firstLine$2 } from "./node-pty-preflight-B6wME-M3.js";
30
- import { t as DETACHED_DESKTOP_BUS_ADDRESS } from "./spawn-env-BzXNL1C6.js";
30
+ import { t as DETACHED_DESKTOP_BUS_ADDRESS } from "./spawn-env-CapiuFtq.js";
31
31
  import { t as HOOK_URL_ENV } from "./hook-relay-core-ne0rkTgG.js";
32
32
  import { c as saneYoloFiles } from "./sane-yolo-BJM6ju1w.js";
33
33
  import { n as glimmervoidHomeDir$1, r as isOperatorHomeUnderTest, t as decideConfigPath } from "./config-path-core-qUZH9-0F.js";
34
34
  import { r as knownWriteHookInput } from "./posthog-read-gate-core-D_5rXRpS.js";
35
- import { A as withPrActionRun, C as teammateThreadItems, D as withHandled, E as visibleRun, M as withRuleRun, O as withInterruptedRuns, a as fixLocallyPrompt, b as shouldTellBranchMoved, c as mergeItems, f as plannedActions, g as prFlowsConfig, h as prFlowSetup, j as withReopened, k as withOnlyOpenPrs, m as prActionRunAfterExit, n as branchMovedNote, r as commandFingerprint, s as itemLocation, t as acceptReport, u as packPathsOf, v as savedRuleFor, w as threadCandidates, x as sourceCandidates$1, y as scopedToRepo } from "./pr-flows-core-BozpyjPp.js";
36
- import { i as packsStatePath, l as PacksState, o as readPackDir, r as packDirsUnder, s as PACK_FILE_NAME, t as PACKS_DIR_NAME } from "./pack-files-D-DwYbEb.js";
37
- import { a as PackStoreData, d as packStoreSizeError, u as packStoreAfterSet } from "./pack-bridge-Bu5URQmU.js";
38
- import { t as createPrFlowsExternal } from "./pr-flows-external-DcCUz1_Q.js";
39
- import { n as isSameHostEntry, r as removeHostFrom, t as addHostTo } from "./host-registry-core-DdbIz-3r.js";
35
+ import { A as withPrActionRun, C as teammateThreadItems, D as withHandled, E as visibleRun, M as withRuleRun, O as withInterruptedRuns, a as fixLocallyPrompt, b as shouldTellBranchMoved, c as mergeItems, f as plannedActions, g as prFlowsConfig, h as prFlowSetup, j as withReopened, k as withOnlyOpenPrs, m as prActionRunAfterExit, n as branchMovedNote, r as commandFingerprint, s as itemLocation, t as acceptReport, u as packPathsOf, v as savedRuleFor, w as threadCandidates, x as sourceCandidates$1, y as scopedToRepo } from "./pr-flows-core-C5EdQcdl.js";
36
+ import { i as packsStatePath, l as PacksState, o as readPackDir, r as packDirsUnder, s as PACK_FILE_NAME, t as PACKS_DIR_NAME } from "./pack-files-Cquc-WhV.js";
37
+ import { a as PackStoreData, d as packStoreSizeError, u as packStoreAfterSet } from "./pack-bridge-BKP_4o4G.js";
38
+ import { t as createPrFlowsExternal } from "./pr-flows-external-Bwwtnh-u.js";
39
+ import { n as isSameHostEntry, r as removeHostFrom, t as addHostTo } from "./host-registry-core-Cj9x_2Yr.js";
40
40
  import { i as parseCommandLine, n as warnWhenGitIsTooOld } from "./git-version-Bs9G8R8w.js";
41
41
  import { createRequire } from "node:module";
42
42
  import fs, { readFileSync } from "node:fs";
@@ -52,6 +52,7 @@ import { pipeline } from "node:stream";
52
52
  import express from "express";
53
53
  import { toNodeHandler } from "@modelcontextprotocol/node";
54
54
  import { McpServer, createMcpHandler } from "@modelcontextprotocol/server";
55
+ import { isUtf8 } from "node:buffer";
55
56
  import dns from "node:dns";
56
57
  import https from "node:https";
57
58
  import WebSocket$1, { WebSocket, WebSocketServer } from "ws";
@@ -886,13 +887,14 @@ var SESSION_TOOL = {
886
887
  var WHITEBOARD_TOOL = {
887
888
  name: "whiteboard",
888
889
  title: "Glimmervoid whiteboards",
889
- description: "Draw diagrams, architecture maps and plans on a shared whiteboard the operator sees and edits on the dashboard; prefer it to a diagram in chat. new creates a board and list names them; every other action needs a board that exists, so call list or new first. get reads one with what changed since this session last read it, view returns a picture of it as the operator sees it, put applies element ops (add, set, remove; a box with a step is a plan step, and a wire from one step to another orders them); get and put also return the plan steps in build order and any layout warnings to fix, connect and disconnect follow a board's changes, resolve closes a note, delete removes a board this session created, attach stores a PNG, JPEG, WebP, GIF, SVG, MP4, WebM or HTML file and returns the media a box takes to show it.",
890
+ description: "Draw diagrams, architecture maps and plans on a shared whiteboard the operator sees and edits on the dashboard; prefer it to a diagram in chat. new creates a board and list names them; every other action needs a board that exists, so call list or new first. get reads one with what changed since this session last read it, view returns a picture of it as the operator sees it, put applies element ops (add, set, remove; a box with a step is a plan step, and a wire from one step to another orders them); get and put also return the plan steps in build order and any layout warnings to fix, connect and disconnect follow a board's changes, resolve closes a note, delete removes a board this session created, attach stores a PNG, JPEG, WebP, GIF, SVG, MP4, WebM, HTML or Markdown file and returns the media a box takes to show it, and doc reads the Markdown text of the document a box shows, as the operator last saved it.",
890
891
  loadsUpfront: true,
891
892
  fields: {
892
893
  board: BoardField.optional(),
893
894
  title: z.string().min(1).max(200).optional().describe("new: the board title"),
894
895
  ops: z.array(Op).min(1).optional().describe("put: the element ops to apply"),
895
896
  note: z.string().min(1).max(200).optional().describe("resolve: the note element id"),
897
+ box: z.string().min(1).max(40).optional().describe("doc: the id of the box whose document to read"),
896
898
  peek: z.boolean().optional().describe("get: read without marking changes as seen; view never marks them"),
897
899
  review: z.boolean().optional().describe("get: include the plan review against the code session"),
898
900
  path: z.string().min(1).max(4096).optional().describe("attach: the image file, absolute or relative to this session's directory")
@@ -932,6 +934,11 @@ var WHITEBOARD_TOOL = {
932
934
  required: ["board", "note"],
933
935
  hints: REWRITES
934
936
  }),
937
+ doc: whiteboardRoute("doc", ["board", "box"], {
938
+ required: ["board", "box"],
939
+ hints: READS,
940
+ presenter: "reply-text"
941
+ }),
935
942
  delete: whiteboardRoute("delete", ["board"], {
936
943
  required: ["board"],
937
944
  hints: {
@@ -1013,7 +1020,7 @@ function showPayload(toolArguments, context) {
1013
1020
  var SHOW_TOOL = {
1014
1021
  name: "show",
1015
1022
  title: "Glimmervoid show",
1016
- description: "Show the operator an image, video or HTML page you made (a screenshot, a rendered chart, a report, a mockup, a demo clip) as a card on a whiteboard on their dashboard. Use it instead of publishing an artifact, pasting a picture into chat, or asking the operator to open a file: the operator is already watching the board, and the card stays there for them and other sessions to see and edit. It puts the card on the board this session is connected to, creating one named after this session when there is none, and returns the board and the box id so whiteboard put can change it. Accepts PNG, JPEG, WebP, GIF, SVG, MP4, WebM or HTML on this machine, up to 200 MB.",
1023
+ description: "Show the operator an image, video, HTML page or Markdown document you made (a screenshot, a rendered chart, a report, a mockup, a demo clip, a draft they should edit) as a card on a whiteboard on their dashboard. Use it instead of publishing an artifact, pasting a picture into chat, or asking the operator to open a file: the operator is already watching the board, and the card stays there for them and other sessions to see and edit. It puts the card on the board this session is connected to, creating one named after this session when there is none, and returns the board and the box id so whiteboard put can change it. Accepts PNG, JPEG, WebP, GIF, SVG, MP4, WebM, HTML or Markdown on this machine, up to 200 MB, a Markdown document up to 256 KiB; the operator can edit a Markdown document on the board.",
1017
1024
  loadsUpfront: true,
1018
1025
  fields: {
1019
1026
  path: z.string().min(1).max(4096).describe("The file, absolute or relative to this session's directory"),
@@ -1453,6 +1460,233 @@ function decideOpenExternalRequest({ isLoopback, trust, origin, listenerPorts, t
1453
1460
  url
1454
1461
  };
1455
1462
  }
1463
+ // server/core/shown-files-core.ts
1464
+ var SHOWN_SNIFF_BYTES = 65536;
1465
+ var PAGE_TITLE_MAX_CHARS = 200;
1466
+ var ACCEPTED_KINDS_TEXT = "PNG, JPEG, WebP, GIF, SVG, MP4, WebM, HTML or Markdown";
1467
+ var PNG = {
1468
+ kind: "image",
1469
+ mime: "image/png",
1470
+ extension: ".png"
1471
+ };
1472
+ var JPEG = {
1473
+ kind: "image",
1474
+ mime: "image/jpeg",
1475
+ extension: ".jpg"
1476
+ };
1477
+ var GIF = {
1478
+ kind: "image",
1479
+ mime: "image/gif",
1480
+ extension: ".gif"
1481
+ };
1482
+ var WEBP = {
1483
+ kind: "image",
1484
+ mime: "image/webp",
1485
+ extension: ".webp"
1486
+ };
1487
+ var SVG = {
1488
+ kind: "image",
1489
+ mime: "image/svg+xml",
1490
+ extension: ".svg"
1491
+ };
1492
+ var MP4 = {
1493
+ kind: "video",
1494
+ mime: "video/mp4",
1495
+ extension: ".mp4"
1496
+ };
1497
+ var WEBM = {
1498
+ kind: "video",
1499
+ mime: "video/webm",
1500
+ extension: ".webm"
1501
+ };
1502
+ var PAGE = {
1503
+ kind: "page",
1504
+ mime: "text/html; charset=utf-8",
1505
+ extension: ".html"
1506
+ };
1507
+ var DOC = {
1508
+ kind: "doc",
1509
+ mime: "text/markdown; charset=utf-8",
1510
+ extension: ".md"
1511
+ };
1512
+ var MARKDOWN_NAME_EXTENSIONS = /* @__PURE__ */ new Set([".md", ".markdown"]);
1513
+ var NUL_BYTE = 0;
1514
+ var PNG_SIGNATURE = Buffer.from([
1515
+ 137,
1516
+ 80,
1517
+ 78,
1518
+ 71,
1519
+ 13,
1520
+ 10,
1521
+ 26,
1522
+ 10
1523
+ ]);
1524
+ var JPEG_SIGNATURE = Buffer.from([
1525
+ 255,
1526
+ 216,
1527
+ 255
1528
+ ]);
1529
+ var WEBM_SIGNATURE = Buffer.from([
1530
+ 26,
1531
+ 69,
1532
+ 223,
1533
+ 163
1534
+ ]);
1535
+ var UTF8_BYTE_ORDER_MARK = "";
1536
+ var UTF8_BYTE_ORDER_MARK_BYTES = Buffer.from([
1537
+ 239,
1538
+ 187,
1539
+ 191
1540
+ ]);
1541
+ var HTML_WHITESPACE_BYTES = /* @__PURE__ */ new Set([
1542
+ 9,
1543
+ 10,
1544
+ 12,
1545
+ 13,
1546
+ 32
1547
+ ]);
1548
+ var PAGE_SCAN_WINDOW_BYTES = 65536;
1549
+ var PRELUDE_OPENER_BYTES = 9;
1550
+ var LONGEST_PRELUDE_CLOSER_BYTES = 4;
1551
+ var GREATER_THAN_BYTE = 62;
1552
+ var EXCLAMATION_BYTE = 33;
1553
+ var PAGE_TITLE_RE = /<title[^>]*>([\s\S]*?)<\/title>/i;
1554
+ function startsWithBytes(chunk, signature, offset = 0) {
1555
+ return chunk.length >= offset + signature.length && chunk.subarray(offset, offset + signature.length).equals(signature);
1556
+ }
1557
+ function asciiAt(chunk, offset, length) {
1558
+ return chunk.subarray(offset, offset + length).toString("latin1");
1559
+ }
1560
+ function sniffBinaryFormat(chunk) {
1561
+ if (startsWithBytes(chunk, PNG_SIGNATURE)) return PNG;
1562
+ if (startsWithBytes(chunk, JPEG_SIGNATURE)) return JPEG;
1563
+ if (asciiAt(chunk, 0, 6) === "GIF87a" || asciiAt(chunk, 0, 6) === "GIF89a") return GIF;
1564
+ if (asciiAt(chunk, 0, 4) === "RIFF" && asciiAt(chunk, 8, 4) === "WEBP") return WEBP;
1565
+ if (asciiAt(chunk, 4, 4) === "ftyp") return MP4;
1566
+ if (startsWithBytes(chunk, WEBM_SIGNATURE)) return WEBM;
1567
+ return null;
1568
+ }
1569
+ function leadingMarkup(chunk) {
1570
+ const text = chunk.toString("utf8");
1571
+ return (text.startsWith(UTF8_BYTE_ORDER_MARK) ? text.slice(1) : text).trimStart().toLowerCase();
1572
+ }
1573
+ function sniffMarkupFormat(chunk, declaredName) {
1574
+ const markup = leadingMarkup(chunk);
1575
+ if (!markup.startsWith("<")) return null;
1576
+ if (markup.startsWith("<svg")) return SVG;
1577
+ if (markup.startsWith("<!doctype html") || markup.startsWith("<html")) return PAGE;
1578
+ const declaredExtension = path.extname(declaredName).toLowerCase();
1579
+ if (declaredExtension === ".svg" && markup.includes("<svg")) return SVG;
1580
+ if (declaredExtension === ".html" || declaredExtension === ".htm") return PAGE;
1581
+ if (markup.startsWith("<?xml") && markup.includes("<svg")) return SVG;
1582
+ return null;
1583
+ }
1584
+ function sniffDocFormat(chunk, declaredName) {
1585
+ if (!MARKDOWN_NAME_EXTENSIONS.has(path.extname(declaredName).toLowerCase())) return null;
1586
+ return chunk.includes(NUL_BYTE) ? null : DOC;
1587
+ }
1588
+ function decideShownKind(firstChunk, declaredName) {
1589
+ const format = sniffBinaryFormat(firstChunk) ?? sniffMarkupFormat(firstChunk, declaredName) ?? sniffDocFormat(firstChunk, declaredName);
1590
+ if (!format) return {
1591
+ ok: false,
1592
+ error: `${declaredName} is not a file show takes; show takes ${ACCEPTED_KINDS_TEXT} files`
1593
+ };
1594
+ return {
1595
+ ok: true,
1596
+ kind: format.kind,
1597
+ mime: format.mime,
1598
+ extension: format.extension
1599
+ };
1600
+ }
1601
+ function preludeTokenOpenedBy(opener) {
1602
+ if (opener.startsWith("<!-->") || opener.startsWith("<!--->")) return {
1603
+ closedBy: "greater-than sign",
1604
+ closerSearchSkip: 4,
1605
+ isDoctype: false
1606
+ };
1607
+ if (opener.startsWith("<!--")) return {
1608
+ closedBy: "comment end",
1609
+ closerSearchSkip: 4,
1610
+ isDoctype: false
1611
+ };
1612
+ if (opener === "<!doctype") return {
1613
+ closedBy: "greater-than sign",
1614
+ closerSearchSkip: 0,
1615
+ isDoctype: true
1616
+ };
1617
+ return opener.startsWith("<!") || opener.startsWith("<?") || /^<\/[^a-z]/.test(opener) ? {
1618
+ closedBy: "greater-than sign",
1619
+ closerSearchSkip: 0,
1620
+ isDoctype: false
1621
+ } : null;
1622
+ }
1623
+ function commentEndIn(window, searchFrom) {
1624
+ let dashesAt = window.indexOf("--", searchFrom);
1625
+ while (dashesAt !== -1) {
1626
+ if (window[dashesAt + 2] === GREATER_THAN_BYTE) return {
1627
+ offset: dashesAt,
1628
+ length: 3
1629
+ };
1630
+ if (window[dashesAt + 2] === EXCLAMATION_BYTE && window[dashesAt + 3] === GREATER_THAN_BYTE) return {
1631
+ offset: dashesAt,
1632
+ length: 4
1633
+ };
1634
+ dashesAt = window.indexOf("--", dashesAt + 1);
1635
+ }
1636
+ return null;
1637
+ }
1638
+ function closerIn(window, closedBy, searchFrom) {
1639
+ if (closedBy === "comment end") return commentEndIn(window, searchFrom);
1640
+ const greaterThanAt = window.indexOf(GREATER_THAN_BYTE, searchFrom);
1641
+ return greaterThanAt === -1 ? null : {
1642
+ offset: greaterThanAt,
1643
+ length: 1
1644
+ };
1645
+ }
1646
+ async function closerInFile(readWindow, closedBy, searchFrom) {
1647
+ let position = searchFrom;
1648
+ for (;;) {
1649
+ const window = await readWindow(position, PAGE_SCAN_WINDOW_BYTES);
1650
+ const closer = closerIn(window, closedBy, 0);
1651
+ if (closer) return {
1652
+ offset: position + closer.offset,
1653
+ length: closer.length
1654
+ };
1655
+ if (window.length < PAGE_SCAN_WINDOW_BYTES) return null;
1656
+ position += window.length - LONGEST_PRELUDE_CLOSER_BYTES + 1;
1657
+ }
1658
+ }
1659
+ async function offsetAfterPagePrelude(readWindow) {
1660
+ let windowStart = 0;
1661
+ let window = await readWindow(0, PAGE_SCAN_WINDOW_BYTES);
1662
+ let offset = startsWithBytes(window, UTF8_BYTE_ORDER_MARK_BYTES) ? UTF8_BYTE_ORDER_MARK_BYTES.length : 0;
1663
+ for (;;) {
1664
+ if (window.length === PAGE_SCAN_WINDOW_BYTES && offset + PRELUDE_OPENER_BYTES > windowStart + window.length) {
1665
+ windowStart = offset;
1666
+ window = await readWindow(offset, PAGE_SCAN_WINDOW_BYTES);
1667
+ }
1668
+ const offsetInWindow = offset - windowStart;
1669
+ if (HTML_WHITESPACE_BYTES.has(window[offsetInWindow] ?? -1)) {
1670
+ offset += 1;
1671
+ continue;
1672
+ }
1673
+ const token = preludeTokenOpenedBy(asciiAt(window, offsetInWindow, PRELUDE_OPENER_BYTES).toLowerCase());
1674
+ if (!token) return offset;
1675
+ const closerInWindow = closerIn(window, token.closedBy, offsetInWindow + token.closerSearchSkip);
1676
+ const closer = closerInWindow ? {
1677
+ offset: windowStart + closerInWindow.offset,
1678
+ length: closerInWindow.length
1679
+ } : await closerInFile(readWindow, token.closedBy, Math.max(offset + token.closerSearchSkip, windowStart + window.length - LONGEST_PRELUDE_CLOSER_BYTES + 1));
1680
+ if (!closer) return offset;
1681
+ const tokenEnd = closer.offset + closer.length;
1682
+ if (token.isDoctype) return tokenEnd;
1683
+ offset = tokenEnd;
1684
+ }
1685
+ }
1686
+ function readPageTitle(firstChunk) {
1687
+ const title = PAGE_TITLE_RE.exec(firstChunk.subarray(0, 65536).toString("utf8"))?.[1]?.replace(/\s+/g, " ").trim() ?? "";
1688
+ return title ? title.slice(0, PAGE_TITLE_MAX_CHARS) : null;
1689
+ }
1456
1690
  // server/core/link-preview-core.ts
1457
1691
  var LINK_PREVIEW_LIMITS = {
1458
1692
  maxBodyBytes: 65536,
@@ -1825,120 +2059,6 @@ function mountCustomSoundRoutes(app, { soundsDir }) {
1825
2059
  });
1826
2060
  });
1827
2061
  }
1828
- // server/core/shown-files-core.ts
1829
- var SHOWN_SNIFF_BYTES = 65536;
1830
- var PAGE_TITLE_MAX_CHARS = 200;
1831
- var ACCEPTED_KINDS_TEXT = "PNG, JPEG, WebP, GIF, SVG, MP4, WebM or HTML";
1832
- var PNG = {
1833
- kind: "image",
1834
- mime: "image/png",
1835
- extension: ".png"
1836
- };
1837
- var JPEG = {
1838
- kind: "image",
1839
- mime: "image/jpeg",
1840
- extension: ".jpg"
1841
- };
1842
- var GIF = {
1843
- kind: "image",
1844
- mime: "image/gif",
1845
- extension: ".gif"
1846
- };
1847
- var WEBP = {
1848
- kind: "image",
1849
- mime: "image/webp",
1850
- extension: ".webp"
1851
- };
1852
- var SVG = {
1853
- kind: "image",
1854
- mime: "image/svg+xml",
1855
- extension: ".svg"
1856
- };
1857
- var MP4 = {
1858
- kind: "video",
1859
- mime: "video/mp4",
1860
- extension: ".mp4"
1861
- };
1862
- var WEBM = {
1863
- kind: "video",
1864
- mime: "video/webm",
1865
- extension: ".webm"
1866
- };
1867
- var PAGE = {
1868
- kind: "page",
1869
- mime: "text/html; charset=utf-8",
1870
- extension: ".html"
1871
- };
1872
- var PNG_SIGNATURE = Buffer.from([
1873
- 137,
1874
- 80,
1875
- 78,
1876
- 71,
1877
- 13,
1878
- 10,
1879
- 26,
1880
- 10
1881
- ]);
1882
- var JPEG_SIGNATURE = Buffer.from([
1883
- 255,
1884
- 216,
1885
- 255
1886
- ]);
1887
- var WEBM_SIGNATURE = Buffer.from([
1888
- 26,
1889
- 69,
1890
- 223,
1891
- 163
1892
- ]);
1893
- var UTF8_BYTE_ORDER_MARK = "";
1894
- var PAGE_TITLE_RE = /<title[^>]*>([\s\S]*?)<\/title>/i;
1895
- function startsWithBytes(chunk, signature, offset = 0) {
1896
- return chunk.length >= offset + signature.length && chunk.subarray(offset, offset + signature.length).equals(signature);
1897
- }
1898
- function asciiAt(chunk, offset, length) {
1899
- return chunk.subarray(offset, offset + length).toString("latin1");
1900
- }
1901
- function sniffBinaryFormat(chunk) {
1902
- if (startsWithBytes(chunk, PNG_SIGNATURE)) return PNG;
1903
- if (startsWithBytes(chunk, JPEG_SIGNATURE)) return JPEG;
1904
- if (asciiAt(chunk, 0, 6) === "GIF87a" || asciiAt(chunk, 0, 6) === "GIF89a") return GIF;
1905
- if (asciiAt(chunk, 0, 4) === "RIFF" && asciiAt(chunk, 8, 4) === "WEBP") return WEBP;
1906
- if (asciiAt(chunk, 4, 4) === "ftyp") return MP4;
1907
- if (startsWithBytes(chunk, WEBM_SIGNATURE)) return WEBM;
1908
- return null;
1909
- }
1910
- function leadingMarkup(chunk) {
1911
- const text = chunk.toString("utf8");
1912
- return (text.startsWith(UTF8_BYTE_ORDER_MARK) ? text.slice(1) : text).trimStart().toLowerCase();
1913
- }
1914
- function sniffMarkupFormat(chunk, declaredName) {
1915
- const markup = leadingMarkup(chunk);
1916
- if (!markup.startsWith("<")) return null;
1917
- if (markup.startsWith("<svg")) return SVG;
1918
- if (markup.startsWith("<!doctype html") || markup.startsWith("<html")) return PAGE;
1919
- const declaredExtension = path.extname(declaredName).toLowerCase();
1920
- if (declaredExtension === ".svg" && markup.includes("<svg")) return SVG;
1921
- if (declaredExtension === ".html" || declaredExtension === ".htm") return PAGE;
1922
- if (markup.startsWith("<?xml") && markup.includes("<svg")) return SVG;
1923
- return null;
1924
- }
1925
- function decideShownKind(firstChunk, declaredName) {
1926
- const format = sniffBinaryFormat(firstChunk) ?? sniffMarkupFormat(firstChunk, declaredName);
1927
- if (!format) return {
1928
- ok: false,
1929
- error: `${declaredName} is not a file show takes; show takes ${ACCEPTED_KINDS_TEXT} files`
1930
- };
1931
- return {
1932
- ok: true,
1933
- kind: format.kind,
1934
- mime: format.mime,
1935
- extension: format.extension
1936
- };
1937
- }
1938
- function readPageTitle(firstChunk) {
1939
- const title = PAGE_TITLE_RE.exec(firstChunk.subarray(0, 65536).toString("utf8"))?.[1]?.replace(/\s+/g, " ").trim() ?? "";
1940
- return title ? title.slice(0, PAGE_TITLE_MAX_CHARS) : null;
1941
- }
1942
2062
  // server/whiteboard/whiteboard-assets.ts
1943
2063
  var ASSETS_FOLDER_NAME = "assets";
1944
2064
  var ASSET_INPUT_CAP_BYTES = SHOWN_FILE_CAP_BYTES;
@@ -1947,12 +2067,14 @@ var PREVIEW_WEBP_QUALITY = 85;
1947
2067
  var MAX_INPUT_PIXELS = 268435456;
1948
2068
  var PAGE_WIDTH_PX = 1280;
1949
2069
  var PAGE_HEIGHT_PX = 800;
2070
+ var DOC_WIDTH_PX = 800;
2071
+ var DOC_HEIGHT_PX = 1e3;
1950
2072
  var UNPOSTERED_VIDEO_WIDTH_PX = 1280;
1951
2073
  var UNPOSTERED_VIDEO_HEIGHT_PX = 720;
1952
2074
  var VIDEO_POSTER_TIMEOUT_MS = 15e3;
1953
2075
  var ASSET_FILE_MODE = 384;
1954
2076
  var PREVIEW_SUFFIX = ".preview.webp";
1955
- var ORIGINAL_FILENAME_RE = /^([0-9a-f]{64})(\.png|\.jpg|\.gif|\.webp|\.svg|\.mp4|\.webm|\.html)$/;
2077
+ var ORIGINAL_FILENAME_RE = /^([0-9a-f]{64})(\.png|\.jpg|\.gif|\.webp|\.svg|\.mp4|\.webm|\.html|\.md)$/;
1956
2078
  var PREVIEW_FILENAME_RE = /^([0-9a-f]{64})\.preview\.webp$/;
1957
2079
  var INCOMING_PREFIX = ".incoming-";
1958
2080
  var ATTACH_HOLD_MS = 6e5;
@@ -1978,7 +2100,7 @@ var STILL_IMAGE_FTYP_BRANDS = /* @__PURE__ */ new Set([
1978
2100
  "crx "
1979
2101
  ]);
1980
2102
  var FTYP_BRANDS_OFFSET = 16;
1981
- var ACCEPTED_TEXT = "PNG, JPEG, WebP, GIF, SVG, MP4, WebM or HTML";
2103
+ var ACCEPTED_TEXT = "PNG, JPEG, WebP, GIF, SVG, MP4, WebM, HTML or Markdown";
1982
2104
  var OPEN_WITHOUT_BLOCKING_ON_A_PIPE = fs.constants.O_RDONLY | (fs.constants.O_NONBLOCK ?? 0);
1983
2105
  var MEDIA_FORMAT_BY_EXTENSION = {
1984
2106
  ".png": {
@@ -2028,6 +2150,12 @@ var MEDIA_FORMAT_BY_EXTENSION = {
2028
2150
  mime: "text/html",
2029
2151
  contentType: "text/html; charset=utf-8",
2030
2152
  hasLargeRasterPreview: false
2153
+ },
2154
+ ".md": {
2155
+ kind: "doc",
2156
+ mime: "text/markdown",
2157
+ contentType: "text/markdown; charset=utf-8",
2158
+ hasLargeRasterPreview: false
2031
2159
  }
2032
2160
  };
2033
2161
  function ftypBrandsOf(firstChunk) {
@@ -2050,6 +2178,17 @@ function refusal$2(status, error) {
2050
2178
  function overCapRefusal(name) {
2051
2179
  return refusal$2(413, `${name} is larger than the ${ASSET_INPUT_CAP_BYTES / 1048576} MB a board takes`);
2052
2180
  }
2181
+ function overDocCapRefusal(name) {
2182
+ return refusal$2(413, `${name} is larger than the ${BOARD_DOC_CAP_BYTES / 1024} KiB a board document takes`);
2183
+ }
2184
+ function notUtf8Refusal(name) {
2185
+ return refusal$2(415, `${name} is not UTF-8 text; a board document is UTF-8 Markdown`);
2186
+ }
2187
+ async function docRefusalOf(incomingPath, name) {
2188
+ if ((await fs$1.stat(incomingPath)).size > 262144) return overDocCapRefusal(name);
2189
+ if (!isUtf8(await fs$1.readFile(incomingPath))) return notUtf8Refusal(name);
2190
+ return null;
2191
+ }
2053
2192
  function isRefusal(value) {
2054
2193
  return typeof value === "object" && value !== null && "ok" in value && value.ok === false;
2055
2194
  }
@@ -2208,12 +2347,22 @@ async function sizeVideo(sourcePath, previewPath, name) {
2208
2347
  hasPreview: true
2209
2348
  };
2210
2349
  }
2211
- async function sizeStoredMedia(sourcePath, previewPath, format, hasStoredPreview, name) {
2350
+ function fixedViewportSizeOf(format) {
2212
2351
  if (format.kind === "page") return {
2213
2352
  width: PAGE_WIDTH_PX,
2214
2353
  height: PAGE_HEIGHT_PX,
2215
2354
  hasPreview: false
2216
2355
  };
2356
+ if (format.kind === "doc") return {
2357
+ width: DOC_WIDTH_PX,
2358
+ height: DOC_HEIGHT_PX,
2359
+ hasPreview: false
2360
+ };
2361
+ return null;
2362
+ }
2363
+ async function sizeStoredMedia(sourcePath, previewPath, format, hasStoredPreview, name) {
2364
+ const fixedViewportSize = fixedViewportSizeOf(format);
2365
+ if (fixedViewportSize) return fixedViewportSize;
2217
2366
  const drawnSize = await rasterSizeOf(format.kind === "video" ? previewPath : sourcePath);
2218
2367
  if (drawnSize === "interrupted") return interruptedReadRefusal(name);
2219
2368
  if (format.kind === "video") return {
@@ -2230,11 +2379,8 @@ async function sizeStoredMedia(sourcePath, previewPath, format, hasStoredPreview
2230
2379
  };
2231
2380
  }
2232
2381
  function sizeMedia(sourcePath, previewPath, format, name) {
2233
- if (format.kind === "page") return Promise.resolve({
2234
- width: PAGE_WIDTH_PX,
2235
- height: PAGE_HEIGHT_PX,
2236
- hasPreview: false
2237
- });
2382
+ const fixedViewportSize = fixedViewportSizeOf(format);
2383
+ if (fixedViewportSize) return Promise.resolve(fixedViewportSize);
2238
2384
  if (format.kind === "video") return sizeVideo(sourcePath, previewPath, name);
2239
2385
  return sizeImage(sourcePath, previewPath, format, name);
2240
2386
  }
@@ -2324,6 +2470,8 @@ function createWhiteboardAssetStore({ boardsRoot, logger = console, now = Date.n
2324
2470
  const verdict = decideShownKind(firstChunk, name);
2325
2471
  const format = verdict.ok ? MEDIA_FORMAT_BY_EXTENSION[verdict.extension] : void 0;
2326
2472
  if (!verdict.ok || !format || isStillImageInVideoContainer(firstChunk, verdict.extension)) return refusal$2(415, `${name} is not a file a board takes; a board takes ${ACCEPTED_TEXT}`);
2473
+ const docRefusal = format.kind === "doc" ? await docRefusalOf(incomingPath, name) : null;
2474
+ if (docRefusal) return docRefusal;
2327
2475
  return await storeIncomingInTurn(incomingPath, await hashFile(incomingPath), verdict.extension, name);
2328
2476
  } catch (error) {
2329
2477
  logger.warn(`[whiteboard] board media could not be stored: ${errorMessage(error)}`);
@@ -2412,6 +2560,11 @@ function createWhiteboardAssetStore({ boardsRoot, logger = console, now = Date.n
2412
2560
  if (stored.hasPreview) return previewPathOf(media.asset);
2413
2561
  return media.kind === "image" ? originalPathOf(media.asset, stored.extension) : null;
2414
2562
  }
2563
+ async function readDocText(media) {
2564
+ const stored = storedByAssetId.get(media.asset);
2565
+ if (media.kind !== "doc" || !stored || MEDIA_FORMAT_BY_EXTENSION[stored.extension]?.kind !== "doc") return null;
2566
+ return fs$1.readFile(originalPathOf(media.asset, stored.extension), "utf8").catch(() => null);
2567
+ }
2415
2568
  async function dataUriOf(media, drawnWidth, drawnHeight) {
2416
2569
  const sourcePath = pictureSourceOf(media);
2417
2570
  if (!sourcePath) return null;
@@ -2436,7 +2589,8 @@ function createWhiteboardAssetStore({ boardsRoot, logger = console, now = Date.n
2436
2589
  sweep,
2437
2590
  servableOf,
2438
2591
  mismatchOf,
2439
- dataUriOf
2592
+ dataUriOf,
2593
+ readDocText
2440
2594
  };
2441
2595
  }
2442
2596
  // server/backend/http/backend-http-uploads.ts
@@ -2748,6 +2902,19 @@ function answerLinkPreview({ req, res, remoteListenerPort, listenerPortsFor, tok
2748
2902
  var BOARD_PAGE_SANDBOX_POLICY = "sandbox allow-scripts allow-popups allow-modals allow-forms";
2749
2903
  var BOARD_MEDIA_SANDBOX_POLICY = "default-src 'none'; sandbox";
2750
2904
  var DASHBOARD_FRAME_POLICY = "frame-src 'self' blob: data:";
2905
+ var BOARD_PAGE_ESCAPE_REPORTER = Buffer.from(`<script>(function(later,dashboard){addEventListener("keydown",function(event){if(event.key==="Escape")later(function(){if(!event.defaultPrevented)dashboard.postMessage(${JSON.stringify(BOARD_PAGE_ESCAPE_MESSAGE)},"*")})},true)})(setTimeout,parent)<\/script>`);
2906
+ async function escapeReporterOffsetOf(pagePath) {
2907
+ const page = await fs$1.open(pagePath, "r");
2908
+ try {
2909
+ return await offsetAfterPagePrelude(async (position, byteCount) => {
2910
+ const window = Buffer.alloc(byteCount);
2911
+ const { bytesRead } = await page.read(window, 0, byteCount, position);
2912
+ return window.subarray(0, bytesRead);
2913
+ });
2914
+ } finally {
2915
+ await page.close().catch(() => {});
2916
+ }
2917
+ }
2751
2918
  function sendBoardAssetBytes(req, res, servable, sizeBytes) {
2752
2919
  res.setHeader("Content-Security-Policy", servable.contentType.startsWith("text/html") ? BOARD_PAGE_SANDBOX_POLICY : BOARD_MEDIA_SANDBOX_POLICY);
2753
2920
  res.setHeader("X-Content-Type-Options", "nosniff");
@@ -2773,10 +2940,30 @@ function sendBoardAssetBytes(req, res, servable, sizeBytes) {
2773
2940
  res.setHeader("Content-Length", String(sizeBytes));
2774
2941
  pipeline(fs.createReadStream(servable.path), res, () => {});
2775
2942
  }
2943
+ function sendBoardPageForViewer(res, servable, sizeBytes, reporterOffset) {
2944
+ res.setHeader("Content-Security-Policy", BOARD_PAGE_SANDBOX_POLICY);
2945
+ res.setHeader("X-Content-Type-Options", "nosniff");
2946
+ res.setHeader("Cache-Control", "no-store");
2947
+ res.setHeader("Content-Type", servable.contentType);
2948
+ res.setHeader("Content-Length", String(sizeBytes + BOARD_PAGE_ESCAPE_REPORTER.byteLength));
2949
+ pipeline(async function* pageWithEscapeReporterAfterPrelude() {
2950
+ if (reporterOffset > 0) yield* fs.createReadStream(servable.path, { end: reporterOffset - 1 });
2951
+ yield BOARD_PAGE_ESCAPE_REPORTER;
2952
+ yield* fs.createReadStream(servable.path, { start: reporterOffset });
2953
+ }, res, () => {});
2954
+ }
2955
+ function isPageAskedForViewer(req, servable) {
2956
+ return servable.contentType.startsWith("text/html") && req.query["viewer"] === "1";
2957
+ }
2776
2958
  function serveBoardAsset(req, res, servable) {
2777
- fs$1.stat(servable.path).then((stats) => sendBoardAssetBytes(req, res, servable, stats.size), () => {
2959
+ const answerMissing = () => {
2778
2960
  if (!res.headersSent) res.status(404).end();
2779
- });
2961
+ };
2962
+ if (!isPageAskedForViewer(req, servable)) {
2963
+ fs$1.stat(servable.path).then((stats) => sendBoardAssetBytes(req, res, servable, stats.size), answerMissing);
2964
+ return;
2965
+ }
2966
+ Promise.all([fs$1.stat(servable.path), escapeReporterOffsetOf(servable.path)]).then(([stats, reporterOffset]) => sendBoardPageForViewer(res, servable, stats.size, reporterOffset), answerMissing);
2780
2967
  }
2781
2968
  async function receiveBoardMedia({ req, assets, name }) {
2782
2969
  const declaredBytes = declaredContentLength(req);
@@ -4979,8 +5166,6 @@ var DIFFED_BOARD_FIELDS = [
4979
5166
  "title",
4980
5167
  "caption",
4981
5168
  "legend",
4982
- "columns",
4983
- "lanes",
4984
5169
  "codeSessionId"
4985
5170
  ];
4986
5171
  var OPERATOR_AUTHOR = Object.freeze({
@@ -5050,16 +5235,14 @@ function checkBoxReferences(board, box, previous) {
5050
5235
  const outputs = checkBoxOutputs(board, box, previous);
5051
5236
  if (!outputs.ok) return outputs;
5052
5237
  if (box.change === "relabeled" && !box.was) return refuse(`box ${box.id} is relabeled, so give its old title in was`);
5053
- if (box.step === null && box.shape !== "panel" && box.column === null && box.near === null && box.at === null) return refuse(`box ${box.id} needs a place: a column, near another box, or at a point`);
5238
+ if (box.step === null && box.shape !== "panel" && box.near === null && box.at === null) return refuse(`box ${box.id} needs a place: near another box or at a point`);
5054
5239
  const sittingNear = isStackedPanel(box) && previous?.kind === "box" && !isStackedPanel(previous) ? boxSittingNear(board, box.id) : null;
5055
- if (sittingNear) return refuse(`box ${sittingNear.id} sits near ${box.id}, so ${box.id} cannot go back to the panel stack with no place: keep a column, near or at on it, or move box ${sittingNear.id} first`);
5056
- if (box.column !== null && !board.columns.some((column) => column.id === box.column)) return refuse(`box ${box.id} names column ${box.column}, which the board does not have, so add it with a columns op first`);
5057
- if (box.lane !== null && !board.lanes.some((lane) => lane.id === box.lane)) return refuse(`box ${box.id} names lane ${box.lane}, which the board does not have, so add it with a lanes op first`);
5240
+ if (sittingNear) return refuse(`box ${sittingNear.id} sits near ${box.id}, so ${box.id} cannot go back to the panel stack with no place: keep a near or at on it, or move box ${sittingNear.id} first`);
5058
5241
  if (box.near === null) return OK;
5059
5242
  if (box.near.of === box.id) return refuse(`box ${box.id} cannot sit near itself`);
5060
5243
  const nearTarget = board.elements[box.near.of];
5061
5244
  if (nearTarget?.kind !== "box") return refuse(`box ${box.id} sits near ${box.near.of}, which is not a box`);
5062
- if (isStackedPanel(nearTarget)) return refuse(`box ${box.id} sits near ${box.near.of}, a panel with no place yet, so give that panel a column, near or at first`);
5245
+ if (isStackedPanel(nearTarget)) return refuse(`box ${box.id} sits near ${box.near.of}, a panel with no place yet, so give that panel a near or at first`);
5063
5246
  if (nearChainReaches(board, box.near.of, box.id)) return refuse(`box ${box.id} sits near ${box.near.of}, which already sits near ${box.id}, so they would place each other`);
5064
5247
  return OK;
5065
5248
  }
@@ -5211,34 +5394,6 @@ function resolveNote(board, id, author) {
5211
5394
  };
5212
5395
  return OK;
5213
5396
  }
5214
- function replaceColumns(board, columns, moveByColumnId) {
5215
- const columnIds = new Set(columns.map((column) => column.id));
5216
- if (columnIds.size !== columns.length) return refuse("column ids must be unique");
5217
- const strayTarget = Object.entries(moveByColumnId).find(([, targetId]) => !columnIds.has(targetId));
5218
- if (strayTarget) return refuse(`move sends column ${strayTarget[0]} to ${strayTarget[1]}, which is not in the new columns`);
5219
- const movedBoxes = Object.values(board.elements).flatMap((element) => {
5220
- if (element.kind !== "box" || element.column === null) return [];
5221
- return [{
5222
- ...element,
5223
- column: Object.hasOwn(moveByColumnId, element.column) ? moveByColumnId[element.column] ?? element.column : element.column
5224
- }];
5225
- });
5226
- const strandedBox = movedBoxes.find((box) => box.column !== null && !columnIds.has(box.column));
5227
- if (strandedBox) return refuse(`box ${strandedBox.id} is still in removed column ${strandedBox.column}, so name it in move or remove the box first`);
5228
- for (const box of movedBoxes) board.elements[box.id] = box;
5229
- board.columns = columns;
5230
- return OK;
5231
- }
5232
- function replaceLanes(board, lanes) {
5233
- const laneIds = new Set(lanes.map((lane) => lane.id));
5234
- if (laneIds.size !== lanes.length) return refuse("lane ids must be unique");
5235
- board.lanes = lanes;
5236
- for (const element of Object.values(board.elements)) if (element.kind === "box" && element.lane !== null && !laneIds.has(element.lane)) board.elements[element.id] = {
5237
- ...element,
5238
- lane: null
5239
- };
5240
- return OK;
5241
- }
5242
5397
  function applyOne(draft, op, author) {
5243
5398
  const { board } = draft;
5244
5399
  if (op.op !== "remove") {
@@ -5250,8 +5405,6 @@ function applyOne(draft, op, author) {
5250
5405
  case "set": return setFields(board, op.id, op.fields, author);
5251
5406
  case "remove": return removeElement(draft, op.id);
5252
5407
  case "resolve": return resolveNote(board, op.id, author);
5253
- case "columns": return replaceColumns(board, op.columns, op.move);
5254
- case "lanes": return replaceLanes(board, op.lanes);
5255
5408
  case "board":
5256
5409
  if (op.title !== void 0) board.title = op.title;
5257
5410
  if (op.caption !== void 0) board.caption = op.caption;
@@ -5361,6 +5514,7 @@ function describeSet(op, previous, after) {
5361
5514
  if (fieldNames.length === 1 && fieldNames[0] === "at") return `moved ${nameOf(after, op.id)}`;
5362
5515
  if (fieldNames.length === 1 && fieldNames[0] === "step" && previous?.kind === "box" && afterElement?.kind === "box") return describeStepChange(nameOf(after, op.id), previous.step, afterElement.step);
5363
5516
  if (previous?.kind === "box" && afterElement?.kind === "box" && fieldNames.length === 1 && fieldNames[0] === "title") return `renamed "${previous.title}" to "${afterElement.title}"`;
5517
+ if (fieldNames.length === 1 && fieldNames[0] === "media" && previous?.kind === "box" && afterElement?.kind === "box" && previous.media?.kind === "doc" && afterElement.media?.kind === "doc") return `edited the document in ${nameOf(after, op.id)} (read it with whiteboard doc)`;
5364
5518
  return `changed ${fieldNames.join(", ")} of ${nameOf(after, op.id)}`;
5365
5519
  }
5366
5520
  function describeBoardOp(op) {
@@ -5379,8 +5533,6 @@ function describeOp(op, previous, after) {
5379
5533
  case "set": return describeSet(op, previous, after);
5380
5534
  case "remove": return `removed ${previous?.kind ?? "element"} ${nameOf(after, op.id, previous)}`;
5381
5535
  case "resolve": return previous?.kind === "note" ? `resolved note ${op.id} on ${nameOf(after, previous.on)}` : `resolved note ${op.id}`;
5382
- case "columns": return `set the columns to ${op.columns.map((column) => column.title || column.id).join(", ") || "none"}`;
5383
- case "lanes": return `set the lanes to ${op.lanes.map((lane) => lane.label || lane.id).join(", ") || "none"}`;
5384
5536
  case "board": return describeBoardOp(op);
5385
5537
  }
5386
5538
  }
@@ -5390,11 +5542,6 @@ function createBoard({ id, title, nowMs, codeSessionId = null }) {
5390
5542
  title,
5391
5543
  version: 0,
5392
5544
  caption: null,
5393
- columns: [{
5394
- id: "main",
5395
- title: ""
5396
- }],
5397
- lanes: [],
5398
5545
  legend: [],
5399
5546
  codeSessionId,
5400
5547
  elements: {},
@@ -5848,16 +5995,81 @@ function elementsWithStepBoxesForUnits(elements) {
5848
5995
  }
5849
5996
  return upgraded;
5850
5997
  }
5998
+ var UPGRADE_MARGIN = 40;
5999
+ var UPGRADE_COLUMN_WIDTH = 220;
6000
+ var UPGRADE_COLUMN_GAP = 90;
6001
+ var UPGRADE_BOX_GAP = 30;
6002
+ function idsOf(entries) {
6003
+ if (!Array.isArray(entries)) return [];
6004
+ return entries.flatMap((entry) => isRecord$1(entry) && typeof entry.id === "string" ? [entry.id] : []);
6005
+ }
6006
+ function isGridPlacedBox(element, columnId) {
6007
+ return isRecord$1(element) && element.kind === "box" && element.column === columnId && (element.at ?? null) === null && (element.near ?? null) === null;
6008
+ }
6009
+ function freePlacementByBoxId(board, elements) {
6010
+ const laneIds = idsOf(board.lanes);
6011
+ const laneRankOf = (box) => typeof box.lane === "string" ? laneIds.indexOf(box.lane) + 1 : 0;
6012
+ const orderOf = (box) => typeof box.order === "number" ? box.order : 0;
6013
+ const placementByBoxId = /* @__PURE__ */ new Map();
6014
+ let columnLeftEdge = UPGRADE_MARGIN;
6015
+ for (const columnId of idsOf(board.columns)) {
6016
+ const columnBoxes = Object.values(elements).filter((element) => isGridPlacedBox(element, columnId)).map((box, index) => ({
6017
+ box,
6018
+ index
6019
+ })).sort((left, right) => laneRankOf(left.box) - laneRankOf(right.box) || orderOf(left.box) - orderOf(right.box) || left.index - right.index).map(({ box }) => box);
6020
+ columnBoxes.forEach((box, index) => {
6021
+ const boxAbove = columnBoxes[index - 1];
6022
+ placementByBoxId.set(String(box.id), boxAbove ? { near: {
6023
+ of: boxAbove.id,
6024
+ side: "bottom",
6025
+ gap: UPGRADE_BOX_GAP
6026
+ } } : { at: {
6027
+ x: columnLeftEdge,
6028
+ y: UPGRADE_MARGIN
6029
+ } });
6030
+ });
6031
+ const widestBox = Math.max(UPGRADE_COLUMN_WIDTH, ...columnBoxes.map((box) => typeof box.width === "number" ? box.width : UPGRADE_COLUMN_WIDTH));
6032
+ columnLeftEdge += widestBox + UPGRADE_COLUMN_GAP;
6033
+ }
6034
+ return placementByBoxId;
6035
+ }
6036
+ function withoutColumnAndLane(element, placementByBoxId) {
6037
+ if (!isRecord$1(element)) return element;
6038
+ if (element.kind === "wire" && element.tone === "lane") return {
6039
+ ...element,
6040
+ tone: "plain"
6041
+ };
6042
+ if (element.kind !== "box") return element;
6043
+ const { column: _column, lane: _lane, ...freeBox } = element;
6044
+ return {
6045
+ ...freeBox,
6046
+ ...placementByBoxId.get(String(element.id))
6047
+ };
6048
+ }
6049
+ function legendWithoutLaneTone(legend) {
6050
+ if (!Array.isArray(legend)) return legend;
6051
+ return legend.map((entry) => isRecord$1(entry) && entry.tone === "lane" ? {
6052
+ ...entry,
6053
+ tone: "plain"
6054
+ } : entry);
6055
+ }
6056
+ function freeCanvasBoard(board, elements) {
6057
+ const placementByBoxId = freePlacementByBoxId(board, elements);
6058
+ const { columns: _columns, lanes: _lanes, ...freeBoard } = board;
6059
+ const freeElements = Object.fromEntries(Object.entries(elements).map(([elementId, element]) => [elementId, withoutColumnAndLane(element, placementByBoxId)]));
6060
+ return {
6061
+ ...freeBoard,
6062
+ ..."legend" in board ? { legend: legendWithoutLaneTone(board.legend) } : {},
6063
+ elements: freeElements
6064
+ };
6065
+ }
5851
6066
  function upgradedBoardRecord(raw) {
5852
6067
  const board = isRecord$1(raw) ? raw.board : null;
5853
6068
  if (!isRecord$1(raw) || !isRecord$1(board) || !isRecord$1(board.elements)) return raw;
5854
6069
  const elements = Object.fromEntries(Object.entries(elementsWithStepBoxesForUnits(board.elements)).map(([elementId, element]) => [elementId, boxForPanel(elementWithMediaForImage(element))]));
5855
6070
  return {
5856
6071
  ...raw,
5857
- board: {
5858
- ...board,
5859
- elements
5860
- }
6072
+ board: freeCanvasBoard(board, elements)
5861
6073
  };
5862
6074
  }
5863
6075
  function lowestCursor(record) {
@@ -6056,19 +6268,19 @@ var PUT_GUIDE = [
6056
6268
  "{\"op\":\"add\",\"element\":{\"kind\":\"wire\",\"id\":\"w1\",\"from\":\"parse\",\"to\":\"store\",\"dashed\":true,\"label\":\"on retry\"}},",
6057
6269
  "{\"op\":\"set\",\"id\":\"parse\",\"fields\":{\"title\":\"Parse feed\"}},{\"op\":\"remove\",\"id\":\"w1\"}]'.",
6058
6270
  "Pick the layout that fits what you draw; the example shows op syntax, not a preferred shape.",
6059
- "Element kinds: box (title, column, lane, near, at, lines, refs, change none|added|removed|relabeled, was, order, shape box|decision|panel, outputs, step {status planned|building|landed, linkedBoardId} to make it a plan step), wire (from, to, fromOutput, dashed, tone plain|fail|join|lane, label, fromSide and toSide left|right|top|bottom, back), frame (title, contains, loop), note (on, text, ref).",
6060
- "To show a picture, video or HTML page, run glimmervoid whiteboard attach <path> (PNG, JPEG, WebP, GIF, SVG, MP4, WebM or HTML) and set the media it returns on a box unchanged except alt, as in \"media\":{\"kind\":\"image\",\"asset\":\"<id>\",\"mime\":\"image/png\",\"width\":800,\"height\":600,\"alt\":\"login screen\",\"hasPreview\":false}; a picture or video first frame draws under the box lines, and a page or a video without a first frame shows as a labelled placeholder.",
6271
+ "Element kinds: box (title, near, at, lines, refs, change none|added|removed|relabeled, was, order, shape box|decision|panel, outputs, step {status planned|building|landed, linkedBoardId} to make it a plan step), wire (from, to, fromOutput, dashed, tone plain|fail|join, label, fromSide and toSide left|right|top|bottom, back), frame (title, contains, loop), note (on, text, ref).",
6272
+ "To show a picture, video, HTML page or Markdown document, run glimmervoid whiteboard attach <path> (PNG, JPEG, WebP, GIF, SVG, MP4, WebM, HTML or Markdown) and set the media it returns on a box unchanged except alt, as in \"media\":{\"kind\":\"image\",\"asset\":\"<id>\",\"mime\":\"image/png\",\"width\":800,\"height\":600,\"alt\":\"login screen\",\"hasPreview\":false}; a picture or video first frame draws under the box lines, a page or a video without a first frame shows as a labelled placeholder, and a Markdown document shows the operator its rendered text, which they can edit and save on the board.",
6061
6273
  "A line takes style text|code|item|numbered|kv; kv needs a key, as in {\"style\":\"kv\",\"key\":\"timeout\",\"text\":\"30s\"}, and numbered lines count up through each run.",
6062
6274
  "A plan step is a box with a step; a wire from one step to another means the second is built after the first, cycles allowed. A step with no place sits in the build-order band above the free drawing until moved. glimmervoid whiteboard plan add|after|status|show edits and reads them.",
6063
6275
  "A box with shape panel is a side note card for text such as prior art: with no place it stacks right of the drawing, lowest order first, until it is given one, and no box can sit near it while it is stacked.",
6064
- "Every box but a plan step or a panel needs one place: column and lane on a grid of columns and lane row bands, set by a columns op such as {\"op\":\"columns\",\"columns\":[{\"id\":\"intake\",\"title\":\"Intake\"}]} and a lanes op such as {\"op\":\"lanes\",\"lanes\":[{\"id\":\"pr1\",\"label\":\"PR 1\",\"color\":\"blue\"}]} before any box names them; near another box with near {\"of\":\"parse\",\"side\":\"right|left|top|bottom\",\"gap\":60}; or at {\"x\",\"y\"} pixels.",
6276
+ "The board is a free canvas: every box but a plan step or a panel needs one place, near another box with near {\"of\":\"parse\",\"side\":\"right|left|top|bottom\",\"gap\":60} or at {\"x\",\"y\"} pixels; build columns, rows or lanes yourself from at positions, frames and text boxes.",
6065
6277
  "A planned step whose ref files already changed, or a landed one whose ref files are unchanged or uncommitted, comes back as a warning.",
6066
6278
  "Point a box at code with refs [\"path\", \"path#L12\", \"path#L12-L30\"], relative to the board code session worktree (codeSessionId, the creating session by default); any line or note takes one ref. A ref that names no file or runs past the end comes back as a warning.",
6067
6279
  "Mark what a change does to a box with change: added and removed for parts it brings or takes away, relabeled with was set to the old title for a rename.",
6068
6280
  "A decision is a box with shape:\"decision\" and outputs [{id, label}] drawn as rows in that order; a wire with fromOutput set to an output id leaves from that row, so each branch starts at its own named exit.",
6069
6281
  "Wires route around every box on their own; set fromSide or toSide to pick where one attaches, back:true for a return edge that loops around the outside, and loop:true on a frame to mark what repeats.",
6070
6282
  "The legend lists every wire style in use on its own; a board op with legend [{tone, dashed, back, label}] renames an entry or adds one.",
6071
- "A columns op takes move {\"old-column\":\"new-column\"} to carry boxes when it drops or renames a column. A put is applied whole or refused whole.",
6283
+ "A put is applied whole or refused whole.",
6072
6284
  "glimmervoid whiteboard get <board> returns the board and a one-line summary of each change others made since this session last read it;",
6073
6285
  "add --layout to see where every box, wire and label landed, which refs need fixing, which changed files no ref covers and which referenced files the review tab calls worth a look, or run glimmervoid whiteboard render <board> --out board.svg to draw it as the dashboard does."
6074
6286
  ].join(" ");
@@ -6093,6 +6305,11 @@ function refusal$1(status, error) {
6093
6305
  }
6094
6306
  };
6095
6307
  }
6308
+ function attachedMediaUse(media) {
6309
+ if (media.kind === "doc") return "to show the operator the document, which they can edit and save on the board";
6310
+ if (media.kind === "image" || media.hasPreview) return "to draw it";
6311
+ return "to show it as a labelled placeholder until live playback ships";
6312
+ }
6096
6313
  function parseBoardRecord(raw) {
6097
6314
  const parsed = BoardRecord.safeParse(upgradedBoardRecord(raw));
6098
6315
  return parsed.success ? parsed.data : null;
@@ -6345,6 +6562,22 @@ function createWhiteboardWiring({ boardsRoot, broadcastControl = () => {}, now =
6345
6562
  changes: readsChanges ? await readChangeFacts(codeContext.buildChangeMap) : null
6346
6563
  });
6347
6564
  }
6565
+ async function readDocOf(boardId, boxId) {
6566
+ const board = recordsByBoardId.get(boardId)?.board;
6567
+ if (!board) return refusal$1(404, DELETED_BOARD_TEXT);
6568
+ const element = board.elements[boxId];
6569
+ if (element?.kind !== "box" || element.media?.kind !== "doc") return refusal$1(400, `${boxId} on board "${board.title}" holds no document; whiteboard doc reads a box whose media kind is doc`);
6570
+ const text = await assets.readDocText(element.media);
6571
+ if (text === null) return refusal$1(404, `the document ${boxId} on board "${board.title}" shows is not stored any more`);
6572
+ return {
6573
+ status: 200,
6574
+ body: {
6575
+ ok: true,
6576
+ box: boxId,
6577
+ text
6578
+ }
6579
+ };
6580
+ }
6348
6581
  async function reviewedPut(boardId, ops, author) {
6349
6582
  const reply = await putOps(boardId, ops, author);
6350
6583
  const board = recordsByBoardId.get(boardId)?.board;
@@ -6585,11 +6818,10 @@ function createWhiteboardWiring({ boardsRoot, broadcastControl = () => {}, now =
6585
6818
  if (caller.remoteWorkspace) return refusal$1(409, `attach reads files on the Glimmervoid machine, and this session runs in the Coder workspace ${caller.remoteWorkspace}, so its files are not there`);
6586
6819
  const ingested = await assets.ingestFile(path.resolve(caller.cwd ?? boardsRoot, requestedPath));
6587
6820
  if (!ingested.ok) return refusal$1(ingested.status, ingested.error);
6588
- const shownAs = ingested.media.kind === "image" || ingested.media.hasPreview ? "to draw it" : "to show it as a labelled placeholder until live playback ships";
6589
6821
  const note = `put a box with "media":${JSON.stringify({
6590
6822
  ...ingested.media,
6591
6823
  alt: "<what it shows>"
6592
- })} ${shownAs}`;
6824
+ })} ${attachedMediaUse(ingested.media)}`;
6593
6825
  return {
6594
6826
  status: 200,
6595
6827
  body: {
@@ -6702,6 +6934,7 @@ function createWhiteboardWiring({ boardsRoot, broadcastControl = () => {}, now =
6702
6934
  op: "resolve",
6703
6935
  id: request.note
6704
6936
  }], author);
6937
+ case "doc": return readDocOf(found.boardId, request.box);
6705
6938
  case "delete": return deleteOwnBoard(found.boardId, caller.id);
6706
6939
  }
6707
6940
  }