@aquaclawai/aquarium 1.0.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 (517) hide show
  1. package/dist/agent-types/claude-code/index.d.ts +2 -0
  2. package/dist/agent-types/claude-code/index.d.ts.map +1 -0
  3. package/dist/agent-types/claude-code/index.js +2 -0
  4. package/dist/agent-types/claude-code/index.js.map +1 -0
  5. package/dist/agent-types/claude-code/manifest.d.ts +3 -0
  6. package/dist/agent-types/claude-code/manifest.d.ts.map +1 -0
  7. package/dist/agent-types/claude-code/manifest.js +45 -0
  8. package/dist/agent-types/claude-code/manifest.js.map +1 -0
  9. package/dist/agent-types/openclaw/adapter.d.ts +3 -0
  10. package/dist/agent-types/openclaw/adapter.d.ts.map +1 -0
  11. package/dist/agent-types/openclaw/adapter.js +714 -0
  12. package/dist/agent-types/openclaw/adapter.js.map +1 -0
  13. package/dist/agent-types/openclaw/gateway-rpc.d.ts +21 -0
  14. package/dist/agent-types/openclaw/gateway-rpc.d.ts.map +1 -0
  15. package/dist/agent-types/openclaw/gateway-rpc.js +202 -0
  16. package/dist/agent-types/openclaw/gateway-rpc.js.map +1 -0
  17. package/dist/agent-types/openclaw/index.d.ts +3 -0
  18. package/dist/agent-types/openclaw/index.d.ts.map +1 -0
  19. package/dist/agent-types/openclaw/index.js +3 -0
  20. package/dist/agent-types/openclaw/index.js.map +1 -0
  21. package/dist/agent-types/openclaw/manifest.d.ts +137 -0
  22. package/dist/agent-types/openclaw/manifest.d.ts.map +1 -0
  23. package/dist/agent-types/openclaw/manifest.js +191 -0
  24. package/dist/agent-types/openclaw/manifest.js.map +1 -0
  25. package/dist/agent-types/openclaw/provider-registry.d.ts +46 -0
  26. package/dist/agent-types/openclaw/provider-registry.d.ts.map +1 -0
  27. package/dist/agent-types/openclaw/provider-registry.js +108 -0
  28. package/dist/agent-types/openclaw/provider-registry.js.map +1 -0
  29. package/dist/agent-types/openclaw/reverse-adapter.d.ts +7 -0
  30. package/dist/agent-types/openclaw/reverse-adapter.d.ts.map +1 -0
  31. package/dist/agent-types/openclaw/reverse-adapter.js +528 -0
  32. package/dist/agent-types/openclaw/reverse-adapter.js.map +1 -0
  33. package/dist/agent-types/openclaw/security-profiles.d.ts +21 -0
  34. package/dist/agent-types/openclaw/security-profiles.d.ts.map +1 -0
  35. package/dist/agent-types/openclaw/security-profiles.js +251 -0
  36. package/dist/agent-types/openclaw/security-profiles.js.map +1 -0
  37. package/dist/agent-types/openclaw/workspace-templates.d.ts +2 -0
  38. package/dist/agent-types/openclaw/workspace-templates.d.ts.map +1 -0
  39. package/dist/agent-types/openclaw/workspace-templates.js +363 -0
  40. package/dist/agent-types/openclaw/workspace-templates.js.map +1 -0
  41. package/dist/agent-types/opencode/index.d.ts +2 -0
  42. package/dist/agent-types/opencode/index.d.ts.map +1 -0
  43. package/dist/agent-types/opencode/index.js +2 -0
  44. package/dist/agent-types/opencode/index.js.map +1 -0
  45. package/dist/agent-types/opencode/manifest.d.ts +3 -0
  46. package/dist/agent-types/opencode/manifest.d.ts.map +1 -0
  47. package/dist/agent-types/opencode/manifest.js +63 -0
  48. package/dist/agent-types/opencode/manifest.js.map +1 -0
  49. package/dist/agent-types/registry.d.ts +4 -0
  50. package/dist/agent-types/registry.d.ts.map +1 -0
  51. package/dist/agent-types/registry.js +24 -0
  52. package/dist/agent-types/registry.js.map +1 -0
  53. package/dist/agent-types/types.d.ts +169 -0
  54. package/dist/agent-types/types.d.ts.map +1 -0
  55. package/dist/agent-types/types.js +2 -0
  56. package/dist/agent-types/types.js.map +1 -0
  57. package/dist/cli.d.ts +3 -0
  58. package/dist/cli.d.ts.map +1 -0
  59. package/dist/cli.js +72 -0
  60. package/dist/cli.js.map +1 -0
  61. package/dist/config.d.ts +68 -0
  62. package/dist/config.d.ts.map +1 -0
  63. package/dist/config.js +98 -0
  64. package/dist/config.js.map +1 -0
  65. package/dist/db/adapter.d.ts +21 -0
  66. package/dist/db/adapter.d.ts.map +1 -0
  67. package/dist/db/adapter.js +11 -0
  68. package/dist/db/adapter.js.map +1 -0
  69. package/dist/db/index.d.ts +4 -0
  70. package/dist/db/index.d.ts.map +1 -0
  71. package/dist/db/index.js +5 -0
  72. package/dist/db/index.js.map +1 -0
  73. package/dist/db/knexfile.d.ts +5 -0
  74. package/dist/db/knexfile.d.ts.map +1 -0
  75. package/dist/db/knexfile.js +34 -0
  76. package/dist/db/knexfile.js.map +1 -0
  77. package/dist/db/migration-helpers.d.ts +45 -0
  78. package/dist/db/migration-helpers.d.ts.map +1 -0
  79. package/dist/db/migration-helpers.js +90 -0
  80. package/dist/db/migration-helpers.js.map +1 -0
  81. package/dist/db/migrations/001_initial.d.ts +4 -0
  82. package/dist/db/migrations/001_initial.d.ts.map +1 -0
  83. package/dist/db/migrations/001_initial.js +56 -0
  84. package/dist/db/migrations/001_initial.js.map +1 -0
  85. package/dist/db/migrations/002_instance_config.d.ts +4 -0
  86. package/dist/db/migrations/002_instance_config.d.ts.map +1 -0
  87. package/dist/db/migrations/002_instance_config.js +12 -0
  88. package/dist/db/migrations/002_instance_config.js.map +1 -0
  89. package/dist/db/migrations/003_instance_status_message.d.ts +4 -0
  90. package/dist/db/migrations/003_instance_status_message.d.ts.map +1 -0
  91. package/dist/db/migrations/003_instance_status_message.js +11 -0
  92. package/dist/db/migrations/003_instance_status_message.js.map +1 -0
  93. package/dist/db/migrations/004_templates.d.ts +4 -0
  94. package/dist/db/migrations/004_templates.d.ts.map +1 -0
  95. package/dist/db/migrations/004_templates.js +95 -0
  96. package/dist/db/migrations/004_templates.js.map +1 -0
  97. package/dist/db/migrations/005_group_chats.d.ts +4 -0
  98. package/dist/db/migrations/005_group_chats.d.ts.map +1 -0
  99. package/dist/db/migrations/005_group_chats.js +66 -0
  100. package/dist/db/migrations/005_group_chats.js.map +1 -0
  101. package/dist/db/migrations/006_template_setup.d.ts +4 -0
  102. package/dist/db/migrations/006_template_setup.d.ts.map +1 -0
  103. package/dist/db/migrations/006_template_setup.js +14 -0
  104. package/dist/db/migrations/006_template_setup.js.map +1 -0
  105. package/dist/db/migrations/007_group_chat_v2.d.ts +4 -0
  106. package/dist/db/migrations/007_group_chat_v2.d.ts.map +1 -0
  107. package/dist/db/migrations/007_group_chat_v2.js +59 -0
  108. package/dist/db/migrations/007_group_chat_v2.js.map +1 -0
  109. package/dist/db/migrations/008_default_provider_openrouter.d.ts +4 -0
  110. package/dist/db/migrations/008_default_provider_openrouter.d.ts.map +1 -0
  111. package/dist/db/migrations/008_default_provider_openrouter.js +33 -0
  112. package/dist/db/migrations/008_default_provider_openrouter.js.map +1 -0
  113. package/dist/db/migrations/009_opencode_default_provider_openrouter.d.ts +4 -0
  114. package/dist/db/migrations/009_opencode_default_provider_openrouter.d.ts.map +1 -0
  115. package/dist/db/migrations/009_opencode_default_provider_openrouter.js +33 -0
  116. package/dist/db/migrations/009_opencode_default_provider_openrouter.js.map +1 -0
  117. package/dist/db/migrations/010_fix_null_default_provider.d.ts +4 -0
  118. package/dist/db/migrations/010_fix_null_default_provider.d.ts.map +1 -0
  119. package/dist/db/migrations/010_fix_null_default_provider.js +24 -0
  120. package/dist/db/migrations/010_fix_null_default_provider.js.map +1 -0
  121. package/dist/db/migrations/011_snapshots.d.ts +4 -0
  122. package/dist/db/migrations/011_snapshots.d.ts.map +1 -0
  123. package/dist/db/migrations/011_snapshots.js +27 -0
  124. package/dist/db/migrations/011_snapshots.js.map +1 -0
  125. package/dist/db/migrations/013_official_templates.d.ts +4 -0
  126. package/dist/db/migrations/013_official_templates.d.ts.map +1 -0
  127. package/dist/db/migrations/013_official_templates.js +173 -0
  128. package/dist/db/migrations/013_official_templates.js.map +1 -0
  129. package/dist/db/migrations/014_notifications.d.ts +4 -0
  130. package/dist/db/migrations/014_notifications.d.ts.map +1 -0
  131. package/dist/db/migrations/014_notifications.js +45 -0
  132. package/dist/db/migrations/014_notifications.js.map +1 -0
  133. package/dist/db/migrations/015_security_profile.d.ts +4 -0
  134. package/dist/db/migrations/015_security_profile.d.ts.map +1 -0
  135. package/dist/db/migrations/015_security_profile.js +14 -0
  136. package/dist/db/migrations/015_security_profile.js.map +1 -0
  137. package/dist/db/migrations/016_template_security.d.ts +4 -0
  138. package/dist/db/migrations/016_template_security.d.ts.map +1 -0
  139. package/dist/db/migrations/016_template_security.js +12 -0
  140. package/dist/db/migrations/016_template_security.js.map +1 -0
  141. package/dist/db/migrations/017_auth_events.d.ts +4 -0
  142. package/dist/db/migrations/017_auth_events.d.ts.map +1 -0
  143. package/dist/db/migrations/017_auth_events.js +19 -0
  144. package/dist/db/migrations/017_auth_events.js.map +1 -0
  145. package/dist/db/migrations/018_skill_market.d.ts +4 -0
  146. package/dist/db/migrations/018_skill_market.d.ts.map +1 -0
  147. package/dist/db/migrations/018_skill_market.js +21 -0
  148. package/dist/db/migrations/018_skill_market.js.map +1 -0
  149. package/dist/db/migrations/019_credential_audit_log.d.ts +4 -0
  150. package/dist/db/migrations/019_credential_audit_log.d.ts.map +1 -0
  151. package/dist/db/migrations/019_credential_audit_log.js +19 -0
  152. package/dist/db/migrations/019_credential_audit_log.js.map +1 -0
  153. package/dist/db/migrations/020_template_security_score.d.ts +4 -0
  154. package/dist/db/migrations/020_template_security_score.d.ts.map +1 -0
  155. package/dist/db/migrations/020_template_security_score.js +31 -0
  156. package/dist/db/migrations/020_template_security_score.js.map +1 -0
  157. package/dist/db/migrations/021_credential_enhancements.d.ts +4 -0
  158. package/dist/db/migrations/021_credential_enhancements.d.ts.map +1 -0
  159. package/dist/db/migrations/021_credential_enhancements.js +15 -0
  160. package/dist/db/migrations/021_credential_enhancements.js.map +1 -0
  161. package/dist/db/migrations/021_user_roles.d.ts +4 -0
  162. package/dist/db/migrations/021_user_roles.d.ts.map +1 -0
  163. package/dist/db/migrations/021_user_roles.js +11 -0
  164. package/dist/db/migrations/021_user_roles.js.map +1 -0
  165. package/dist/db/migrations/022_config_hash.d.ts +4 -0
  166. package/dist/db/migrations/022_config_hash.d.ts.map +1 -0
  167. package/dist/db/migrations/022_config_hash.js +11 -0
  168. package/dist/db/migrations/022_config_hash.js.map +1 -0
  169. package/dist/db/migrations/023_account_security.d.ts +4 -0
  170. package/dist/db/migrations/023_account_security.d.ts.map +1 -0
  171. package/dist/db/migrations/023_account_security.js +22 -0
  172. package/dist/db/migrations/023_account_security.js.map +1 -0
  173. package/dist/db/migrations/024_wizard_configs.d.ts +4 -0
  174. package/dist/db/migrations/024_wizard_configs.d.ts.map +1 -0
  175. package/dist/db/migrations/024_wizard_configs.js +165 -0
  176. package/dist/db/migrations/024_wizard_configs.js.map +1 -0
  177. package/dist/db/migrations/025_auth_dual_mode.d.ts +4 -0
  178. package/dist/db/migrations/025_auth_dual_mode.d.ts.map +1 -0
  179. package/dist/db/migrations/025_auth_dual_mode.js +19 -0
  180. package/dist/db/migrations/025_auth_dual_mode.js.map +1 -0
  181. package/dist/db/migrations/027_add_avatar_to_instances.d.ts +4 -0
  182. package/dist/db/migrations/027_add_avatar_to_instances.d.ts.map +1 -0
  183. package/dist/db/migrations/027_add_avatar_to_instances.js +11 -0
  184. package/dist/db/migrations/027_add_avatar_to_instances.js.map +1 -0
  185. package/dist/db/migrations/027_add_clerk_id.d.ts +4 -0
  186. package/dist/db/migrations/027_add_clerk_id.d.ts.map +1 -0
  187. package/dist/db/migrations/027_add_clerk_id.js +11 -0
  188. package/dist/db/migrations/027_add_clerk_id.js.map +1 -0
  189. package/dist/db/migrations/028_template_plugin_dependencies.d.ts +4 -0
  190. package/dist/db/migrations/028_template_plugin_dependencies.d.ts.map +1 -0
  191. package/dist/db/migrations/028_template_plugin_dependencies.js +18 -0
  192. package/dist/db/migrations/028_template_plugin_dependencies.js.map +1 -0
  193. package/dist/db/migrations/029_remap_orphan_config_keys.d.ts +21 -0
  194. package/dist/db/migrations/029_remap_orphan_config_keys.d.ts.map +1 -0
  195. package/dist/db/migrations/029_remap_orphan_config_keys.js +63 -0
  196. package/dist/db/migrations/029_remap_orphan_config_keys.js.map +1 -0
  197. package/dist/db/migrations/030_extend_notification_types.d.ts +4 -0
  198. package/dist/db/migrations/030_extend_notification_types.d.ts.map +1 -0
  199. package/dist/db/migrations/030_extend_notification_types.js +10 -0
  200. package/dist/db/migrations/030_extend_notification_types.js.map +1 -0
  201. package/dist/db/migrations/031_default_security_profile_developer.d.ts +9 -0
  202. package/dist/db/migrations/031_default_security_profile_developer.d.ts.map +1 -0
  203. package/dist/db/migrations/031_default_security_profile_developer.js +22 -0
  204. package/dist/db/migrations/031_default_security_profile_developer.js.map +1 -0
  205. package/dist/db/migrations/032_geo_template.d.ts +4 -0
  206. package/dist/db/migrations/032_geo_template.d.ts.map +1 -0
  207. package/dist/db/migrations/032_geo_template.js +133 -0
  208. package/dist/db/migrations/032_geo_template.js.map +1 -0
  209. package/dist/db/migrations/033_jinko_travel_template.d.ts +4 -0
  210. package/dist/db/migrations/033_jinko_travel_template.d.ts.map +1 -0
  211. package/dist/db/migrations/033_jinko_travel_template.js +126 -0
  212. package/dist/db/migrations/033_jinko_travel_template.js.map +1 -0
  213. package/dist/db/postgres-adapter.d.ts +13 -0
  214. package/dist/db/postgres-adapter.d.ts.map +1 -0
  215. package/dist/db/postgres-adapter.js +27 -0
  216. package/dist/db/postgres-adapter.js.map +1 -0
  217. package/dist/db/run-migrations.d.ts +2 -0
  218. package/dist/db/run-migrations.d.ts.map +1 -0
  219. package/dist/db/run-migrations.js +26 -0
  220. package/dist/db/run-migrations.js.map +1 -0
  221. package/dist/db/sqlite-adapter.d.ts +13 -0
  222. package/dist/db/sqlite-adapter.d.ts.map +1 -0
  223. package/dist/db/sqlite-adapter.js +29 -0
  224. package/dist/db/sqlite-adapter.js.map +1 -0
  225. package/dist/ee/litellm/litellm-key-manager.d.ts +16 -0
  226. package/dist/ee/litellm/litellm-key-manager.d.ts.map +1 -0
  227. package/dist/ee/litellm/litellm-key-manager.js +16 -0
  228. package/dist/ee/litellm/litellm-key-manager.js.map +1 -0
  229. package/dist/ee/litellm/litellm-model-seeder.d.ts +6 -0
  230. package/dist/ee/litellm/litellm-model-seeder.d.ts.map +1 -0
  231. package/dist/ee/litellm/litellm-model-seeder.js +6 -0
  232. package/dist/ee/litellm/litellm-model-seeder.js.map +1 -0
  233. package/dist/index.ce.d.ts +2 -0
  234. package/dist/index.ce.d.ts.map +1 -0
  235. package/dist/index.ce.js +12 -0
  236. package/dist/index.ce.js.map +1 -0
  237. package/dist/middleware/auth.d.ts +30 -0
  238. package/dist/middleware/auth.d.ts.map +1 -0
  239. package/dist/middleware/auth.js +86 -0
  240. package/dist/middleware/auth.js.map +1 -0
  241. package/dist/middleware/dynamic-middleware.d.ts +7 -0
  242. package/dist/middleware/dynamic-middleware.d.ts.map +1 -0
  243. package/dist/middleware/dynamic-middleware.js +46 -0
  244. package/dist/middleware/dynamic-middleware.js.map +1 -0
  245. package/dist/middleware/log-redaction.d.ts +2 -0
  246. package/dist/middleware/log-redaction.d.ts.map +1 -0
  247. package/dist/middleware/log-redaction.js +56 -0
  248. package/dist/middleware/log-redaction.js.map +1 -0
  249. package/dist/routes/admin.d.ts +3 -0
  250. package/dist/routes/admin.d.ts.map +1 -0
  251. package/dist/routes/admin.js +491 -0
  252. package/dist/routes/admin.js.map +1 -0
  253. package/dist/routes/agent-types.d.ts +3 -0
  254. package/dist/routes/agent-types.d.ts.map +1 -0
  255. package/dist/routes/agent-types.js +85 -0
  256. package/dist/routes/agent-types.js.map +1 -0
  257. package/dist/routes/auth.d.ts +3 -0
  258. package/dist/routes/auth.d.ts.map +1 -0
  259. package/dist/routes/auth.js +242 -0
  260. package/dist/routes/auth.js.map +1 -0
  261. package/dist/routes/channels.d.ts +3 -0
  262. package/dist/routes/channels.d.ts.map +1 -0
  263. package/dist/routes/channels.js +527 -0
  264. package/dist/routes/channels.js.map +1 -0
  265. package/dist/routes/credentials.d.ts +3 -0
  266. package/dist/routes/credentials.d.ts.map +1 -0
  267. package/dist/routes/credentials.js +81 -0
  268. package/dist/routes/credentials.js.map +1 -0
  269. package/dist/routes/dashboard.d.ts +3 -0
  270. package/dist/routes/dashboard.d.ts.map +1 -0
  271. package/dist/routes/dashboard.js +75 -0
  272. package/dist/routes/dashboard.js.map +1 -0
  273. package/dist/routes/exec-approval.d.ts +3 -0
  274. package/dist/routes/exec-approval.d.ts.map +1 -0
  275. package/dist/routes/exec-approval.js +60 -0
  276. package/dist/routes/exec-approval.js.map +1 -0
  277. package/dist/routes/group-chats.d.ts +3 -0
  278. package/dist/routes/group-chats.d.ts.map +1 -0
  279. package/dist/routes/group-chats.js +190 -0
  280. package/dist/routes/group-chats.js.map +1 -0
  281. package/dist/routes/instance-files.d.ts +3 -0
  282. package/dist/routes/instance-files.d.ts.map +1 -0
  283. package/dist/routes/instance-files.js +255 -0
  284. package/dist/routes/instance-files.js.map +1 -0
  285. package/dist/routes/instance-proxy.d.ts +40 -0
  286. package/dist/routes/instance-proxy.d.ts.map +1 -0
  287. package/dist/routes/instance-proxy.js +318 -0
  288. package/dist/routes/instance-proxy.js.map +1 -0
  289. package/dist/routes/instances.d.ts +3 -0
  290. package/dist/routes/instances.d.ts.map +1 -0
  291. package/dist/routes/instances.js +325 -0
  292. package/dist/routes/instances.js.map +1 -0
  293. package/dist/routes/metadata.d.ts +3 -0
  294. package/dist/routes/metadata.d.ts.map +1 -0
  295. package/dist/routes/metadata.js +13 -0
  296. package/dist/routes/metadata.js.map +1 -0
  297. package/dist/routes/notifications.d.ts +3 -0
  298. package/dist/routes/notifications.d.ts.map +1 -0
  299. package/dist/routes/notifications.js +104 -0
  300. package/dist/routes/notifications.js.map +1 -0
  301. package/dist/routes/oauth.d.ts +3 -0
  302. package/dist/routes/oauth.d.ts.map +1 -0
  303. package/dist/routes/oauth.js +516 -0
  304. package/dist/routes/oauth.js.map +1 -0
  305. package/dist/routes/rpc-proxy.d.ts +3 -0
  306. package/dist/routes/rpc-proxy.d.ts.map +1 -0
  307. package/dist/routes/rpc-proxy.js +116 -0
  308. package/dist/routes/rpc-proxy.js.map +1 -0
  309. package/dist/routes/security.d.ts +3 -0
  310. package/dist/routes/security.d.ts.map +1 -0
  311. package/dist/routes/security.js +43 -0
  312. package/dist/routes/security.js.map +1 -0
  313. package/dist/routes/skills.d.ts +3 -0
  314. package/dist/routes/skills.d.ts.map +1 -0
  315. package/dist/routes/skills.js +48 -0
  316. package/dist/routes/skills.js.map +1 -0
  317. package/dist/routes/snapshots.d.ts +3 -0
  318. package/dist/routes/snapshots.d.ts.map +1 -0
  319. package/dist/routes/snapshots.js +99 -0
  320. package/dist/routes/snapshots.js.map +1 -0
  321. package/dist/routes/system-config.d.ts +3 -0
  322. package/dist/routes/system-config.d.ts.map +1 -0
  323. package/dist/routes/system-config.js +75 -0
  324. package/dist/routes/system-config.js.map +1 -0
  325. package/dist/routes/templates.d.ts +3 -0
  326. package/dist/routes/templates.d.ts.map +1 -0
  327. package/dist/routes/templates.js +256 -0
  328. package/dist/routes/templates.js.map +1 -0
  329. package/dist/routes/ui-proxy.d.ts +3 -0
  330. package/dist/routes/ui-proxy.d.ts.map +1 -0
  331. package/dist/routes/ui-proxy.js +90 -0
  332. package/dist/routes/ui-proxy.js.map +1 -0
  333. package/dist/routes/user-credentials.d.ts +3 -0
  334. package/dist/routes/user-credentials.d.ts.map +1 -0
  335. package/dist/routes/user-credentials.js +85 -0
  336. package/dist/routes/user-credentials.js.map +1 -0
  337. package/dist/routes/users.d.ts +3 -0
  338. package/dist/routes/users.d.ts.map +1 -0
  339. package/dist/routes/users.js +30 -0
  340. package/dist/routes/users.js.map +1 -0
  341. package/dist/runtime/docker.d.ts +37 -0
  342. package/dist/runtime/docker.d.ts.map +1 -0
  343. package/dist/runtime/docker.js +612 -0
  344. package/dist/runtime/docker.js.map +1 -0
  345. package/dist/runtime/factory.d.ts +4 -0
  346. package/dist/runtime/factory.d.ts.map +1 -0
  347. package/dist/runtime/factory.js +21 -0
  348. package/dist/runtime/factory.js.map +1 -0
  349. package/dist/runtime/kubernetes.d.ts +34 -0
  350. package/dist/runtime/kubernetes.d.ts.map +1 -0
  351. package/dist/runtime/kubernetes.js +513 -0
  352. package/dist/runtime/kubernetes.js.map +1 -0
  353. package/dist/runtime/types.d.ts +81 -0
  354. package/dist/runtime/types.d.ts.map +1 -0
  355. package/dist/runtime/types.js +2 -0
  356. package/dist/runtime/types.js.map +1 -0
  357. package/dist/server-core.d.ts +26 -0
  358. package/dist/server-core.d.ts.map +1 -0
  359. package/dist/server-core.js +184 -0
  360. package/dist/server-core.js.map +1 -0
  361. package/dist/services/config-diff.d.ts +6 -0
  362. package/dist/services/config-diff.d.ts.map +1 -0
  363. package/dist/services/config-diff.js +85 -0
  364. package/dist/services/config-diff.js.map +1 -0
  365. package/dist/services/config-field-meta.d.ts +22 -0
  366. package/dist/services/config-field-meta.d.ts.map +1 -0
  367. package/dist/services/config-field-meta.js +177 -0
  368. package/dist/services/config-field-meta.js.map +1 -0
  369. package/dist/services/config-validator.d.ts +8 -0
  370. package/dist/services/config-validator.d.ts.map +1 -0
  371. package/dist/services/config-validator.js +59 -0
  372. package/dist/services/config-validator.js.map +1 -0
  373. package/dist/services/credential-audit.d.ts +13 -0
  374. package/dist/services/credential-audit.d.ts.map +1 -0
  375. package/dist/services/credential-audit.js +18 -0
  376. package/dist/services/credential-audit.js.map +1 -0
  377. package/dist/services/credential-store.d.ts +28 -0
  378. package/dist/services/credential-store.d.ts.map +1 -0
  379. package/dist/services/credential-store.js +99 -0
  380. package/dist/services/credential-store.js.map +1 -0
  381. package/dist/services/dlp-scanner.d.ts +9 -0
  382. package/dist/services/dlp-scanner.d.ts.map +1 -0
  383. package/dist/services/dlp-scanner.js +90 -0
  384. package/dist/services/dlp-scanner.js.map +1 -0
  385. package/dist/services/gateway-event-relay.d.ts +53 -0
  386. package/dist/services/gateway-event-relay.d.ts.map +1 -0
  387. package/dist/services/gateway-event-relay.js +519 -0
  388. package/dist/services/gateway-event-relay.js.map +1 -0
  389. package/dist/services/group-chat-manager.d.ts +17 -0
  390. package/dist/services/group-chat-manager.d.ts.map +1 -0
  391. package/dist/services/group-chat-manager.js +613 -0
  392. package/dist/services/group-chat-manager.js.map +1 -0
  393. package/dist/services/health-monitor.d.ts +3 -0
  394. package/dist/services/health-monitor.d.ts.map +1 -0
  395. package/dist/services/health-monitor.js +342 -0
  396. package/dist/services/health-monitor.js.map +1 -0
  397. package/dist/services/instance-manager.d.ts +20 -0
  398. package/dist/services/instance-manager.d.ts.map +1 -0
  399. package/dist/services/instance-manager.js +833 -0
  400. package/dist/services/instance-manager.js.map +1 -0
  401. package/dist/services/metadata-store.d.ts +3 -0
  402. package/dist/services/metadata-store.d.ts.map +1 -0
  403. package/dist/services/metadata-store.js +34 -0
  404. package/dist/services/metadata-store.js.map +1 -0
  405. package/dist/services/notification-store.d.ts +24 -0
  406. package/dist/services/notification-store.d.ts.map +1 -0
  407. package/dist/services/notification-store.js +216 -0
  408. package/dist/services/notification-store.js.map +1 -0
  409. package/dist/services/openrouter-models.d.ts +13 -0
  410. package/dist/services/openrouter-models.d.ts.map +1 -0
  411. package/dist/services/openrouter-models.js +46 -0
  412. package/dist/services/openrouter-models.js.map +1 -0
  413. package/dist/services/output-filter.d.ts +8 -0
  414. package/dist/services/output-filter.d.ts.map +1 -0
  415. package/dist/services/output-filter.js +230 -0
  416. package/dist/services/output-filter.js.map +1 -0
  417. package/dist/services/prompt-guard.d.ts +6 -0
  418. package/dist/services/prompt-guard.d.ts.map +1 -0
  419. package/dist/services/prompt-guard.js +165 -0
  420. package/dist/services/prompt-guard.js.map +1 -0
  421. package/dist/services/security-event-service.d.ts +11 -0
  422. package/dist/services/security-event-service.d.ts.map +1 -0
  423. package/dist/services/security-event-service.js +201 -0
  424. package/dist/services/security-event-service.js.map +1 -0
  425. package/dist/services/snapshot-store.d.ts +21 -0
  426. package/dist/services/snapshot-store.d.ts.map +1 -0
  427. package/dist/services/snapshot-store.js +330 -0
  428. package/dist/services/snapshot-store.js.map +1 -0
  429. package/dist/services/system-config.d.ts +15 -0
  430. package/dist/services/system-config.d.ts.map +1 -0
  431. package/dist/services/system-config.js +80 -0
  432. package/dist/services/system-config.js.map +1 -0
  433. package/dist/services/template-file-format.d.ts +32 -0
  434. package/dist/services/template-file-format.d.ts.map +1 -0
  435. package/dist/services/template-file-format.js +125 -0
  436. package/dist/services/template-file-format.js.map +1 -0
  437. package/dist/services/template-store.d.ts +21 -0
  438. package/dist/services/template-store.d.ts.map +1 -0
  439. package/dist/services/template-store.js +701 -0
  440. package/dist/services/template-store.js.map +1 -0
  441. package/dist/services/user-credential-store.d.ts +20 -0
  442. package/dist/services/user-credential-store.d.ts.map +1 -0
  443. package/dist/services/user-credential-store.js +243 -0
  444. package/dist/services/user-credential-store.js.map +1 -0
  445. package/dist/services/wizard-config-store.d.ts +38 -0
  446. package/dist/services/wizard-config-store.d.ts.map +1 -0
  447. package/dist/services/wizard-config-store.js +70 -0
  448. package/dist/services/wizard-config-store.js.map +1 -0
  449. package/dist/web-dist/assets/AdminPage-BrAU67Dg.js +1 -0
  450. package/dist/web-dist/assets/AgentAvatar-BKJckc1W.js +1 -0
  451. package/dist/web-dist/assets/AgentAvatar-Cq-M5jMd.css +1 -0
  452. package/dist/web-dist/assets/AppLayout-Bf0v_2wK.css +1 -0
  453. package/dist/web-dist/assets/AppLayout-DXgV0atq.js +1 -0
  454. package/dist/web-dist/assets/AssistantChatPage-uVLgKLay.js +6 -0
  455. package/dist/web-dist/assets/AssistantEditPage-Bab1X-DA.js +1 -0
  456. package/dist/web-dist/assets/AssistantVersionsPage-BQRw3BUF.js +1 -0
  457. package/dist/web-dist/assets/AvatarPicker-DmnkD8Rb.js +1 -0
  458. package/dist/web-dist/assets/AvatarPicker-LHUepNFa.css +1 -0
  459. package/dist/web-dist/assets/CeAuthProvider-38_x9VGA.js +1 -0
  460. package/dist/web-dist/assets/ChatHubPage-2l4cKq0x.css +1 -0
  461. package/dist/web-dist/assets/ChatHubPage-B2WduoUM.js +1 -0
  462. package/dist/web-dist/assets/ChatTab-CHpjEu8M.js +6 -0
  463. package/dist/web-dist/assets/CreateWizardPage-DFEQ3VX3.js +47 -0
  464. package/dist/web-dist/assets/CreateWizardPage-IqNXDOER.css +1 -0
  465. package/dist/web-dist/assets/CredentialsPage-CDeXpnLG.js +1 -0
  466. package/dist/web-dist/assets/CredentialsPage-aI4kLoJD.css +1 -0
  467. package/dist/web-dist/assets/DocsAboutPage-CMbxiw1u.js +26 -0
  468. package/dist/web-dist/assets/DocsChannelsPage-CtmKYKK_.js +1 -0
  469. package/dist/web-dist/assets/DocsGettingStartedPage-CpM7o8sw.js +1 -0
  470. package/dist/web-dist/assets/DocsGroupChatsPage-7w-RVSJR.js +1 -0
  471. package/dist/web-dist/assets/DocsHomePage-BGEU5xBg.js +1 -0
  472. package/dist/web-dist/assets/DocsInstancesPage-Sewnw_x7.js +1 -0
  473. package/dist/web-dist/assets/DocsLayout-S7-ONZwP.js +1 -0
  474. package/dist/web-dist/assets/DocsProvidersPage-MeWneL5K.js +1 -0
  475. package/dist/web-dist/assets/DocsSkillsPage-CzsHPXxE.js +1 -0
  476. package/dist/web-dist/assets/DocsTemplatesPage-BXASAEoO.js +1 -0
  477. package/dist/web-dist/assets/DocsWorkspacePage-qYNeK_YS.js +24 -0
  478. package/dist/web-dist/assets/ExportWizardPage-BhNvovbU.js +3 -0
  479. package/dist/web-dist/assets/ExportWizardPage-Cp-KSYUy.css +1 -0
  480. package/dist/web-dist/assets/GoogleOAuthCallback-CBvLawe2.js +1 -0
  481. package/dist/web-dist/assets/GroupChatPage-rMfhmtsX.js +1 -0
  482. package/dist/web-dist/assets/GroupChatsListPage-BOwxHFfA.js +1 -0
  483. package/dist/web-dist/assets/InstancePage-BBL68DKB.js +1 -0
  484. package/dist/web-dist/assets/InstancePage-CzysRY40.css +1 -0
  485. package/dist/web-dist/assets/MyAssistantsPage-B808ZfHg.css +1 -0
  486. package/dist/web-dist/assets/MyAssistantsPage-q3-hNMth.js +1 -0
  487. package/dist/web-dist/assets/ProfilePage-Dx8YdU59.js +1 -0
  488. package/dist/web-dist/assets/ProfilePage-JMOkUDx7.css +1 -0
  489. package/dist/web-dist/assets/SessionDrawer-Ba7pbZDJ.css +1 -0
  490. package/dist/web-dist/assets/SessionDrawer-CXzEQAfF.js +1 -0
  491. package/dist/web-dist/assets/SystemConfigPage-4dvxADwi.js +1 -0
  492. package/dist/web-dist/assets/SystemConfigPage-DRqVfLGt.css +1 -0
  493. package/dist/web-dist/assets/TemplatesPage-DqXuG-Gy.css +1 -0
  494. package/dist/web-dist/assets/TemplatesPage-HMS__ODO.js +1 -0
  495. package/dist/web-dist/assets/TestLoginPage-xVQL0lYP.js +1 -0
  496. package/dist/web-dist/assets/ThemeToggle-DymKEYXG.js +1 -0
  497. package/dist/web-dist/assets/WorkbenchPage-Bymo4SSt.css +1 -0
  498. package/dist/web-dist/assets/WorkbenchPage-ST3hVrbL.js +33 -0
  499. package/dist/web-dist/assets/api-B5psysvQ.js +1 -0
  500. package/dist/web-dist/assets/clock-dRyRszad.js +1 -0
  501. package/dist/web-dist/assets/createLucideIcon-DiGX-lN4.js +1 -0
  502. package/dist/web-dist/assets/group-chat-9BaA9G_8.css +1 -0
  503. package/dist/web-dist/assets/index-BqzqZJ96.js +26 -0
  504. package/dist/web-dist/assets/index-DyrDN1Of.css +1 -0
  505. package/dist/web-dist/assets/index-wWimwgy7.js +1 -0
  506. package/dist/web-dist/assets/provider-display-BgrE7u33.js +1 -0
  507. package/dist/web-dist/assets/types-1lNWpzYk.js +57 -0
  508. package/dist/web-dist/assets/types-B6ttO-6G.css +1 -0
  509. package/dist/web-dist/assets/useTranslation-B-8kenfJ.js +1 -0
  510. package/dist/web-dist/assets/zap-CVBnETFW.js +1 -0
  511. package/dist/web-dist/index.html +31 -0
  512. package/dist/web-dist/vite.svg +1 -0
  513. package/dist/ws/index.d.ts +7 -0
  514. package/dist/ws/index.d.ts.map +1 -0
  515. package/dist/ws/index.js +112 -0
  516. package/dist/ws/index.js.map +1 -0
  517. package/package.json +54 -0
