bazilion 0.57.1 → 0.58.1

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 (135) hide show
  1. package/dist/cli.js +392 -92
  2. package/dist/cli.js.map +1 -1
  3. package/dist/daemon.js +674 -259
  4. package/dist/daemon.js.map +1 -1
  5. package/dist/web/client/assets/AddProviderDialog-DIxB5CRz.js +1 -0
  6. package/dist/web/client/assets/AgentTemplateParts-B9JD9mno.js +1 -0
  7. package/dist/web/client/assets/ConfirmDialog-D-Qk9p6V.js +1 -0
  8. package/dist/web/client/assets/ConnectionsView-Dfbn7vfB.js +1 -0
  9. package/dist/web/client/assets/SkillsParts-DN_JvpRU.js +1 -0
  10. package/dist/web/client/assets/SpawnTeamModal-Btj3My2v.js +1 -0
  11. package/dist/web/client/assets/TeamForm-BX_68QZQ.js +1 -0
  12. package/dist/web/client/assets/TeamThread-CJXudrt6.js +1 -0
  13. package/dist/web/client/assets/{UnsavedChangesGuard-CYz0AopL.js → UnsavedChangesGuard-B_e5_ck_.js} +1 -1
  14. package/dist/web/client/assets/_id-BJt13p-G.js +1 -0
  15. package/dist/web/client/assets/_id-DoP6Mlct.js +1 -0
  16. package/dist/web/client/assets/{access-BGtASxet.js → access-DnkUj0iM.js} +1 -1
  17. package/dist/web/client/assets/{agents-BAODfMcm.js → agents-CrfF2ZOS.js} +1 -1
  18. package/dist/web/client/assets/agents-Cv07gKT0.js +1 -0
  19. package/dist/web/client/assets/{attention-BIC0TL8d.js → attention-TQpP915m.js} +1 -1
  20. package/dist/web/client/assets/config-CKPln0Ng.js +1 -0
  21. package/dist/web/client/assets/index-Bwz8tnmS.js +14 -0
  22. package/dist/web/client/assets/{login-q9O7dqRe.js → login-C-FCzcQU.js} +1 -1
  23. package/dist/web/client/assets/manage-BSGsiEPw.js +1 -0
  24. package/dist/web/client/assets/mcp-DDw8SGMV.js +1 -0
  25. package/dist/web/client/assets/routes-C5KzZ73E.js +85 -0
  26. package/dist/web/client/assets/shield-alert-CO7P-cbq.js +1 -0
  27. package/dist/web/client/assets/{skills-VEtq-MQJ.js → skills-H_AVE6G7.js} +1 -1
  28. package/dist/web/client/assets/style-HG30duye.js +7 -0
  29. package/dist/web/client/assets/styles-DyFDuWBI.css +2 -0
  30. package/dist/web/client/assets/system-C7vZKVdU.js +1 -0
  31. package/dist/web/client/assets/teams-DcxoMrsV.js +1 -0
  32. package/dist/web/client/assets/teams-Dcy3Wb4u.js +1 -0
  33. package/dist/web/client/assets/telegram-CUw1r_J5.js +1 -0
  34. package/dist/web/client/assets/{tools-C0FIeAL1.js → tools-BNZxmJJk.js} +1 -1
  35. package/dist/web/client/assets/usage-BhqvXWtk.js +1 -0
  36. package/dist/web/client/assets/welcome-4H9Gvu-u.js +1 -0
  37. package/dist/web/server/assets/{AddProviderDialog-CpLDHOcA.js → AddProviderDialog-Bqsz5NaL.js} +1 -1
  38. package/dist/web/server/assets/{AgentTemplateParts-Dh9F_-T_.js → AgentTemplateParts-D97gKNdN.js} +2 -2
  39. package/dist/web/server/assets/{ConfirmDialog-C89B8qKM.js → ConfirmDialog-CuD5HXTw.js} +1 -1
  40. package/dist/web/server/assets/{ConnectionsView-DslcKQmA.js → ConnectionsView-CSf83J-v.js} +32 -10
  41. package/dist/web/server/assets/{Dialog-_Gt_Nt86.js → Dialog-CwAfaXpM.js} +5 -0
  42. package/dist/web/server/assets/{SkillsParts-CqS2B45v.js → SkillsParts-hjS9a_Ht.js} +2 -2
  43. package/dist/web/server/assets/{SpawnDialog-BNKj2Lup.js → SpawnDialog-BjVZl7xK.js} +19 -6
  44. package/dist/web/server/assets/{SpawnTeamModal-zcLxtFOO.js → SpawnTeamModal-BmBXqfFi.js} +7 -7
  45. package/dist/web/server/assets/{TeamForm-XFP0l2TB.js → TeamForm-B4702hBg.js} +2 -2
  46. package/dist/web/server/assets/{TeamThread-gYV_ToRM.js → TeamThread-BGl5z8_I.js} +40 -2
  47. package/dist/web/server/assets/{UnsavedChangesGuard-CB_TugFF.js → UnsavedChangesGuard-Be8EqfV_.js} +1 -1
  48. package/dist/web/server/assets/{_id-D4RFNqaJ.js → _id-BWtcQovD.js} +1 -1
  49. package/dist/web/server/assets/{_id-josYXBx3.js → _id-CKBQM7LH.js} +1 -1
  50. package/dist/web/server/assets/{_id-BTyd2i5U.js → _id-Cf1461pN.js} +1 -1
  51. package/dist/web/server/assets/{_id-517adSuB.js → _id-DBhvSxVl.js} +1 -1
  52. package/dist/web/server/assets/{_id-CyinHJam.js → _id-TT_ZsaSc.js} +6 -6
  53. package/dist/web/server/assets/{_id-BsQnL9LV.js → _id-VqiN2zRR.js} +35 -12
  54. package/dist/web/server/assets/{_tanstack-start-manifest_v-DIMayzEa.js → _tanstack-start-manifest_v-Df5LTm5g.js} +60 -58
  55. package/dist/web/server/assets/{access-BdQmjMJV.js → access-Bog7dbtP.js} +1 -1
  56. package/dist/web/server/assets/{access-Cc7fMMod.js → access-C5lXP5JS.js} +2 -2
  57. package/dist/web/server/assets/{access-B97-94Wt.js → access-bTlESGXh.js} +1 -1
  58. package/dist/web/server/assets/{agents-CjrkaEz8.js → agents-8XZAjHh0.js} +5 -5
  59. package/dist/web/server/assets/{agents-Tg3zkmQv.js → agents-BepbikC0.js} +1 -1
  60. package/dist/web/server/assets/{agents-BL918wVc.js → agents-CKkMouJX.js} +1 -1
  61. package/dist/web/server/assets/{agents-BzJFjA2i.js → agents-Co6S2Ml9.js} +1 -1
  62. package/dist/web/server/assets/{agents-BlUZqqJn.js → agents-DDUHE3eY.js} +17 -9
  63. package/dist/web/server/assets/{agents-uw32jPWx.js → agents-DnUK-7qJ.js} +1 -1
  64. package/dist/web/server/assets/{attention-C94WWwQe.js → attention--1dBWt0c.js} +1 -1
  65. package/dist/web/server/assets/{attention-2unmuO-q.js → attention-ColV2zMz.js} +1 -1
  66. package/dist/web/server/assets/{attention-a_OmC6L3.js → attention-n8edCJBL.js} +2 -2
  67. package/dist/web/server/assets/{auth-DuIqEAed.js → auth-Q5eVKoKR.js} +1 -1
  68. package/dist/web/server/assets/{config-BG1KOtwA.js → config-BpwsF11b.js} +1 -1
  69. package/dist/web/server/assets/{config-D1Li_7Yt2.js → config-Cfn1TU8w.js} +1 -1
  70. package/dist/web/server/assets/{config-Bhem9XER.js → config-UHRqSrh4.js} +4 -4
  71. package/dist/web/server/assets/{daemon-client-D-NWKQto.js → daemon-client-Dw3ut4pU.js} +1 -1
  72. package/dist/web/server/assets/{manage-C7ReF2ZZ.js → manage-C7ss0xG5.js} +147 -1
  73. package/dist/web/server/assets/{mcp-BFixpBQk.js → mcp-COn047tO.js} +1 -1
  74. package/dist/web/server/assets/mcp-CUoF4jIO.js +753 -0
  75. package/dist/web/server/assets/{mcp-Ceg9gzKE.js → mcp-DVjTaRq3.js} +1 -1
  76. package/dist/web/server/assets/{open-groups-C89TEK85.js → open-groups-lUX_YX9X.js} +1 -1
  77. package/dist/web/server/assets/{router-DizFxqh-.js → router-q3PwQgDH.js} +22 -22
  78. package/dist/web/server/assets/{routes-DsuaDPTO.js → routes-BgjikzXy.js} +2 -2
  79. package/dist/web/server/assets/{routes-CVrH9qgo.js → routes-DRtxA9c1.js} +1 -1
  80. package/dist/web/server/assets/{routes-D9Mw1_VV.js → routes-Do8a2liK.js} +261 -71
  81. package/dist/web/server/assets/{skills-BNbZ75am.js → skills-B--hjk-0.js} +1 -1
  82. package/dist/web/server/assets/{skills-D5rnOmKJ.js → skills-D5oN5ehC.js} +4 -4
  83. package/dist/web/server/assets/{skills-BWwEFc4a.js → skills-DouMCq_2.js} +1 -1
  84. package/dist/web/server/assets/src-ErO6nYmi.js +226 -0
  85. package/dist/web/server/assets/{start-2MvkBRdC.js → start-D4sx5Ovq.js} +1 -1
  86. package/dist/web/server/assets/style-BgFXDhAR.js +64 -0
  87. package/dist/web/server/assets/{system-Cr4C-YRw.js → system-4WV2pOS4.js} +1 -1
  88. package/dist/web/server/assets/{system-DsmXkgqn.js → system-A2Aib6JE.js} +2 -1
  89. package/dist/web/server/assets/{system-DT7AU0e6.js → system-DtGHi7X7.js} +31 -11
  90. package/dist/web/server/assets/{teams-u6m6JzuU.js → teams-BJNZ7ZsS.js} +1 -1
  91. package/dist/web/server/assets/{teams-Dix5XVIx.js → teams-Blfyu8ej.js} +1 -1
  92. package/dist/web/server/assets/{teams-DjE0swAZ.js → teams-BnsbH4YW.js} +9 -9
  93. package/dist/web/server/assets/{teams-Rk_RED7X.js → teams-GDzT7Tv0.js} +1 -1
  94. package/dist/web/server/assets/{teams-BeStcDvQ.js → teams-QVxXJfo7.js} +1 -1
  95. package/dist/web/server/assets/{teams-CsEBLW8-.js → teams-gzY3tOtu.js} +7 -7
  96. package/dist/web/server/assets/{telegram-CQpF3EHA.js → telegram-BSp9aCz6.js} +1 -1
  97. package/dist/web/server/assets/{telegram-DhzHgDfg.js → telegram-CIbuQ5-U.js} +1 -1
  98. package/dist/web/server/assets/{telegram-BjqABrl-.js → telegram-Ctj5dqvs.js} +2 -2
  99. package/dist/web/server/assets/{tools-DC69leH7.js → tools-BPhol5jb.js} +1 -1
  100. package/dist/web/server/assets/{usage-mvQegG4l.js → usage-CeiyPffw.js} +1 -1
  101. package/dist/web/server/assets/{usage-4zMG0sab.js → usage-Dsi2V9Wh.js} +2 -2
  102. package/dist/web/server/assets/{welcome-DrYbWGd_.js → welcome-A2Koo4HI.js} +3 -3
  103. package/dist/web/server/assets/{welcome-BuE9FRf4.js → welcome-C71pZOQ9.js} +1 -1
  104. package/dist/web/server/assets/{welcome-DYw35wl5.js → welcome-PxSZeoU6.js} +1 -1
  105. package/dist/web/server/server.js +20 -20
  106. package/dist/worker.js +15 -5
  107. package/dist/worker.js.map +1 -1
  108. package/package.json +1 -1
  109. package/dist/web/client/assets/AddProviderDialog-D8VvDmbM.js +0 -1
  110. package/dist/web/client/assets/AgentTemplateParts-BWorU6-F.js +0 -1
  111. package/dist/web/client/assets/ConfirmDialog-DrN26lN_.js +0 -1
  112. package/dist/web/client/assets/ConnectionsView-DcO7RJZ7.js +0 -1
  113. package/dist/web/client/assets/SkillsParts-BueR3HoP.js +0 -1
  114. package/dist/web/client/assets/SpawnTeamModal-B65eQyzu.js +0 -1
  115. package/dist/web/client/assets/TeamForm-BhI9FbjV.js +0 -1
  116. package/dist/web/client/assets/TeamThread-FPpHlVFc.js +0 -1
  117. package/dist/web/client/assets/_id-5mTcKU2j.js +0 -1
  118. package/dist/web/client/assets/_id-DKgyyyeX.js +0 -1
  119. package/dist/web/client/assets/agents-Bfwz3dl5.js +0 -1
  120. package/dist/web/client/assets/config-kMzM8kdp.js +0 -1
  121. package/dist/web/client/assets/index-DuLpyCSP.js +0 -14
  122. package/dist/web/client/assets/manage-DdCiSgG9.js +0 -1
  123. package/dist/web/client/assets/mcp-B3LzNtrr.js +0 -1
  124. package/dist/web/client/assets/routes-BDdLZEGO.js +0 -85
  125. package/dist/web/client/assets/style-J8ypSsCb.js +0 -7
  126. package/dist/web/client/assets/styles-C7NsCHeU.css +0 -2
  127. package/dist/web/client/assets/system-DtBBeAjO.js +0 -1
  128. package/dist/web/client/assets/teams-D4X9oNx8.js +0 -1
  129. package/dist/web/client/assets/teams-QlaY2Sxd.js +0 -1
  130. package/dist/web/client/assets/telegram-B7vlTQbt.js +0 -1
  131. package/dist/web/client/assets/usage-3mYfS5C-.js +0 -1
  132. package/dist/web/client/assets/welcome-CkmanVa_.js +0 -1
  133. package/dist/web/server/assets/mcp-BTZkDvdc.js +0 -379
  134. package/dist/web/server/assets/src-BeMh8Fze.js +0 -113
  135. package/dist/web/server/assets/style-B3l0Wtlf.js +0 -178
