bazilion 0.58.2 → 0.59.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/dist/cli.js +16 -1
  2. package/dist/cli.js.map +1 -1
  3. package/dist/daemon.js +211 -77
  4. package/dist/daemon.js.map +1 -1
  5. package/dist/web/client/assets/AddProviderDialog-CbBtkgU7.js +1 -0
  6. package/dist/web/client/assets/{AgentTemplateParts-BaeuW_3n.js → AgentTemplateParts-Tx0RJoDa.js} +1 -1
  7. package/dist/web/client/assets/{ConfirmDialog-D8f2wI5x.js → ConfirmDialog-Du8-95Zj.js} +1 -1
  8. package/dist/web/client/assets/{ConnectionsView-BUZcfBHw.js → ConnectionsView-Dg9kLuab.js} +1 -1
  9. package/dist/web/client/assets/{SkillsParts-jMYdOiWh.js → SkillsParts-TYzEfrVu.js} +1 -1
  10. package/dist/web/client/assets/{SpawnTeamModal-Dq7D3Zlc.js → SpawnTeamModal-Dr98zpUf.js} +1 -1
  11. package/dist/web/client/assets/{TeamForm-Crz3mvXu.js → TeamForm-DaH5H-LF.js} +1 -1
  12. package/dist/web/client/assets/{TeamThread-qTkvxv27.js → TeamThread-DmtbrFq1.js} +1 -1
  13. package/dist/web/client/assets/{UnsavedChangesGuard-DGzP-x1t.js → UnsavedChangesGuard-fvP4Xr0R.js} +1 -1
  14. package/dist/web/client/assets/{_id-DsZBpW5G.js → _id--1i1fY0o.js} +1 -1
  15. package/dist/web/client/assets/{_id-CiqTBi2Q.js → _id-C_s4pMAk.js} +1 -1
  16. package/dist/web/client/assets/{access-ssWsYTEU.js → access-99X0FS-H.js} +1 -1
  17. package/dist/web/client/assets/{agents-BmkaQvWh.js → agents-CDJMwJL1.js} +1 -1
  18. package/dist/web/client/assets/{agents-D3tZ58Dh.js → agents-DVAJFWJI.js} +1 -1
  19. package/dist/web/client/assets/{attention-ChHdu7E8.js → attention-CDzRuQGN.js} +1 -1
  20. package/dist/web/client/assets/{config-DPsq6Zy9.js → config-9GESe8FI.js} +1 -1
  21. package/dist/web/client/assets/{index-CVVVmIFC.js → index-DkK2xZ2o.js} +2 -2
  22. package/dist/web/client/assets/{login-B-Kpyw9o.js → login-DUmrDZjN.js} +1 -1
  23. package/dist/web/client/assets/{manage-Dwe9yQl9.js → manage-D6zhY8hA.js} +1 -1
  24. package/dist/web/client/assets/{mcp-73AMOCv3.js → mcp-ByioWHXZ.js} +1 -1
  25. package/dist/web/client/assets/routes-DEMmBJiz.js +85 -0
  26. package/dist/web/client/assets/{skills-DmYDuDbl.js → skills-a52e5W9Z.js} +1 -1
  27. package/dist/web/client/assets/{style-B9Vy-99n.js → style-CiyV21dp.js} +1 -1
  28. package/dist/web/client/assets/styles-B-X0olFi.css +2 -0
  29. package/dist/web/client/assets/{system-t9hcqYBg.js → system-wJXOiU47.js} +1 -1
  30. package/dist/web/client/assets/{teams-5B2cyDin.js → teams-vRmMRnY_.js} +1 -1
  31. package/dist/web/client/assets/{teams-Nk_bHpr0.js → teams-wLJHtFW_.js} +1 -1
  32. package/dist/web/client/assets/telegram-CUsT8ZzL.js +1 -0
  33. package/dist/web/client/assets/{tools-mdAuMsYJ.js → tools-NMtdwKi0.js} +1 -1
  34. package/dist/web/client/assets/{usage-CWu7R8ZD.js → usage-DiIpfPPk.js} +1 -1
  35. package/dist/web/client/assets/{welcome-BuRNFxpc.js → welcome-BWN0jtZP.js} +1 -1
  36. package/dist/web/server/assets/{AddProviderDialog-Bqsz5NaL.js → AddProviderDialog-CxwjFPVY.js} +3 -3
  37. package/dist/web/server/assets/{AgentTemplateParts-D97gKNdN.js → AgentTemplateParts-CDDoX_bG.js} +5 -5
  38. package/dist/web/server/assets/{ConfigPage-CrxctbtN.js → ConfigPage-DwbP35aS.js} +2 -2
  39. package/dist/web/server/assets/{ConfirmDialog-CuD5HXTw.js → ConfirmDialog-CR_DTRpW.js} +1 -1
  40. package/dist/web/server/assets/{ConnectionsView-CSf83J-v.js → ConnectionsView-CplWLHII.js} +4 -4
  41. package/dist/web/server/assets/{Dialog-CwAfaXpM.js → Dialog-B2ZAk0JC.js} +1 -1
  42. package/dist/web/server/assets/{ManagePage-DGYNJ6XG.js → ManagePage-DSzEP6tP.js} +2 -2
  43. package/dist/web/server/assets/{ModelMenu-DEJoYASj.js → ModelMenu-BgIvpkO0.js} +1 -1
  44. package/dist/web/server/assets/{SectionTabs--vMBvaUz.js → SectionTabs-B56iIxRj.js} +1 -1
  45. package/dist/web/server/assets/{SkillsParts-hjS9a_Ht.js → SkillsParts-Bf5aGuER.js} +5 -5
  46. package/dist/web/server/assets/{SpawnDialog-BjVZl7xK.js → SpawnDialog-Fsdom-ur.js} +4 -4
  47. package/dist/web/server/assets/{SpawnTeamModal-BmBXqfFi.js → SpawnTeamModal-Zz03rkBZ.js} +4 -4
  48. package/dist/web/server/assets/{TeamForm-B4702hBg.js → TeamForm-DwXwjZWb.js} +4 -4
  49. package/dist/web/server/assets/{UnsavedChangesGuard-Be8EqfV_.js → UnsavedChangesGuard-BEtAdwza.js} +1 -1
  50. package/dist/web/server/assets/{_id-VqiN2zRR.js → _id-D1USZSkO.js} +9 -9
  51. package/dist/web/server/assets/{_id-BWtcQovD.js → _id-Dkx7QsM_.js} +1 -1
  52. package/dist/web/server/assets/{_id-DBhvSxVl.js → _id-R5F7ISnu.js} +1 -1
  53. package/dist/web/server/assets/{_id-TT_ZsaSc.js → _id-gh-ba9YO.js} +10 -10
  54. package/dist/web/server/assets/{_id-CKBQM7LH.js → _id-sS3ozDuV.js} +1 -1
  55. package/dist/web/server/assets/{_tanstack-start-manifest_v-gHDkHqeS.js → _tanstack-start-manifest_v-Be9mOSxg.js} +57 -57
  56. package/dist/web/server/assets/{access-Bog7dbtP.js → access-BcKK4G_w.js} +1 -1
  57. package/dist/web/server/assets/{access-C5lXP5JS.js → access-CftAsKX6.js} +5 -5
  58. package/dist/web/server/assets/{agents-DDUHE3eY.js → agents-BAlP1gc_.js} +8 -8
  59. package/dist/web/server/assets/{agents-8XZAjHh0.js → agents-BBQyhQz7.js} +7 -7
  60. package/dist/web/server/assets/{agents-Co6S2Ml9.js → agents-Bgo3LnIL.js} +1 -1
  61. package/dist/web/server/assets/{agents-BepbikC0.js → agents-CSMQtQCr.js} +1 -1
  62. package/dist/web/server/assets/{agents-DnUK-7qJ.js → agents-CvU8ljqt.js} +1 -1
  63. package/dist/web/server/assets/{agents-CKkMouJX.js → agents-DlxkPC-q.js} +1 -1
  64. package/dist/web/server/assets/{attention-n8edCJBL.js → attention-CHqUjESP.js} +5 -5
  65. package/dist/web/server/assets/{attention--1dBWt0c.js → attention-rfqLfyDE.js} +1 -1
  66. package/dist/web/server/assets/{config-BpwsF11b.js → config-CraGjaZB.js} +1 -1
  67. package/dist/web/server/assets/{config-UHRqSrh4.js → config-DSBJKiDX.js} +7 -7
  68. package/dist/web/server/assets/{form-Bwsyt9OY.js → form-BGif16IN.js} +2 -2
  69. package/dist/web/server/assets/{manage-C7ss0xG5.js → manage-CfDQUV7j.js} +1 -1
  70. package/dist/web/server/assets/{mcp-CUoF4jIO.js → mcp-RKq9Cj-h.js} +6 -6
  71. package/dist/web/server/assets/{mcp-COn047tO.js → mcp-VCW2SGMk.js} +1 -1
  72. package/dist/web/server/assets/{parts-B0wbj_yK.js → parts-BpwHijPN.js} +1 -1
  73. package/dist/web/server/assets/{router-yEsciAts.js → router-BER0FKkT.js} +21 -21
  74. package/dist/web/server/assets/{routes-BgjikzXy.js → routes-BYmi9O0B.js} +2 -0
  75. package/dist/web/server/assets/{routes-Bfkccvfb.js → routes-DSIwTrHI.js} +238 -91
  76. package/dist/web/server/assets/{routes-CjtC0rDs.js → routes-qtTyGHXK.js} +1 -1
  77. package/dist/web/server/assets/{skills-D5oN5ehC.js → skills-DM_Qcvqk.js} +7 -7
  78. package/dist/web/server/assets/{skills-DouMCq_2.js → skills-DZI56DdW.js} +1 -1
  79. package/dist/web/server/assets/{style-BgFXDhAR.js → style-DuiMhwn4.js} +1 -1
  80. package/dist/web/server/assets/{system-4WV2pOS4.js → system-Bx-_Vfss.js} +1 -1
  81. package/dist/web/server/assets/{system-DtGHi7X7.js → system-C_kmuned.js} +3 -3
  82. package/dist/web/server/assets/{teams-BnsbH4YW.js → teams-BL_lLFPd.js} +8 -8
  83. package/dist/web/server/assets/{teams-Blfyu8ej.js → teams-Bd6J6rHj.js} +1 -1
  84. package/dist/web/server/assets/{teams-QVxXJfo7.js → teams-CRGLRUp9.js} +1 -1
  85. package/dist/web/server/assets/{teams-gzY3tOtu.js → teams-fQEKru2G.js} +7 -7
  86. package/dist/web/server/assets/{telegram-CIbuQ5-U.js → telegram-CpHjomwG.js} +1 -1
  87. package/dist/web/server/assets/{telegram-Ctj5dqvs.js → telegram-Do0oUOXQ.js} +6 -6
  88. package/dist/web/server/assets/{tools-x_DQTQtE.js → tools-CMXn8htp.js} +5 -5
  89. package/dist/web/server/assets/{tools-Dn6RnOFu.js → tools-Ctckgev8.js} +1 -1
  90. package/dist/web/server/assets/{usage-CeiyPffw.js → usage-DaV-iwEz.js} +1 -1
  91. package/dist/web/server/assets/{usage-Dsi2V9Wh.js → usage-sZ4SFz36.js} +3 -3
  92. package/dist/web/server/assets/{welcome-C71pZOQ9.js → welcome-BhfLQBOr.js} +1 -1
  93. package/dist/web/server/assets/{welcome-A2Koo4HI.js → welcome-Dz5zfvV2.js} +3 -3
  94. package/dist/web/server/server.js +6 -6
  95. package/dist/worker.js +71 -16
  96. package/dist/worker.js.map +1 -1
  97. package/package.json +1 -1
  98. package/dist/web/client/assets/AddProviderDialog-BsUXLr-m.js +0 -1
  99. package/dist/web/client/assets/routes-Lj8n-RF7.js +0 -85
  100. package/dist/web/client/assets/styles-DyFDuWBI.css +0 -2
  101. package/dist/web/client/assets/telegram-BWfL_OIt.js +0 -1
