bazilion 0.9.0 → 0.10.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 +9 -15
- package/dist/cli.js.map +1 -1
- package/dist/daemon.js +22 -75
- package/dist/daemon.js.map +1 -1
- package/dist/web/client/assets/AgentTabs-B3hq5a3e.js +1 -0
- package/dist/web/client/assets/ConfigPage-BCwfgyjD.js +1 -0
- package/dist/web/client/assets/FieldRow-avAFLgYW.js +1 -0
- package/dist/web/client/assets/Page-CwNuDhWz.js +1 -0
- package/dist/web/client/assets/ProductionTeamPolicyEditor-CiQ-VVDo.js +7 -0
- package/dist/web/client/assets/{ProfileCommunicationEditor-D1OZ8WE5.js → ProfileCommunicationEditor-D84F5yfr.js} +1 -1
- package/dist/web/client/assets/SectionTabs-DZzy01az.js +1 -0
- package/dist/web/client/assets/TeamTabs-Btoe_FAE.js +1 -0
- package/dist/web/client/assets/TemplatesTabs-CAYY03F5.js +1 -0
- package/dist/web/client/assets/_id-BeauECmk.js +1 -0
- package/dist/web/client/assets/_id-BqU2BodK.js +1 -0
- package/dist/web/client/assets/_id-CKtoio3t.js +1 -0
- package/dist/web/client/assets/_id-Q98Of6k9.js +1 -0
- package/dist/web/client/assets/activity-DXN_N85w.js +1 -0
- package/dist/web/client/assets/agents-C5Xsdge1.js +1 -0
- package/dist/web/client/assets/agents-Cgxo4H5G.js +1 -0
- package/dist/web/client/assets/approvals-BnG7fbw-.js +1 -0
- package/dist/web/client/assets/chevron-down-BhcBspw3.js +1 -0
- package/dist/web/client/assets/config-xw4NyrXF.js +3 -0
- package/dist/web/client/assets/context-D2V1Oi4z.js +1 -0
- package/dist/web/client/assets/inbox-DK6hWCMp.js +1 -0
- package/dist/web/client/assets/index-VdURSoM4.js +12 -0
- package/dist/web/client/assets/login-CvptUoMR.js +1 -0
- package/dist/web/client/assets/mcp-BDFM_sW-.js +1 -0
- package/dist/web/client/assets/members-BJvph_TR.js +1 -0
- package/dist/web/client/assets/memory-DRytqZCD.js +1 -0
- package/dist/web/client/assets/plus-C9ee3SIO.js +1 -0
- package/dist/web/client/assets/policy-CGP50OtQ.js +1 -0
- package/dist/web/client/assets/preload-helper-mNuBjNXU.js +1 -0
- package/dist/web/client/assets/react-3W8R1pOO.js +1 -0
- package/dist/web/client/assets/routes-DJnWYvC9.js +1 -0
- package/dist/web/client/assets/services-DHheiv7L.js +1 -0
- package/dist/web/client/assets/skills-DmsitluU.js +1 -0
- package/dist/web/client/assets/styles-B5eQAwLP.css +2 -0
- package/dist/web/client/assets/team-policy-D0jpnn2b.js +1 -0
- package/dist/web/client/assets/teams-BdC4gthq.js +1 -0
- package/dist/web/client/assets/teams-CbxSaorm.js +1 -0
- package/dist/web/client/assets/telegram-D61G_alO.js +1 -0
- package/dist/web/client/assets/tokens-CjRplDrJ.js +1 -0
- package/dist/web/client/assets/triggers-MLzTm_DM.js +1 -0
- package/dist/web/client/assets/welcome-wBfX9dAd.js +1 -0
- package/dist/web/client/assets/{wire-constants-BY9Q9Z7d.js → wire-constants-BxfyUMXB.js} +2 -2
- package/dist/web/server/assets/{AgentTabs-BOjTN7QF.js → AgentTabs-DoMDJBXH.js} +10 -7
- package/dist/web/server/assets/{ChatPane-Dh3qxzdb.js → ChatPane-eUY_dga3.js} +15 -8
- package/dist/web/server/assets/ConfigPage-BKlh5vOU.js +68 -0
- package/dist/web/server/assets/{FieldRow-DwyqycWI.js → FieldRow-B4eTegH9.js} +5 -5
- package/dist/web/server/assets/Page-LENulSXY.js +111 -0
- package/dist/web/server/assets/{ProductionTeamPolicyEditor-Bke5doyl.js → ProductionTeamPolicyEditor-Y4mzFFvR.js} +4 -4
- package/dist/web/server/assets/SectionTabs-BJTPr5nU.js +8 -0
- package/dist/web/server/assets/{Sidebar-CGmtCnYU.js → Sidebar-O_CH1-JD.js} +228 -117
- package/dist/web/server/assets/{TeamTabs-BPxDBfqy.js → TeamTabs-zZzbP1t_.js} +9 -8
- package/dist/web/server/assets/{TemplatesTabs-zf4YhStd.js → TemplatesTabs-CcRxZhJe.js} +5 -4
- package/dist/web/server/assets/{_id-fpFQ9_Ya.js → _id-BhOB8Umi.js} +1 -1
- package/dist/web/server/assets/{_id-CCHA0gdR.js → _id-C3HY4lWg.js} +7 -10
- package/dist/web/server/assets/{_id-B6g9wmPR.js → _id-ClN9hY2x.js} +22 -28
- package/dist/web/server/assets/{_id-B04VaQlh.js → _id-CwyGjJeP.js} +2 -2
- package/dist/web/server/assets/{_id-_nFwi9gD.js → _id-D27T85mU.js} +1 -1
- package/dist/web/server/assets/{_id-5lLzLwcv.js → _id-D3Ap7zZA.js} +142 -144
- package/dist/web/server/assets/{_id-ButXHnRH.js → _id-DinTp_7X.js} +2 -2
- package/dist/web/server/assets/{_id-DdC9wpNN.js → _id-Dj1yZ3zJ.js} +2 -2
- package/dist/web/server/assets/{_id-DkFgCIb-.js → _id-DkYodSkG.js} +2 -2
- package/dist/web/server/assets/{_id-CUWgTqMS.js → _id-IzadFZV9.js} +1 -1
- package/dist/web/server/assets/{_id-C4AOhstq.js → _id-LrvXU4Nr.js} +6 -5
- package/dist/web/server/assets/{_id-DJkzwHjM.js → _id-tB47Vsfp.js} +1 -1
- package/dist/web/server/assets/{_tanstack-start-manifest_v-Div-TukY.js → _tanstack-start-manifest_v-D09Xu_6u.js} +95 -50
- package/dist/web/server/assets/{activity-C2ZKg1Q9.js → activity-BCI4mfNS.js} +28 -30
- package/dist/web/server/assets/{activity-DedraoFj.js → activity-D9SMqBhy.js} +2 -2
- package/dist/web/server/assets/{activity-GPx8NCeB.js → activity-DohitgwW.js} +1 -1
- package/dist/web/server/assets/{agents-BR2qXlXF.js → agents-BPKOshR5.js} +1 -1
- package/dist/web/server/assets/{agents-LHowEI6S.js → agents-BY74v7fM.js} +1 -1
- package/dist/web/server/assets/{agents-B8kinIPW.js → agents-BvttypqB.js} +2 -2
- package/dist/web/server/assets/{agents-Bp1nsVs2.js → agents-C9xlWK0Z.js} +2 -2
- package/dist/web/server/assets/agents-CgZMHj80.js +265 -0
- package/dist/web/server/assets/{agents-CUQmWhTp.js → agents-DZuFEj0D.js} +59 -77
- package/dist/web/server/assets/{approvals-VPc0YpLN.js → approvals-BGU-XGIO.js} +1 -1
- package/dist/web/server/assets/{approvals-Dw2LJoSA.js → approvals-CWcFHlor.js} +2 -2
- package/dist/web/server/assets/{approvals-DHgARzd8.js → approvals-DCaVw1Mz.js} +116 -78
- package/dist/web/server/assets/{auth-l-Vf8wlu.js → auth-byfSx6Ja.js} +1 -1
- package/dist/web/server/assets/{config-CHaCv89D.js → config-BDCJdtj2.js} +1 -1
- package/dist/web/server/assets/{config-BvKctDOX.js → config-D2LAsud2.js} +28 -49
- package/dist/web/server/assets/{config-QvHaxGlP.js → config-TeIoyYYc.js} +2 -2
- package/dist/web/server/assets/{context-5lrf2ame.js → context-B-XDf6Ym.js} +1 -1
- package/dist/web/server/assets/{context-D3Egm-vY.js → context-BXGo5Vfi.js} +2 -2
- package/dist/web/server/assets/context-DrkrIWun.js +47 -0
- package/dist/web/server/assets/{createServerRpc-CeKECg65.js → createServerRpc-pU-IQV2Y.js} +1 -1
- package/dist/web/server/assets/{createSsrRpc-ZBGxhl8t.js → createSsrRpc-DFsIAfFd.js} +1 -1
- package/dist/web/server/assets/{empty-plugin-adapters-DKUlnwwl.js → empty-plugin-adapters-Cq4--YW-.js} +1 -1
- package/dist/web/server/assets/{inbox-CkiSvD14.js → inbox-B3-TRsNI.js} +1 -1
- package/dist/web/server/assets/{inbox-Bxb3W04M.js → inbox-BardsGyy.js} +2 -2
- package/dist/web/server/assets/inbox-CUIyf9MT.js +131 -0
- package/dist/web/server/assets/login-Bx5LEyGP.js +118 -0
- package/dist/web/server/assets/login-CmWvxfTK.js +136 -0
- package/dist/web/server/assets/{mcp-BsFKEoXt.js → mcp-2pwT9HU8.js} +1 -1
- package/dist/web/server/assets/{mcp-BU_kKENi.js → mcp-BJjLIdP0.js} +105 -112
- package/dist/web/server/assets/{mcp-CKqwG4mt.js → mcp-DIWTogHM.js} +2 -2
- package/dist/web/server/assets/members-CCv17cjQ.js +46 -0
- package/dist/web/server/assets/{members-DlGBKZNl.js → members-CW5aBe81.js} +1 -1
- package/dist/web/server/assets/{members-ksELRsyk.js → members-VdPwD6CE.js} +2 -2
- package/dist/web/server/assets/{memory-CO0jKGzJ.js → memory-Dngc13Nw.js} +1 -1
- package/dist/web/server/assets/memory-a8Kz57Kh.js +287 -0
- package/dist/web/server/assets/{memory-B5moRnnp.js → memory-pZ4pZT7p.js} +2 -2
- package/dist/web/server/assets/{policy-Dxs78_GO.js → policy-Bb-vEgqg.js} +1 -1
- package/dist/web/server/assets/{policy-Dr55y-Mh.js → policy-BcGELcc9.js} +16 -22
- package/dist/web/server/assets/{policy-DNcGZLOB.js → policy-C30AeFIb.js} +2 -2
- package/dist/web/server/assets/{router-_izWQUeG.js → router-DIdp8ZNt.js} +100 -111
- package/dist/web/server/assets/{routes-BrTOoeth.js → routes-CXz4hTAr.js} +2 -2
- package/dist/web/server/assets/{routes-BSSKp3Rv.js → routes-Jb0zjKav.js} +16 -13
- package/dist/web/server/assets/{routes-DOj6ljcm.js → routes-lIclH9Br.js} +2 -2
- package/dist/web/server/assets/services-B9yBWDX0.js +79 -0
- package/dist/web/server/assets/{services-Pv_V88VA.js → services-C4szdhPx.js} +2 -2
- package/dist/web/server/assets/{services-DhRiNeq0.js → services-wG8I06oS.js} +1 -1
- package/dist/web/server/assets/skills-BZdqiDig.js +358 -0
- package/dist/web/server/assets/{skills-l2cyQ3zS.js → skills-C-UgkuCW.js} +2 -2
- package/dist/web/server/assets/{skills-CFIWVg32.js → skills-a9VSWHWq.js} +1 -1
- package/dist/web/server/assets/{start-DlHq0RaQ.js → start-WH8WzTL_.js} +1 -1
- package/dist/web/server/assets/{team-policy-Csvc5EDd.js → team-policy-vPG01onj.js} +3 -3
- package/dist/web/server/assets/{teams-B9O-WDH5.js → teams-CpQ0YgWf.js} +38 -34
- package/dist/web/server/assets/{teams-35Oprf6e.js → teams-DEpQR2QA.js} +2 -2
- package/dist/web/server/assets/{teams-DFkN7ic7.js → teams-DqfrEoH6.js} +1 -1
- package/dist/web/server/assets/{teams-B5IF65p2.js → teams-MjqgsmC3.js} +1 -1
- package/dist/web/server/assets/{teams-DH1CvWmT.js → teams-OIkHuxy1.js} +2 -2
- package/dist/web/server/assets/teams-jBtvnk59.js +193 -0
- package/dist/web/server/assets/{telegram-C9sQFwWj.js → telegram-7ub--6xz.js} +39 -51
- package/dist/web/server/assets/{telegram-mTnJCOmn.js → telegram-Bazhmpr4.js} +2 -2
- package/dist/web/server/assets/{telegram-BdaUIjvs.js → telegram-DNgCWebD.js} +1 -1
- package/dist/web/server/assets/{tokens-DdpnfV_Y.js → tokens-BnwFbV7T.js} +2 -2
- package/dist/web/server/assets/{tokens-BCz3PSoT.js → tokens-DPDMSN5O.js} +1 -1
- package/dist/web/server/assets/tokens-yyTSfBSN.js +186 -0
- package/dist/web/server/assets/{triggers-BzJG1nN5.js → triggers-BMpHsGIr.js} +5 -4
- package/dist/web/server/assets/{triggers-BcH_6PW1.js → triggers-C_0y6QV9.js} +1 -1
- package/dist/web/server/assets/{triggers-BcTTwMfy.js → triggers-Ca57_qym.js} +2 -2
- package/dist/web/server/assets/{welcome-CDGE2Sdk.js → welcome-IYHGurWx.js} +21 -13
- package/dist/web/server/server.js +82 -73
- package/dist/worker.js +5 -18
- package/dist/worker.js.map +1 -1
- package/package.json +4 -3
- package/dist/web/client/assets/AgentTabs-DioGqUVR.js +0 -1
- package/dist/web/client/assets/ConfigTabs-pY-V0Rie.js +0 -1
- package/dist/web/client/assets/FieldRow-DmwAFfbF.js +0 -1
- package/dist/web/client/assets/ProductionTeamPolicyEditor-1a5jQqUB.js +0 -7
- package/dist/web/client/assets/TeamTabs-BViZ4sti.js +0 -1
- package/dist/web/client/assets/TemplatesTabs-DVcY9pMD.js +0 -1
- package/dist/web/client/assets/_id-8P7brhGy.js +0 -1
- package/dist/web/client/assets/_id-C3o3MHq8.js +0 -1
- package/dist/web/client/assets/_id-DGRrSF1e.js +0 -1
- package/dist/web/client/assets/_id-KnJe-aW9.js +0 -1
- package/dist/web/client/assets/activity-WWvJSo4t.js +0 -1
- package/dist/web/client/assets/agents-C32T1voV.js +0 -1
- package/dist/web/client/assets/agents-nH4m4gZ1.js +0 -1
- package/dist/web/client/assets/approvals-l8jIZjqz.js +0 -1
- package/dist/web/client/assets/config-C7wvi1nR.js +0 -3
- package/dist/web/client/assets/context-BEGWE3RC.js +0 -1
- package/dist/web/client/assets/inbox--4aBaAgG.js +0 -1
- package/dist/web/client/assets/index-BCXoh1c8.js +0 -12
- package/dist/web/client/assets/login-Bk2wwIHQ.js +0 -1
- package/dist/web/client/assets/mcp-vM7xgh9e.js +0 -1
- package/dist/web/client/assets/members-cPKfnrSL.js +0 -1
- package/dist/web/client/assets/memory-BOcsaemD.js +0 -1
- package/dist/web/client/assets/policy-BGLCJYvS.js +0 -1
- package/dist/web/client/assets/preload-helper-eOOCz1Fu.js +0 -1
- package/dist/web/client/assets/routes-DnrP3dwv.js +0 -1
- package/dist/web/client/assets/services-C2_O3ifw.js +0 -1
- package/dist/web/client/assets/skills-B__fLZjx.js +0 -1
- package/dist/web/client/assets/styles-Dn24-ZvP.css +0 -2
- package/dist/web/client/assets/team-policy-BdX340m4.js +0 -1
- package/dist/web/client/assets/teams-DZMB4_iw.js +0 -1
- package/dist/web/client/assets/teams-rpaYKNIb.js +0 -1
- package/dist/web/client/assets/telegram-B1O4Ko0V.js +0 -1
- package/dist/web/client/assets/tokens-D7FH9VgA.js +0 -1
- package/dist/web/client/assets/triggers-3PLy2_Fo.js +0 -1
- package/dist/web/client/assets/welcome-B-QQobzq.js +0 -1
- package/dist/web/server/assets/ConfigTabs-CyuxzesF.js +0 -41
- package/dist/web/server/assets/agents-DU9Hqs58.js +0 -249
- package/dist/web/server/assets/context-CEr4-xiA.js +0 -49
- package/dist/web/server/assets/inbox-DU27iHv_.js +0 -133
- package/dist/web/server/assets/login-CNznncgA.js +0 -58
- package/dist/web/server/assets/login-CQybKk7Y.js +0 -74
- package/dist/web/server/assets/members-40DxRdVj.js +0 -48
- package/dist/web/server/assets/memory-CiTl4cN9.js +0 -289
- package/dist/web/server/assets/services-CHe4ihJk.js +0 -94
- package/dist/web/server/assets/skills-D89ND2kR.js +0 -321
- package/dist/web/server/assets/teams-zcm9XaQU.js +0 -174
- package/dist/web/server/assets/tokens-CkKqrtk-.js +0 -193
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
import { t as Route } from "./teams-35Oprf6e.js";
|
|
2
|
-
import { useState } from "react";
|
|
3
|
-
import { useRouter } from "@tanstack/react-router";
|
|
4
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
-
//#region src/routes/teams/index.tsx?tsr-split=component
|
|
6
|
-
function TeamsPage() {
|
|
7
|
-
const { teams, memberCounts, policies, readiness } = Route.useLoaderData();
|
|
8
|
-
const router = useRouter();
|
|
9
|
-
async function remove(id) {
|
|
10
|
-
if (!confirm("remove this team registration?")) return;
|
|
11
|
-
const revision = policies[id]?.revision;
|
|
12
|
-
if (!revision) return;
|
|
13
|
-
const res = await fetch(`/api/teams/${encodeURIComponent(id)}?expectedTeamPolicyRevision=${revision}`, { method: "DELETE" });
|
|
14
|
-
if (!res.ok && res.status !== 204) {
|
|
15
|
-
alert(res.statusText);
|
|
16
|
-
return;
|
|
17
|
-
}
|
|
18
|
-
await router.invalidate();
|
|
19
|
-
}
|
|
20
|
-
return /* @__PURE__ */ jsxs("div", { children: [
|
|
21
|
-
/* @__PURE__ */ jsx("h1", { children: "teams" }),
|
|
22
|
-
/* @__PURE__ */ jsx("p", {
|
|
23
|
-
className: "muted",
|
|
24
|
-
children: "A Team owns one workspace, one live membership roster, and exactly one effective policy. Every agent belongs to exactly one Team."
|
|
25
|
-
}),
|
|
26
|
-
/* @__PURE__ */ jsxs("aside", {
|
|
27
|
-
className: "card",
|
|
28
|
-
"aria-label": "TeamPolicy enforcement readiness",
|
|
29
|
-
children: [
|
|
30
|
-
/* @__PURE__ */ jsx("strong", { children: readiness.enforcementActive ? "Team Policy enforcement is active." : "Team Policy enforcement is currently off." }),
|
|
31
|
-
" ",
|
|
32
|
-
/* @__PURE__ */ jsxs("span", {
|
|
33
|
-
className: "muted",
|
|
34
|
-
children: [
|
|
35
|
-
"Management contract v",
|
|
36
|
-
readiness.contractVersion,
|
|
37
|
-
" is release-ready. Set",
|
|
38
|
-
" ",
|
|
39
|
-
/* @__PURE__ */ jsx("code", { children: "BAZILION_TEAM_POLICY_ENFORCEMENT=on" }),
|
|
40
|
-
" and restart the daemon to enforce it."
|
|
41
|
-
]
|
|
42
|
-
})
|
|
43
|
-
]
|
|
44
|
-
}),
|
|
45
|
-
/* @__PURE__ */ jsx(RegisterTeamForm, { onRegistered: () => router.invalidate() }),
|
|
46
|
-
/* @__PURE__ */ jsx("div", {
|
|
47
|
-
className: "overflow-x-auto",
|
|
48
|
-
children: /* @__PURE__ */ jsxs("table", { children: [/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [
|
|
49
|
-
/* @__PURE__ */ jsx("th", { children: "id" }),
|
|
50
|
-
/* @__PURE__ */ jsx("th", { children: "name" }),
|
|
51
|
-
/* @__PURE__ */ jsx("th", { children: "members" }),
|
|
52
|
-
/* @__PURE__ */ jsx("th", { children: "policy" }),
|
|
53
|
-
/* @__PURE__ */ jsx("th", { children: "baseline" }),
|
|
54
|
-
/* @__PURE__ */ jsx("th", {})
|
|
55
|
-
] }) }), /* @__PURE__ */ jsxs("tbody", { children: [teams.length === 0 && /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", {
|
|
56
|
-
colSpan: 6,
|
|
57
|
-
className: "muted",
|
|
58
|
-
children: "no teams registered"
|
|
59
|
-
}) }), teams.map((g) => {
|
|
60
|
-
const count = memberCounts[g.id] ?? 0;
|
|
61
|
-
const policy = policies[g.id];
|
|
62
|
-
return /* @__PURE__ */ jsxs("tr", { children: [
|
|
63
|
-
/* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsx("code", { children: g.id }) }),
|
|
64
|
-
/* @__PURE__ */ jsx("td", { children: g.name }),
|
|
65
|
-
/* @__PURE__ */ jsx("td", { children: count }),
|
|
66
|
-
/* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsx("a", {
|
|
67
|
-
href: `/teams/${g.id}/policy`,
|
|
68
|
-
children: policy ? `r${policy.revision} · ${policy.edges} edges` : "unavailable"
|
|
69
|
-
}) }),
|
|
70
|
-
/* @__PURE__ */ jsx("td", { children: policy?.baseline ?? "none" }),
|
|
71
|
-
/* @__PURE__ */ jsx("td", { children: count === 0 ? /* @__PURE__ */ jsx("button", {
|
|
72
|
-
type: "button",
|
|
73
|
-
className: "ghost-btn",
|
|
74
|
-
onClick: () => remove(g.id),
|
|
75
|
-
children: "remove"
|
|
76
|
-
}) : /* @__PURE__ */ jsx("span", {
|
|
77
|
-
className: "muted",
|
|
78
|
-
title: `${count} agent(s) belong to this team`,
|
|
79
|
-
children: "in use"
|
|
80
|
-
}) })
|
|
81
|
-
] }, g.id);
|
|
82
|
-
})] })] })
|
|
83
|
-
})
|
|
84
|
-
] });
|
|
85
|
-
}
|
|
86
|
-
function RegisterTeamForm({ onRegistered }) {
|
|
87
|
-
const [id, setId] = useState("");
|
|
88
|
-
const [name, setName] = useState("");
|
|
89
|
-
const [link, setLink] = useState("");
|
|
90
|
-
const [err, setErr] = useState(null);
|
|
91
|
-
const [submitting, setSubmitting] = useState(false);
|
|
92
|
-
async function submit(e) {
|
|
93
|
-
e.preventDefault();
|
|
94
|
-
setErr(null);
|
|
95
|
-
if (!id.trim()) {
|
|
96
|
-
setErr("id is required");
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
setSubmitting(true);
|
|
100
|
-
try {
|
|
101
|
-
const res = await fetch("/api/teams", {
|
|
102
|
-
method: "POST",
|
|
103
|
-
headers: { "content-type": "application/json" },
|
|
104
|
-
body: JSON.stringify({
|
|
105
|
-
id: id.trim(),
|
|
106
|
-
name: name.trim() || void 0,
|
|
107
|
-
link: link.trim() || void 0
|
|
108
|
-
})
|
|
109
|
-
});
|
|
110
|
-
if (!res.ok) {
|
|
111
|
-
const e2 = await res.json().catch(() => null);
|
|
112
|
-
throw new Error(e2?.error ?? res.statusText);
|
|
113
|
-
}
|
|
114
|
-
setId("");
|
|
115
|
-
setName("");
|
|
116
|
-
setLink("");
|
|
117
|
-
onRegistered();
|
|
118
|
-
} catch (e2) {
|
|
119
|
-
setErr(e2.message);
|
|
120
|
-
} finally {
|
|
121
|
-
setSubmitting(false);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
return /* @__PURE__ */ jsxs("form", {
|
|
125
|
-
className: "card",
|
|
126
|
-
onSubmit: submit,
|
|
127
|
-
children: [
|
|
128
|
-
/* @__PURE__ */ jsx("h3", { children: "register team" }),
|
|
129
|
-
err && /* @__PURE__ */ jsx("div", {
|
|
130
|
-
className: "err",
|
|
131
|
-
children: err
|
|
132
|
-
}),
|
|
133
|
-
/* @__PURE__ */ jsxs("p", {
|
|
134
|
-
className: "muted",
|
|
135
|
-
children: [
|
|
136
|
-
"Teams always live under ",
|
|
137
|
-
/* @__PURE__ */ jsx("code", { children: "~/.bazilion/teams/<slug>/" }),
|
|
138
|
-
". Leave the link target blank to create a fresh directory; supply an absolute path to materialize the slot as a symlink to your existing project tree instead."
|
|
139
|
-
]
|
|
140
|
-
}),
|
|
141
|
-
/* @__PURE__ */ jsxs("div", {
|
|
142
|
-
className: "flex gap-4",
|
|
143
|
-
children: [/* @__PURE__ */ jsxs("label", {
|
|
144
|
-
className: "flex-1",
|
|
145
|
-
children: ["id (slug)", /* @__PURE__ */ jsx("input", {
|
|
146
|
-
value: id,
|
|
147
|
-
onChange: (e) => setId(e.target.value),
|
|
148
|
-
required: true,
|
|
149
|
-
placeholder: "myproject"
|
|
150
|
-
})]
|
|
151
|
-
}), /* @__PURE__ */ jsxs("label", {
|
|
152
|
-
className: "flex-1",
|
|
153
|
-
children: ["name", /* @__PURE__ */ jsx("input", {
|
|
154
|
-
value: name,
|
|
155
|
-
onChange: (e) => setName(e.target.value),
|
|
156
|
-
placeholder: "My Project"
|
|
157
|
-
})]
|
|
158
|
-
})]
|
|
159
|
-
}),
|
|
160
|
-
/* @__PURE__ */ jsxs("label", { children: ["link target (optional, absolute path)", /* @__PURE__ */ jsx("input", {
|
|
161
|
-
value: link,
|
|
162
|
-
onChange: (e) => setLink(e.target.value),
|
|
163
|
-
placeholder: "/home/user/projects/myproject"
|
|
164
|
-
})] }),
|
|
165
|
-
/* @__PURE__ */ jsx("button", {
|
|
166
|
-
type: "submit",
|
|
167
|
-
disabled: submitting,
|
|
168
|
-
children: submitting ? "registering…" : "register"
|
|
169
|
-
})
|
|
170
|
-
]
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
//#endregion
|
|
174
|
-
export { TeamsPage as component };
|
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
import { t as Route } from "./tokens-DdpnfV_Y.js";
|
|
2
|
-
import { t as ConfigTabs } from "./ConfigTabs-CyuxzesF.js";
|
|
3
|
-
import { useState } from "react";
|
|
4
|
-
import { useRouter } from "@tanstack/react-router";
|
|
5
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
-
//#region src/routes/config/tokens.tsx?tsr-split=component
|
|
7
|
-
function fmtTs(ts) {
|
|
8
|
-
return new Date(ts).toISOString().slice(0, 16).replace("T", " ");
|
|
9
|
-
}
|
|
10
|
-
function TokensPage() {
|
|
11
|
-
const { tokens } = Route.useLoaderData();
|
|
12
|
-
const { all } = Route.useSearch();
|
|
13
|
-
const includeRevoked = all === "1";
|
|
14
|
-
const router = useRouter();
|
|
15
|
-
const [label, setLabel] = useState("");
|
|
16
|
-
const [created, setCreated] = useState(null);
|
|
17
|
-
const [err, setErr] = useState(null);
|
|
18
|
-
const [busy, setBusy] = useState(false);
|
|
19
|
-
async function mint(e) {
|
|
20
|
-
e.preventDefault();
|
|
21
|
-
setErr(null);
|
|
22
|
-
setBusy(true);
|
|
23
|
-
try {
|
|
24
|
-
const res = await fetch("/api/tokens", {
|
|
25
|
-
method: "POST",
|
|
26
|
-
headers: { "content-type": "application/json" },
|
|
27
|
-
body: JSON.stringify({ label })
|
|
28
|
-
});
|
|
29
|
-
if (!res.ok) {
|
|
30
|
-
const j = await res.json().catch(() => ({}));
|
|
31
|
-
throw new Error(j.error ?? `${res.status} ${res.statusText}`);
|
|
32
|
-
}
|
|
33
|
-
setCreated((await res.json()).token);
|
|
34
|
-
setLabel("");
|
|
35
|
-
await router.invalidate();
|
|
36
|
-
} catch (e) {
|
|
37
|
-
setErr(e.message);
|
|
38
|
-
} finally {
|
|
39
|
-
setBusy(false);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
async function revoke(id) {
|
|
43
|
-
await fetch(`/api/tokens/${id}`, { method: "DELETE" });
|
|
44
|
-
await router.invalidate();
|
|
45
|
-
}
|
|
46
|
-
return /* @__PURE__ */ jsxs("main", {
|
|
47
|
-
className: "mx-auto max-w-5xl px-6 py-8",
|
|
48
|
-
children: [
|
|
49
|
-
/* @__PURE__ */ jsx("h1", {
|
|
50
|
-
className: "font-serif text-3xl text-foreground mb-2",
|
|
51
|
-
children: "config"
|
|
52
|
-
}),
|
|
53
|
-
/* @__PURE__ */ jsx(ConfigTabs, { active: "tokens" }),
|
|
54
|
-
/* @__PURE__ */ jsxs("p", {
|
|
55
|
-
className: "text-muted-foreground text-sm mb-6",
|
|
56
|
-
children: [
|
|
57
|
-
"Per-client credentials for the HTTP API and CLI. The row labelled",
|
|
58
|
-
" ",
|
|
59
|
-
/* @__PURE__ */ jsx("code", {
|
|
60
|
-
className: "font-mono",
|
|
61
|
-
children: "bootstrap"
|
|
62
|
-
}),
|
|
63
|
-
" is the loopback token in",
|
|
64
|
-
" ",
|
|
65
|
-
/* @__PURE__ */ jsx("code", {
|
|
66
|
-
className: "font-mono",
|
|
67
|
-
children: "~/.bazilion/auth.json"
|
|
68
|
-
}),
|
|
69
|
-
" — revoking it locks the local CLI out, so it can't be revoked from this page. Mint additional tokens here for Tailscale/LAN clients (mobile, remote machines); revoke any of those at any time."
|
|
70
|
-
]
|
|
71
|
-
}),
|
|
72
|
-
/* @__PURE__ */ jsxs("section", {
|
|
73
|
-
className: "rounded-lg border bg-card p-5 mb-6",
|
|
74
|
-
children: [
|
|
75
|
-
/* @__PURE__ */ jsx("h3", {
|
|
76
|
-
className: "font-serif text-xl mb-3",
|
|
77
|
-
children: "Mint a new token"
|
|
78
|
-
}),
|
|
79
|
-
/* @__PURE__ */ jsxs("form", {
|
|
80
|
-
onSubmit: mint,
|
|
81
|
-
className: "flex gap-2 items-end mb-3",
|
|
82
|
-
children: [/* @__PURE__ */ jsxs("label", {
|
|
83
|
-
className: "text-sm",
|
|
84
|
-
children: ["Label", /* @__PURE__ */ jsx("input", {
|
|
85
|
-
type: "text",
|
|
86
|
-
value: label,
|
|
87
|
-
onChange: (e) => setLabel(e.target.value),
|
|
88
|
-
required: true,
|
|
89
|
-
placeholder: "e.g. laptop-tailscale",
|
|
90
|
-
autoComplete: "off",
|
|
91
|
-
className: "block mt-1 rounded-md border bg-background px-3 py-2 text-sm w-72"
|
|
92
|
-
})]
|
|
93
|
-
}), /* @__PURE__ */ jsx("button", {
|
|
94
|
-
type: "submit",
|
|
95
|
-
disabled: busy,
|
|
96
|
-
className: "rounded-md bg-primary px-3 py-2 text-sm font-medium text-primary-foreground disabled:opacity-50",
|
|
97
|
-
children: busy ? "creating…" : "create"
|
|
98
|
-
})]
|
|
99
|
-
}),
|
|
100
|
-
created && /* @__PURE__ */ jsxs("div", {
|
|
101
|
-
className: "rounded-md border border-amber-200 bg-amber-50 p-3",
|
|
102
|
-
children: [/* @__PURE__ */ jsx("p", {
|
|
103
|
-
className: "text-xs text-amber-800 mb-1",
|
|
104
|
-
children: "copy this token now — it is not recoverable later."
|
|
105
|
-
}), /* @__PURE__ */ jsx("pre", {
|
|
106
|
-
className: "font-mono text-xs whitespace-pre-wrap break-all",
|
|
107
|
-
children: created
|
|
108
|
-
})]
|
|
109
|
-
}),
|
|
110
|
-
err && /* @__PURE__ */ jsx("p", {
|
|
111
|
-
className: "text-sm text-rose-700",
|
|
112
|
-
children: err
|
|
113
|
-
})
|
|
114
|
-
]
|
|
115
|
-
}),
|
|
116
|
-
/* @__PURE__ */ jsx("div", {
|
|
117
|
-
className: "mb-3",
|
|
118
|
-
children: /* @__PURE__ */ jsxs("label", {
|
|
119
|
-
className: "text-sm flex items-center gap-2",
|
|
120
|
-
children: [/* @__PURE__ */ jsx("input", {
|
|
121
|
-
type: "checkbox",
|
|
122
|
-
checked: includeRevoked,
|
|
123
|
-
onChange: (e) => {
|
|
124
|
-
window.location.assign(e.target.checked ? "/config/tokens?all=1" : "/config/tokens");
|
|
125
|
-
}
|
|
126
|
-
}), "show revoked"]
|
|
127
|
-
})
|
|
128
|
-
}),
|
|
129
|
-
/* @__PURE__ */ jsxs("table", {
|
|
130
|
-
className: "w-full text-sm",
|
|
131
|
-
children: [/* @__PURE__ */ jsx("thead", {
|
|
132
|
-
className: "text-left text-muted-foreground border-b",
|
|
133
|
-
children: /* @__PURE__ */ jsxs("tr", { children: [
|
|
134
|
-
/* @__PURE__ */ jsx("th", {
|
|
135
|
-
className: "py-2",
|
|
136
|
-
children: "label"
|
|
137
|
-
}),
|
|
138
|
-
/* @__PURE__ */ jsx("th", { children: "id" }),
|
|
139
|
-
/* @__PURE__ */ jsx("th", { children: "state" }),
|
|
140
|
-
/* @__PURE__ */ jsx("th", { children: "created" }),
|
|
141
|
-
/* @__PURE__ */ jsx("th", { children: "last used" }),
|
|
142
|
-
/* @__PURE__ */ jsx("th", {})
|
|
143
|
-
] })
|
|
144
|
-
}), /* @__PURE__ */ jsxs("tbody", { children: [tokens.length === 0 && /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", {
|
|
145
|
-
colSpan: 6,
|
|
146
|
-
className: "py-6 text-center text-muted-foreground italic",
|
|
147
|
-
children: "no tokens yet — mint one above"
|
|
148
|
-
}) }), tokens.map((t) => {
|
|
149
|
-
const isBootstrap = t.label === "bootstrap";
|
|
150
|
-
return /* @__PURE__ */ jsxs("tr", {
|
|
151
|
-
className: "border-b last:border-0 hover:bg-accent/30",
|
|
152
|
-
children: [
|
|
153
|
-
/* @__PURE__ */ jsxs("td", {
|
|
154
|
-
className: "py-2",
|
|
155
|
-
children: [t.label, isBootstrap && /* @__PURE__ */ jsx("span", {
|
|
156
|
-
className: "ml-2 text-[0.7em] uppercase tracking-wide text-muted-foreground",
|
|
157
|
-
children: "auth.json"
|
|
158
|
-
})]
|
|
159
|
-
}),
|
|
160
|
-
/* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsx("code", {
|
|
161
|
-
className: "font-mono text-xs",
|
|
162
|
-
children: t.id
|
|
163
|
-
}) }),
|
|
164
|
-
/* @__PURE__ */ jsx("td", { children: t.revokedAt ? /* @__PURE__ */ jsx("span", {
|
|
165
|
-
className: "text-muted-foreground",
|
|
166
|
-
children: "revoked"
|
|
167
|
-
}) : /* @__PURE__ */ jsx("span", {
|
|
168
|
-
className: "text-emerald-700",
|
|
169
|
-
children: "active"
|
|
170
|
-
}) }),
|
|
171
|
-
/* @__PURE__ */ jsx("td", {
|
|
172
|
-
className: "text-muted-foreground text-xs",
|
|
173
|
-
children: fmtTs(t.createdAt)
|
|
174
|
-
}),
|
|
175
|
-
/* @__PURE__ */ jsx("td", {
|
|
176
|
-
className: "text-muted-foreground text-xs",
|
|
177
|
-
children: t.lastUsedAt ? fmtTs(t.lastUsedAt) : "(never)"
|
|
178
|
-
}),
|
|
179
|
-
/* @__PURE__ */ jsx("td", { children: !t.revokedAt && !isBootstrap && /* @__PURE__ */ jsx("button", {
|
|
180
|
-
type: "button",
|
|
181
|
-
onClick: () => revoke(t.id),
|
|
182
|
-
className: "rounded-md border px-2 py-1 text-xs text-rose-700 hover:bg-rose-50",
|
|
183
|
-
children: "revoke"
|
|
184
|
-
}) })
|
|
185
|
-
]
|
|
186
|
-
}, t.id);
|
|
187
|
-
})] })]
|
|
188
|
-
})
|
|
189
|
-
]
|
|
190
|
-
});
|
|
191
|
-
}
|
|
192
|
-
//#endregion
|
|
193
|
-
export { TokensPage as component };
|