@@ -1,10 +1,10 @@
1
1
  import { i as api, o as errorMessage } from "./live-DbJeq6KP.js";
2
- import { d as agentNameProblem } from "./src-BeMh8Fze.js";
2
+ import { l as AGENT_ROLE_MAX, m as agentNameProblem } from "./src-ErO6nYmi.js";
3
3
  import { t as Button } from "./Button-Dsnw22OF.js";
4
4
  import { n as ModelMenu, t as MODELS_PATH } from "./ModelMenu-DEJoYASj.js";
5
- import { n as DialogActions, t as Dialog } from "./Dialog-_Gt_Nt86.js";
5
+ import { n as DialogActions, t as Dialog } from "./Dialog-CwAfaXpM.js";
6
6
  import { g as Notice } from "./parts-B0wbj_yK.js";
7
- import { d as TextField, s as SelectField } from "./form-Bwsyt9OY.js";
7
+ import { d as TextField, s as SelectField, u as TextAreaField } from "./form-Bwsyt9OY.js";
8
8
  import { useEffect, useState } from "react";
9
9
  import { useNavigate } from "@tanstack/react-router";
10
10
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -15,6 +15,8 @@ function SpawnDialog({ profiles, teams, profileId: initialProfileId, teamId: ini
15
15
  const [profileId, setProfileId] = useState(initialProfileId ?? profiles.find((profile) => profile.id === "default")?.id ?? profiles[0]?.id ?? "");
16
16
  const [name, setName] = useState("");
17
17
  const nameProblem = name.trim() ? agentNameProblem(name.trim()) : null;
18
+ const [role, setRole] = useState("");
19
+ const roleProblem = role.trim().length > 4e3 ? `A role is at most ${AGENT_ROLE_MAX} characters.` : void 0;
18
20
  const [model, setModel] = useState("");
19
21
  const [chatModels, setChatModels] = useState([]);
20
22
  const [teamId, setTeamId] = useState(teams.find((team) => team.id === initialTeamId)?.id ?? teams.find((team) => team.id === "default")?.id ?? teams[0]?.id ?? "");
@@ -37,6 +39,7 @@ function SpawnDialog({ profiles, teams, profileId: initialProfileId, teamId: ini
37
39
  };
38
40
  if (name.trim()) request.name = name.trim();
39
41
  if (model) request.model = model;
42
+ if (role.trim()) request.role = role.trim();
40
43
  const { agent } = await api("/api/agents", { body: request });
41
44
  onClose();
42
45
  await navigate({
@@ -79,6 +82,16 @@ function SpawnDialog({ profiles, teams, profileId: initialProfileId, teamId: ini
79
82
  className: "max-w-none",
80
83
  onChange: setName
81
84
  }),
85
+ /* @__PURE__ */ jsx(TextAreaField, {
86
+ label: "What is it for?",
87
+ value: role,
88
+ rows: 3,
89
+ disabled: busy,
90
+ placeholder: "Find small recruiting agencies in Krakow, with a source for each, and hand them to the Sales Director.",
91
+ hint: "Its job, what it delivers and to whom. It starts knowing it and gets to work, without the get-to-know questions. Leave it empty to have it ask you who it is.",
92
+ problem: roleProblem,
93
+ onChange: setRole
94
+ }),
82
95
  /* @__PURE__ */ jsx(ModelMenu, {
83
96
  kit: true,
84
97
  label: "Model",
@@ -99,13 +112,13 @@ function SpawnDialog({ profiles, teams, profileId: initialProfileId, teamId: ini
99
112
  })),
100
113
  disabled: busy,
101
114
  className: "max-w-none",
102
- hint: restricted ? "This Team is restricted: the new Agent starts with no connections. Add them under Connections." : void 0,
115
+ hint: restricted ? "In this Team messages go only along connections, and the new Agent starts with none. Add them under Connections." : void 0,
103
116
  onChange: setTeamId
104
117
  }),
105
118
  error && /* @__PURE__ */ jsx(Notice, {
106
119
  tone: "warning",
107
120
  role: "alert",
108
- title: "It was not spawned.",
121
+ title: "It was not added.",
109
122
  children: error
110
123
  }),
111
124
  /* @__PURE__ */ jsxs(DialogActions, { children: [/* @__PURE__ */ jsx(Button, {
@@ -116,7 +129,7 @@ function SpawnDialog({ profiles, teams, profileId: initialProfileId, teamId: ini
116
129
  }), /* @__PURE__ */ jsx(Button, {
117
130
  variant: "primary",
118
131
  type: "submit",
119
- disabled: busy || !profileId || !teamId || nameProblem !== null,
132
+ disabled: busy || !profileId || !teamId || nameProblem !== null || roleProblem !== void 0,
120
133
  children: busy ? "Adding…" : "Add the Agent"
121
134
  })] })
122
135
  ]
@@ -1,13 +1,13 @@
1
1
  import { i as api, o as errorMessage } from "./live-DbJeq6KP.js";
2
+ import { O as MODE_SENTENCE, S as slugify, s as count, x as slugProblem } from "./manage-C7ss0xG5.js";
2
3
  import { t as Button } from "./Button-Dsnw22OF.js";
3
- import { n as DialogActions, t as Dialog } from "./Dialog-_Gt_Nt86.js";
4
+ import { n as DialogActions, t as Dialog } from "./Dialog-CwAfaXpM.js";
4
5
  import { g as Notice } from "./parts-B0wbj_yK.js";
5
6
  import { d as TextField, n as ChoiceCards, s as SelectField } from "./form-Bwsyt9OY.js";
6
- import { S as slugify, s as count, x as slugProblem } from "./manage-C7ReF2ZZ.js";
7
7
  import { useState } from "react";
8
8
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
9
9
  //#region src/components/SpawnTeamModal.tsx
10
- /** Spawn a Team template's Agents and connections into a new Team or one that exists. */
10
+ /** Use a Team template: add its Agents and connections to a new Team or one that exists. */
11
11
  function SpawnTeamModal({ template, teams, initialTeamId = "", onClose, onSpawned }) {
12
12
  const known = teams.some((team) => team.id === initialTeamId);
13
13
  const [target, setTarget] = useState(known ? "existing" : "new");
@@ -36,7 +36,7 @@ function SpawnTeamModal({ template, teams, initialTeamId = "", onClose, onSpawne
36
36
  }
37
37
  }
38
38
  return /* @__PURE__ */ jsx(Dialog, {
39
- title: `Spawn ${template.name}`,
39
+ title: `Use ${template.name}`,
40
40
  description: `Creates ${count(template.slots.length, "Agent")} and ${count(template.edges.length, "connection")} between them.`,
41
41
  busy,
42
42
  onClose,
@@ -53,7 +53,7 @@ function SpawnTeamModal({ template, teams, initialTeamId = "", onClose, onSpawne
53
53
  options: [{
54
54
  value: "new",
55
55
  label: "A new Team",
56
- hint: `It is ${template.policyMode === "restricted" ? "restricted: members message each other along connections" : "open: members message each other freely"}, as the template is.`
56
+ hint: `${MODE_SENTENCE[template.policyMode]}, as in the template.`
57
57
  }, {
58
58
  value: "existing",
59
59
  label: "A Team that exists",
@@ -106,7 +106,7 @@ function SpawnTeamModal({ template, teams, initialTeamId = "", onClose, onSpawne
106
106
  error && /* @__PURE__ */ jsx(Notice, {
107
107
  tone: "warning",
108
108
  role: "alert",
109
- title: "The Team was not spawned.",
109
+ title: "The Agents were not added.",
110
110
  children: error
111
111
  }),
112
112
  /* @__PURE__ */ jsxs(DialogActions, { children: [/* @__PURE__ */ jsx(Button, {
@@ -118,7 +118,7 @@ function SpawnTeamModal({ template, teams, initialTeamId = "", onClose, onSpawne
118
118
  variant: "primary",
119
119
  type: "submit",
120
120
  disabled: busy || !ready,
121
- children: busy ? "Spawning…" : `Spawn ${count(template.slots.length, "Agent")}`
121
+ children: busy ? "Adding…" : `Add ${count(template.slots.length, "Agent")}`
122
122
  })] })
123
123
  ]
124
124
  })
@@ -1,9 +1,9 @@
1
1
  import { i as api, o as errorMessage } from "./live-DbJeq6KP.js";
2
+ import { S as slugify, x as slugProblem } from "./manage-C7ss0xG5.js";
2
3
  import { t as Button } from "./Button-Dsnw22OF.js";
3
- import { n as DialogActions } from "./Dialog-_Gt_Nt86.js";
4
+ import { n as DialogActions } from "./Dialog-CwAfaXpM.js";
4
5
  import { g as Notice } from "./parts-B0wbj_yK.js";
5
6
  import { d as TextField, n as ChoiceCards } from "./form-Bwsyt9OY.js";
6
- import { S as slugify, x as slugProblem } from "./manage-C7ReF2ZZ.js";
7
7
  import { useState } from "react";
8
8
  import { jsx, jsxs } from "react/jsx-runtime";
9
9
  //#region src/components/TeamForm.tsx
@@ -36,6 +36,43 @@ function useWorkspaceOptional() {
36
36
  return useContext(WorkspaceContext);
37
37
  }
38
38
  //#endregion
39
+ //#region src/components/workspace/counts.ts
40
+ /**
41
+ * How many changed files and saved files the Team has (null while unknown or not applicable), and
42
+ * whether its folder is a Git repository (null until known): Changes is offered only when it is.
43
+ */
44
+ function useTeamCounts(teamId) {
45
+ const { turnsEnded } = useActivity();
46
+ return useResource(async (signal) => {
47
+ if (!teamId) return {
48
+ changes: null,
49
+ files: null,
50
+ repository: null
51
+ };
52
+ const team = encodeURIComponent(teamId);
53
+ const [review, files] = await Promise.all([api(`/api/teams/${team}/review`, { signal }).catch(() => null), api(`/api/results?teamId=${team}&limit=1`, { signal }).then((list) => list.total).catch(() => null)]);
54
+ if (!review) return {
55
+ changes: null,
56
+ files,
57
+ repository: null
58
+ };
59
+ if ("unavailable" in review) return {
60
+ changes: null,
61
+ files,
62
+ repository: review.unavailable.code !== "not_repository"
63
+ };
64
+ return {
65
+ changes: review.changes.changes.length,
66
+ files,
67
+ repository: true
68
+ };
69
+ }, [teamId], { refreshOn: turnsEnded }).data ?? {
70
+ changes: null,
71
+ files: null,
72
+ repository: null
73
+ };
74
+ }
75
+ //#endregion
39
76
  //#region src/components/workspace/FocusFrame.tsx
40
77
  var VIEW = {
41
78
  connections: {
@@ -53,6 +90,7 @@ var VIEW = {
53
90
  };
54
91
  function FocusFrame({ view, actions, children }) {
55
92
  const { team, agent, to } = useWorkspace();
93
+ const counts = useTeamCounts(team?.id);
56
94
  return /* @__PURE__ */ jsxs("section", {
57
95
  "aria-label": `${VIEW[view].label} of ${team?.name ?? "the Team"}`,
58
96
  className: "flex h-full min-w-0 flex-col overflow-hidden rounded-[16px] border border-border bg-card shadow-baziu-sm",
@@ -82,7 +120,7 @@ function FocusFrame({ view, actions, children }) {
82
120
  /* @__PURE__ */ jsx("nav", {
83
121
  "aria-label": "Team views",
84
122
  className: "flex rounded-[12px] border border-border bg-card p-0.5",
85
- children: FOCUS_VIEWS.map((id) => {
123
+ children: FOCUS_VIEWS.filter((id) => id !== "changes" || id === view || counts.repository !== false).map((id) => {
86
124
  const Icon = VIEW[id].icon;
87
125
  const current = id === view;
88
126
  return /* @__PURE__ */ jsxs(Link, {
@@ -234,4 +272,4 @@ function TeamThread({ messages, limit = 20, empty = "No messages between Agents
234
272
  });
235
273
  }
236
274
  //#endregion
237
- export { trafficByPair as a, FocusFrame as c, useWorkspaceOptional as d, pairKey as i, WorkspaceProvider as l, useTeamMessages as n, STATE_DOT as o, messageText as r, STATE_TEXT as s, TeamThread as t, useWorkspace as u };
275
+ export { trafficByPair as a, FocusFrame as c, useWorkspace as d, useWorkspaceOptional as f, pairKey as i, useTeamCounts as l, useTeamMessages as n, STATE_DOT as o, messageText as r, STATE_TEXT as s, TeamThread as t, WorkspaceProvider as u };
@@ -1,4 +1,4 @@
1
- import { t as ConfirmDialog } from "./ConfirmDialog-C89B8qKM.js";
1
+ import { t as ConfirmDialog } from "./ConfirmDialog-CuD5HXTw.js";
2
2
  import { useCallback, useRef } from "react";
3
3
  import { useBlocker } from "@tanstack/react-router";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -1,7 +1,7 @@
1
1
  import { n as createServerFn } from "../server.js";
2
2
  import { t as MODELS_PATH } from "./ModelMenu-DEJoYASj.js";
3
3
  import { t as createServerRpc } from "./createServerRpc-B7Yr1K8i.js";
4
- import { n as daemonClient, r as ApiClientError } from "./daemon-client-D-NWKQto.js";
4
+ import { n as daemonClient, r as ApiClientError } from "./daemon-client-Dw3ut4pU.js";
5
5
  //#region src/routes/templates/agents/$id/index.tsx?tss-serverfn-split
6
6
  var fetchTemplate_createServerFn_handler = createServerRpc({
7
7
  id: "a3ce4c3b27c4c69828cf8a81d1f5312a9f8e2c82de6c7e6e2846eb5c2fc322ea",
@@ -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, redirect } from "@tanstack/react-router";
4
4
  //#region src/routes/templates/agents/$id/index.tsx
5
- var $$splitComponentImporter = () => import("./_id-CyinHJam.js");
5
+ var $$splitComponentImporter = () => import("./_id-TT_ZsaSc.js");
6
6
  var fetchTemplate = createServerFn({ method: "GET" }).validator((data) => data).handler(createSsrRpc("a3ce4c3b27c4c69828cf8a81d1f5312a9f8e2c82de6c7e6e2846eb5c2fc322ea"));
7
7
  var Route = createFileRoute("/templates/agents/$id/")({
8
8
  loader: async ({ params }) => {
@@ -1,6 +1,6 @@
1
1
  import { n as createServerFn } from "../server.js";
2
2
  import { t as createServerRpc } from "./createServerRpc-B7Yr1K8i.js";
3
- import { n as daemonClient, r as ApiClientError } from "./daemon-client-D-NWKQto.js";
3
+ import { n as daemonClient, r as ApiClientError } from "./daemon-client-Dw3ut4pU.js";
4
4
  //#region src/routes/templates/teams/$id/index.tsx?tss-serverfn-split
5
5
  var fetchTemplate_createServerFn_handler = createServerRpc({
6
6
  id: "c13d90cf82cd448c86427091165d0361b92843852a3f73a5bf4412dd2adc6bae",
@@ -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, redirect } from "@tanstack/react-router";
4
4
  //#region src/routes/templates/teams/$id/index.tsx
5
- var $$splitComponentImporter = () => import("./_id-BsQnL9LV.js");
5
+ var $$splitComponentImporter = () => import("./_id-VqiN2zRR.js");
6
6
  var fetchTemplate = createServerFn({ method: "GET" }).validator((data) => data).handler(createSsrRpc("c13d90cf82cd448c86427091165d0361b92843852a3f73a5bf4412dd2adc6bae"));
7
7
  var Route = createFileRoute("/templates/teams/$id/")({
8
8
  loader: async ({ params }) => {
@@ -1,15 +1,15 @@
1
1
  import { i as api, o as errorMessage } from "./live-DbJeq6KP.js";
2
+ import { E as templateUseLine, T as templateName, d as modelLine, w as templateDeleteBlocker } from "./manage-C7ss0xG5.js";
2
3
  import { t as Button } from "./Button-Dsnw22OF.js";
3
4
  import { n as ModelMenu, p as cn } from "./ModelMenu-DEJoYASj.js";
4
- import { t as ConfirmDialog } from "./ConfirmDialog-C89B8qKM.js";
5
- import { t as UnsavedChangesGuard } from "./UnsavedChangesGuard-CB_TugFF.js";
5
+ import { t as ConfirmDialog } from "./ConfirmDialog-CuD5HXTw.js";
6
+ import { t as UnsavedChangesGuard } from "./UnsavedChangesGuard-Be8EqfV_.js";
6
7
  import { _ as RowMenu, a as CardForm, c as CardToolbar, t as Banner, y as SetupCard } from "./parts-B0wbj_yK.js";
7
8
  import { a as SaveBar, d as TextField, f as saveStatus } from "./form-Bwsyt9OY.js";
8
- import { t as SpawnDialog } from "./SpawnDialog-BNKj2Lup.js";
9
- import { t as Route } from "./_id-josYXBx3.js";
9
+ import { t as SpawnDialog } from "./SpawnDialog-BjVZl7xK.js";
10
+ import { t as Route } from "./_id-CKBQM7LH.js";
10
11
  import { t as ManagePage } from "./ManagePage-DGYNJ6XG.js";
11
- import { E as templateUseLine, T as templateName, d as modelLine, w as templateDeleteBlocker } from "./manage-C7ReF2ZZ.js";
12
- import { n as SkillsChoice, r as TEMPLATE_FILES } from "./AgentTemplateParts-Dh9F_-T_.js";
12
+ import { n as SkillsChoice, r as TEMPLATE_FILES } from "./AgentTemplateParts-D97gKNdN.js";
13
13
  import { useCallback, useEffect, useRef, useState } from "react";
14
14
  import { useNavigate, useRouter } from "@tanstack/react-router";
15
15
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
@@ -1,15 +1,15 @@
1
1
  import { i as api, o as errorMessage } from "./live-DbJeq6KP.js";
2
- import { a as endpointLabel, d as templateDocument, f as templateInput, i as edgeKey, l as sameDocument, n as OUTSIDE, o as hasEdge, r as defaultPosition, t as TeamPolicyMatrix, u as setEdge } from "./style-B3l0Wtlf.js";
2
+ import { A as SWITCH_QUESTION, B as switchAndConnect, D as MODE_NAME, F as hasEdge, H as templateInput, M as defaultPosition, N as edgeKey, P as endpointLabel, R as sameDocument, V as templateDocument, j as connectionNeedsSwitch, k as OUTSIDE, s as count, z as setEdge } from "./manage-C7ss0xG5.js";
3
3
  import { t as Button } from "./Button-Dsnw22OF.js";
4
- import { t as ConfirmDialog } from "./ConfirmDialog-C89B8qKM.js";
4
+ import { t as ConfirmDialog } from "./ConfirmDialog-CuD5HXTw.js";
5
5
  import { t as Segmented } from "./Segmented-3ZLdqa5U.js";
6
- import { t as UnsavedChangesGuard } from "./UnsavedChangesGuard-CB_TugFF.js";
6
+ import { t as TeamPolicyMatrix } from "./style-BgFXDhAR.js";
7
+ import { t as UnsavedChangesGuard } from "./UnsavedChangesGuard-Be8EqfV_.js";
7
8
  import { _ as RowMenu, g as Notice } from "./parts-B0wbj_yK.js";
8
9
  import { d as TextField, l as SwitchRow, s as SelectField } from "./form-Bwsyt9OY.js";
9
- import { t as Route } from "./_id-517adSuB.js";
10
+ import { t as Route } from "./_id-DBhvSxVl.js";
10
11
  import { t as ManagePage } from "./ManagePage-DGYNJ6XG.js";
11
- import { s as count } from "./manage-C7ReF2ZZ.js";
12
- import { t as SpawnTeamModal } from "./SpawnTeamModal-zcLxtFOO.js";
12
+ import { t as SpawnTeamModal } from "./SpawnTeamModal-BmBXqfFi.js";
13
13
  import { useEffect, useMemo, useState } from "react";
14
14
  import { useNavigate, useRouter } from "@tanstack/react-router";
15
15
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
@@ -223,7 +223,7 @@ function TeamPolicyFlow({ document, selectedId, incompleteKeys, templateNames =
223
223
  //#endregion
224
224
  //#region src/components/team-policy/TeamPolicyEditor.tsx
225
225
  var MODE_HELP = {
226
- open: "Members message each other freely; connections only matter for messages to and from other Teams.",
226
+ open: "Every member can message every other member, with no connections needed; connections only matter for messages to and from other Teams, or if the Team is set to Connections only.",
227
227
  restricted: "Members message each other only along connections."
228
228
  };
229
229
  /** A Team template's roster and connections, as a flow or a matrix. */
@@ -239,7 +239,17 @@ function TeamPolicyEditor({ template, profiles, onSaved, onDirtyChange }) {
239
239
  useEffect(() => onDirtyChange?.(dirty), [dirty, onDirtyChange]);
240
240
  const incomplete = useMemo(() => new Set(draft.members.filter((member) => !profiles.some((profile) => profile.id === member.profileId)).map((member) => member.key)), [draft.members, profiles]);
241
241
  const templateNames = useMemo(() => Object.fromEntries(profiles.map((profile) => [profile.id, `${profile.name || profile.id} template`])), [profiles]);
242
- const toggle = (from, to, allowed) => setDraft((current) => setEdge(current, from, to, allowed));
242
+ const [proposed, setProposed] = useState(null);
243
+ const toggle = (from, to, allowed) => {
244
+ if (connectionNeedsSwitch(draft, from, to, allowed)) {
245
+ setProposed({
246
+ from,
247
+ to
248
+ });
249
+ return;
250
+ }
251
+ setDraft((current) => setEdge(current, from, to, allowed));
252
+ };
243
253
  const save = async () => {
244
254
  setSaving(true);
245
255
  setNotice(null);
@@ -306,10 +316,10 @@ function TeamPolicyEditor({ template, profiles, onSaved, onDirtyChange }) {
306
316
  })),
307
317
  options: [{
308
318
  id: "open",
309
- label: "Open"
319
+ label: MODE_NAME.open
310
320
  }, {
311
321
  id: "restricted",
312
- label: "Restricted"
322
+ label: MODE_NAME.restricted
313
323
  }]
314
324
  })]
315
325
  }),
@@ -399,6 +409,19 @@ function TeamPolicyEditor({ template, profiles, onSaved, onDirtyChange }) {
399
409
  })
400
410
  ]
401
411
  }),
412
+ /* @__PURE__ */ jsx(ConfirmDialog, {
413
+ open: proposed !== null,
414
+ title: SWITCH_QUESTION.title,
415
+ description: /* @__PURE__ */ jsx("p", { children: SWITCH_QUESTION.description }),
416
+ confirmLabel: SWITCH_QUESTION.confirm,
417
+ onConfirm: () => {
418
+ if (proposed) setDraft((current) => switchAndConnect(current, proposed.from, proposed.to));
419
+ setProposed(null);
420
+ },
421
+ onOpenChange: (open) => {
422
+ if (!open) setProposed(null);
423
+ }
424
+ }),
402
425
  /* @__PURE__ */ jsx(ConfirmDialog, {
403
426
  open: confirmDiscard,
404
427
  title: "Discard your changes to this template?",
@@ -581,13 +604,13 @@ function TeamTemplatePage() {
581
604
  const [unsaved, setUnsaved] = useState(false);
582
605
  return /* @__PURE__ */ jsxs(ManagePage, {
583
606
  title: template.name,
584
- description: `A roster of ${count(template.slots.length, "Agent")} and ${count(template.edges.length, "connection")}. Spawning it creates them in a new Team or one that exists; Teams already spawned keep their own.`,
607
+ description: `A roster of ${count(template.slots.length, "Agent")} and ${count(template.edges.length, "connection")}. Using it adds them to a new Team or one that exists; Teams made from it earlier keep their own.`,
585
608
  actions: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Button, {
586
609
  variant: "primary",
587
610
  disabled: template.slots.length === 0 || unsaved,
588
611
  "aria-describedby": unsaved ? "spawn-needs-save" : void 0,
589
612
  onClick: () => setSpawning(true),
590
- children: "Spawn this Team"
613
+ children: "Use this template"
591
614
  }), /* @__PURE__ */ jsx(RowMenu, {
592
615
  label: `More for ${template.name}`,
593
616
  items: [{