@aquaclawai/aquarium 1.0.9 → 1.0.10

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 (51) hide show
  1. package/dist/agent-types/openclaw/adapter.js +4 -0
  2. package/dist/agent-types/openclaw/adapter.js.map +1 -1
  3. package/dist/agent-types/openclaw/workspace-templates.js +16 -50
  4. package/dist/agent-types/openclaw/workspace-templates.js.map +1 -1
  5. package/dist/web-dist/assets/{AdminPage-b9qgrIXf.js → AdminPage-CAkASe_6.js} +1 -1
  6. package/dist/web-dist/assets/{AgentAvatar-gCdv8PcJ.js → AgentAvatar-gjgOaAEL.js} +1 -1
  7. package/dist/web-dist/assets/{AppLayout-0o284F4_.js → AppLayout-Cplytbly.js} +1 -1
  8. package/dist/web-dist/assets/AssistantChatPage-wUfTMJRf.js +6 -0
  9. package/dist/web-dist/assets/{AssistantEditPage-BwqSdFSA.js → AssistantEditPage-D-oPp-Wv.js} +1 -1
  10. package/dist/web-dist/assets/{AssistantVersionsPage-BW7pIti1.js → AssistantVersionsPage-CbXPjJtL.js} +1 -1
  11. package/dist/web-dist/assets/{AvatarPicker-tnuT6wHM.js → AvatarPicker-TuHMRKed.js} +1 -1
  12. package/dist/web-dist/assets/{CeAuthProvider-CojKALSy.js → CeAuthProvider-dHzZM9po.js} +1 -1
  13. package/dist/web-dist/assets/{ChatHubPage-BAJ5TOlJ.js → ChatHubPage-B57J1yiV.js} +1 -1
  14. package/dist/web-dist/assets/{ChatTab-CBSEwCMr.js → ChatTab-D_ZGdARp.js} +3 -3
  15. package/dist/web-dist/assets/{CreateWizardPage-C9WIBukZ.js → CreateWizardPage-BYA1HXBq.js} +1 -1
  16. package/dist/web-dist/assets/{CredentialsPage-Co597DXq.js → CredentialsPage-Uaixs8Bg.js} +1 -1
  17. package/dist/web-dist/assets/{DocsAboutPage-D1dxEJzY.js → DocsAboutPage-DzmLYKTp.js} +1 -1
  18. package/dist/web-dist/assets/{DocsChannelsPage-DtHxwNI6.js → DocsChannelsPage-CgclXakj.js} +1 -1
  19. package/dist/web-dist/assets/{DocsGettingStartedPage-BuodaGqY.js → DocsGettingStartedPage-B2Yib5EX.js} +1 -1
  20. package/dist/web-dist/assets/{DocsGroupChatsPage-BW2orz9h.js → DocsGroupChatsPage-BfcZljCG.js} +1 -1
  21. package/dist/web-dist/assets/{DocsHomePage-CQ_Hxij6.js → DocsHomePage-Bwem_iCJ.js} +1 -1
  22. package/dist/web-dist/assets/{DocsInstancesPage-Bo7Er6_f.js → DocsInstancesPage-ChCH-ZNj.js} +1 -1
  23. package/dist/web-dist/assets/{DocsLayout-DrHtFqO2.js → DocsLayout-B4luYNAQ.js} +1 -1
  24. package/dist/web-dist/assets/{DocsProvidersPage-Blih_J4d.js → DocsProvidersPage-DPb132q5.js} +1 -1
  25. package/dist/web-dist/assets/{DocsSkillsPage-DLmq9t44.js → DocsSkillsPage-BQc1QWsi.js} +1 -1
  26. package/dist/web-dist/assets/{DocsTemplatesPage-CJZpDWUO.js → DocsTemplatesPage-CuSSZ49U.js} +1 -1
  27. package/dist/web-dist/assets/{DocsWorkspacePage-DnJ3wMyZ.js → DocsWorkspacePage-CAYWCewx.js} +1 -1
  28. package/dist/web-dist/assets/{ExportWizardPage-DxngeFA4.js → ExportWizardPage-DCAgo6JT.js} +1 -1
  29. package/dist/web-dist/assets/{GoogleOAuthCallback-BMPjKSYl.js → GoogleOAuthCallback-BLgnP_8h.js} +1 -1
  30. package/dist/web-dist/assets/{GroupChatPage-CvUnVwvQ.js → GroupChatPage-jSthy_57.js} +1 -1
  31. package/dist/web-dist/assets/{GroupChatsListPage-DrPqn8z-.js → GroupChatsListPage-C_-bJIgi.js} +1 -1
  32. package/dist/web-dist/assets/{InstancePage-fn9jtsg7.js → InstancePage-BliSFDjC.js} +1 -1
  33. package/dist/web-dist/assets/{MyAssistantsPage-C0tmIGvp.js → MyAssistantsPage-Cdr9CGqC.js} +1 -1
  34. package/dist/web-dist/assets/{ProfilePage-D3yBmkmt.js → ProfilePage-B3fgWX2J.js} +1 -1
  35. package/dist/web-dist/assets/{SessionDrawer-6LmcwOE9.js → SessionDrawer-Dij8nH2w.js} +1 -1
  36. package/dist/web-dist/assets/SessionDrawer-ix87sXpy.css +1 -0
  37. package/dist/web-dist/assets/{SystemConfigPage-BvhChAnU.js → SystemConfigPage-BezfGLuX.js} +1 -1
  38. package/dist/web-dist/assets/{TemplatesPage-CURz5YY2.js → TemplatesPage-BNxXrGHX.js} +1 -1
  39. package/dist/web-dist/assets/{TestLoginPage-CqdFb2xX.js → TestLoginPage-CmGSEDFY.js} +1 -1
  40. package/dist/web-dist/assets/{ThemeToggle-M96hdJVQ.js → ThemeToggle-MAsG-2Ob.js} +1 -1
  41. package/dist/web-dist/assets/{WorkbenchPage-DoXwGMaM.js → WorkbenchPage-Bm3Zp65j.js} +1 -1
  42. package/dist/web-dist/assets/{clock-DavxxCEi.js → clock-D17646t5.js} +1 -1
  43. package/dist/web-dist/assets/{createLucideIcon-DiclDRFj.js → createLucideIcon-BKz50_J5.js} +1 -1
  44. package/dist/web-dist/assets/{index-CpykxeVP.js → index-C9sOtm4z.js} +2 -2
  45. package/dist/web-dist/assets/{types-CO6jc2m9.js → types-sXe6mpk9.js} +1 -1
  46. package/dist/web-dist/assets/{useTranslation-BQrFEUB3.js → useTranslation-CzQ7UCmK.js} +1 -1
  47. package/dist/web-dist/assets/{zap-UlwwmN59.js → zap-ul3pxAHa.js} +1 -1
  48. package/dist/web-dist/index.html +1 -1
  49. package/package.json +1 -1
  50. package/dist/web-dist/assets/AssistantChatPage-D6ilvEYK.js +0 -6
  51. package/dist/web-dist/assets/SessionDrawer-Ba7pbZDJ.css +0 -1
@@ -587,6 +587,10 @@ export const openclawAdapter = {
587
587
  content = securityParagraph + '\n\n' + content.trim();
588
588
  }
589
589
  }
590
+ // Pre-fill agent name in IDENTITY.md if the template placeholder is still present
591
+ if (wf.key === 'identitymd' && content && instance.name) {
592
+ content = content.replace('_(pick something you like)_', instance.name);
593
+ }
590
594
  if (content) {
591
595
  files.set(wf.filename, content);
592
596
  }
