bazilion 0.8.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.
Files changed (217) hide show
  1. package/README.md +47 -5
  2. package/dist/cli.js +1190 -640
  3. package/dist/cli.js.map +1 -1
  4. package/dist/daemon.js +5165 -1598
  5. package/dist/daemon.js.map +1 -1
  6. package/dist/migrations/0001_init.sql +318 -88
  7. package/dist/web/client/assets/AgentTabs-B3hq5a3e.js +1 -0
  8. package/dist/web/client/assets/ConfigPage-BCwfgyjD.js +1 -0
  9. package/dist/web/client/assets/FieldRow-avAFLgYW.js +1 -0
  10. package/dist/web/client/assets/Page-CwNuDhWz.js +1 -0
  11. package/dist/web/client/assets/ProductionTeamPolicyEditor-CiQ-VVDo.js +7 -0
  12. package/dist/web/client/assets/ProductionTeamPolicyEditor-DLioOiRN.css +1 -0
  13. package/dist/web/client/assets/ProfileCommunicationEditor-D84F5yfr.js +1 -0
  14. package/dist/web/client/assets/RecoveryState-QfMSuwy3.js +1 -0
  15. package/dist/web/client/assets/SectionTabs-DZzy01az.js +1 -0
  16. package/dist/web/client/assets/TeamTabs-Btoe_FAE.js +1 -0
  17. package/dist/web/client/assets/TemplatesTabs-CAYY03F5.js +1 -0
  18. package/dist/web/client/assets/_id-BeauECmk.js +1 -0
  19. package/dist/web/client/assets/_id-BqU2BodK.js +1 -0
  20. package/dist/web/client/assets/_id-CKtoio3t.js +1 -0
  21. package/dist/web/client/assets/_id-DGyKURCp.js +1 -0
  22. package/dist/web/client/assets/_id-Q98Of6k9.js +1 -0
  23. package/dist/web/client/assets/activity-DJuhhQCb.js +1 -0
  24. package/dist/web/client/assets/activity-DXN_N85w.js +1 -0
  25. package/dist/web/client/assets/agents-C5Xsdge1.js +1 -0
  26. package/dist/web/client/assets/agents-Cgxo4H5G.js +1 -0
  27. package/dist/web/client/assets/approvals-BnG7fbw-.js +1 -0
  28. package/dist/web/client/assets/approvals-DGi0PSx8.js +1 -0
  29. package/dist/web/client/assets/chevron-down-BhcBspw3.js +1 -0
  30. package/dist/web/client/assets/config-xw4NyrXF.js +3 -0
  31. package/dist/web/client/assets/context-D2V1Oi4z.js +1 -0
  32. package/dist/web/client/assets/inbox-DK6hWCMp.js +1 -0
  33. package/dist/web/client/assets/index-VdURSoM4.js +12 -0
  34. package/dist/web/client/assets/login-CvptUoMR.js +1 -0
  35. package/dist/web/client/assets/mcp-BDFM_sW-.js +1 -0
  36. package/dist/web/client/assets/members-BJvph_TR.js +1 -0
  37. package/dist/web/client/assets/memory-DRytqZCD.js +1 -0
  38. package/dist/web/client/assets/plus-C9ee3SIO.js +1 -0
  39. package/dist/web/client/assets/policy-CGP50OtQ.js +1 -0
  40. package/dist/web/client/assets/policy-K4hIbbIN.js +1 -0
  41. package/dist/web/client/assets/preload-helper-mNuBjNXU.js +1 -0
  42. package/dist/web/client/assets/react-3W8R1pOO.js +1 -0
  43. package/dist/web/client/assets/routes-DJnWYvC9.js +1 -0
  44. package/dist/web/client/assets/services-DHheiv7L.js +1 -0
  45. package/dist/web/client/assets/skills-DmsitluU.js +1 -0
  46. package/dist/web/client/assets/styles-B5eQAwLP.css +2 -0
  47. package/dist/web/client/assets/team-policy-D0jpnn2b.js +1 -0
  48. package/dist/web/client/assets/teams-BdC4gthq.js +1 -0
  49. package/dist/web/client/assets/teams-CSNyLz3l.js +1 -0
  50. package/dist/web/client/assets/teams-CbxSaorm.js +1 -0
  51. package/dist/web/client/assets/telegram-D61G_alO.js +1 -0
  52. package/dist/web/client/assets/tokens-CjRplDrJ.js +1 -0
  53. package/dist/web/client/assets/triggers-MLzTm_DM.js +1 -0
  54. package/dist/web/client/assets/welcome-wBfX9dAd.js +1 -0
  55. package/dist/web/client/assets/{ChatPane-DzEgOEqS.js → wire-constants-BxfyUMXB.js} +4 -4
  56. package/dist/web/server/assets/{AgentTabs-BOjTN7QF.js → AgentTabs-DoMDJBXH.js} +10 -7
  57. package/dist/web/server/assets/{ChatPane-BvpswYvF.js → ChatPane-eUY_dga3.js} +38 -20
  58. package/dist/web/server/assets/ConfigPage-BKlh5vOU.js +68 -0
  59. package/dist/web/server/assets/{FieldRow-DwyqycWI.js → FieldRow-B4eTegH9.js} +5 -5
  60. package/dist/web/server/assets/Page-LENulSXY.js +111 -0
  61. package/dist/web/server/assets/ProductionTeamPolicyEditor-Y4mzFFvR.js +1009 -0
  62. package/dist/web/server/assets/ProfileCommunicationEditor-C2RU-2QB.js +107 -0
  63. package/dist/web/server/assets/RecoveryState-B2SG-mrY.js +37 -0
  64. package/dist/web/server/assets/SectionTabs-BJTPr5nU.js +8 -0
  65. package/dist/web/server/assets/Sidebar-O_CH1-JD.js +964 -0
  66. package/dist/web/server/assets/TeamTabs-zZzbP1t_.js +51 -0
  67. package/dist/web/server/assets/{TemplatesTabs---7h5GYa.js → TemplatesTabs-CcRxZhJe.js} +9 -8
  68. package/dist/web/server/assets/_id-A8Xiv6Lc.js +11 -0
  69. package/dist/web/server/assets/{_id-Sjw0zhA6.js → _id-BhOB8Umi.js} +5 -5
  70. package/dist/web/server/assets/{_id-DDixKEud.js → _id-C3HY4lWg.js} +77 -20
  71. package/dist/web/server/assets/{_id-BdRiQb2H.js → _id-ClN9hY2x.js} +132 -39
  72. package/dist/web/server/assets/{_id-BqnDy_Ca.js → _id-CwyGjJeP.js} +7 -6
  73. package/dist/web/server/assets/{_id-D8duqgd5.js → _id-D27T85mU.js} +6 -5
  74. package/dist/web/server/assets/_id-D3Ap7zZA.js +377 -0
  75. package/dist/web/server/assets/_id-DinTp_7X.js +14 -0
  76. package/dist/web/server/assets/{_id-CnQflrRv.js → _id-Dj1yZ3zJ.js} +6 -6
  77. package/dist/web/server/assets/{_id-DUIrFV3G.js → _id-DkYodSkG.js} +10 -2
  78. package/dist/web/server/assets/{_id-D_Ew11ED.js → _id-IzadFZV9.js} +9 -9
  79. package/dist/web/server/assets/_id-LrvXU4Nr.js +45 -0
  80. package/dist/web/server/assets/_id-tB47Vsfp.js +42 -0
  81. package/dist/web/server/assets/_tanstack-start-manifest_v-D09Xu_6u.js +286 -0
  82. package/dist/web/server/assets/activity-BCI4mfNS.js +168 -0
  83. package/dist/web/server/assets/activity-CGCf8BQf.js +11 -0
  84. package/dist/web/server/assets/activity-D9SMqBhy.js +14 -0
  85. package/dist/web/server/assets/activity-DohitgwW.js +12 -0
  86. package/dist/web/server/assets/{agents-k5QURC4I.js → agents-BPKOshR5.js} +5 -5
  87. package/dist/web/server/assets/{profiles-C6a3RKgu.js → agents-BY74v7fM.js} +5 -5
  88. package/dist/web/server/assets/{profiles-CZ5NkmVw.js → agents-BvttypqB.js} +5 -5
  89. package/dist/web/server/assets/{agents-ChcAJUI5.js → agents-C9xlWK0Z.js} +2 -2
  90. package/dist/web/server/assets/agents-CgZMHj80.js +265 -0
  91. package/dist/web/server/assets/{profiles-LxcC_L6n.js → agents-DZuFEj0D.js} +87 -79
  92. package/dist/web/server/assets/approvals-BGU-XGIO.js +12 -0
  93. package/dist/web/server/assets/approvals-CWcFHlor.js +14 -0
  94. package/dist/web/server/assets/approvals-CbFXFvG8.js +11 -0
  95. package/dist/web/server/assets/approvals-DCaVw1Mz.js +280 -0
  96. package/dist/web/server/assets/{auth-DzRAMwVt.js → auth-byfSx6Ja.js} +6 -2
  97. package/dist/web/server/assets/{config-CHaCv89D.js → config-BDCJdtj2.js} +1 -1
  98. package/dist/web/server/assets/{config-CdVjqjin.js → config-D2LAsud2.js} +31 -52
  99. package/dist/web/server/assets/{config-Bq3o924J.js → config-TeIoyYYc.js} +2 -2
  100. package/dist/web/server/assets/context-B-XDf6Ym.js +12 -0
  101. package/dist/web/server/assets/context-BXGo5Vfi.js +12 -0
  102. package/dist/web/server/assets/context-DrkrIWun.js +47 -0
  103. package/dist/web/server/assets/{createServerRpc-CeKECg65.js → createServerRpc-pU-IQV2Y.js} +1 -1
  104. package/dist/web/server/assets/{createSsrRpc-ZBGxhl8t.js → createSsrRpc-DFsIAfFd.js} +1 -1
  105. package/dist/web/server/assets/{empty-plugin-adapters-DKUlnwwl.js → empty-plugin-adapters-Cq4--YW-.js} +1 -1
  106. package/dist/web/server/assets/{inbox-CkiSvD14.js → inbox-B3-TRsNI.js} +1 -1
  107. package/dist/web/server/assets/{inbox-Bxb3W04M.js → inbox-BardsGyy.js} +2 -2
  108. package/dist/web/server/assets/inbox-CUIyf9MT.js +131 -0
  109. package/dist/web/server/assets/login-Bx5LEyGP.js +118 -0
  110. package/dist/web/server/assets/login-CmWvxfTK.js +136 -0
  111. package/dist/web/server/assets/{mcp-BsFKEoXt.js → mcp-2pwT9HU8.js} +1 -1
  112. package/dist/web/server/assets/{mcp-BU_kKENi.js → mcp-BJjLIdP0.js} +105 -112
  113. package/dist/web/server/assets/{mcp-CKqwG4mt.js → mcp-DIWTogHM.js} +2 -2
  114. package/dist/web/server/assets/members-CCv17cjQ.js +46 -0
  115. package/dist/web/server/assets/members-CW5aBe81.js +12 -0
  116. package/dist/web/server/assets/members-VdPwD6CE.js +12 -0
  117. package/dist/web/server/assets/{memory-BaYnfm7K.js → memory-Dngc13Nw.js} +9 -9
  118. package/dist/web/server/assets/{memory-CQaqWnyM.js → memory-a8Kz57Kh.js} +22 -19
  119. package/dist/web/server/assets/{memory-Ns2-Z31p.js → memory-pZ4pZT7p.js} +6 -6
  120. package/dist/web/server/assets/policy-BYVXqsan.js +11 -0
  121. package/dist/web/server/assets/policy-Bb-vEgqg.js +40 -0
  122. package/dist/web/server/assets/policy-BcGELcc9.js +490 -0
  123. package/dist/web/server/assets/policy-C30AeFIb.js +21 -0
  124. package/dist/web/server/assets/router-DIdp8ZNt.js +504 -0
  125. package/dist/web/server/assets/{routes-C61gBiXa.js → routes-CXz4hTAr.js} +6 -6
  126. package/dist/web/server/assets/{routes-Ce2VWrU9.js → routes-Jb0zjKav.js} +16 -13
  127. package/dist/web/server/assets/{routes-V9URcp1v.js → routes-lIclH9Br.js} +2 -2
  128. package/dist/web/server/assets/services-B9yBWDX0.js +79 -0
  129. package/dist/web/server/assets/{services-Ccc5s2bS.js → services-C4szdhPx.js} +4 -4
  130. package/dist/web/server/assets/{services-DhRiNeq0.js → services-wG8I06oS.js} +1 -1
  131. package/dist/web/server/assets/skills-BZdqiDig.js +358 -0
  132. package/dist/web/server/assets/{skills-l2cyQ3zS.js → skills-C-UgkuCW.js} +2 -2
  133. package/dist/web/server/assets/{skills-CFIWVg32.js → skills-a9VSWHWq.js} +1 -1
  134. package/dist/web/server/assets/{start-CYDpZ6cb.js → start-WH8WzTL_.js} +1 -1
  135. package/dist/web/server/assets/team-policy-vPG01onj.js +180 -0
  136. package/dist/web/server/assets/teams-3im0oQnS.js +11 -0
  137. package/dist/web/server/assets/teams-CpQ0YgWf.js +112 -0
  138. package/dist/web/server/assets/teams-DEpQR2QA.js +14 -0
  139. package/dist/web/server/assets/teams-DqfrEoH6.js +36 -0
  140. package/dist/web/server/assets/teams-MjqgsmC3.js +12 -0
  141. package/dist/web/server/assets/teams-OIkHuxy1.js +12 -0
  142. package/dist/web/server/assets/teams-jBtvnk59.js +193 -0
  143. package/dist/web/server/assets/{telegram-DfAddLdv.js → telegram-7ub--6xz.js} +44 -56
  144. package/dist/web/server/assets/{telegram-T3l9KtiE.js → telegram-Bazhmpr4.js} +2 -2
  145. package/dist/web/server/assets/{telegram-BdaUIjvs.js → telegram-DNgCWebD.js} +1 -1
  146. package/dist/web/server/assets/{tokens-DdpnfV_Y.js → tokens-BnwFbV7T.js} +2 -2
  147. package/dist/web/server/assets/{tokens-BCz3PSoT.js → tokens-DPDMSN5O.js} +1 -1
  148. package/dist/web/server/assets/tokens-yyTSfBSN.js +186 -0
  149. package/dist/web/server/assets/{triggers-BzJG1nN5.js → triggers-BMpHsGIr.js} +5 -4
  150. package/dist/web/server/assets/{triggers-BcH_6PW1.js → triggers-C_0y6QV9.js} +1 -1
  151. package/dist/web/server/assets/{triggers-BcTTwMfy.js → triggers-Ca57_qym.js} +2 -2
  152. package/dist/web/server/assets/{welcome-CP4CZ9B6.js → welcome-IYHGurWx.js} +23 -15
  153. package/dist/web/server/assets/{wire-constants-Deb4NxBb.js → wire-constants-C8nBJcU3.js} +3 -3
  154. package/dist/web/server/server.js +126 -95
  155. package/dist/worker.js +185 -146
  156. package/dist/worker.js.map +1 -1
  157. package/package.json +8 -7
  158. package/dist/migrations/0002_profile_groups.sql +0 -38
  159. package/dist/migrations/0003_agent_telegram.sql +0 -40
  160. package/dist/migrations/0004_agent_mirror_mode.sql +0 -17
  161. package/dist/migrations/0005_group_topic_name_format.sql +0 -15
  162. package/dist/migrations/0006_telegram_acl.sql +0 -18
  163. package/dist/migrations/0007_mcp_servers.sql +0 -30
  164. package/dist/migrations/0008_seed_user_md.sql +0 -39
  165. package/dist/web/client/assets/AgentTabs-DioGqUVR.js +0 -1
  166. package/dist/web/client/assets/ConfigTabs-pY-V0Rie.js +0 -1
  167. package/dist/web/client/assets/FieldRow-CNKma5LE.js +0 -1
  168. package/dist/web/client/assets/MembersEditor-C6UpqDdV.js +0 -1
  169. package/dist/web/client/assets/SpawnTeamModal-BEkNCKXm.js +0 -1
  170. package/dist/web/client/assets/TemplatesTabs-UM04RMO9.js +0 -1
  171. package/dist/web/client/assets/_id-BNJapCT4.js +0 -1
  172. package/dist/web/client/assets/_id-CjGoV8Mr.js +0 -1
  173. package/dist/web/client/assets/_id-DehuCHUw.js +0 -1
  174. package/dist/web/client/assets/_id-Dz9fjcCM.js +0 -1
  175. package/dist/web/client/assets/agents-M6omAXcZ.js +0 -1
  176. package/dist/web/client/assets/config-DIuEc5bm.js +0 -3
  177. package/dist/web/client/assets/groups-DpE2d2zZ.js +0 -1
  178. package/dist/web/client/assets/inbox-BPnLsRNf.js +0 -1
  179. package/dist/web/client/assets/index-MAJuXnie.js +0 -12
  180. package/dist/web/client/assets/login-CawJX16E.js +0 -1
  181. package/dist/web/client/assets/mcp-DIrh9-v_.js +0 -1
  182. package/dist/web/client/assets/memory-BpHbdKsd.js +0 -1
  183. package/dist/web/client/assets/preload-helper-CvnapA2_.js +0 -1
  184. package/dist/web/client/assets/profile-groups-ByoKak0c.js +0 -1
  185. package/dist/web/client/assets/profiles-BEjv8LGo.js +0 -1
  186. package/dist/web/client/assets/routes-D2COHy7v.js +0 -1
  187. package/dist/web/client/assets/services-D212jSK_.js +0 -1
  188. package/dist/web/client/assets/skills-Da0MURjY.js +0 -1
  189. package/dist/web/client/assets/styles-BgE5bCHA.css +0 -2
  190. package/dist/web/client/assets/telegram-Czh2MdVm.js +0 -1
  191. package/dist/web/client/assets/tokens-E_JvO5JN.js +0 -1
  192. package/dist/web/client/assets/triggers-BBRZQOm7.js +0 -1
  193. package/dist/web/client/assets/welcome-Dn-zvmBE.js +0 -1
  194. package/dist/web/client/assets/wire-constants-BkT5-597.js +0 -1
  195. package/dist/web/server/assets/ConfigTabs-CyuxzesF.js +0 -41
  196. package/dist/web/server/assets/MembersEditor-BWQztvrX.js +0 -131
  197. package/dist/web/server/assets/Sidebar-DmEiewRN.js +0 -529
  198. package/dist/web/server/assets/SpawnTeamModal-dSN421k_.js +0 -107
  199. package/dist/web/server/assets/_id-BKev9H1p.js +0 -12
  200. package/dist/web/server/assets/_id-BNwlbWHP.js +0 -24
  201. package/dist/web/server/assets/_id-CRqqi8IE.js +0 -161
  202. package/dist/web/server/assets/_id-CXg-Blec.js +0 -367
  203. package/dist/web/server/assets/_tanstack-start-manifest_v-D9FLKShQ.js +0 -178
  204. package/dist/web/server/assets/agents-C7SBPN0M.js +0 -210
  205. package/dist/web/server/assets/groups-CbSwND2r.js +0 -12
  206. package/dist/web/server/assets/groups-CeRRlZaZ.js +0 -150
  207. package/dist/web/server/assets/groups-pk4CYSuf.js +0 -21
  208. package/dist/web/server/assets/inbox-DU27iHv_.js +0 -133
  209. package/dist/web/server/assets/login-CNznncgA.js +0 -58
  210. package/dist/web/server/assets/login-CQybKk7Y.js +0 -74
  211. package/dist/web/server/assets/profile-groups-CiU06yN1.js +0 -28
  212. package/dist/web/server/assets/profile-groups-D21MYoLM.js +0 -208
  213. package/dist/web/server/assets/profile-groups-aoJleXHP.js +0 -12
  214. package/dist/web/server/assets/router-BrDascdO.js +0 -460
  215. package/dist/web/server/assets/services-B91w2f-X.js +0 -94
  216. package/dist/web/server/assets/skills-D89ND2kR.js +0 -321
  217. package/dist/web/server/assets/tokens-CkKqrtk-.js +0 -193