@@ -1,12 +1,12 @@
1
1
  import { i as api, o as errorMessage } from "./live-DbJeq6KP.js";
2
2
  import { c as presetServer, s as MCP_PRESETS } from "./src-ErO6nYmi.js";
3
3
  import { t as Button } from "./Button-Dsnw22OF.js";
4
- import { n as DialogActions, t as Dialog } from "./Dialog-CwAfaXpM.js";
5
- import { t as ConfirmDialog } from "./ConfirmDialog-CuD5HXTw.js";
6
- import { a as CardForm, d as Chip, g as Notice, h as ListRow, o as CardList, r as CardBody, s as CardRow, x as Waiting, y as SetupCard } from "./parts-B0wbj_yK.js";
7
- import { d as TextField, o as SecretField, s as SelectField, t as CheckboxRow } from "./form-Bwsyt9OY.js";
8
- import { t as Route } from "./mcp-COn047tO.js";
9
- import { t as ConfigPage } from "./ConfigPage-CrxctbtN.js";
4
+ import { n as DialogActions, t as Dialog } from "./Dialog-B2ZAk0JC.js";
5
+ import { t as ConfirmDialog } from "./ConfirmDialog-CR_DTRpW.js";
6
+ import { a as CardForm, d as Chip, g as Notice, h as ListRow, o as CardList, r as CardBody, s as CardRow, x as Waiting, y as SetupCard } from "./parts-BpwHijPN.js";
7
+ import { d as TextField, o as SecretField, s as SelectField, t as CheckboxRow } from "./form-BGif16IN.js";
8
+ import { t as Route } from "./mcp-VCW2SGMk.js";
9
+ import { t as ConfigPage } from "./ConfigPage-DwbP35aS.js";
10
10
  import { useState } from "react";