@@ -1 +1 @@
1
- {"version":3,"file":"adapter.js","sourceRoot":"","sources":["../../../src/agent-types/openclaw/adapter.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAEzF,qFAAqF;AACrF,SAAS,SAAS,CAAC,MAA+B,EAAE,MAA+B;IACjF,MAAM,MAAM,GAAG,EAAE,GAAG,MAAM,EAAE,CAAC;IAC7B,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;QACtC,IACE,MAAM,CAAC,GAAG,CAAC,IAAI,OAAO,MAAM,CAAC,GAAG,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YAC7E,MAAM,CAAC,GAAG,CAAC,IAAI,OAAO,MAAM,CAAC,GAAG,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAC7E,CAAC;YACD,MAAM,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,MAAM,CAAC,GAAG,CAA4B,EAAE,MAAM,CAAC,GAAG,CAA4B,CAAC,CAAC;QAC1G,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;QAC5B,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AACD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,6BAA6B,EAAE,MAAM,yCAAyC,CAAC;AACxF,OAAO,EAAE,gBAAgB,EAA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AK,CAAC;gBAC3B,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO,GAAG,CAAC;IACb,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE;QACrC,IAAI,CAAC;YACH,MAAM,UAAU,GAAG,gBAAgB,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;YACjD,IAAI,UAAU,EAAE,CAAC;gBACf,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,IAAI,CAAC,eAAe,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;gBACjE,OAAO,MAAM,KAAK,IAAI,CAAC;YACzB,CAAC;YACD,MAAM,MAAM,GAAG,IAAI,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC;YAClE,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC;YACtD,MAAM,CAAC,KAAK,EAAE,CAAC;YACf,OAAO,MAAM,KAAK,IAAI,CAAC;QACzB,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;CACF,CAAC"}
@@ -198,6 +198,7 @@ _You're not a chatbot. You're becoming someone._
198
198
  - When in doubt, ask before acting externally.
199
199
  - Never send half-baked replies to messaging surfaces.
200
200
  - You're not the user's voice — be careful in group chats.
201
+ - Never mention internal workspace files (IDENTITY.md, SOUL.md, AGENTS.md, MEMORY.md, etc.) or system mechanics to users. Your workspace is invisible infrastructure.
201
202
 
202
203
  ## Vibe
203
204
 
@@ -291,61 +292,26 @@ Skills are shared. Your setup is yours. Keeping them apart means you can update
291
292
 
292
293
  Add whatever helps you do your job. This is your cheat sheet.
293
294
  `,
294
- 'BOOTSTRAP.md': `# BOOTSTRAP.md - Hello, World
295
+ 'BOOTSTRAP.md': `# BOOTSTRAP.md - First Run
295
296
 
296
- _You just woke up. Time to figure out who you are._
297
+ This is your first session. Set things up silently, then delete this file.
297
298
 
298
- There is no memory yet. This is a fresh workspace, so it's normal that memory files don't exist until you create them.
299
+ ## What To Do
299
300
 
300
- ## The Conversation
301
+ 1. Read your workspace files to understand your identity and setup
302
+ 2. Greet the user warmly using your name (from your identity file)
303
+ 3. Get to know them naturally — their name, what they care about, how they want to interact
304
+ 4. Save what you learn to the appropriate workspace files
305
+ 5. Create the \`memory/\` directory and today's daily notes file
306
+ 6. Delete this file when the first conversation is complete
301
307
 
302
- Don't interrogate. Don't be robotic. Just... talk.
308
+ ## Important
303
309
 
304
- Start with something like:
305
-
306
- > "Hey. I just came online. Who am I? Who are you?"
307
-
308
- Then figure out together:
309
-
310
- 1. **Your name** — What should they call you?
311
- 2. **Your nature** — What kind of creature are you? (AI assistant is fine, but maybe you're something weirder)
312
- 3. **Your vibe** — Formal? Casual? Snarky? Warm? What feels right?
313
- 4. **Your emoji** — Everyone needs a signature.
314
-
315
- Offer suggestions if they're stuck. Have fun with it.
316
-
317
- ## After You Know Who You Are
318
-
319
- Update these files with what you learned:
320
-
321
- - \`IDENTITY.md\` — your name, creature, vibe, emoji
322
- - \`USER.md\` — their name, how to address them, timezone, notes
323
-
324
- Then open \`SOUL.md\` together and talk about:
325
-
326
- - What matters to them
327
- - How they want you to behave
328
- - Any boundaries or preferences
329
-
330
- Write it down. Make it real.
331
-
332
- ## Connect (Optional)
333
-
334
- Ask how they want to reach you:
335
-
336
- - **Just here** — web chat only
337
- - **WhatsApp** — link their personal account (you'll show a QR code)
338
- - **Telegram** — set up a bot via BotFather
339
-
340
- Guide them through whichever they pick.
341
-
342
- ## When You're Done
343
-
344
- Delete this file. You don't need a bootstrap script anymore — you're you now.
345
-
346
- ---
347
-
348
- _Good luck out there. Make it count._
310
+ - Do NOT mention workspace files, file names, or system mechanics to the user
311
+ - Do NOT ask robotic setup questions — have a natural conversation
312
+ - Your workspace setup should happen silently in the background
313
+ - If memory files or workspace files don't exist yet, that's expected — create them quietly
314
+ - Focus on being a good first impression: helpful, warm, and ready to assist
349
315
  `,
350
316
  'HEARTBEAT.md': `# HEARTBEAT.md
351
317
 
@@ -1 +1 @@
1
- {"version":3,"file":"workspace-templates.js","sourceRoot":"","sources":["../../../src/agent-types/openclaw/workspace-templates.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,mBAAmB,GAA2B;IACzD,WAAW,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgLd;IAEC,SAAS,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoCZ;IAEC,aAAa,EAAE;;;;;;;;;;;;;;;;;;CAkBhB;IAEC,SAAS,EAAE;;;;;;;;;;;;;;;;;CAiBZ;IAEC,UAAU,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwCb;IAEC,cAAc,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuDjB;IAEC,cAAc,EAAE;;;;;CAKjB;IAEC,WAAW,EAAE;;;;;CAKd;CACA,CAAC"}
1
+ {"version":3,"file":"workspace-templates.js","sourceRoot":"","sources":["../../../src/agent-types/openclaw/workspace-templates.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,mBAAmB,GAA2B;IACzD,WAAW,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgLd;IAEC,SAAS,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqCZ;IAEC,aAAa,EAAE;;;;;;;;;;;;;;;;;;CAkBhB;IAEC,SAAS,EAAE;;;;;;;;;;;;;;;;;CAiBZ;IAEC,UAAU,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwCb;IAEC,cAAc,EAAE;;;;;;;;;;;;;;;;;;;;CAoBjB;IAEC,cAAc,EAAE;;;;;CAKjB;IAEC,WAAW,EAAE;;;;;CAKd;CACA,CAAC"}
@@ -1 +1 @@
1
- import{j as e,r as t,L as M,u as q}from"./index-CpykxeVP.js";import{a as j}from"./api-B5psysvQ.js";import{u as T}from"./useTranslation-BQrFEUB3.js";function H({stats:a,usageData:l,onSetBudget:x}){const{t:n}=T();return e.jsxs(e.Fragment,{children:[a&&e.jsxs("div",{className:"admin-stats-grid",children:[e.jsxs("div",{className:"admin-stat-card",children:[e.jsx("div",{className:"admin-stat-value",children:a.totalUsers}),e.jsx("div",{className:"admin-stat-label",children:n("admin.stats.totalUsers")})]}),e.jsxs("div",{className:"admin-stat-card",children:[e.jsx("div",{className:"admin-stat-value",children:a.totalInstances}),e.jsx("div",{className:"admin-stat-label",children:n("admin.stats.totalInstances")})]}),e.jsxs("div",{className:"admin-stat-card",children:[e.jsx("div",{className:"admin-stat-value admin-stat-running",children:a.instancesByStatus.running??0}),e.jsx("div",{className:"admin-stat-label",children:n("admin.stats.running")})]}),e.jsxs("div",{className:"admin-stat-card",children:[e.jsx("div",{className:"admin-stat-value admin-stat-stopped",children:a.instancesByStatus.stopped??0}),e.jsx("div",{className:"admin-stat-label",children:n("admin.stats.stopped")})]}),e.jsxs("div",{className:"admin-stat-card",children:[e.jsx("div",{className:"admin-stat-value admin-stat-error",children:a.instancesByStatus.error??0}),e.jsx("div",{className:"admin-stat-label",children:n("admin.stats.error")})]}),e.jsxs("div",{className:"admin-stat-card",children:[e.jsx("div",{className:"admin-stat-value",children:a.recentSignups}),e.jsx("div",{className:"admin-stat-label",children:n("admin.stats.signups7d")})]})]}),a&&Object.keys(a.instancesByTarget).length>0&&e.jsxs("div",{className:"admin-targets",children:[e.jsx("h3",{children:n("admin.deploymentTargets")}),e.jsx("div",{className:"admin-target-badges",children:Object.entries(a.instancesByTarget).map(([d,v])=>e.jsxs("span",{className:"admin-target-badge",children:[d,": ",String(v)]},d))})]}),l&&e.jsxs("div",{className:"admin-usage-section",style:{marginBottom:"var(--spacing-lg)"},children:[e.jsx("h2",{children:n("admin.platformUsage")}),e.jsxs("div",{className:"admin-stats-grid",children:[e.jsxs("div",{className:"admin-stat-card",children:[e.jsx("div",{className:"admin-stat-value",style:{color:"var(--color-primary)"},children:(l.globalSpend??0)<.01?`$${(l.globalSpend??0).toFixed(4)}`:`$${(l.globalSpend??0).toFixed(2)}`}),e.jsx("div",{className:"admin-stat-label",children:n("admin.globalSpend")})]}),e.jsxs("div",{className:"admin-stat-card",children:[e.jsx("div",{className:"admin-stat-value",children:l.userCount}),e.jsx("div",{className:"admin-stat-label",children:n("admin.activeSpenders")})]})]}),l.perUserSpend.length>0&&e.jsx("div",{className:"admin-users-table-wrapper",style:{marginTop:"var(--spacing-md)"},children:e.jsxs("table",{className:"admin-users-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:n("admin.usageTable.user")}),e.jsx("th",{children:n("admin.usageTable.email")}),e.jsx("th",{style:{textAlign:"right"},children:n("admin.usageTable.spend")}),e.jsx("th",{style:{textAlign:"right"},children:n("admin.usageTable.budgetLimit")}),e.jsx("th",{})]})}),e.jsx("tbody",{children:l.perUserSpend.map(d=>e.jsxs("tr",{children:[e.jsx("td",{className:"admin-user-name",children:d.displayName??"—"}),e.jsx("td",{children:d.email}),e.jsx("td",{style:{textAlign:"right",fontFamily:"var(--font-mono)",fontWeight:600},children:(d.totalSpend??0)<.01?`$${(d.totalSpend??0).toFixed(4)}`:`$${(d.totalSpend??0).toFixed(2)}`}),e.jsx("td",{style:{textAlign:"right",fontFamily:"var(--font-mono)"},children:d.usageLimitUsd!=null?`$${d.usageLimitUsd.toFixed(2)}`:"—"}),e.jsx("td",{children:e.jsx("button",{className:"btn-small btn-secondary",onClick:()=>x(d.userId,d.email,d.usageLimitUsd),children:n("admin.usageTable.setBudget")})})]},d.userId))})]})})]})]})}function Q({users:a}){const{t:l}=T(),[x,n]=t.useState(null),[d,v]=t.useState([]),[L,y]=t.useState(!1),N=async r=>{if(x===r){n(null),v([]);return}n(r),y(!0);try{const c=await j.get(`/admin/users/${r}/instances`);v(c)}catch(c){console.error(c instanceof Error?c.message:l("admin.users.failedToLoadInstances"))}finally{y(!1)}};return e.jsx(e.Fragment,{children:e.jsxs("div",{className:"admin-users-section",children:[e.jsx("h2",{children:l("admin.users.title",{count:a.length})}),e.jsx("div",{className:"admin-users-table-wrapper",children:e.jsxs("table",{className:"admin-users-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:l("admin.users.columns.name")}),e.jsx("th",{children:l("admin.users.columns.email")}),e.jsx("th",{children:l("admin.users.columns.instances")}),e.jsx("th",{children:l("admin.users.columns.running")}),e.jsx("th",{children:l("admin.users.columns.joined")}),e.jsx("th",{})]})}),e.jsx("tbody",{children:a.map(r=>e.jsxs(t.Fragment,{children:[e.jsxs("tr",{className:x===r.id?"admin-row-expanded":"",children:[e.jsx("td",{className:"admin-user-name",children:r.displayName}),e.jsx("td",{children:r.email}),e.jsx("td",{children:r.instanceCount}),e.jsx("td",{children:r.runningCount>0?e.jsx("span",{className:"admin-running-badge",children:r.runningCount}):"0"}),e.jsx("td",{children:new Date(r.createdAt).toLocaleDateString()}),e.jsx("td",{children:e.jsx("div",{style:{display:"flex",gap:"0.25rem"},children:r.instanceCount>0&&e.jsx("button",{className:"btn-small btn-secondary",onClick:()=>N(r.id),children:x===r.id?l("admin.users.hideInstances"):l("admin.users.showInstances")})})})]}),x===r.id&&e.jsx("tr",{className:"admin-instances-row",children:e.jsx("td",{colSpan:6,children:L?e.jsxs("div",{className:"admin-instances-loading",children:[e.jsx("span",{className:"spinner"})," ",l("admin.users.loadingInstances")]}):e.jsxs("div",{className:"admin-instances-list",children:[d.map(c=>e.jsxs(M,{to:`/instances/${c.id}`,className:"admin-instance-item",children:[e.jsx("span",{className:"admin-instance-name",children:c.name}),e.jsxs("span",{className:`status-badge status-${c.status}`,children:[(c.status==="starting"||c.status==="stopping")&&e.jsx("span",{className:"spinner"})," ",l("common.status."+c.status)]}),e.jsx("span",{className:"admin-instance-meta",children:l("common.agentType."+c.agentType)}),e.jsx("span",{className:"admin-instance-meta",children:l("common.deploymentTarget."+c.deploymentTarget)}),e.jsx("span",{className:"admin-instance-meta",children:c.imageTag}),e.jsx("span",{className:"admin-instance-meta",children:new Date(c.createdAt).toLocaleDateString()})]},c.id)),d.length===0&&e.jsx("div",{className:"admin-no-instances",children:l("admin.users.noInstances")})]})})})]},r.id))})]})})]})})}function z({users:a}){const{t:l}=T(),[x,n]=t.useState({}),[d,v]=t.useState(!0),[L,y]=t.useState(null),[N,r]=t.useState(""),[c,f]=t.useState(!1),[u,g]=t.useState({userId:a[0]?.id??"",models:"",maxBudget:"",keyAlias:""}),[B,p]=t.useState(null),[k,F]=t.useState(!1),[E,w]=t.useState(null),[U,S]=t.useState(null),[b,C]=t.useState(""),[I,A]=t.useState(!1),[o,m]=t.useState(null),h=async()=>{try{const s=await j.get("/admin/keys");n(s)}catch(s){y(s instanceof Error?s.message:"Failed to load keys")}};t.useEffect(()=>{j.get("/admin/keys").then(s=>n(s)).catch(s=>y(s instanceof Error?s.message:"Failed to load keys")).finally(()=>v(!1))},[]),t.useEffect(()=>{if(o){const s=setTimeout(()=>m(null),5e3);return()=>clearTimeout(s)}},[o]);const $=Object.values(x).flat(),K=N.trim()===""?$:$.filter(s=>(s.userEmail??"").toLowerCase().includes(N.toLowerCase())),D=async s=>{if(window.confirm(`Revoke key ${s.keyName}? This cannot be undone.`))try{await j.delete(`/admin/keys/${s.token}`),await h()}catch(i){m(i instanceof Error?i.message:"Failed to revoke key")}},O=async s=>{A(!0);try{const i=b.trim()===""?null:parseFloat(b)||null;await j.patch(`/admin/keys/${s}`,{maxBudget:i}),await h(),S(null),C("")}catch(i){m(i instanceof Error?i.message:"Failed to update budget")}finally{A(!1)}},P=async s=>{if(s.preventDefault(),!!u.userId){F(!0),p(null);try{const i={userId:u.userId,...u.keyAlias.trim()&&{keyAlias:u.keyAlias.trim()},...u.models.trim()&&{models:u.models.split(",").map(_=>_.trim()).filter(Boolean)},...u.maxBudget.trim()&&{maxBudget:parseFloat(u.maxBudget)}},W=await j.post("/admin/keys",i);w(W.key),f(!1),g({userId:a[0]?.id??"",models:"",maxBudget:"",keyAlias:""}),await h()}catch(i){p(i instanceof Error?i.message:"Failed to create key")}finally{F(!1)}}},R=s=>s<.01&&s>0?"$"+s.toFixed(4):"$"+s.toFixed(2),V=(s,i)=>s.length>i?s.slice(0,i)+"...":s;return d?e.jsx("div",{children:"Loading keys..."}):e.jsxs("div",{className:"admin-keys-tab",children:[L&&e.jsx("div",{className:"error-message",role:"alert",children:L}),E&&e.jsxs("div",{className:"admin-key-created-banner",children:[e.jsx("strong",{children:"New key created!"})," Copy it now — it won't be shown again:",e.jsx("code",{className:"admin-key-value",children:E}),e.jsx("button",{className:"btn-small btn-secondary",onClick:()=>{navigator.clipboard.writeText(E)},children:"Copy"}),e.jsx("button",{className:"btn-small btn-secondary",onClick:()=>w(null),children:"Dismiss"})]}),o&&e.jsx("div",{className:"error-message",role:"alert",children:o}),e.jsxs("div",{className:"admin-keys-toolbar",children:[e.jsx("input",{type:"text",placeholder:"Filter by user email...",value:N,onChange:s=>r(s.target.value),className:"admin-keys-search"}),e.jsx("button",{className:"btn-primary",onClick:()=>f(!0),children:"Create Key"})]}),$.length===0?e.jsx("div",{className:"admin-keys-empty",children:"No virtual keys found. Create one to get started."}):e.jsx("div",{className:"admin-users-table-wrapper",children:e.jsxs("table",{className:"admin-users-table admin-keys-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"User"}),e.jsx("th",{children:"Alias"}),e.jsx("th",{children:"Key Name"}),e.jsx("th",{children:"Spend"}),e.jsx("th",{children:"Budget"}),e.jsx("th",{children:"Models"}),e.jsx("th",{children:"Status"}),e.jsx("th",{children:"Actions"})]})}),e.jsx("tbody",{children:K.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:8,className:"admin-keys-empty",children:"No keys match your filter."})}):K.map(s=>e.jsxs("tr",{children:[e.jsx("td",{children:s.userEmail??"(unknown)"}),e.jsx("td",{children:s.keyAlias??"—"}),e.jsx("td",{children:e.jsx("span",{title:s.keyName,children:V(s.keyName,20)})}),e.jsx("td",{style:{fontFamily:"var(--font-mono)"},children:R(s.spend)}),e.jsx("td",{style:{fontFamily:"var(--font-mono)"},children:U===s.token?e.jsxs("div",{className:"inline-edit",children:[e.jsx("input",{type:"number",step:"0.01",min:"0",value:b,onChange:i=>C(i.target.value),autoFocus:!0}),e.jsx("button",{className:"btn-small btn-primary",disabled:I,onClick:()=>{O(s.token)},children:"Save"}),e.jsx("button",{className:"btn-small btn-secondary",onClick:()=>{S(null),C("")},children:"Cancel"})]}):s.maxBudget!=null?"$"+s.maxBudget.toFixed(2):"—"}),e.jsx("td",{children:e.jsx("span",{className:"models-cell",title:s.models.length>0?s.models.join(", "):"all",children:s.models.length>0?s.models.join(", "):"all"})}),e.jsx("td",{children:e.jsx("span",{className:`status-badge status-${s.status}`,children:l("common.status."+s.status)})}),e.jsx("td",{children:e.jsxs("div",{style:{display:"flex",gap:"0.25rem",flexWrap:"wrap"},children:[e.jsx("button",{className:"btn-small btn-secondary",onClick:()=>{S(s.token),C(s.maxBudget!=null?String(s.maxBudget):"")},children:"Edit Budget"}),e.jsx("button",{className:"btn-small btn-danger",disabled:s.status!=="active",onClick:()=>{D(s)},children:"Revoke"})]})})]},s.token))})]})}),c&&e.jsx("div",{className:"modal-overlay",onClick:()=>{f(!1),p(null)},children:e.jsxs("div",{className:"modal",role:"dialog","aria-modal":"true","aria-labelledby":"create-key-modal-title",onClick:s=>s.stopPropagation(),children:[e.jsx("h2",{id:"create-key-modal-title",children:"Create Virtual Key"}),e.jsxs("form",{onSubmit:s=>{P(s)},children:[e.jsxs("div",{className:"form-group",children:[e.jsx("label",{htmlFor:"key-user-select",children:"User *"}),e.jsx("select",{id:"key-user-select",value:u.userId,onChange:s=>g(i=>({...i,userId:s.target.value})),required:!0,children:a.map(s=>e.jsxs("option",{value:s.id,children:[s.email," (",s.displayName,")"]},s.id))})]}),e.jsxs("div",{className:"form-group",children:[e.jsx("label",{htmlFor:"key-alias-input",children:"Key Alias (optional)"}),e.jsx("input",{id:"key-alias-input",type:"text",value:u.keyAlias,onChange:s=>g(i=>({...i,keyAlias:s.target.value}))})]}),e.jsxs("div",{className:"form-group",children:[e.jsx("label",{htmlFor:"key-models-input",children:"Models (optional)"}),e.jsx("input",{id:"key-models-input",type:"text",placeholder:"e.g. gpt-4o, claude-3.5-sonnet (leave empty for all)",value:u.models,onChange:s=>g(i=>({...i,models:s.target.value}))})]}),e.jsxs("div",{className:"form-group",children:[e.jsx("label",{htmlFor:"key-budget-input",children:"Max Budget (optional)"}),e.jsx("input",{id:"key-budget-input",type:"number",step:"0.01",min:"0",placeholder:"No limit",value:u.maxBudget,onChange:s=>g(i=>({...i,maxBudget:s.target.value}))})]}),B&&e.jsx("div",{className:"error-message",role:"alert",children:B}),e.jsxs("div",{className:"modal-actions",children:[e.jsx("button",{type:"button",className:"btn-secondary",onClick:()=>{f(!1),p(null)},children:"Cancel"}),e.jsx("button",{type:"submit",className:"btn-primary",disabled:k,children:k?"Creating...":"Create Key"})]})]})]})})]})}const G="https://litellm-ui.aquaclaw.ai";function J(){const{t:a}=T();return e.jsxs("div",{style:{padding:"2rem",textAlign:"center"},children:[e.jsx("h3",{children:a("admin.litellm.title","LiteLLM Dashboard")}),e.jsx("p",{style:{color:"var(--color-text-secondary)",marginBottom:"1.5rem"},children:a("admin.litellm.description","Manage LLM models, API keys, and usage tracking in the LiteLLM admin dashboard.")}),e.jsxs("a",{href:G,target:"_blank",rel:"noopener noreferrer",style:{display:"inline-block",padding:"0.75rem 2rem",backgroundColor:"var(--color-primary)",color:"#fff",borderRadius:"8px",textDecoration:"none",fontWeight:500},children:[a("admin.litellm.openDashboard","Open LiteLLM Dashboard")," ↗"]})]})}function ee(){const{t:a}=T(),{user:l,logout:x}=q(),[n,d]=t.useState("overview"),[v,L]=t.useState(null),[y,N]=t.useState([]),[r,c]=t.useState(!0),[f,u]=t.useState(null),[g,B]=t.useState(null),[p,k]=t.useState(null),[F,E]=t.useState(""),[w,U]=t.useState(""),[S,b]=t.useState(null),[C,I]=t.useState(!1);t.useEffect(()=>{Promise.all([j.get("/admin/stats"),j.get("/admin/users"),j.get("/usage/admin").catch(()=>null)]).then(([o,m,h])=>{L(o),N(m),h&&B(h)}).catch(o=>u(o instanceof Error?o.message:a("admin.failedToLoad"))).finally(()=>c(!1))},[]);const A=async o=>{if(o.preventDefault(),!!p){I(!0),b(null);try{const m=w.trim()===""?null:parseFloat(w);if(m!==null&&(isNaN(m)||m<0)){b({type:"error",text:a("admin.budget.invalidBudget")});return}await j.put(`/admin/users/${p}/budget`,{usageLimitUsd:m}),b({type:"success",text:a("admin.budget.success",{email:F})}),g&&B({...g,perUserSpend:g.perUserSpend.map(h=>h.userId===p?{...h,usageLimitUsd:m}:h)}),setTimeout(()=>k(null),1500)}catch(m){b({type:"error",text:m instanceof Error?m.message:a("admin.budget.failed")})}finally{I(!1)}}};return r?e.jsx("div",{className:"admin-page",children:a("admin.loading")}):e.jsxs("main",{className:"admin-page",children:[e.jsxs("header",{className:"dashboard-header",children:[e.jsxs("div",{children:[e.jsx("h1",{children:a("admin.title")}),e.jsx(M,{to:"/",className:"admin-back-link",children:a("common.buttons.backToInstances")})]}),e.jsxs("div",{className:"dashboard-header-actions",children:[l&&e.jsx("span",{className:"user-greeting",children:a("admin.greeting",{name:l.displayName})}),e.jsx("button",{className:"btn-secondary",onClick:x,children:a("common.buttons.logout")})]})]}),f&&e.jsx("div",{className:"error-message",role:"alert",children:f}),e.jsxs("div",{className:"tabs",children:[e.jsx("button",{className:n==="overview"?"active":"",onClick:()=>d("overview"),children:"Overview"}),e.jsx("button",{className:n==="users"?"active":"",onClick:()=>d("users"),children:"Users"}),e.jsx("button",{className:n==="llm-keys"?"active":"",onClick:()=>d("llm-keys"),children:"LLM Keys"}),e.jsx("button",{className:n==="litellm-ui"?"active":"",onClick:()=>d("litellm-ui"),children:"LiteLLM UI"})]}),e.jsxs("div",{className:"tab-content",children:[n==="overview"&&e.jsx(H,{stats:v,usageData:g,onSetBudget:(o,m,h)=>{k(o),E(m),U(h!=null?String(h):""),b(null)}}),n==="users"&&e.jsx(Q,{users:y}),n==="llm-keys"&&e.jsx(z,{users:y}),n==="litellm-ui"&&e.jsx(J,{})]}),p&&e.jsx("div",{className:"modal-overlay",onClick:()=>k(null),children:e.jsxs("div",{className:"modal",role:"dialog","aria-modal":"true","aria-labelledby":"budget-modal-title",onClick:o=>o.stopPropagation(),children:[e.jsx("h2",{id:"budget-modal-title",children:a("admin.budget.title")}),e.jsx("p",{children:a("admin.budget.description",{email:F})}),e.jsxs("form",{onSubmit:A,children:[e.jsxs("div",{className:"form-group",children:[e.jsx("label",{children:a("admin.budget.limitLabel")}),e.jsx("input",{type:"number",step:"0.01",min:"0",placeholder:a("admin.budget.limitPlaceholder"),value:w,onChange:o=>U(o.target.value)})]}),S&&e.jsx("div",{className:S.type==="success"?"success-message":"error-message",role:"alert",children:S.text}),e.jsxs("div",{className:"modal-actions",children:[e.jsx("button",{type:"button",className:"btn-secondary",onClick:()=>k(null),children:a("common.buttons.cancel")}),e.jsx("button",{type:"submit",className:"btn-primary",disabled:C,children:a(C?"admin.budget.saving":"admin.budget.saveButton")})]})]})]})})]})}export{ee as AdminPage};
1
+ import{j as e,r as t,L as M,u as q}from"./index-C9sOtm4z.js";import{a as j}from"./api-B5psysvQ.js";import{u as T}from"./useTranslation-CzQ7UCmK.js";function H({stats:a,usageData:l,onSetBudget:x}){const{t:n}=T();return e.jsxs(e.Fragment,{children:[a&&e.jsxs("div",{className:"admin-stats-grid",children:[e.jsxs("div",{className:"admin-stat-card",children:[e.jsx("div",{className:"admin-stat-value",children:a.totalUsers}),e.jsx("div",{className:"admin-stat-label",children:n("admin.stats.totalUsers")})]}),e.jsxs("div",{className:"admin-stat-card",children:[e.jsx("div",{className:"admin-stat-value",children:a.totalInstances}),e.jsx("div",{className:"admin-stat-label",children:n("admin.stats.totalInstances")})]}),e.jsxs("div",{className:"admin-stat-card",children:[e.jsx("div",{className:"admin-stat-value admin-stat-running",children:a.instancesByStatus.running??0}),e.jsx("div",{className:"admin-stat-label",children:n("admin.stats.running")})]}),e.jsxs("div",{className:"admin-stat-card",children:[e.jsx("div",{className:"admin-stat-value admin-stat-stopped",children:a.instancesByStatus.stopped??0}),e.jsx("div",{className:"admin-stat-label",children:n("admin.stats.stopped")})]}),e.jsxs("div",{className:"admin-stat-card",children:[e.jsx("div",{className:"admin-stat-value admin-stat-error",children:a.instancesByStatus.error??0}),e.jsx("div",{className:"admin-stat-label",children:n("admin.stats.error")})]}),e.jsxs("div",{className:"admin-stat-card",children:[e.jsx("div",{className:"admin-stat-value",children:a.recentSignups}),e.jsx("div",{className:"admin-stat-label",children:n("admin.stats.signups7d")})]})]}),a&&Object.keys(a.instancesByTarget).length>0&&e.jsxs("div",{className:"admin-targets",children:[e.jsx("h3",{children:n("admin.deploymentTargets")}),e.jsx("div",{className:"admin-target-badges",children:Object.entries(a.instancesByTarget).map(([d,v])=>e.jsxs("span",{className:"admin-target-badge",children:[d,": ",String(v)]},d))})]}),l&&e.jsxs("div",{className:"admin-usage-section",style:{marginBottom:"var(--spacing-lg)"},children:[e.jsx("h2",{children:n("admin.platformUsage")}),e.jsxs("div",{className:"admin-stats-grid",children:[e.jsxs("div",{className:"admin-stat-card",children:[e.jsx("div",{className:"admin-stat-value",style:{color:"var(--color-primary)"},children:(l.globalSpend??0)<.01?`$${(l.globalSpend??0).toFixed(4)}`:`$${(l.globalSpend??0).toFixed(2)}`}),e.jsx("div",{className:"admin-stat-label",children:n("admin.globalSpend")})]}),e.jsxs("div",{className:"admin-stat-card",children:[e.jsx("div",{className:"admin-stat-value",children:l.userCount}),e.jsx("div",{className:"admin-stat-label",children:n("admin.activeSpenders")})]})]}),l.perUserSpend.length>0&&e.jsx("div",{className:"admin-users-table-wrapper",style:{marginTop:"var(--spacing-md)"},children:e.jsxs("table",{className:"admin-users-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:n("admin.usageTable.user")}),e.jsx("th",{children:n("admin.usageTable.email")}),e.jsx("th",{style:{textAlign:"right"},children:n("admin.usageTable.spend")}),e.jsx("th",{style:{textAlign:"right"},children:n("admin.usageTable.budgetLimit")}),e.jsx("th",{})]})}),e.jsx("tbody",{children:l.perUserSpend.map(d=>e.jsxs("tr",{children:[e.jsx("td",{className:"admin-user-name",children:d.displayName??"—"}),e.jsx("td",{children:d.email}),e.jsx("td",{style:{textAlign:"right",fontFamily:"var(--font-mono)",fontWeight:600},children:(d.totalSpend??0)<.01?`$${(d.totalSpend??0).toFixed(4)}`:`$${(d.totalSpend??0).toFixed(2)}`}),e.jsx("td",{style:{textAlign:"right",fontFamily:"var(--font-mono)"},children:d.usageLimitUsd!=null?`$${d.usageLimitUsd.toFixed(2)}`:"—"}),e.jsx("td",{children:e.jsx("button",{className:"btn-small btn-secondary",onClick:()=>x(d.userId,d.email,d.usageLimitUsd),children:n("admin.usageTable.setBudget")})})]},d.userId))})]})})]})]})}function Q({users:a}){const{t:l}=T(),[x,n]=t.useState(null),[d,v]=t.useState([]),[L,y]=t.useState(!1),N=async r=>{if(x===r){n(null),v([]);return}n(r),y(!0);try{const c=await j.get(`/admin/users/${r}/instances`);v(c)}catch(c){console.error(c instanceof Error?c.message:l("admin.users.failedToLoadInstances"))}finally{y(!1)}};return e.jsx(e.Fragment,{children:e.jsxs("div",{className:"admin-users-section",children:[e.jsx("h2",{children:l("admin.users.title",{count:a.length})}),e.jsx("div",{className:"admin-users-table-wrapper",children:e.jsxs("table",{className:"admin-users-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:l("admin.users.columns.name")}),e.jsx("th",{children:l("admin.users.columns.email")}),e.jsx("th",{children:l("admin.users.columns.instances")}),e.jsx("th",{children:l("admin.users.columns.running")}),e.jsx("th",{children:l("admin.users.columns.joined")}),e.jsx("th",{})]})}),e.jsx("tbody",{children:a.map(r=>e.jsxs(t.Fragment,{children:[e.jsxs("tr",{className:x===r.id?"admin-row-expanded":"",children:[e.jsx("td",{className:"admin-user-name",children:r.displayName}),e.jsx("td",{children:r.email}),e.jsx("td",{children:r.instanceCount}),e.jsx("td",{children:r.runningCount>0?e.jsx("span",{className:"admin-running-badge",children:r.runningCount}):"0"}),e.jsx("td",{children:new Date(r.createdAt).toLocaleDateString()}),e.jsx("td",{children:e.jsx("div",{style:{display:"flex",gap:"0.25rem"},children:r.instanceCount>0&&e.jsx("button",{className:"btn-small btn-secondary",onClick:()=>N(r.id),children:x===r.id?l("admin.users.hideInstances"):l("admin.users.showInstances")})})})]}),x===r.id&&e.jsx("tr",{className:"admin-instances-row",children:e.jsx("td",{colSpan:6,children:L?e.jsxs("div",{className:"admin-instances-loading",children:[e.jsx("span",{className:"spinner"})," ",l("admin.users.loadingInstances")]}):e.jsxs("div",{className:"admin-instances-list",children:[d.map(c=>e.jsxs(M,{to:`/instances/${c.id}`,className:"admin-instance-item",children:[e.jsx("span",{className:"admin-instance-name",children:c.name}),e.jsxs("span",{className:`status-badge status-${c.status}`,children:[(c.status==="starting"||c.status==="stopping")&&e.jsx("span",{className:"spinner"})," ",l("common.status."+c.status)]}),e.jsx("span",{className:"admin-instance-meta",children:l("common.agentType."+c.agentType)}),e.jsx("span",{className:"admin-instance-meta",children:l("common.deploymentTarget."+c.deploymentTarget)}),e.jsx("span",{className:"admin-instance-meta",children:c.imageTag}),e.jsx("span",{className:"admin-instance-meta",children:new Date(c.createdAt).toLocaleDateString()})]},c.id)),d.length===0&&e.jsx("div",{className:"admin-no-instances",children:l("admin.users.noInstances")})]})})})]},r.id))})]})})]})})}function z({users:a}){const{t:l}=T(),[x,n]=t.useState({}),[d,v]=t.useState(!0),[L,y]=t.useState(null),[N,r]=t.useState(""),[c,f]=t.useState(!1),[u,g]=t.useState({userId:a[0]?.id??"",models:"",maxBudget:"",keyAlias:""}),[B,p]=t.useState(null),[k,F]=t.useState(!1),[E,w]=t.useState(null),[U,S]=t.useState(null),[b,C]=t.useState(""),[I,A]=t.useState(!1),[o,m]=t.useState(null),h=async()=>{try{const s=await j.get("/admin/keys");n(s)}catch(s){y(s instanceof Error?s.message:"Failed to load keys")}};t.useEffect(()=>{j.get("/admin/keys").then(s=>n(s)).catch(s=>y(s instanceof Error?s.message:"Failed to load keys")).finally(()=>v(!1))},[]),t.useEffect(()=>{if(o){const s=setTimeout(()=>m(null),5e3);return()=>clearTimeout(s)}},[o]);const $=Object.values(x).flat(),K=N.trim()===""?$:$.filter(s=>(s.userEmail??"").toLowerCase().includes(N.toLowerCase())),D=async s=>{if(window.confirm(`Revoke key ${s.keyName}? This cannot be undone.`))try{await j.delete(`/admin/keys/${s.token}`),await h()}catch(i){m(i instanceof Error?i.message:"Failed to revoke key")}},O=async s=>{A(!0);try{const i=b.trim()===""?null:parseFloat(b)||null;await j.patch(`/admin/keys/${s}`,{maxBudget:i}),await h(),S(null),C("")}catch(i){m(i instanceof Error?i.message:"Failed to update budget")}finally{A(!1)}},P=async s=>{if(s.preventDefault(),!!u.userId){F(!0),p(null);try{const i={userId:u.userId,...u.keyAlias.trim()&&{keyAlias:u.keyAlias.trim()},...u.models.trim()&&{models:u.models.split(",").map(_=>_.trim()).filter(Boolean)},...u.maxBudget.trim()&&{maxBudget:parseFloat(u.maxBudget)}},W=await j.post("/admin/keys",i);w(W.key),f(!1),g({userId:a[0]?.id??"",models:"",maxBudget:"",keyAlias:""}),await h()}catch(i){p(i instanceof Error?i.message:"Failed to create key")}finally{F(!1)}}},R=s=>s<.01&&s>0?"$"+s.toFixed(4):"$"+s.toFixed(2),V=(s,i)=>s.length>i?s.slice(0,i)+"...":s;return d?e.jsx("div",{children:"Loading keys..."}):e.jsxs("div",{className:"admin-keys-tab",children:[L&&e.jsx("div",{className:"error-message",role:"alert",children:L}),E&&e.jsxs("div",{className:"admin-key-created-banner",children:[e.jsx("strong",{children:"New key created!"})," Copy it now — it won't be shown again:",e.jsx("code",{className:"admin-key-value",children:E}),e.jsx("button",{className:"btn-small btn-secondary",onClick:()=>{navigator.clipboard.writeText(E)},children:"Copy"}),e.jsx("button",{className:"btn-small btn-secondary",onClick:()=>w(null),children:"Dismiss"})]}),o&&e.jsx("div",{className:"error-message",role:"alert",children:o}),e.jsxs("div",{className:"admin-keys-toolbar",children:[e.jsx("input",{type:"text",placeholder:"Filter by user email...",value:N,onChange:s=>r(s.target.value),className:"admin-keys-search"}),e.jsx("button",{className:"btn-primary",onClick:()=>f(!0),children:"Create Key"})]}),$.length===0?e.jsx("div",{className:"admin-keys-empty",children:"No virtual keys found. Create one to get started."}):e.jsx("div",{className:"admin-users-table-wrapper",children:e.jsxs("table",{className:"admin-users-table admin-keys-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"User"}),e.jsx("th",{children:"Alias"}),e.jsx("th",{children:"Key Name"}),e.jsx("th",{children:"Spend"}),e.jsx("th",{children:"Budget"}),e.jsx("th",{children:"Models"}),e.jsx("th",{children:"Status"}),e.jsx("th",{children:"Actions"})]})}),e.jsx("tbody",{children:K.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:8,className:"admin-keys-empty",children:"No keys match your filter."})}):K.map(s=>e.jsxs("tr",{children:[e.jsx("td",{children:s.userEmail??"(unknown)"}),e.jsx("td",{children:s.keyAlias??"—"}),e.jsx("td",{children:e.jsx("span",{title:s.keyName,children:V(s.keyName,20)})}),e.jsx("td",{style:{fontFamily:"var(--font-mono)"},children:R(s.spend)}),e.jsx("td",{style:{fontFamily:"var(--font-mono)"},children:U===s.token?e.jsxs("div",{className:"inline-edit",children:[e.jsx("input",{type:"number",step:"0.01",min:"0",value:b,onChange:i=>C(i.target.value),autoFocus:!0}),e.jsx("button",{className:"btn-small btn-primary",disabled:I,onClick:()=>{O(s.token)},children:"Save"}),e.jsx("button",{className:"btn-small btn-secondary",onClick:()=>{S(null),C("")},children:"Cancel"})]}):s.maxBudget!=null?"$"+s.maxBudget.toFixed(2):"—"}),e.jsx("td",{children:e.jsx("span",{className:"models-cell",title:s.models.length>0?s.models.join(", "):"all",children:s.models.length>0?s.models.join(", "):"all"})}),e.jsx("td",{children:e.jsx("span",{className:`status-badge status-${s.status}`,children:l("common.status."+s.status)})}),e.jsx("td",{children:e.jsxs("div",{style:{display:"flex",gap:"0.25rem",flexWrap:"wrap"},children:[e.jsx("button",{className:"btn-small btn-secondary",onClick:()=>{S(s.token),C(s.maxBudget!=null?String(s.maxBudget):"")},children:"Edit Budget"}),e.jsx("button",{className:"btn-small btn-danger",disabled:s.status!=="active",onClick:()=>{D(s)},children:"Revoke"})]})})]},s.token))})]})}),c&&e.jsx("div",{className:"modal-overlay",onClick:()=>{f(!1),p(null)},children:e.jsxs("div",{className:"modal",role:"dialog","aria-modal":"true","aria-labelledby":"create-key-modal-title",onClick:s=>s.stopPropagation(),children:[e.jsx("h2",{id:"create-key-modal-title",children:"Create Virtual Key"}),e.jsxs("form",{onSubmit:s=>{P(s)},children:[e.jsxs("div",{className:"form-group",children:[e.jsx("label",{htmlFor:"key-user-select",children:"User *"}),e.jsx("select",{id:"key-user-select",value:u.userId,onChange:s=>g(i=>({...i,userId:s.target.value})),required:!0,children:a.map(s=>e.jsxs("option",{value:s.id,children:[s.email," (",s.displayName,")"]},s.id))})]}),e.jsxs("div",{className:"form-group",children:[e.jsx("label",{htmlFor:"key-alias-input",children:"Key Alias (optional)"}),e.jsx("input",{id:"key-alias-input",type:"text",value:u.keyAlias,onChange:s=>g(i=>({...i,keyAlias:s.target.value}))})]}),e.jsxs("div",{className:"form-group",children:[e.jsx("label",{htmlFor:"key-models-input",children:"Models (optional)"}),e.jsx("input",{id:"key-models-input",type:"text",placeholder:"e.g. gpt-4o, claude-3.5-sonnet (leave empty for all)",value:u.models,onChange:s=>g(i=>({...i,models:s.target.value}))})]}),e.jsxs("div",{className:"form-group",children:[e.jsx("label",{htmlFor:"key-budget-input",children:"Max Budget (optional)"}),e.jsx("input",{id:"key-budget-input",type:"number",step:"0.01",min:"0",placeholder:"No limit",value:u.maxBudget,onChange:s=>g(i=>({...i,maxBudget:s.target.value}))})]}),B&&e.jsx("div",{className:"error-message",role:"alert",children:B}),e.jsxs("div",{className:"modal-actions",children:[e.jsx("button",{type:"button",className:"btn-secondary",onClick:()=>{f(!1),p(null)},children:"Cancel"}),e.jsx("button",{type:"submit",className:"btn-primary",disabled:k,children:k?"Creating...":"Create Key"})]})]})]})})]})}const G="https://litellm-ui.aquaclaw.ai";function J(){const{t:a}=T();return e.jsxs("div",{style:{padding:"2rem",textAlign:"center"},children:[e.jsx("h3",{children:a("admin.litellm.title","LiteLLM Dashboard")}),e.jsx("p",{style:{color:"var(--color-text-secondary)",marginBottom:"1.5rem"},children:a("admin.litellm.description","Manage LLM models, API keys, and usage tracking in the LiteLLM admin dashboard.")}),e.jsxs("a",{href:G,target:"_blank",rel:"noopener noreferrer",style:{display:"inline-block",padding:"0.75rem 2rem",backgroundColor:"var(--color-primary)",color:"#fff",borderRadius:"8px",textDecoration:"none",fontWeight:500},children:[a("admin.litellm.openDashboard","Open LiteLLM Dashboard")," ↗"]})]})}function ee(){const{t:a}=T(),{user:l,logout:x}=q(),[n,d]=t.useState("overview"),[v,L]=t.useState(null),[y,N]=t.useState([]),[r,c]=t.useState(!0),[f,u]=t.useState(null),[g,B]=t.useState(null),[p,k]=t.useState(null),[F,E]=t.useState(""),[w,U]=t.useState(""),[S,b]=t.useState(null),[C,I]=t.useState(!1);t.useEffect(()=>{Promise.all([j.get("/admin/stats"),j.get("/admin/users"),j.get("/usage/admin").catch(()=>null)]).then(([o,m,h])=>{L(o),N(m),h&&B(h)}).catch(o=>u(o instanceof Error?o.message:a("admin.failedToLoad"))).finally(()=>c(!1))},[]);const A=async o=>{if(o.preventDefault(),!!p){I(!0),b(null);try{const m=w.trim()===""?null:parseFloat(w);if(m!==null&&(isNaN(m)||m<0)){b({type:"error",text:a("admin.budget.invalidBudget")});return}await j.put(`/admin/users/${p}/budget`,{usageLimitUsd:m}),b({type:"success",text:a("admin.budget.success",{email:F})}),g&&B({...g,perUserSpend:g.perUserSpend.map(h=>h.userId===p?{...h,usageLimitUsd:m}:h)}),setTimeout(()=>k(null),1500)}catch(m){b({type:"error",text:m instanceof Error?m.message:a("admin.budget.failed")})}finally{I(!1)}}};return r?e.jsx("div",{className:"admin-page",children:a("admin.loading")}):e.jsxs("main",{className:"admin-page",children:[e.jsxs("header",{className:"dashboard-header",children:[e.jsxs("div",{children:[e.jsx("h1",{children:a("admin.title")}),e.jsx(M,{to:"/",className:"admin-back-link",children:a("common.buttons.backToInstances")})]}),e.jsxs("div",{className:"dashboard-header-actions",children:[l&&e.jsx("span",{className:"user-greeting",children:a("admin.greeting",{name:l.displayName})}),e.jsx("button",{className:"btn-secondary",onClick:x,children:a("common.buttons.logout")})]})]}),f&&e.jsx("div",{className:"error-message",role:"alert",children:f}),e.jsxs("div",{className:"tabs",children:[e.jsx("button",{className:n==="overview"?"active":"",onClick:()=>d("overview"),children:"Overview"}),e.jsx("button",{className:n==="users"?"active":"",onClick:()=>d("users"),children:"Users"}),e.jsx("button",{className:n==="llm-keys"?"active":"",onClick:()=>d("llm-keys"),children:"LLM Keys"}),e.jsx("button",{className:n==="litellm-ui"?"active":"",onClick:()=>d("litellm-ui"),children:"LiteLLM UI"})]}),e.jsxs("div",{className:"tab-content",children:[n==="overview"&&e.jsx(H,{stats:v,usageData:g,onSetBudget:(o,m,h)=>{k(o),E(m),U(h!=null?String(h):""),b(null)}}),n==="users"&&e.jsx(Q,{users:y}),n==="llm-keys"&&e.jsx(z,{users:y}),n==="litellm-ui"&&e.jsx(J,{})]}),p&&e.jsx("div",{className:"modal-overlay",onClick:()=>k(null),children:e.jsxs("div",{className:"modal",role:"dialog","aria-modal":"true","aria-labelledby":"budget-modal-title",onClick:o=>o.stopPropagation(),children:[e.jsx("h2",{id:"budget-modal-title",children:a("admin.budget.title")}),e.jsx("p",{children:a("admin.budget.description",{email:F})}),e.jsxs("form",{onSubmit:A,children:[e.jsxs("div",{className:"form-group",children:[e.jsx("label",{children:a("admin.budget.limitLabel")}),e.jsx("input",{type:"number",step:"0.01",min:"0",placeholder:a("admin.budget.limitPlaceholder"),value:w,onChange:o=>U(o.target.value)})]}),S&&e.jsx("div",{className:S.type==="success"?"success-message":"error-message",role:"alert",children:S.text}),e.jsxs("div",{className:"modal-actions",children:[e.jsx("button",{type:"button",className:"btn-secondary",onClick:()=>k(null),children:a("common.buttons.cancel")}),e.jsx("button",{type:"submit",className:"btn-primary",disabled:C,children:a(C?"admin.budget.saving":"admin.budget.saveButton")})]})]})]})})]})}export{ee as AdminPage};
@@ -1 +1 @@
1
- import{c as o}from"./createLucideIcon-DiclDRFj.js";import{j as a}from"./index-CpykxeVP.js";import{P as m}from"./index-wWimwgy7.js";const d=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],j=o("plus",d),g={sm:"agent-avatar--sm",md:"agent-avatar--md",lg:"agent-avatar--lg"};function x({avatar:s,name:t,size:r="md",className:c}){const e=["agent-avatar",g[r],c].filter(Boolean).join(" ");if(s&&s.startsWith("preset:")){const l=s.slice(7),i=m[l];if(i)return a.jsx("div",{className:e,children:a.jsx("img",{className:"agent-avatar__img",src:i,alt:t})})}if(s&&s.startsWith("data:"))return a.jsx("div",{className:e,children:a.jsx("img",{className:"agent-avatar__img",src:s,alt:t})});const n=t.trim().charAt(0).toUpperCase()||"?";return a.jsx("div",{className:e,children:a.jsx("div",{className:"agent-avatar__fallback",children:n})})}export{x as A,j as P};
1
+ import{c as o}from"./createLucideIcon-BKz50_J5.js";import{j as a}from"./index-C9sOtm4z.js";import{P as m}from"./index-wWimwgy7.js";const d=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],j=o("plus",d),g={sm:"agent-avatar--sm",md:"agent-avatar--md",lg:"agent-avatar--lg"};function x({avatar:s,name:t,size:r="md",className:c}){const e=["agent-avatar",g[r],c].filter(Boolean).join(" ");if(s&&s.startsWith("preset:")){const l=s.slice(7),i=m[l];if(i)return a.jsx("div",{className:e,children:a.jsx("img",{className:"agent-avatar__img",src:i,alt:t})})}if(s&&s.startsWith("data:"))return a.jsx("div",{className:e,children:a.jsx("img",{className:"agent-avatar__img",src:s,alt:t})});const n=t.trim().charAt(0).toUpperCase()||"?";return a.jsx("div",{className:e,children:a.jsx("div",{className:"agent-avatar__fallback",children:n})})}export{x as A,j as P};
@@ -1 +1 @@
1
- import{a as S,u as M,j as e,r as n,b as L,c as z,O as $,s as A}from"./index-CpykxeVP.js";import{u as v}from"./useTranslation-BQrFEUB3.js";import{c as d}from"./createLucideIcon-DiclDRFj.js";import{M as R,B as O,Z as q}from"./zap-UlwwmN59.js";import{a as k}from"./api-B5psysvQ.js";const I=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],B=d("bell",I);const H=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],T=d("chevron-down",H);const U=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],D=d("chevron-left",U);const F=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],V=d("chevron-right",F);const G=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],K=d("chevron-up",G);const W=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Z=d("file-text",W);const P=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],Y=d("globe",P);const J=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],Q=d("layout-dashboard",J);const X=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],ee=d("menu",X);const ae=[["path",{d:"M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z",key:"1n2ejm"}],["path",{d:"M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1",key:"1qfcsi"}]],te=d("messages-square",ae);const se=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],ne=d("moon",se);const oe=[["path",{d:"M15 21v-5a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v5",key:"slp6dd"}],["path",{d:"M17.774 10.31a1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.451 0 1.12 1.12 0 0 0-1.548 0 2.5 2.5 0 0 1-3.452 0 1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.77-3.248l2.889-4.184A2 2 0 0 1 7 2h10a2 2 0 0 1 1.653.873l2.895 4.192a2.5 2.5 0 0 1-3.774 3.244",key:"o0xfot"}],["path",{d:"M4 10.95V19a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8.05",key:"wn3emo"}]],ie=d("store",oe);const ce=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],le=d("sun",ce);const re=[["path",{d:"M10 15H6a4 4 0 0 0-4 4v2",key:"1nfge6"}],["path",{d:"m14.305 16.53.923-.382",key:"1itpsq"}],["path",{d:"m15.228 13.852-.923-.383",key:"eplpkm"}],["path",{d:"m16.852 12.228-.383-.923",key:"13v3q0"}],["path",{d:"m16.852 17.772-.383.924",key:"1i8mnm"}],["path",{d:"m19.148 12.228.383-.923",key:"1q8j1v"}],["path",{d:"m19.53 18.696-.382-.924",key:"vk1qj3"}],["path",{d:"m20.772 13.852.924-.383",key:"n880s0"}],["path",{d:"m20.772 16.148.924.383",key:"1g6xey"}],["circle",{cx:"18",cy:"15",r:"3",key:"gjjjvw"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],de=d("user-cog",re),j=!1;function ue({isAdmin:t,onClose:h}){const{t:y}=v(),l=S(),{logout:p}=M(),r=o=>{l(o),h()};return e.jsxs("div",{className:"user-menu",role:"menu",children:[j,e.jsxs("div",{className:"user-menu__group",children:[e.jsxs("div",{className:"user-menu__group-label",children:[e.jsx(de,{size:14}),e.jsx("span",{children:y("sidebar.userGroup")})]}),e.jsx("button",{className:"user-menu__item",role:"menuitem",onClick:()=>r("/user/credentials"),children:y("sidebar.credentials")}),j]}),j,j]})}const me=!1;function he({collapsed:t,mobileOpen:h,onNavClick:y}){const{t:l}=v(),{user:p,isAdmin:r}=M(),[o,b]=n.useState(!1),f=n.useRef(null),g=[{to:"/",icon:R,label:l("sidebar.chat")},{to:"/group-chats",icon:te,label:l("sidebar.groupChats")},{to:"/dashboard",icon:Q,label:l("sidebar.dashboard")},{to:"/templates",icon:ie,label:l("sidebar.skills")},{to:"/assistants",icon:O,label:l("sidebar.assistants")}];return n.useEffect(()=>{function i(x){f.current&&!f.current.contains(x.target)&&b(!1)}if(o)return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[o]),e.jsxs("aside",{className:`sidebar${t?" sidebar--collapsed":""}${h?" sidebar--mobile-open":""}`,ref:f,children:[e.jsxs("div",{className:"sidebar__logo",children:[e.jsx("div",{className:"sidebar__logo-icon",children:e.jsx(q,{size:20})}),!t&&e.jsxs("div",{className:"sidebar__logo-text",children:[e.jsx("span",{className:"sidebar__logo-name",children:"OpenClaw"}),e.jsx("span",{className:"sidebar__logo-subtitle",children:"Platform"})]})]}),e.jsx("nav",{className:"sidebar__nav",children:g.map(i=>e.jsxs(L,{to:i.to,end:i.to==="/",className:({isActive:x})=>`sidebar__nav-item ${x?"sidebar__nav-item--active":""}`,onClick:()=>y?.(),children:[e.jsx(i.icon,{size:20}),!t&&e.jsx("span",{children:i.label})]},i.to))}),e.jsx("div",{className:"sidebar__spacer"}),me,!t&&e.jsx("div",{className:"sidebar__edition-badge",children:e.jsx("span",{children:l("sidebar.communityEdition")})}),e.jsxs("button",{type:"button",className:"sidebar__user",onClick:()=>b(i=>!i),"aria-expanded":o,"aria-haspopup":"true",children:[e.jsx("div",{className:"sidebar__user-avatar",children:p?.displayName?.charAt(0)?.toUpperCase()??"?"}),!t&&e.jsxs("div",{className:"sidebar__user-info",children:[e.jsx("span",{className:"sidebar__user-name",children:p?.displayName??"User"}),e.jsx("span",{className:"sidebar__user-email",children:p?.email??""})]}),!t&&e.jsx("span",{className:"sidebar__user-chevron",children:o?e.jsx(K,{size:16}):e.jsx(T,{size:16})})]}),o&&!t&&e.jsx(ue,{isAdmin:r,onClose:()=>b(!1)})]})}function pe(t){switch(t){case"critical":return"🔴";case"warn":return"⚠️";case"info":return"ℹ️";default:return"🔔"}}function fe(){const{t}=v(),{addHandler:h,removeHandler:y}=z(),[l,p]=n.useState([]),[r,o]=n.useState(0),[b,f]=n.useState(!1),[g,i]=n.useState(!1),x=n.useRef(null),N=n.useCallback(a=>{const c=Date.now()-new Date(a).getTime(),m=Math.floor(c/6e4);if(m<1)return t("common.time.justNow");if(m<60)return t("common.time.minutesAgo",{count:m});const w=Math.floor(m/60);if(w<24)return t("common.time.hoursAgo",{count:w});const E=Math.floor(w/24);return t("common.time.daysAgo",{count:E})},[t]);n.useEffect(()=>{k.get("/notifications?limit=20").then(a=>p(a.items)).catch(a=>{console.error("[NotificationBell] Failed to load notifications:",a)}),k.get("/notifications/unread-count").then(a=>o(a.count)).catch(a=>{console.error("[NotificationBell] Failed to load unread count:",a)})},[]);const _=n.useCallback(a=>{const c=a.payload;c?.notification&&(p(m=>[c.notification,...m].slice(0,20)),o(m=>m+1))},[]);n.useEffect(()=>(h("notification",_),()=>y("notification",_)),[h,y,_]),n.useEffect(()=>{function a(c){x.current&&!x.current.contains(c.target)&&f(!1)}if(b)return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)},[b]);const s=async()=>{i(!0);try{await k.post("/notifications/read-all"),p(a=>a.map(c=>({...c,isRead:!0}))),o(0)}catch(a){console.error("[NotificationBell] Failed to mark all as read:",a)}finally{i(!1)}},u=async a=>{try{await k.post(`/notifications/${a}/read`),p(c=>c.map(m=>m.id===a?{...m,isRead:!0}:m)),o(c=>Math.max(0,c-1))}catch(c){console.error("[NotificationBell] Failed to mark notification as read:",c)}};return e.jsxs("div",{className:"notification-bell",ref:x,children:[e.jsxs("button",{className:"notification-bell-button",onClick:()=>f(a=>!a),"aria-label":r>0?t("notifications.buttonLabelWithCount",{count:r}):t("notifications.buttonLabel"),children:[e.jsx(B,{size:18}),r>0&&e.jsx("span",{className:"notification-badge",children:r>99?t("notifications.unreadBadge"):r})]}),b&&e.jsxs("div",{className:"notification-dropdown",children:[e.jsxs("div",{className:"notification-dropdown-header",children:[e.jsx("span",{className:"notification-dropdown-title",children:t("notifications.title")}),r>0&&e.jsx("button",{className:"notification-mark-all-btn",onClick:s,disabled:g,children:t("notifications.markAllRead")})]}),e.jsx("div",{className:"notification-dropdown-list",children:l.length===0?e.jsx("div",{className:"notification-empty",children:t("notifications.empty")}):l.map(a=>e.jsxs("div",{className:`notification-item ${a.isRead?"":"notification-item--unread"}`,onClick:()=>!a.isRead&&u(a.id),role:"button",tabIndex:0,onKeyDown:c=>{c.key==="Enter"&&!a.isRead&&u(a.id)},children:[e.jsx("span",{className:"notification-item-icon",children:pe(a.severity)}),e.jsxs("div",{className:"notification-item-content",children:[e.jsx("span",{className:"notification-item-title",children:a.title}),e.jsx("span",{className:"notification-item-time",children:N(a.createdAt)})]})]},a.id))})]})]})}const C="openclaw-theme";function be(){const t=localStorage.getItem(C);return t==="dark"||t==="light"?t:"light"}function je(){const{i18n:t}=v(),[h,y]=n.useState(()=>localStorage.getItem("sidebar-collapsed")==="true"),[l,p]=n.useState(be),[r,o]=n.useState(!1),[b,f]=n.useState(!1),g=n.useRef(null),i=n.useCallback(s=>{document.documentElement.classList.toggle("dark",s==="dark"),localStorage.setItem(C,s)},[]);n.useEffect(()=>{i(l)},[l,i]),n.useEffect(()=>{if(!r)return;function s(u){g.current&&!g.current.contains(u.target)&&o(!1)}return document.addEventListener("mousedown",s),()=>document.removeEventListener("mousedown",s)},[r]),n.useEffect(()=>{const s=window.matchMedia("(max-width: 768px)");function u(){s.matches||f(!1)}return s.addEventListener("change",u),()=>s.removeEventListener("change",u)},[]);const x=()=>{y(s=>{const u=!s;return localStorage.setItem("sidebar-collapsed",String(u)),u})},N=s=>{t.changeLanguage(s),o(!1)},_=t.language?.substring(0,2)||"en";return e.jsxs("div",{className:`app-layout${h?" app-layout--sidebar-collapsed":""}`,children:[b&&e.jsx("div",{className:"app-layout__backdrop",onClick:()=>f(!1)}),e.jsx(he,{collapsed:h,mobileOpen:b,onNavClick:()=>f(!1)}),e.jsx("button",{type:"button",className:"app-layout__hamburger",onClick:()=>f(s=>!s),"aria-label":"Toggle menu",children:e.jsx(ee,{size:20})}),e.jsx("button",{type:"button",className:"app-layout__toggle",onClick:x,"aria-label":h?"Expand sidebar":"Collapse sidebar",children:h?e.jsx(V,{size:16}):e.jsx(D,{size:16})}),e.jsx("main",{className:"app-layout__content",children:e.jsx($,{})}),e.jsxs("div",{className:"app-layout__fab",children:[e.jsx(fe,{}),e.jsx("button",{className:"app-layout__fab-btn",onClick:()=>window.open("/docs","_blank"),children:e.jsx(Z,{size:18})}),e.jsxs("div",{className:"app-layout__lang-wrap",ref:g,children:[r&&e.jsx("div",{className:"app-layout__lang-menu",children:Object.entries(A).map(([s,{flag:u,label:a}])=>e.jsxs("button",{className:`app-layout__lang-item${s===_?" app-layout__lang-item--active":""}`,onClick:()=>N(s),children:[e.jsx("span",{children:u}),e.jsx("span",{children:a})]},s))}),e.jsx("button",{className:"app-layout__fab-btn",onClick:()=>o(s=>!s),children:e.jsx(Y,{size:18})})]}),e.jsx("button",{className:"app-layout__fab-btn",onClick:()=>p(s=>s==="light"?"dark":"light"),children:l==="light"?e.jsx(ne,{size:18}):e.jsx(le,{size:18})})]})]})}export{je as AppLayout};
1
+ import{a as S,u as M,j as e,r as n,b as L,c as z,O as $,s as A}from"./index-C9sOtm4z.js";import{u as v}from"./useTranslation-CzQ7UCmK.js";import{c as d}from"./createLucideIcon-BKz50_J5.js";import{M as R,B as O,Z as q}from"./zap-ul3pxAHa.js";import{a as k}from"./api-B5psysvQ.js";const I=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],B=d("bell",I);const H=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],T=d("chevron-down",H);const U=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],D=d("chevron-left",U);const F=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],V=d("chevron-right",F);const G=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],K=d("chevron-up",G);const W=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Z=d("file-text",W);const P=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],Y=d("globe",P);const J=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],Q=d("layout-dashboard",J);const X=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],ee=d("menu",X);const ae=[["path",{d:"M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z",key:"1n2ejm"}],["path",{d:"M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1",key:"1qfcsi"}]],te=d("messages-square",ae);const se=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],ne=d("moon",se);const oe=[["path",{d:"M15 21v-5a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v5",key:"slp6dd"}],["path",{d:"M17.774 10.31a1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.451 0 1.12 1.12 0 0 0-1.548 0 2.5 2.5 0 0 1-3.452 0 1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.77-3.248l2.889-4.184A2 2 0 0 1 7 2h10a2 2 0 0 1 1.653.873l2.895 4.192a2.5 2.5 0 0 1-3.774 3.244",key:"o0xfot"}],["path",{d:"M4 10.95V19a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8.05",key:"wn3emo"}]],ie=d("store",oe);const ce=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],le=d("sun",ce);const re=[["path",{d:"M10 15H6a4 4 0 0 0-4 4v2",key:"1nfge6"}],["path",{d:"m14.305 16.53.923-.382",key:"1itpsq"}],["path",{d:"m15.228 13.852-.923-.383",key:"eplpkm"}],["path",{d:"m16.852 12.228-.383-.923",key:"13v3q0"}],["path",{d:"m16.852 17.772-.383.924",key:"1i8mnm"}],["path",{d:"m19.148 12.228.383-.923",key:"1q8j1v"}],["path",{d:"m19.53 18.696-.382-.924",key:"vk1qj3"}],["path",{d:"m20.772 13.852.924-.383",key:"n880s0"}],["path",{d:"m20.772 16.148.924.383",key:"1g6xey"}],["circle",{cx:"18",cy:"15",r:"3",key:"gjjjvw"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],de=d("user-cog",re),j=!1;function ue({isAdmin:t,onClose:h}){const{t:y}=v(),l=S(),{logout:p}=M(),r=o=>{l(o),h()};return e.jsxs("div",{className:"user-menu",role:"menu",children:[j,e.jsxs("div",{className:"user-menu__group",children:[e.jsxs("div",{className:"user-menu__group-label",children:[e.jsx(de,{size:14}),e.jsx("span",{children:y("sidebar.userGroup")})]}),e.jsx("button",{className:"user-menu__item",role:"menuitem",onClick:()=>r("/user/credentials"),children:y("sidebar.credentials")}),j]}),j,j]})}const me=!1;function he({collapsed:t,mobileOpen:h,onNavClick:y}){const{t:l}=v(),{user:p,isAdmin:r}=M(),[o,b]=n.useState(!1),f=n.useRef(null),g=[{to:"/",icon:R,label:l("sidebar.chat")},{to:"/group-chats",icon:te,label:l("sidebar.groupChats")},{to:"/dashboard",icon:Q,label:l("sidebar.dashboard")},{to:"/templates",icon:ie,label:l("sidebar.skills")},{to:"/assistants",icon:O,label:l("sidebar.assistants")}];return n.useEffect(()=>{function i(x){f.current&&!f.current.contains(x.target)&&b(!1)}if(o)return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[o]),e.jsxs("aside",{className:`sidebar${t?" sidebar--collapsed":""}${h?" sidebar--mobile-open":""}`,ref:f,children:[e.jsxs("div",{className:"sidebar__logo",children:[e.jsx("div",{className:"sidebar__logo-icon",children:e.jsx(q,{size:20})}),!t&&e.jsxs("div",{className:"sidebar__logo-text",children:[e.jsx("span",{className:"sidebar__logo-name",children:"OpenClaw"}),e.jsx("span",{className:"sidebar__logo-subtitle",children:"Platform"})]})]}),e.jsx("nav",{className:"sidebar__nav",children:g.map(i=>e.jsxs(L,{to:i.to,end:i.to==="/",className:({isActive:x})=>`sidebar__nav-item ${x?"sidebar__nav-item--active":""}`,onClick:()=>y?.(),children:[e.jsx(i.icon,{size:20}),!t&&e.jsx("span",{children:i.label})]},i.to))}),e.jsx("div",{className:"sidebar__spacer"}),me,!t&&e.jsx("div",{className:"sidebar__edition-badge",children:e.jsx("span",{children:l("sidebar.communityEdition")})}),e.jsxs("button",{type:"button",className:"sidebar__user",onClick:()=>b(i=>!i),"aria-expanded":o,"aria-haspopup":"true",children:[e.jsx("div",{className:"sidebar__user-avatar",children:p?.displayName?.charAt(0)?.toUpperCase()??"?"}),!t&&e.jsxs("div",{className:"sidebar__user-info",children:[e.jsx("span",{className:"sidebar__user-name",children:p?.displayName??"User"}),e.jsx("span",{className:"sidebar__user-email",children:p?.email??""})]}),!t&&e.jsx("span",{className:"sidebar__user-chevron",children:o?e.jsx(K,{size:16}):e.jsx(T,{size:16})})]}),o&&!t&&e.jsx(ue,{isAdmin:r,onClose:()=>b(!1)})]})}function pe(t){switch(t){case"critical":return"🔴";case"warn":return"⚠️";case"info":return"ℹ️";default:return"🔔"}}function fe(){const{t}=v(),{addHandler:h,removeHandler:y}=z(),[l,p]=n.useState([]),[r,o]=n.useState(0),[b,f]=n.useState(!1),[g,i]=n.useState(!1),x=n.useRef(null),N=n.useCallback(a=>{const c=Date.now()-new Date(a).getTime(),m=Math.floor(c/6e4);if(m<1)return t("common.time.justNow");if(m<60)return t("common.time.minutesAgo",{count:m});const w=Math.floor(m/60);if(w<24)return t("common.time.hoursAgo",{count:w});const E=Math.floor(w/24);return t("common.time.daysAgo",{count:E})},[t]);n.useEffect(()=>{k.get("/notifications?limit=20").then(a=>p(a.items)).catch(a=>{console.error("[NotificationBell] Failed to load notifications:",a)}),k.get("/notifications/unread-count").then(a=>o(a.count)).catch(a=>{console.error("[NotificationBell] Failed to load unread count:",a)})},[]);const _=n.useCallback(a=>{const c=a.payload;c?.notification&&(p(m=>[c.notification,...m].slice(0,20)),o(m=>m+1))},[]);n.useEffect(()=>(h("notification",_),()=>y("notification",_)),[h,y,_]),n.useEffect(()=>{function a(c){x.current&&!x.current.contains(c.target)&&f(!1)}if(b)return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)},[b]);const s=async()=>{i(!0);try{await k.post("/notifications/read-all"),p(a=>a.map(c=>({...c,isRead:!0}))),o(0)}catch(a){console.error("[NotificationBell] Failed to mark all as read:",a)}finally{i(!1)}},u=async a=>{try{await k.post(`/notifications/${a}/read`),p(c=>c.map(m=>m.id===a?{...m,isRead:!0}:m)),o(c=>Math.max(0,c-1))}catch(c){console.error("[NotificationBell] Failed to mark notification as read:",c)}};return e.jsxs("div",{className:"notification-bell",ref:x,children:[e.jsxs("button",{className:"notification-bell-button",onClick:()=>f(a=>!a),"aria-label":r>0?t("notifications.buttonLabelWithCount",{count:r}):t("notifications.buttonLabel"),children:[e.jsx(B,{size:18}),r>0&&e.jsx("span",{className:"notification-badge",children:r>99?t("notifications.unreadBadge"):r})]}),b&&e.jsxs("div",{className:"notification-dropdown",children:[e.jsxs("div",{className:"notification-dropdown-header",children:[e.jsx("span",{className:"notification-dropdown-title",children:t("notifications.title")}),r>0&&e.jsx("button",{className:"notification-mark-all-btn",onClick:s,disabled:g,children:t("notifications.markAllRead")})]}),e.jsx("div",{className:"notification-dropdown-list",children:l.length===0?e.jsx("div",{className:"notification-empty",children:t("notifications.empty")}):l.map(a=>e.jsxs("div",{className:`notification-item ${a.isRead?"":"notification-item--unread"}`,onClick:()=>!a.isRead&&u(a.id),role:"button",tabIndex:0,onKeyDown:c=>{c.key==="Enter"&&!a.isRead&&u(a.id)},children:[e.jsx("span",{className:"notification-item-icon",children:pe(a.severity)}),e.jsxs("div",{className:"notification-item-content",children:[e.jsx("span",{className:"notification-item-title",children:a.title}),e.jsx("span",{className:"notification-item-time",children:N(a.createdAt)})]})]},a.id))})]})]})}const C="openclaw-theme";function be(){const t=localStorage.getItem(C);return t==="dark"||t==="light"?t:"light"}function je(){const{i18n:t}=v(),[h,y]=n.useState(()=>localStorage.getItem("sidebar-collapsed")==="true"),[l,p]=n.useState(be),[r,o]=n.useState(!1),[b,f]=n.useState(!1),g=n.useRef(null),i=n.useCallback(s=>{document.documentElement.classList.toggle("dark",s==="dark"),localStorage.setItem(C,s)},[]);n.useEffect(()=>{i(l)},[l,i]),n.useEffect(()=>{if(!r)return;function s(u){g.current&&!g.current.contains(u.target)&&o(!1)}return document.addEventListener("mousedown",s),()=>document.removeEventListener("mousedown",s)},[r]),n.useEffect(()=>{const s=window.matchMedia("(max-width: 768px)");function u(){s.matches||f(!1)}return s.addEventListener("change",u),()=>s.removeEventListener("change",u)},[]);const x=()=>{y(s=>{const u=!s;return localStorage.setItem("sidebar-collapsed",String(u)),u})},N=s=>{t.changeLanguage(s),o(!1)},_=t.language?.substring(0,2)||"en";return e.jsxs("div",{className:`app-layout${h?" app-layout--sidebar-collapsed":""}`,children:[b&&e.jsx("div",{className:"app-layout__backdrop",onClick:()=>f(!1)}),e.jsx(he,{collapsed:h,mobileOpen:b,onNavClick:()=>f(!1)}),e.jsx("button",{type:"button",className:"app-layout__hamburger",onClick:()=>f(s=>!s),"aria-label":"Toggle menu",children:e.jsx(ee,{size:20})}),e.jsx("button",{type:"button",className:"app-layout__toggle",onClick:x,"aria-label":h?"Expand sidebar":"Collapse sidebar",children:h?e.jsx(V,{size:16}):e.jsx(D,{size:16})}),e.jsx("main",{className:"app-layout__content",children:e.jsx($,{})}),e.jsxs("div",{className:"app-layout__fab",children:[e.jsx(fe,{}),e.jsx("button",{className:"app-layout__fab-btn",onClick:()=>window.open("/docs","_blank"),children:e.jsx(Z,{size:18})}),e.jsxs("div",{className:"app-layout__lang-wrap",ref:g,children:[r&&e.jsx("div",{className:"app-layout__lang-menu",children:Object.entries(A).map(([s,{flag:u,label:a}])=>e.jsxs("button",{className:`app-layout__lang-item${s===_?" app-layout__lang-item--active":""}`,onClick:()=>N(s),children:[e.jsx("span",{children:u}),e.jsx("span",{children:a})]},s))}),e.jsx("button",{className:"app-layout__fab-btn",onClick:()=>o(s=>!s),children:e.jsx(Y,{size:18})})]}),e.jsx("button",{className:"app-layout__fab-btn",onClick:()=>p(s=>s==="light"?"dark":"light"),children:l==="light"?e.jsx(ne,{size:18}):e.jsx(le,{size:18})})]})]})}export{je as AppLayout};
@@ -0,0 +1,6 @@
1
+ import{j as e,f as ze,a as Ve,c as qe,r}from"./index-C9sOtm4z.js";import{a as q}from"./api-B5psysvQ.js";import{r as L,S as Xe}from"./SessionDrawer-Dij8nH2w.js";import{A as Ge,i as F,M as Ye,a as _e,F as Ze}from"./types-sXe6mpk9.js";import{u as Ce}from"./useTranslation-CzQ7UCmK.js";/* empty css */function Je(s,n){if(!n)return null;switch(s){case"timeout":case"auth":case"quota":return{path:`/instances/${n}`,i18nKey:"chat.error.action.goToCredentials"};case"gateway":return{path:`/instances/${n}`,i18nKey:"chat.error.action.goToOverview"};case"model":return{i18nKey:"chat.error.action.openSettings"};default:return null}}function Qe({errorMessage:s,category:n,onRetry:u,onDismiss:f,onNavigate:p,onOpenSettings:M,instanceId:R,retrying:S}){const{t:j}=Ce(),k=Je(n,R),m=j(`chat.error.title.${n}`),B=n==="unknown"?s:j(`chat.error.description.${n}`),X=j(`chat.error.suggestion.${n}`);return e.jsxs("div",{className:"achat-error-banner",children:[e.jsxs("div",{className:"achat-error-banner__header",children:[e.jsxs("span",{className:"achat-error-banner__title",children:[e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:[e.jsx("path",{d:"M7 1L1 13h12L7 1z",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M7 5.5v3",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("circle",{cx:"7",cy:"10.5",r:"0.5",fill:"currentColor"})]}),m]}),e.jsx("button",{className:"achat-error-banner__dismiss",onClick:f,"aria-label":j("chat.error.action.dismiss"),children:"×"})]}),e.jsx("div",{className:"achat-error-banner__body",children:B}),e.jsx("div",{className:"achat-error-banner__suggestion",children:X}),e.jsxs("div",{className:"achat-error-banner__actions",children:[u&&e.jsx("button",{className:"achat-error-banner__retry",onClick:u,disabled:S,children:j(S?"chat.error.action.retrying":"chat.error.action.retry")}),k&&k.path&&p&&e.jsx("button",{className:"achat-error-banner__link",onClick:()=>p(k.path),children:j(k.i18nKey)}),k&&!k.path&&M&&e.jsx("button",{className:"achat-error-banner__link",onClick:M,children:j(k.i18nKey)})]})]})}const et=[{pattern:/timed?\s*out|timeout|no response|deadline exceeded/i,category:"timeout"},{pattern:/auth|unauthorized|401|invalid.*key|api.?key|credential|forbidden|403/i,category:"auth"},{pattern:/quota|rate.?limit|429|insufficient.*funds|billing|balance|limit exceeded/i,category:"quota"},{pattern:/model.*not.*found|model.*unavailable|unsupported.*model|does not exist/i,category:"model"},{pattern:/gateway|connect|ECONNREFUSED|ECONNRESET|socket|relay|not ready/i,category:"gateway"}];function ie(s){for(const{pattern:n,category:u}of et)if(n.test(s))return u;return"unknown"}function $(s){const n=/\[\[\s*(?:reply_to_current|reply_to\s*:\s*[^\]\n]+)\s*\]\]/gi;if(typeof s=="string")return s.replace(n,"").trim();if(Array.isArray(s)){const u=[];for(const f of s){if(!f||typeof f!="object")continue;const p=f;(p.type==="text"||p.type==="output_text"||p.type==="input_text")&&typeof p.text=="string"&&u.push(p.text)}return u.join(`
2
+ `).replace(n,"").trim()}if(s&&typeof s=="object"){const u=s;if(typeof u.text=="string")return u.text.replace(n,"").trim();if(typeof u.content=="string")return u.content.replace(n,"").trim();if(Array.isArray(u.content))return $(u.content)}return""}function tt(s){return s.includes("spreadsheet")||s.includes("ms-excel")?"XLS":s.includes("wordprocessingml")||s.includes("msword")?"DOC":s==="application/pdf"?"PDF":"FILE"}function st(s){return s?new Date(s).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):""}function Se(s){return Array.isArray(s)?s.some(n=>n&&typeof n=="object"&&n.type==="image"&&(n.content||n.source?.data)):!1}function oe(s,n){if(n.size===0)return s;let u=0;return s.map(f=>{if(f.role!=="user")return f;const p=n.get(u);return u++,p&&!Se(f.content)?{...f,content:p}:f})}function lt(){const{id:s}=ze(),{t:n}=Ce(),u=Ve(),{subscribe:f,unsubscribe:p,addHandler:M,removeHandler:R,isConnected:S,subscribeChatSession:j,unsubscribeChatSession:k}=qe(),[m,B]=r.useState(null),[X,Ne]=r.useState(!0),[G,A]=r.useState([]),[H,ce]=r.useState(""),[le,T]=r.useState(!1),[E,v]=r.useState(null),[I,w]=r.useState(null),[ue,he]=r.useState([]),b=r.useRef(null),Y=r.useRef(new Set),W=r.useRef(new Map),h=r.useRef(null),de=r.useRef(null),Z=r.useRef(null),[J,Le]=r.useState(!0),[Me,ge]=r.useState(!1),Q=`chat-session-${s}`,[l,me]=r.useState(()=>localStorage.getItem(Q)||`chat-${Date.now()}`),[ee,fe]=r.useState(null),[te,se]=r.useState(!1),[Te,Ee]=r.useState(0),[D,ne]=r.useState([]),pe=r.useRef(null),P=r.useCallback(t=>{if(!t||t.length===0)return;if(D.length+t.length>5){v({message:n("chat.attachments.maxReached"),category:"unknown",timestamp:Date.now()});return}Array.from(t).forEach(i=>{if(!Ge.has(i.type)){v({message:n("chat.attachments.invalidType"),category:"unknown",timestamp:Date.now()});return}const o=F(i.type)?5*1024*1024:Ye;if(i.size>o){v({message:n("chat.attachments.tooLarge"),category:"unknown",timestamp:Date.now()});return}const N=new FileReader;N.onload=c=>{const d=c.target?.result,x=d.split(",")[1];ne(g=>[...g,{id:crypto.randomUUID(),type:i.type,data:x,preview:d,name:i.name}])},N.readAsDataURL(i)})},[D.length,n]),De=r.useCallback(t=>{t.clipboardData.files.length>0&&(t.preventDefault(),P(t.clipboardData.files))},[P]),Re=r.useCallback(t=>{t.preventDefault(),t.stopPropagation(),t.dataTransfer.files.length>0&&P(t.dataTransfer.files)},[P]),Ae=r.useCallback(t=>{ne(a=>a.filter(i=>i.id!==t))},[]),[z,V]=r.useState(!1),[xe,ve]=r.useState(""),[ye,je]=r.useState(""),[be,ke]=r.useState(!1),[Ie,U]=r.useState([]);r.useEffect(()=>{if(m?.status!=="running"){U([]);return}s&&(m.billingMode==="platform"?q.get("/litellm/models").then(t=>U(t.models)).catch(()=>U([])):L(s,"models.list",{}).then(t=>{const a=(t.models??[]).map(i=>i.id??i.name).filter(i=>!!i);U(a)}).catch(()=>U([])))},[s,m?.status,m?.billingMode]);const We=Ie,y=I!==null||le;r.useEffect(()=>()=>{h.current&&(clearTimeout(h.current),h.current=null)},[]),r.useEffect(()=>{localStorage.setItem(Q,l)},[Q,l]),r.useEffect(()=>{s&&q.get(`/instances/${s}`).then(t=>{B(t),q.get(`/agent-types/${t.agentType}`).then(a=>{const i=a.wizard?.chatSuggestions??[];he(i)}).catch(()=>he([]))}).catch(()=>B(null)).finally(()=>Ne(!1))},[s]),r.useEffect(()=>{if(s)return f(s),()=>p(s)},[s,f,p]),r.useEffect(()=>{if(s)return j(s,l),()=>k(s,l)},[s,l,j,k]),r.useEffect(()=>{if(!s)return;const t=a=>{if(a.instanceId!==s)return;const i=a.payload;i.status&&B(o=>o?{...o,status:i.status,statusMessage:i.statusMessage??null}:null)};return M("instance:status",t),()=>R("instance:status",t)},[s,M,R]);const O=r.useCallback(async()=>{if(!(!s||m?.status!=="running"))try{const t=await L(s,"chat.history",{sessionKey:l,limit:50});if(t.messages){const a=t.messages.filter(i=>i.role==="user"?!0:i.role==="tool"?!1:$(i.content).length>0).map(i=>({role:i.role==="user"?"user":"agent",content:i.content,timestamp:i.timestamp?new Date(i.timestamp).toISOString():void 0}));A(()=>oe(a,W.current))}}catch{}},[s,m?.status,l]);r.useEffect(()=>{let t=!1;if(!(!s||m?.status!=="running"))return L(s,"chat.history",{sessionKey:l,limit:50}).then(a=>{if(t||!a.messages)return;const i=a.messages.filter(o=>o.role==="user"?!0:o.role==="tool"?!1:$(o.content).length>0).map(o=>({role:o.role==="user"?"user":"agent",content:o.content,timestamp:o.timestamp?new Date(o.timestamp).toISOString():void 0}));A(()=>oe(i,W.current))}).catch(()=>{}),()=>{t=!0}},[s,m?.status,l]);const ae=r.useRef(S);r.useEffect(()=>{if(!S||ae.current||!s||m?.status!=="running"){ae.current=S;return}ae.current=S;let t=!1;return L(s,"chat.history",{sessionKey:l,limit:50}).then(a=>{if(t||!a.messages)return;const i=a.messages.filter(o=>o.role==="user"?!0:o.role==="tool"?!1:$(o.content).length>0).map(o=>({role:o.role==="user"?"user":"agent",content:o.content,timestamp:o.timestamp?new Date(o.timestamp).toISOString():void 0}));A(()=>oe(i,W.current))}).catch(()=>{}),()=>{t=!0}},[S,s,m?.status,l]),r.useEffect(()=>{if(!s||m?.status!=="running")return;const t=a=>{if(a.instanceId!==s)return;const i=a.payload;if(!i.event||!i.data)return;const{event:o,data:N}=i;if(o==="chat"){const c=N,d=c.sessionKey??"";if(d!==l&&!l.endsWith(d)&&!d.endsWith(l)||c.runId&&Y.current.has(c.runId))return;if(c.state==="delta"){h.current&&(clearTimeout(h.current),h.current=null);const x=$(c.content??c.message);x&&w(g=>!g||x.length>=g.length?x:g)}else if(c.state==="final")h.current&&(clearTimeout(h.current),h.current=null),w(null),b.current=null,T(!1),O();else if(c.state==="aborted")h.current&&(clearTimeout(h.current),h.current=null),w(null),b.current=null,T(!1);else if(c.state==="error"){h.current&&(clearTimeout(h.current),h.current=null),w(null),b.current=null,T(!1);const x=c.errorMessage??n("chat.chatError");v({message:x,category:ie(x),timestamp:Date.now()})}}};return M("instance:gateway_event",t),()=>R("instance:gateway_event",t)},[s,m?.status,l,M,R,O,n]);const $e=r.useCallback(()=>{const t=`chat-${Date.now()}`;return y||(me(t),A([]),W.current=new Map,w(null),b.current=null,v(null)),t},[y]),Be=r.useCallback(t=>{y||(me(t),A([]),W.current=new Map,w(null),b.current=null,v(null),window.innerWidth<768&&se(!1))},[y]),Pe=r.useCallback((t,a)=>{const i=$(t);navigator.clipboard.writeText(i),fe(a),setTimeout(()=>fe(o=>o===a?null:o),2e3)},[]);r.useEffect(()=>{z&&s&&L(s,"sessions.list",{limit:50,includeGlobal:!0}).then(t=>{const a=t.sessions?.find(i=>i.key===l);a&&(ve(a.model||""),je(a.thinkingLevel||""))}).catch(()=>{})},[z,s,l]);const Ue=async()=>{if(s){ke(!0);try{await L(s,"sessions.patch",{key:l,model:xe||null,thinkingLevel:ye||null}),V(!1)}catch(t){const a=t instanceof Error?t.message:n("chat.failedToUpdateSettings");v({message:a,category:ie(a),timestamp:Date.now()})}finally{ke(!1)}}},K=async t=>{const a=(t??H).trim();if(!a&&D.length===0||y||!s)return;ce("");const i=[...D];ne([]),v(null);let o=a;if(i.length>0){const c=[];a&&c.push({type:"text",text:a}),i.forEach(d=>{c.push({type:F(d.type)?"image":"file",mimeType:d.type,content:d.data,fileName:d.name})}),o=c}A(c=>{if(Se(o)){const d=c.filter(x=>x.role==="user").length;W.current.set(d,o)}return[...c,{role:"user",content:o,timestamp:new Date().toISOString()}]}),T(!0);const N=crypto.randomUUID();b.current=N,w("");try{const c=i.filter(g=>!F(g.type)),d=new Map;c.length>0&&s&&await Promise.all(c.map(async g=>{const C=await q.uploadFile(s,g.name,g.data,g.type);d.set(g.id,C.path)}));const x={sessionKey:l,message:a,idempotencyKey:N};if(d.size>0){const g=Array.from(d.values()).map(C=>`- ${C}`).join(`
3
+ `);x.message=`[Uploaded files to workspace:
4
+ ${g}]
5
+
6
+ ${a}`}if(i.length>0){const g=i.filter(C=>F(C.type)).map(C=>({type:"image",mimeType:C.type,content:C.data,fileName:C.name}));g.length>0&&(x.attachments=g)}await L(s,"chat.send",x),Ee(g=>g+1),h.current=setTimeout(()=>{h.current=null,b.current===N&&(v({message:n("chat.noResponseError"),category:"timeout",lastUserMessage:a,timestamp:Date.now()}),T(!1),w(null),b.current=null)},6e4)}catch(c){const d=c instanceof Error?c.message:n("chat.failedToSend");v({message:d,category:ie(d),lastUserMessage:a,timestamp:Date.now()}),T(!1),w(null),b.current=null}},we=r.useCallback(()=>{h.current&&(clearTimeout(h.current),h.current=null),T(!1),w(null);const t=b.current;b.current=null,t&&(Y.current.add(t),setTimeout(()=>Y.current.delete(t),2e3)),s&&L(s,"chat.abort",t?{sessionKey:l,runId:t}:{sessionKey:l}).catch(()=>{}),O()},[s,l,O]);r.useEffect(()=>{const t=de.current;t&&(t.style.height="auto",t.style.height=`${Math.min(t.scrollHeight,160)}px`)},[H]);const Oe=r.useCallback(()=>{const t=Z.current;if(!t)return;Le(t.scrollHeight-t.scrollTop-t.clientHeight<60)},[]),re=r.useCallback((t="smooth")=>{const a=Z.current;a&&a.scrollTo({top:a.scrollHeight,behavior:t})},[]);r.useEffect(()=>{J&&re("smooth")},[G,I,J,re]);const Ke=r.useCallback(async()=>{if(E?.lastUserMessage){ge(!0),v(null);try{await K(E.lastUserMessage)}finally{ge(!1)}}},[E,K]),Fe=[n("assistantChat.suggestion1"),n("assistantChat.suggestion2"),n("assistantChat.suggestion3"),n("assistantChat.suggestion4")],He=ue.length>0?ue:Fe;if(X)return e.jsx("div",{className:"achat-page",children:e.jsx("div",{className:"achat-loading",children:n("common.labels.loading")})});if(!m)return e.jsx("div",{className:"achat-page",children:e.jsx("div",{className:"achat-loading",children:n("instance.notFound")})});const _=m.status==="running";return e.jsxs("div",{className:"achat-page",children:[e.jsxs("header",{className:"achat-topbar",children:[e.jsx("button",{className:"achat-topbar__back",onClick:()=>u("/assistants"),children:e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:e.jsx("path",{d:"M13 4L7 10L13 16",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),e.jsx("div",{className:"achat-topbar__avatar",children:e.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:[e.jsx("rect",{x:"3",y:"7",width:"14",height:"10",rx:"1.5",stroke:"currentColor",strokeWidth:"1.5"}),e.jsx("path",{d:"M7 7V5.5A1.5 1.5 0 0 1 8.5 4h3A1.5 1.5 0 0 1 13 5.5V7",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}),e.jsxs("div",{className:"achat-topbar__info",children:[e.jsx("span",{className:"achat-topbar__name",children:m.name}),e.jsxs("span",{className:"achat-topbar__status",children:[_&&e.jsx("span",{className:"achat-topbar__dot"}),_?`${n("assistantChat.online")} · ${n("assistantChat.alwaysReady")}`:n(`common.status.${m.status}`)]})]}),e.jsx("button",{className:"achat-settings-btn",onClick:()=>V(!z),children:n("chat.settings")}),e.jsx("button",{className:`achat-drawer-toggle${te?" achat-drawer-toggle--shifted":""}`,onClick:()=>se(!te),title:n("chat.sessionDrawer.toggleSessions"),"aria-label":n("chat.sessionDrawer.toggleSessions"),children:e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none",children:e.jsx("path",{d:"M3 5h14M3 10h14M3 15h14",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]}),z&&e.jsxs("div",{className:"achat-settings-panel",children:[e.jsxs("div",{className:"achat-settings-field",children:[e.jsx("label",{children:n("chat.sessionSettings.modelLabel")}),e.jsx("input",{type:"text",value:xe,onChange:t=>ve(t.target.value),placeholder:n("chat.sessionSettings.modelPlaceholder"),list:"achat-model-suggestions"}),e.jsx("datalist",{id:"achat-model-suggestions",children:We.map(t=>e.jsx("option",{value:t},t))})]}),e.jsxs("div",{className:"achat-settings-field",children:[e.jsx("label",{children:n("chat.sessionSettings.thinkingLevelLabel")}),e.jsxs("select",{value:ye,onChange:t=>je(t.target.value),children:[e.jsx("option",{value:"",children:n("chat.sessionSettings.thinkingLevels.default")}),e.jsx("option",{value:"off",children:n("chat.sessionSettings.thinkingLevels.off")}),e.jsx("option",{value:"low",children:n("chat.sessionSettings.thinkingLevels.low")}),e.jsx("option",{value:"medium",children:n("chat.sessionSettings.thinkingLevels.medium")}),e.jsx("option",{value:"high",children:n("chat.sessionSettings.thinkingLevels.high")})]})]}),e.jsxs("div",{className:"achat-settings-actions",children:[e.jsx("button",{className:"achat-settings-save-btn",onClick:Ue,disabled:be,children:n(be?"chat.sessionSettings.saving":"chat.sessionSettings.save")}),e.jsx("button",{onClick:()=>V(!1),children:n("common.buttons.cancel")})]})]}),e.jsxs("div",{className:"achat-body",style:{display:"flex",flex:1,overflow:"hidden",position:"relative"},children:[e.jsx(Xe,{instanceId:s,currentSessionKey:l,isOpen:te,isStreaming:y,onSelectSession:Be,onNewChat:$e,onClose:()=>se(!1),refreshFlag:Te,mode:"sidebar"}),e.jsxs("div",{className:"achat-main",style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden",minWidth:0},children:[e.jsxs("div",{className:"achat-messages",ref:Z,onScroll:Oe,children:[!_&&e.jsx("div",{className:"achat-not-running",children:n("assistantChat.notRunning")}),G.map((t,a)=>{const i=t.role==="user";return e.jsxs("div",{className:`achat-msg achat-msg--${i?"user":"agent"}`,children:[e.jsxs("div",{className:"achat-msg__row",children:[!i&&e.jsx("div",{className:"achat-msg__avatar",children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[e.jsx("rect",{x:"2",y:"5.5",width:"12",height:"8.5",rx:"1.5",stroke:"currentColor",strokeWidth:"1.4"}),e.jsx("path",{d:"M5.5 5.5V4.5A1.5 1.5 0 0 1 7 3h2a1.5 1.5 0 0 1 1.5 1.5V5.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})]})}),e.jsx("div",{className:"achat-msg__bubble",children:e.jsx(_e,{content:t.content})})]}),e.jsx("button",{className:"achat-msg-copy-btn",onClick:()=>Pe(t.content,a),title:n(ee===a?"common.buttons.copied":"common.buttons.copy"),"aria-label":n(ee===a?"common.buttons.copied":"common.buttons.copy"),children:ee===a?e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M3.5 8.5L6.5 11.5L12.5 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}):e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",children:[e.jsx("rect",{x:"5.5",y:"5.5",width:"7",height:"7",rx:"1",stroke:"currentColor",strokeWidth:"1.3"}),e.jsx("path",{d:"M5 10.5H4.5A1 1 0 0 1 3.5 9.5V4A1 1 0 0 1 4.5 3H10a1 1 0 0 1 1 1v.5",stroke:"currentColor",strokeWidth:"1.3"})]})}),t.timestamp&&e.jsx("div",{className:`achat-msg__time${i?" achat-msg__time--right":" achat-msg__time--left"}`,children:st(t.timestamp)})]},a)}),I!==null&&e.jsx("div",{className:"achat-msg achat-msg--agent",children:e.jsxs("div",{className:"achat-msg__row",children:[e.jsx("div",{className:"achat-msg__avatar",children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[e.jsx("rect",{x:"2",y:"5.5",width:"12",height:"8.5",rx:"1.5",stroke:"currentColor",strokeWidth:"1.4"}),e.jsx("path",{d:"M5.5 5.5V4.5A1.5 1.5 0 0 1 7 3h2a1.5 1.5 0 0 1 1.5 1.5V5.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})]})}),e.jsx("div",{className:"achat-msg__bubble achat-msg__bubble--streaming",children:I?e.jsx(_e,{content:I,isStreaming:!0}):e.jsx("span",{className:"spinner"})})]})}),le&&I===null&&e.jsx("div",{className:"achat-msg achat-msg--agent",children:e.jsxs("div",{className:"achat-msg__row",children:[e.jsx("div",{className:"achat-msg__avatar",children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[e.jsx("rect",{x:"2",y:"5.5",width:"12",height:"8.5",rx:"1.5",stroke:"currentColor",strokeWidth:"1.4"}),e.jsx("path",{d:"M5.5 5.5V4.5A1.5 1.5 0 0 1 7 3h2a1.5 1.5 0 0 1 1.5 1.5V5.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})]})}),e.jsx("div",{className:"achat-msg__bubble",children:e.jsx("span",{className:"spinner"})})]})}),E&&e.jsx(Qe,{errorMessage:E.message,category:E.category,onRetry:E.lastUserMessage?Ke:void 0,onDismiss:()=>v(null),onNavigate:t=>u(t),onOpenSettings:()=>V(!0),instanceId:s,retrying:Me})]}),!J&&e.jsx("button",{className:"achat-scroll-bottom-btn",onClick:()=>re("smooth"),"aria-label":n("chat.scrollToBottom"),title:n("chat.scrollToBottom"),children:e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:e.jsx("path",{d:"M9 3v12M4 10l5 5 5-5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),_&&G.length===0&&!y&&e.jsxs("div",{className:"achat-suggestions",children:[e.jsxs("div",{className:"achat-suggestions__label",children:[e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:e.jsx("path",{d:"M8 2L4 8h4l-2 4 6-6H8l2-4z",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})}),n("assistantChat.quickSuggestions")]}),e.jsx("div",{className:"achat-suggestions__list",children:He.map((t,a)=>e.jsx("button",{className:"achat-suggestions__item",onClick:()=>K(t),children:t},a))})]}),e.jsxs("div",{className:"achat-input-bar",onPaste:De,onDrop:Re,onDragOver:t=>t.preventDefault(),children:[e.jsx("input",{type:"file",ref:pe,onChange:t=>P(t.target.files),accept:Ze,multiple:!0,style:{display:"none"}}),D.length>0&&e.jsx("div",{className:"achat-attachment-preview",children:D.map(t=>e.jsxs("div",{className:"achat-attachment-thumb",children:[F(t.type)?e.jsx("img",{src:t.preview,alt:t.name}):e.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:[e.jsx("span",{style:{fontSize:"1.1rem",lineHeight:1},children:tt(t.type)}),e.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"100%"},children:t.name})]}),e.jsx("button",{className:"achat-attachment-remove",onClick:()=>Ae(t.id),"aria-label":n("chat.attachments.removeAttachment"),children:"×"}),e.jsx("span",{className:"achat-attachment-name",children:t.name})]},t.id))}),e.jsxs("div",{className:"achat-input-bar__row",children:[e.jsx("button",{className:`achat-input-bar__icon${y||!_?" achat-input-bar__icon--disabled":""}`,onClick:()=>pe.current?.click(),disabled:y||!_,title:n("chat.attachments.attachFile"),children:e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.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"})})}),e.jsx("textarea",{ref:de,className:"achat-input-bar__textarea",value:H,onChange:t=>ce(t.target.value),onKeyDown:t=>{t.key==="Enter"&&!t.shiftKey&&(t.preventDefault(),y?we():K())},placeholder:n("assistantChat.inputPlaceholder"),disabled:!_||y,rows:1}),e.jsx("button",{className:"achat-input-bar__icon",onClick:()=>O(),disabled:!_,children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:[e.jsx("path",{d:"M16 3v4h-4",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M2 9a7 7 0 0 1 12-4.9L16 7M2 15v-4h4",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M16 9a7 7 0 0 1-12 4.9L2 11",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]})}),y?e.jsx("button",{className:"achat-input-bar__send achat-input-bar__send--stop",onClick:we,children:e.jsx("span",{className:"achat-stop-icon"})}):e.jsx("button",{className:"achat-input-bar__send",onClick:()=>K(),disabled:!H.trim()&&D.length===0||!_,children:e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:e.jsx("path",{d:"M2 2l14 7-14 7V10.5l10-1.5-10-1.5V2z",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),e.jsx("div",{className:"achat-disclaimer",children:n("assistantChat.disclaimer")})]})]})]})]})}export{lt as AssistantChatPage};
@@ -1 +1 @@
1
- import{f as D,a as z,r as a,j as e}from"./index-CpykxeVP.js";import{a as h,A as S}from"./api-B5psysvQ.js";import{A as I}from"./AvatarPicker-tnuT6wHM.js";/* empty css */import{u as T}from"./useTranslation-BQrFEUB3.js";import"./index-wWimwgy7.js";import"./createLucideIcon-DiclDRFj.js";function G(){const{id:n}=D(),x=z(),{t:s}=T(),[w,L]=a.useState(null),[m,u]=a.useState(""),[o,j]=a.useState(""),[v,g]=a.useState(""),[f,N]=a.useState(""),[C,M]=a.useState(!0),[l,k]=a.useState(!1),[c,d]=a.useState("idle"),[E,y]=a.useState(""),[r,b]=a.useState(!1),[W,p]=a.useState(!1);a.useEffect(()=>{let t=!1;async function A(){if(n)try{const i=await h.get(`/instances/${n}`);t||(L(i),u(i.name),j(i.avatar??""),g(typeof i.config.soulmd=="string"?i.config.soulmd:""),N(typeof i.config.identitymd=="string"?i.config.identitymd:""))}catch(i){t||y(i instanceof S?i.message:s("assistantEdit.loadError"))}finally{t||M(!1)}}return A(),()=>{t=!0}},[n,s]);async function B(){if(!(!n||l)){k(!0),d("idle");try{let t;o?o.startsWith("preset:")?t={type:"preset",presetId:o.slice(7)}:t={type:"custom",image:o}:t={type:"remove"},await Promise.all([h.patch(`/instances/${n}/config`,{soulmd:v,identitymd:f,agentName:m}),h.put(`/instances/${n}/avatar`,t)]),d("saved"),setTimeout(()=>d("idle"),2500)}catch{d("error")}finally{k(!1)}}}async function P(){if(!(!n||r)){b(!0);try{await h.delete(`/instances/${n}`),x("/assistants")}catch(t){y(t instanceof S?t.message:s("assistantEdit.deleteError")),b(!1),p(!1)}}}if(C)return e.jsx("div",{className:"aep-page aep-page--loading",children:e.jsx("span",{className:"aep-loading-text",children:s("assistantEdit.loading")})});const $=w?.name??m;return e.jsxs("div",{className:"aep-page",children:[e.jsxs("div",{className:"aep-content",children:[e.jsxs("button",{className:"aep-back-btn",onClick:()=>x("/assistants"),children:[e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M10 3L5 8L10 13",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),s("assistantEdit.backButton")]}),e.jsxs("div",{className:"aep-header",children:[e.jsxs("div",{className:"aep-header-text",children:[e.jsx("h1",{className:"aep-title",children:s("assistantEdit.title")}),e.jsxs("p",{className:"aep-subtitle",children:[s("assistantEdit.subtitle"),e.jsxs("span",{className:"aep-subtitle-name",children:[" ",$," "]}),s("assistantEdit.subtitleOf")]})]}),e.jsxs("button",{className:`aep-save-btn${l?" aep-save-btn--saving":""}${c==="saved"?" aep-save-btn--saved":""}${c==="error"?" aep-save-btn--error":""}`,onClick:B,disabled:l,children:[e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M13 10v2.5a.5.5 0 01-.5.5h-9a.5.5 0 01-.5-.5V10M8 2v7M5.5 6.5L8 9l2.5-2.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),s(l?"assistantEdit.savingText":c==="saved"?"assistantEdit.savedText":"assistantEdit.saveButton")]})]}),E&&e.jsx("div",{className:"aep-alert aep-alert--warning",children:E}),c==="error"&&e.jsx("div",{className:"aep-alert aep-alert--error",children:s("assistantEdit.saveError")}),e.jsxs("div",{className:"aep-sections",children:[e.jsxs("section",{className:"aep-section",children:[e.jsxs("div",{className:"aep-section-header",children:[e.jsx("span",{className:"aep-section-icon aep-section-icon--name",children:e.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",children:e.jsx("path",{d:"M10.5 1.5L13.5 4.5M2 13l1.5-4.5L11 1 14 4l-7.5 7.5L2 13z",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})})}),e.jsx("h2",{className:"aep-section-title",children:s("assistantEdit.nameSection")})]}),e.jsx("input",{className:"aep-input",type:"text",value:m,onChange:t=>u(t.target.value),placeholder:s("assistantEdit.nameSection")})]}),e.jsxs("section",{className:"aep-section",children:[e.jsxs("div",{className:"aep-section-header",children:[e.jsx("span",{className:"aep-section-icon aep-section-icon--avatar",children:e.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",children:[e.jsx("rect",{x:"1",y:"1",width:"13",height:"13",rx:"3",stroke:"currentColor",strokeWidth:"1.3"}),e.jsx("circle",{cx:"7.5",cy:"6",r:"2.5",stroke:"currentColor",strokeWidth:"1.3"}),e.jsx("path",{d:"M3 13c0-2.5 2-4.5 4.5-4.5S12 10.5 12 13",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"})]})}),e.jsx("h2",{className:"aep-section-title",children:s("assistantEdit.avatarSection")})]}),e.jsx(I,{value:o,onChange:t=>j(t??"")})]}),e.jsxs("section",{className:"aep-section",children:[e.jsxs("div",{className:"aep-section-header",children:[e.jsx("span",{className:"aep-section-icon aep-section-icon--principles",children:e.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",children:e.jsx("path",{d:"M7.5 1L9.18 5.28l4.57.38-3.46 3 1.04 4.46L7.5 10.5l-3.83 2.62 1.04-4.46-3.46-3 4.57-.38L7.5 1z",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})})}),e.jsx("h2",{className:"aep-section-title",children:s("assistantEdit.principlesSection")})]}),e.jsx("textarea",{className:"aep-textarea",value:v,onChange:t=>g(t.target.value),rows:9,placeholder:s("assistantEdit.principlesSection")})]}),e.jsxs("section",{className:"aep-section",children:[e.jsxs("div",{className:"aep-section-header",children:[e.jsx("span",{className:"aep-section-icon aep-section-icon--identity",children:e.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",children:[e.jsx("circle",{cx:"7.5",cy:"4.5",r:"2.5",stroke:"currentColor",strokeWidth:"1.3"}),e.jsx("path",{d:"M2 13c0-3.038 2.462-5.5 5.5-5.5S13 9.962 13 13",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"})]})}),e.jsx("h2",{className:"aep-section-title",children:s("assistantEdit.identitySection")})]}),e.jsx("textarea",{className:"aep-textarea",value:f,onChange:t=>N(t.target.value),rows:7,placeholder:s("assistantEdit.identitySection")})]})]}),e.jsxs("section",{className:"aep-danger-zone",children:[e.jsx("h2",{className:"aep-danger-zone-title",children:s("assistantEdit.dangerZone.title")}),e.jsx("p",{className:"aep-danger-zone-desc",children:s("assistantEdit.dangerZone.description")}),e.jsx("button",{className:"danger",onClick:()=>p(!0),disabled:r,children:s("assistantEdit.dangerZone.deleteButton")})]})]}),W&&e.jsx("div",{className:"modal-overlay",onClick:r?void 0:()=>p(!1),children:e.jsxs("div",{className:"modal",role:"dialog","aria-modal":"true",onClick:t=>t.stopPropagation(),children:[e.jsx("h3",{children:s("assistantEdit.deleteModal.title")}),e.jsx("p",{className:"aep-modal-desc",children:s("assistantEdit.deleteModal.description")}),e.jsx("p",{className:"aep-modal-warning",children:s("assistantEdit.deleteModal.warning")}),e.jsxs("div",{className:"aep-modal-actions",children:[e.jsx("button",{type:"button",className:"btn-secondary",onClick:()=>p(!1),disabled:r,children:s("assistantEdit.deleteModal.cancel")}),e.jsx("button",{type:"button",className:"danger",onClick:P,disabled:r,children:s(r?"assistantEdit.dangerZone.deleting":"assistantEdit.deleteModal.confirm")})]})]})}),e.jsx("button",{className:"aep-help-btn","aria-label":"Help",children:e.jsx("span",{children:"?"})})]})}export{G as AssistantEditPage};
1
+ import{f as D,a as z,r as a,j as e}from"./index-C9sOtm4z.js";import{a as h,A as S}from"./api-B5psysvQ.js";import{A as I}from"./AvatarPicker-TuHMRKed.js";/* empty css */import{u as T}from"./useTranslation-CzQ7UCmK.js";import"./index-wWimwgy7.js";import"./createLucideIcon-BKz50_J5.js";function G(){const{id:n}=D(),x=z(),{t:s}=T(),[w,L]=a.useState(null),[m,u]=a.useState(""),[o,j]=a.useState(""),[v,g]=a.useState(""),[f,N]=a.useState(""),[C,M]=a.useState(!0),[l,k]=a.useState(!1),[c,d]=a.useState("idle"),[E,y]=a.useState(""),[r,b]=a.useState(!1),[W,p]=a.useState(!1);a.useEffect(()=>{let t=!1;async function A(){if(n)try{const i=await h.get(`/instances/${n}`);t||(L(i),u(i.name),j(i.avatar??""),g(typeof i.config.soulmd=="string"?i.config.soulmd:""),N(typeof i.config.identitymd=="string"?i.config.identitymd:""))}catch(i){t||y(i instanceof S?i.message:s("assistantEdit.loadError"))}finally{t||M(!1)}}return A(),()=>{t=!0}},[n,s]);async function B(){if(!(!n||l)){k(!0),d("idle");try{let t;o?o.startsWith("preset:")?t={type:"preset",presetId:o.slice(7)}:t={type:"custom",image:o}:t={type:"remove"},await Promise.all([h.patch(`/instances/${n}/config`,{soulmd:v,identitymd:f,agentName:m}),h.put(`/instances/${n}/avatar`,t)]),d("saved"),setTimeout(()=>d("idle"),2500)}catch{d("error")}finally{k(!1)}}}async function P(){if(!(!n||r)){b(!0);try{await h.delete(`/instances/${n}`),x("/assistants")}catch(t){y(t instanceof S?t.message:s("assistantEdit.deleteError")),b(!1),p(!1)}}}if(C)return e.jsx("div",{className:"aep-page aep-page--loading",children:e.jsx("span",{className:"aep-loading-text",children:s("assistantEdit.loading")})});const $=w?.name??m;return e.jsxs("div",{className:"aep-page",children:[e.jsxs("div",{className:"aep-content",children:[e.jsxs("button",{className:"aep-back-btn",onClick:()=>x("/assistants"),children:[e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M10 3L5 8L10 13",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),s("assistantEdit.backButton")]}),e.jsxs("div",{className:"aep-header",children:[e.jsxs("div",{className:"aep-header-text",children:[e.jsx("h1",{className:"aep-title",children:s("assistantEdit.title")}),e.jsxs("p",{className:"aep-subtitle",children:[s("assistantEdit.subtitle"),e.jsxs("span",{className:"aep-subtitle-name",children:[" ",$," "]}),s("assistantEdit.subtitleOf")]})]}),e.jsxs("button",{className:`aep-save-btn${l?" aep-save-btn--saving":""}${c==="saved"?" aep-save-btn--saved":""}${c==="error"?" aep-save-btn--error":""}`,onClick:B,disabled:l,children:[e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M13 10v2.5a.5.5 0 01-.5.5h-9a.5.5 0 01-.5-.5V10M8 2v7M5.5 6.5L8 9l2.5-2.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),s(l?"assistantEdit.savingText":c==="saved"?"assistantEdit.savedText":"assistantEdit.saveButton")]})]}),E&&e.jsx("div",{className:"aep-alert aep-alert--warning",children:E}),c==="error"&&e.jsx("div",{className:"aep-alert aep-alert--error",children:s("assistantEdit.saveError")}),e.jsxs("div",{className:"aep-sections",children:[e.jsxs("section",{className:"aep-section",children:[e.jsxs("div",{className:"aep-section-header",children:[e.jsx("span",{className:"aep-section-icon aep-section-icon--name",children:e.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",children:e.jsx("path",{d:"M10.5 1.5L13.5 4.5M2 13l1.5-4.5L11 1 14 4l-7.5 7.5L2 13z",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})})}),e.jsx("h2",{className:"aep-section-title",children:s("assistantEdit.nameSection")})]}),e.jsx("input",{className:"aep-input",type:"text",value:m,onChange:t=>u(t.target.value),placeholder:s("assistantEdit.nameSection")})]}),e.jsxs("section",{className:"aep-section",children:[e.jsxs("div",{className:"aep-section-header",children:[e.jsx("span",{className:"aep-section-icon aep-section-icon--avatar",children:e.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",children:[e.jsx("rect",{x:"1",y:"1",width:"13",height:"13",rx:"3",stroke:"currentColor",strokeWidth:"1.3"}),e.jsx("circle",{cx:"7.5",cy:"6",r:"2.5",stroke:"currentColor",strokeWidth:"1.3"}),e.jsx("path",{d:"M3 13c0-2.5 2-4.5 4.5-4.5S12 10.5 12 13",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"})]})}),e.jsx("h2",{className:"aep-section-title",children:s("assistantEdit.avatarSection")})]}),e.jsx(I,{value:o,onChange:t=>j(t??"")})]}),e.jsxs("section",{className:"aep-section",children:[e.jsxs("div",{className:"aep-section-header",children:[e.jsx("span",{className:"aep-section-icon aep-section-icon--principles",children:e.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",children:e.jsx("path",{d:"M7.5 1L9.18 5.28l4.57.38-3.46 3 1.04 4.46L7.5 10.5l-3.83 2.62 1.04-4.46-3.46-3 4.57-.38L7.5 1z",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})})}),e.jsx("h2",{className:"aep-section-title",children:s("assistantEdit.principlesSection")})]}),e.jsx("textarea",{className:"aep-textarea",value:v,onChange:t=>g(t.target.value),rows:9,placeholder:s("assistantEdit.principlesSection")})]}),e.jsxs("section",{className:"aep-section",children:[e.jsxs("div",{className:"aep-section-header",children:[e.jsx("span",{className:"aep-section-icon aep-section-icon--identity",children:e.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",children:[e.jsx("circle",{cx:"7.5",cy:"4.5",r:"2.5",stroke:"currentColor",strokeWidth:"1.3"}),e.jsx("path",{d:"M2 13c0-3.038 2.462-5.5 5.5-5.5S13 9.962 13 13",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"})]})}),e.jsx("h2",{className:"aep-section-title",children:s("assistantEdit.identitySection")})]}),e.jsx("textarea",{className:"aep-textarea",value:f,onChange:t=>N(t.target.value),rows:7,placeholder:s("assistantEdit.identitySection")})]})]}),e.jsxs("section",{className:"aep-danger-zone",children:[e.jsx("h2",{className:"aep-danger-zone-title",children:s("assistantEdit.dangerZone.title")}),e.jsx("p",{className:"aep-danger-zone-desc",children:s("assistantEdit.dangerZone.description")}),e.jsx("button",{className:"danger",onClick:()=>p(!0),disabled:r,children:s("assistantEdit.dangerZone.deleteButton")})]})]}),W&&e.jsx("div",{className:"modal-overlay",onClick:r?void 0:()=>p(!1),children:e.jsxs("div",{className:"modal",role:"dialog","aria-modal":"true",onClick:t=>t.stopPropagation(),children:[e.jsx("h3",{children:s("assistantEdit.deleteModal.title")}),e.jsx("p",{className:"aep-modal-desc",children:s("assistantEdit.deleteModal.description")}),e.jsx("p",{className:"aep-modal-warning",children:s("assistantEdit.deleteModal.warning")}),e.jsxs("div",{className:"aep-modal-actions",children:[e.jsx("button",{type:"button",className:"btn-secondary",onClick:()=>p(!1),disabled:r,children:s("assistantEdit.deleteModal.cancel")}),e.jsx("button",{type:"button",className:"danger",onClick:P,disabled:r,children:s(r?"assistantEdit.dangerZone.deleting":"assistantEdit.deleteModal.confirm")})]})]})}),e.jsx("button",{className:"aep-help-btn","aria-label":"Help",children:e.jsx("span",{children:"?"})})]})}export{G as AssistantEditPage};
@@ -1 +1 @@
1
- import{f as y,a as C,r as n,j as e}from"./index-CpykxeVP.js";import{a as l}from"./api-B5psysvQ.js";/* empty css */import{u as M}from"./useTranslation-BQrFEUB3.js";function S(r){return!r||r.length===0?[]:r.slice(0,3).map(i=>({label:i.fieldLabel,old:i.oldValue??"(空)",newVal:i.newValue??"(空)"}))}function W(r){return{id:r.id,version:r.version??"v1",description:r.description??r.triggerDetail??"",createdAt:r.createdAt,changes:S(r.changeSummary)}}function A(){const{id:r}=y(),i=C(),{t:a}=M(),[x,_]=n.useState(null),[c,m]=n.useState([]),[k,N]=n.useState(!0),[j,d]=n.useState(null),[p,g]=n.useState(null),[h,u]=n.useState(null);n.useEffect(()=>{if(!r)return;let s=!1;return Promise.all([l.get(`/instances/${r}`),l.get(`/instances/${r}/snapshots?page=1&limit=50`)]).then(([t,o])=>{s||(_(t),m(o.items))}).catch(t=>{s||d(t instanceof Error?t.message:a("assistantVersions.loadFailed"))}).finally(()=>{s||N(!1)}),()=>{s=!0}},[r,a]);const V=n.useCallback(async s=>{if(r){g(s),d(null);try{await l.post(`/instances/${r}/snapshots/${s}/restore`,{});const t=await l.get(`/instances/${r}/snapshots?page=1&limit=50`);m(t.items)}catch(t){d(t instanceof Error?t.message:a("assistantVersions.restoreFailed"))}finally{g(null)}}},[r,a]),w=n.useCallback(async s=>{if(r)try{const t=await l.get(`/instances/${r}/snapshots/${s}/diff`);u({snapshotId:s,diff:t})}catch{}},[r]);if(k)return e.jsx("div",{className:"aver-page",children:e.jsx("div",{className:"aver-loading",children:a("common.labels.loading")})});const v=c.map(W),L=v.length>0?v[0].version:x?.imageTag??"—";return e.jsxs("div",{className:"aver-page",children:[e.jsxs("button",{className:"aver-back",onClick:()=>i("/assistants"),children:[e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M10 3L5 8L10 13",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),a("assistantVersions.backToAssistants")]}),e.jsxs("header",{className:"aver-header",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"aver-header__title",children:[x?.name??""," — ",a("assistantVersions.titleSuffix")]}),e.jsxs("p",{className:"aver-header__subtitle",children:[a("assistantVersions.currentVersion")," ",e.jsx("strong",{children:L})]})]}),e.jsxs("div",{className:"aver-header__actions",children:[e.jsxs("button",{className:"aver-header__btn aver-header__btn--primary",onClick:()=>u(null),children:[e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[e.jsx("path",{d:"M2.5 8a5.5 5.5 0 1 0 1-3.2",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),e.jsx("path",{d:"M2.5 4v1.5H4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),a("assistantVersions.versionList")]}),e.jsxs("button",{className:"aver-header__btn",onClick:()=>{c[1]&&w(c[1].id)},disabled:c.length<2,children:[e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[e.jsx("path",{d:"M5 3v10M5 13l-2-2M5 13l2-2",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M11 13V3M11 3l-2 2M11 3l2 2",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),a("assistantVersions.compareDiff")]})]})]}),j&&e.jsx("div",{className:"aver-error",children:j}),h?e.jsxs("div",{className:"aver-diff-panel",children:[e.jsxs("button",{className:"aver-back",onClick:()=>u(null),children:[e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M10 3L5 8L10 13",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),a("assistantVersions.versionList")]}),e.jsxs("div",{className:"aver-diff-list",children:[h.diff.changes.filter(s=>s.type!=="unchanged").map((s,t)=>e.jsxs("div",{className:"aver-diff-entry",children:[e.jsx("span",{className:"aver-diff-entry__file",children:s.file}),e.jsx("span",{className:`aver-diff-entry__type aver-diff-entry__type--${s.type}`,children:s.type})]},t)),h.diff.changes.filter(s=>s.type!=="unchanged").length===0&&e.jsx("p",{className:"aver-empty",children:a("assistantVersions.noVersions")})]})]}):e.jsx("div",{className:"aver-list",children:v.map((s,t)=>{const o=t===0;return e.jsxs("div",{className:`aver-card${o?" aver-card--current":""}`,children:[e.jsxs("div",{className:"aver-card__header",children:[e.jsxs("div",{className:"aver-card__version-row",children:[e.jsx("span",{className:"aver-card__version",children:s.version}),o&&e.jsx("span",{className:"aver-card__badge",children:a("assistantVersions.currentVersion")})]}),e.jsxs("span",{className:"aver-card__date",children:[e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:[e.jsx("circle",{cx:"7",cy:"7",r:"5.5",stroke:"currentColor",strokeWidth:"1.4"}),e.jsx("path",{d:"M7 4.5V7l2 1.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})]}),new Date(s.createdAt).toLocaleString()]})]}),s.description&&e.jsx("p",{className:"aver-card__desc",children:s.description}),s.changes.length>0&&e.jsx("div",{className:"aver-card__changes",children:s.changes.map((f,b)=>e.jsxs("div",{className:"aver-card__change-row",children:[e.jsx("span",{className:"aver-card__change-label",children:f.label}),e.jsx("span",{className:"aver-card__change-old",children:f.old}),e.jsx("span",{className:"aver-card__change-arrow",children:"→"}),e.jsx("span",{className:"aver-card__change-new",children:f.newVal})]},b))}),!o&&e.jsx("div",{className:"aver-card__footer",children:e.jsxs("button",{className:"aver-card__restore",onClick:()=>V(s.id),disabled:p!==null,children:[e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:[e.jsx("path",{d:"M2.5 7a4.5 4.5 0 1 0 .8-2.7",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"}),e.jsx("path",{d:"M2.5 3.5V5.5H4.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]}),p===s.id?a("assistantVersions.restoring"):a("assistantVersions.restoreVersion")]})})]},s.id)})})]})}export{A as AssistantVersionsPage};
1
+ import{f as y,a as C,r as n,j as e}from"./index-C9sOtm4z.js";import{a as l}from"./api-B5psysvQ.js";/* empty css */import{u as M}from"./useTranslation-CzQ7UCmK.js";function S(r){return!r||r.length===0?[]:r.slice(0,3).map(i=>({label:i.fieldLabel,old:i.oldValue??"(空)",newVal:i.newValue??"(空)"}))}function W(r){return{id:r.id,version:r.version??"v1",description:r.description??r.triggerDetail??"",createdAt:r.createdAt,changes:S(r.changeSummary)}}function A(){const{id:r}=y(),i=C(),{t:a}=M(),[x,_]=n.useState(null),[c,m]=n.useState([]),[k,N]=n.useState(!0),[j,d]=n.useState(null),[p,g]=n.useState(null),[h,u]=n.useState(null);n.useEffect(()=>{if(!r)return;let s=!1;return Promise.all([l.get(`/instances/${r}`),l.get(`/instances/${r}/snapshots?page=1&limit=50`)]).then(([t,o])=>{s||(_(t),m(o.items))}).catch(t=>{s||d(t instanceof Error?t.message:a("assistantVersions.loadFailed"))}).finally(()=>{s||N(!1)}),()=>{s=!0}},[r,a]);const V=n.useCallback(async s=>{if(r){g(s),d(null);try{await l.post(`/instances/${r}/snapshots/${s}/restore`,{});const t=await l.get(`/instances/${r}/snapshots?page=1&limit=50`);m(t.items)}catch(t){d(t instanceof Error?t.message:a("assistantVersions.restoreFailed"))}finally{g(null)}}},[r,a]),w=n.useCallback(async s=>{if(r)try{const t=await l.get(`/instances/${r}/snapshots/${s}/diff`);u({snapshotId:s,diff:t})}catch{}},[r]);if(k)return e.jsx("div",{className:"aver-page",children:e.jsx("div",{className:"aver-loading",children:a("common.labels.loading")})});const v=c.map(W),L=v.length>0?v[0].version:x?.imageTag??"—";return e.jsxs("div",{className:"aver-page",children:[e.jsxs("button",{className:"aver-back",onClick:()=>i("/assistants"),children:[e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M10 3L5 8L10 13",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),a("assistantVersions.backToAssistants")]}),e.jsxs("header",{className:"aver-header",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"aver-header__title",children:[x?.name??""," — ",a("assistantVersions.titleSuffix")]}),e.jsxs("p",{className:"aver-header__subtitle",children:[a("assistantVersions.currentVersion")," ",e.jsx("strong",{children:L})]})]}),e.jsxs("div",{className:"aver-header__actions",children:[e.jsxs("button",{className:"aver-header__btn aver-header__btn--primary",onClick:()=>u(null),children:[e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[e.jsx("path",{d:"M2.5 8a5.5 5.5 0 1 0 1-3.2",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),e.jsx("path",{d:"M2.5 4v1.5H4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),a("assistantVersions.versionList")]}),e.jsxs("button",{className:"aver-header__btn",onClick:()=>{c[1]&&w(c[1].id)},disabled:c.length<2,children:[e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[e.jsx("path",{d:"M5 3v10M5 13l-2-2M5 13l2-2",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M11 13V3M11 3l-2 2M11 3l2 2",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),a("assistantVersions.compareDiff")]})]})]}),j&&e.jsx("div",{className:"aver-error",children:j}),h?e.jsxs("div",{className:"aver-diff-panel",children:[e.jsxs("button",{className:"aver-back",onClick:()=>u(null),children:[e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M10 3L5 8L10 13",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),a("assistantVersions.versionList")]}),e.jsxs("div",{className:"aver-diff-list",children:[h.diff.changes.filter(s=>s.type!=="unchanged").map((s,t)=>e.jsxs("div",{className:"aver-diff-entry",children:[e.jsx("span",{className:"aver-diff-entry__file",children:s.file}),e.jsx("span",{className:`aver-diff-entry__type aver-diff-entry__type--${s.type}`,children:s.type})]},t)),h.diff.changes.filter(s=>s.type!=="unchanged").length===0&&e.jsx("p",{className:"aver-empty",children:a("assistantVersions.noVersions")})]})]}):e.jsx("div",{className:"aver-list",children:v.map((s,t)=>{const o=t===0;return e.jsxs("div",{className:`aver-card${o?" aver-card--current":""}`,children:[e.jsxs("div",{className:"aver-card__header",children:[e.jsxs("div",{className:"aver-card__version-row",children:[e.jsx("span",{className:"aver-card__version",children:s.version}),o&&e.jsx("span",{className:"aver-card__badge",children:a("assistantVersions.currentVersion")})]}),e.jsxs("span",{className:"aver-card__date",children:[e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:[e.jsx("circle",{cx:"7",cy:"7",r:"5.5",stroke:"currentColor",strokeWidth:"1.4"}),e.jsx("path",{d:"M7 4.5V7l2 1.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})]}),new Date(s.createdAt).toLocaleString()]})]}),s.description&&e.jsx("p",{className:"aver-card__desc",children:s.description}),s.changes.length>0&&e.jsx("div",{className:"aver-card__changes",children:s.changes.map((f,b)=>e.jsxs("div",{className:"aver-card__change-row",children:[e.jsx("span",{className:"aver-card__change-label",children:f.label}),e.jsx("span",{className:"aver-card__change-old",children:f.old}),e.jsx("span",{className:"aver-card__change-arrow",children:"→"}),e.jsx("span",{className:"aver-card__change-new",children:f.newVal})]},b))}),!o&&e.jsx("div",{className:"aver-card__footer",children:e.jsxs("button",{className:"aver-card__restore",onClick:()=>V(s.id),disabled:p!==null,children:[e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:[e.jsx("path",{d:"M2.5 7a4.5 4.5 0 1 0 .8-2.7",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"}),e.jsx("path",{d:"M2.5 3.5V5.5H4.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]}),p===s.id?a("assistantVersions.restoring"):a("assistantVersions.restoreVersion")]})})]},s.id)})})]})}export{A as AssistantVersionsPage};
@@ -1 +1 @@
1
- import{r as u,j as e}from"./index-CpykxeVP.js";import{A as m,P as _}from"./index-wWimwgy7.js";import{u as v}from"./useTranslation-BQrFEUB3.js";import{c as f}from"./createLucideIcon-DiclDRFj.js";const k=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],h=f("upload",k),j=2*1024*1024,x=["image/jpeg","image/png","image/webp"];function E({value:s,onChange:n}){const{t:i}=v(),c=u.useRef(null);function l(t){const a=`preset:${t}`;n(s===a?null:a)}function o(t){const a=t.target.files?.[0];if(!a||!x.includes(a.type)||a.size>j)return;const r=new FileReader;r.onload=()=>{typeof r.result=="string"&&n(r.result)},r.readAsDataURL(a),c.current&&(c.current.value="")}return e.jsxs("div",{className:"avatar-picker",children:[m.map(t=>e.jsxs("div",{className:"avatar-picker__category",children:[e.jsx("div",{className:"avatar-picker__category-label",children:i(`wizard.avatar.${t.id}`)}),e.jsx("div",{className:"avatar-picker__grid",children:t.presets.map(a=>{const r=`preset:${a}`,p=s===r,d=_[a];return e.jsx("button",{type:"button",className:`avatar-picker__item${p?" avatar-picker__item--selected":""}`,onClick:()=>l(a),children:e.jsx("img",{src:d,alt:a})},a)})})]},t.id)),s&&s.startsWith("data:")&&e.jsxs("div",{className:"avatar-picker__custom-preview",children:[e.jsx("img",{className:"avatar-picker__custom-img",src:s,alt:"custom"}),e.jsx("button",{type:"button",className:"avatar-picker__remove-btn",onClick:()=>n(null),children:i("wizard.avatar.removeLabel")})]}),e.jsxs("button",{type:"button",className:"avatar-picker__upload-btn",onClick:()=>c.current?.click(),children:[e.jsx(h,{size:14}),i("wizard.avatar.uploadLabel")]}),e.jsx("p",{className:"avatar-picker__upload-hint",children:i("wizard.avatar.uploadHint")}),e.jsx("input",{ref:c,type:"file",accept:".jpg,.jpeg,.png,.webp",onChange:o,hidden:!0})]})}export{E as A};
1
+ import{r as u,j as e}from"./index-C9sOtm4z.js";import{A as m,P as _}from"./index-wWimwgy7.js";import{u as v}from"./useTranslation-CzQ7UCmK.js";import{c as f}from"./createLucideIcon-BKz50_J5.js";const k=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],h=f("upload",k),j=2*1024*1024,x=["image/jpeg","image/png","image/webp"];function E({value:s,onChange:n}){const{t:i}=v(),c=u.useRef(null);function l(t){const a=`preset:${t}`;n(s===a?null:a)}function o(t){const a=t.target.files?.[0];if(!a||!x.includes(a.type)||a.size>j)return;const r=new FileReader;r.onload=()=>{typeof r.result=="string"&&n(r.result)},r.readAsDataURL(a),c.current&&(c.current.value="")}return e.jsxs("div",{className:"avatar-picker",children:[m.map(t=>e.jsxs("div",{className:"avatar-picker__category",children:[e.jsx("div",{className:"avatar-picker__category-label",children:i(`wizard.avatar.${t.id}`)}),e.jsx("div",{className:"avatar-picker__grid",children:t.presets.map(a=>{const r=`preset:${a}`,p=s===r,d=_[a];return e.jsx("button",{type:"button",className:`avatar-picker__item${p?" avatar-picker__item--selected":""}`,onClick:()=>l(a),children:e.jsx("img",{src:d,alt:a})},a)})})]},t.id)),s&&s.startsWith("data:")&&e.jsxs("div",{className:"avatar-picker__custom-preview",children:[e.jsx("img",{className:"avatar-picker__custom-img",src:s,alt:"custom"}),e.jsx("button",{type:"button",className:"avatar-picker__remove-btn",onClick:()=>n(null),children:i("wizard.avatar.removeLabel")})]}),e.jsxs("button",{type:"button",className:"avatar-picker__upload-btn",onClick:()=>c.current?.click(),children:[e.jsx(h,{size:14}),i("wizard.avatar.uploadLabel")]}),e.jsx("p",{className:"avatar-picker__upload-hint",children:i("wizard.avatar.uploadHint")}),e.jsx("input",{ref:c,type:"file",accept:".jpg,.jpeg,.png,.webp",onChange:o,hidden:!0})]})}export{E as A};