@@ -0,0 +1 @@
1
+ import{j as s,L as e}from"./index-BqzqZJ96.js";function a(){return s.jsxs("div",{className:"docs-home",children:[s.jsxs("div",{className:"docs-section",children:[s.jsx("h1",{children:"Aquarium Documentation"}),s.jsx("p",{children:"Aquarium is a web-based management interface for running and configuring OpenClaw AI gateway instances. You can spin up personal AI assistants connected to 18+ language model providers, link them to WhatsApp or Telegram, customize their personalities with workspace files, and share bot templates with the community. Everything runs in isolated containers, so each instance has its own credentials, memory, and configuration."}),s.jsxs("p",{children:["Pick a topic below to get started, or jump straight to"," ",s.jsx(e,{to:"/docs/getting-started",children:"Getting Started"})," if this is your first time on the platform."]})]}),s.jsxs("div",{className:"docs-nav-cards",children:[s.jsxs(e,{to:"/docs/getting-started",className:"docs-nav-card",children:[s.jsx("h3",{children:"Getting Started"}),s.jsx("p",{children:"Create your account and launch your first AI bot in minutes"})]}),s.jsxs(e,{to:"/docs/instances",className:"docs-nav-card",children:[s.jsx("h3",{children:"Instances"}),s.jsx("p",{children:"Manage your AI bot instances — start, stop, configure, monitor"})]}),s.jsxs(e,{to:"/docs/providers",className:"docs-nav-card",children:[s.jsx("h3",{children:"AI Providers"}),s.jsx("p",{children:"Connect 18+ AI providers including OpenAI, Anthropic, Google, and more"})]}),s.jsxs(e,{to:"/docs/workspace",className:"docs-nav-card",children:[s.jsx("h3",{children:"Workspace Files"}),s.jsx("p",{children:"Customize your bot's personality, memory, and behavior"})]}),s.jsxs(e,{to:"/docs/templates",className:"docs-nav-card",children:[s.jsx("h3",{children:"Templates"}),s.jsx("p",{children:"Browse and share bot templates in the marketplace"})]}),s.jsxs(e,{to:"/docs/skills",className:"docs-nav-card",children:[s.jsx("h3",{children:"Skills & ClaWHub"}),s.jsx("p",{children:"Extend your bot with community skills and integrations"})]}),s.jsxs(e,{to:"/docs/channels",className:"docs-nav-card",children:[s.jsx("h3",{children:"Channels"}),s.jsx("p",{children:"Connect your bot to WhatsApp and Telegram"})]}),s.jsxs(e,{to:"/docs/group-chats",className:"docs-nav-card",children:[s.jsx("h3",{children:"Group Chats"}),s.jsx("p",{children:"Create conversations between multiple AI agents"})]}),s.jsxs(e,{to:"/docs/about",className:"docs-nav-card",children:[s.jsx("h3",{children:"About"}),s.jsx("p",{children:"The story behind Aquarium"})]})]})]})}export{a as DocsHomePage};
@@ -0,0 +1 @@
1
+ import{j as e,L as s}from"./index-BqzqZJ96.js";function a(){return e.jsxs("div",{className:"docs-page",children:[e.jsx("h1",{children:"Instance Management"}),e.jsx("p",{className:"docs-lead",children:"An instance is a single running OpenClaw gateway container. Each instance has its own configuration, credentials, workspace files, and messaging channel connections. You can run multiple instances under one account, each serving a different purpose or persona."}),e.jsxs("div",{className:"docs-section",children:[e.jsx("h2",{children:"Instance Lifecycle"}),e.jsx("p",{children:"Every instance moves through a defined set of states. Understanding these states helps you diagnose issues and know when an instance is ready to use."}),e.jsxs("div",{className:"docs-state-flow",children:[e.jsx("div",{className:"docs-state-node docs-state-created",children:e.jsx("span",{className:"docs-state-label",children:"created"})}),e.jsx("div",{className:"docs-state-arrow",children:"→"}),e.jsx("div",{className:"docs-state-node docs-state-starting",children:e.jsx("span",{className:"docs-state-label",children:"starting"})}),e.jsx("div",{className:"docs-state-arrow",children:"→"}),e.jsx("div",{className:"docs-state-node docs-state-running",children:e.jsx("span",{className:"docs-state-label",children:"running"})}),e.jsx("div",{className:"docs-state-arrow",children:"→"}),e.jsx("div",{className:"docs-state-node docs-state-stopping",children:e.jsx("span",{className:"docs-state-label",children:"stopping"})}),e.jsx("div",{className:"docs-state-arrow",children:"→"}),e.jsx("div",{className:"docs-state-node docs-state-stopped",children:e.jsx("span",{className:"docs-state-label",children:"stopped"})}),e.jsx("div",{className:"docs-state-arrow",children:"⇢"}),e.jsx("div",{className:"docs-state-node docs-state-error",children:e.jsx("span",{className:"docs-state-label",children:"error"})})]}),e.jsxs("div",{className:"docs-state-descriptions",children:[e.jsxs("div",{className:"docs-state-desc",children:[e.jsx("strong",{children:"created"}),e.jsx("p",{children:"A database record exists for the instance but no container or pod has been provisioned yet. The instance is ready to be started for the first time."})]}),e.jsxs("div",{className:"docs-state-desc",children:[e.jsx("strong",{children:"starting"}),e.jsx("p",{children:"The platform has sent a start request to the orchestrator. The container image is being pulled (if not cached), the pod is being scheduled, and the gateway process is booting up. The health monitor polls every 5 seconds during this phase. First boot can take 1 to 3 minutes."})]}),e.jsxs("div",{className:"docs-state-desc",children:[e.jsx("strong",{children:"running"}),e.jsx("p",{children:"The gateway health endpoint responded successfully. The instance is fully operational and accepting messages. The health monitor shifts to a 30-second polling interval."})]}),e.jsxs("div",{className:"docs-state-desc",children:[e.jsx("strong",{children:"stopping"}),e.jsx("p",{children:"A termination signal has been sent to the container. The gateway is shutting down gracefully, flushing any in-flight messages before the process exits."})]}),e.jsxs("div",{className:"docs-state-desc",children:[e.jsx("strong",{children:"stopped"}),e.jsx("p",{children:"The container is gone but all persistent data (workspace files, credentials, conversation history) is preserved on disk. The instance can be restarted at any time with no data loss."})]}),e.jsxs("div",{className:"docs-state-desc",children:[e.jsx("strong",{children:"error"}),e.jsxs("p",{children:["A state transition failed. Open the Events tab and check the ",e.jsx("code",{children:"status_message"})," field for the specific failure reason. Common causes are image pull failures, port conflicts, or invalid configuration. Once the underlying issue is resolved, you can start the instance again. The health monitor will auto-recover the instance if the Kubernetes pod stabilizes on its own after a crash."]})]})]})]}),e.jsxs("div",{className:"docs-section",children:[e.jsx("h2",{children:"Instance Header Actions"}),e.jsx("p",{children:"The four action buttons at the top of every instance page control the instance lifecycle."}),e.jsxs("div",{className:"docs-tab-grid docs-action-grid",children:[e.jsxs("div",{className:"docs-tab-item",children:[e.jsx("div",{className:"docs-tab-name docs-action-start",children:"Start"}),e.jsxs("p",{children:["Provisions and boots the container or Kubernetes pod. Transitions the instance from",e.jsx("code",{children:"stopped"})," (or ",e.jsx("code",{children:"created"}),") to ",e.jsx("code",{children:"starting"}),", then to",e.jsx("code",{children:"running"})," once the health check passes. Available only when the instance is stopped or in error state."]})]}),e.jsxs("div",{className:"docs-tab-item",children:[e.jsx("div",{className:"docs-tab-name docs-action-stop",children:"Stop"}),e.jsx("p",{children:"Sends a graceful shutdown signal to the running container. The gateway flushes pending operations before exiting. Persistent data is retained. Use this before making significant configuration changes if a restart isn't sufficient."})]}),e.jsxs("div",{className:"docs-tab-item",children:[e.jsx("div",{className:"docs-tab-name docs-action-restart",children:"Restart"}),e.jsx("p",{children:"Performs a stop followed immediately by a start. Useful after changing workspace files, credentials, or gateway config. The platform waits for the stop to complete before issuing the start request."})]}),e.jsxs("div",{className:"docs-tab-item",children:[e.jsx("div",{className:"docs-tab-name docs-action-delete",children:"Delete"}),e.jsxs("p",{children:["Permanently removes the instance, its container, and its persistent volume."," ",e.jsx("strong",{children:"This action cannot be undone."})," All workspace files, credentials, conversation history, and WhatsApp session data are destroyed. Export anything you need before deleting."]})]})]}),e.jsxs("div",{className:"docs-warning-box",children:[e.jsx("strong",{children:"Warning:"})," Deleting an instance removes the persistent volume along with it. If you have a WhatsApp session linked, the phone will need to be re-paired after creating a new instance."]})]}),e.jsxs("div",{className:"docs-section",children:[e.jsx("h2",{children:"The 16 Tabs"}),e.jsx("p",{children:"Every instance page has 16 tabs. Here's what each one does."}),e.jsxs("div",{className:"docs-tab-grid",children:[e.jsxs("div",{className:"docs-tab-item",children:[e.jsx("div",{className:"docs-tab-name",children:"1. Overview"}),e.jsx("p",{children:"The landing tab for every instance. Shows the instance name, current status badge, agent type, image tag, and deployment target (Docker or Kubernetes). Created and last-updated timestamps are displayed here too. Use this tab for a quick sanity check before diving into configuration or logs."})]}),e.jsxs("div",{className:"docs-tab-item",children:[e.jsx("div",{className:"docs-tab-name",children:"2. Credentials"}),e.jsxs("p",{children:["Manage the AI provider API keys and OAuth tokens attached to this instance. You can add credentials for any supported provider — Anthropic, OpenAI, Google, Groq, and others. Each credential has a type (",e.jsx("code",{children:"api_key"})," or"," ",e.jsx("code",{children:"refresh_token"}),") and a value. All values are encrypted with AES-256-GCM before being stored in the database. Credential values are never returned in API responses after creation; you can only replace or delete them."]}),e.jsxs("p",{children:["See the ",e.jsx(s,{to:"/docs/providers",children:"AI Providers"})," page for provider-specific setup instructions, including which credential type each provider requires."]})]}),e.jsxs("div",{className:"docs-tab-item",children:[e.jsx("div",{className:"docs-tab-name",children:"3. Config"}),e.jsx("p",{children:"A JSON editor showing the full instance configuration as stored in the database. Advanced users can edit this directly to set options that aren't exposed in the UI. The config is validated before saving to prevent invalid JSON from being persisted. Changes made here don't take effect until the instance is restarted — the gateway reads config on startup, not continuously."}),e.jsxs("div",{className:"docs-info-box",children:["If you want to change the live gateway config without a full restart, use the Gateway Config tab instead, which sends a ",e.jsx("code",{children:"config.patch"})," RPC call to the running gateway."]})]}),e.jsxs("div",{className:"docs-tab-item",children:[e.jsx("div",{className:"docs-tab-name",children:"4. Workspace"}),e.jsx("p",{children:"Edit the eight workspace files that shape your agent's personality, knowledge, and behavior. Each file has a dedicated text editor in this tab:"}),e.jsxs("ul",{className:"docs-file-list",children:[e.jsxs("li",{children:[e.jsx("code",{children:"SOUL.md"})," — Core personality and values"]}),e.jsxs("li",{children:[e.jsx("code",{children:"AGENTS.md"})," — Behavioral instructions and rules"]}),e.jsxs("li",{children:[e.jsx("code",{children:"IDENTITY.md"})," — Who the agent is and how it presents itself"]}),e.jsxs("li",{children:[e.jsx("code",{children:"USER.md"})," — Information about the user(s) it serves"]}),e.jsxs("li",{children:[e.jsx("code",{children:"TOOLS.md"})," — Tool usage preferences and restrictions"]}),e.jsxs("li",{children:[e.jsx("code",{children:"BOOTSTRAP.md"})," — Initialization instructions run on first session"]}),e.jsxs("li",{children:[e.jsx("code",{children:"HEARTBEAT.md"})," — Periodic check-in behavior"]}),e.jsxs("li",{children:[e.jsx("code",{children:"MEMORY.md"})," — Long-term memory the agent maintains"]})]}),e.jsx("p",{children:`Click "Save" on any file to persist it to the database. The platform syncs saved changes to the running instance's filesystem in real time without requiring a restart (except for SOUL.md and AGENTS.md, which are re-read at session start).`}),e.jsxs("p",{children:["See the ",e.jsx(s,{to:"/docs/workspace",children:"Workspace Files"})," page for a detailed explanation of each file's purpose and format."]})]}),e.jsxs("div",{className:"docs-tab-item",children:[e.jsx("div",{className:"docs-tab-name",children:"5. Channels"}),e.jsx("p",{children:"Connect the instance to messaging platforms. Currently supported channels are WhatsApp and Telegram; more channels are available through the Skills/ClaWHub tab."}),e.jsxs("p",{children:[e.jsx("strong",{children:"WhatsApp:"}),` Click "Connect", then scan the QR code with your phone using WhatsApp's linked devices flow. The platform relays the QR code from the gateway in real time. Once paired, the session is stored on the instance's persistent volume and survives restarts.`]}),e.jsxs("p",{children:[e.jsx("strong",{children:"Telegram:"}),' Paste the bot token you received from BotFather, then click "Save & Restart". The instance will restart with the new token injected as an environment variable.']}),e.jsxs("p",{children:["For a full setup guide including permissions, group policies, and multi-account support, see the ",e.jsx(s,{to:"/docs/channels",children:"Channels"})," page."]})]}),e.jsxs("div",{className:"docs-tab-item",children:[e.jsx("div",{className:"docs-tab-name",children:"6. Chat"}),e.jsx("p",{children:"A built-in chat interface that lets you talk to the agent directly from the platform, without going through WhatsApp or Telegram. Type a message and press Enter or click Send. Responses render with full Markdown support, including code blocks, tables, and lists."}),e.jsx("p",{children:"Chat history persists across page reloads for the duration of a browser session. This tab is useful for testing changes to workspace files or credentials without needing a connected messaging channel."})]}),e.jsxs("div",{className:"docs-tab-item",children:[e.jsx("div",{className:"docs-tab-name",children:"7. Sessions"}),e.jsx("p",{children:"A list of all chat sessions tracked by the gateway, both active and historical. Each entry shows the session start time, the channel it originated from, the total message count, and whether the session is still open. Clicking a session shows its full message history."}),e.jsx("p",{children:"This is useful for reviewing what conversations happened in your absence, or for auditing what the agent said to specific users."})]}),e.jsxs("div",{className:"docs-tab-item",children:[e.jsx("div",{className:"docs-tab-name",children:"8. Skills / ClaWHub"}),e.jsx("p",{children:"Browse and manage skills from the ClaWHub registry. Skills extend the gateway with new tools, channel integrations, and behaviors. The top of this tab shows summary stats: total skills available in the registry, how many are installed on this instance, and how many are eligible to install based on the current provider."}),e.jsx("p",{children:'Use the filter buttons to view All, Eligible, or Enabled skills. Toggle the switch on any skill card to enable or disable it. Click "Install" on community skills to download and register them with the gateway.'}),e.jsxs("p",{children:["See the ",e.jsx(s,{to:"/docs/skills",children:"Skills"})," page for a full registry overview and instructions on writing custom skills."]})]}),e.jsxs("div",{className:"docs-tab-item",children:[e.jsx("div",{className:"docs-tab-name",children:"9. Cron"}),e.jsxs("p",{children:["Configure scheduled tasks that the agent should run automatically. Each cron job has a name, a standard cron expression (e.g. ",e.jsx("code",{children:"0 9 * * 1-5"})," for weekdays at 9am), and a message or action to trigger. The gateway's internal scheduler picks up these tasks and fires them at the specified times."]}),e.jsx("p",{children:"Common uses: daily summaries, reminder messages, periodic web fetches, or any recurring task you'd normally ask the agent to do manually."})]}),e.jsxs("div",{className:"docs-tab-item",children:[e.jsx("div",{className:"docs-tab-name",children:"10. Gateway Config"}),e.jsxs("p",{children:["View and edit the raw ",e.jsx("code",{children:"openclaw.json"})," configuration file served by the running gateway. Unlike the Config tab (which shows the DB-stored config), changes here are applied to the live gateway via a ",e.jsx("code",{children:"config.patch"})," RPC call, meaning they take effect immediately without a restart."]}),e.jsx("p",{children:"This is the lowest-level config surface. The schema is strict — unknown keys will cause the gateway to reject the patch. Refer to the OpenClaw documentation for the full schema reference before making manual edits here."}),e.jsx("div",{className:"docs-warning-box",children:"Changes made in Gateway Config are live but ephemeral if they're not also saved to the DB config (Config tab). After a restart, the gateway re-reads from the DB. Always update both if you want the change to survive restarts."})]}),e.jsxs("div",{className:"docs-tab-item",children:[e.jsx("div",{className:"docs-tab-name",children:"11. Health"}),e.jsx("p",{children:"A monitoring dashboard showing the current health of the instance. Displays the overall health status (healthy, degraded, or unhealthy), the timestamp of the last successful health check, total uptime since the last start, and resource utilization metrics where available (CPU, memory)."}),e.jsxs("p",{children:["The platform's health monitor runs on a dual-speed schedule: every 5 seconds for instances in ",e.jsx("code",{children:"starting"})," state, and every 30 seconds for instances that are ",e.jsx("code",{children:"running"})," or in ",e.jsx("code",{children:"error"}),". Auto-recovery kicks in here too — if a Kubernetes pod stabilizes after a crash, the monitor flips the status back to ",e.jsx("code",{children:"running"})," automatically."]})]}),e.jsxs("div",{className:"docs-tab-item",children:[e.jsx("div",{className:"docs-tab-name",children:"12. Usage"}),e.jsx("p",{children:"Token usage statistics broken down by provider and model. Shows the number of API calls made, input and output tokens consumed, and an estimated cost based on current provider pricing. Data is aggregated over configurable time windows (daily, weekly, monthly)."}),e.jsx("p",{children:"Use this tab to track spend across providers, identify which models are being used most, and spot unexpected spikes in usage."})]}),e.jsxs("div",{className:"docs-tab-item",children:[e.jsx("div",{className:"docs-tab-name",children:"13. Logs"}),e.jsx("p",{children:"Real-time log streaming from the instance container. Logs are parsed intelligently: JSON-structured log lines are broken into individual fields (timestamp, log level, subsystem, message), while plain-text lines are displayed as-is."}),e.jsxs("p",{children:[e.jsx("strong",{children:"Filtering:"})," Use the level checkboxes to show or hide trace, debug, info, warn, error, and fatal lines. The text search field filters by message content."]}),e.jsxs("p",{children:[e.jsx("strong",{children:"Color coding:"})," Each level gets its own color (gray for trace, blue for debug, green for info, yellow for warn, red for error, magenta for fatal), making it easy to spot problems at a glance."]}),e.jsx("p",{children:"The viewer maintains a circular buffer of the last 2,000 log entries to keep memory usage bounded. For longer-term log retention, configure external log shipping in the Gateway Config tab."})]}),e.jsxs("div",{className:"docs-tab-item",children:[e.jsx("div",{className:"docs-tab-name",children:"14. Events"}),e.jsxs("p",{children:["An audit log of every lifecycle event recorded for this instance. Events include things like ",e.jsx("code",{children:"START_REQUESTED"}),", ",e.jsx("code",{children:"HEALTH_CHECK_PASSED"}),",",e.jsx("code",{children:"CONFIG_UPDATED"}),", ",e.jsx("code",{children:"CREDENTIALS_CHANGED"}),", and",e.jsx("code",{children:"ERROR_OCCURRED"}),". Each event has a precise timestamp, an event type, and a metadata object with context-specific details."]}),e.jsx("p",{children:"This tab is the first place to check when an instance won't start or keeps falling into error state. The metadata on a failed health check event, for example, will show the exact HTTP status or connection error returned by the gateway."})]}),e.jsxs("div",{className:"docs-tab-item",children:[e.jsx("div",{className:"docs-tab-name",children:"15. Approvals"}),e.jsx("p",{children:"When exec approval mode is enabled, the agent pauses before executing certain tools and waits for explicit human approval. This tab lists all pending approval requests, showing the tool name, the arguments it wants to call with, and the session context in which it was triggered."}),e.jsx("p",{children:'Click "Approve" to allow the tool call to proceed, or "Reject" to cancel it and send a refusal message back to the agent. Approved and rejected decisions are logged with timestamps for auditing.'}),e.jsxs("div",{className:"docs-info-box",children:["Exec approval mode is configured in the Gateway Config tab under the"," ",e.jsx("code",{children:"tools.approval"})," section. It's recommended for agents with access to sensitive tools like file writes, shell commands, or external API calls."]})]}),e.jsxs("div",{className:"docs-tab-item",children:[e.jsx("div",{className:"docs-tab-name",children:"16. Debug"}),e.jsx("p",{children:"Advanced debugging tools for diagnosing tricky issues. This tab lets you inspect the environment variables currently set in the container, view the resolved configuration state as the gateway sees it (after env var substitution), and examine runtime details like the active plugin list and loaded skill registrations."}),e.jsx("p",{children:"Useful when a configuration change doesn't seem to take effect, or when troubleshooting credential injection issues. Not intended for everyday use."})]})]})]}),e.jsxs("div",{className:"docs-section",children:[e.jsx("h2",{children:"Setup Wizard"}),e.jsx("p",{children:"After creating a brand new instance, the platform shows a setup wizard to get it configured quickly. The wizard walks through four steps before starting the instance for the first time."}),e.jsxs("div",{className:"docs-steps",children:[e.jsxs("div",{className:"docs-step",children:[e.jsx("div",{className:"docs-step-number",children:"1"}),e.jsxs("div",{className:"docs-step-content",children:[e.jsx("h3",{children:"Select Provider & Model"}),e.jsx("p",{children:"Choose the AI provider (Anthropic, OpenAI, Google, Groq, etc.) and the specific model you want the agent to use. The dropdown shows all providers supported by the current agent type. Your selection is saved to the instance config and will be used for all chat sessions."})]})]}),e.jsxs("div",{className:"docs-step",children:[e.jsx("div",{className:"docs-step-number",children:"2"}),e.jsxs("div",{className:"docs-step-content",children:[e.jsx("h3",{children:"Configure Credentials"}),e.jsx("p",{children:"Enter the API key or OAuth token for the provider you selected in step 1. The wizard knows which credential type each provider needs, so it shows the correct input field. The value is encrypted and stored in the instance's credential vault. You can add credentials for additional providers later from the Credentials tab."}),e.jsxs("p",{children:["Not sure which credential type to use? See the"," ",e.jsx(s,{to:"/docs/providers",children:"AI Providers"})," page for per-provider instructions."]})]})]}),e.jsxs("div",{className:"docs-step",children:[e.jsx("div",{className:"docs-step-number",children:"3"}),e.jsxs("div",{className:"docs-step-content",children:[e.jsx("h3",{children:"Review & Apply"}),e.jsx("p",{children:"A summary screen showing the choices made in the previous steps. Verify that the provider, model, and credential are correct. This step writes the final configuration to the database. You can go back to previous steps if anything needs adjusting."})]})]}),e.jsxs("div",{className:"docs-step",children:[e.jsx("div",{className:"docs-step-number",children:"4"}),e.jsxs("div",{className:"docs-step-content",children:[e.jsx("h3",{children:"Restart"}),e.jsxs("p",{children:["The wizard triggers a restart (or first start) of the instance with the new configuration applied. The page transitions to the Overview tab and shows the instance moving through ",e.jsx("code",{children:"starting"})," to ",e.jsx("code",{children:"running"}),". On first boot this can take a few minutes while the container image is pulled and the gateway initializes."]})]})]})]})]}),e.jsxs("div",{className:"docs-section",children:[e.jsx("h2",{children:"Tips"}),e.jsxs("div",{className:"docs-info-box",children:[e.jsx("strong",{children:"First boot is slow."})," Expect 1 to 3 minutes on a fresh instance. The container image needs to be pulled, the gateway process needs to initialize, and the startup probe has up to 310 seconds to pass before the health check is recorded. Subsequent starts from a warm image cache are much faster."]}),e.jsxs("div",{className:"docs-info-box",children:[e.jsx("strong",{children:"Workspace file changes sync live."})," Saving a workspace file writes it to the database and pushes it to the running instance's filesystem. You don't need to restart for most file changes. SOUL.md and AGENTS.md are re-read at each new session start, so existing open sessions won't see changes until they start fresh."]}),e.jsxs("div",{className:"docs-info-box",children:[e.jsx("strong",{children:"Credentials stay secret."})," Credential values are encrypted before being written to the database and are never returned in any API response after creation. They never appear in application logs. If you suspect a credential was compromised, delete it and create a new one."]}),e.jsxs("div",{className:"docs-info-box",children:[e.jsx("strong",{children:"Use the Events tab to troubleshoot."})," If an instance won't start or keeps flipping to error state, the Events tab shows exactly what happened and when. Check the metadata on the most recent error event for the specific failure message from the orchestrator or health check."]}),e.jsxs("div",{className:"docs-info-box",children:[e.jsx("strong",{children:"Health monitor polling rates."})," The platform checks"," ",e.jsx("code",{children:"starting"})," instances every 5 seconds to catch startup completion quickly. Once an instance is ",e.jsx("code",{children:"running"}),", checks drop to every 30 seconds. An instance in ",e.jsx("code",{children:"error"})," state is also polled every 30 seconds so that auto-recovery can happen if the underlying pod stabilizes on its own."]})]})]})}export{a as DocsInstancesPage};
@@ -0,0 +1 @@
1
+ import{r as n,j as s,L as e,b as t,O as i}from"./index-BqzqZJ96.js";import{T as r}from"./ThemeToggle-DymKEYXG.js";const b=[{to:"/docs",label:"Overview",end:!0},{to:"/docs/getting-started",label:"Getting Started"},{to:"/docs/instances",label:"Instances"},{to:"/docs/providers",label:"AI Providers"},{to:"/docs/workspace",label:"Workspace Files"},{to:"/docs/templates",label:"Templates"},{to:"/docs/skills",label:"Skills & ClaWHub"},{to:"/docs/channels",label:"Channels"},{to:"/docs/group-chats",label:"Group Chats"},{to:"/docs/about",label:"About"}];function m(){const[a,c]=n.useState(!1),l=()=>c(!1);return s.jsxs("div",{className:"docs-layout",children:[s.jsx(r,{}),s.jsx("header",{className:"docs-header",children:s.jsxs("div",{className:"docs-header-inner",children:[s.jsxs("div",{className:"docs-header-left",children:[s.jsx("button",{className:"docs-sidebar-toggle",onClick:()=>c(!a),"aria-label":"Toggle navigation",children:a?"✕":"☰"}),s.jsx(e,{to:"/docs",className:"docs-brand",children:"Aquarium"}),s.jsx("span",{className:"docs-brand-tag",children:"Docs"})]}),s.jsxs("nav",{className:"docs-nav",children:[s.jsx(e,{to:"/login",children:"Sign In"}),s.jsx(e,{to:"/signup",className:"docs-nav-cta",children:"Get Started"})]})]})}),s.jsxs("div",{className:"docs-layout-body",children:[s.jsx("aside",{className:`docs-sidebar ${a?"docs-sidebar--open":""}`,children:s.jsx("nav",{className:"docs-sidebar-nav",children:b.map(o=>s.jsx(t,{to:o.to,end:o.end,className:({isActive:d})=>`docs-sidebar-link ${d?"docs-sidebar-link--active":""}`,onClick:l,children:o.label},o.to))})}),a&&s.jsx("div",{className:"docs-sidebar-overlay",onClick:l}),s.jsx("main",{className:"docs-main",children:s.jsx("article",{className:"docs-article",children:s.jsx(i,{})})})]}),s.jsx("footer",{className:"docs-footer",children:s.jsxs("p",{children:[s.jsx(e,{to:"/login",children:"Sign In"})," · ",s.jsx(e,{to:"/signup",children:"Create Account"})," · ",s.jsx(e,{to:"/docs",children:"Documentation"})]})})]})}export{m as DocsLayout};
@@ -0,0 +1 @@
1
+ import{j as e,L as s}from"./index-BqzqZJ96.js";function r(){return e.jsxs("div",{className:"docs-page",children:[e.jsx("h1",{children:"AI Providers"}),e.jsx("p",{className:"docs-intro",children:"Aquarium supports 18+ AI providers. Each provider can be configured with API keys or, for select providers, via OAuth authentication. All credentials are encrypted at rest with AES-256-GCM."}),e.jsxs("div",{className:"docs-section",children:[e.jsx("h2",{children:"Provider Tiers"}),e.jsx("p",{children:"Providers are grouped into three tiers based on how they authenticate and how tightly they integrate with the platform."}),e.jsxs("div",{className:"docs-provider-grid docs-provider-grid--tiers",children:[e.jsxs("div",{className:"docs-provider-card docs-provider-card--tier1",children:[e.jsx("div",{className:"docs-provider-card__badge",children:"Tier 1"}),e.jsx("h3",{children:"Deep Integration"}),e.jsx("p",{children:"Full OAuth support with automatic token refresh. Uses device-code or PKCE flows so you never have to copy-paste API keys manually. The platform handles token lifecycle end-to-end."}),e.jsx("p",{className:"docs-provider-card__providers",children:"OpenAI, Anthropic, Google Gemini, GitHub Copilot"})]}),e.jsxs("div",{className:"docs-provider-card docs-provider-card--tier2",children:[e.jsx("div",{className:"docs-provider-card__badge",children:"Tier 2"}),e.jsx("h3",{children:"Standard Integration"}),e.jsx("p",{children:"API key authentication with a wide model selection. Generate a key from the provider's dashboard, paste it into the Credentials tab, and you're done."}),e.jsx("p",{className:"docs-provider-card__providers",children:"OpenRouter, Ollama, AWS Bedrock, xAI, Together AI, Venice AI, Groq, DeepSeek, Mistral, Moonshot/Kimi, MiniMax"})]}),e.jsxs("div",{className:"docs-provider-card docs-provider-card--tier3",children:[e.jsx("div",{className:"docs-provider-card__badge",children:"Tier 3"}),e.jsx("h3",{children:"Proxy & Custom"}),e.jsx("p",{children:"Connect to any OpenAI-compatible endpoint. Bring your own proxy server or point to a local deployment. Useful for enterprise setups, cost routing, or self-hosted models."}),e.jsx("p",{className:"docs-provider-card__providers",children:"LiteLLM, Custom Provider, Telegram Bot"})]})]})]}),e.jsxs("div",{className:"docs-section",children:[e.jsx("h2",{children:"Tier 1 Providers (OAuth + API Key)"}),e.jsx("p",{children:"These providers support OAuth flows alongside traditional API keys. OAuth is recommended when available because tokens rotate automatically and you don't need to manage key expiration manually."}),e.jsxs("div",{className:"docs-provider-card docs-provider-card--full",children:[e.jsx("h3",{children:"1. OpenAI"}),e.jsxs("div",{className:"docs-provider-card__meta",children:[e.jsx("span",{className:"docs-badge",children:"API Key"}),e.jsx("span",{className:"docs-badge docs-badge--oauth",children:"OAuth (device-code)"})]}),e.jsx("p",{children:"The most widely used provider. Supports both a static API key from platform.openai.com and a device-code OAuth flow that issues a long-lived refresh token."}),e.jsxs("div",{className:"docs-provider-card__models",children:[e.jsx("strong",{children:"Popular models:"})," gpt-4o, gpt-4-turbo, gpt-3.5-turbo, gpt-4o-mini"]}),e.jsxs("div",{className:"docs-info-box",children:[e.jsx("strong",{children:"OAuth flow:"})," The platform generates a device code. You visit"," ",e.jsx("code",{children:"openai.com/device"}),", enter the code, and approve. The platform receives a refresh token automatically and stores it encrypted."]})]}),e.jsxs("div",{className:"docs-provider-card docs-provider-card--full",children:[e.jsx("h3",{children:"2. Anthropic"}),e.jsx("div",{className:"docs-provider-card__meta",children:e.jsx("span",{className:"docs-badge",children:"API Key"})}),e.jsxs("p",{children:["Claude models from Anthropic. Get your API key from"," ",e.jsx("code",{children:"console.anthropic.com"}),", then add it to the Credentials tab."]}),e.jsxs("div",{className:"docs-provider-card__models",children:[e.jsx("strong",{children:"Popular models:"})," claude-3.5-sonnet, claude-3-opus, claude-3-haiku"]})]}),e.jsxs("div",{className:"docs-provider-card docs-provider-card--full",children:[e.jsx("h3",{children:"3. Google Gemini"}),e.jsxs("div",{className:"docs-provider-card__meta",children:[e.jsx("span",{className:"docs-badge",children:"API Key"}),e.jsx("span",{className:"docs-badge docs-badge--oauth",children:"OAuth (PKCE redirect)"})]}),e.jsx("p",{children:"Google's Gemini model family. Supports a standard API key from Google AI Studio or a PKCE-based OAuth redirect flow tied to your Google account."}),e.jsxs("div",{className:"docs-provider-card__models",children:[e.jsx("strong",{children:"Popular models:"})," gemini-1.5-pro, gemini-1.5-flash, gemini-2.0-flash"]}),e.jsxs("div",{className:"docs-info-box",children:[e.jsx("strong",{children:"OAuth flow:"}),` Click "Connect Google" in the Credentials tab. You're redirected to Google's consent screen. After approval, you're sent back to the platform and tokens are saved automatically.`]})]}),e.jsxs("div",{className:"docs-provider-card docs-provider-card--full",children:[e.jsx("h3",{children:"4. GitHub Copilot"}),e.jsx("div",{className:"docs-provider-card__meta",children:e.jsx("span",{className:"docs-badge docs-badge--oauth",children:"OAuth only (device-code)"})}),e.jsx("p",{children:"Access GPT-4o through your existing GitHub Copilot subscription. No separate API key needed. OAuth only."}),e.jsxs("div",{className:"docs-provider-card__models",children:[e.jsx("strong",{children:"Popular models:"})," gpt-4o via Copilot"]}),e.jsxs("div",{className:"docs-warning-box",children:["Requires an active GitHub Copilot subscription. Internally uses the"," ",e.jsx("code",{children:"openai-codex"})," provider with a limited model set (gpt-5.1-codex-mini, gpt-5.1-codex-max, etc.)."]}),e.jsxs("div",{className:"docs-info-box",children:[e.jsx("strong",{children:"OAuth flow:"})," The platform generates a device code. You visit"," ",e.jsx("code",{children:"github.com/login/device"}),", enter the code, approve the authorization, and return to the platform. The token is saved automatically."]})]})]}),e.jsxs("div",{className:"docs-section",children:[e.jsx("h2",{children:"Tier 2 Providers (API Key)"}),e.jsx("p",{children:"These providers use a static API key. Generate a key from the provider's dashboard and add it to your instance's Credentials tab."}),e.jsxs("div",{className:"docs-provider-grid",children:[e.jsxs("div",{className:"docs-provider-card",children:[e.jsx("h3",{children:"5. OpenRouter"}),e.jsx("div",{className:"docs-provider-card__meta",children:e.jsx("span",{className:"docs-badge",children:"API Key"})}),e.jsxs("p",{children:["An aggregator that routes to 100+ models through a single API. Get a key at"," ",e.jsx("code",{children:"openrouter.ai/keys"}),"."]}),e.jsxs("div",{className:"docs-provider-card__models",children:[e.jsx("strong",{children:"Models:"})," Any model on OpenRouter's catalog"]})]}),e.jsxs("div",{className:"docs-provider-card",children:[e.jsx("h3",{children:"6. Ollama"}),e.jsx("div",{className:"docs-provider-card__meta",children:e.jsx("span",{className:"docs-badge",children:"No key required"})}),e.jsxs("p",{children:["Run open-source models locally or on your own server. No API key needed. Just provide the Ollama server URL (default: ",e.jsx("code",{children:"http://localhost:11434"}),")."]}),e.jsxs("div",{className:"docs-provider-card__models",children:[e.jsx("strong",{children:"Models:"})," llama3, mistral, codellama, and any model you've pulled"]})]}),e.jsxs("div",{className:"docs-provider-card",children:[e.jsx("h3",{children:"7. AWS Bedrock"}),e.jsx("div",{className:"docs-provider-card__meta",children:e.jsx("span",{className:"docs-badge",children:"AWS credentials"})}),e.jsx("p",{children:"Enterprise AI hosting inside AWS. Uses your AWS access key ID and secret access key. Models run in your AWS account's region."}),e.jsxs("div",{className:"docs-provider-card__models",children:[e.jsx("strong",{children:"Models:"})," Claude, Titan, Llama via AWS"]})]}),e.jsxs("div",{className:"docs-provider-card",children:[e.jsx("h3",{children:"8. xAI (Grok)"}),e.jsx("div",{className:"docs-provider-card__meta",children:e.jsx("span",{className:"docs-badge",children:"API Key"})}),e.jsxs("p",{children:["Elon Musk's AI lab. Get a key at ",e.jsx("code",{children:"x.ai"}),"."]}),e.jsxs("div",{className:"docs-provider-card__models",children:[e.jsx("strong",{children:"Models:"})," grok-beta"]})]}),e.jsxs("div",{className:"docs-provider-card",children:[e.jsx("h3",{children:"9. Together AI"}),e.jsx("div",{className:"docs-provider-card__meta",children:e.jsx("span",{className:"docs-badge",children:"API Key"})}),e.jsxs("p",{children:["Hosted open-source model inference. Get a key at ",e.jsx("code",{children:"together.xyz"}),"."]}),e.jsxs("div",{className:"docs-provider-card__models",children:[e.jsx("strong",{children:"Models:"})," Llama, Mistral, Mixtral variants"]})]}),e.jsxs("div",{className:"docs-provider-card",children:[e.jsx("h3",{children:"10. Venice AI"}),e.jsx("div",{className:"docs-provider-card__meta",children:e.jsx("span",{className:"docs-badge",children:"API Key"})}),e.jsxs("p",{children:["Privacy-focused AI inference. No training on your data. Get a key at"," ",e.jsx("code",{children:"venice.ai"}),"."]}),e.jsxs("div",{className:"docs-provider-card__models",children:[e.jsx("strong",{children:"Models:"})," Various open models"]})]}),e.jsxs("div",{className:"docs-provider-card",children:[e.jsx("h3",{children:"11. Groq"}),e.jsx("div",{className:"docs-provider-card__meta",children:e.jsx("span",{className:"docs-badge",children:"API Key"})}),e.jsxs("p",{children:["Ultra-fast inference using LPU hardware. Get a key at"," ",e.jsx("code",{children:"console.groq.com"}),"."]}),e.jsxs("div",{className:"docs-provider-card__models",children:[e.jsx("strong",{children:"Models:"})," llama3-70b, mixtral-8x7b"]})]}),e.jsxs("div",{className:"docs-provider-card",children:[e.jsx("h3",{children:"12. DeepSeek"}),e.jsx("div",{className:"docs-provider-card__meta",children:e.jsx("span",{className:"docs-badge",children:"API Key"})}),e.jsxs("p",{children:["Strong coding and reasoning models from a Chinese AI lab. Get a key at"," ",e.jsx("code",{children:"platform.deepseek.com"}),"."]}),e.jsxs("div",{className:"docs-provider-card__models",children:[e.jsx("strong",{children:"Models:"})," deepseek-chat, deepseek-coder"]})]}),e.jsxs("div",{className:"docs-provider-card",children:[e.jsx("h3",{children:"13. Mistral"}),e.jsx("div",{className:"docs-provider-card__meta",children:e.jsx("span",{className:"docs-badge",children:"API Key"})}),e.jsxs("p",{children:["French AI lab known for efficient, high-quality models. Get a key at"," ",e.jsx("code",{children:"console.mistral.ai"}),"."]}),e.jsxs("div",{className:"docs-provider-card__models",children:[e.jsx("strong",{children:"Models:"})," mistral-large, mistral-medium, mistral-small"]})]}),e.jsxs("div",{className:"docs-provider-card",children:[e.jsx("h3",{children:"14. Moonshot / Kimi"}),e.jsx("div",{className:"docs-provider-card__meta",children:e.jsx("span",{className:"docs-badge",children:"API Key"})}),e.jsxs("p",{children:["Chinese AI assistant optimized for long-context tasks. Get a key at"," ",e.jsx("code",{children:"platform.moonshot.cn"}),"."]}),e.jsxs("div",{className:"docs-provider-card__models",children:[e.jsx("strong",{children:"Models:"})," moonshot-v1-8k, moonshot-v1-32k"]})]}),e.jsxs("div",{className:"docs-provider-card",children:[e.jsx("h3",{children:"15. MiniMax"}),e.jsx("div",{className:"docs-provider-card__meta",children:e.jsx("span",{className:"docs-badge",children:"API Key"})}),e.jsx("p",{children:"Chinese AI provider with multimodal capabilities."}),e.jsxs("div",{className:"docs-provider-card__models",children:[e.jsx("strong",{children:"Models:"})," abab5.5-chat"]})]})]})]}),e.jsxs("div",{className:"docs-section",children:[e.jsx("h2",{children:"Tier 3 Providers (Proxy & Custom)"}),e.jsx("p",{children:"These options let you connect to any OpenAI-compatible API or specialized integration. Useful for enterprise proxies, cost routing, or channel-specific tokens."}),e.jsxs("div",{className:"docs-provider-grid",children:[e.jsxs("div",{className:"docs-provider-card",children:[e.jsx("h3",{children:"16. LiteLLM"}),e.jsx("div",{className:"docs-provider-card__meta",children:e.jsx("span",{className:"docs-badge",children:"Proxy URL + API Key"})}),e.jsx("p",{children:"A proxy server that normalizes 100+ model providers behind a single OpenAI-compatible interface. Run your own LiteLLM server, enter the URL and API key. One credential gives access to every model in your LiteLLM config."})]}),e.jsxs("div",{className:"docs-provider-card",children:[e.jsx("h3",{children:"17. Custom Provider"}),e.jsx("div",{className:"docs-provider-card__meta",children:e.jsx("span",{className:"docs-badge",children:"Base URL + API Key"})}),e.jsx("p",{children:"Connect to any service that implements the OpenAI chat completions API. Enter the base URL and your API key. Works with self-hosted vLLM, llama.cpp servers, Azure OpenAI, or any compatible endpoint."})]}),e.jsxs("div",{className:"docs-provider-card",children:[e.jsx("h3",{children:"18. Telegram Bot"}),e.jsx("div",{className:"docs-provider-card__meta",children:e.jsx("span",{className:"docs-badge",children:"Bot API Token"})}),e.jsx("p",{children:"A special provider for Telegram channel integration. Uses a Telegram Bot API token obtained from BotFather. This isn't a language model provider but enables the Telegram channel on your instance."})]})]})]}),e.jsxs("div",{className:"docs-section",children:[e.jsx("h2",{children:"OAuth Authentication Flows"}),e.jsx("p",{children:"OAuth flows let you connect to a provider without ever seeing an API key. The platform handles token storage, encryption, and refresh automatically."}),e.jsx("h3",{children:"OpenAI Device-Code Flow"}),e.jsx("p",{children:"Device-code flows are designed for headless or embedded clients. The platform acts as the client and polls for approval while you authenticate in your browser."}),e.jsxs("ol",{className:"docs-steps",children:[e.jsxs("li",{className:"docs-step",children:["In the Credentials tab, click ",e.jsx("strong",{children:'"Connect OpenAI"'})," (or choose OpenAI during the setup wizard)."]}),e.jsxs("li",{className:"docs-step",children:["The platform displays a user code, for example ",e.jsx("code",{children:"ABCD-1234"}),"."]}),e.jsxs("li",{className:"docs-step",children:["Click the link to open ",e.jsx("code",{children:"openai.com/device"})," in a new tab."]}),e.jsx("li",{className:"docs-step",children:"Enter the user code on OpenAI's website."}),e.jsx("li",{className:"docs-step",children:"Approve the authorization request."}),e.jsx("li",{className:"docs-step",children:"Return to the platform. It detects the approval automatically within a few seconds."}),e.jsx("li",{className:"docs-step",children:"Your refresh token is saved and encrypted with AES-256-GCM."})]}),e.jsx("h3",{children:"Google PKCE Flow"}),e.jsx("p",{children:"PKCE (Proof Key for Code Exchange) is a redirect-based flow suited for web clients. No client secret is exposed."}),e.jsxs("ol",{className:"docs-steps",children:[e.jsxs("li",{className:"docs-step",children:["In the Credentials tab, click ",e.jsx("strong",{children:'"Connect Google"'}),"."]}),e.jsx("li",{className:"docs-step",children:"You're redirected to Google's consent screen."}),e.jsx("li",{className:"docs-step",children:"Select your Google account and approve access to the requested scopes."}),e.jsx("li",{className:"docs-step",children:"You're redirected back to the platform."}),e.jsx("li",{className:"docs-step",children:"Tokens are saved and encrypted automatically. No further action needed."})]}),e.jsx("h3",{children:"GitHub Copilot Device-Code Flow"}),e.jsx("p",{children:"Same device-code pattern as OpenAI, but authenticates with GitHub's OAuth server to obtain a Copilot-scoped access token."}),e.jsxs("ol",{className:"docs-steps",children:[e.jsxs("li",{className:"docs-step",children:["In the Credentials tab, click ",e.jsx("strong",{children:'"Connect GitHub Copilot"'}),"."]}),e.jsx("li",{className:"docs-step",children:"The platform displays a user code."}),e.jsxs("li",{className:"docs-step",children:["Click the link to open ",e.jsx("code",{children:"github.com/login/device"}),"."]}),e.jsx("li",{className:"docs-step",children:"Enter the user code."}),e.jsx("li",{className:"docs-step",children:"Approve the authorization request on GitHub."}),e.jsx("li",{className:"docs-step",children:"Return to the platform. The token is saved automatically."})]}),e.jsxs("div",{className:"docs-warning-box",children:["GitHub Copilot requires an active subscription. Internally, the platform maps this to the ",e.jsx("code",{children:"openai-codex"})," provider with a limited model selection:"," ",e.jsx("code",{children:"gpt-5.1-codex-mini"}),", ",e.jsx("code",{children:"gpt-5.1-codex-max"}),", and a few others. Standard OpenAI models aren't available through the Copilot token."]})]}),e.jsxs("div",{className:"docs-section",children:[e.jsx("h2",{children:"Credential Vault"}),e.jsx("p",{children:"The platform stores credentials at two levels. Understanding which level to use saves time when you're managing multiple instances or spinning up templates."}),e.jsx("h3",{children:"1. Instance Credentials"}),e.jsx("p",{children:"Tied to a specific instance. Added via the Credentials tab on the instance page. Only that instance can use them. Good for credentials you don't want to share across instances, or when different instances need different keys for the same provider."}),e.jsx("h3",{children:"2. User Credential Vault"}),e.jsx("p",{children:"A cross-instance credential store accessible from your profile. Add a credential once and reuse it across any template instantiation."}),e.jsxs("ol",{className:"docs-steps",children:[e.jsxs("li",{className:"docs-step",children:["Navigate to your ",e.jsx("strong",{children:"Profile"})," page and find the Credential Vault section."]}),e.jsx("li",{className:"docs-step",children:"Add a credential with: Provider, Credential Type, Value, and a Display Name."}),e.jsxs("li",{className:"docs-step",children:["When instantiating a template that declares credential requirements via"," ",e.jsx("code",{children:"${CREDENTIAL:provider:type}"})," placeholders, the platform checks your vault automatically and injects the matching values."]})]}),e.jsxs("div",{className:"docs-info-box",children:[e.jsx("strong",{children:"Credential resolution order:"})," Instance credentials are checked first. If not found, the platform checks your User Credential Vault. If still not found, you'll be prompted to add the missing credential before the instance can start."]})]}),e.jsxs("div",{className:"docs-section",children:[e.jsx("h2",{children:"Adding Credentials to an Instance"}),e.jsx("p",{children:"Most providers require a credential before your instance can use them. Here's the standard flow for adding an API key directly to an instance."}),e.jsxs("ol",{className:"docs-steps",children:[e.jsxs("li",{className:"docs-step",children:["Navigate to your ",e.jsx(s,{to:"/docs/instances",children:"instance page"}),"."]}),e.jsxs("li",{className:"docs-step",children:["Click the ",e.jsx("strong",{children:'"Credentials"'})," tab."]}),e.jsxs("li",{className:"docs-step",children:["Click ",e.jsx("strong",{children:'"Add Credential"'}),"."]}),e.jsxs("li",{className:"docs-step",children:["Select the provider, for example ",e.jsx("code",{children:"openai"}),"."]}),e.jsxs("li",{className:"docs-step",children:["Choose the credential type. For most providers this is ",e.jsx("code",{children:"api_key"}),"."]}),e.jsx("li",{className:"docs-step",children:"Paste your API key into the value field."}),e.jsxs("li",{className:"docs-step",children:["Click ",e.jsx("strong",{children:"Save"}),". The key is encrypted immediately before storage."]}),e.jsxs("li",{className:"docs-step",children:["Restart your instance for the new credential to take effect. See"," ",e.jsx(s,{to:"/docs/instances",children:"Managing Instances"})," for restart steps."]})]}),e.jsxs("div",{className:"docs-info-box",children:["Credentials are written to the instance's config file on startup via the"," ",e.jsx(s,{to:"/docs/workspace",children:"workspace adapter"}),". The raw key is never stored in plaintext on disk."]})]})]})}export{r as DocsProvidersPage};
@@ -0,0 +1 @@
1
+ import{j as s,L as e}from"./index-BqzqZJ96.js";function i(){return s.jsxs("div",{className:"docs-page",children:[s.jsx("h1",{children:"Skills & ClaWHub"}),s.jsx("p",{className:"docs-lead",children:"ClaWHub is the skill registry for OpenClaw. Skills are pre-built capabilities that extend your bot — from web search to flight booking, code execution to data analysis. Browse, install, and manage skills directly from your instance's Skills tab."}),s.jsxs("section",{className:"docs-section",children:[s.jsx("h2",{children:"What Are Skills?"}),s.jsx("p",{children:"Skills are packages of tools, prompts, and configurations that give your bot new abilities. Think of them like apps for your AI agent — each one unlocks a specific capability or domain."}),s.jsxs("ul",{children:[s.jsxs("li",{children:["Each skill defines one or more"," ",s.jsx("strong",{children:"MCP (Model Context Protocol) tools"})," that the AI can call during conversations."]}),s.jsxs("li",{children:["Skills can have ",s.jsx("strong",{children:"requirements"})," — certain API keys, provider configurations, or model capabilities your instance needs to support the skill."]}),s.jsxs("li",{children:["Skills are ",s.jsx("strong",{children:"versioned and community-maintained"}),". When a skill updates, you'll see an upgrade prompt in the Skills tab."]}),s.jsxs("li",{children:["Some skills are ",s.jsx("strong",{children:"bundled"})," with OpenClaw (built-in, no download needed). Others come from the ClaWHub registry and need to be installed."]})]})]}),s.jsxs("section",{className:"docs-section",children:[s.jsx("h2",{children:"The Skills Tab"}),s.jsxs("p",{children:["Every instance page has a ",s.jsx("strong",{children:"Skills / ClaWHub"})," tab. Here's what you'll find there:"]}),s.jsxs("ul",{children:[s.jsxs("li",{children:[s.jsx("strong",{children:"Summary stats"})," at the top: total skills available in ClaWHub, how many are installed on this instance, and how many your instance is eligible to use based on its current configuration."]}),s.jsxs("li",{children:[s.jsx("strong",{children:"Filter tabs:"}),s.jsxs("ul",{children:[s.jsxs("li",{children:[s.jsx("em",{children:"All"})," — browse every skill in the registry"]}),s.jsxs("li",{children:[s.jsx("em",{children:"Eligible"})," — skills your instance can actually use right now"]}),s.jsxs("li",{children:[s.jsx("em",{children:"Enabled"})," — skills that are currently active"]})]})]}),s.jsxs("li",{children:["A ",s.jsx("strong",{children:"search bar"})," lets you find skills by name or description."]}),s.jsx("li",{children:"Each skill card shows the skill name, description, version, and whether it's bundled, installed, or available from the registry."})]})]}),s.jsxs("section",{className:"docs-section",children:[s.jsx("h2",{children:"Enabling Bundled Skills"}),s.jsx("p",{children:"Bundled skills ship with OpenClaw itself. They don't need to be downloaded — they're already part of your instance's runtime."}),s.jsxs("ol",{className:"docs-steps",children:[s.jsxs("li",{className:"docs-step",children:["Open your instance page and click the ",s.jsx("strong",{children:"Skills / ClaWHub"})," tab."]}),s.jsxs("li",{className:"docs-step",children:["Look for skills with the ",s.jsx("strong",{children:'"bundled"'})," badge."]}),s.jsx("li",{className:"docs-step",children:"Click the toggle switch to enable the skill."}),s.jsx("li",{className:"docs-step",children:"The change takes effect immediately — no restart required."})]}),s.jsx("p",{children:"To disable, flip the toggle off. The skill's tools become unavailable to the AI but nothing is uninstalled."})]}),s.jsxs("section",{className:"docs-section",children:[s.jsx("h2",{children:"Installing Community Skills"}),s.jsx("p",{children:"There are two ways to install a skill from ClaWHub."}),s.jsx("h3",{children:"Method 1 — Via the Skills Tab"}),s.jsxs("ol",{className:"docs-steps",children:[s.jsxs("li",{className:"docs-step",children:["Open the ",s.jsx("strong",{children:"Skills / ClaWHub"})," tab on your instance page."]}),s.jsx("li",{className:"docs-step",children:"Browse or search for a skill in the registry."}),s.jsx("li",{className:"docs-step",children:"Click the skill card to see its full description, version history, and requirements."}),s.jsxs("li",{className:"docs-step",children:["If your instance meets all the requirements, the ",s.jsx("strong",{children:"Install"})," button will be active. Click it."]}),s.jsxs("li",{className:"docs-step",children:["Installation runs in the background. It may take ",s.jsx("strong",{children:"up to 2 minutes"})," ","for the skill to download, configure, and become active."]}),s.jsx("li",{className:"docs-step",children:'Once installed, the skill card shows an "Enabled" badge and its tools are available to the AI.'})]}),s.jsx("h3",{children:"Method 2 — Via Chat"}),s.jsxs("ol",{className:"docs-steps",children:[s.jsxs("li",{className:"docs-step",children:["Open the ",s.jsx("strong",{children:"Chat"})," tab on your instance page."]}),s.jsxs("li",{className:"docs-step",children:["Type the install command:",s.jsx("div",{className:"docs-code-block",children:"clawhub install <skill-name>"}),"For example:",s.jsx("div",{className:"docs-code-block",children:"clawhub install jinko-flight-search"})]}),s.jsx("li",{className:"docs-step",children:"The bot will handle the installation and confirm when the skill is ready."})]}),s.jsxs("div",{className:"docs-info-box",children:[s.jsx("strong",{children:"Note:"})," Skill installation triggers a ",s.jsx("code",{children:"session_spawn"})," in the gateway for isolated execution. Your instance needs the ",s.jsx("code",{children:"sessions_spawn"})," ","permission configured, which is set automatically by the platform."]})]}),s.jsxs("section",{className:"docs-section",children:[s.jsx("h2",{children:"Skill Requirements"}),s.jsx("p",{children:"Some skills need external credentials or specific configuration before they'll work. The Skills tab makes this visible."}),s.jsxs("ul",{children:[s.jsxs("li",{children:["Skills with unmet requirements show a ",s.jsx("strong",{children:"warning icon"})," on their card. Hover to see exactly what's missing."]}),s.jsxs("li",{children:["Most commonly, skills need ",s.jsx("strong",{children:"API keys"})," added to your instance's Credentials tab. For example:",s.jsx("ul",{children:s.jsxs("li",{children:[s.jsx("code",{children:"jinko-flight-search"})," requires a"," ",s.jsx("strong",{children:"Travelfusion API key"})," configured as a credential."]})})]}),s.jsxs("li",{children:["Add the required credentials first (via the ",s.jsx("strong",{children:"Credentials"})," tab), then return to Skills to install."]}),s.jsxs("li",{children:["Some skills require a specific ",s.jsx("strong",{children:"AI provider"})," or model capability. Check the skill's requirements section for details."]})]}),s.jsxs("p",{children:["Need help setting up credentials? See the"," ",s.jsx(e,{to:"/docs/instances",children:"Instances"})," documentation."]})]}),s.jsxs("section",{className:"docs-section",children:[s.jsx("h2",{children:"Managing Installed Skills"}),s.jsxs("ul",{children:[s.jsxs("li",{children:[s.jsx("strong",{children:"Toggle on/off"})," from the Skills tab at any time. Disabling a skill deactivates its tools without removing the installation."]}),s.jsx("li",{children:"Re-enable a disabled skill instantly — no re-download needed."}),s.jsxs("li",{children:["When a newer version is available, an ",s.jsx("strong",{children:"Upgrade"})," button appears on the skill card. Upgrades are applied in-place."]}),s.jsxs("li",{children:["To fully remove a skill, use the ",s.jsx("strong",{children:"Uninstall"})," option in the skill card's menu."]})]})]}),s.jsxs("section",{className:"docs-section",children:[s.jsx("h2",{children:"Tips"}),s.jsxs("ul",{children:[s.jsxs("li",{children:["Start with ",s.jsx("strong",{children:"bundled skills"})," to explore what's possible before adding third-party integrations."]}),s.jsx("li",{children:"Always check skill requirements before installing — missing credentials will cause the skill to fail silently."}),s.jsx("li",{children:"Some skills work better with specific AI models. For instance, tool-heavy skills benefit from models with strong function-calling support."}),s.jsxs("li",{children:["If a skill install seems stuck, check the instance logs in the"," ",s.jsx("strong",{children:"Logs"})," tab for errors."]}),s.jsxs("li",{children:["The chat method (",s.jsx("code",{children:"clawhub install"}),") is handy if you already have a chat session open."]})]})]}),s.jsxs("nav",{className:"docs-page-nav",children:[s.jsx(e,{to:"/docs/templates",className:"docs-page-nav__prev",children:"← Templates"}),s.jsx(e,{to:"/docs/channels",className:"docs-page-nav__next",children:"Channels →"})]})]})}export{i as DocsSkillsPage};
@@ -0,0 +1 @@
1
+ import{j as e,L as s}from"./index-BqzqZJ96.js";function a(){return e.jsxs("div",{className:"docs-templates",children:[e.jsxs("div",{className:"docs-section",children:[e.jsx("h1",{children:"Bot Templates"}),e.jsx("p",{children:"The Template Marketplace lets you browse, share, and reuse pre-configured bot setups. A template packages workspace files, MCP server configurations, skill definitions, and credential requirements into a reusable unit you can instantiate with a few clicks."})]}),e.jsxs("div",{className:"docs-section",children:[e.jsx("h2",{children:"Browsing the Marketplace"}),e.jsx("p",{children:"The marketplace is accessible from the dashboard sidebar or the top navigation bar. You can search or filter to find what you need:"}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Search"})," by name or keyword to find templates matching a specific use case."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Filter by category:"})," Customer Service, Sales, Coding, Personal, Education, Research, Creative, or Custom."]}),e.jsx("li",{children:"Each template card shows its name, description, author, category, install count, and fork count at a glance."}),e.jsx("li",{children:"Click any template to open the detail page, which shows the full description, workspace file previews, required credentials, and included MCP server configs."})]})]}),e.jsxs("div",{className:"docs-section",children:[e.jsx("h2",{children:"Instantiating a Template"}),e.jsx("p",{children:"Instantiating creates a new bot instance pre-loaded with everything in the template. No manual setup needed for the workspace files or MCP configs."}),e.jsxs("div",{className:"docs-steps",children:[e.jsxs("div",{className:"docs-step",children:[e.jsx("div",{className:"docs-step-number",children:"1"}),e.jsx("div",{className:"docs-step-content",children:"Find a template you like in the marketplace."})]}),e.jsxs("div",{className:"docs-step",children:[e.jsx("div",{className:"docs-step-number",children:"2"}),e.jsxs("div",{className:"docs-step-content",children:["Click ",e.jsx("strong",{children:"Use Template"}),' (also labeled "Instantiate" on some views).']})]}),e.jsxs("div",{className:"docs-step",children:[e.jsx("div",{className:"docs-step-number",children:"3"}),e.jsx("div",{className:"docs-step-content",children:"Enter a name for your new instance."})]}),e.jsxs("div",{className:"docs-step",children:[e.jsx("div",{className:"docs-step-number",children:"4"}),e.jsxs("div",{className:"docs-step-content",children:["Choose a ",e.jsx("strong",{children:"deployment target"})," — Docker or Kubernetes. This defaults to whatever the platform is currently configured to use."]})]}),e.jsxs("div",{className:"docs-step",children:[e.jsx("div",{className:"docs-step-number",children:"5"}),e.jsx("div",{className:"docs-step-content",children:"If the template declares credential requirements (for example, an OpenAI API key), you'll see a warning listing any missing credentials. You can proceed anyway and add them after creation."})]}),e.jsxs("div",{className:"docs-step",children:[e.jsx("div",{className:"docs-step-number",children:"6"}),e.jsxs("div",{className:"docs-step-content",children:["Click ",e.jsx("strong",{children:"Create"}),". The platform provisions a new instance with all the template's workspace files and configuration pre-loaded."]})]}),e.jsxs("div",{className:"docs-step",children:[e.jsx("div",{className:"docs-step-number",children:"7"}),e.jsxs("div",{className:"docs-step-content",children:["If any credentials were flagged as missing, go to the ",e.jsx("strong",{children:"Credentials"})," ","tab and add them now."]})]}),e.jsxs("div",{className:"docs-step",children:[e.jsx("div",{className:"docs-step-number",children:"8"}),e.jsxs("div",{className:"docs-step-content",children:["Click ",e.jsx("strong",{children:"Start"}),". The instance boots up with the template's full configuration active from the first session."]})]})]}),e.jsx("div",{className:"docs-info-box",children:"Instances created from a template are fully independent from that point on. Changes you make to the instance don't affect the original template, and template updates don't automatically propagate to existing instances."})]}),e.jsxs("div",{className:"docs-section",children:[e.jsx("h2",{children:"Forking a Template"}),e.jsx("p",{children:"Forking creates a personal copy of any marketplace template under your own account. Use it when you want to start from someone else's template but make significant customizations."}),e.jsxs("ul",{children:[e.jsx("li",{children:"You become the author of the forked copy."}),e.jsx("li",{children:"You can modify the fork freely without affecting the original template."}),e.jsx("li",{children:"The forked template appears in your template list alongside any templates you created from scratch."}),e.jsxs("li",{children:["Click the ",e.jsx("strong",{children:"Fork"})," button on any template's detail page to create your copy immediately."]})]}),e.jsx("div",{className:"docs-info-box",children:"The original template's fork count increments when you fork it, giving authors visibility into how widely their templates are being used."})]}),e.jsxs("div",{className:"docs-section",children:[e.jsx("h2",{children:"Creating a Template"}),e.jsx("p",{children:"There are two ways to create a template: from scratch, or by exporting a live instance."}),e.jsx("h3",{children:"Option A — From Scratch"}),e.jsxs("div",{className:"docs-steps",children:[e.jsxs("div",{className:"docs-step",children:[e.jsx("div",{className:"docs-step-number",children:"1"}),e.jsxs("div",{className:"docs-step-content",children:["Navigate to the Templates page and click ",e.jsx("strong",{children:"Create Template"}),"."]})]}),e.jsxs("div",{className:"docs-step",children:[e.jsx("div",{className:"docs-step-number",children:"2"}),e.jsxs("div",{className:"docs-step-content",children:["Fill in the basic metadata: ",e.jsx("strong",{children:"Name"}),", ",e.jsx("strong",{children:"Slug"})," ","(the URL-friendly identifier, like ",e.jsx("code",{children:"my-coding-assistant"}),"),"," ",e.jsx("strong",{children:"Description"}),", ",e.jsx("strong",{children:"Category"}),", and"," ",e.jsx("strong",{children:"Tags"}),"."]})]}),e.jsxs("div",{className:"docs-step",children:[e.jsx("div",{className:"docs-step-number",children:"3"}),e.jsxs("div",{className:"docs-step-content",children:["Define the content for each workspace file. At minimum, fill in SOUL.md to give the bot a personality. See"," ",e.jsx(s,{to:"/docs/workspace",children:"Workspace Files"})," for what each file does."]})]}),e.jsxs("div",{className:"docs-step",children:[e.jsx("div",{className:"docs-step-number",children:"4"}),e.jsx("div",{className:"docs-step-content",children:"Optionally configure MCP servers and skills that the template should include."})]}),e.jsxs("div",{className:"docs-step",children:[e.jsx("div",{className:"docs-step-number",children:"5"}),e.jsxs("div",{className:"docs-step-content",children:["Set the ",e.jsx("strong",{children:"license"}),": ",e.jsx("em",{children:"Public"})," (visible to everyone in the marketplace), ",e.jsx("em",{children:"Private"})," (only accessible to you), or"," ",e.jsx("em",{children:"Unlisted"})," (accessible via direct link but not listed in search results)."]})]}),e.jsxs("div",{className:"docs-step",children:[e.jsx("div",{className:"docs-step-number",children:"6"}),e.jsxs("div",{className:"docs-step-content",children:["Click ",e.jsx("strong",{children:"Publish"}),"."]})]})]}),e.jsx("h3",{children:"Option B — Export from an Existing Instance"}),e.jsxs("div",{className:"docs-steps",children:[e.jsxs("div",{className:"docs-step",children:[e.jsx("div",{className:"docs-step-number",children:"1"}),e.jsx("div",{className:"docs-step-content",children:"Navigate to the instance you want to export."})]}),e.jsxs("div",{className:"docs-step",children:[e.jsx("div",{className:"docs-step-number",children:"2"}),e.jsxs("div",{className:"docs-step-content",children:["Use the ",e.jsx("strong",{children:"Export as Template"})," action from the instance settings or actions menu."]})]}),e.jsxs("div",{className:"docs-step",children:[e.jsx("div",{className:"docs-step-number",children:"3"}),e.jsx("div",{className:"docs-step-content",children:"The platform captures all workspace files, MCP server configs, and skill settings from the running instance and pre-fills the template form."})]}),e.jsxs("div",{className:"docs-step",children:[e.jsx("div",{className:"docs-step-number",children:"4"}),e.jsx("div",{className:"docs-step-content",children:"Edit the template metadata: name, description, category, and any other fields you want to set before publishing."})]}),e.jsxs("div",{className:"docs-step",children:[e.jsx("div",{className:"docs-step-number",children:"5"}),e.jsxs("div",{className:"docs-step-content",children:["Credential values are ",e.jsx("strong",{children:"not"})," exported. Only placeholder declarations are captured. This ensures you never accidentally share API keys or tokens when publishing a template."]})]}),e.jsxs("div",{className:"docs-step",children:[e.jsx("div",{className:"docs-step-number",children:"6"}),e.jsxs("div",{className:"docs-step-content",children:["Click ",e.jsx("strong",{children:"Publish"}),"."]})]})]})]}),e.jsxs("div",{className:"docs-section",children:[e.jsx("h2",{children:"Template Versioning"}),e.jsx("p",{children:"Templates use semantic versioning. Every time you update a published template, the platform creates a new row with a bumped version number rather than overwriting the existing one."}),e.jsxs("ul",{children:[e.jsxs("li",{children:["The ",e.jsx("code",{children:"is_latest"})," flag marks the currently active version. The marketplace always shows the latest version to users browsing."]}),e.jsx("li",{children:"Instances created from older versions are not affected when you publish an update. They keep running against the config they were created with."}),e.jsx("li",{children:"If you need to roll back a template, contact support — previous versions are retained in the database and can be re-flagged as latest."})]}),e.jsx("div",{className:"docs-warning-box",children:"Publishing a template update doesn't automatically update any instances that were created from previous versions. Users who want the latest version need to create a new instance from the updated template."})]}),e.jsxs("div",{className:"docs-section",children:[e.jsx("h2",{children:"Credential Placeholders"}),e.jsxs("p",{children:["Templates can declare that they require certain credentials without embedding the actual secret values. Placeholders use the syntax"," ",e.jsx("code",{children:"${CREDENTIAL:provider:type}"}),"."]}),e.jsxs("p",{children:["For example, ",e.jsx("code",{children:"${CREDENTIAL:openai:api_key}"})," tells the platform that this template needs an OpenAI API key. When someone instantiates the template, the platform resolves credentials in three layers:"]}),e.jsxs("ol",{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Instance credentials"})," — credentials already attached to the newly created instance."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"User vault"})," — credentials stored in your profile's User Vault (see the Profile page). If a matching credential is found here, it's automatically applied to the instance without any extra steps."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Prompt user"})," — if no matching credential is found in either place, the platform shows a warning listing what's missing so you know what to add after creation."]})]}),e.jsxs("div",{className:"docs-info-box",children:["Adding your API keys to the ",e.jsx("strong",{children:"User Vault"})," on your Profile page means you'll never be prompted for credentials again when instantiating templates that need the same provider. The platform handles the wiring automatically."]})]}),e.jsxs("div",{className:"docs-section",children:[e.jsx("h2",{children:"Related"}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx(s,{to:"/docs/workspace",children:"Workspace Files"})," — understand what goes inside a template's workspace file set and how each file shapes bot behavior."]}),e.jsxs("li",{children:[e.jsx(s,{to:"/docs/instances",children:"Instances"})," — the full instance lifecycle, including how template-created instances are managed after creation."]}),e.jsxs("li",{children:[e.jsx(s,{to:"/docs/skills",children:"Skills"})," — skill packages that can be bundled with templates to give bots pre-built capabilities out of the box."]}),e.jsxs("li",{children:[e.jsx(s,{to:"/docs/providers",children:"AI Providers"})," — provider setup details, including which credential types the placeholder syntax supports."]})]})]})]})}export{a as DocsTemplatesPage};
@@ -0,0 +1,24 @@
1
+ import{j as e,L as s}from"./index-BqzqZJ96.js";function i(){return e.jsxs("div",{className:"docs-workspace",children:[e.jsxs("div",{className:"docs-section",children:[e.jsx("h1",{children:"Workspace Files"}),e.jsx("p",{children:"OpenClaw uses 8 markdown files to define your bot's personality, behavior, and capabilities. These files are edited directly in the platform via the Workspace tab on your instance page. Changes are saved to the database and synced to your running instance."})]}),e.jsxs("div",{className:"docs-section",children:[e.jsx("h2",{children:"SOUL.md"}),e.jsx("p",{children:"The personality and values file. This is the most important workspace file — it defines your bot's core character, communication style, ethical boundaries, and guiding principles. The gateway loads SOUL.md at session start and uses it as the foundation for every interaction."}),e.jsx("p",{children:"Spend real time on this file. A vague SOUL.md produces an inconsistent bot. A specific, opinionated one produces a bot that feels deliberate and trustworthy."}),e.jsx("pre",{className:"docs-code-block",children:e.jsx("code",{children:`You are a helpful and friendly AI assistant.
2
+ You speak in a warm, professional tone.
3
+ You never provide medical, legal, or financial advice.
4
+ You always cite your sources when sharing factual information.`})})]}),e.jsxs("div",{className:"docs-section",children:[e.jsx("h2",{children:"AGENTS.md"}),e.jsx("p",{children:"Task-to-model mapping. AGENTS.md tells the gateway which AI model to use for different categories of tasks. This is useful when you want to route complex queries to a more capable (and more expensive) model while keeping simple questions on a cheaper one."}),e.jsx("p",{children:"The gateway reads this file when deciding how to handle each incoming request. If no match is found, it falls back to the default model configured in the provider settings."}),e.jsx("pre",{className:"docs-code-block",children:e.jsx("code",{children:`## Task Routing
5
+ - Simple questions: gpt-4o-mini
6
+ - Complex analysis: gpt-4o
7
+ - Code generation: claude-3.5-sonnet`})})]}),e.jsxs("div",{className:"docs-section",children:[e.jsx("h2",{children:"IDENTITY.md"}),e.jsx("p",{children:`Name and persona. Sets the bot's name and self-image. The bot refers to itself using this identity when introducing itself, responding to "who are you" questions, or signing off in conversations.`}),e.jsx("p",{children:"IDENTITY.md is loaded once at session start alongside SOUL.md. Changing the bot's name here takes effect after the next restart."}),e.jsx("pre",{className:"docs-code-block",children:e.jsx("code",{children:`Name: Luna
8
+ Role: Personal Research Assistant
9
+ I help users find, summarize, and analyze information.`})})]}),e.jsxs("div",{className:"docs-section",children:[e.jsx("h2",{children:"USER.md"}),e.jsx("p",{children:"User context. Store information about yourself that the bot should always have in mind. This could include your name, job, technical background, preferred language, or any recurring context that helps personalize responses."}),e.jsx("p",{children:"The gateway injects USER.md into the context at the start of each session. Unlike MEMORY.md, this file is intended for stable facts — the bot won't write back to it."}),e.jsx("pre",{className:"docs-code-block",children:e.jsx("code",{children:`Name: Alice
10
+ Role: Data Scientist at TechCorp
11
+ Interests: Machine learning, Python, data visualization
12
+ Preferred language: English`})})]}),e.jsxs("div",{className:"docs-section",children:[e.jsx("h2",{children:"TOOLS.md"}),e.jsx("p",{children:"Function definitions. TOOLS.md declares custom tools or functions the bot can call during a conversation. Tools extend the bot's capabilities beyond text generation — they let it take actions, retrieve live data, or run calculations."}),e.jsxs("p",{children:["The gateway reads TOOLS.md at startup and registers each declared tool with the model's function-calling system. For skills installed via the marketplace, this file acts as the reference for what's available. See"," ",e.jsx(s,{to:"/docs/skills",children:"Skills"})," for more on extending your bot with pre-built tool packages."]}),e.jsx("pre",{className:"docs-code-block",children:e.jsx("code",{children:`## Available Tools
13
+ - web_search: Search the web for current information
14
+ - calculator: Perform mathematical calculations`})})]}),e.jsxs("div",{className:"docs-section",children:[e.jsx("h2",{children:"BOOTSTRAP.md"}),e.jsx("p",{children:"Initialization instructions. These are the first instructions the bot sees when starting a new session. Use this file for setup tasks, a welcome routine, or any one-time work that should happen before the user says anything."}),e.jsx("p",{children:"BOOTSTRAP.md runs once per session start, not on every message. If you want repeating background tasks, use HEARTBEAT.md instead."}),e.jsx("pre",{className:"docs-code-block",children:e.jsx("code",{children:`On startup:
15
+ 1. Greet the user by name (from USER.md)
16
+ 2. Summarize any pending tasks from MEMORY.md
17
+ 3. Ask how you can help today`})})]}),e.jsxs("div",{className:"docs-section",children:[e.jsx("h2",{children:"HEARTBEAT.md"}),e.jsx("p",{children:"Background tasks. The bot checks HEARTBEAT.md on a regular interval and runs any periodic tasks you've defined. This is how you give your bot proactive behavior — checking emails, updating task lists, or sending reminders without being asked."}),e.jsx("p",{children:"Keep heartbeat tasks lightweight. They run on a timer in the background, so heavy operations can interfere with normal conversation responsiveness."}),e.jsx("pre",{className:"docs-code-block",children:e.jsx("code",{children:`Every 30 minutes:
18
+ - Check for new emails and summarize them
19
+ - Update the daily task list in MEMORY.md`})})]}),e.jsxs("div",{className:"docs-section",children:[e.jsx("h2",{children:"MEMORY.md"}),e.jsxs("p",{children:["Long-term notes. A persistent scratchpad where the bot stores information across sessions. MEMORY.md is the only workspace file the bot reads ",e.jsx("em",{children:"and writes to"}),". Anything the bot records here survives session restarts and is available next time the conversation picks up."]}),e.jsx("p",{children:"Don't put static configuration in this file. Because the bot can overwrite it, any manual changes you make might be replaced the next time the bot updates its memory. Static context belongs in USER.md; instructions belong in SOUL.md or BOOTSTRAP.md."}),e.jsx("pre",{className:"docs-code-block",children:e.jsx("code",{children:`## User Preferences
20
+ - Prefers bullet points over paragraphs
21
+ - Likes code examples in Python
22
+
23
+ ## Ongoing Tasks
24
+ - Research report on renewable energy (due Friday)`})})]}),e.jsxs("div",{className:"docs-section",children:[e.jsx("h2",{children:"How to Edit Workspace Files"}),e.jsx("p",{children:"All workspace files are editable directly in the platform without any external tooling. Here's the full flow:"}),e.jsxs("div",{className:"docs-steps",children:[e.jsxs("div",{className:"docs-step",children:[e.jsx("div",{className:"docs-step-number",children:"1"}),e.jsx("div",{className:"docs-step-content",children:"Navigate to your instance page by clicking the instance name on the dashboard."})]}),e.jsxs("div",{className:"docs-step",children:[e.jsx("div",{className:"docs-step-number",children:"2"}),e.jsxs("div",{className:"docs-step-content",children:["Click the ",e.jsx("strong",{children:"Workspace"})," tab in the instance navigation bar."]})]}),e.jsxs("div",{className:"docs-step",children:[e.jsx("div",{className:"docs-step-number",children:"3"}),e.jsx("div",{className:"docs-step-content",children:"Select the file you want to edit from the file list on the left side of the editor."})]}),e.jsxs("div",{className:"docs-step",children:[e.jsx("div",{className:"docs-step-number",children:"4"}),e.jsx("div",{className:"docs-step-content",children:"Edit the content in the text editor. The editor accepts plain markdown with no special syntax requirements."})]}),e.jsxs("div",{className:"docs-step",children:[e.jsx("div",{className:"docs-step-number",children:"5"}),e.jsxs("div",{className:"docs-step-content",children:["Click ",e.jsx("strong",{children:"Save"})," to persist your changes to the database."]})]}),e.jsxs("div",{className:"docs-step",children:[e.jsx("div",{className:"docs-step-number",children:"6"}),e.jsx("div",{className:"docs-step-content",children:"Changes are automatically synced to the running instance. Some changes (like provider configuration) require a restart to take effect, but personality and behavior files typically apply on the next session."})]})]})]}),e.jsxs("div",{className:"docs-section",children:[e.jsx("h2",{children:"Tips"}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx("strong",{children:"SOUL.md is your highest-leverage file."}),' Spend time crafting it. Specificity beats generality — "be concise" works, but "respond in 3 sentences or fewer unless asked to elaborate" works better.']}),e.jsxs("li",{children:[e.jsx("strong",{children:"MEMORY.md is the only file the bot writes to."})," Don't put static config here, or the bot may overwrite it."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Use BOOTSTRAP.md for one-time setup."})," If you want something to happen at the start of every session but only once, not repeatedly, that's what BOOTSTRAP.md is for."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Keep HEARTBEAT.md tasks lightweight."})," They run on a timer in the background, so avoid anything that blocks for a long time."]})]}),e.jsx("div",{className:"docs-info-box",children:'If you want to reset a file to its default content, delete everything in the editor and save an empty file. The platform treats an empty file as "not configured" and the gateway falls back to sensible defaults.'})]}),e.jsxs("div",{className:"docs-section",children:[e.jsx("h2",{children:"Related"}),e.jsx("p",{children:"Workspace files work alongside other configuration systems. For more context, see:"}),e.jsxs("ul",{children:[e.jsxs("li",{children:[e.jsx(s,{to:"/docs/instances",children:"Instances"})," — how instances are created, started, and stopped, and where workspace files live in the broader instance lifecycle."]}),e.jsxs("li",{children:[e.jsx(s,{to:"/docs/templates",children:"Bot Templates"})," — pre-packaged workspace file sets you can fork and customize rather than writing from scratch."]}),e.jsxs("li",{children:[e.jsx(s,{to:"/docs/skills",children:"Skills"})," — tool packages that pair with TOOLS.md to give your bot concrete capabilities like web search or calendar access."]})]})]})]})}export{i as DocsWorkspacePage};
@@ -0,0 +1,3 @@
1
+ import{f as P,a as F,r as d,j as e}from"./index-BqzqZJ96.js";import{a as C}from"./api-B5psysvQ.js";import{u as L}from"./useTranslation-B-8kenfJ.js";function q(){const{id:t}=P(),i=F(),{t:a}=L(),[n,l]=d.useState(!0),[o,p]=d.useState(""),[s,_]=d.useState(null),[c,g]=d.useState(""),[m,v]=d.useState(""),[u,j]=d.useState(""),[z,N]=d.useState(""),[x,k]=d.useState("overview"),[f,b]=d.useState(!1),w=d.useCallback(async()=>{if(t){l(!0),p("");try{const r=await C.post(`/templates/from-instance/${t}`);_(r),g(r.draft.name),v(r.draft.slug),j(r.draft.description??""),N((r.draft.tags??[]).join(", "))}catch(r){p(r instanceof Error?r.message:a("exportWizard.error"))}finally{l(!1)}}},[t,a]);d.useEffect(()=>{w()},[w]);function S(){if(!s)return;const r={...s.draft,name:c,slug:m,description:u,tags:z.split(",").map(T=>T.trim()).filter(Boolean),content:s.content},O=new Blob([JSON.stringify(r,null,2)],{type:"application/json"}),W=URL.createObjectURL(O),h=document.createElement("a");h.href=W,h.download=`${m||"template"}.template.json`,h.click(),URL.revokeObjectURL(W)}async function E(){if(s){b(!0),p("");try{await C.post("/templates",{...s.draft,name:c,slug:m,description:u,tags:z.split(",").map(r=>r.trim()).filter(Boolean),content:s.content}),i("/assistants")}catch(r){p(r instanceof Error?r.message:a("exportWizard.error"))}finally{b(!1)}}}const y=s?.securityWarnings.length??0;return e.jsxs("div",{className:"export-wizard",children:[e.jsx("div",{className:"export-wizard__topbar",children:e.jsxs("button",{className:"export-wizard__back-link",onClick:()=>i(-1),children:["← ",a("exportWizard.cancel")]})}),e.jsxs("div",{className:"export-wizard__header",children:[e.jsx("h1",{className:"export-wizard__title",children:a("exportWizard.title")}),e.jsx("p",{className:"export-wizard__subtitle",children:s?c:""})]}),n&&e.jsxs("div",{className:"export-wizard__loading",children:[e.jsx("div",{className:"export-wizard__spinner"}),e.jsx("span",{children:a("exportWizard.loading")})]}),!n&&o&&!s&&e.jsxs("div",{className:"export-wizard__error",children:[e.jsx("p",{className:"export-wizard__error-msg",children:o}),e.jsx("button",{className:"export-wizard__error-btn",onClick:()=>{w()},children:a("exportWizard.retry")})]}),!n&&s&&e.jsxs(e.Fragment,{children:[o&&e.jsx("div",{className:"export-wizard__error",style:{marginBottom:"var(--space-4)",maxWidth:"1100px"},children:e.jsx("p",{className:"export-wizard__error-msg",children:o})}),e.jsxs("div",{className:"export-wizard__content",children:[e.jsxs("div",{className:"export-wizard__metadata",children:[e.jsxs("div",{className:"export-wizard__field",children:[e.jsx("label",{className:"export-wizard__label",children:a("exportWizard.name")}),e.jsx("input",{className:"export-wizard__input",value:c,onChange:r=>g(r.target.value)})]}),e.jsxs("div",{className:"export-wizard__field",children:[e.jsx("label",{className:"export-wizard__label",children:a("exportWizard.slug")}),e.jsx("input",{className:"export-wizard__input",value:m,onChange:r=>v(r.target.value)})]}),e.jsxs("div",{className:"export-wizard__field",children:[e.jsx("label",{className:"export-wizard__label",children:a("exportWizard.description")}),e.jsx("textarea",{className:"export-wizard__textarea",value:u,onChange:r=>j(r.target.value),rows:3})]}),e.jsxs("div",{className:"export-wizard__field",children:[e.jsx("label",{className:"export-wizard__label",children:a("exportWizard.tags")}),e.jsx("input",{className:"export-wizard__input",value:z,onChange:r=>N(r.target.value),placeholder:a("exportWizard.tagsHint")}),e.jsx("span",{className:"export-wizard__hint",children:a("exportWizard.tagsHint")})]}),e.jsxs("div",{className:"export-wizard__field",children:[e.jsx("label",{className:"export-wizard__label",children:a("exportWizard.category")}),e.jsx("span",{className:"export-wizard__readonly",children:s.draft.category??"custom"})]}),e.jsxs("div",{className:"export-wizard__field",children:[e.jsx("label",{className:"export-wizard__label",children:a("exportWizard.agentType")}),e.jsx("span",{className:"export-wizard__readonly",children:s.draft.agentType??"openclaw"})]})]}),e.jsxs("div",{className:"export-wizard__preview",children:[e.jsx("div",{className:"export-wizard__tabs",children:["overview","files","mcp","warnings"].map(r=>e.jsxs("button",{className:`export-wizard__tab${x===r?" export-wizard__tab--active":""}`,onClick:()=>k(r),children:[a(`exportWizard.tabs.${r}`),r==="warnings"&&y>0&&e.jsx("span",{className:"export-wizard__tab-badge",children:y})]},r))}),e.jsxs("div",{className:"export-wizard__tab-panel",children:[x==="overview"&&e.jsx(R,{exportData:s,t:a}),x==="files"&&e.jsx(B,{exportData:s,t:a}),x==="mcp"&&e.jsx(U,{exportData:s,t:a}),x==="warnings"&&e.jsx($,{exportData:s,t:a})]})]})]}),e.jsxs("div",{className:"export-wizard__actions",children:[e.jsx("button",{className:"export-wizard__btn export-wizard__btn--cancel",onClick:()=>i(-1),children:a("exportWizard.cancel")}),e.jsx("button",{className:"export-wizard__btn export-wizard__btn--secondary",onClick:S,children:a("exportWizard.downloadJson")}),e.jsx("button",{className:"export-wizard__btn export-wizard__btn--primary",onClick:()=>{E()},disabled:f||!c.trim(),children:a(f?"exportWizard.saving":"exportWizard.saveTemplate")})]})]})]})}function R({exportData:t,t:i}){const a=Object.keys(t.content.workspaceFiles).length,n=Object.keys(t.content.mcpServerConfigs).length,l=(t.draft.skills??[]).length,o=(t.draft.requiredCredentials??[]).length,p=(t.draft.suggestedChannels??[]).length,s=(t.draft.pluginDependencies??[]).length,_=[{value:a,label:i("exportWizard.summary.files")},{value:n,label:i("exportWizard.summary.mcpServers")},{value:l,label:i("exportWizard.summary.skills")},{value:o,label:i("exportWizard.summary.credentials")},{value:p,label:i("exportWizard.summary.channels")},{value:s,label:i("exportWizard.summary.plugins")}];return e.jsx("div",{className:"export-wizard__summary-grid",children:_.map(c=>e.jsxs("div",{className:"export-wizard__summary-card",children:[e.jsx("span",{className:"export-wizard__summary-value",children:c.value}),e.jsx("span",{className:"export-wizard__summary-label",children:c.label})]},c.label))})}function B({exportData:t,t:i}){const a=Object.entries(t.content.workspaceFiles);return a.length===0?e.jsx("div",{className:"export-wizard__empty",children:i("exportWizard.noFiles")}):e.jsx("div",{className:"export-wizard__file-list",children:a.map(([n,l])=>e.jsxs("div",{className:"export-wizard__file-item",children:[e.jsx("div",{className:"export-wizard__file-name",children:n}),e.jsx("div",{className:"export-wizard__file-preview",children:typeof l=="string"?l.split(`
2
+ `).slice(0,3).join(`
3
+ `):""})]},n))})}function U({exportData:t,t:i}){const a=Object.entries(t.content.mcpServerConfigs);return a.length===0?e.jsx("div",{className:"export-wizard__empty",children:i("exportWizard.noMcp")}):e.jsx("div",{className:"export-wizard__mcp-list",children:a.map(([n,l])=>{const o=l&&typeof l=="object"?Object.keys(l.env??{}).length:0;return e.jsxs("div",{className:"export-wizard__mcp-item",children:[e.jsx("span",{className:"export-wizard__mcp-name",children:n}),e.jsxs("span",{className:"export-wizard__mcp-meta",children:[o," env var",o!==1?"s":""]})]},n)})})}function $({exportData:t,t:i}){const a=t.securityWarnings;return a.length===0?e.jsxs("div",{className:"export-wizard__no-warnings",children:["✓ ",i("exportWizard.noWarnings")]}):e.jsx("div",{className:"export-wizard__warning-list",children:a.map((n,l)=>e.jsxs("div",{className:"export-wizard__warning-item",children:[e.jsx("div",{className:"export-wizard__warning-type",children:n.type.replace(/_/g," ")}),e.jsx("div",{className:"export-wizard__warning-location",children:n.location}),n.suggestion&&e.jsx("div",{className:"export-wizard__warning-suggestion",children:n.suggestion})]},l))})}export{q as ExportWizardPage};
@@ -0,0 +1 @@
1
+ .export-wizard{display:flex;flex-direction:column;align-items:center;min-height:100vh;padding:var(--space-8) var(--space-6) var(--space-10);background:var(--color-bg);box-sizing:border-box}.export-wizard__topbar{width:100%;max-width:1100px;margin-bottom:var(--space-4)}.export-wizard__back-link{display:inline-flex;align-items:center;gap:var(--space-2);background:none;border:none;padding:var(--space-1) 0;font-size:.875rem;font-family:var(--font-sans);color:var(--color-text-secondary);cursor:pointer;transition:color var(--transition-fast)}.export-wizard__back-link:hover{color:var(--color-primary)}.export-wizard__header{width:100%;max-width:1100px;margin-bottom:var(--space-7)}.export-wizard__title{margin:0 0 var(--space-2);font-size:2rem;font-weight:700;color:var(--color-text);line-height:1.2}.export-wizard__subtitle{margin:0;font-size:.95rem;color:var(--color-text-secondary)}.export-wizard__loading{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--space-4);padding:var(--space-10) 0;color:var(--color-text-secondary);font-size:1rem}.export-wizard__spinner{width:36px;height:36px;border:3px solid var(--color-border);border-top-color:var(--color-primary);border-radius:50%;animation:export-spin .8s linear infinite}@keyframes export-spin{to{transform:rotate(360deg)}}.export-wizard__error{width:100%;max-width:600px;padding:var(--space-6);background:var(--color-card-bg);border:1px solid var(--color-danger);border-radius:var(--radius-md);text-align:center}.export-wizard__error-msg{color:var(--color-danger);margin:0 0 var(--space-4);font-size:.95rem}.export-wizard__error-btn{padding:var(--space-2) var(--space-5);background:var(--color-primary);color:#fff;border:none;border-radius:var(--radius-sm);font-family:var(--font-sans);font-size:.875rem;font-weight:600;cursor:pointer;transition:background var(--transition-fast)}.export-wizard__error-btn:hover{background:var(--color-primary-dark)}.export-wizard__content{display:flex;gap:var(--spacing-xl);width:100%;max-width:1100px;align-items:flex-start}.export-wizard__metadata{min-width:340px;max-width:400px;flex-shrink:0;display:flex;flex-direction:column;gap:var(--space-4);background:var(--color-card-bg);border:1px solid var(--color-border);border-radius:var(--radius-md);padding:var(--space-6)}.export-wizard__field{display:flex;flex-direction:column;gap:var(--space-1)}.export-wizard__label{font-size:.8125rem;font-weight:600;color:var(--color-text-secondary);text-transform:uppercase;letter-spacing:.04em}.export-wizard__input{padding:var(--space-2) var(--space-3);border:1px solid var(--color-border);border-radius:var(--radius-sm);font-family:var(--font-sans);font-size:.9rem;color:var(--color-text);background:var(--color-bg);transition:border-color var(--transition-fast)}.export-wizard__input:focus{outline:none;border-color:var(--color-primary)}.export-wizard__textarea{padding:var(--space-2) var(--space-3);border:1px solid var(--color-border);border-radius:var(--radius-sm);font-family:var(--font-sans);font-size:.9rem;color:var(--color-text);background:var(--color-bg);resize:vertical;min-height:80px;transition:border-color var(--transition-fast)}.export-wizard__textarea:focus{outline:none;border-color:var(--color-primary)}.export-wizard__hint{font-size:.75rem;color:var(--color-text-secondary)}.export-wizard__readonly{font-size:.9rem;color:var(--color-text);padding:var(--space-2) 0}.export-wizard__preview{flex:1;min-width:0;display:flex;flex-direction:column;background:var(--color-card-bg);border:1px solid var(--color-border);border-radius:var(--radius-md);overflow:hidden}.export-wizard__tabs{display:flex;border-bottom:1px solid var(--color-border);padding:0 var(--space-4)}.export-wizard__tab{padding:var(--space-3) var(--space-4);background:none;border:none;border-bottom:2px solid transparent;font-family:var(--font-sans);font-size:.875rem;font-weight:500;color:var(--color-text-secondary);cursor:pointer;transition:color var(--transition-fast),border-color var(--transition-fast)}.export-wizard__tab:hover{color:var(--color-text)}.export-wizard__tab--active{color:var(--color-primary);border-bottom-color:var(--color-primary)}.export-wizard__tab-badge{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;padding:0 5px;margin-left:var(--space-2);border-radius:var(--radius-full);font-size:.7rem;font-weight:700;background:var(--color-warning);color:#fff}.export-wizard__tab-panel{padding:var(--space-5);max-height:500px;overflow-y:auto}.export-wizard__summary-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:var(--space-3)}.export-wizard__summary-card{display:flex;flex-direction:column;align-items:center;gap:var(--space-1);padding:var(--space-4);background:var(--color-bg);border:1px solid var(--color-border);border-radius:var(--radius-sm)}.export-wizard__summary-value{font-size:1.5rem;font-weight:700;color:var(--color-text)}.export-wizard__summary-label{font-size:.8rem;color:var(--color-text-secondary);text-align:center}.export-wizard__file-list{display:flex;flex-direction:column;gap:var(--space-3)}.export-wizard__file-item{padding:var(--space-3) var(--space-4);background:var(--color-bg);border:1px solid var(--color-border);border-radius:var(--radius-sm)}.export-wizard__file-name{font-size:.875rem;font-weight:600;color:var(--color-text);font-family:var(--font-mono);margin-bottom:var(--space-1)}.export-wizard__file-preview{font-size:.8rem;color:var(--color-text-secondary);font-family:var(--font-mono);white-space:pre-wrap;overflow:hidden;max-height:60px}.export-wizard__mcp-list{display:flex;flex-direction:column;gap:var(--space-3)}.export-wizard__mcp-item{display:flex;justify-content:space-between;align-items:center;padding:var(--space-3) var(--space-4);background:var(--color-bg);border:1px solid var(--color-border);border-radius:var(--radius-sm)}.export-wizard__mcp-name{font-size:.875rem;font-weight:600;color:var(--color-text);font-family:var(--font-mono)}.export-wizard__mcp-meta{font-size:.8rem;color:var(--color-text-secondary)}.export-wizard__warning-list{display:flex;flex-direction:column;gap:var(--space-3)}.export-wizard__warning-item{padding:var(--space-3) var(--space-4);background:color-mix(in srgb,var(--color-warning) 8%,transparent);border:1px solid color-mix(in srgb,var(--color-warning) 30%,transparent);border-left:3px solid var(--color-warning);border-radius:var(--radius-sm)}.export-wizard__warning-type{font-size:.8rem;font-weight:600;color:var(--color-warning);text-transform:uppercase;letter-spacing:.03em;margin-bottom:var(--space-1)}.export-wizard__warning-location{font-size:.8125rem;color:var(--color-text);font-family:var(--font-mono);margin-bottom:var(--space-1)}.export-wizard__warning-suggestion{font-size:.8rem;color:var(--color-text-secondary)}.export-wizard__no-warnings{display:flex;align-items:center;gap:var(--space-2);padding:var(--space-4);background:color-mix(in srgb,var(--color-success) 8%,transparent);border:1px solid color-mix(in srgb,var(--color-success) 30%,transparent);border-radius:var(--radius-sm);color:var(--color-success);font-size:.9rem;font-weight:500}.export-wizard__empty{text-align:center;padding:var(--space-6);color:var(--color-text-secondary);font-size:.9rem}.export-wizard__actions{display:flex;justify-content:flex-end;gap:var(--space-3);width:100%;max-width:1100px;margin-top:var(--space-6)}.export-wizard__btn{padding:var(--space-2) var(--space-5);border:none;border-radius:var(--radius-sm);font-family:var(--font-sans);font-size:.875rem;font-weight:600;cursor:pointer;transition:background var(--transition-fast),opacity var(--transition-fast)}.export-wizard__btn:disabled{opacity:.5;cursor:not-allowed}.export-wizard__btn--cancel{background:var(--color-bg);color:var(--color-text-secondary);border:1px solid var(--color-border)}.export-wizard__btn--cancel:hover:not(:disabled){background:var(--color-border)}.export-wizard__btn--secondary{background:var(--color-bg);color:var(--color-text);border:1px solid var(--color-border)}.export-wizard__btn--secondary:hover:not(:disabled){border-color:var(--color-primary);color:var(--color-primary)}.export-wizard__btn--primary{background:var(--color-primary);color:#fff}.export-wizard__btn--primary:hover:not(:disabled){background:var(--color-primary-dark)}@media(max-width:860px){.export-wizard__content{flex-direction:column}.export-wizard__metadata{max-width:none;min-width:0;width:100%}.export-wizard__summary-grid{grid-template-columns:repeat(2,1fr)}}
@@ -0,0 +1 @@
1
+ import{h as d,a as f,r as l,j as e}from"./index-BqzqZJ96.js";import{a as h}from"./api-B5psysvQ.js";function j(){const[n]=d(),r=f(),[g,s]=l.useState(null),[m,a]=l.useState(!0);return l.useEffect(()=>{(async()=>{const p=n.get("code"),o=n.get("state"),u=sessionStorage.getItem("google_oauth_pending");if(!p||!o||!u){s("Missing OAuth parameters. Please try again from the instance page."),a(!1);return}let i;try{i=JSON.parse(u)}catch{s("Invalid session data. Please try again from the instance page."),a(!1);return}if(i.state!==o){s("OAuth state mismatch — possible CSRF. Please try again."),a(!1);return}sessionStorage.removeItem("google_oauth_pending");const{instanceId:c}=i;try{const t=await h.post("/oauth/google/token",{code:p,state:o});await h.post(`/instances/${c}/credentials`,{provider:"google",credentialType:"oauth_token",value:t.accessToken,metadata:{refreshToken:t.refreshToken,expiresIn:t.expiresIn}}),sessionStorage.setItem("google_oauth_success",JSON.stringify({instanceId:c})),r(`/instances/${c}`,{replace:!0})}catch(t){s(t instanceof Error?t.message:"Failed to complete Google authentication"),a(!1)}})()},[n,r]),g?e.jsxs("div",{className:"page-container",style:{textAlign:"center",paddingTop:"4rem"},children:[e.jsx("h2",{children:"Authentication Failed"}),e.jsx("p",{style:{color:"#e74c3c",marginTop:"1rem"},children:g}),e.jsx("button",{style:{marginTop:"1.5rem"},onClick:()=>r("/",{replace:!0}),children:"Back to Dashboard"})]}):m?e.jsxs("div",{className:"page-container",style:{textAlign:"center",paddingTop:"4rem"},children:[e.jsx("h2",{children:"Completing Google Authentication..."}),e.jsxs("p",{style:{marginTop:"1rem"},children:[e.jsx("span",{className:"spinner"})," Please wait while we finalize your connection."]})]}):null}export{j as GoogleOAuthCallback};
@@ -0,0 +1 @@
1
+ import{f as qe,c as Ve,u as Xe,a as Ye,r as o,j as t,L as Ze}from"./index-BqzqZJ96.js";import{a as h}from"./api-B5psysvQ.js";import{b as Je,A as Ke,c as Qe,a as et,i as Y,F as tt}from"./types-1lNWpzYk.js";/* empty css */import{u as st}from"./useTranslation-B-8kenfJ.js";const Ce=new Map;function at(a){return a.includes("spreadsheet")||a.includes("ms-excel")?"XLS":a.includes("wordprocessingml")||a.includes("msword")?"DOC":a==="application/pdf"?"PDF":"FILE"}function ct(){const{t:a}=st(),{id:u}=qe(),{subscribeGroupChat:Z,unsubscribeGroupChat:J,addHandler:F,removeHandler:L}=Ve(),{user:Ne}=Xe(),je=Ye(),[c,R]=o.useState(null),[x,I]=o.useState([]),[Ie,Me]=o.useState(!0),[K,g]=o.useState(null),[v,T]=o.useState(""),[P,Q]=o.useState(!1),[H,ee]=o.useState(!1),[$,te]=o.useState(!1),[Se,_]=o.useState(!1),[se,we]=o.useState(""),[ae,Ae]=o.useState(0),[B,k]=o.useState(!1),[p,re]=o.useState("bot"),[U,ne]=o.useState([]),[M,le]=o.useState(""),[O,C]=o.useState(""),[z,oe]=o.useState(""),[G,ie]=o.useState(!1),[De,W]=o.useState(null),[ce,de]=o.useState(""),[me,ue]=o.useState(""),[S,w]=o.useState(""),[he,b]=o.useState([]),[y,N]=o.useState(null),[Re,ge]=o.useState(!1),pe=o.useRef(null),be=o.useRef(null),q=o.useRef(!1),ye=o.useRef(null),fe=o.useRef(null),[f,E]=o.useState([]),xe=o.useCallback(async()=>{try{const e=await h.get("/instances");if(c){const s=new Set(c.members.map(l=>l.instanceId).filter(Boolean));ne(e.filter(l=>!s.has(l.id)))}else ne(e)}catch(e){console.error("Failed to fetch instances:",e)}},[c]);o.useEffect(()=>{B&&xe()},[B,xe]),o.useEffect(()=>{if(!S||S.length<3){b([]);return}const e=setTimeout(async()=>{ge(!0);try{const s=await h.get("/users/search?email="+encodeURIComponent(S));b(s)}catch(s){console.error("Search failed:",s),b([])}finally{ge(!1)}},300);return()=>clearTimeout(e)},[S]);const Te=async e=>{if(e.preventDefault(),!!c){ie(!0);try{if(p==="bot"){if(!M)return;const l=U.find(r=>r.id===M);if(!l)return;await h.post(`/group-chats/${c.id}/members`,{instanceId:M,displayName:O||l.name,role:z})}else{if(!y)return;await h.post(`/group-chats/${c.id}/members`,{userId:y.id,displayName:O||y.displayName,role:z,isHuman:!0})}const s=await h.get(`/group-chats/${c.id}`);R(s),k(!1),le(""),C(""),oe(""),w(""),b([]),N(null)}catch(s){console.error("Failed to add member:",s),g(a("groupChat.detail.failedToAddMember"))}finally{ie(!1)}}},$e=async e=>{if(!(!c||!confirm(a("groupChat.detail.removeMemberConfirm"))))try{await h.delete(`/group-chats/${c.id}/members/${e}`);const s=await h.get(`/group-chats/${c.id}`);R(s)}catch(s){console.error("Failed to remove member:",s),g(a("groupChat.detail.failedToRemoveMember"))}},ke=async e=>{if(c)try{await h.put(`/group-chats/${c.id}/members/${e}`,{displayName:ce,role:me});const s=await h.get(`/group-chats/${c.id}`);R(s),W(null)}catch(s){console.error("Failed to update member:",s),g(a("groupChat.detail.failedToUpdateMember"))}},Ee=e=>{W(e.id),de(e.displayName),ue(e.role||"")},Fe=()=>{pe.current?.scrollIntoView({behavior:"smooth"})};o.useEffect(()=>{x.length>0&&!q.current&&Fe(),q.current=!1},[x]);const V=o.useCallback(e=>{I(s=>{const l=new Map(s.map(n=>[n.id,n]));let r=!1;for(const n of e)l.has(n.id)||(l.set(n.id,n),r=!0);return r?Array.from(l.values()).sort((n,i)=>new Date(n.createdAt).getTime()-new Date(i.createdAt).getTime()):s})},[]),Le=o.useCallback(async()=>{if(!u||$||!H||x.length===0)return;const e=x[0];te(!0),q.current=!0;const s=be.current,l=s?.scrollHeight??0;try{const r=await h.get(`/group-chats/${u}/messages?limit=50&before=${e.id}`);ee(r.hasMore),V(r.messages),requestAnimationFrame(()=>{s&&(s.scrollTop=s.scrollHeight-l)})}catch(r){g(r instanceof Error?r.message:a("groupChat.detail.failedToLoadOlderMessages"))}finally{te(!1)}},[u,$,H,x,V,a]),A=o.useCallback(e=>{if(e.groupChatId===u){if(e.type==="group_chat:message"){const s=e.payload,l={id:s.messageId,groupChatId:u,senderType:s.senderType,senderInstanceId:s.senderInstanceId,senderUserId:s.senderUserId||null,senderDisplayName:s.senderName,content:s.content,mentionedInstanceIds:[],replyToMessageId:null,chainDepth:s.chainDepth,createdAt:s.createdAt,deliveryStatus:s.deliveryStatus?.map(r=>({id:`${s.messageId}-${r.targetInstanceId}`,messageId:s.messageId,targetInstanceId:r.targetInstanceId,targetDisplayName:r.targetDisplayName,status:r.status,errorMessage:r.errorMessage||null,responseMessageId:null,retryCount:0,maxRetries:3,nextRetryAt:null,deliveredAt:null,processingAt:null,completedAt:null,errorAt:null,createdAt:s.createdAt}))};I(r=>{const n=r.findIndex(i=>i.id===l.id);if(n>=0){const i=[...r],m=Ce.get(l.id);return i[n]=m?{...l,content:m}:l,i}return[...r,l]})}else if(e.type==="group_chat:delivery_status"){const s=e.payload;I(l=>l.map(r=>{if(r.id!==s.messageId)return r;const n=r.deliveryStatus||[],i=n.findIndex(d=>d.targetInstanceId===s.targetInstanceId),m=[...n];return i>=0?m[i]={...m[i],status:s.status,errorMessage:s.errorMessage||null,responseMessageId:s.responseMessageId||null,retryCount:s.retryCount??m[i].retryCount,maxRetries:s.maxRetries??m[i].maxRetries,nextRetryAt:s.nextRetryAt??m[i].nextRetryAt}:m.push({id:`${s.messageId}-${s.targetInstanceId}`,messageId:s.messageId,targetInstanceId:s.targetInstanceId,targetDisplayName:s.targetDisplayName,status:s.status,errorMessage:s.errorMessage||null,responseMessageId:s.responseMessageId||null,retryCount:0,maxRetries:3,nextRetryAt:null,deliveredAt:null,processingAt:null,completedAt:null,errorAt:null,createdAt:s.timestamp}),{...r,deliveryStatus:m}})),s.status==="error"&&s.errorMessage&&g(s.errorMessage)}}},[u]);o.useEffect(()=>u?(F("group_chat:message",A),F("group_chat:delivery_status",A),Z(u),(async()=>{try{const[s,l]=await Promise.all([h.get(`/group-chats/${u}`),h.get(`/group-chats/${u}/messages?limit=50`)]);R(s),I(l.messages),ee(l.hasMore)}catch(s){g(s instanceof Error?s.message:a("groupChat.detail.failedToLoadChat"))}finally{Me(!1)}})(),()=>{L("group_chat:message",A),L("group_chat:delivery_status",A),J(u)}):void 0,[u,Z,J,F,L,A]);const Pe=e=>{const s=e.target.value;T(s);const l=e.target.selectionStart||0,r=s.slice(0,l),n=r.lastIndexOf("@");if(n>=0&&n>=r.lastIndexOf(" ")){const i=r.slice(n+1);we(i.toLowerCase()),Ae(n),_(!0)}else _(!1)},He=e=>{const s=v.slice(0,ae),l=v.slice(ae+se.length+1),r=`${s}@${e} ${l}`;T(r),_(!1),ye.current?.focus()},D=o.useCallback(e=>{if(!(!e||e.length===0)){if(f.length+e.length>Je){g(a("chat.attachments.maxReached"));return}Array.from(e).forEach(s=>{if(!Ke.has(s.type)){g(a("chat.attachments.invalidType"));return}if(s.size>Qe){g(a("chat.attachments.tooLarge"));return}const l=new FileReader;l.onload=r=>{const n=r.target?.result,i=n.split(",")[1];E(m=>[...m,{id:crypto.randomUUID(),type:s.type,data:i,preview:n,name:s.name}])},l.readAsDataURL(s)})}},[f.length,a]),_e=o.useCallback(e=>{e.clipboardData.files.length>0&&(e.preventDefault(),D(e.clipboardData.files))},[D]),Be=o.useCallback(e=>{e.preventDefault(),e.stopPropagation(),e.dataTransfer.files.length>0&&D(e.dataTransfer.files)},[D]),Ue=o.useCallback(e=>{E(s=>s.filter(l=>l.id!==e))},[]),Oe=async e=>{if(e.preventDefault(),!v.trim()&&f.length===0||!u)return;const s=v,l=[...f];Q(!0),T(""),E([]);try{const r={content:s};l.length>0&&(r.attachments=l.map(d=>({type:Y(d.type)?"image":"file",mimeType:d.type,content:d.data,fileName:d.name})));const n=await h.post(`/group-chats/${u}/messages`,r);let i=s;if(l.length>0){const d=[];s.trim()&&d.push({type:"text",text:s});for(const j of l)d.push({type:Y(j.type)?"image":"file",mimeType:j.type,content:j.data,fileName:j.name});i=d,Ce.set(n.messageId,d)}const m={id:n.messageId,groupChatId:u,senderType:"user",senderInstanceId:null,senderUserId:null,senderDisplayName:a("groupChat.detail.senderYou"),content:i,mentionedInstanceIds:[],replyToMessageId:null,chainDepth:0,createdAt:new Date().toISOString()};I(d=>d.some(j=>j.id===n.messageId)?d:[...d,m]),setTimeout(async()=>{try{const d=await h.get(`/group-chats/${u}/messages?limit=50`);V(d.messages)}catch{}},2e3)}catch(r){console.error("Failed to send message:",r),g(r instanceof Error?r.message:a("groupChat.detail.failedToSendMessage")),T(s),E(l)}finally{Q(!1)}},ze=e=>{switch(e){case"pending":return a("groupChat.delivery.pending");case"delivered":return a("groupChat.delivery.delivered");case"processing":return a("groupChat.delivery.processing");case"completed":return a("groupChat.delivery.completed");case"error":return a("groupChat.delivery.error");default:return""}},Ge=e=>{const s=e.senderType==="user",l=e.senderType==="system",r=c?.members.find(d=>e.senderInstanceId?d.instanceId===e.senderInstanceId:d.userId===e.senderUserId),n=r?.isHuman&&!s;let i;s?i="user":l?i="system":n?i="human":i="bot";const m=s?e.senderDisplayName||a("groupChat.detail.senderYou"):r?.displayName||e.senderDisplayName||a("groupChat.detail.senderUnknown");return{variant:i,senderName:m,role:r?.role,isHumanMember:n}},We=async()=>{if(!(!u||!window.confirm(a("groupChat.detail.deleteChatConfirm"))))try{await h.delete(`/group-chats/${u}`),je("/group-chats")}catch(e){g(e instanceof Error?e.message:a("common.errors.deleteFailed"))}};if(Ie)return t.jsx("div",{className:"dashboard-page",children:a("groupChat.detail.loadingChat")});if(!c)return t.jsx("div",{className:"dashboard-page error-message",children:a("groupChat.detail.chatNotFound")});const X=Ne?.id===c.userId,ve=c.members.filter(e=>e.displayName.toLowerCase().includes(se));return t.jsxs("main",{className:"dashboard-page gc-page",children:[t.jsxs("header",{className:"dashboard-header",children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"1rem"},children:[t.jsx(Ze,{to:"/group-chats",style:{textDecoration:"none",fontSize:"1.2rem"},children:"←"}),t.jsx("h1",{children:c.name})]}),t.jsxs("div",{className:"dashboard-header-actions",children:[t.jsx("span",{className:"status-badge status-running",children:a("groupChat.list.memberCount",{count:c.members.length})}),X&&t.jsx("button",{className:"btn btn-danger",onClick:We,children:a("groupChat.detail.deleteChat")})]})]}),K&&t.jsx("div",{className:"error-message",role:"alert",style:{margin:"1rem"},children:K}),t.jsxs("div",{className:"gc-body",children:[t.jsxs("div",{className:"gc-messages",ref:be,children:[H&&t.jsx("div",{style:{textAlign:"center",padding:"0.5rem"},children:t.jsx("button",{className:"btn btn-secondary",onClick:Le,disabled:$,children:a($?"groupChat.detail.loadingMessages":"groupChat.detail.loadOlderMessages")})}),x.map(e=>{const{variant:s,senderName:l,role:r}=Ge(e);return t.jsxs("div",{className:`gc-msg-wrapper gc-msg-wrapper--${s}`,children:[t.jsxs("div",{className:`gc-msg-bubble gc-msg-bubble--${s}`,children:[s!=="system"&&t.jsxs("div",{className:"gc-msg-header",children:[t.jsx("span",{className:"gc-msg-sender",children:l}),s!=="user"&&t.jsx("span",{className:`gc-msg-type-badge gc-msg-type-badge--${s==="human"?"human":"bot"}`,children:a(s==="human"?"groupChat.detail.typeBadgeHuman":"groupChat.detail.typeBadgeBot")}),r&&t.jsx("span",{className:"gc-msg-role",children:r})]}),t.jsx("div",{className:"gc-msg-content",children:t.jsx(et,{content:e.content})})]}),e.deliveryStatus&&e.deliveryStatus.length>0&&t.jsx("div",{className:"gc-delivery",children:e.deliveryStatus.map(n=>t.jsxs("span",{className:`gc-delivery-item gc-delivery-item--${n.status}`,title:`${n.targetDisplayName}: ${n.status}${n.errorMessage?` - ${n.errorMessage}`:""}${n.retryCount>0?` (retry ${n.retryCount}/${n.maxRetries})`:""}`,children:[t.jsx("span",{children:n.targetDisplayName}),t.jsx("span",{className:"gc-delivery-icon",children:ze(n.status)}),n.retryCount>0&&n.status==="error"&&t.jsxs("span",{className:"gc-retry-progress",children:[t.jsx("span",{className:"gc-retry-bar",children:Array.from({length:n.maxRetries},(i,m)=>t.jsx("span",{className:`gc-retry-dot ${m<n.retryCount?"gc-retry-dot--used":""}`},m))}),t.jsxs("span",{className:"gc-retry-label",children:[n.retryCount,"/",n.maxRetries]})]})]},n.id))})]},e.id)}),t.jsx("div",{ref:pe})]}),t.jsxs("div",{className:"gc-sidebar",children:[t.jsxs("div",{className:"gc-sidebar-header",children:[t.jsx("h3",{className:"gc-sidebar-title",children:a("groupChat.members.title")}),X&&t.jsx("button",{onClick:()=>k(!0),className:"gc-sidebar-add-btn",title:a("groupChat.members.addButton"),children:"+"})]}),c.members.map(e=>t.jsx("div",{className:"gc-member",children:De===e.id?t.jsxs("div",{className:"gc-member-edit",children:[t.jsx("input",{type:"text",value:ce,onChange:s=>de(s.target.value),placeholder:a("groupChat.members.displayNameLabel"),autoFocus:!0}),t.jsx("input",{type:"text",value:me,onChange:s=>ue(s.target.value),placeholder:a("groupChat.members.roleLabel"),style:{fontSize:"0.75rem"}}),t.jsxs("div",{className:"gc-member-edit-actions",children:[t.jsx("button",{onClick:()=>W(null),className:"gc-member-edit-btn gc-member-edit-btn--cancel",children:a("groupChat.members.cancel")}),t.jsx("button",{onClick:()=>ke(e.id),className:"gc-member-edit-btn gc-member-edit-btn--save",children:a("groupChat.members.save")})]})]}):t.jsxs("div",{className:"gc-member-row",children:[t.jsx("div",{className:`gc-member-dot gc-member-dot--${e.isHuman?"human":"bot"}`}),t.jsxs("div",{className:"gc-member-info",children:[t.jsx("div",{className:"gc-member-name-row",children:t.jsxs("div",{className:"gc-member-name-left",children:[t.jsx("span",{className:"gc-member-name",children:e.displayName}),t.jsx("span",{className:`gc-member-type gc-member-type--${e.isHuman?"human":"bot"}`,children:e.isHuman?a("groupChat.detail.typeBadgeHuman"):a("groupChat.detail.typeBadgeBot")})]})}),e.role&&t.jsx("div",{className:"gc-member-role",children:e.role})]}),X&&t.jsxs("div",{className:"gc-member-actions",children:[t.jsx("button",{onClick:()=>Ee(e),title:a("groupChat.members.editTitle"),className:"gc-member-action-btn",children:"✎"}),t.jsx("button",{onClick:()=>$e(e.id),title:a("groupChat.members.removeTitle"),className:"gc-member-action-btn gc-member-action-btn--danger",children:"×"})]})]})},e.id))]})]}),t.jsxs("div",{className:"gc-input-area",onPaste:_e,onDrop:Be,onDragOver:e=>e.preventDefault(),children:[Se&&ve.length>0&&t.jsx("div",{className:"gc-mention-dropdown",children:ve.map(e=>t.jsx("div",{onClick:()=>He(e.displayName),className:"gc-mention-item",children:e.displayName},e.id))}),f.length>0&&t.jsx("div",{className:"gc-attachment-preview",children:f.map(e=>t.jsxs("div",{className:"gc-attachment-thumb",children:[Y(e.type)?t.jsx("img",{src:e.preview,alt:e.name,style:{width:"100%",height:"100%",objectFit:"cover",borderRadius:"4px"}}):t.jsxs("div",{style:{width:"100%",height:"100%",borderRadius:"4px",background:"var(--color-surface-hover)",border:"1px solid var(--color-border)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"2px",padding:"4px",overflow:"hidden",fontSize:"0.55rem",color:"var(--color-text-secondary)",textAlign:"center"},children:[t.jsx("span",{style:{fontSize:"1.1rem",lineHeight:1},children:at(e.type)}),t.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"100%"},children:e.name})]}),t.jsx("button",{onClick:()=>Ue(e.id),title:a("chat.attachments.removeAttachment"),className:"gc-attachment-remove",children:"×"})]},e.id))}),t.jsxs("form",{onSubmit:Oe,className:"gc-input-form",children:[t.jsx("input",{type:"file",ref:fe,onChange:e=>D(e.target.files),accept:tt,multiple:!0,style:{display:"none"}}),t.jsx("button",{type:"button",className:"gc-attach-btn",onClick:()=>fe.current?.click(),title:a("chat.attachments.attachFile"),disabled:P,children:t.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:t.jsx("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48"})})}),t.jsx("label",{htmlFor:"chat-message-input",className:"visually-hidden",children:"Message"}),t.jsx("input",{ref:ye,id:"chat-message-input",type:"text",value:v,onChange:Pe,placeholder:a("groupChat.detail.messagePlaceholder"),className:"gc-input-field",disabled:P}),t.jsx("button",{type:"submit",disabled:P||!v.trim()&&f.length===0,className:"gc-send-btn",children:a("common.buttons.send")})]})]}),B&&t.jsx("div",{className:"modal-overlay",onClick:()=>k(!1),children:t.jsxs("div",{className:"modal",onClick:e=>e.stopPropagation(),style:{maxWidth:"500px"},children:[t.jsx("h2",{children:a("groupChat.members.addTitle")}),t.jsxs("div",{className:"gc-tab-bar",children:[t.jsx("button",{onClick:()=>{re("bot"),C(""),w(""),b([]),N(null)},className:`gc-tab ${p==="bot"?"gc-tab--active":""}`,children:a("groupChat.members.tabBot")}),t.jsx("button",{onClick:()=>{re("human"),C(""),w(""),b([]),N(null)},className:`gc-tab ${p==="human"?"gc-tab--active":""}`,children:a("groupChat.members.tabHuman")})]}),t.jsxs("form",{onSubmit:Te,children:[p==="bot"?t.jsxs("div",{className:"form-group",children:[t.jsx("label",{children:a("groupChat.members.selectInstance")}),t.jsxs("select",{value:M,onChange:e=>{const s=e.target.value;le(s);const l=U.find(r=>r.id===s);l&&C(l.name)},required:!0,style:{width:"100%",padding:"0.5rem",borderRadius:"var(--radius-sm)",border:"1px solid var(--color-border)"},children:[t.jsx("option",{value:"",children:a("groupChat.members.selectInstancePlaceholder")}),U.map(e=>t.jsxs("option",{value:e.id,children:[e.name," (",a("common.status."+e.status),")"]},e.id))]})]}):t.jsxs("div",{className:"form-group",style:{marginBottom:"1rem"},children:[t.jsx("label",{children:a("groupChat.members.searchUserByEmail")}),y?t.jsxs("div",{className:"gc-selected-user",children:[t.jsxs("div",{children:[t.jsx("div",{className:"gc-selected-user-name",children:y.displayName}),t.jsx("div",{className:"gc-selected-user-email",children:y.email})]}),t.jsx("button",{type:"button",onClick:()=>{N(null),w("")},className:"gc-selected-user-remove",children:"✕"})]}):t.jsxs(t.Fragment,{children:[t.jsx("input",{type:"text",value:S,onChange:e=>{w(e.target.value),N(null)},placeholder:a("groupChat.members.searchPlaceholder"),style:{width:"100%",padding:"0.5rem",borderRadius:"var(--radius-sm)",border:"1px solid var(--color-border)"},autoFocus:!0}),Re&&t.jsx("div",{style:{fontSize:"0.75rem",color:"var(--color-text-secondary)",marginTop:"0.25rem"},children:a("groupChat.create.searching")}),he.length>0&&t.jsx("div",{className:"gc-user-search-results",children:he.map(e=>t.jsxs("div",{onClick:()=>{N(e),C(e.displayName),b([])},className:"gc-user-search-item",children:[t.jsx("div",{className:"gc-user-search-name",children:e.displayName}),t.jsx("div",{className:"gc-user-search-email",children:e.email})]},e.id))})]})]}),t.jsxs("div",{className:"form-group",children:[t.jsx("label",{children:a("groupChat.members.displayNameLabel")}),t.jsx("input",{type:"text",value:O,onChange:e=>C(e.target.value),placeholder:a(p==="bot"?"groupChat.members.displayNamePlaceholderBot":"groupChat.members.displayNamePlaceholderHuman"),required:!0,style:{width:"100%",padding:"0.5rem",borderRadius:"var(--radius-sm)",border:"1px solid var(--color-border)"}})]}),t.jsxs("div",{className:"form-group",children:[t.jsx("label",{children:a("groupChat.members.roleLabel")}),t.jsx("input",{type:"text",value:z,onChange:e=>oe(e.target.value),placeholder:a("groupChat.members.rolePlaceholder"),style:{width:"100%",padding:"0.5rem",borderRadius:"var(--radius-sm)",border:"1px solid var(--color-border)"}})]}),t.jsxs("div",{className:"modal-actions",children:[t.jsx("button",{type:"button",onClick:()=>k(!1),className:"btn-secondary",children:a("groupChat.members.cancel")}),t.jsx("button",{type:"submit",disabled:G||p==="bot"&&!M||p==="human"&&!y,style:{backgroundColor:"var(--color-primary)",color:"white",padding:"0.5rem 1rem",border:"none",borderRadius:"var(--radius-sm)",cursor:G?"not-allowed":"pointer"},children:a(G?"groupChat.members.adding":"groupChat.members.addMember")})]})]})]})})]})}export{ct as GroupChatPage};
@@ -0,0 +1 @@
1
+ import{r as n,j as a,L as Y}from"./index-BqzqZJ96.js";import{a as h}from"./api-B5psysvQ.js";/* empty css */import{u as K}from"./useTranslation-B-8kenfJ.js";function X(){const{t:s}=K(),[w,R]=n.useState([]),[z,M]=n.useState(!0),[k,p]=n.useState(null),[j,m]=n.useState(!1),[u,A]=n.useState([]),[C,E]=n.useState(""),[l,I]=n.useState(new Set),[v,b]=n.useState({}),[g,H]=n.useState({}),[N,B]=n.useState(!1),[x,f]=n.useState(""),[T,c]=n.useState([]),[o,y]=n.useState([]),[G,D]=n.useState(!1);n.useEffect(()=>{L()},[]),n.useEffect(()=>{j&&P()},[j]),n.useEffect(()=>{if(x.length<2){c([]);return}D(!0);const e=setTimeout(async()=>{try{const t=await h.get("/users/search?email="+encodeURIComponent(x));c(t.filter(r=>!o.some(d=>d.id===r.id)))}catch{c([])}finally{D(!1)}},300);return()=>clearTimeout(e)},[x,o]);const L=async()=>{try{const e=await h.get("/group-chats");R(e)}catch(e){p(e instanceof Error?e.message:s("groupChat.create.failedToLoadGroupChats"))}finally{M(!1)}},P=async()=>{try{const e=await h.get("/instances");A(e);const t={};e.forEach(r=>{t[r.id]=r.name}),b(r=>({...t,...r}))}catch(e){console.error("Failed to load instances:",e)}},$=e=>{const t=new Set(l);t.has(e)?t.delete(e):t.add(e),I(t)},F=(e,t)=>{b(r=>({...r,[e]:t}))},W=(e,t)=>{H(r=>({...r,[e]:t}))},q=async e=>{if(e.preventDefault(),l.size===0){p(s("groupChat.create.selectAtLeastOne"));return}B(!0),p(null);try{const t={};l.forEach(i=>{t[i]=v[i]||u.find(O=>O.id===i)?.name||"Bot"});const r={};l.forEach(i=>{g[i]&&(r[i]=g[i])});const d={name:C,instanceIds:Array.from(l),displayNames:t,roles:Object.keys(r).length>0?r:void 0,defaultMentionMode:"broadcast",maxBotChainDepth:3},S=await h.post("/group-chats",d);o.length>0&&await Promise.all(o.map(i=>h.post(`/group-chats/${S.id}/members`,{userId:i.id,displayName:i.displayName,isHuman:!0}))),m(!1),E(""),I(new Set),b({}),H({}),f(""),c([]),y([]),await L()}catch(t){p(t instanceof Error?t.message:s("groupChat.create.failedToCreate"))}finally{B(!1)}};return z?a.jsx("div",{className:"dashboard-page",children:s("groupChat.list.loading")}):a.jsxs("main",{className:"dashboard-page",children:[a.jsxs("header",{className:"dashboard-header",children:[a.jsx("h1",{children:s("groupChat.list.title")}),a.jsx("div",{className:"dashboard-header-actions",children:a.jsx("button",{onClick:()=>m(!0),children:s("groupChat.list.createButton")})})]}),k&&a.jsx("div",{className:"error-message",role:"alert",children:k}),w.length===0&&a.jsx("div",{className:"info-message",children:s("groupChat.list.noChats")}),a.jsx("div",{className:"instances-grid",children:w.map(e=>a.jsxs(Y,{to:`/group-chats/${e.id}`,className:"instance-card",children:[a.jsxs("div",{className:"instance-header",children:[a.jsx("h3",{children:e.name}),a.jsx("span",{className:"status-badge status-running",children:s("groupChat.list.memberCount",{count:e.members.length})})]}),a.jsxs("div",{className:"instance-details",children:[a.jsx("p",{children:s("groupChat.list.created",{date:new Date(e.createdAt).toLocaleDateString()})}),a.jsx("p",{children:s("groupChat.list.mode",{mode:e.defaultMentionMode})})]})]},e.id))}),j&&a.jsx("div",{className:"modal-overlay",onClick:()=>m(!1),children:a.jsxs("div",{className:"modal",role:"dialog","aria-modal":"true","aria-labelledby":"create-chat-title",style:{maxWidth:"600px"},onClick:e=>e.stopPropagation(),children:[a.jsx("h2",{id:"create-chat-title",children:s("groupChat.create.title")}),a.jsxs("form",{onSubmit:q,children:[a.jsxs("div",{className:"form-group",children:[a.jsx("label",{htmlFor:"chat-name",children:s("groupChat.create.chatNameLabel")}),a.jsx("input",{type:"text",id:"chat-name",value:C,onChange:e=>E(e.target.value),required:!0,placeholder:s("groupChat.create.chatNamePlaceholder")})]}),a.jsxs("div",{className:"form-group",children:[a.jsx("label",{children:s("groupChat.create.selectInstances")}),a.jsx("div",{style:{maxHeight:"300px",overflowY:"auto",border:"1px solid #ccc",padding:"10px",borderRadius:"4px"},children:u.length===0?a.jsx("p",{children:s("groupChat.create.noInstances")}):u.map(e=>a.jsxs("div",{style:{marginBottom:"10px",padding:"8px",borderBottom:"1px solid #eee"},children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",marginBottom:"5px"},children:[a.jsx("input",{type:"checkbox",id:`inst-${e.id}`,checked:l.has(e.id),onChange:()=>$(e.id),style:{marginRight:"10px"}}),a.jsx("label",{htmlFor:`inst-${e.id}`,style:{fontWeight:"bold",flex:1},children:e.name}),a.jsx("span",{className:`status-badge status-${e.status}`,style:{fontSize:"0.8em"},children:s("common.status."+e.status)})]}),l.has(e.id)&&a.jsxs("div",{style:{marginLeft:"25px"},children:[a.jsx("label",{style:{fontSize:"0.9em",display:"block",marginBottom:"2px"},children:s("groupChat.create.displayNameInChat")}),a.jsx("input",{type:"text",value:v[e.id]||"",onChange:t=>F(e.id,t.target.value),placeholder:e.name,style:{width:"100%",padding:"4px"}}),a.jsxs("div",{style:{marginTop:"5px"},children:[a.jsx("label",{style:{fontSize:"0.9em",display:"block",marginBottom:"2px"},children:s("groupChat.create.roleLabel")}),a.jsx("input",{type:"text",value:g[e.id]||"",onChange:t=>W(e.id,t.target.value),placeholder:s("groupChat.create.rolePlaceholder"),style:{width:"100%",padding:"4px"}})]})]})]},e.id))})]}),a.jsxs("div",{className:"form-group",children:[a.jsx("label",{children:s("groupChat.create.inviteHumans")}),a.jsx("input",{type:"text",value:x,onChange:e=>f(e.target.value),placeholder:s("groupChat.create.searchByEmail")}),G&&a.jsx("div",{style:{fontSize:"0.8em",color:"#666",marginTop:"4px"},children:s("groupChat.create.searching")}),T.length>0&&a.jsx("div",{style:{maxHeight:"150px",overflowY:"auto",border:"1px solid #ccc",marginTop:"5px",borderRadius:"4px"},children:T.map(e=>a.jsxs("div",{onClick:()=>{y(t=>[...t,e]),f(""),c([])},style:{padding:"8px",cursor:"pointer",borderBottom:"1px solid #eee"},role:"button",tabIndex:0,onKeyDown:t=>{(t.key==="Enter"||t.key===" ")&&(y(r=>[...r,e]),f(""),c([]))},children:[e.displayName," (",e.email,")"]},e.id))}),o.length>0&&a.jsxs("div",{style:{marginTop:"10px"},children:[a.jsx("label",{style:{fontSize:"0.9em"},children:s("groupChat.create.selectedHumans")}),a.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"5px",marginTop:"5px"},children:o.map(e=>a.jsxs("span",{className:"status-badge status-running",style:{display:"flex",alignItems:"center",gap:"5px"},children:[e.displayName,a.jsx("button",{type:"button",onClick:()=>y(t=>t.filter(r=>r.id!==e.id)),style:{background:"none",border:"none",color:"inherit",cursor:"pointer",padding:0,fontSize:"1.2em",lineHeight:1},"aria-label":s("groupChat.create.removeHuman",{name:e.displayName}),children:"×"})]},e.id))})]})]}),(l.size>0||o.length>0)&&a.jsxs("div",{className:"gc-context-preview",children:[a.jsx("div",{className:"gc-context-preview-title",children:s("groupChat.create.preview",{name:C||s("groupChat.create.untitledChat")})}),a.jsxs("div",{className:"gc-context-preview-members",children:[Array.from(l).map(e=>{const t=u.find(S=>S.id===e),r=v[e]||t?.name||"Bot",d=g[e];return a.jsxs("div",{className:"gc-context-preview-member",children:[a.jsx("span",{className:"gc-context-preview-dot gc-context-preview-dot--bot"}),a.jsx("span",{className:"gc-context-preview-name",children:r}),d&&a.jsxs("span",{className:"gc-context-preview-role",children:["— ",d]})]},e)}),o.map(e=>a.jsxs("div",{className:"gc-context-preview-member",children:[a.jsx("span",{className:"gc-context-preview-dot gc-context-preview-dot--human"}),a.jsx("span",{className:"gc-context-preview-name",children:e.displayName})]},e.id))]})]}),a.jsxs("div",{className:"modal-actions",children:[a.jsx("button",{type:"button",onClick:()=>m(!1),disabled:N,children:s("common.buttons.cancel")}),a.jsx("button",{type:"submit",disabled:N||l.size===0,children:N?s("groupChat.create.creating"):o.length>0?s("groupChat.create.createAndInvite"):s("groupChat.create.createGroupChat")})]})]})]})})]})}export{X as GroupChatsListPage};