11
11
  import { useRouter } from "@tanstack/react-router";
12
12
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
@@ -2,7 +2,7 @@ import { n as createServerFn } from "../server.js";
2
2
  import { t as createSsrRpc } from "./createSsrRpc-6LHNEsSK.js";
3
3
  import { createFileRoute, lazyRouteComponent } from "@tanstack/react-router";
4
4
  //#region src/routes/config/mcp.tsx
5
- var $$splitComponentImporter = () => import("./mcp-CUoF4jIO.js");
5
+ var $$splitComponentImporter = () => import("./mcp-RKq9Cj-h.js");
6
6
  var fetchServers = createServerFn({ method: "GET" }).handler(createSsrRpc("278849457893891c3d22806d15e11a0a42cc3630b30e9e62b74cf2d3b982ded7"));
7
7
  var Route = createFileRoute("/config/mcp")({
8
8
  loader: () => fetchServers(),
@@ -1,4 +1,4 @@
1
- import { p as cn } from "./ModelMenu-DEJoYASj.js";
1
+ import { m as cn } from "./ModelMenu-BgIvpkO0.js";
2
2
  import { n as usePageTitle } from "./page-title-PTpFHXWo.js";
3
3
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
4
4
  import { AlertTriangle, Check, Info, MoreHorizontal, Search, X } from "lucide-react";
@@ -4,30 +4,30 @@ import { n as agentState, r as shortTime } from "./activity-Czfq-5_F.js";
4
4
  import { h as chosenName, o as publicOriginConfig } from "./src-ErO6nYmi.js";
5
5
  import { t as AgentAvatar } from "./AgentAvatar-8gTAy_tP.js";
6
6
  import { t as Button } from "./Button-Dsnw22OF.js";
7
- import { i as restoreDialogFocus, r as getDialogFocusRestoreTarget, t as Dialog$1 } from "./Dialog-CwAfaXpM.js";
7
+ import { i as restoreDialogFocus, r as getDialogFocusRestoreTarget, t as Dialog$1 } from "./Dialog-B2ZAk0JC.js";
8
8
  import { c as parseWorkspaceSearch } from "./workspace-0XPILV1W.js";
9
9
  import { t as DAEMON_BASE_URL } from "./daemon-client-Dw3ut4pU.js";
10
10
  import { i as useAttentionCount, r as AttentionCountProvider, t as PageTitleProvider } from "./page-title-PTpFHXWo.js";
11
- import { C as PageShell } from "./parts-B0wbj_yK.js";
11
+ import { C as PageShell } from "./parts-BpwHijPN.js";
12
12
  import { a as PawIcon, i as useThemeMode, n as THEME_MODES, o as BaziuLogo, r as setThemeMode, t as Route$3 } from "./login-BJdJ219n.js";
13
- import { i as isTyping, n as NEW_CONVERSATION_EVENT, r as SHORTCUTS, t as Route$4 } from "./routes-CjtC0rDs.js";
14
- import { t as SpawnDialog } from "./SpawnDialog-BjVZl7xK.js";
15
- import { i as isSetupOpen, n as PUBLIC_PATHS, r as fetchAuthState, t as Route$5 } from "./welcome-C71pZOQ9.js";
16
- import { t as Route$6 } from "./usage-CeiyPffw.js";
17
- import { t as Route$7 } from "./teams-QVxXJfo7.js";
18
- import { t as Route$8 } from "./skills-DouMCq_2.js";
19
- import { t as Route$9 } from "./config-BpwsF11b.js";
20
- import { t as Route$10 } from "./attention--1dBWt0c.js";
21
- import { t as Route$11 } from "./agents-CKkMouJX.js";
22
- import { t as Route$12 } from "./tools-Dn6RnOFu.js";
23
- import { t as Route$13 } from "./telegram-CIbuQ5-U.js";
24
- import { t as Route$14 } from "./system-4WV2pOS4.js";
25
- import { t as Route$15 } from "./mcp-COn047tO.js";
26
- import { t as Route$16 } from "./access-Bog7dbtP.js";
27
- import { t as Route$17 } from "./teams-Blfyu8ej.js";
28
- import { t as Route$18 } from "./agents-DnUK-7qJ.js";
29
- import { t as Route$19 } from "./_id-DBhvSxVl.js";
30
- import { t as Route$20 } from "./_id-CKBQM7LH.js";
13
+ import { i as isTyping, n as NEW_CONVERSATION_EVENT, r as SHORTCUTS, t as Route$4 } from "./routes-qtTyGHXK.js";
14
+ import { t as SpawnDialog } from "./SpawnDialog-Fsdom-ur.js";
15
+ import { i as isSetupOpen, n as PUBLIC_PATHS, r as fetchAuthState, t as Route$5 } from "./welcome-BhfLQBOr.js";
16
+ import { t as Route$6 } from "./usage-DaV-iwEz.js";
17
+ import { t as Route$7 } from "./teams-CRGLRUp9.js";
18
+ import { t as Route$8 } from "./skills-DZI56DdW.js";
19
+ import { t as Route$9 } from "./config-CraGjaZB.js";
20
+ import { t as Route$10 } from "./attention-rfqLfyDE.js";
21
+ import { t as Route$11 } from "./agents-DlxkPC-q.js";
22
+ import { t as Route$12 } from "./tools-Ctckgev8.js";
23
+ import { t as Route$13 } from "./telegram-CpHjomwG.js";
24
+ import { t as Route$14 } from "./system-Bx-_Vfss.js";
25
+ import { t as Route$15 } from "./mcp-VCW2SGMk.js";
26
+ import { t as Route$16 } from "./access-BcKK4G_w.js";
27
+ import { t as Route$17 } from "./teams-Bd6J6rHj.js";
28
+ import { t as Route$18 } from "./agents-CvU8ljqt.js";
29
+ import { t as Route$19 } from "./_id-R5F7ISnu.js";
30
+ import { t as Route$20 } from "./_id-sS3ozDuV.js";
31
31
  import { useEffect, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
32
32
  import { HeadContent, Link, Outlet, Scripts, createFileRoute, createRootRoute, createRouter, redirect, useNavigate, useRouter, useRouterState } from "@tanstack/react-router";
33
33
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
@@ -1031,7 +1031,7 @@ function RosterWatcher() {
1031
1031
  }
1032
1032
  //#endregion
1033
1033
  //#region src/styles.css?url
1034
- var styles_default = "/assets/styles-DyFDuWBI.css";
1034
+ var styles_default = "/assets/styles-B-X0olFi.css";
1035
1035
  //#endregion
1036
1036
  //#region src/routes/__root.tsx
1037
1037
  var THEME_INIT_SCRIPT = `(function(){try{var t=localStorage.getItem('baziu-theme');var sd=window.matchMedia&&window.matchMedia('(prefers-color-scheme: dark)').matches;var d=t==='dark'||((t===null||t==='system')&&sd);document.documentElement.classList.toggle('dark',d);}catch(e){}})();`;
@@ -37,6 +37,8 @@ var fetchWorkspace = createServerFn({ method: "GET" }).validator((data) => data)
37
37
  selected = {
38
38
  resolved,
39
39
  messages: history.messages,
40
+ compactions: history.compactions,
41
+ context: history.context,
40
42
  head: history.head
41
43
  };
42
44
  } catch (err) {
@@ -1,27 +1,27 @@
1
1
  import { a as apiFetch, i as api, n as useLive, o as errorMessage, r as ApiError } from "./live-DbJeq6KP.js";
2
2
  import { a as useActivity, c as lineChange, i as teamSummary, l as parseArgs, o as useActivityOptional, r as shortTime, s as describeStep, t as ActivityProvider, u as summarizeSteps } from "./activity-Czfq-5_F.js";
3
3
  import { d as DEFAULT_TEAM_ID, h as chosenName, i as isTextPreview, p as REASONING_LEVELS, r as usageSummary, u as DEFAULT_PROFILE_ID } from "./src-ErO6nYmi.js";
4
- import { D as MODE_NAME, O as MODE_SENTENCE, S as slugify, _ as skillState, x as slugProblem } from "./manage-C7ss0xG5.js";
4
+ import { D as MODE_NAME, O as MODE_SENTENCE, S as slugify, _ as skillState, x as slugProblem } from "./manage-CfDQUV7j.js";
5
5
  import { n as useMediaQuery, r as useResource, t as useHydrated } from "./use-resource-BjN1uJoL.js";
6
6
  import { t as AgentAvatar } from "./AgentAvatar-8gTAy_tP.js";
7
7
  import { t as Button } from "./Button-Dsnw22OF.js";
8
- import { l as modelName, m as revealInStrip, n as ModelMenu, p as cn, t as MODELS_PATH } from "./ModelMenu-DEJoYASj.js";
9
- import { i as restoreDialogFocus, n as DialogActions, r as getDialogFocusRestoreTarget, t as Dialog$1 } from "./Dialog-CwAfaXpM.js";
10
- import { t as ConfirmDialog } from "./ConfirmDialog-CuD5HXTw.js";
8
+ import { h as revealInStrip, m as cn, n as ModelMenu, s as formatContext$1, t as MODELS_PATH, u as modelName } from "./ModelMenu-BgIvpkO0.js";
9
+ import { i as restoreDialogFocus, n as DialogActions, r as getDialogFocusRestoreTarget, t as Dialog$1 } from "./Dialog-B2ZAk0JC.js";
10
+ import { t as ConfirmDialog } from "./ConfirmDialog-CR_DTRpW.js";
11
11
  import { t as Segmented } from "./Segmented-3ZLdqa5U.js";
12
- import { t as UnsavedChangesGuard } from "./UnsavedChangesGuard-Be8EqfV_.js";
12
+ import { t as UnsavedChangesGuard } from "./UnsavedChangesGuard-BEtAdwza.js";
13
13
  import { a as trafficByPair, c as FocusFrame, d as useWorkspace, f as useWorkspaceOptional, i as pairKey, l as useTeamCounts, n as useTeamMessages, o as STATE_DOT, r as messageText, s as STATE_TEXT, t as TeamThread, u as WorkspaceProvider } from "./TeamThread-BGl5z8_I.js";
14
14
  import { a as isAgentSection, i as PANEL_TABS, l as writePanelCookie, o as isTeamSection, r as PANEL_LABELS } from "./workspace-0XPILV1W.js";
15
15
  import { i as useAttentionCount, n as usePageTitle } from "./page-title-PTpFHXWo.js";
16
- import { _ as RowMenu, a as CardForm, b as Switch, c as CardToolbar, d as Chip, f as Fact, g as Notice, h as ListRow, i as CardEmpty, n as CARD_ROW, o as CardList, p as Facts, r as CardBody, v as SearchField, w as StatusBadge, y as SetupCard } from "./parts-B0wbj_yK.js";
17
- import { a as neighbour, i as isTyping, n as NEW_CONVERSATION_EVENT, t as Route } from "./routes-CjtC0rDs.js";
18
- import { a as SaveBar, c as SelectMenu, d as TextField, f as saveStatus, l as SwitchRow, n as ChoiceCards, r as FilterSelect, s as SelectField, u as TextAreaField } from "./form-Bwsyt9OY.js";
19
- import { t as SpawnDialog } from "./SpawnDialog-BjVZl7xK.js";
16
+ import { _ as RowMenu, a as CardForm, b as Switch, c as CardToolbar, d as Chip, f as Fact, g as Notice, h as ListRow, i as CardEmpty, n as CARD_ROW, o as CardList, p as Facts, r as CardBody, v as SearchField, w as StatusBadge, y as SetupCard } from "./parts-BpwHijPN.js";
17
+ import { a as neighbour, i as isTyping, n as NEW_CONVERSATION_EVENT, t as Route } from "./routes-qtTyGHXK.js";
18
+ import { a as SaveBar, c as SelectMenu, d as TextField, f as saveStatus, l as SwitchRow, n as ChoiceCards, r as FilterSelect, s as SelectField, u as TextAreaField } from "./form-BGif16IN.js";
19
+ import { t as SpawnDialog } from "./SpawnDialog-Fsdom-ur.js";
20
20
  import { i as unarchiveAgent, n as deleteAgent, r as renameAgent, t as archiveAgent } from "./agent-actions-ChH7Mne4.js";
21
- import { t as SpawnTeamModal } from "./SpawnTeamModal-BmBXqfFi.js";
22
- import { t as TeamForm } from "./TeamForm-B4702hBg.js";
21
+ import { t as SpawnTeamModal } from "./SpawnTeamModal-Zz03rkBZ.js";
22
+ import { t as TeamForm } from "./TeamForm-DwXwjZWb.js";
23
23
  import { n as isGroupOpen, r as writeOpenGroupsCookie } from "./open-groups-lUX_YX9X.js";
24
- import { n as FindingsNotice, t as FindingLines } from "./SkillsParts-hjS9a_Ht.js";
24
+ import { n as FindingsNotice, t as FindingLines } from "./SkillsParts-Bf5aGuER.js";
25
25
  import { Fragment, Suspense, createContext, lazy, useCallback, useContext, useEffect, useId, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
26
26
  import { Link, useNavigate, useRouter } from "@tanstack/react-router";
27
27
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
@@ -3292,7 +3292,7 @@ function draftEntry(text, attachments) {
3292
3292
  * answer them grouped into one tool box. Saved results and images are deliverables, so they stand
3293
3293
  * outside the box.
3294
3294
  */
3295
- function projectMessages(messages) {
3295
+ function projectMessages(messages, compactions = []) {
3296
3296
  const entries = [];
3297
3297
  let openTool = null;
3298
3298
  const toolBox = () => {
@@ -3305,56 +3305,71 @@ function projectMessages(messages) {
3305
3305
  }
3306
3306
  return openTool;
3307
3307
  };
3308
- for (const message of messages) if (message.role === "user") {
3309
- openTool = null;
3310
- entries.push({
3311
- type: "user",
3312
- content: message.content,
3313
- ...message.images?.length ? { images: message.images } : {}
3314
- });
3315
- } else if (message.role === "assistant") {
3316
- if (message.content) {
3308
+ /** The dividers that stand before message `index`, in the order they happened. */
3309
+ const dividersAt = (index) => {
3310
+ for (const mark of compactions) {
3311
+ if (mark.index !== index) continue;
3317
3312
  openTool = null;
3318
3313
  entries.push({
3319
- type: "assistant",
3320
- content: message.content
3314
+ type: "compacted",
3315
+ mark
3321
3316
  });
3322
3317
  }
3323
- for (const call of message.toolCalls ?? []) toolBox().items.push({
3324
- kind: "call",
3325
- id: call.id,
3326
- name: call.name,
3327
- body: call.arguments
3328
- });
3329
- if (message.stopped) {
3318
+ };
3319
+ messages.forEach((message, index) => {
3320
+ dividersAt(index);
3321
+ if (message.role === "user") {
3330
3322
  openTool = null;
3331
3323
  entries.push({
3332
- type: "stopped",
3333
- reason: message.stopped
3324
+ type: "user",
3325
+ content: message.content,
3326
+ ...message.images?.length ? { images: message.images } : {}
3334
3327
  });
3335
- }
3336
- } else if (message.role === "tool") {
3337
- toolBox().items.push({
3338
- kind: /^error:/i.test(message.content) ? "error" : "result",
3339
- id: message.toolCallId ?? "",
3340
- name: message.toolName ?? "",
3341
- body: message.content
3342
- });
3343
- for (const result of message.results ?? []) {
3344
- entries.push({
3345
- type: "result",
3346
- resultId: result.resultId
3328
+ } else if (message.role === "assistant") {
3329
+ if (message.content) {
3330
+ openTool = null;
3331
+ entries.push({
3332
+ type: "assistant",
3333
+ content: message.content
3334
+ });
3335
+ }
3336
+ for (const call of message.toolCalls ?? []) toolBox().items.push({
3337
+ kind: "call",
3338
+ id: call.id,
3339
+ name: call.name,
3340
+ body: call.arguments
3347
3341
  });
3348
- openTool = null;
3349
- }
3350
- if (message.images?.length) {
3351
- entries.push({
3352
- type: "images",
3353
- images: message.images
3342
+ if (message.stopped) {
3343
+ openTool = null;
3344
+ entries.push({
3345
+ type: "stopped",
3346
+ reason: message.stopped
3347
+ });
3348
+ }
3349
+ } else if (message.role === "tool") {
3350
+ toolBox().items.push({
3351
+ kind: message.isError || /^error:/i.test(message.content) ? "error" : "result",
3352
+ id: message.toolCallId ?? "",
3353
+ name: message.toolName ?? "",
3354
+ body: message.content
3354
3355
  });
3355
- openTool = null;
3356
+ for (const result of message.results ?? []) {
3357
+ entries.push({
3358
+ type: "result",
3359
+ resultId: result.resultId
3360
+ });
3361
+ openTool = null;
3362
+ }
3363
+ if (message.images?.length) {
3364
+ entries.push({
3365
+ type: "images",
3366
+ images: message.images
3367
+ });
3368
+ openTool = null;
3369
+ }
3356
3370
  }
3357
- }
3371
+ });
3372
+ dividersAt(messages.length);
3358
3373
  return entries;
3359
3374
  }
3360
3375
  /** Pair each call with its result. A result without its call (a cut history) stands alone. */
@@ -3515,6 +3530,15 @@ function applyEvent(entries, event) {
3515
3530
  type: "result",
3516
3531
  resultId: event.result.resultId
3517
3532
  }];
3533
+ case "compaction": {
3534
+ const entry = {
3535
+ type: "compacting",
3536
+ state: event.state,
3537
+ ...event.error ? { error: event.error } : {}
3538
+ };
3539
+ const at = entries.findLastIndex((candidate) => candidate.type === "compacting");
3540
+ return at >= 0 && entries[at]?.type === "compacting" && entries[at].state === "running" ? entries.map((candidate, index) => index === at ? entry : candidate) : [...entries, entry];
3541
+ }
3518
3542
  case "error":
3519
3543
  if (event.error === "cancelled") return [...entries, {
3520
3544
  type: "stopped",
@@ -4179,10 +4203,27 @@ function LiveOutput({ output }) {
4179
4203
  children: output
4180
4204
  });
4181
4205
  }
4206
+ /**
4207
+ * The teammate a message went to: `to` is an id, the name in the list or the name the teammate
4208
+ * gave itself, as send_message takes them (in the open Agent's Team, whatever the case).
4209
+ */
4210
+ function recipientOf(workspace, to) {
4211
+ if (!workspace || !to) return void 0;
4212
+ const byId = workspace.agentById(to);
4213
+ if (byId) return byId;
4214
+ const key = to.trim().toLowerCase();
4215
+ const team = workspace.agent?.agent.teamId;
4216
+ const named = (match) => {
4217
+ const found = workspace.agents.filter((agent) => agent.teamId === team && match(agent));
4218
+ return found.length === 1 ? found[0] : void 0;
4219
+ };
4220
+ return named((agent) => agent.name.trim().toLowerCase() === key) ?? named((agent) => chosenName(agent)?.toLowerCase() === key);
4221
+ }
4182
4222
  /** Messages to teammates: who got what, and what that teammate is doing now. */
4183
4223
  function Handoffs({ steps }) {
4184
4224
  const workspace = useWorkspaceOptional();
4185
4225
  const activity = useActivityOptional();
4226
+ const sent = steps.filter((step) => step.status !== "failed").length;
4186
4227
  return /* @__PURE__ */ jsxs("div", {
4187
4228
  className: "my-3 overflow-hidden rounded-[10px] border border-border bg-muted text-sm",
4188
4229
  children: [/* @__PURE__ */ jsxs("div", {
@@ -4194,7 +4235,7 @@ function Handoffs({ steps }) {
4194
4235
  }),
4195
4236
  /* @__PURE__ */ jsx("span", {
4196
4237
  className: "font-semibold text-foreground",
4197
- children: steps.length === 1 ? "Handed off to a teammate" : `Handed off to ${steps.length} teammates`
4238
+ children: sent === 0 ? steps.length === 1 ? "Not handed off" : "Nothing handed off" : sent === 1 ? "Handed off to a teammate" : `Handed off to ${sent} teammates`
4198
4239
  }),
4199
4240
  workspace?.team && /* @__PURE__ */ jsx(Link, {
4200
4241
  to: "/",
@@ -4206,7 +4247,7 @@ function Handoffs({ steps }) {
4206
4247
  }), steps.map((step, index) => {
4207
4248
  const args = parseArgs(step.args);
4208
4249
  const to = typeof args?.to === "string" ? args.to : "";
4209
- const recipient = workspace?.agentById(to);
4250
+ const recipient = recipientOf(workspace, to);
4210
4251
  const message = typeof args?.text === "string" ? args.text : "";
4211
4252
  const state = recipient ? activity?.stateOf(recipient.id) : void 0;
4212
4253
  return /* @__PURE__ */ jsxs("div", {
@@ -4309,7 +4350,6 @@ function WrittenFiles({ paths }) {
4309
4350
  //#endregion
4310
4351
  //#region src/components/chat/Transcript.tsx
4311
4352
  var INBOX_WAKE_PREFIX = "[[bazilion:inbox-wake]]\n";
4312
- var COMPACTION_REPLAY_PREFIX = "[conversation summary]";
4313
4353
  var noSubscription = () => () => {};
4314
4354
  /**
4315
4355
  * False during SSR and the hydration pass, true afterwards. Markdown renders as escaped text until
@@ -4383,31 +4423,17 @@ function Bubble({ entry, markdownReady, onEdit, dropped = false, approvals }) {
4383
4423
  })
4384
4424
  ]
4385
4425
  });
4386
- case "assistant":
4387
- if (entry.content.startsWith(COMPACTION_REPLAY_PREFIX)) {
4388
- const summary = entry.content.slice(22).trim();
4389
- return /* @__PURE__ */ jsx("div", {
4390
- className: `my-3 border-y border-dashed border-frost py-2 text-[0.85em] italic text-mocha-light ${dropClass}`,
4391
- children: /* @__PURE__ */ jsxs("details", { children: [/* @__PURE__ */ jsx("summary", {
4392
- className: "cursor-pointer select-none text-center [&::-webkit-details-marker]:hidden",
4393
- children: "— conversation summary (click to expand) —"
4394
- }), /* @__PURE__ */ jsx("div", {
4395
- className: "md-content mt-2 rounded-sm bg-frost/40 p-2 not-italic",
4396
- dangerouslySetInnerHTML: { __html: renderMd(summary, markdownReady) }
4397
- })] })
4398
- });
4399
- }
4400
- return /* @__PURE__ */ jsxs("div", {
4401
- "data-message": "",
4402
- className: `my-4 flex flex-col items-start ${dropClass}`,
4403
- children: [/* @__PURE__ */ jsx("span", {
4404
- className: "sr-only",
4405
- children: "agent"
4406
- }), /* @__PURE__ */ jsx("div", {
4407
- className: "md-content bubble-content w-full leading-[1.55] text-chocolate",
4408
- dangerouslySetInnerHTML: { __html: renderMd(entry.content, markdownReady) }
4409
- })]
4410
- });
4426
+ case "assistant": return /* @__PURE__ */ jsxs("div", {
4427
+ "data-message": "",
4428
+ className: `my-4 flex flex-col items-start ${dropClass}`,
4429
+ children: [/* @__PURE__ */ jsx("span", {
4430
+ className: "sr-only",
4431
+ children: "agent"
4432
+ }), /* @__PURE__ */ jsx("div", {
4433
+ className: "md-content bubble-content w-full leading-[1.55] text-chocolate",
4434
+ dangerouslySetInnerHTML: { __html: renderMd(entry.content, markdownReady) }
4435
+ })]
4436
+ });
4411
4437
  case "images": return /* @__PURE__ */ jsx("div", {
4412
4438
  className: `my-2 space-y-2 ${dropClass}`,
4413
4439
  children: entry.images.map((image, index) => /* @__PURE__ */ jsx("img", {
@@ -4440,8 +4466,73 @@ function Bubble({ entry, markdownReady, onEdit, dropped = false, approvals }) {
4440
4466
  className: "my-3 rounded-r-sm border-l-[3px] border-danger bg-danger/10 px-3 py-1 text-[0.92em] text-danger",
4441
4467
  children: entry.content
4442
4468
  });
4469
+ case "compacted": return /* @__PURE__ */ jsx(CompactedDivider, {
4470
+ mark: entry.mark,
4471
+ markdownReady
4472
+ });
4473
+ case "compacting": return entry.state === "failed" ? /* @__PURE__ */ jsxs("div", {
4474
+ role: "alert",
4475
+ className: "my-3 rounded-r-sm border-l-[3px] border-danger bg-danger/10 px-3 py-1 text-[0.92em] text-danger",
4476
+ children: ["Could not summarize older messages: ", entry.error]
4477
+ }) : /* @__PURE__ */ jsxs("p", {
4478
+ role: "status",
4479
+ className: "my-2 flex items-center gap-2 px-1 text-[0.85em] text-mocha",
4480
+ children: [entry.state === "running" && /* @__PURE__ */ jsx("span", {
4481
+ className: "size-[7px] animate-pulse rounded-full bg-success",
4482
+ "aria-hidden": "true"
4483
+ }), entry.state === "running" ? "Summarizing older messages to make room…" : "Older messages summarized to make room."]
4484
+ });
4443
4485
  }
4444
4486
  }
4487
+ /**
4488
+ * Where a compaction summarized the conversation. The messages above stay for the reader; the
4489
+ * Agent reads the summary in their place.
4490
+ */
4491
+ function CompactedDivider({ mark, markdownReady }) {
4492
+ const size = formatContext$1(mark.tokensBefore);
4493
+ return /* @__PURE__ */ jsxs("details", {
4494
+ className: "group my-5 text-[0.85em] text-mocha",
4495
+ children: [/* @__PURE__ */ jsxs("summary", {
4496
+ className: "flex cursor-pointer list-none items-center gap-3 rounded-md [&::-webkit-details-marker]:hidden",
4497
+ children: [
4498
+ /* @__PURE__ */ jsx("span", {
4499
+ className: "h-px flex-1 bg-fawn",
4500
+ "aria-hidden": "true"
4501
+ }),
4502
+ /* @__PURE__ */ jsxs("span", {
4503
+ className: "min-w-0 text-center",
4504
+ children: [
4505
+ "Older messages summarized to make room",
4506
+ size ? ` (${size} tokens)` : "",
4507
+ " ·",
4508
+ " ",
4509
+ /* @__PURE__ */ jsx("span", {
4510
+ className: "font-semibold text-sapphire-deep group-open:hidden",
4511
+ children: "Show the summary"
4512
+ }),
4513
+ /* @__PURE__ */ jsx("span", {
4514
+ className: "hidden font-semibold text-sapphire-deep group-open:inline",
4515
+ children: "Hide the summary"
4516
+ })
4517
+ ]
4518
+ }),
4519
+ /* @__PURE__ */ jsx("span", {
4520
+ className: "h-px flex-1 bg-fawn",
4521
+ "aria-hidden": "true"
4522
+ })
4523
+ ]
4524
+ }), /* @__PURE__ */ jsxs("div", {
4525
+ className: "mt-2 rounded-[10px] border border-frost bg-muted px-3 py-2 text-chocolate",
4526
+ children: [/* @__PURE__ */ jsx("p", {
4527
+ className: "m-0 mb-1.5 text-[0.92em] text-mocha",
4528
+ children: "The Agent reads this summary in place of the messages above; they stay here for you."
4529
+ }), /* @__PURE__ */ jsx("div", {
4530
+ className: "md-content",
4531
+ dangerouslySetInnerHTML: { __html: renderMd(mark.summary, markdownReady) }
4532
+ })]
4533
+ })]
4534
+ });
4535
+ }
4445
4536
  var LONG_LINES = 14;
4446
4537
  var LONG_CHARS = 1400;
4447
4538
  var SHOWN_LINES = 8;
@@ -4519,12 +4610,12 @@ function TranscriptBlocks({ entries, notes = [], markdownReady, editableEntry =
4519
4610
  return /* @__PURE__ */ jsx(Fragment$1, { children: out });
4520
4611
  }
4521
4612
  /** A conversation's messages, read-only (an earlier conversation). */
4522
- function ReadOnlyTranscript({ messages }) {
4613
+ function ReadOnlyTranscript({ messages, compactions }) {
4523
4614
  const markdownReady = useMarkdownReady();
4524
4615
  return /* @__PURE__ */ jsx("section", {
4525
4616
  "aria-label": "Conversation history",
4526
4617
  children: /* @__PURE__ */ jsx(TranscriptBlocks, {
4527
- entries: projectMessages(messages),
4618
+ entries: projectMessages(messages, compactions),
4528
4619
  markdownReady
4529
4620
  })
4530
4621
  });
@@ -4736,7 +4827,7 @@ function useSessionSync({ agentId, base, initialSessionHead, onConversation, str
4736
4827
  try {
4737
4828
  const body = await api(`${base}/sessions/messages`);
4738
4829
  setHistoryUnavailable(body.head.unavailable ?? false);
4739
- onHistory(body.messages);
4830
+ onHistory(body);
4740
4831
  know(body.head);
4741
4832
  setStale(false);
4742
4833
  } catch {
@@ -4840,9 +4931,11 @@ function useSessionSync({ agentId, base, initialSessionHead, onConversation, str
4840
4931
  }
4841
4932
  //#endregion
4842
4933
  //#region src/components/chat/useChatSession.ts
4843
- function useChatSession({ agentId, initialMessages, initialSessionHead, onOpenLibrary, onConversation }) {
4934
+ function useChatSession({ agentId, initialMessages, initialCompactions = [], initialContext = null, initialSessionHead, onOpenLibrary, onConversation }) {
4844
4935
  const base = `/api/agents/${encodeURIComponent(agentId)}`;
4845
4936
  const [messages, setMessages] = useState(initialMessages);
4937
+ const [compactions, setCompactions] = useState(initialCompactions);
4938
+ const [context, setContext] = useState(initialContext);
4846
4939
  const [live, setLive] = useState([]);
4847
4940
  const [notes, setNotes] = useState([]);
4848
4941
  const [thinking, setThinking] = useState(false);
@@ -4871,7 +4964,9 @@ function useChatSession({ agentId, initialMessages, initialSessionHead, onOpenLi
4871
4964
  streamingRef,
4872
4965
  pushNote,
4873
4966
  onHistory: (saved) => {
4874
- setMessages(saved);
4967
+ setMessages(saved.messages);
4968
+ setCompactions(saved.compactions ?? []);
4969
+ setContext(saved.context ?? null);
4875
4970
  setLive([]);
4876
4971
  setEditing(false);
4877
4972
  }
@@ -4898,6 +4993,8 @@ function useChatSession({ agentId, initialMessages, initialSessionHead, onOpenLi
4898
4993
  if (frame.kind === "done") {
4899
4994
  approvalTurnRef.current = false;
4900
4995
  setMessages(frame.messages);
4996
+ if (frame.compactions) setCompactions(frame.compactions);
4997
+ if (frame.context) setContext(frame.context);
4901
4998
  setLive([]);
4902
4999
  setRecoveredTurn(false);
4903
5000
  resetApprovals();
@@ -4950,6 +5047,7 @@ function useChatSession({ agentId, initialMessages, initialSessionHead, onOpenLi
4950
5047
  return draft;
4951
5048
  }
4952
5049
  setMessages((current) => current.slice(0, keepCount));
5050
+ setCompactions((current) => current.filter((mark) => mark.index < keepCount));
4953
5051
  setEditing(false);
4954
5052
  }
4955
5053
  setLive([draftEntry(draft.text, draft.attachments)]);
@@ -5017,7 +5115,7 @@ function useChatSession({ agentId, initialMessages, initialSessionHead, onOpenLi
5017
5115
  setEditing(true);
5018
5116
  return messages[index]?.content ?? null;
5019
5117
  }
5020
- const history = projectMessages(messages);
5118
+ const history = projectMessages(messages, compactions);
5021
5119
  const entries = [...history, ...live];
5022
5120
  entryCountRef.current = entries.length;
5023
5121
  const lastUserEntry = history.findLastIndex((entry) => entry.type === "user");
@@ -5031,6 +5129,8 @@ function useChatSession({ agentId, initialMessages, initialSessionHead, onOpenLi
5031
5129
  thinking,
5032
5130
  turnBusy,
5033
5131
  agentBusy,
5132
+ /** How full the model's window is; null before the daemon has said. */
5133
+ context,
5034
5134
  editing,
5035
5135
  stale: sync.stale,
5036
5136
  recoveredTurn,
@@ -5062,13 +5162,15 @@ var CHAT_FRAME = "relative flex h-full flex-col overflow-hidden rounded-[16px] b
5062
5162
  function ChatPane(props) {
5063
5163
  return /* @__PURE__ */ jsx(AgentChat, { ...props }, props.agentId);
5064
5164
  }
5065
- function AgentChat({ agentId, agentName, initialMessages, initialSessionHead, header, onViewConversation, onConversationChange }) {
5165
+ function AgentChat({ agentId, agentName, initialMessages, initialCompactions, initialContext, initialSessionHead, header, onViewConversation, onConversationChange }) {
5066
5166
  const markdownReady = useMarkdownReady();
5067
5167
  const activity = useActivityOptional();
5068
5168
  const [conversationsOpen, setConversationsOpen] = useState(false);
5069
5169
  const chat = useChatSession({
5070
5170
  agentId,
5071
5171
  initialMessages,
5172
+ ...initialCompactions ? { initialCompactions } : {},
5173
+ ...initialContext !== void 0 ? { initialContext } : {},
5072
5174
  initialSessionHead,
5073
5175
  onOpenLibrary: () => setConversationsOpen(true),
5074
5176
  onConversation: onConversationChange
@@ -5174,6 +5276,7 @@ function AgentChat({ agentId, agentName, initialMessages, initialSessionHead, he
5174
5276
  }),
5175
5277
  header ? header({
5176
5278
  agentBusy: chat.agentBusy,
5279
+ context: chat.context,
5177
5280
  reload: chat.refreshHistory,
5178
5281
  conversationsOpen,
5179
5282
  setConversationsOpen
@@ -5676,7 +5779,7 @@ function shortModel(model) {
5676
5779
  function ConversationHeader({ agent, chat, panel, lastPanel }) {
5677
5780
  const { to } = useWorkspace();
5678
5781
  return /* @__PURE__ */ jsxs("div", {
5679
- className: "flex flex-wrap items-center gap-x-2.5 gap-y-2 border-b border-frost px-3 py-2.5 sm:flex-nowrap sm:px-4",
5782
+ className: "@container flex flex-wrap items-center gap-x-2.5 gap-y-2 border-b border-frost px-3 py-2.5 sm:flex-nowrap sm:px-4",
5680
5783
  children: [
5681
5784
  /* @__PURE__ */ jsx(Link, {
5682
5785
  to: "/",
@@ -5733,6 +5836,7 @@ function ConversationHeader({ agent, chat, panel, lastPanel }) {
5733
5836
  "aria-hidden": "true"
5734
5837
  })]
5735
5838
  }),
5839
+ chat && /* @__PURE__ */ jsx(WindowMeter, { context: chat.context }),
5736
5840
  /* @__PURE__ */ jsxs("div", {
5737
5841
  className: "ml-auto flex min-w-[7.75rem] shrink-[20] items-center justify-end gap-1.5",
5738
5842
  children: [/* @__PURE__ */ jsx(ConversationMenu, {
@@ -5756,6 +5860,44 @@ function ConversationHeader({ agent, chat, panel, lastPanel }) {
5756
5860
  ]
5757
5861
  });
5758
5862
  }
5863
+ /** Tokens as a short figure: 812, 41K, 1.2M. */
5864
+ function tokenFigure(tokens) {
5865
+ return tokens < 1e3 ? String(tokens) : formatContext$1(tokens) ?? String(tokens);
5866
+ }
5867
+ /**
5868
+ * How full the model's window is with this conversation: what the model read for its last reply.
5869
+ * Unknown after a compaction until the next reply; nothing when the model's window is unknown too.
5870
+ */
5871
+ function WindowMeter({ context }) {
5872
+ if (!context) return null;
5873
+ const { tokens, window } = context;
5874
+ if (tokens === null && window === null) return null;
5875
+ const share = tokens !== null && window ? Math.min(1, tokens / window) : null;
5876
+ const label = tokens === null ? `${tokenFigure(window ?? 0)} window` : window ? `${tokenFigure(tokens)} / ${tokenFigure(window)}` : tokenFigure(tokens);
5877
+ return /* @__PURE__ */ jsxs("span", {
5878
+ title: share === null ? "The size of this conversation shows after the next reply. Near the end of the window, older messages are summarized to make room." : `This conversation fills ${Math.round(share * 100)}% of the model's window. Near the end, older messages are summarized to make room.`,
5879
+ className: "hidden h-[26px] min-w-0 shrink-[2] items-center gap-1.5 rounded-full border border-border bg-muted px-2.5 text-xs text-mocha @min-[36rem]:inline-flex",
5880
+ ...share === null ? {} : {
5881
+ role: "meter",
5882
+ "aria-label": "Conversation size",
5883
+ "aria-valuemin": 0,
5884
+ "aria-valuemax": 100,
5885
+ "aria-valuenow": Math.round(share * 100),
5886
+ "aria-valuetext": `${label} tokens`
5887
+ },
5888
+ children: [share !== null && /* @__PURE__ */ jsx("span", {
5889
+ className: "h-1.5 w-8 shrink-0 overflow-hidden rounded-full bg-frost",
5890
+ "aria-hidden": "true",
5891
+ children: /* @__PURE__ */ jsx("span", {
5892
+ className: `block h-full rounded-full ${share >= .8 ? "bg-warning" : "bg-sapphire"}`,
5893
+ style: { width: `${Math.max(4, share * 100)}%` }
5894
+ })
5895
+ }), /* @__PURE__ */ jsx("span", {
5896
+ className: "min-w-0 truncate font-mono",
5897
+ children: label
5898
+ })]
5899
+ });
5900
+ }
5759
5901
  /** The Agent's conversations: read an earlier one, continue it, start a new one, rename. */
5760
5902
  function ConversationMenu({ agentId, chat }) {
5761
5903
  const { search, to } = useWorkspace();
@@ -6131,7 +6273,10 @@ function EarlierConversation({ agentId, agentName, conversationId, header }) {
6131
6273
  role: "alert",
6132
6274
  className: "text-sm",
6133
6275
  children: "This conversation's history is unavailable, so it cannot be read or continued."
6134
- }) : opened.data.messages.length > 0 ? /* @__PURE__ */ jsx(ReadOnlyTranscript, { messages: opened.data.messages }) : /* @__PURE__ */ jsx("p", {
6276
+ }) : opened.data.messages.length > 0 ? /* @__PURE__ */ jsx(ReadOnlyTranscript, {
6277
+ messages: opened.data.messages,
6278
+ compactions: opened.data.compactions
6279
+ }) : /* @__PURE__ */ jsx("p", {
6135
6280
  className: "py-12 text-center italic text-mocha-light",
6136
6281
  children: "This conversation is empty."
6137
6282
  }))
@@ -9754,7 +9899,7 @@ function WaitingRow({ agent, team, text }) {
9754
9899
  //#endregion
9755
9900
  //#region src/routes/index.tsx?tsr-split=component
9756
9901
  /** The rail's open/closed Teams; a bad cookie is ignored. */
9757
- var ConnectionsView = lazy(() => import("./ConnectionsView-CSf83J-v.js").then((module) => ({ default: module.ConnectionsView })));
9902
+ var ConnectionsView = lazy(() => import("./ConnectionsView-CplWLHII.js").then((module) => ({ default: module.ConnectionsView })));
9758
9903
  function WorkspacePage() {
9759
9904
  const data = Route.useLoaderData();
9760
9905
  const search = Route.useSearch();
@@ -9957,6 +10102,8 @@ function WorkspacePage() {
9957
10102
  agentId: open.agent.id,
9958
10103
  agentName: open.agent.name,
9959
10104
  initialMessages: selected.messages,
10105
+ initialCompactions: selected.compactions,
10106
+ initialContext: selected.context,
9960
10107
  initialSessionHead: selected.head,
9961
10108
  header,
9962
10109
  onViewConversation: (id) => void router.navigate({