bazilion 0.51.0 → 0.53.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.
- package/dist/cli.js +74 -28
- package/dist/cli.js.map +1 -1
- package/dist/daemon.js +547 -187
- package/dist/daemon.js.map +1 -1
- package/dist/web/client/assets/AddProviderDialog-CO_uijWF.js +1 -0
- package/dist/web/client/assets/AgentTemplateParts-Dl35c-Ux.js +1 -0
- package/dist/web/client/assets/ConfigPage-DiQiJXP6.js +1 -0
- package/dist/web/client/assets/ConfirmDialog-BVytx3kN.js +1 -0
- package/dist/web/client/assets/ConnectionsView-DDrBaiLg.js +1 -0
- package/dist/web/client/assets/Dialog-BTDzv3J5.js +1 -0
- package/dist/web/client/assets/ManagePage-xlePXXx5.js +1 -0
- package/dist/web/client/assets/SectionTabs-BMiRKFfb.js +1 -0
- package/dist/web/client/assets/Segmented-Co4n2C5X.js +1 -0
- package/dist/web/client/assets/SpawnDialog-ejwXnyxy.js +1 -0
- package/dist/web/client/assets/SpawnTeamModal-Cp-nAvIC.js +1 -0
- package/dist/web/client/assets/TeamForm-Cz9uDVvb.js +1 -0
- package/dist/web/client/assets/TeamThread-D8xqE_gb.js +1 -0
- package/dist/web/client/assets/UnsavedChangesGuard-DmT4nBQU.js +1 -0
- package/dist/web/client/assets/_id-DEQxwq2v.js +1 -0
- package/dist/web/client/assets/_id-DSRgpxEc.js +1 -0
- package/dist/web/client/assets/access-34_ShgHU.js +1 -0
- package/dist/web/client/assets/agent-actions--EO4yJ4Q.js +1 -0
- package/dist/web/client/assets/agents-C87yBHaR.js +1 -0
- package/dist/web/client/assets/agents-DvCSl1Ro.js +1 -0
- package/dist/web/client/assets/api-CoLs57oO.js +1 -0
- package/dist/web/client/assets/arrow-right-BhTWtC9z.js +1 -0
- package/dist/web/client/assets/attention-CteEeRvX.js +1 -0
- package/dist/web/client/assets/chevron-right-BqOIX9UM.js +1 -0
- package/dist/web/client/assets/config-XJuQeEP4.js +1 -0
- package/dist/web/client/assets/createLucideIcon-dN8ooBD1.js +1 -0
- package/dist/web/client/assets/download-Dj-1ltZb.js +1 -0
- package/dist/web/client/assets/file-text-DiP-LaEg.js +1 -0
- package/dist/web/client/assets/form-Bvr_f9lR.js +1 -0
- package/dist/web/client/assets/images-BKjyhYUc.js +1 -0
- package/dist/web/client/assets/index-J_Uqj4md.js +54 -0
- package/dist/web/client/assets/key-round-QpqZklz6.js +1 -0
- package/dist/web/client/assets/list-checks-BeyG5SVQ.js +1 -0
- package/dist/web/client/assets/login-076Bc601.js +1 -0
- package/dist/web/client/assets/manage-CsrV2hhK.js +1 -0
- package/dist/web/client/assets/mcp-8N0BqZ0G.js +1 -0
- package/dist/web/client/assets/message-square-DnpSOYv4.js +1 -0
- package/dist/web/client/assets/model-facts-DoB6QD5y.js +1 -0
- package/dist/web/client/assets/network-BC7rNaOC.js +1 -0
- package/dist/web/client/assets/parts-B0JBolvG.js +1 -0
- package/dist/web/client/assets/plus-DZ3KVo7E.js +1 -0
- package/dist/web/client/assets/routes-3HkZZOOe.js +76 -0
- package/dist/web/client/assets/skills-DiaqZRXT.js +1 -0
- package/dist/web/client/assets/square-terminal-hQZ6pexU.js +1 -0
- package/dist/web/client/assets/style-BtcFIkOS.js +7 -0
- package/dist/web/client/assets/styles-C7Ztw15K.css +2 -0
- package/dist/web/client/assets/system-YWlJ8ogO.js +1 -0
- package/dist/web/client/assets/teams-DQwceMvk.js +1 -0
- package/dist/web/client/assets/teams-DTC3plIH.js +1 -0
- package/dist/web/client/assets/telegram-D4wINntt.js +1 -0
- package/dist/web/client/assets/tools-CZeQ9pDx.js +1 -0
- package/dist/web/client/assets/use-resource-BaTkTGvG.js +1 -0
- package/dist/web/client/assets/welcome-CnxP_RCk.js +1 -0
- package/dist/web/client/assets/wrench-BrwBswfo.js +1 -0
- package/dist/web/server/assets/{AddProviderDialog-CR6TRYdZ.js → AddProviderDialog-Di5crZUB.js} +9 -205
- package/dist/web/server/assets/AgentTemplateParts-Cqy7kSzx.js +269 -0
- package/dist/web/server/assets/{ConfigPage-CIh3ohea.js → ConfigPage-oXM3wyOU.js} +2 -2
- package/dist/web/server/assets/{ConfirmDialog-B79K2KEW.js → ConfirmDialog-DfaJ--A6.js} +2 -2
- package/dist/web/server/assets/{ConnectionsView-BIMYdp9C.js → ConnectionsView-DZrLoNoW.js} +7 -7
- package/dist/web/server/assets/{Dialog-CVqpXxuN.js → Dialog-aup_yJv5.js} +1 -1
- package/dist/web/server/assets/ManagePage-0LKHEcT_.js +29 -0
- package/dist/web/server/assets/ModelMenu-BAZeARx6.js +138 -0
- package/dist/web/server/assets/{Rail-Cg-efcpA.js → Rail-7JU6ly2O.js} +17 -107
- package/dist/web/server/assets/{SectionTabs-DrcgVeZd.js → SectionTabs-CWQ5orUW.js} +12 -5
- package/dist/web/server/assets/SpawnDialog-CYkwzETs.js +124 -0
- package/dist/web/server/assets/SpawnTeamModal-CCe6P82H.js +127 -0
- package/dist/web/server/assets/TeamForm-BzQmdhVi.js +141 -0
- package/dist/web/server/assets/{TeamThread-5CjVPcDr.js → TeamThread-SyQpUvz5.js} +3 -3
- package/dist/web/server/assets/{UnsavedChangesGuard-CyF2Z9p1.js → UnsavedChangesGuard-DrOvPV14.js} +1 -1
- package/dist/web/server/assets/_id-AcyGvFrE.js +400 -0
- package/dist/web/server/assets/{_id-8bsYEcGg.js → _id-BGTgqsWm.js} +8 -4
- package/dist/web/server/assets/{_id-TVruGcOd.js → _id-BKzOw78O.js} +11 -3
- package/dist/web/server/assets/{_id-0fEWiVZX.js → _id-DPGzfmjG.js} +258 -206
- package/dist/web/server/assets/_id-DXm9W55C.js +16 -0
- package/dist/web/server/assets/_id-DojvxRZn.js +39 -0
- package/dist/web/server/assets/_tanstack-start-manifest_v-D7RvKGRH.js +285 -0
- package/dist/web/server/assets/{tokens-C-oDTqnp.js → access-BJe-NduL.js} +5 -5
- package/dist/web/server/assets/access-CKSW7MFH.js +297 -0
- package/dist/web/server/assets/{tokens-CEdl8puR.js → access-WWspT0v4.js} +5 -4
- package/dist/web/server/assets/agent-actions-CUDMCG0F.js +20 -0
- package/dist/web/server/assets/agents-1sjSvp5p.js +12 -0
- package/dist/web/server/assets/{agents-BnWgFo6o.js → agents-6d9WxbYF.js} +9 -6
- package/dist/web/server/assets/agents-DKVGUwD1.js +31 -0
- package/dist/web/server/assets/agents-DUI4Yjtg.js +13 -0
- package/dist/web/server/assets/agents-DsHeRaLq.js +327 -0
- package/dist/web/server/assets/agents-DtLDoZ_u.js +136 -0
- package/dist/web/server/assets/{attention-Cr7puThv.js → attention-B6sSDR_4.js} +2 -1
- package/dist/web/server/assets/{attention-CHQEQiZl.js → attention-DefKwvgm.js} +2 -2
- package/dist/web/server/assets/attention-johfkM0_.js +203 -0
- package/dist/web/server/assets/{config-DOp28gcy.js → config-Clz57LuN.js} +186 -87
- package/dist/web/server/assets/{config-DzgkbBoD.js → config-DYAaaE9Z.js} +2 -2
- package/dist/web/server/assets/{createSsrRpc-CcLbajrF.js → createSsrRpc-BijMHgqE.js} +2 -46
- package/dist/web/server/assets/form-BRQAsKKq.js +319 -0
- package/dist/web/server/assets/manage-Ppyi3Y5y.js +230 -0
- package/dist/web/server/assets/mcp-Ce6O8Qs2.js +378 -0
- package/dist/web/server/assets/{mcp-D3OCoHtO.js → mcp-DB38leWS.js} +2 -2
- package/dist/web/server/assets/model-facts-mrfrWQne.js +136 -0
- package/dist/web/server/assets/parts-mabERIJZ.js +380 -0
- package/dist/web/server/assets/{router-Cs2Ak4II.js → router-C97bwlXi.js} +55 -50
- package/dist/web/server/assets/{routes-BSNOKE-C.js → routes-C4aGqXfr.js} +65 -17
- package/dist/web/server/assets/{routes-CO4l-GJ0.js → routes-DuOShl4q.js} +2 -2
- package/dist/web/server/assets/{routes-BVwqgZGI.js → routes-IHMVKpDK.js} +3 -3
- package/dist/web/server/assets/{skills-CggQJk6a.js → skills-B7sg0QKS.js} +2 -2
- package/dist/web/server/assets/{skills-h5aHa7Q8.js → skills-DWzlT_hC.js} +9 -1
- package/dist/web/server/assets/skills-hfTSwqsG.js +353 -0
- package/dist/web/server/assets/{style-GYDODk2F.js → style-BR7ufS6Z.js} +1 -1
- package/dist/web/server/assets/system-CNQpt3JB.js +145 -0
- package/dist/web/server/assets/{system-DtswhLW62.js → system-D3th6n2E.js} +4 -2
- package/dist/web/server/assets/{system-DsJfpBPl.js → system-DaP0ol67.js} +2 -2
- package/dist/web/server/assets/{teams-B6lBhvdL.js → teams-4cEZ4_rw.js} +4 -2
- package/dist/web/server/assets/{teams-BxnvFTyn.js → teams-70u1XQTr.js} +1 -3
- package/dist/web/server/assets/teams-BKHe67f3.js +176 -0
- package/dist/web/server/assets/{teams-YrmyutM4.js → teams-BopOP4x7.js} +8 -1
- package/dist/web/server/assets/teams-C3xwTz8-.js +219 -0
- package/dist/web/server/assets/{teams-Bp2tERZe.js → teams-CuKE5iAK.js} +2 -2
- package/dist/web/server/assets/{telegram-D2RZriz_.js → telegram-BnQADwnj.js} +5 -5
- package/dist/web/server/assets/telegram-BpmK-HHV.js +1059 -0
- package/dist/web/server/assets/{telegram-Gy7_9yih.js → telegram-CGol0CKX.js} +3 -3
- package/dist/web/server/assets/tools-BQeWn7Tj.js +12 -0
- package/dist/web/server/assets/tools-C-wwWjLI.js +12 -0
- package/dist/web/server/assets/tools-CURTfG2q.js +341 -0
- package/dist/web/server/assets/{use-resource-ChQozXVI.js → use-resource-DVzK0toP.js} +1 -1
- package/dist/web/server/assets/utils-C_uf36nf.js +8 -0
- package/dist/web/server/assets/{welcome-BLw1G6SS.js → welcome-OiZCAIHZ.js} +5 -5
- package/dist/web/server/assets/{welcome-ByAkvHSP.js → welcome-SNsE49JO.js} +2 -2
- package/dist/web/server/assets/{workspace-DeEYMPDX.js → workspace-DaitCM0t.js} +1 -8
- package/dist/web/server/server.js +30 -30
- package/dist/worker.js +202 -120
- package/dist/worker.js.map +1 -1
- package/package.json +1 -1
- package/dist/web/client/assets/AddProviderDialog-Diic36c_.js +0 -1
- package/dist/web/client/assets/ConfigPage-pupvtSCX.js +0 -1
- package/dist/web/client/assets/ConfirmDialog-GFDcHI1L.js +0 -1
- package/dist/web/client/assets/ConnectionsView-y1CeY-6U.js +0 -1
- package/dist/web/client/assets/Dialog-bg86_x4v.js +0 -1
- package/dist/web/client/assets/FieldRow-B8eIni5r.js +0 -1
- package/dist/web/client/assets/ModelSelect-DvCLUmkW.js +0 -1
- package/dist/web/client/assets/SectionTabs-D4ezA6U4.js +0 -1
- package/dist/web/client/assets/Segmented-Dh77vmpp.js +0 -1
- package/dist/web/client/assets/SkillFindings-BzLO1lNA.js +0 -1
- package/dist/web/client/assets/SkillsPicker-hI3YXvib.js +0 -1
- package/dist/web/client/assets/SpawnDialog-YJX6UMBC.js +0 -1
- package/dist/web/client/assets/Tabs-f6bHvCGn.js +0 -1
- package/dist/web/client/assets/TeamForm-kda1HYZG.js +0 -1
- package/dist/web/client/assets/TeamThread-DFvbakHo.js +0 -1
- package/dist/web/client/assets/UnsavedChangesGuard-DBJikVgc.js +0 -1
- package/dist/web/client/assets/_id-BjNtLwak.js +0 -1
- package/dist/web/client/assets/_id-BklaQf3z.js +0 -1
- package/dist/web/client/assets/agents-D9cUF2d9.js +0 -1
- package/dist/web/client/assets/agents-wuBlzx4e.js +0 -1
- package/dist/web/client/assets/api-HC_YzjBy.js +0 -1
- package/dist/web/client/assets/arrow-right-Gm_FDWJ_.js +0 -1
- package/dist/web/client/assets/attention-8ZkSLl2e.js +0 -1
- package/dist/web/client/assets/check-BjgKoGvU.js +0 -1
- package/dist/web/client/assets/config-Con_BbSh.js +0 -1
- package/dist/web/client/assets/createLucideIcon-C6gOo8sD.js +0 -1
- package/dist/web/client/assets/index-Br9qkGM-.js +0 -54
- package/dist/web/client/assets/link-Cbztlp_R.js +0 -1
- package/dist/web/client/assets/login-llnOKSJc.js +0 -1
- package/dist/web/client/assets/mcp-zIUguMSI.js +0 -1
- package/dist/web/client/assets/plus-CWrKMtvA.js +0 -1
- package/dist/web/client/assets/routes-BY5uqJ2n.js +0 -76
- package/dist/web/client/assets/save-f9O-CQia.js +0 -1
- package/dist/web/client/assets/services-esLrcTwe.js +0 -1
- package/dist/web/client/assets/skills-DzYXksM0.js +0 -1
- package/dist/web/client/assets/style-Cdzqt_TJ.js +0 -7
- package/dist/web/client/assets/styles-BRSS6yrm.css +0 -2
- package/dist/web/client/assets/system-CsI66nyZ.js +0 -1
- package/dist/web/client/assets/teams-CHE_zpxS.js +0 -1
- package/dist/web/client/assets/teams-dxG9OESG.js +0 -1
- package/dist/web/client/assets/telegram-C3dGndJV.js +0 -1
- package/dist/web/client/assets/tokens-CNNH-Wr9.js +0 -1
- package/dist/web/client/assets/use-resource-BjnxgGvh.js +0 -1
- package/dist/web/client/assets/welcome-C8EOtc8P.js +0 -1
- package/dist/web/server/assets/FieldRow-CHVhX2rS.js +0 -173
- package/dist/web/server/assets/ModelSelect-DrZrdndo.js +0 -43
- package/dist/web/server/assets/SkillFindings-DSDiL6hn.js +0 -46
- package/dist/web/server/assets/SkillsPicker-DlqEfRWh.js +0 -67
- package/dist/web/server/assets/SpawnDialog-BUUlLxE9.js +0 -129
- package/dist/web/server/assets/Tabs-BhF41MfQ.js +0 -20
- package/dist/web/server/assets/TeamForm-CvQAs2FA.js +0 -96
- package/dist/web/server/assets/_id-BvAaRSUW.js +0 -18
- package/dist/web/server/assets/_id-Dg6M_qfr.js +0 -383
- package/dist/web/server/assets/_id-Dji7xr9C.js +0 -28
- package/dist/web/server/assets/_tanstack-start-manifest_v-sxiIH4M7.js +0 -214
- package/dist/web/server/assets/agents-BDA5yYZ2.js +0 -130
- package/dist/web/server/assets/agents-BTDxmp-F.js +0 -12
- package/dist/web/server/assets/agents-DM7guWF2.js +0 -14
- package/dist/web/server/assets/agents-DktqUffG.js +0 -327
- package/dist/web/server/assets/agents-xgZ9rsac.js +0 -27
- package/dist/web/server/assets/attention-De3-ehuf.js +0 -216
- package/dist/web/server/assets/mcp-CO_tycXU.js +0 -250
- package/dist/web/server/assets/services-DZLxUSG8.js +0 -13
- package/dist/web/server/assets/services-DsHRLL8q.js +0 -12
- package/dist/web/server/assets/services-DsvpaF3L.js +0 -74
- package/dist/web/server/assets/skills-DKYV7PTk.js +0 -275
- package/dist/web/server/assets/system-CZ2qzBz3.js +0 -138
- package/dist/web/server/assets/teams-B6PzNcoy.js +0 -88
- package/dist/web/server/assets/teams-C-8iz-uV.js +0 -108
- package/dist/web/server/assets/telegram-CXrP3hMp.js +0 -984
- package/dist/web/server/assets/tokens-DSLwQ1Pw.js +0 -232
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
import { C as api, T as errorMessage, u as Button } from "./workspace-DaitCM0t.js";
|
|
2
|
+
import { n as DialogActions, t as Dialog } from "./Dialog-aup_yJv5.js";
|
|
3
|
+
import { n as ModelMenu } from "./ModelMenu-BAZeARx6.js";
|
|
4
|
+
import { g as Notice } from "./parts-mabERIJZ.js";
|
|
5
|
+
import { l as TextField, n as ChoiceCards, t as CheckboxRow } from "./form-BRQAsKKq.js";
|
|
6
|
+
import { S as slugify, x as slugProblem } from "./manage-Ppyi3Y5y.js";
|
|
7
|
+
import { useState } from "react";
|
|
8
|
+
import { useNavigate } from "@tanstack/react-router";
|
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
//#region src/components/manage/AgentTemplateParts.tsx
|
|
11
|
+
var TEMPLATE_FILES = [
|
|
12
|
+
{
|
|
13
|
+
key: "soul",
|
|
14
|
+
name: "SOUL.md",
|
|
15
|
+
hint: "Persona, values and operating principles. Part of every session.",
|
|
16
|
+
optional: false
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
key: "identity",
|
|
20
|
+
name: "IDENTITY.md",
|
|
21
|
+
hint: "Name, creature, vibe, emoji and avatar: filled in during the first conversation.",
|
|
22
|
+
optional: false
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
key: "bootstrap",
|
|
26
|
+
name: "BOOTSTRAP.md",
|
|
27
|
+
hint: "The first-run ritual in which the Agent introduces itself; it retires the file once done.",
|
|
28
|
+
optional: true
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
key: "agents",
|
|
32
|
+
name: "AGENTS.md",
|
|
33
|
+
hint: "How the Agent works in its workspace: memory, red lines, who it hands work to.",
|
|
34
|
+
optional: true
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
key: "tools",
|
|
38
|
+
name: "TOOLS.md",
|
|
39
|
+
hint: "Notes on its tools and environment beyond the tool descriptions.",
|
|
40
|
+
optional: true
|
|
41
|
+
}
|
|
42
|
+
];
|
|
43
|
+
var SKILL_MODES = [{
|
|
44
|
+
value: "all",
|
|
45
|
+
label: "All skills",
|
|
46
|
+
hint: "Every installed skill, including ones imported later."
|
|
47
|
+
}, {
|
|
48
|
+
value: "selected",
|
|
49
|
+
label: "Chosen skills",
|
|
50
|
+
hint: "Only the ones ticked below."
|
|
51
|
+
}];
|
|
52
|
+
/** Which skills a template attaches at spawn: all of them, or the ticked ones. */
|
|
53
|
+
function SkillsChoice({ mode, picked, skills, disabled, onModeChange, onPickedChange }) {
|
|
54
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
55
|
+
className: "grid gap-3",
|
|
56
|
+
children: [
|
|
57
|
+
/* @__PURE__ */ jsx(ChoiceCards, {
|
|
58
|
+
legend: "Skills at spawn",
|
|
59
|
+
name: "template-skills",
|
|
60
|
+
value: mode,
|
|
61
|
+
options: SKILL_MODES,
|
|
62
|
+
disabled,
|
|
63
|
+
onChange: onModeChange
|
|
64
|
+
}),
|
|
65
|
+
mode === "selected" && (skills.length === 0 ? /* @__PURE__ */ jsxs("p", {
|
|
66
|
+
className: "m-0 text-sm text-muted-foreground",
|
|
67
|
+
children: [
|
|
68
|
+
"No skills are installed yet. Import some under ",
|
|
69
|
+
/* @__PURE__ */ jsx("a", {
|
|
70
|
+
href: "/skills",
|
|
71
|
+
children: "Skills"
|
|
72
|
+
}),
|
|
73
|
+
"."
|
|
74
|
+
]
|
|
75
|
+
}) : /* @__PURE__ */ jsxs("fieldset", {
|
|
76
|
+
className: "m-0 grid max-h-64 min-w-0 gap-2.5 overflow-y-auto rounded-xl border border-border bg-muted/30 p-3.5",
|
|
77
|
+
children: [/* @__PURE__ */ jsx("legend", {
|
|
78
|
+
className: "sr-only",
|
|
79
|
+
children: "Chosen skills"
|
|
80
|
+
}), skills.map((skill) => /* @__PURE__ */ jsx(CheckboxRow, {
|
|
81
|
+
checked: picked.has(skill.name),
|
|
82
|
+
disabled,
|
|
83
|
+
label: /* @__PURE__ */ jsxs("span", {
|
|
84
|
+
className: "min-w-0",
|
|
85
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
86
|
+
className: "font-mono text-[0.9em] font-semibold",
|
|
87
|
+
children: skill.name
|
|
88
|
+
}), skill.description && /* @__PURE__ */ jsxs("span", {
|
|
89
|
+
className: "text-muted-foreground",
|
|
90
|
+
children: [" · ", skill.description]
|
|
91
|
+
})]
|
|
92
|
+
}),
|
|
93
|
+
onChange: (checked) => {
|
|
94
|
+
const next = new Set(picked);
|
|
95
|
+
if (checked) next.add(skill.name);
|
|
96
|
+
else next.delete(skill.name);
|
|
97
|
+
onPickedChange(next);
|
|
98
|
+
}
|
|
99
|
+
}, skill.name))]
|
|
100
|
+
})),
|
|
101
|
+
/* @__PURE__ */ jsx("p", {
|
|
102
|
+
className: "m-0 text-xs text-muted-foreground",
|
|
103
|
+
children: "Each Agent can still attach or detach skills after it is spawned."
|
|
104
|
+
})
|
|
105
|
+
]
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
/** Create an Agent template from the starter files, then open it to edit them. */
|
|
109
|
+
function CreateAgentTemplateDialog({ chat, skills, starter, onClose }) {
|
|
110
|
+
const navigate = useNavigate();
|
|
111
|
+
const [name, setName] = useState("");
|
|
112
|
+
const [id, setId] = useState("");
|
|
113
|
+
const [idTouched, setIdTouched] = useState(false);
|
|
114
|
+
const [model, setModel] = useState("");
|
|
115
|
+
const [mode, setMode] = useState("all");
|
|
116
|
+
const [picked, setPicked] = useState(/* @__PURE__ */ new Set());
|
|
117
|
+
const [optional, setOptional] = useState({
|
|
118
|
+
soul: true,
|
|
119
|
+
identity: true,
|
|
120
|
+
bootstrap: true,
|
|
121
|
+
agents: true,
|
|
122
|
+
tools: true
|
|
123
|
+
});
|
|
124
|
+
const [busy, setBusy] = useState(false);
|
|
125
|
+
const [error, setError] = useState(null);
|
|
126
|
+
const shownId = idTouched ? id : slugify(name);
|
|
127
|
+
const idProblem = slugProblem(shownId);
|
|
128
|
+
const ready = shownId !== "" && !idProblem && model !== "";
|
|
129
|
+
async function create(event) {
|
|
130
|
+
event.preventDefault();
|
|
131
|
+
if (!ready || busy) return;
|
|
132
|
+
setBusy(true);
|
|
133
|
+
setError(null);
|
|
134
|
+
try {
|
|
135
|
+
await api("/api/profiles", { body: {
|
|
136
|
+
id: shownId,
|
|
137
|
+
name: name.trim() || void 0,
|
|
138
|
+
defaultModel: model,
|
|
139
|
+
skillsMode: mode,
|
|
140
|
+
defaultSkills: mode === "selected" ? [...picked] : [],
|
|
141
|
+
soul: starter.soul,
|
|
142
|
+
identity: starter.identity,
|
|
143
|
+
bootstrap: optional.bootstrap ? starter.bootstrap : null,
|
|
144
|
+
agents: optional.agents ? starter.agents : null,
|
|
145
|
+
tools: optional.tools ? starter.tools : null
|
|
146
|
+
} });
|
|
147
|
+
await navigate({
|
|
148
|
+
to: "/templates/agents/$id",
|
|
149
|
+
params: { id: shownId }
|
|
150
|
+
});
|
|
151
|
+
} catch (cause) {
|
|
152
|
+
setError(errorMessage(cause));
|
|
153
|
+
setBusy(false);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
return /* @__PURE__ */ jsx(Dialog, {
|
|
157
|
+
title: "New Agent template",
|
|
158
|
+
description: "It starts from the built-in files, which you can edit next. Agents spawned from it get their own copies.",
|
|
159
|
+
busy,
|
|
160
|
+
onClose,
|
|
161
|
+
className: "max-w-xl",
|
|
162
|
+
children: /* @__PURE__ */ jsxs("form", {
|
|
163
|
+
onSubmit: (event) => void create(event),
|
|
164
|
+
className: "grid gap-4",
|
|
165
|
+
children: [
|
|
166
|
+
/* @__PURE__ */ jsxs("div", {
|
|
167
|
+
className: "grid items-start gap-x-3 gap-y-4 sm:grid-cols-2",
|
|
168
|
+
children: [/* @__PURE__ */ jsx(TextField, {
|
|
169
|
+
label: "Name",
|
|
170
|
+
value: name,
|
|
171
|
+
disabled: busy,
|
|
172
|
+
placeholder: "Writer",
|
|
173
|
+
className: "max-w-none",
|
|
174
|
+
onChange: setName
|
|
175
|
+
}), /* @__PURE__ */ jsx(TextField, {
|
|
176
|
+
label: "ID",
|
|
177
|
+
value: shownId,
|
|
178
|
+
disabled: busy,
|
|
179
|
+
placeholder: "writer",
|
|
180
|
+
mono: true,
|
|
181
|
+
className: "max-w-none",
|
|
182
|
+
problem: idProblem,
|
|
183
|
+
onChange: (value) => {
|
|
184
|
+
setIdTouched(true);
|
|
185
|
+
setId(value);
|
|
186
|
+
}
|
|
187
|
+
})]
|
|
188
|
+
}),
|
|
189
|
+
/* @__PURE__ */ jsx(ModelMenu, {
|
|
190
|
+
kit: true,
|
|
191
|
+
label: "Default model",
|
|
192
|
+
value: model,
|
|
193
|
+
onChange: setModel,
|
|
194
|
+
models: chat,
|
|
195
|
+
required: true
|
|
196
|
+
}),
|
|
197
|
+
chat.length === 0 && /* @__PURE__ */ jsxs(Notice, {
|
|
198
|
+
tone: "warning",
|
|
199
|
+
children: [
|
|
200
|
+
"No chat model is in use yet. Add one under ",
|
|
201
|
+
/* @__PURE__ */ jsx("a", {
|
|
202
|
+
href: "/config",
|
|
203
|
+
children: "Setup → Models"
|
|
204
|
+
}),
|
|
205
|
+
" first."
|
|
206
|
+
]
|
|
207
|
+
}),
|
|
208
|
+
/* @__PURE__ */ jsx(SkillsChoice, {
|
|
209
|
+
mode,
|
|
210
|
+
picked,
|
|
211
|
+
skills,
|
|
212
|
+
disabled: busy,
|
|
213
|
+
onModeChange: setMode,
|
|
214
|
+
onPickedChange: setPicked
|
|
215
|
+
}),
|
|
216
|
+
/* @__PURE__ */ jsxs("fieldset", {
|
|
217
|
+
className: "m-0 grid min-w-0 gap-2.5 border-0 p-0",
|
|
218
|
+
children: [
|
|
219
|
+
/* @__PURE__ */ jsx("legend", {
|
|
220
|
+
className: "mb-2 p-0 text-sm font-semibold text-foreground",
|
|
221
|
+
children: "Files"
|
|
222
|
+
}),
|
|
223
|
+
/* @__PURE__ */ jsx("p", {
|
|
224
|
+
className: "m-0 text-xs text-muted-foreground",
|
|
225
|
+
children: "SOUL.md and IDENTITY.md are always there. These three can be left out:"
|
|
226
|
+
}),
|
|
227
|
+
TEMPLATE_FILES.filter((file) => file.optional).map((file) => /* @__PURE__ */ jsx(CheckboxRow, {
|
|
228
|
+
checked: optional[file.key],
|
|
229
|
+
disabled: busy,
|
|
230
|
+
label: /* @__PURE__ */ jsxs("span", {
|
|
231
|
+
className: "min-w-0",
|
|
232
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
233
|
+
className: "font-mono text-[0.9em] font-semibold",
|
|
234
|
+
children: file.name
|
|
235
|
+
}), /* @__PURE__ */ jsxs("span", {
|
|
236
|
+
className: "text-muted-foreground",
|
|
237
|
+
children: [" · ", file.hint]
|
|
238
|
+
})]
|
|
239
|
+
}),
|
|
240
|
+
onChange: (checked) => setOptional((current) => ({
|
|
241
|
+
...current,
|
|
242
|
+
[file.key]: checked
|
|
243
|
+
}))
|
|
244
|
+
}, file.key))
|
|
245
|
+
]
|
|
246
|
+
}),
|
|
247
|
+
error && /* @__PURE__ */ jsx(Notice, {
|
|
248
|
+
tone: "warning",
|
|
249
|
+
role: "alert",
|
|
250
|
+
title: "The template was not created.",
|
|
251
|
+
children: error
|
|
252
|
+
}),
|
|
253
|
+
/* @__PURE__ */ jsxs(DialogActions, { children: [/* @__PURE__ */ jsx(Button, {
|
|
254
|
+
variant: "ghost",
|
|
255
|
+
disabled: busy,
|
|
256
|
+
onClick: onClose,
|
|
257
|
+
children: "Cancel"
|
|
258
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
259
|
+
variant: "primary",
|
|
260
|
+
type: "submit",
|
|
261
|
+
disabled: busy || !ready,
|
|
262
|
+
children: busy ? "Creating…" : "Create and edit its files"
|
|
263
|
+
})] })
|
|
264
|
+
]
|
|
265
|
+
})
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
//#endregion
|
|
269
|
+
export { SkillsChoice as n, TEMPLATE_FILES as r, CreateAgentTemplateDialog as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import {
|
|
1
|
+
import { a as PageShell, i as PageHeader } from "./createSsrRpc-BijMHgqE.js";
|
|
2
|
+
import { r as SectionTabs, t as CONFIG_TABS } from "./SectionTabs-CWQ5orUW.js";
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
//#region src/components/ConfigPage.tsx
|
|
5
5
|
function ConfigPage({ title, description, children, actions, size = "default" }) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as DialogActions, t as Dialog } from "./Dialog-
|
|
1
|
+
import { T as errorMessage, u as Button } from "./workspace-DaitCM0t.js";
|
|
2
|
+
import { n as DialogActions, t as Dialog } from "./Dialog-aup_yJv5.js";
|
|
3
3
|
import { useEffect, useState } from "react";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
//#region src/components/ConfirmDialog.tsx
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as endpointLabel, c as liveEdges, l as sameDocument, n as OUTSIDE, o as hasEdge, s as liveDocument, t as TeamPolicyMatrix, u as setEdge } from "./style-
|
|
3
|
-
import { r as useResource } from "./use-resource-
|
|
4
|
-
import { t as ConfirmDialog } from "./ConfirmDialog-
|
|
1
|
+
import { C as api, T as errorMessage, d as AgentAvatar, g as useActivity, u as Button } from "./workspace-DaitCM0t.js";
|
|
2
|
+
import { a as endpointLabel, c as liveEdges, l as sameDocument, n as OUTSIDE, o as hasEdge, s as liveDocument, t as TeamPolicyMatrix, u as setEdge } from "./style-BR7ufS6Z.js";
|
|
3
|
+
import { r as useResource } from "./use-resource-DVzK0toP.js";
|
|
4
|
+
import { t as ConfirmDialog } from "./ConfirmDialog-DfaJ--A6.js";
|
|
5
5
|
import { t as Segmented } from "./Segmented-3ZLdqa5U.js";
|
|
6
|
-
import { t as UnsavedChangesGuard } from "./UnsavedChangesGuard-
|
|
7
|
-
import {
|
|
8
|
-
import { i as pairKey, n as useTeamMessages, o as FocusFrame, t as TeamThread } from "./TeamThread-
|
|
6
|
+
import { t as UnsavedChangesGuard } from "./UnsavedChangesGuard-DrOvPV14.js";
|
|
7
|
+
import { i as STATE_DOT, s as useWorkspace } from "./Rail-7JU6ly2O.js";
|
|
8
|
+
import { i as pairKey, n as useTeamMessages, o as FocusFrame, t as TeamThread } from "./TeamThread-SyQpUvz5.js";
|
|
9
9
|
import { useEffect, useMemo, useState } from "react";
|
|
10
10
|
import { Link, useRouter } from "@tanstack/react-router";
|
|
11
11
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { a as PageShell, i as PageHeader } from "./createSsrRpc-BijMHgqE.js";
|
|
2
|
+
import { n as MANAGE_TABS, r as SectionTabs } from "./SectionTabs-CWQ5orUW.js";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/ManagePage.tsx
|
|
5
|
+
/** A page of Manage: Agents, Teams, their templates and the skills, under one tab bar. */
|
|
6
|
+
function ManagePage({ title, description, children, actions, size = "default" }) {
|
|
7
|
+
return /* @__PURE__ */ jsxs(PageShell, {
|
|
8
|
+
size,
|
|
9
|
+
children: [
|
|
10
|
+
/* @__PURE__ */ jsx(PageHeader, {
|
|
11
|
+
eyebrow: "Manage",
|
|
12
|
+
title,
|
|
13
|
+
description,
|
|
14
|
+
actions
|
|
15
|
+
}),
|
|
16
|
+
/* @__PURE__ */ jsx(SectionTabs, {
|
|
17
|
+
label: "Manage sections",
|
|
18
|
+
base: "",
|
|
19
|
+
tabs: MANAGE_TABS
|
|
20
|
+
}),
|
|
21
|
+
/* @__PURE__ */ jsx("div", {
|
|
22
|
+
className: "space-y-6",
|
|
23
|
+
children
|
|
24
|
+
})
|
|
25
|
+
]
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
export { ManagePage as t };
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { t as cn } from "./utils-C_uf36nf.js";
|
|
2
|
+
import { c as menuGroups, l as modelName, s as menuFacts } from "./model-facts-mrfrWQne.js";
|
|
3
|
+
import { useId } from "react";
|
|
4
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { Check, ChevronDown } from "lucide-react";
|
|
6
|
+
import { Select } from "radix-ui";
|
|
7
|
+
//#region src/components/ModelMenu.tsx
|
|
8
|
+
/** The Models overview, whose `chat` list the menu shows. */
|
|
9
|
+
var MODELS_PATH = "/api/config/models";
|
|
10
|
+
var INHERITED = ":inherited";
|
|
11
|
+
var ITEM = "relative flex cursor-pointer select-none items-baseline gap-x-3 rounded-lg py-2 pl-8 pr-3 text-sm outline-none data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground";
|
|
12
|
+
function ModelMenu({ label, value, onChange, models, inherited, required, kit = false }) {
|
|
13
|
+
const id = useId();
|
|
14
|
+
const find = (candidate) => models.find((model) => model.value === candidate);
|
|
15
|
+
const named = (candidate) => {
|
|
16
|
+
const model = find(candidate);
|
|
17
|
+
return model ? modelName(model) : candidate;
|
|
18
|
+
};
|
|
19
|
+
const chosen = find(value);
|
|
20
|
+
const unlisted = value !== "" && !chosen;
|
|
21
|
+
const groups = menuGroups(models);
|
|
22
|
+
const empty = models.length === 0 && !inherited;
|
|
23
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
24
|
+
className: kit ? "min-w-0" : "my-[0.6rem]",
|
|
25
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
26
|
+
id: `${id}-label`,
|
|
27
|
+
className: kit ? "mb-1.5 block text-sm font-semibold text-foreground" : "block text-[0.9em] text-mocha",
|
|
28
|
+
children: label
|
|
29
|
+
}), /* @__PURE__ */ jsxs(Select.Root, {
|
|
30
|
+
value: value === "" ? inherited ? INHERITED : "" : value,
|
|
31
|
+
onValueChange: (next) => onChange(next === INHERITED ? "" : next),
|
|
32
|
+
required,
|
|
33
|
+
disabled: empty,
|
|
34
|
+
children: [/* @__PURE__ */ jsxs(Select.Trigger, {
|
|
35
|
+
"aria-labelledby": `${id}-label ${id}-value`,
|
|
36
|
+
className: "flex min-h-[2.65rem] w-full items-center justify-between gap-2 rounded-[var(--radius-md)] border border-frost bg-[color-mix(in_srgb,var(--color-snow)_82%,var(--color-ivory))] px-[0.8rem] py-[0.5rem] text-left text-[0.95em] text-chocolate transition-all focus-visible:border-sapphire focus-visible:bg-snow focus-visible:shadow-[0_0_0_3px_var(--color-sapphire-glow)] disabled:opacity-60 data-[state=open]:border-sapphire",
|
|
37
|
+
style: { outline: "none" },
|
|
38
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
39
|
+
id: `${id}-value`,
|
|
40
|
+
className: "min-w-0 flex-1 truncate",
|
|
41
|
+
children: value === "" ? inherited ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
42
|
+
inherited.model ? named(inherited.model) : inherited.label,
|
|
43
|
+
" ",
|
|
44
|
+
inherited.model && /* @__PURE__ */ jsx("span", {
|
|
45
|
+
className: "ml-1 text-[0.9em] text-mocha-light",
|
|
46
|
+
children: inherited.label.toLowerCase()
|
|
47
|
+
})
|
|
48
|
+
] }) : /* @__PURE__ */ jsx("span", {
|
|
49
|
+
className: "text-mocha-light",
|
|
50
|
+
children: empty ? "No chat model yet" : "Pick a model"
|
|
51
|
+
}) : /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
52
|
+
named(value),
|
|
53
|
+
" ",
|
|
54
|
+
/* @__PURE__ */ jsx("span", {
|
|
55
|
+
className: "ml-1 text-[0.9em] text-mocha-light",
|
|
56
|
+
children: chosen ? chosen.providerName : "not in Chat"
|
|
57
|
+
})
|
|
58
|
+
] })
|
|
59
|
+
}), /* @__PURE__ */ jsx(Select.Icon, {
|
|
60
|
+
asChild: true,
|
|
61
|
+
children: /* @__PURE__ */ jsx(ChevronDown, {
|
|
62
|
+
className: "size-4 shrink-0 text-mocha-light",
|
|
63
|
+
"aria-hidden": "true"
|
|
64
|
+
})
|
|
65
|
+
})]
|
|
66
|
+
}), /* @__PURE__ */ jsx(Select.Portal, { children: /* @__PURE__ */ jsxs(Select.Content, {
|
|
67
|
+
position: "popper",
|
|
68
|
+
sideOffset: 6,
|
|
69
|
+
className: "z-50 max-h-[min(26rem,var(--radix-select-content-available-height))] w-[max(var(--radix-select-trigger-width),18rem)] max-w-[calc(100vw-1.5rem)] overflow-hidden rounded-xl border border-border bg-popover text-popover-foreground shadow-baziu-lg",
|
|
70
|
+
children: [/* @__PURE__ */ jsxs(Select.Viewport, {
|
|
71
|
+
className: "p-1.5",
|
|
72
|
+
children: [
|
|
73
|
+
inherited && /* @__PURE__ */ jsx(Option, {
|
|
74
|
+
value: INHERITED,
|
|
75
|
+
name: inherited.label,
|
|
76
|
+
children: inherited.model ? named(inherited.model) : ""
|
|
77
|
+
}),
|
|
78
|
+
unlisted && /* @__PURE__ */ jsx(Option, {
|
|
79
|
+
value,
|
|
80
|
+
name: value,
|
|
81
|
+
mono: true,
|
|
82
|
+
children: "not in Chat"
|
|
83
|
+
}),
|
|
84
|
+
groups.map((group) => /* @__PURE__ */ jsxs(Select.Group, { children: [/* @__PURE__ */ jsxs(Select.Label, {
|
|
85
|
+
className: "flex items-baseline gap-2 px-3 pb-1 pt-2.5 text-[0.68rem] font-bold uppercase tracking-[0.08em] text-muted-foreground",
|
|
86
|
+
children: [group.name, group.trouble && /* @__PURE__ */ jsx("span", {
|
|
87
|
+
className: "font-semibold normal-case tracking-normal text-warning",
|
|
88
|
+
children: group.trouble
|
|
89
|
+
})]
|
|
90
|
+
}), group.models.map((model) => /* @__PURE__ */ jsx(Option, {
|
|
91
|
+
value: model.value,
|
|
92
|
+
name: modelName(model),
|
|
93
|
+
mono: !model.name,
|
|
94
|
+
children: menuFacts(model)
|
|
95
|
+
}, model.value))] }, group.provider)),
|
|
96
|
+
models.length === 0 && /* @__PURE__ */ jsx("p", {
|
|
97
|
+
className: "m-0 px-3 py-2 text-sm text-muted-foreground",
|
|
98
|
+
children: "No chat model is in use yet."
|
|
99
|
+
})
|
|
100
|
+
]
|
|
101
|
+
}), /* @__PURE__ */ jsx("a", {
|
|
102
|
+
href: "/config?pick=true",
|
|
103
|
+
className: "block border-t border-border px-4 py-2.5 text-sm font-semibold text-primary hover:bg-muted/50",
|
|
104
|
+
children: "Add models in Setup"
|
|
105
|
+
})]
|
|
106
|
+
}) })]
|
|
107
|
+
})]
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
function Option({ value, name, mono = false, children }) {
|
|
111
|
+
return /* @__PURE__ */ jsxs(Select.Item, {
|
|
112
|
+
value,
|
|
113
|
+
className: ITEM,
|
|
114
|
+
style: { outline: "none" },
|
|
115
|
+
children: [
|
|
116
|
+
/* @__PURE__ */ jsx(Select.ItemIndicator, {
|
|
117
|
+
className: "absolute left-2.5 top-1/2 -translate-y-1/2",
|
|
118
|
+
children: /* @__PURE__ */ jsx(Check, {
|
|
119
|
+
className: "size-4 text-primary",
|
|
120
|
+
"aria-hidden": "true"
|
|
121
|
+
})
|
|
122
|
+
}),
|
|
123
|
+
/* @__PURE__ */ jsx(Select.ItemText, {
|
|
124
|
+
asChild: true,
|
|
125
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
126
|
+
className: cn("min-w-0 flex-1 break-words", mono ? "font-mono text-[0.85em] font-medium" : "font-semibold"),
|
|
127
|
+
children: name
|
|
128
|
+
})
|
|
129
|
+
}),
|
|
130
|
+
children && /* @__PURE__ */ jsx("span", {
|
|
131
|
+
className: "shrink-0 text-xs text-muted-foreground",
|
|
132
|
+
children
|
|
133
|
+
})
|
|
134
|
+
]
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
//#endregion
|
|
138
|
+
export { ModelMenu as n, MODELS_PATH as t };
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { T as errorMessage, d as AgentAvatar, g as useActivity, h as teamSummary, m as shortTime, u as Button } from "./workspace-DaitCM0t.js";
|
|
2
2
|
import { n as DEFAULT_TEAM_ID, t as DEFAULT_PROFILE_ID } from "./entities-Dn2xzKIw.js";
|
|
3
|
-
import { t as useHydrated } from "./use-resource-
|
|
4
|
-
import { n as DialogActions, t as Dialog$1 } from "./Dialog-
|
|
5
|
-
import { t as ConfirmDialog } from "./ConfirmDialog-
|
|
6
|
-
import {
|
|
7
|
-
import { t as
|
|
3
|
+
import { t as useHydrated } from "./use-resource-DVzK0toP.js";
|
|
4
|
+
import { n as DialogActions, t as Dialog$1 } from "./Dialog-aup_yJv5.js";
|
|
5
|
+
import { t as ConfirmDialog } from "./ConfirmDialog-DfaJ--A6.js";
|
|
6
|
+
import { r as renameAgent, t as archiveAgent } from "./agent-actions-CUDMCG0F.js";
|
|
7
|
+
import { t as SpawnDialog } from "./SpawnDialog-CYkwzETs.js";
|
|
8
|
+
import { t as SpawnTeamModal } from "./SpawnTeamModal-CCe6P82H.js";
|
|
9
|
+
import { t as TeamForm } from "./TeamForm-BzQmdhVi.js";
|
|
8
10
|
import { createContext, useContext, useMemo, useRef, useState } from "react";
|
|
9
11
|
import { Link, useRouter } from "@tanstack/react-router";
|
|
10
|
-
import {
|
|
12
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
13
|
import { Archive, Bot, ChevronDown, ChevronRight, Ellipsis, PanelLeft, PanelRight, Pencil, Plus, Send, Settings2, UsersRound } from "lucide-react";
|
|
12
14
|
import { DropdownMenu } from "radix-ui";
|
|
13
15
|
//#region src/components/workspace/context.tsx
|
|
@@ -39,98 +41,6 @@ function useWorkspaceOptional() {
|
|
|
39
41
|
return useContext(WorkspaceContext);
|
|
40
42
|
}
|
|
41
43
|
//#endregion
|
|
42
|
-
//#region src/components/SpawnTeamModal.tsx
|
|
43
|
-
/** Spawn a Team template's Agents and allow edges into a new or existing Team. */
|
|
44
|
-
function SpawnTeamModal({ template, teams, initialTeamId = "", onClose, onSpawned }) {
|
|
45
|
-
const [teamId, setTeamId] = useState(initialTeamId);
|
|
46
|
-
const [userMd, setUserMd] = useState("");
|
|
47
|
-
const [error, setError] = useState(null);
|
|
48
|
-
const [busy, setBusy] = useState(false);
|
|
49
|
-
const target = teamId.trim();
|
|
50
|
-
const existing = teams.some((team) => team.id === target);
|
|
51
|
-
async function spawn(event) {
|
|
52
|
-
event.preventDefault();
|
|
53
|
-
setBusy(true);
|
|
54
|
-
setError(null);
|
|
55
|
-
try {
|
|
56
|
-
await api(`/api/team-templates/${encodeURIComponent(template.id)}/spawn`, { body: {
|
|
57
|
-
teamId: target,
|
|
58
|
-
...userMd && !existing ? { userMd } : {}
|
|
59
|
-
} });
|
|
60
|
-
onSpawned(target);
|
|
61
|
-
} catch (cause) {
|
|
62
|
-
setError(errorMessage(cause));
|
|
63
|
-
} finally {
|
|
64
|
-
setBusy(false);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
return /* @__PURE__ */ jsx(Dialog$1, {
|
|
68
|
-
title: `Spawn team: ${template.name}`,
|
|
69
|
-
description: /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
70
|
-
"Creates ",
|
|
71
|
-
template.slots.length,
|
|
72
|
-
" Agent",
|
|
73
|
-
template.slots.length === 1 ? "" : "s",
|
|
74
|
-
" and",
|
|
75
|
-
" ",
|
|
76
|
-
template.edges.length,
|
|
77
|
-
" allow edge",
|
|
78
|
-
template.edges.length === 1 ? "" : "s",
|
|
79
|
-
". An unknown slug creates a new ",
|
|
80
|
-
template.policyMode,
|
|
81
|
-
" Team; an existing Team keeps its mode."
|
|
82
|
-
] }),
|
|
83
|
-
busy,
|
|
84
|
-
onClose,
|
|
85
|
-
children: /* @__PURE__ */ jsxs("form", {
|
|
86
|
-
onSubmit: (event) => void spawn(event),
|
|
87
|
-
children: [
|
|
88
|
-
/* @__PURE__ */ jsxs("label", { children: [
|
|
89
|
-
"Target Team slug",
|
|
90
|
-
/* @__PURE__ */ jsx("input", {
|
|
91
|
-
value: teamId,
|
|
92
|
-
onChange: (event) => setTeamId(event.target.value),
|
|
93
|
-
list: "spawn-team-targets",
|
|
94
|
-
required: true
|
|
95
|
-
}),
|
|
96
|
-
/* @__PURE__ */ jsx("datalist", {
|
|
97
|
-
id: "spawn-team-targets",
|
|
98
|
-
children: teams.map((team) => /* @__PURE__ */ jsx("option", {
|
|
99
|
-
value: team.id,
|
|
100
|
-
children: team.name
|
|
101
|
-
}, team.id))
|
|
102
|
-
})
|
|
103
|
-
] }),
|
|
104
|
-
!existing && /* @__PURE__ */ jsxs("label", { children: ["Starter USER.md (new Team only; defaults to the template's)", /* @__PURE__ */ jsx("textarea", {
|
|
105
|
-
rows: 3,
|
|
106
|
-
value: userMd,
|
|
107
|
-
onChange: (event) => setUserMd(event.target.value),
|
|
108
|
-
className: "font-mono text-[0.88em] leading-[1.55]"
|
|
109
|
-
})] }),
|
|
110
|
-
error && /* @__PURE__ */ jsx("p", {
|
|
111
|
-
role: "alert",
|
|
112
|
-
className: "err mt-2",
|
|
113
|
-
children: error
|
|
114
|
-
}),
|
|
115
|
-
/* @__PURE__ */ jsx("div", {
|
|
116
|
-
className: "mt-4",
|
|
117
|
-
children: /* @__PURE__ */ jsxs(DialogActions, { children: [/* @__PURE__ */ jsx(Button, {
|
|
118
|
-
variant: "ghost",
|
|
119
|
-
disabled: busy,
|
|
120
|
-
onClick: onClose,
|
|
121
|
-
children: "Cancel"
|
|
122
|
-
}), /* @__PURE__ */ jsx(Button, {
|
|
123
|
-
variant: "primary",
|
|
124
|
-
type: "submit",
|
|
125
|
-
disabled: busy || !target || template.slots.length === 0,
|
|
126
|
-
children: busy ? "Spawning…" : "Spawn team"
|
|
127
|
-
})] })
|
|
128
|
-
})
|
|
129
|
-
]
|
|
130
|
-
})
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
//#endregion
|
|
134
44
|
//#region src/components/workspace/Rail.tsx
|
|
135
45
|
var SIDEBAR_OPEN_GROUPS_COOKIE = "bz_sidebar_open_groups";
|
|
136
46
|
function writeOpenGroupsCookie(map) {
|
|
@@ -242,7 +152,7 @@ function Rail({ initialOpenGroups }) {
|
|
|
242
152
|
asChild: true,
|
|
243
153
|
className: MENU_ITEM,
|
|
244
154
|
children: /* @__PURE__ */ jsx("a", {
|
|
245
|
-
href: "/templates/agents",
|
|
155
|
+
href: "/templates/agents?new=1",
|
|
246
156
|
children: "Create an Agent template"
|
|
247
157
|
})
|
|
248
158
|
}) : sortedProfiles.map((profile) => /* @__PURE__ */ jsxs(DropdownMenu.Item, {
|
|
@@ -271,7 +181,7 @@ function Rail({ initialOpenGroups }) {
|
|
|
271
181
|
asChild: true,
|
|
272
182
|
className: MENU_ITEM,
|
|
273
183
|
children: /* @__PURE__ */ jsx("a", {
|
|
274
|
-
href: "/templates/teams",
|
|
184
|
+
href: "/templates/teams?new=1",
|
|
275
185
|
children: "Create a Team template"
|
|
276
186
|
})
|
|
277
187
|
}) : teamTemplates.map((entry) => /* @__PURE__ */ jsxs(DropdownMenu.Item, {
|
|
@@ -294,7 +204,7 @@ function Rail({ initialOpenGroups }) {
|
|
|
294
204
|
children: [/* @__PURE__ */ jsx(Plus, {
|
|
295
205
|
className: "size-3.5",
|
|
296
206
|
"aria-hidden": "true"
|
|
297
|
-
}), "Create a
|
|
207
|
+
}), "Create a Team"]
|
|
298
208
|
})
|
|
299
209
|
]
|
|
300
210
|
}) })]
|
|
@@ -320,7 +230,7 @@ function Rail({ initialOpenGroups }) {
|
|
|
320
230
|
onClick: () => setSpawnProfile(sortedProfiles[0]?.id ?? "default"),
|
|
321
231
|
children: "Spawn first agent"
|
|
322
232
|
}) : /* @__PURE__ */ jsx("a", {
|
|
323
|
-
href: "/templates/agents",
|
|
233
|
+
href: "/templates/agents?new=1",
|
|
324
234
|
className: "mt-3 text-xs font-semibold",
|
|
325
235
|
children: "Create an Agent template"
|
|
326
236
|
})
|
|
@@ -421,8 +331,8 @@ function Rail({ initialOpenGroups }) {
|
|
|
421
331
|
}
|
|
422
332
|
}),
|
|
423
333
|
createTeamOpen && /* @__PURE__ */ jsx(Dialog$1, {
|
|
424
|
-
title: "Create a
|
|
425
|
-
description: "A Team is one workspace
|
|
334
|
+
title: "Create a Team",
|
|
335
|
+
description: "A Team is one workspace: its folder, its Agents, its USER.md and shared memory, and who may message whom.",
|
|
426
336
|
busy: createTeamBusy,
|
|
427
337
|
onClose: () => {
|
|
428
338
|
setCreateTeamOpen(false);
|
|
@@ -459,7 +369,7 @@ function Rail({ initialOpenGroups }) {
|
|
|
459
369
|
if (!next) setArchiveTarget(null);
|
|
460
370
|
},
|
|
461
371
|
title: `Archive ${archiveTarget?.name ?? "agent"}?`,
|
|
462
|
-
description: /* @__PURE__ */ jsx("p", { children: "The Agent leaves this list and receives no work. Restore it later under Manage
|
|
372
|
+
description: /* @__PURE__ */ jsx("p", { children: "The Agent leaves this list and receives no work. Restore it later under Manage → Agents, in Archived." }),
|
|
463
373
|
confirmLabel: "Archive agent",
|
|
464
374
|
confirmVariant: "primary",
|
|
465
375
|
onConfirm: async () => {
|
|
@@ -695,4 +605,4 @@ function RenameAgentDialog({ agent, onClose, onRenamed }) {
|
|
|
695
605
|
});
|
|
696
606
|
}
|
|
697
607
|
//#endregion
|
|
698
|
-
export { SlimRail as a,
|
|
608
|
+
export { SlimRail as a, useWorkspaceOptional as c, STATE_DOT as i, RenameAgentDialog as n, WorkspaceProvider as o, SIDEBAR_OPEN_GROUPS_COOKIE as r, useWorkspace as s, Rail as t };
|