@@ -1,321 +0,0 @@
1
- import { t as Route } from "./skills-l2cyQ3zS.js";
2
- import { useRef, useState } from "react";
3
- import { useRouter } from "@tanstack/react-router";
4
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
- //#region src/routes/skills/index.tsx?tsr-split=component
6
- function SkillsPage() {
7
- const skills = Route.useLoaderData();
8
- const router = useRouter();
9
- async function remove(name) {
10
- if (!confirm(`remove skill "${name}"? this deletes the directory on disk.`)) return;
11
- const res = await fetch(`/api/skills/${encodeURIComponent(name)}`, { method: "DELETE" });
12
- if (!res.ok && res.status !== 204) {
13
- alert(res.statusText);
14
- return;
15
- }
16
- await router.invalidate();
17
- }
18
- return /* @__PURE__ */ jsxs("div", { children: [
19
- /* @__PURE__ */ jsx("h1", { children: "skills" }),
20
- /* @__PURE__ */ jsx(ImportCard, { onImported: () => router.invalidate() }),
21
- /* @__PURE__ */ jsxs("table", { children: [/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [
22
- /* @__PURE__ */ jsx("th", { children: "name" }),
23
- /* @__PURE__ */ jsx("th", { children: "description" }),
24
- /* @__PURE__ */ jsx("th", { children: "scan" }),
25
- /* @__PURE__ */ jsx("th", { children: "source" }),
26
- /* @__PURE__ */ jsx("th", {})
27
- ] }) }), /* @__PURE__ */ jsxs("tbody", { children: [skills.length === 0 && /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", {
28
- colSpan: 5,
29
- className: "muted",
30
- children: "no skills installed yet"
31
- }) }), skills.map((s) => /* @__PURE__ */ jsxs("tr", { children: [
32
- /* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsx("code", { children: s.name }) }),
33
- /* @__PURE__ */ jsx("td", { children: s.parseError ? /* @__PURE__ */ jsxs("span", {
34
- className: "text-[#9B3D3D]",
35
- children: ["parse error: ", s.parseError]
36
- }) : s.description }),
37
- /* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsx(FindingSummary, { findings: s.scanFindings ?? [] }) }),
38
- /* @__PURE__ */ jsxs("td", {
39
- className: "text-[0.78em] text-mocha-light",
40
- children: [/* @__PURE__ */ jsx("span", {
41
- className: "font-mono",
42
- children: s.source ?? "(unknown)"
43
- }), s.importedAt && /* @__PURE__ */ jsx("div", {
44
- className: "font-mono",
45
- children: new Date(s.importedAt).toLocaleDateString()
46
- })]
47
- }),
48
- /* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsx("button", {
49
- type: "button",
50
- className: "ghost-btn",
51
- onClick: () => remove(s.name),
52
- children: "remove"
53
- }) })
54
- ] }, s.name))] })] })
55
- ] });
56
- }
57
- function ImportCard({ onImported }) {
58
- const [tab, setTab] = useState("openclaw");
59
- const [path, setPath] = useState("");
60
- const [force, setForce] = useState(false);
61
- const [zipFile, setZipFile] = useState(null);
62
- const [dragOver, setDragOver] = useState(false);
63
- const [err, setErr] = useState(null);
64
- const [findings, setFindings] = useState([]);
65
- const [submitting, setSubmitting] = useState(false);
66
- const fileInput = useRef(null);
67
- async function submit(e) {
68
- e.preventDefault();
69
- setErr(null);
70
- setFindings([]);
71
- setSubmitting(true);
72
- try {
73
- let res;
74
- if (tab === "zip") {
75
- if (!zipFile) {
76
- setErr("choose a .zip file first");
77
- setSubmitting(false);
78
- return;
79
- }
80
- const fd = new FormData();
81
- fd.set("file", zipFile);
82
- if (force) fd.set("force", "true");
83
- res = await fetch("/api/skills/import", {
84
- method: "POST",
85
- body: fd
86
- });
87
- } else {
88
- let source;
89
- if (tab === "openclaw") source = "openclaw";
90
- else {
91
- source = path.trim();
92
- if (!source) {
93
- setErr("fill in the server path");
94
- setSubmitting(false);
95
- return;
96
- }
97
- }
98
- res = await fetch("/api/skills/import", {
99
- method: "POST",
100
- headers: { "content-type": "application/json" },
101
- body: JSON.stringify({
102
- source,
103
- force
104
- })
105
- });
106
- }
107
- if (!res.ok) {
108
- const e2 = await res.json().catch(() => null);
109
- setFindings(e2?.findings ?? []);
110
- throw new Error(e2?.error ?? `${res.status} ${res.statusText}`);
111
- }
112
- setFindings(flattenImportFindings((await res.json().catch(() => null))?.findings));
113
- setPath("");
114
- setZipFile(null);
115
- onImported();
116
- } catch (e2) {
117
- setErr(e2.message);
118
- } finally {
119
- setSubmitting(false);
120
- }
121
- }
122
- function onFileChange(e) {
123
- setZipFile(e.target.files?.[0] ?? null);
124
- }
125
- function onDrop(e) {
126
- e.preventDefault();
127
- setDragOver(false);
128
- const files = e.dataTransfer?.files;
129
- if (!files || files.length === 0) return;
130
- const f = files[0];
131
- if (!f) return;
132
- if (!/\.zip$/i.test(f.name)) {
133
- setErr("only .zip archives are supported");
134
- return;
135
- }
136
- setZipFile(f);
137
- if (fileInput.current) {
138
- const dt = new DataTransfer();
139
- dt.items.add(f);
140
- fileInput.current.files = dt.files;
141
- }
142
- }
143
- return /* @__PURE__ */ jsxs("section", {
144
- className: "card",
145
- children: [
146
- /* @__PURE__ */ jsx("h3", {
147
- className: "mb-1",
148
- children: "import skills"
149
- }),
150
- /* @__PURE__ */ jsxs("p", {
151
- className: "muted mb-3 text-[0.88em]",
152
- children: [
153
- "pick a source. Each skill's ",
154
- /* @__PURE__ */ jsx("code", { children: "SKILL.md" }),
155
- " body is injected into the system prompt of any agent it's attached to."
156
- ]
157
- }),
158
- /* @__PURE__ */ jsx("div", {
159
- role: "tablist",
160
- className: "mb-4 inline-flex gap-0 rounded-md border border-frost bg-ivory p-1",
161
- children: [
162
- {
163
- id: "openclaw",
164
- label: "OpenClaw"
165
- },
166
- {
167
- id: "path",
168
- label: "server directory"
169
- },
170
- {
171
- id: "zip",
172
- label: "upload zip"
173
- }
174
- ].map((it) => /* @__PURE__ */ jsx("button", {
175
- type: "button",
176
- role: "tab",
177
- "aria-selected": tab === it.id,
178
- onClick: () => {
179
- setTab(it.id);
180
- setErr(null);
181
- },
182
- className: `unstyled cursor-pointer rounded-sm border-none bg-transparent px-3 py-1.5 text-[0.88em] font-medium transition-colors ${tab === it.id ? "bg-snow text-sapphire-deep shadow-baziu-sm" : "text-mocha hover:text-sapphire"}`,
183
- children: it.label
184
- }, it.id))
185
- }),
186
- err && /* @__PURE__ */ jsx("div", {
187
- className: "err",
188
- children: err
189
- }),
190
- findings.length > 0 && /* @__PURE__ */ jsxs("div", {
191
- className: "mb-3 rounded-md border border-[#D7A3A3] bg-[#FFF7F5] p-3 text-[0.86em] text-[#7C2D2D]",
192
- children: [/* @__PURE__ */ jsx("div", {
193
- className: "mb-1 font-semibold",
194
- children: "scan findings"
195
- }), /* @__PURE__ */ jsx(FindingList, { findings })]
196
- }),
197
- /* @__PURE__ */ jsxs("form", {
198
- onSubmit: submit,
199
- children: [
200
- tab === "openclaw" && /* @__PURE__ */ jsxs("p", {
201
- className: "text-[0.92em] text-mocha",
202
- children: [
203
- "One-click import of every skill found in ",
204
- /* @__PURE__ */ jsx("code", { children: "~/.openclaw/skills" }),
205
- " on the server."
206
- ]
207
- }),
208
- tab === "path" && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("p", {
209
- className: "text-[0.92em] text-mocha",
210
- children: [
211
- "Import from an absolute path on the server — either a single skill folder (contains ",
212
- /* @__PURE__ */ jsx("code", { children: "SKILL.md" }),
213
- ") or a parent folder holding many skill subfolders."
214
- ]
215
- }), /* @__PURE__ */ jsxs("label", { children: ["server path", /* @__PURE__ */ jsx("input", {
216
- value: path,
217
- onChange: (e) => setPath(e.target.value),
218
- placeholder: "/home/you/my-skills",
219
- required: true
220
- })] })] }),
221
- tab === "zip" && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("p", {
222
- className: "text-[0.92em] text-mocha",
223
- children: [
224
- "Upload a ",
225
- /* @__PURE__ */ jsx("code", { children: ".zip" }),
226
- " archive whose top level contains one folder per skill — the folder name becomes the skill name."
227
- ]
228
- }), /* @__PURE__ */ jsxs("label", {
229
- onDragOver: (e) => {
230
- e.preventDefault();
231
- setDragOver(true);
232
- },
233
- onDragLeave: () => setDragOver(false),
234
- onDrop,
235
- className: `block cursor-pointer rounded-md border-2 border-dashed p-6 text-center transition-colors ${dragOver ? "border-sapphire bg-sapphire-glow text-sapphire-deep" : zipFile ? "border-solid border-sapphire-light bg-snow text-chocolate" : "border-frost bg-ivory text-mocha-light hover:border-sapphire hover:bg-sapphire-glow hover:text-sapphire-deep"}`,
236
- children: [/* @__PURE__ */ jsx("input", {
237
- ref: fileInput,
238
- type: "file",
239
- accept: ".zip,application/zip",
240
- onChange: onFileChange,
241
- className: "absolute h-px w-px overflow-hidden opacity-0"
242
- }), zipFile ? /* @__PURE__ */ jsx("span", {
243
- className: "block break-all font-mono text-[0.85em] text-sapphire-deep",
244
- children: zipFile.name
245
- }) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
246
- className: "block text-[0.95em] font-medium text-mocha",
247
- children: "click to choose a .zip file"
248
- }), /* @__PURE__ */ jsx("span", {
249
- className: "text-[0.82em]",
250
- children: "or drag & drop here"
251
- })] })]
252
- })] }),
253
- /* @__PURE__ */ jsxs("div", {
254
- className: "mt-3 flex flex-wrap items-center gap-3",
255
- children: [/* @__PURE__ */ jsx("button", {
256
- type: "submit",
257
- disabled: submitting,
258
- children: submitting ? "importing…" : tab === "zip" ? "upload & import" : tab === "openclaw" ? "import from OpenClaw" : "import"
259
- }), /* @__PURE__ */ jsxs("label", {
260
- className: "m-0 inline-flex cursor-pointer items-center text-[0.88em] text-mocha",
261
- children: [
262
- /* @__PURE__ */ jsx("input", {
263
- type: "checkbox",
264
- checked: force,
265
- onChange: (e) => setForce(e.target.checked)
266
- }),
267
- "overwrite existing",
268
- /* @__PURE__ */ jsx("span", {
269
- className: "ml-1 text-mocha-light",
270
- children: "/ confirm scan findings"
271
- })
272
- ]
273
- })]
274
- })
275
- ]
276
- })
277
- ]
278
- });
279
- }
280
- function FindingSummary({ findings }) {
281
- if (findings.length === 0) return /* @__PURE__ */ jsx("span", {
282
- className: "text-mocha-light",
283
- children: "clean"
284
- });
285
- return /* @__PURE__ */ jsxs("details", {
286
- className: "text-[0.82em]",
287
- children: [/* @__PURE__ */ jsxs("summary", {
288
- className: findings.some((f) => f.severity === "danger") ? "cursor-pointer text-[#9B3D3D]" : "cursor-pointer text-mocha",
289
- children: [
290
- findings.length,
291
- " finding",
292
- findings.length === 1 ? "" : "s"
293
- ]
294
- }), /* @__PURE__ */ jsx(FindingList, { findings })]
295
- });
296
- }
297
- function FindingList({ findings }) {
298
- return /* @__PURE__ */ jsx("ul", {
299
- className: "m-0 list-disc pl-4",
300
- children: findings.map((f, i) => /* @__PURE__ */ jsxs("li", { children: [
301
- /* @__PURE__ */ jsx("span", {
302
- className: "font-mono",
303
- children: f.severity
304
- }),
305
- ": ",
306
- f.code,
307
- f.line ? ` line ${f.line}` : "",
308
- " - ",
309
- f.message
310
- ] }, `${f.code}-${f.line ?? 0}-${i}`))
311
- });
312
- }
313
- function flattenImportFindings(findings) {
314
- if (!findings) return [];
315
- return Object.entries(findings).flatMap(([name, items]) => items.map((item) => ({
316
- ...item,
317
- message: `${name}: ${item.message}`
318
- })));
319
- }
320
- //#endregion
321
- export { SkillsPage 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 };