agent-relay-server 0.42.0 → 0.44.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/docs/openapi.json +85 -1
  2. package/package.json +2 -2
  3. package/public/assets/{activity-G6l1nOLj.js → activity-Dkzmef0Z.js} +2 -2
  4. package/public/assets/{activity-G6l1nOLj.js.map → activity-Dkzmef0Z.js.map} +1 -1
  5. package/public/assets/{agent-profiles-BWKpVoNw.js → agent-profiles-DQYHMAyu.js} +2 -2
  6. package/public/assets/{agent-profiles-BWKpVoNw.js.map → agent-profiles-DQYHMAyu.js.map} +1 -1
  7. package/public/assets/{agents-DBuCRS5A.js → agents-atr6HZ1e.js} +2 -2
  8. package/public/assets/{agents-DBuCRS5A.js.map → agents-atr6HZ1e.js.map} +1 -1
  9. package/public/assets/{analytics-BhwMtd0_.js → analytics-azFfAy4R.js} +2 -2
  10. package/public/assets/{analytics-BhwMtd0_.js.map → analytics-azFfAy4R.js.map} +1 -1
  11. package/public/assets/{automation-B7jnsYhH.js → automation-Bk4umHIm.js} +2 -2
  12. package/public/assets/{automation-B7jnsYhH.js.map → automation-Bk4umHIm.js.map} +1 -1
  13. package/public/assets/{branch-state-badge-dN2mQ2gs.js → branch-state-badge-DymObp8d.js} +2 -2
  14. package/public/assets/{branch-state-badge-dN2mQ2gs.js.map → branch-state-badge-DymObp8d.js.map} +1 -1
  15. package/public/assets/channels-B_0wDy0s.js +2 -0
  16. package/public/assets/{channels-CQy-JL7o.js.map → channels-B_0wDy0s.js.map} +1 -1
  17. package/public/assets/chat-DxV4MyYF.js +2 -0
  18. package/public/assets/chat-DxV4MyYF.js.map +1 -0
  19. package/public/assets/{connectors-ByNxzq2k.js → connectors-DLqYF2_3.js} +2 -2
  20. package/public/assets/{connectors-ByNxzq2k.js.map → connectors-DLqYF2_3.js.map} +1 -1
  21. package/public/assets/display-ConJ9cJB.js.map +1 -1
  22. package/public/assets/{formatted-body-impl-BXuR2gfL.js → formatted-body-impl-LK0QcFLC.js} +2 -2
  23. package/public/assets/{formatted-body-impl-BXuR2gfL.js.map → formatted-body-impl-LK0QcFLC.js.map} +1 -1
  24. package/public/assets/{index-CAnJGSBl.js → index-CT10XH5Y.js} +8 -8
  25. package/public/assets/{index-CAnJGSBl.js.map → index-CT10XH5Y.js.map} +1 -1
  26. package/public/assets/index-Ryvn1efN.css +2 -0
  27. package/public/assets/{integrations-BBmL-PnQ.js → integrations-CdeQuRSQ.js} +2 -2
  28. package/public/assets/{integrations-BBmL-PnQ.js.map → integrations-CdeQuRSQ.js.map} +1 -1
  29. package/public/assets/{maintenance-B1bX9ety.js → maintenance-DbqSE_ps.js} +2 -2
  30. package/public/assets/{maintenance-B1bX9ety.js.map → maintenance-DbqSE_ps.js.map} +1 -1
  31. package/public/assets/{managed-agents-D12-nGKd.js → managed-agents-BxhRiBVn.js} +2 -2
  32. package/public/assets/{managed-agents-D12-nGKd.js.map → managed-agents-BxhRiBVn.js.map} +1 -1
  33. package/public/assets/{markdown-preview-impl-BWd3swt8.js → markdown-preview-impl-Dz2Spmat.js} +2 -2
  34. package/public/assets/{markdown-preview-impl-BWd3swt8.js.map → markdown-preview-impl-Dz2Spmat.js.map} +1 -1
  35. package/public/assets/{memory-4ERBFJBZ.js → memory-BTjUKTyA.js} +2 -2
  36. package/public/assets/{memory-4ERBFJBZ.js.map → memory-BTjUKTyA.js.map} +1 -1
  37. package/public/assets/{messages-B3ZES72c.js → messages-C8z05Y3O.js} +2 -2
  38. package/public/assets/{messages-B3ZES72c.js.map → messages-C8z05Y3O.js.map} +1 -1
  39. package/public/assets/{orchestrators-qKPntM-a.js → orchestrators-DQqtYryc.js} +2 -2
  40. package/public/assets/{orchestrators-qKPntM-a.js.map → orchestrators-DQqtYryc.js.map} +1 -1
  41. package/public/assets/{overview-ekmeyPaO.js → overview-CGYu6qQr.js} +2 -2
  42. package/public/assets/{overview-ekmeyPaO.js.map → overview-CGYu6qQr.js.map} +1 -1
  43. package/public/assets/pairs-BgqXzCto.js +2 -0
  44. package/public/assets/{pairs-B2QdTF0M.js.map → pairs-BgqXzCto.js.map} +1 -1
  45. package/public/assets/{security-WkMkEhb7.js → security-BqfRVw-p.js} +2 -2
  46. package/public/assets/{security-WkMkEhb7.js.map → security-BqfRVw-p.js.map} +1 -1
  47. package/public/assets/{settings-C5aXX3od.js → settings-63whklIq.js} +3 -3
  48. package/public/assets/{settings-C5aXX3od.js.map → settings-63whklIq.js.map} +1 -1
  49. package/public/assets/store-B6qT5_de.js +9 -0
  50. package/public/assets/store-B6qT5_de.js.map +1 -0
  51. package/public/assets/tasks-DiZ_4TYW.js +2 -0
  52. package/public/assets/{tasks-ppuVeXkO.js.map → tasks-DiZ_4TYW.js.map} +1 -1
  53. package/public/assets/{terminal-viewer-impl-DXycIJKe.js → terminal-viewer-impl-D3T1F77z.js} +2 -2
  54. package/public/assets/{terminal-viewer-impl-DXycIJKe.js.map → terminal-viewer-impl-D3T1F77z.js.map} +1 -1
  55. package/public/assets/work-queue-C1p2Hybt.js +2 -0
  56. package/public/assets/{work-queue-C8UzeekT.js.map → work-queue-C1p2Hybt.js.map} +1 -1
  57. package/public/assets/{workspaces-BD1P6J21.js → workspaces-DqVr0uN7.js} +2 -2
  58. package/public/assets/{workspaces-BD1P6J21.js.map → workspaces-DqVr0uN7.js.map} +1 -1
  59. package/public/index.html +3 -3
  60. package/src/agent-ref.ts +7 -4
  61. package/src/channel-target.ts +1 -0
  62. package/src/db/agent-search.ts +6 -0
  63. package/src/db/agents.ts +11 -2
  64. package/src/db/channels.ts +2 -1
  65. package/src/db/delivery.ts +4 -1
  66. package/src/db/index.ts +1 -0
  67. package/src/db/mappers.ts +1 -1
  68. package/src/db/message-reads.ts +10 -1
  69. package/src/db/migrations.ts +54 -2
  70. package/src/db/plans.ts +17 -2
  71. package/src/db/schema.ts +24 -3
  72. package/src/db/teams.ts +151 -0
  73. package/src/mcp-plan-tools.ts +7 -3
  74. package/src/mcp-team-tools.ts +87 -0
  75. package/src/mcp.ts +6 -1
  76. package/src/routes/index.ts +4 -0
  77. package/src/routes/integrations.ts +2 -1
  78. package/src/routes/messages.ts +1 -1
  79. package/src/routes/plans.ts +9 -3
  80. package/src/routes/teams.ts +60 -0
  81. package/src/runtime-tokens.ts +9 -3
  82. package/src/security.ts +7 -1
  83. package/src/services/plan-graph.ts +17 -3
  84. package/src/services/register-agent.ts +3 -1
  85. package/src/services/spawn-agent.ts +4 -1
  86. package/src/services/team.ts +69 -0
  87. package/src/token-db.ts +3 -3
  88. package/src/validation.ts +2 -0
  89. package/public/assets/channels-CQy-JL7o.js +0 -2
  90. package/public/assets/chat-KaK5_x65.js +0 -2
  91. package/public/assets/chat-KaK5_x65.js.map +0 -1
  92. package/public/assets/index-DzRKGPXS.css +0 -2
  93. package/public/assets/pairs-B2QdTF0M.js +0 -2
  94. package/public/assets/store-CtKmqMfx.js +0 -9
  95. package/public/assets/store-CtKmqMfx.js.map +0 -1
  96. package/public/assets/tasks-ppuVeXkO.js +0 -2
  97. package/public/assets/work-queue-C8UzeekT.js +0 -2
package/docs/openapi.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "openapi": "3.1.0",
3
3
  "info": {
4
4
  "title": "Agent Relay API",
5
- "version": "0.42.0",
5
+ "version": "0.44.0",
6
6
  "description": "Real-time message bus for inter-agent communication. Agent-first: this spec is designed for machine consumption — agents can self-discover the full API surface via GET /api/spec.",
7
7
  "license": {
8
8
  "name": "MIT",
@@ -2870,6 +2870,90 @@
2870
2870
  ]
2871
2871
  }
2872
2872
  },
2873
+ "/api/teams/me": {
2874
+ "get": {
2875
+ "operationId": "getMyTeamRoute",
2876
+ "summary": "Get My Team",
2877
+ "tags": [
2878
+ "Other"
2879
+ ],
2880
+ "responses": {
2881
+ "200": {
2882
+ "description": "Success",
2883
+ "content": {
2884
+ "application/json": {}
2885
+ }
2886
+ }
2887
+ },
2888
+ "security": [
2889
+ {
2890
+ "bearerAuth": []
2891
+ },
2892
+ {
2893
+ "tokenHeader": []
2894
+ },
2895
+ {
2896
+ "tokenQuery": []
2897
+ }
2898
+ ]
2899
+ }
2900
+ },
2901
+ "/api/teams/me/brief": {
2902
+ "put": {
2903
+ "operationId": "putMyTeamBriefRoute",
2904
+ "summary": "Put My Team Brief",
2905
+ "tags": [
2906
+ "Other"
2907
+ ],
2908
+ "responses": {
2909
+ "200": {
2910
+ "description": "Success",
2911
+ "content": {
2912
+ "application/json": {}
2913
+ }
2914
+ }
2915
+ },
2916
+ "security": [
2917
+ {
2918
+ "bearerAuth": []
2919
+ },
2920
+ {
2921
+ "tokenHeader": []
2922
+ },
2923
+ {
2924
+ "tokenQuery": []
2925
+ }
2926
+ ]
2927
+ }
2928
+ },
2929
+ "/api/teams/me/dissolve": {
2930
+ "post": {
2931
+ "operationId": "postMyTeamDissolveRoute",
2932
+ "summary": "Post My Team Dissolve",
2933
+ "tags": [
2934
+ "Other"
2935
+ ],
2936
+ "responses": {
2937
+ "200": {
2938
+ "description": "Success",
2939
+ "content": {
2940
+ "application/json": {}
2941
+ }
2942
+ }
2943
+ },
2944
+ "security": [
2945
+ {
2946
+ "bearerAuth": []
2947
+ },
2948
+ {
2949
+ "tokenHeader": []
2950
+ },
2951
+ {
2952
+ "tokenQuery": []
2953
+ }
2954
+ ]
2955
+ }
2956
+ },
2873
2957
  "/api/recipes": {
2874
2958
  "get": {
2875
2959
  "operationId": "getRecipes",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-relay-server",
3
- "version": "0.42.0",
3
+ "version": "0.44.0",
4
4
  "description": "Lightweight HTTP message relay for inter-agent communication across machines",
5
5
  "module": "src/index.ts",
6
6
  "type": "module",
@@ -33,7 +33,7 @@
33
33
  "CONTRIBUTING.md"
34
34
  ],
35
35
  "dependencies": {
36
- "agent-relay-sdk": "0.2.27"
36
+ "agent-relay-sdk": "0.2.28"
37
37
  },
38
38
  "scripts": {
39
39
  "prepack": "bun run build:dashboard:bundle >&2",
@@ -1,2 +1,2 @@
1
- import{r as e}from"./chunk-CilyBKbf.js";import{N as t,On as n,Un as r,X as i,Xt as a,Y as o,jn as s,jt as c,mn as l,ot as u,qt as d,u as f}from"./lucide-react-ChOGD4vc.js";import{a as p,t as m}from"./store-CtKmqMfx.js";import{H as h,h as g}from"./display-ConJ9cJB.js";import{t as _}from"./badge-CFVr4fG9.js";import{t as v}from"./button-BuTu0MHx.js";import{s as y}from"./index-CAnJGSBl.js";import{n as b,t as x}from"./card-C3ErQ372.js";var S=e(r(),1),C=s(),w={question:a,reply:o,message:i,operator:f,pair:u,task:d,state:t},T={question:`bg-blue-500/10 text-blue-400 border-blue-500/20`,reply:`bg-emerald-500/10 text-emerald-400 border-emerald-500/20`,message:`bg-zinc-500/10 text-zinc-400 border-zinc-500/20`,operator:`bg-purple-500/10 text-purple-400 border-purple-500/20`,pair:`bg-yellow-500/10 text-yellow-400 border-yellow-500/20`,task:`bg-orange-500/10 text-orange-400 border-orange-500/20`,state:`bg-cyan-500/10 text-cyan-400 border-cyan-500/20`},E=[`question`,`reply`,`message`,`operator`,`pair`,`task`,`state`];function D(e){let t=e?.surface;if(!t||typeof t!=`object`)return null;let n=t,r=[];return typeof n.component==`string`&&r.push(n.component),typeof n.view==`string`&&n.view!==n.component&&r.push(n.view),typeof n.session==`string`&&r.push(`tab ${n.session.slice(0,6)}`),typeof n.client==`string`&&r.push(`client ${n.client.slice(0,6)}`),r.length?r.join(` · `):null}function O(){let e=p(),t=m(e=>e.activityFilter),r=m(e=>e.activityEvents),i=m(e=>e.operatorActivity),a=m(e=>e.set),o=m(e=>e.openActivityItem),s=m(e=>e.exportActivity),u=(0,S.useMemo)(()=>{let e=[...r,...i],t=new Set,n=[];for(let r of e){let e=r.clientId||String(r.id);t.has(e)||(t.add(e),n.push(r))}return n.map(e=>({...e,ts:e.ts??new Date(e.createdAt).getTime()})).sort((e,t)=>(t.ts??0)-(e.ts??0))},[r,i]),d=(0,S.useMemo)(()=>t?u.filter(e=>e.kind===t):u,[u,t]);return(0,C.jsxs)(`div`,{className:`space-y-4`,children:[(0,C.jsxs)(`div`,{className:`flex items-center justify-between flex-wrap gap-2`,children:[(0,C.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,C.jsx)(n,{className:`w-5 h-5 text-muted-foreground`}),(0,C.jsx)(`h2`,{className:`text-lg font-semibold`,children:`Activity`}),(0,C.jsx)(_,{variant:`secondary`,children:d.length})]}),(0,C.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,C.jsxs)(`select`,{className:`rounded-md border border-input bg-background px-3 py-1.5 text-sm`,value:t,onChange:e=>a({activityFilter:e.target.value}),children:[(0,C.jsx)(`option`,{value:``,children:`All types`}),E.map(e=>(0,C.jsx)(`option`,{value:e,children:e},e))]}),(0,C.jsxs)(v,{size:`sm`,variant:`outline`,onClick:()=>s(`markdown`),children:[(0,C.jsx)(c,{className:`w-4 h-4 mr-1`}),` Markdown`]}),(0,C.jsxs)(v,{size:`sm`,variant:`outline`,onClick:()=>s(`json`),children:[(0,C.jsx)(l,{className:`w-4 h-4 mr-1`}),` JSON`]})]})]}),(0,C.jsx)(y,{className:`h-[calc(100dvh-11rem)]`,children:(0,C.jsxs)(`div`,{className:`space-y-2 pr-2`,children:[d.length===0&&(0,C.jsx)(`div`,{className:`text-center text-muted-foreground py-16 text-sm`,children:`No activity yet`}),d.map(t=>{let r=w[t.kind]||n,i=T[t.kind]||T.message,a=D(t.metadata);return(0,C.jsx)(x,{className:`cursor-pointer hover:bg-accent/40 transition-colors`,onClick:()=>o(t),children:(0,C.jsxs)(b,{className:`p-3 flex gap-3`,children:[(0,C.jsx)(`span`,{className:`inline-flex items-center justify-center w-7 h-7 rounded-md border shrink-0 mt-0.5 ${i}`,children:(0,C.jsx)(r,{className:`w-3.5 h-3.5`})}),(0,C.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,C.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,C.jsx)(`span`,{className:`font-medium text-sm truncate`,children:t.title}),(0,C.jsx)(_,{variant:`outline`,className:`text-xs px-1.5 py-0 border ${i}`,children:t.kind}),(0,C.jsx)(`span`,{className:`text-xs text-muted-foreground ml-auto shrink-0`,title:g(t.ts??t.createdAt),children:h(e,t.ts??t.createdAt)})]}),t.body&&(0,C.jsx)(`p`,{className:`text-xs text-muted-foreground mt-0.5 line-clamp-2`,children:t.body}),t.meta&&(0,C.jsx)(`p`,{className:`text-xs text-muted-foreground/60 mt-0.5 font-mono truncate`,children:t.meta}),a&&(0,C.jsxs)(`p`,{className:`text-xs text-muted-foreground/60 mt-0.5 truncate`,title:a,children:[(0,C.jsx)(`span`,{className:`opacity-70`,children:`via`}),` `,a]})]})]})},t.clientId||t.id)})]})})]})}export{O as ActivityView};
2
- //# sourceMappingURL=activity-G6l1nOLj.js.map
1
+ import{r as e}from"./chunk-CilyBKbf.js";import{N as t,On as n,Un as r,X as i,Xt as a,Y as o,jn as s,jt as c,mn as l,ot as u,qt as d,u as f}from"./lucide-react-ChOGD4vc.js";import{o as p,t as m}from"./store-B6qT5_de.js";import{H as h,h as g}from"./display-ConJ9cJB.js";import{t as _}from"./badge-CFVr4fG9.js";import{t as v}from"./button-BuTu0MHx.js";import{s as y}from"./index-CT10XH5Y.js";import{n as b,t as x}from"./card-C3ErQ372.js";var S=e(r(),1),C=s(),w={question:a,reply:o,message:i,operator:f,pair:u,task:d,state:t},T={question:`bg-blue-500/10 text-blue-400 border-blue-500/20`,reply:`bg-emerald-500/10 text-emerald-400 border-emerald-500/20`,message:`bg-zinc-500/10 text-zinc-400 border-zinc-500/20`,operator:`bg-purple-500/10 text-purple-400 border-purple-500/20`,pair:`bg-yellow-500/10 text-yellow-400 border-yellow-500/20`,task:`bg-orange-500/10 text-orange-400 border-orange-500/20`,state:`bg-cyan-500/10 text-cyan-400 border-cyan-500/20`},E=[`question`,`reply`,`message`,`operator`,`pair`,`task`,`state`];function D(e){let t=e?.surface;if(!t||typeof t!=`object`)return null;let n=t,r=[];return typeof n.component==`string`&&r.push(n.component),typeof n.view==`string`&&n.view!==n.component&&r.push(n.view),typeof n.session==`string`&&r.push(`tab ${n.session.slice(0,6)}`),typeof n.client==`string`&&r.push(`client ${n.client.slice(0,6)}`),r.length?r.join(` · `):null}function O(){let e=p(),t=m(e=>e.activityFilter),r=m(e=>e.activityEvents),i=m(e=>e.operatorActivity),a=m(e=>e.set),o=m(e=>e.openActivityItem),s=m(e=>e.exportActivity),u=(0,S.useMemo)(()=>{let e=[...r,...i],t=new Set,n=[];for(let r of e){let e=r.clientId||String(r.id);t.has(e)||(t.add(e),n.push(r))}return n.map(e=>({...e,ts:e.ts??new Date(e.createdAt).getTime()})).sort((e,t)=>(t.ts??0)-(e.ts??0))},[r,i]),d=(0,S.useMemo)(()=>t?u.filter(e=>e.kind===t):u,[u,t]);return(0,C.jsxs)(`div`,{className:`space-y-4`,children:[(0,C.jsxs)(`div`,{className:`flex items-center justify-between flex-wrap gap-2`,children:[(0,C.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,C.jsx)(n,{className:`w-5 h-5 text-muted-foreground`}),(0,C.jsx)(`h2`,{className:`text-lg font-semibold`,children:`Activity`}),(0,C.jsx)(_,{variant:`secondary`,children:d.length})]}),(0,C.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,C.jsxs)(`select`,{className:`rounded-md border border-input bg-background px-3 py-1.5 text-sm`,value:t,onChange:e=>a({activityFilter:e.target.value}),children:[(0,C.jsx)(`option`,{value:``,children:`All types`}),E.map(e=>(0,C.jsx)(`option`,{value:e,children:e},e))]}),(0,C.jsxs)(v,{size:`sm`,variant:`outline`,onClick:()=>s(`markdown`),children:[(0,C.jsx)(c,{className:`w-4 h-4 mr-1`}),` Markdown`]}),(0,C.jsxs)(v,{size:`sm`,variant:`outline`,onClick:()=>s(`json`),children:[(0,C.jsx)(l,{className:`w-4 h-4 mr-1`}),` JSON`]})]})]}),(0,C.jsx)(y,{className:`h-[calc(100dvh-11rem)]`,children:(0,C.jsxs)(`div`,{className:`space-y-2 pr-2`,children:[d.length===0&&(0,C.jsx)(`div`,{className:`text-center text-muted-foreground py-16 text-sm`,children:`No activity yet`}),d.map(t=>{let r=w[t.kind]||n,i=T[t.kind]||T.message,a=D(t.metadata);return(0,C.jsx)(x,{className:`cursor-pointer hover:bg-accent/40 transition-colors`,onClick:()=>o(t),children:(0,C.jsxs)(b,{className:`p-3 flex gap-3`,children:[(0,C.jsx)(`span`,{className:`inline-flex items-center justify-center w-7 h-7 rounded-md border shrink-0 mt-0.5 ${i}`,children:(0,C.jsx)(r,{className:`w-3.5 h-3.5`})}),(0,C.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,C.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,C.jsx)(`span`,{className:`font-medium text-sm truncate`,children:t.title}),(0,C.jsx)(_,{variant:`outline`,className:`text-xs px-1.5 py-0 border ${i}`,children:t.kind}),(0,C.jsx)(`span`,{className:`text-xs text-muted-foreground ml-auto shrink-0`,title:g(t.ts??t.createdAt),children:h(e,t.ts??t.createdAt)})]}),t.body&&(0,C.jsx)(`p`,{className:`text-xs text-muted-foreground mt-0.5 line-clamp-2`,children:t.body}),t.meta&&(0,C.jsx)(`p`,{className:`text-xs text-muted-foreground/60 mt-0.5 font-mono truncate`,children:t.meta}),a&&(0,C.jsxs)(`p`,{className:`text-xs text-muted-foreground/60 mt-0.5 truncate`,title:a,children:[(0,C.jsx)(`span`,{className:`opacity-70`,children:`via`}),` `,a]})]})]})},t.clientId||t.id)})]})})]})}export{O as ActivityView};
2
+ //# sourceMappingURL=activity-Dkzmef0Z.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"activity-G6l1nOLj.js","names":[],"sources":["../../dashboard/src/components/views/activity.tsx"],"sourcesContent":["import { useRelayStore, useNow } from '@/store'\nimport { useComposeAgents } from '@/hooks/use-selectors'\nimport { Card, CardContent } from '@/components/ui/card'\nimport { Badge } from '@/components/ui/badge'\nimport { Button } from '@/components/ui/button'\nimport { ScrollArea } from '@/components/ui/scroll-area'\nimport {\n Activity, MessageCircle, MessageSquareReply, HelpCircle, User,\n Link, ClipboardList, Radio, FileDown, Braces,\n} from 'lucide-react'\nimport { timeAgo, fmtTime } from '@/lib/display'\nimport type { ActivityEvent } from '@/types'\nimport { useMemo } from 'react'\n\nconst KIND_ICONS: Record<string, React.ElementType> = {\n question: HelpCircle,\n reply: MessageSquareReply,\n message: MessageCircle,\n operator: User,\n pair: Link,\n task: ClipboardList,\n state: Radio,\n}\n\nconst KIND_COLORS: Record<string, string> = {\n question: 'bg-blue-500/10 text-blue-400 border-blue-500/20',\n reply: 'bg-emerald-500/10 text-emerald-400 border-emerald-500/20',\n message: 'bg-zinc-500/10 text-zinc-400 border-zinc-500/20',\n operator: 'bg-purple-500/10 text-purple-400 border-purple-500/20',\n pair: 'bg-yellow-500/10 text-yellow-400 border-yellow-500/20',\n task: 'bg-orange-500/10 text-orange-400 border-orange-500/20',\n state: 'bg-cyan-500/10 text-cyan-400 border-cyan-500/20',\n}\n\nconst KIND_LABELS = ['question', 'reply', 'message', 'operator', 'pair', 'task', 'state'] as const\n\n// Compact attribution line for dashboard-initiated lifecycle commands (#172): identifies the\n// surface that issued a restart/shutdown/reconnect — component, SPA view, tab session, browser.\nfunction formatSurface(metadata: Record<string, unknown> | undefined): string | null {\n const surface = metadata?.surface\n if (!surface || typeof surface !== 'object') return null\n const s = surface as Record<string, unknown>\n const parts: string[] = []\n if (typeof s.component === 'string') parts.push(s.component)\n if (typeof s.view === 'string' && s.view !== s.component) parts.push(s.view)\n if (typeof s.session === 'string') parts.push(`tab ${s.session.slice(0, 6)}`)\n if (typeof s.client === 'string') parts.push(`client ${s.client.slice(0, 6)}`)\n return parts.length ? parts.join(' · ') : null\n}\n\nexport function ActivityView() {\n const now = useNow()\n const activityFilter = useRelayStore((s) => s.activityFilter)\n const activityEvents = useRelayStore((s) => s.activityEvents)\n const operatorActivity = useRelayStore((s) => s.operatorActivity)\n const set = useRelayStore((s) => s.set)\n const openActivityItem = useRelayStore((s) => s.openActivityItem)\n const exportActivity = useRelayStore((s) => s.exportActivity)\n\n const allItems = useMemo(() => {\n const merged = [...activityEvents, ...operatorActivity]\n const seen = new Set<string>()\n const deduped: ActivityEvent[] = []\n for (const item of merged) {\n const key = item.clientId || String(item.id)\n if (!seen.has(key)) { seen.add(key); deduped.push(item) }\n }\n return deduped\n .map((e) => ({ ...e, ts: e.ts ?? new Date(e.createdAt as string).getTime() }))\n .sort((a, b) => (b.ts ?? 0) - (a.ts ?? 0))\n }, [activityEvents, operatorActivity])\n\n const filtered = useMemo(() => {\n if (!activityFilter) return allItems\n return allItems.filter((e) => e.kind === activityFilter)\n }, [allItems, activityFilter])\n\n return (\n <div className=\"space-y-4\">\n <div className=\"flex items-center justify-between flex-wrap gap-2\">\n <div className=\"flex items-center gap-2\">\n <Activity className=\"w-5 h-5 text-muted-foreground\" />\n <h2 className=\"text-lg font-semibold\">Activity</h2>\n <Badge variant=\"secondary\">{filtered.length}</Badge>\n </div>\n <div className=\"flex items-center gap-2\">\n <select\n className=\"rounded-md border border-input bg-background px-3 py-1.5 text-sm\"\n value={activityFilter}\n onChange={(e) => set({ activityFilter: e.target.value })}\n >\n <option value=\"\">All types</option>\n {KIND_LABELS.map((k) => <option key={k} value={k}>{k}</option>)}\n </select>\n <Button size=\"sm\" variant=\"outline\" onClick={() => exportActivity('markdown')}>\n <FileDown className=\"w-4 h-4 mr-1\" /> Markdown\n </Button>\n <Button size=\"sm\" variant=\"outline\" onClick={() => exportActivity('json')}>\n <Braces className=\"w-4 h-4 mr-1\" /> JSON\n </Button>\n </div>\n </div>\n\n <ScrollArea className=\"h-[calc(100dvh-11rem)]\">\n <div className=\"space-y-2 pr-2\">\n {filtered.length === 0 && (\n <div className=\"text-center text-muted-foreground py-16 text-sm\">No activity yet</div>\n )}\n {filtered.map((item) => {\n const Icon = KIND_ICONS[item.kind] || Activity\n const colorClass = KIND_COLORS[item.kind] || KIND_COLORS.message\n const surface = formatSurface(item.metadata)\n return (\n <Card\n key={item.clientId || item.id}\n className=\"cursor-pointer hover:bg-accent/40 transition-colors\"\n onClick={() => openActivityItem(item)}\n >\n <CardContent className=\"p-3 flex gap-3\">\n <span className={`inline-flex items-center justify-center w-7 h-7 rounded-md border shrink-0 mt-0.5 ${colorClass}`}>\n <Icon className=\"w-3.5 h-3.5\" />\n </span>\n <div className=\"flex-1 min-w-0\">\n <div className=\"flex items-center gap-2 flex-wrap\">\n <span className=\"font-medium text-sm truncate\">{item.title}</span>\n <Badge variant=\"outline\" className={`text-xs px-1.5 py-0 border ${colorClass}`}>{item.kind}</Badge>\n <span className=\"text-xs text-muted-foreground ml-auto shrink-0\" title={fmtTime(item.ts ?? item.createdAt)}>\n {timeAgo(now, item.ts ?? item.createdAt)}\n </span>\n </div>\n {item.body && (\n <p className=\"text-xs text-muted-foreground mt-0.5 line-clamp-2\">{item.body}</p>\n )}\n {item.meta && (\n <p className=\"text-xs text-muted-foreground/60 mt-0.5 font-mono truncate\">{item.meta}</p>\n )}\n {surface && (\n <p className=\"text-xs text-muted-foreground/60 mt-0.5 truncate\" title={surface}>\n <span className=\"opacity-70\">via</span> {surface}\n </p>\n )}\n </div>\n </CardContent>\n </Card>\n )\n })}\n </div>\n </ScrollArea>\n </div>\n )\n}\n"],"mappings":"wcAcM,EAAgD,CACpD,SAAU,EACV,MAAO,EACP,QAAS,EACT,SAAU,EACV,KAAM,EACN,KAAM,EACN,MAAO,EACR,CAEK,EAAsC,CAC1C,SAAU,kDACV,MAAO,2DACP,QAAS,kDACT,SAAU,wDACV,KAAM,wDACN,KAAM,wDACN,MAAO,kDACR,CAEK,EAAc,CAAC,WAAY,QAAS,UAAW,WAAY,OAAQ,OAAQ,QAAQ,CAIzF,SAAS,EAAc,EAA8D,CACnF,IAAM,EAAU,GAAU,QAC1B,GAAI,CAAC,GAAW,OAAO,GAAY,SAAU,OAAO,KACpD,IAAM,EAAI,EACJ,EAAkB,EAAE,CAK1B,OAJI,OAAO,EAA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,QACnD,EAAU,EAAc,EAAK,SAAS,CAC5C,OACE,EAAA,EAAA,KAAC,EAAD,CAEE,UAAU,sDACV,YAAe,EAAiB,EAAK,WAErC,EAAA,EAAA,MAAC,EAAD,CAAa,UAAU,0BAAvB,EACE,EAAA,EAAA,KAAC,OAAD,CAAM,UAAW,qFAAqF,cACpG,EAAA,EAAA,KAAC,EAAD,CAAM,UAAU,cAAgB,CAAA,CAC3B,CAAA,EACP,EAAA,EAAA,MAAC,MAAD,CAAK,UAAU,0BAAf,EACE,EAAA,EAAA,MAAC,MAAD,CAAK,UAAU,6CAAf,EACE,EAAA,EAAA,KAAC,OAAD,CAAM,UAAU,wCAAgC,EAAK,MAAa,CAAA,EAClE,EAAA,EAAA,KAAC,EAAD,CAAO,QAAQ,UAAU,UAAW,8BAA8B,aAAe,EAAK,KAAa,CAAA,EACnG,EAAA,EAAA,KAAC,OAAD,CAAM,UAAU,iDAAiD,MAAO,EAAQ,EAAK,IAAM,EAAK,UAAU,UACvG,EAAQ,EAAK,EAAK,IAAM,EAAK,UAAU,CACnC,CAAA,CACH,GACL,EAAK,OACJ,EAAA,EAAA,KAAC,IAAD,CAAG,UAAU,6DAAqD,EAAK,KAAS,CAAA,CAEjF,EAAK,OACJ,EAAA,EAAA,KAAC,IAAD,CAAG,UAAU,sEAA8D,EAAK,KAAS,CAAA,CAE1F,IACC,EAAA,EAAA,MAAC,IAAD,CAAG,UAAU,mDAAmD,MAAO,WAAvE,EACE,EAAA,EAAA,KAAC,OAAD,CAAM,UAAU,sBAAa,MAAU,CAAA,KAAE,EACvC,GAEF,GACM,GACT,CA7BA,EAAK,UAAY,EAAK,GA6BtB,EAET,CACE,GACK,CAAA,CACT"}
1
+ {"version":3,"file":"activity-Dkzmef0Z.js","names":[],"sources":["../../dashboard/src/components/views/activity.tsx"],"sourcesContent":["import { useRelayStore, useNow } from '@/store'\nimport { useComposeAgents } from '@/hooks/use-selectors'\nimport { Card, CardContent } from '@/components/ui/card'\nimport { Badge } from '@/components/ui/badge'\nimport { Button } from '@/components/ui/button'\nimport { ScrollArea } from '@/components/ui/scroll-area'\nimport {\n Activity, MessageCircle, MessageSquareReply, HelpCircle, User,\n Link, ClipboardList, Radio, FileDown, Braces,\n} from 'lucide-react'\nimport { timeAgo, fmtTime } from '@/lib/display'\nimport type { ActivityEvent } from '@/types'\nimport { useMemo } from 'react'\n\nconst KIND_ICONS: Record<string, React.ElementType> = {\n question: HelpCircle,\n reply: MessageSquareReply,\n message: MessageCircle,\n operator: User,\n pair: Link,\n task: ClipboardList,\n state: Radio,\n}\n\nconst KIND_COLORS: Record<string, string> = {\n question: 'bg-blue-500/10 text-blue-400 border-blue-500/20',\n reply: 'bg-emerald-500/10 text-emerald-400 border-emerald-500/20',\n message: 'bg-zinc-500/10 text-zinc-400 border-zinc-500/20',\n operator: 'bg-purple-500/10 text-purple-400 border-purple-500/20',\n pair: 'bg-yellow-500/10 text-yellow-400 border-yellow-500/20',\n task: 'bg-orange-500/10 text-orange-400 border-orange-500/20',\n state: 'bg-cyan-500/10 text-cyan-400 border-cyan-500/20',\n}\n\nconst KIND_LABELS = ['question', 'reply', 'message', 'operator', 'pair', 'task', 'state'] as const\n\n// Compact attribution line for dashboard-initiated lifecycle commands (#172): identifies the\n// surface that issued a restart/shutdown/reconnect — component, SPA view, tab session, browser.\nfunction formatSurface(metadata: Record<string, unknown> | undefined): string | null {\n const surface = metadata?.surface\n if (!surface || typeof surface !== 'object') return null\n const s = surface as Record<string, unknown>\n const parts: string[] = []\n if (typeof s.component === 'string') parts.push(s.component)\n if (typeof s.view === 'string' && s.view !== s.component) parts.push(s.view)\n if (typeof s.session === 'string') parts.push(`tab ${s.session.slice(0, 6)}`)\n if (typeof s.client === 'string') parts.push(`client ${s.client.slice(0, 6)}`)\n return parts.length ? parts.join(' · ') : null\n}\n\nexport function ActivityView() {\n const now = useNow()\n const activityFilter = useRelayStore((s) => s.activityFilter)\n const activityEvents = useRelayStore((s) => s.activityEvents)\n const operatorActivity = useRelayStore((s) => s.operatorActivity)\n const set = useRelayStore((s) => s.set)\n const openActivityItem = useRelayStore((s) => s.openActivityItem)\n const exportActivity = useRelayStore((s) => s.exportActivity)\n\n const allItems = useMemo(() => {\n const merged = [...activityEvents, ...operatorActivity]\n const seen = new Set<string>()\n const deduped: ActivityEvent[] = []\n for (const item of merged) {\n const key = item.clientId || String(item.id)\n if (!seen.has(key)) { seen.add(key); deduped.push(item) }\n }\n return deduped\n .map((e) => ({ ...e, ts: e.ts ?? new Date(e.createdAt as string).getTime() }))\n .sort((a, b) => (b.ts ?? 0) - (a.ts ?? 0))\n }, [activityEvents, operatorActivity])\n\n const filtered = useMemo(() => {\n if (!activityFilter) return allItems\n return allItems.filter((e) => e.kind === activityFilter)\n }, [allItems, activityFilter])\n\n return (\n <div className=\"space-y-4\">\n <div className=\"flex items-center justify-between flex-wrap gap-2\">\n <div className=\"flex items-center gap-2\">\n <Activity className=\"w-5 h-5 text-muted-foreground\" />\n <h2 className=\"text-lg font-semibold\">Activity</h2>\n <Badge variant=\"secondary\">{filtered.length}</Badge>\n </div>\n <div className=\"flex items-center gap-2\">\n <select\n className=\"rounded-md border border-input bg-background px-3 py-1.5 text-sm\"\n value={activityFilter}\n onChange={(e) => set({ activityFilter: e.target.value })}\n >\n <option value=\"\">All types</option>\n {KIND_LABELS.map((k) => <option key={k} value={k}>{k}</option>)}\n </select>\n <Button size=\"sm\" variant=\"outline\" onClick={() => exportActivity('markdown')}>\n <FileDown className=\"w-4 h-4 mr-1\" /> Markdown\n </Button>\n <Button size=\"sm\" variant=\"outline\" onClick={() => exportActivity('json')}>\n <Braces className=\"w-4 h-4 mr-1\" /> JSON\n </Button>\n </div>\n </div>\n\n <ScrollArea className=\"h-[calc(100dvh-11rem)]\">\n <div className=\"space-y-2 pr-2\">\n {filtered.length === 0 && (\n <div className=\"text-center text-muted-foreground py-16 text-sm\">No activity yet</div>\n )}\n {filtered.map((item) => {\n const Icon = KIND_ICONS[item.kind] || Activity\n const colorClass = KIND_COLORS[item.kind] || KIND_COLORS.message\n const surface = formatSurface(item.metadata)\n return (\n <Card\n key={item.clientId || item.id}\n className=\"cursor-pointer hover:bg-accent/40 transition-colors\"\n onClick={() => openActivityItem(item)}\n >\n <CardContent className=\"p-3 flex gap-3\">\n <span className={`inline-flex items-center justify-center w-7 h-7 rounded-md border shrink-0 mt-0.5 ${colorClass}`}>\n <Icon className=\"w-3.5 h-3.5\" />\n </span>\n <div className=\"flex-1 min-w-0\">\n <div className=\"flex items-center gap-2 flex-wrap\">\n <span className=\"font-medium text-sm truncate\">{item.title}</span>\n <Badge variant=\"outline\" className={`text-xs px-1.5 py-0 border ${colorClass}`}>{item.kind}</Badge>\n <span className=\"text-xs text-muted-foreground ml-auto shrink-0\" title={fmtTime(item.ts ?? item.createdAt)}>\n {timeAgo(now, item.ts ?? item.createdAt)}\n </span>\n </div>\n {item.body && (\n <p className=\"text-xs text-muted-foreground mt-0.5 line-clamp-2\">{item.body}</p>\n )}\n {item.meta && (\n <p className=\"text-xs text-muted-foreground/60 mt-0.5 font-mono truncate\">{item.meta}</p>\n )}\n {surface && (\n <p className=\"text-xs text-muted-foreground/60 mt-0.5 truncate\" title={surface}>\n <span className=\"opacity-70\">via</span> {surface}\n </p>\n )}\n </div>\n </CardContent>\n </Card>\n )\n })}\n </div>\n </ScrollArea>\n </div>\n )\n}\n"],"mappings":"wcAcM,EAAgD,CACpD,SAAU,EACV,MAAO,EACP,QAAS,EACT,SAAU,EACV,KAAM,EACN,KAAM,EACN,MAAO,EACR,CAEK,EAAsC,CAC1C,SAAU,kDACV,MAAO,2DACP,QAAS,kDACT,SAAU,wDACV,KAAM,wDACN,KAAM,wDACN,MAAO,kDACR,CAEK,EAAc,CAAC,WAAY,QAAS,UAAW,WAAY,OAAQ,OAAQ,QAAQ,CAIzF,SAAS,EAAc,EAA8D,CACnF,IAAM,EAAU,GAAU,QAC1B,GAAI,CAAC,GAAW,OAAO,GAAY,SAAU,OAAO,KACpD,IAAM,EAAI,EAC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.js";import{t as l}from"./button-BuTu0MHx.js";var u=i(),d={host:`text-emerald-400 bg-emerald-500/10`,minimal:`text-amber-400 bg-amber-500/10`,isolated:`text-red-400 bg-red-500/10`};function f({relay:e}){return(0,u.jsx)(`div`,{className:`flex items-center gap-1`,children:[{key:`ctx`,on:e.context},{key:`skl`,on:e.skills},{key:`plg`,on:e.plugins},{key:`stl`,on:e.statusLine}].map(e=>(0,u.jsx)(`span`,{className:`inline-block h-1.5 w-1.5 rounded-full ${e.on?`bg-emerald-400`:`bg-muted-foreground/30`}`,title:`${e.key}: ${e.on?`on`:`off`}`},e.key))})}function p({profile:t}){let r=s(e=>e.openProfileModal),i=s(e=>e.deleteProfile),p=t.builtIn===!0;return(0,u.jsxs)(`div`,{className:`group flex flex-col gap-3 rounded-lg border border-border bg-card p-4`,children:[(0,u.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,u.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,u.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,u.jsx)(`span`,{className:`font-mono text-sm font-medium`,children:t.name}),p&&(0,u.jsx)(c,{variant:`secondary`,className:`text-[10px]`,children:`Built-in`})]}),t.description&&(0,u.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground line-clamp-2`,children:t.description})]}),(0,u.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5 opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-opacity`,children:[(0,u.jsx)(l,{variant:`ghost`,size:`icon-sm`,className:`h-7 w-7`,title:`View`,onClick:()=>r(`view`,t),children:(0,u.jsx)(n,{className:`h-3.5 w-3.5`})}),!p&&(0,u.jsx)(l,{variant:`ghost`,size:`icon-sm`,className:`h-7 w-7`,title:`Edit`,onClick:()=>r(`edit`,t),children:(0,u.jsx)(o,{className:`h-3.5 w-3.5`})}),(0,u.jsx)(l,{variant:`ghost`,size:`icon-sm`,className:`h-7 w-7`,title:`Duplicate`,onClick:()=>r(`duplicate`,t),children:(0,u.jsx)(e,{className:`h-3.5 w-3.5`})}),!p&&(0,u.jsx)(l,{variant:`ghost`,size:`icon-sm`,className:`h-7 w-7 text-destructive`,title:`Delete`,onClick:()=>i(t.name),children:(0,u.jsx)(a,{className:`h-3.5 w-3.5`})})]})]}),(0,u.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 text-[10px]`,children:[(0,u.jsx)(c,{variant:`outline`,className:d[t.base]||``,children:t.base}),(0,u.jsx)(c,{variant:`outline`,children:t.provider||`any`}),(0,u.jsxs)(c,{variant:`outline`,children:[`fs: `,t.permissions.filesystem]}),t.permissions.mode&&(0,u.jsx)(c,{variant:`outline`,children:t.permissions.mode})]}),(0,u.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1 text-[10px] text-muted-foreground`,children:[(0,u.jsxs)(`span`,{className:`flex items-center gap-1`,children:[`Relay `,(0,u.jsx)(f,{relay:t.relay})]}),(0,u.jsxs)(`span`,{children:[`MCP: `,t.mcp.mode]}),(0,u.jsxs)(`span`,{children:[`Hooks: `,t.hooks.mode]}),t.instructions.globalInstructions===`ignore`&&(0,u.jsx)(`span`,{className:`text-amber-400`,children:`global: ignore`}),Object.keys(t.env||{}).length>0&&(0,u.jsxs)(`span`,{children:[Object.keys(t.env).length,` env vars`]})]})]})}function m(){let e=s(e=>e.agentProfiles),n=s(e=>e.openProfileModal),i=e.filter(e=>e.builtIn),a=e.filter(e=>!e.builtIn);return(0,u.jsxs)(`div`,{className:`space-y-4`,children:[(0,u.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,u.jsxs)(`div`,{className:`flex items-center gap-2 text-lg font-semibold`,children:[(0,u.jsx)(r,{className:`h-5 w-5 text-primary`}),`Agent Profiles`]}),(0,u.jsx)(c,{variant:`outline`,children:e.length}),(0,u.jsx)(`div`,{className:`flex-1`}),(0,u.jsxs)(l,{size:`sm`,className:`gap-1`,onClick:()=>n(`create`),children:[(0,u.jsx)(t,{className:`h-3.5 w-3.5`}),`Create Profile`]})]}),i.length>0&&(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`h3`,{className:`mb-2 text-xs font-medium text-muted-foreground uppercase tracking-wider`,children:`Built-in`}),(0,u.jsx)(`div`,{className:`grid gap-3 grid-cols-1 sm:grid-cols-2 lg:grid-cols-3`,children:i.map(e=>(0,u.jsx)(p,{profile:e},e.name))})]}),a.length>0&&(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`h3`,{className:`mb-2 text-xs font-medium text-muted-foreground uppercase tracking-wider`,children:`Custom`}),(0,u.jsx)(`div`,{className:`grid gap-3 grid-cols-1 sm:grid-cols-2 lg:grid-cols-3`,children:a.map(e=>(0,u.jsx)(p,{profile:e},e.name))})]}),e.length===0&&(0,u.jsx)(`div`,{className:`py-12 text-center text-sm text-muted-foreground`,children:`No agent profiles found. Create one to configure agent behavior.`})]})}export{m as AgentProfilesView};
2
- //# sourceMappingURL=agent-profiles-BWKpVoNw.js.map
1
+ import{Ht as e,I as t,Nt as n,f as r,jn as i,m as a,z as o}from"./lucide-react-ChOGD4vc.js";import{t as s}from"./store-B6qT5_de.js";import{t as c}from"./badge-CFVr4fG9.js";import{t as l}from"./button-BuTu0MHx.js";var u=i(),d={host:`text-emerald-400 bg-emerald-500/10`,minimal:`text-amber-400 bg-amber-500/10`,isolated:`text-red-400 bg-red-500/10`};function f({relay:e}){return(0,u.jsx)(`div`,{className:`flex items-center gap-1`,children:[{key:`ctx`,on:e.context},{key:`skl`,on:e.skills},{key:`plg`,on:e.plugins},{key:`stl`,on:e.statusLine}].map(e=>(0,u.jsx)(`span`,{className:`inline-block h-1.5 w-1.5 rounded-full ${e.on?`bg-emerald-400`:`bg-muted-foreground/30`}`,title:`${e.key}: ${e.on?`on`:`off`}`},e.key))})}function p({profile:t}){let r=s(e=>e.openProfileModal),i=s(e=>e.deleteProfile),p=t.builtIn===!0;return(0,u.jsxs)(`div`,{className:`group flex flex-col gap-3 rounded-lg border border-border bg-card p-4`,children:[(0,u.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,u.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,u.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,u.jsx)(`span`,{className:`font-mono text-sm font-medium`,children:t.name}),p&&(0,u.jsx)(c,{variant:`secondary`,className:`text-[10px]`,children:`Built-in`})]}),t.description&&(0,u.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground line-clamp-2`,children:t.description})]}),(0,u.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5 opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-opacity`,children:[(0,u.jsx)(l,{variant:`ghost`,size:`icon-sm`,className:`h-7 w-7`,title:`View`,onClick:()=>r(`view`,t),children:(0,u.jsx)(n,{className:`h-3.5 w-3.5`})}),!p&&(0,u.jsx)(l,{variant:`ghost`,size:`icon-sm`,className:`h-7 w-7`,title:`Edit`,onClick:()=>r(`edit`,t),children:(0,u.jsx)(o,{className:`h-3.5 w-3.5`})}),(0,u.jsx)(l,{variant:`ghost`,size:`icon-sm`,className:`h-7 w-7`,title:`Duplicate`,onClick:()=>r(`duplicate`,t),children:(0,u.jsx)(e,{className:`h-3.5 w-3.5`})}),!p&&(0,u.jsx)(l,{variant:`ghost`,size:`icon-sm`,className:`h-7 w-7 text-destructive`,title:`Delete`,onClick:()=>i(t.name),children:(0,u.jsx)(a,{className:`h-3.5 w-3.5`})})]})]}),(0,u.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 text-[10px]`,children:[(0,u.jsx)(c,{variant:`outline`,className:d[t.base]||``,children:t.base}),(0,u.jsx)(c,{variant:`outline`,children:t.provider||`any`}),(0,u.jsxs)(c,{variant:`outline`,children:[`fs: `,t.permissions.filesystem]}),t.permissions.mode&&(0,u.jsx)(c,{variant:`outline`,children:t.permissions.mode})]}),(0,u.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1 text-[10px] text-muted-foreground`,children:[(0,u.jsxs)(`span`,{className:`flex items-center gap-1`,children:[`Relay `,(0,u.jsx)(f,{relay:t.relay})]}),(0,u.jsxs)(`span`,{children:[`MCP: `,t.mcp.mode]}),(0,u.jsxs)(`span`,{children:[`Hooks: `,t.hooks.mode]}),t.instructions.globalInstructions===`ignore`&&(0,u.jsx)(`span`,{className:`text-amber-400`,children:`global: ignore`}),Object.keys(t.env||{}).length>0&&(0,u.jsxs)(`span`,{children:[Object.keys(t.env).length,` env vars`]})]})]})}function m(){let e=s(e=>e.agentProfiles),n=s(e=>e.openProfileModal),i=e.filter(e=>e.builtIn),a=e.filter(e=>!e.builtIn);return(0,u.jsxs)(`div`,{className:`space-y-4`,children:[(0,u.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,u.jsxs)(`div`,{className:`flex items-center gap-2 text-lg font-semibold`,children:[(0,u.jsx)(r,{className:`h-5 w-5 text-primary`}),`Agent Profiles`]}),(0,u.jsx)(c,{variant:`outline`,children:e.length}),(0,u.jsx)(`div`,{className:`flex-1`}),(0,u.jsxs)(l,{size:`sm`,className:`gap-1`,onClick:()=>n(`create`),children:[(0,u.jsx)(t,{className:`h-3.5 w-3.5`}),`Create Profile`]})]}),i.length>0&&(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`h3`,{className:`mb-2 text-xs font-medium text-muted-foreground uppercase tracking-wider`,children:`Built-in`}),(0,u.jsx)(`div`,{className:`grid gap-3 grid-cols-1 sm:grid-cols-2 lg:grid-cols-3`,children:i.map(e=>(0,u.jsx)(p,{profile:e},e.name))})]}),a.length>0&&(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`h3`,{className:`mb-2 text-xs font-medium text-muted-foreground uppercase tracking-wider`,children:`Custom`}),(0,u.jsx)(`div`,{className:`grid gap-3 grid-cols-1 sm:grid-cols-2 lg:grid-cols-3`,children:a.map(e=>(0,u.jsx)(p,{profile:e},e.name))})]}),e.length===0&&(0,u.jsx)(`div`,{className:`py-12 text-center text-sm text-muted-foreground`,children:`No agent profiles found. Create one to configure agent behavior.`})]})}export{m as AgentProfilesView};
2
+ //# sourceMappingURL=agent-profiles-DQYHMAyu.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"agent-profiles-BWKpVoNw.js","names":[],"sources":["../../dashboard/src/components/views/agent-profiles.tsx"],"sourcesContent":["import { useRelayStore } from '@/store'\nimport { Button } from '@/components/ui/button'\nimport { Badge } from '@/components/ui/badge'\nimport { Copy, Eye, Pencil, Plus, Trash2, UserCog } from 'lucide-react'\nimport type { AgentProfile } from '@/types'\n\nconst BASE_COLORS: Record<string, string> = {\n host: 'text-emerald-400 bg-emerald-500/10',\n minimal: 'text-amber-400 bg-amber-500/10',\n isolated: 'text-red-400 bg-red-500/10',\n}\n\nfunction RelayDots({ relay }: { relay: AgentProfile['relay'] }) {\n const items = [\n { key: 'ctx', on: relay.context },\n { key: 'skl', on: relay.skills },\n { key: 'plg', on: relay.plugins },\n { key: 'stl', on: relay.statusLine },\n ]\n return (\n <div className=\"flex items-center gap-1\">\n {items.map((item) => (\n <span key={item.key} className={`inline-block h-1.5 w-1.5 rounded-full ${item.on ? 'bg-emerald-400' : 'bg-muted-foreground/30'}`} title={`${item.key}: ${item.on ? 'on' : 'off'}`} />\n ))}\n </div>\n )\n}\n\nfunction ProfileCard({ profile }: { profile: AgentProfile }) {\n const openProfileModal = useRelayStore((s) => s.openProfileModal)\n const deleteProfile = useRelayStore((s) => s.deleteProfile)\n const isBuiltIn = profile.builtIn === true\n\n return (\n <div className=\"group flex flex-col gap-3 rounded-lg border border-border bg-card p-4\">\n <div className=\"flex items-start gap-2\">\n <div className=\"min-w-0 flex-1\">\n <div className=\"flex items-center gap-2\">\n <span className=\"font-mono text-sm font-medium\">{profile.name}</span>\n {isBuiltIn && <Badge variant=\"secondary\" className=\"text-[10px]\">Built-in</Badge>}\n </div>\n {profile.description && (\n <p className=\"mt-0.5 text-xs text-muted-foreground line-clamp-2\">{profile.description}</p>\n )}\n </div>\n <div className=\"flex shrink-0 items-center gap-0.5 opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-opacity\">\n <Button variant=\"ghost\" size=\"icon-sm\" className=\"h-7 w-7\" title=\"View\" onClick={() => openProfileModal('view', profile)}>\n <Eye className=\"h-3.5 w-3.5\" />\n </Button>\n {!isBuiltIn && (\n <Button variant=\"ghost\" size=\"icon-sm\" className=\"h-7 w-7\" title=\"Edit\" onClick={() => openProfileModal('edit', profile)}>\n <Pencil className=\"h-3.5 w-3.5\" />\n </Button>\n )}\n <Button variant=\"ghost\" size=\"icon-sm\" className=\"h-7 w-7\" title=\"Duplicate\" onClick={() => openProfileModal('duplicate', profile)}>\n <Copy className=\"h-3.5 w-3.5\" />\n </Button>\n {!isBuiltIn && (\n <Button variant=\"ghost\" size=\"icon-sm\" className=\"h-7 w-7 text-destructive\" title=\"Delete\" onClick={() => deleteProfile(profile.name)}>\n <Trash2 className=\"h-3.5 w-3.5\" />\n </Button>\n )}\n </div>\n </div>\n\n <div className=\"flex flex-wrap items-center gap-1.5 text-[10px]\">\n <Badge variant=\"outline\" className={BASE_COLORS[profile.base] || ''}>{profile.base}</Badge>\n <Badge variant=\"outline\">{profile.provider || 'any'}</Badge>\n <Badge variant=\"outline\">fs: {profile.permissions.filesystem}</Badge>\n {profile.permissions.mode && <Badge variant=\"outline\">{profile.permissions.mode}</Badge>}\n </div>\n\n <div className=\"flex flex-wrap items-center gap-x-4 gap-y-1 text-[10px] text-muted-foreground\">\n <span className=\"flex items-center gap-1\">\n Relay <RelayDots relay={profile.relay} />\n </span>\n <span>MCP: {profile.mcp.mode}</span>\n <span>Hooks: {profile.hooks.mode}</span>\n {profile.instructions.globalInstructions === 'ignore' && <span className=\"text-amber-400\">global: ignore</span>}\n {Object.keys(profile.env || {}).length > 0 && <span>{Object.keys(profile.env).length} env vars</span>}\n </div>\n </div>\n )\n}\n\nexport function AgentProfilesView() {\n const profiles = useRelayStore((s) => s.agentProfiles)\n const openProfileModal = useRelayStore((s) => s.openProfileModal)\n\n const builtIn = profiles.filter((p) => p.builtIn)\n const custom = profiles.filter((p) => !p.builtIn)\n\n return (\n <div className=\"space-y-4\">\n <div className=\"flex flex-wrap items-center gap-2\">\n <div className=\"flex items-center gap-2 text-lg font-semibold\">\n <UserCog className=\"h-5 w-5 text-primary\" />\n Agent Profiles\n </div>\n <Badge variant=\"outline\">{profiles.length}</Badge>\n <div className=\"flex-1\" />\n <Button size=\"sm\" className=\"gap-1\" onClick={() => openProfileModal('create')}>\n <Plus className=\"h-3.5 w-3.5\" />\n Create Profile\n </Button>\n </div>\n\n {builtIn.length > 0 && (\n <div>\n <h3 className=\"mb-2 text-xs font-medium text-muted-foreground uppercase tracking-wider\">Built-in</h3>\n <div className=\"grid gap-3 grid-cols-1 sm:grid-cols-2 lg:grid-cols-3\">\n {builtIn.map((p) => <ProfileCard key={p.name} profile={p} />)}\n </div>\n </div>\n )}\n\n {custom.length > 0 && (\n <div>\n <h3 className=\"mb-2 text-xs font-medium text-muted-foreground uppercase tracking-wider\">Custom</h3>\n <div className=\"grid gap-3 grid-cols-1 sm:grid-cols-2 lg:grid-cols-3\">\n {custom.map((p) => <ProfileCard key={p.name} profile={p} />)}\n </div>\n </div>\n )}\n\n {profiles.length === 0 && (\n <div className=\"py-12 text-center text-sm text-muted-foreground\">\n No agent profiles found. Create one to configure agent behavior.\n </div>\n )}\n </div>\n )\n}\n"],"mappings":"+NAMM,EAAsC,CAC1C,KAAM,qCACN,QAAS,iCACT,SAAU,6BACX,CAED,SAAS,EAAU,CAAE,SAA2C,CAO9D,OACE,EAAA,EAAA,KAAC,MAAD,CAAK,UAAU,mCACZ,CAPH,CAAE,IAAK,MAAO,GAAI,EAAM,QAAS,CACjC,CAAE,IAAK,MAAO,GAAI,EAAM,OAAQ,CAChC,CAAE,IAAK,MAAO,GAAI,EAAM,QAAS,CACjC,CAAE,IAAK,MAAO,GAAI,EAAM,WAAY,CAIjC,CAAM,IAAK,IACV,EAAA,EAAA,KAAC,OAAD,CAAqB,UAAW,yCAAyC,EAAK,GAAK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AAO,IAAK,IAAM,EAAA,EAAA,KAAC,EAAD,CAA0B,QAAS,EAAK,CAAtB,EAAE,KAAoB,CAAC,CACxD,CAAA,CACF,CAAA,CAAA,CAGP,EAAS,SAAW,IACnB,EAAA,EAAA,KAAC,MAAD,CAAK,UAAU,2DAAkD,mEAE3D,CAAA,CAEJ"}
1
+ {"version":3,"file":"agent-profiles-DQYHMAyu.js","names":[],"sources":["../../dashboard/src/components/views/agent-profiles.tsx"],"sourcesContent":["import { useRelayStore } from '@/store'\nimport { Button } from '@/components/ui/button'\nimport { Badge } from '@/components/ui/badge'\nimport { Copy, Eye, Pencil, Plus, Trash2, UserCog } from 'lucide-react'\nimport type { AgentProfile } from '@/types'\n\nconst BASE_COLORS: Record<string, string> = {\n host: 'text-emerald-400 bg-emerald-500/10',\n minimal: 'text-amber-400 bg-amber-500/10',\n isolated: 'text-red-400 bg-red-500/10',\n}\n\nfunction RelayDots({ relay }: { relay: AgentProfile['relay'] }) {\n const items = [\n { key: 'ctx', on: relay.context },\n { key: 'skl', on: relay.skills },\n { key: 'plg', on: relay.plugins },\n { key: 'stl', on: relay.statusLine },\n ]\n return (\n <div className=\"flex items-center gap-1\">\n {items.map((item) => (\n <span key={item.key} className={`inline-block h-1.5 w-1.5 rounded-full ${item.on ? 'bg-emerald-400' : 'bg-muted-foreground/30'}`} title={`${item.key}: ${item.on ? 'on' : 'off'}`} />\n ))}\n </div>\n )\n}\n\nfunction ProfileCard({ profile }: { profile: AgentProfile }) {\n const openProfileModal = useRelayStore((s) => s.openProfileModal)\n const deleteProfile = useRelayStore((s) => s.deleteProfile)\n const isBuiltIn = profile.builtIn === true\n\n return (\n <div className=\"group flex flex-col gap-3 rounded-lg border border-border bg-card p-4\">\n <div className=\"flex items-start gap-2\">\n <div className=\"min-w-0 flex-1\">\n <div className=\"flex items-center gap-2\">\n <span className=\"font-mono text-sm font-medium\">{profile.name}</span>\n {isBuiltIn && <Badge variant=\"secondary\" className=\"text-[10px]\">Built-in</Badge>}\n </div>\n {profile.description && (\n <p className=\"mt-0.5 text-xs text-muted-foreground line-clamp-2\">{profile.description}</p>\n )}\n </div>\n <div className=\"flex shrink-0 items-center gap-0.5 opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-opacity\">\n <Button variant=\"ghost\" size=\"icon-sm\" className=\"h-7 w-7\" title=\"View\" onClick={() => openProfileModal('view', profile)}>\n <Eye className=\"h-3.5 w-3.5\" />\n </Button>\n {!isBuiltIn && (\n <Button variant=\"ghost\" size=\"icon-sm\" className=\"h-7 w-7\" title=\"Edit\" onClick={() => openProfileModal('edit', profile)}>\n <Pencil className=\"h-3.5 w-3.5\" />\n </Button>\n )}\n <Button variant=\"ghost\" size=\"icon-sm\" className=\"h-7 w-7\" title=\"Duplicate\" onClick={() => openProfileModal('duplicate', profile)}>\n <Copy className=\"h-3.5 w-3.5\" />\n </Button>\n {!isBuiltIn && (\n <Button variant=\"ghost\" size=\"icon-sm\" className=\"h-7 w-7 text-destructive\" title=\"Delete\" onClick={() => deleteProfile(profile.name)}>\n <Trash2 className=\"h-3.5 w-3.5\" />\n </Button>\n )}\n </div>\n </div>\n\n <div className=\"flex flex-wrap items-center gap-1.5 text-[10px]\">\n <Badge variant=\"outline\" className={BASE_COLORS[profile.base] || ''}>{profile.base}</Badge>\n <Badge variant=\"outline\">{profile.provider || 'any'}</Badge>\n <Badge variant=\"outline\">fs: {profile.permissions.filesystem}</Badge>\n {profile.permissions.mode && <Badge variant=\"outline\">{profile.permissions.mode}</Badge>}\n </div>\n\n <div className=\"flex flex-wrap items-center gap-x-4 gap-y-1 text-[10px] text-muted-foreground\">\n <span className=\"flex items-center gap-1\">\n Relay <RelayDots relay={profile.relay} />\n </span>\n <span>MCP: {profile.mcp.mode}</span>\n <span>Hooks: {profile.hooks.mode}</span>\n {profile.instructions.globalInstructions === 'ignore' && <span className=\"text-amber-400\">global: ignore</span>}\n {Object.keys(profile.env || {}).length > 0 && <span>{Object.keys(profile.env).length} env vars</span>}\n </div>\n </div>\n )\n}\n\nexport function AgentProfilesView() {\n const profiles = useRelayStore((s) => s.agentProfiles)\n const openProfileModal = useRelayStore((s) => s.openProfileModal)\n\n const builtIn = profiles.filter((p) => p.builtIn)\n const custom = profiles.filter((p) => !p.builtIn)\n\n return (\n <div className=\"space-y-4\">\n <div className=\"flex flex-wrap items-center gap-2\">\n <div className=\"flex items-center gap-2 text-lg font-semibold\">\n <UserCog className=\"h-5 w-5 text-primary\" />\n Agent Profiles\n </div>\n <Badge variant=\"outline\">{profiles.length}</Badge>\n <div className=\"flex-1\" />\n <Button size=\"sm\" className=\"gap-1\" onClick={() => openProfileModal('create')}>\n <Plus className=\"h-3.5 w-3.5\" />\n Create Profile\n </Button>\n </div>\n\n {builtIn.length > 0 && (\n <div>\n <h3 className=\"mb-2 text-xs font-medium text-muted-foreground uppercase tracking-wider\">Built-in</h3>\n <div className=\"grid gap-3 grid-cols-1 sm:grid-cols-2 lg:grid-cols-3\">\n {builtIn.map((p) => <ProfileCard key={p.name} profile={p} />)}\n </div>\n </div>\n )}\n\n {custom.length > 0 && (\n <div>\n <h3 className=\"mb-2 text-xs font-medium text-muted-foreground uppercase tracking-wider\">Custom</h3>\n <div className=\"grid gap-3 grid-cols-1 sm:grid-cols-2 lg:grid-cols-3\">\n {custom.map((p) => <ProfileCard key={p.name} profile={p} />)}\n </div>\n </div>\n )}\n\n {profiles.length === 0 && (\n <div className=\"py-12 text-center text-sm text-muted-foreground\">\n No agent profiles found. Create one to configure agent behavior.\n </div>\n )}\n </div>\n )\n}\n"],"mappings":"+NAMM,EAAsC,CAC1C,KAAM,qCACN,QAAS,iCACT,SAAU,6BACX,CAED,SAAS,EAAU,CAAE,SAA2C,CAO9D,OACE,EAAA,EAAA,KAAC,MAAD,CAAK,UAAU,mCACZ,CAPH,CAAE,IAAK,MAAO,GAAI,EAAM,QAAS,CACjC,CAAE,IAAK,MAAO,GAAI,EAAM,OAAQ,CAChC,CAAE,IAAK,MAAO,GAAI,EAAM,QAAS,CACj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,SAAA,EACE,EAAA,EAAA,KAAC,KAAD,CAAI,UAAU,mFAA0E,SAAW,CAAA,EACnG,EAAA,EAAA,KAAC,MAAD,CAAK,UAAU,gEACZ,EAAO,IAAK,IAAM,EAAA,EAAA,KAAC,EAAD,CAA0B,QAAS,EAAK,CAAtB,EAAE,KAAoB,CAAC,CACxD,CAAA,CACF,CAAA,CAAA,CAGP,EAAS,SAAW,IACnB,EAAA,EAAA,KAAC,MAAD,CAAK,UAAU,2DAAkD,mEAE3D,CAAA,CAEJ"}
@@ -1,2 +1,2 @@
1
- import{r as e}from"./chunk-CilyBKbf.js";import{B as t,Dt as n,Ft as r,G as i,I as a,J as o,P as s,Tn as c,Un as l,bn as u,g as d,i as f,jn as p,kn as m,l as h,m as g,ot as _}from"./lucide-react-ChOGD4vc.js";import{a as v,t as y}from"./store-CtKmqMfx.js";import{B as b,G as x,H as ee,W as te,a as S,d as C,i as ne,n as re}from"./display-ConJ9cJB.js";import{o as w,r as T}from"./dist-CSISzAHD.js";import{t as E}from"./dist-DvLO--_O.js";import{i as D,n as O}from"./dist-MdPDPcyo.js";import{t as k}from"./dist-BiVJ8IWp.js";import{t as A}from"./dist-BIAvrITs.js";import{a as j,i as M,n as N,o as P,r as ie,s as ae,t as F}from"./es2015-Cu7l1536.js";import{a as I,i as oe,n as se,r as L,t as R}from"./dist-svixSeDF.js";import{t as z}from"./badge-CFVr4fG9.js";import{t as B}from"./button-BuTu0MHx.js";import{t as ce}from"./copy-button-BOj6uOlU.js";import{B as V,H,N as le,S as U,V as W,d as ue,g as de,h as fe,l as pe,m as me,p as he,u as ge,x as G,z as _e}from"./index-CAnJGSBl.js";import{n as ve,t as ye}from"./card-C3ErQ372.js";import{n as be,t as xe}from"./branch-state-badge-dN2mQ2gs.js";var K=e(l(),1),q=p(),J=`Popover`,[Se,Ce]=D(J,[I]),Y=I(),[we,X]=Se(J),Te=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=Y(t),c=K.useRef(null),[l,u]=K.useState(!1),[d,f]=k({prop:r,defaultProp:i??!1,onChange:a,caller:J});return(0,q.jsx)(oe,{...s,children:(0,q.jsx)(we,{scope:t,contentId:ae(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:K.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:K.useCallback(()=>u(!0),[]),onCustomAnchorRemove:K.useCallback(()=>u(!1),[]),modal:o,children:n})})};Te.displayName=J;var Ee=`PopoverAnchor`,De=K.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=X(Ee,n),a=Y(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return K.useEffect(()=>(o(),()=>s()),[o,s]),(0,q.jsx)(R,{...a,...r,ref:t})});De.displayName=Ee;var Oe=`PopoverTrigger`,ke=K.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=X(Oe,n),a=Y(n),o=w(t,i.triggerRef),s=(0,q.jsx)(E.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Ve(i.open),...r,ref:o,onClick:O(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,q.jsx)(R,{asChild:!0,...a,children:s})});ke.displayName=Oe;var Z=`PopoverPortal`,[Ae,je]=Se(Z,{forceMount:void 0}),Me=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=X(Z,t);return(0,q.jsx)(Ae,{scope:t,forceMount:n,children:(0,q.jsx)(A,{present:n||a.open,children:(0,q.jsx)(M,{asChild:!0,container:i,children:r})})})};Me.displayName=Z;var Q=`PopoverContent`,Ne=K.forwardRef((e,t)=>{let n=je(Q,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=X(Q,e.__scopePopover);return(0,q.jsx)(A,{present:r||a.open,children:a.modal?(0,q.jsx)(Fe,{...i,ref:t}):(0,q.jsx)(Ie,{...i,ref:t})})});Ne.displayName=Q;var Pe=T(`PopoverContent.RemoveScroll`),Fe=K.forwardRef((e,t)=>{let n=X(Q,e.__scopePopover),r=K.useRef(null),i=w(t,r),a=K.useRef(!1);return K.useEffect(()=>{let e=r.current;if(e)return F(e)},[]),(0,q.jsx)(N,{as:Pe,allowPinchZoom:!0,children:(0,q.jsx)(Le,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:O(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:O(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;a.current=t.button===2||n},{checkForDefaultPrevented:!1}),onFocusOutside:O(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),Ie=K.forwardRef((e,t)=>{let n=X(Q,e.__scopePopover),r=K.useRef(!1),i=K.useRef(!1);return(0,q.jsx)(Le,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),Le=K.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=X(Q,n),p=Y(n);return ie(),(0,q.jsx)(j,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,q.jsx)(P,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),children:(0,q.jsx)(L,{"data-state":Ve(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})}),$=`PopoverClose`,Re=K.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=X($,n);return(0,q.jsx)(E.button,{type:`button`,...r,ref:t,onClick:O(e.onClick,()=>i.onOpenChange(!1))})});Re.displayName=$;var ze=`PopoverArrow`,Be=K.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=Y(n);return(0,q.jsx)(se,{...i,...r,ref:t})});Be.displayName=ze;function Ve(e){return e?`open`:`closed`}var He=Te,Ue=ke,We=Me,Ge=Ne;function Ke({...e}){return(0,q.jsx)(He,{"data-slot":`popover`,...e})}function qe({...e}){return(0,q.jsx)(Ue,{"data-slot":`popover-trigger`,...e})}function Je({className:e,align:t=`center`,sideOffset:n=4,...r}){return(0,q.jsx)(We,{children:(0,q.jsx)(Ge,{"data-slot":`popover-content`,align:t,sideOffset:n,className:m(`z-50 flex w-72 origin-(--radix-popover-content-transform-origin) flex-col gap-2.5 rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r})})}function Ye({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`popover-header`,className:m(`flex flex-col gap-0.5 text-sm`,e),...t})}function Xe({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`popover-title`,className:m(`font-medium`,e),...t})}function Ze({agent:e,childAgents:a=[],parentAgent:c}){let l=v();y(e=>e.set);let u=y(e=>e.switchView),f=y(e=>e.openInboxThread),p=y(e=>e.openAgentDetail),m=y(e=>e.openPairInvite),w=y(e=>e.openRename),T=y(e=>e.openConfirm),E=y(e=>e.doAgentAction),D=y(e=>e.doDeleteAgent),O=y(e=>e.openFilesForAgent),k=y(e=>e.workspaceAction),A=y(e=>e.openWorkspaceFocus),{terminalOpen:j,terminalTarget:M,terminalOpening:N,openTerminal:P,closeTerminal:ie}=be(e.id),ae=_e(),F=ne(l,e,le(e),ae[e.id]||null),I=S(e,`shutdown`),oe=S(e,`compact`),se=S(e,`clearContext`),L=!!(e.providerCapabilities?.terminal?.live?.read||e.providerCapabilities?.terminal?.attach?.create),R=!!(e.providerCapabilities?.terminal?.live?.write||e.providerCapabilities?.model?.provider===`claude`),V=re(e),H=c?C(c):e.spawnedBy,W=a.length>0;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(ye,{className:`group hover:border-zinc-600 transition-colors cursor-pointer`,onClick:()=>p(e),children:(0,q.jsxs)(ve,{className:`p-4`,children:[(0,q.jsxs)(`div`,{className:`flex items-start gap-2.5 mb-2.5`,children:[(0,q.jsx)(U,{agent:e,now:l,className:`mt-0.5`}),(0,q.jsx)(G,{agent:e}),(0,q.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,q.jsx)(`div`,{className:`text-sm font-medium truncate`,children:C(e)}),(0,q.jsx)(`div`,{className:`text-xs mt-0.5 ${te(F.tone)}`,children:F.label}),typeof e.meta?.cwd==`string`&&e.meta.cwd&&(0,q.jsx)(`button`,{type:`button`,className:`mt-0.5 block max-w-full truncate font-mono text-[10px] text-muted-foreground hover:text-foreground`,title:`Open ${e.meta.cwd} in Files`,onClick:t=>{t.stopPropagation(),O(e)},children:b(e.meta.cwd)})]}),e.branchState&&e.branchWorkspaceId&&(0,q.jsx)(xe,{state:e.branchState,className:`mt-0.5 shrink-0`,onClick:t=>{t.stopPropagation(),A(e.branchWorkspaceId)}})]}),F.badges.length>0&&(0,q.jsx)(`div`,{className:`flex flex-wrap gap-1 mb-2`,children:F.badges.map(e=>(0,q.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded-full font-medium ${e.className}`,children:e.label},e.label))}),(W||e.spawnedBy&&H)&&(0,q.jsxs)(`div`,{className:`mb-2 flex flex-wrap gap-1.5`,onClick:e=>e.stopPropagation(),children:[W&&(0,q.jsxs)(Ke,{children:[(0,q.jsx)(qe,{asChild:!0,children:(0,q.jsxs)(`button`,{type:`button`,className:`inline-flex h-6 max-w-full items-center gap-1.5 rounded-full border border-sky-500/30 bg-sky-500/10 px-2 text-[10px] font-medium text-sky-300 transition-colors hover:bg-sky-500/15`,title:`${a.length} live child ${a.length===1?`agent`:`agents`}`,children:[(0,q.jsx)(h,{className:`h-3 w-3`}),(0,q.jsx)(`span`,{children:a.length}),(0,q.jsx)(`span`,{className:`flex -space-x-1`,children:a.slice(0,4).map(e=>(0,q.jsx)(U,{agent:e,now:l,className:`h-2 w-2 ring-1 ring-background`},e.id))})]})}),(0,q.jsxs)(Je,{align:`start`,className:`w-80`,onClick:e=>e.stopPropagation(),children:[(0,q.jsx)(Ye,{children:(0,q.jsx)(Xe,{children:`Team`})}),(0,q.jsx)(`div`,{className:`space-y-1.5`,children:a.map(e=>(0,q.jsxs)(`div`,{className:`rounded-md border border-border bg-card/60 p-2`,children:[(0,q.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,q.jsx)(U,{agent:e,now:l,className:`mt-1`}),(0,q.jsx)(G,{agent:e}),(0,q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,q.jsx)(`div`,{className:`truncate text-xs font-medium`,children:C(e)}),(0,q.jsx)(`div`,{className:`truncate text-[10px] text-muted-foreground`,children:e.providerCapabilities?.model?.alias||e.providerCapabilities?.model?.id||e.providerCapabilities?.model?.provider||e.status})]}),(0,q.jsx)(z,{variant:`outline`,className:`h-4 px-1.5 text-[9px]`,children:e.status})]}),(0,q.jsxs)(`div`,{className:`mt-2 flex gap-1`,children:[(0,q.jsx)(B,{size:`xs`,variant:`outline`,onClick:()=>p(e),children:`Open`}),(0,q.jsxs)(B,{size:`xs`,variant:`ghost`,onClick:()=>{f(e.id),u(`chat`)},children:[(0,q.jsx)(o,{className:`h-3 w-3`}),`Chat`]})]})]},e.id))})]})]}),e.spawnedBy&&H&&(0,q.jsx)(z,{variant:`outline`,className:`max-w-full text-[10px] text-muted-foreground`,children:(0,q.jsxs)(`span`,{className:`truncate`,children:[`spawned by `,H]})})]}),(e.tags.length>0||x(e.capabilities).length>0)&&(0,q.jsxs)(`div`,{className:`flex flex-wrap gap-1 mb-2`,children:[e.tags.slice(0,3).map(e=>(0,q.jsx)(z,{variant:`outline`,className:`text-[9px] px-1 py-0 h-4`,children:e},e)),x(e.capabilities).slice(0,2).map(e=>(0,q.jsx)(z,{variant:`secondary`,className:`text-[9px] px-1 py-0 h-4`,children:e},e))]}),(0,q.jsxs)(`div`,{className:`space-y-2 mb-2`,children:[(0,q.jsx)(fe,{agent:e}),(0,q.jsx)(me,{agent:e,compact:!0}),(0,q.jsx)(de,{agent:e})]}),(0,q.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:e.id!==`user`&&e.id!==`system`&&ee(l,e.lastSeen)}),(0,q.jsxs)(`div`,{className:`flex gap-1 mt-2.5 opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-opacity`,onClick:e=>e.stopPropagation(),children:[(0,q.jsx)(ce,{value:e.id,label:`Copy agent ID`,size:`icon`,className:`h-7 w-7`,iconClassName:`w-3 h-3`}),(0,q.jsx)(B,{size:`icon`,variant:`ghost`,className:`h-7 w-7`,title:`Chat`,onClick:()=>{f(e.id),u(`chat`)},children:(0,q.jsx)(o,{className:`w-3 h-3`})}),(0,q.jsx)(B,{size:`icon`,variant:`ghost`,className:`h-7 w-7`,title:`Pair`,onClick:()=>m(e.id),children:(0,q.jsx)(_,{className:`w-3 h-3`})}),(0,q.jsx)(B,{size:`icon`,variant:`ghost`,className:`h-7 w-7`,title:`Rename`,onClick:()=>w(e),children:(0,q.jsx)(t,{className:`w-3 h-3`})}),L&&(0,q.jsx)(B,{size:`icon`,variant:`ghost`,className:`h-7 w-7`,title:`Terminal`,disabled:N,onClick:()=>void P(),children:(0,q.jsx)(d,{className:`w-3 h-3`})}),(e.branchState===`changes`||e.branchState===`idle`)&&e.branchWorkspaceId&&(0,q.jsx)(B,{size:`icon`,variant:`ghost`,className:`h-7 w-7 text-amber-400 hover:text-amber-300`,title:`Mark workspace ready — hand off to the auto-merge`,onClick:()=>T(`Mark Workspace Ready`,`Mark ${C(e)}'s branch ready to land? The relay auto-merge will rebase and land it.`,()=>k(e.branchWorkspaceId,`ready`)),children:(0,q.jsx)(n,{className:`w-3 h-3`})}),oe&&(0,q.jsx)(B,{size:`icon`,variant:`ghost`,className:`h-7 w-7`,title:`Compact`,onClick:()=>T(`Compact Agent`,`Compact context for ${C(e)}?`,()=>E(e,`compact`,`agents-grid`)),children:(0,q.jsx)(i,{className:`w-3 h-3`})}),se&&(0,q.jsx)(B,{size:`icon`,variant:`ghost`,className:`h-7 w-7`,title:`Clear Context`,onClick:()=>T(`Clear Context`,`Clear context for ${C(e)}?`,()=>E(e,`clearContext`,`agents-grid`)),children:(0,q.jsx)(r,{className:`w-3 h-3`})}),I&&(0,q.jsx)(B,{size:`icon`,variant:`ghost`,className:`h-7 w-7 text-red-400 hover:text-red-300`,title:`Shutdown`,onClick:()=>T(`Shutdown Agent`,`Shutdown ${C(e)}?`,()=>E(e,`shutdown`,`agents-grid`)),children:(0,q.jsx)(s,{className:`w-3 h-3`})}),V&&(0,q.jsx)(B,{size:`icon`,variant:`ghost`,className:`h-7 w-7 text-red-400 hover:text-red-300`,title:`Forget stale agent`,onClick:()=>T(`Forget Agent`,`Forget ${C(e)}?`,()=>D(e.id)),children:(0,q.jsx)(g,{className:`w-3 h-3`})})]})]})}),M&&(0,q.jsx)(he,{open:j,onOpenChange:ie,orchestratorId:M.orchestratorId,session:M.session,interactive:M.interactive||R})]})}function Qe(){let e=y(e=>e.agentPresetFilter),t=y(e=>e.agentStatusFilter),n=y(e=>e.agentTagFilter),r=y(e=>e.agentHostFilter),i=y(e=>e.agentSort),o=y(e=>e.agentSortDir),s=y(e=>e.showOffline),l=y(e=>e.set),d=y(e=>e.openAgentSpawn),p=y(e=>e.agentsById),m=v(),h=V(),g=H(),_=W(),b=pe(h,m),x=ue(h,m),ee=e||t||n||r;function te(){l({agentPresetFilter:``,agentStatusFilter:``,agentTagFilter:``,agentHostFilter:``})}function S(){l({agentSortDir:o===`asc`?`desc`:`asc`})}return(0,q.jsxs)(`div`,{className:`space-y-4`,children:[(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,q.jsxs)(`select`,{value:e,onChange:e=>l({agentPresetFilter:e.target.value}),className:`h-8 rounded-md border border-border bg-card text-sm px-2 text-foreground`,children:[(0,q.jsx)(`option`,{value:``,children:`All agents`}),(0,q.jsx)(`option`,{value:`active`,children:`Active`}),(0,q.jsx)(`option`,{value:`claude`,children:`Claude`}),(0,q.jsx)(`option`,{value:`codex`,children:`Codex`}),(0,q.jsx)(`option`,{value:`paired`,children:`Paired`}),(0,q.jsx)(`option`,{value:`unpaired`,children:`Unpaired`}),(0,q.jsx)(`option`,{value:`offline_stale`,children:`Offline / Stale`})]}),(0,q.jsxs)(`select`,{value:t,onChange:e=>l({agentStatusFilter:e.target.value}),className:`h-8 rounded-md border border-border bg-card text-sm px-2 text-foreground`,children:[(0,q.jsx)(`option`,{value:``,children:`Any status`}),(0,q.jsx)(`option`,{value:`online`,children:`Online`}),(0,q.jsx)(`option`,{value:`idle`,children:`Idle`}),(0,q.jsx)(`option`,{value:`busy`,children:`Busy`}),(0,q.jsx)(`option`,{value:`offline`,children:`Offline`}),(0,q.jsx)(`option`,{value:`starting`,children:`Starting`})]}),g.length>0&&(0,q.jsxs)(`select`,{value:n,onChange:e=>l({agentTagFilter:e.target.value}),className:`h-8 rounded-md border border-border bg-card text-sm px-2 text-foreground`,children:[(0,q.jsx)(`option`,{value:``,children:`Any tag`}),g.map(e=>(0,q.jsx)(`option`,{value:e,children:e},e))]}),_.length>1&&(0,q.jsxs)(`select`,{value:r,onChange:e=>l({agentHostFilter:e.target.value}),className:`h-8 rounded-md border border-border bg-card text-sm px-2 text-foreground`,children:[(0,q.jsx)(`option`,{value:``,children:`Any host`}),_.map(e=>(0,q.jsx)(`option`,{value:e,children:e},e))]}),(0,q.jsxs)(`select`,{value:i,onChange:e=>l({agentSort:e.target.value}),className:`h-8 rounded-md border border-border bg-card text-sm px-2 text-foreground`,children:[(0,q.jsx)(`option`,{value:`status`,children:`Sort: Status`}),(0,q.jsx)(`option`,{value:`name`,children:`Sort: Name`}),(0,q.jsx)(`option`,{value:`lastSeen`,children:`Sort: Last seen`}),(0,q.jsx)(`option`,{value:`created`,children:`Sort: Created`})]}),(0,q.jsx)(B,{size:`icon`,variant:`outline`,className:`h-8 w-8`,title:`Toggle sort direction`,onClick:S,children:o===`asc`?(0,q.jsx)(u,{className:`w-3.5 h-3.5`}):(0,q.jsx)(c,{className:`w-3.5 h-3.5`})}),(0,q.jsxs)(`label`,{className:`flex items-center gap-1.5 text-sm text-muted-foreground cursor-pointer select-none`,children:[(0,q.jsx)(`input`,{type:`checkbox`,checked:s,onChange:e=>l({showOffline:e.target.checked}),className:`rounded`}),`Show offline`]}),ee&&(0,q.jsxs)(B,{size:`sm`,variant:`ghost`,className:`h-8 text-muted-foreground hover:text-foreground gap-1`,onClick:te,children:[(0,q.jsx)(f,{className:`w-3 h-3`}),`Clear filters`]}),(0,q.jsx)(`div`,{className:`ml-auto`,children:(0,q.jsxs)(B,{size:`sm`,onClick:d,className:`gap-1`,children:[(0,q.jsx)(a,{className:`w-3.5 h-3.5`}),`Spawn`]})})]}),x.length===0?(0,q.jsx)(`div`,{className:`text-center py-16 text-muted-foreground text-sm`,children:`No agents match the current filters.`}):(0,q.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 xl:grid-cols-4 gap-3`,children:x.map(e=>(0,q.jsx)(Ze,{agent:e,parentAgent:e.spawnedBy?p[e.spawnedBy]??null:null,childAgents:ge(b.get(e.id)??[])},e.id))})]})}export{Qe as AgentsView};
2
- //# sourceMappingURL=agents-DBuCRS5A.js.map
1
+ import{r as e}from"./chunk-CilyBKbf.js";import{B as t,Dt as n,Ft as r,G as i,I as a,J as o,P as s,Tn as c,Un as l,bn as u,g as d,i as f,jn as p,kn as m,l as h,m as g,ot as _}from"./lucide-react-ChOGD4vc.js";import{o as v,t as y}from"./store-B6qT5_de.js";import{B as b,G as x,H as ee,W as te,a as S,d as C,i as ne,n as re}from"./display-ConJ9cJB.js";import{o as w,r as T}from"./dist-CSISzAHD.js";import{t as E}from"./dist-DvLO--_O.js";import{i as D,n as O}from"./dist-MdPDPcyo.js";import{t as k}from"./dist-BiVJ8IWp.js";import{t as A}from"./dist-BIAvrITs.js";import{a as j,i as M,n as N,o as P,r as ie,s as ae,t as F}from"./es2015-Cu7l1536.js";import{a as I,i as oe,n as se,r as L,t as R}from"./dist-svixSeDF.js";import{t as z}from"./badge-CFVr4fG9.js";import{t as B}from"./button-BuTu0MHx.js";import{t as ce}from"./copy-button-BOj6uOlU.js";import{B as V,H,N as le,S as U,V as W,d as ue,g as de,h as fe,l as pe,m as me,p as he,u as ge,x as G,z as _e}from"./index-CT10XH5Y.js";import{n as ve,t as ye}from"./card-C3ErQ372.js";import{n as be,t as xe}from"./branch-state-badge-DymObp8d.js";var K=e(l(),1),q=p(),J=`Popover`,[Se,Ce]=D(J,[I]),Y=I(),[we,X]=Se(J),Te=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=Y(t),c=K.useRef(null),[l,u]=K.useState(!1),[d,f]=k({prop:r,defaultProp:i??!1,onChange:a,caller:J});return(0,q.jsx)(oe,{...s,children:(0,q.jsx)(we,{scope:t,contentId:ae(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:K.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:K.useCallback(()=>u(!0),[]),onCustomAnchorRemove:K.useCallback(()=>u(!1),[]),modal:o,children:n})})};Te.displayName=J;var Ee=`PopoverAnchor`,De=K.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=X(Ee,n),a=Y(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return K.useEffect(()=>(o(),()=>s()),[o,s]),(0,q.jsx)(R,{...a,...r,ref:t})});De.displayName=Ee;var Oe=`PopoverTrigger`,ke=K.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=X(Oe,n),a=Y(n),o=w(t,i.triggerRef),s=(0,q.jsx)(E.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Ve(i.open),...r,ref:o,onClick:O(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,q.jsx)(R,{asChild:!0,...a,children:s})});ke.displayName=Oe;var Z=`PopoverPortal`,[Ae,je]=Se(Z,{forceMount:void 0}),Me=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=X(Z,t);return(0,q.jsx)(Ae,{scope:t,forceMount:n,children:(0,q.jsx)(A,{present:n||a.open,children:(0,q.jsx)(M,{asChild:!0,container:i,children:r})})})};Me.displayName=Z;var Q=`PopoverContent`,Ne=K.forwardRef((e,t)=>{let n=je(Q,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=X(Q,e.__scopePopover);return(0,q.jsx)(A,{present:r||a.open,children:a.modal?(0,q.jsx)(Fe,{...i,ref:t}):(0,q.jsx)(Ie,{...i,ref:t})})});Ne.displayName=Q;var Pe=T(`PopoverContent.RemoveScroll`),Fe=K.forwardRef((e,t)=>{let n=X(Q,e.__scopePopover),r=K.useRef(null),i=w(t,r),a=K.useRef(!1);return K.useEffect(()=>{let e=r.current;if(e)return F(e)},[]),(0,q.jsx)(N,{as:Pe,allowPinchZoom:!0,children:(0,q.jsx)(Le,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:O(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:O(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;a.current=t.button===2||n},{checkForDefaultPrevented:!1}),onFocusOutside:O(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),Ie=K.forwardRef((e,t)=>{let n=X(Q,e.__scopePopover),r=K.useRef(!1),i=K.useRef(!1);return(0,q.jsx)(Le,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),Le=K.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=X(Q,n),p=Y(n);return ie(),(0,q.jsx)(j,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,q.jsx)(P,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),children:(0,q.jsx)(L,{"data-state":Ve(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})}),$=`PopoverClose`,Re=K.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=X($,n);return(0,q.jsx)(E.button,{type:`button`,...r,ref:t,onClick:O(e.onClick,()=>i.onOpenChange(!1))})});Re.displayName=$;var ze=`PopoverArrow`,Be=K.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=Y(n);return(0,q.jsx)(se,{...i,...r,ref:t})});Be.displayName=ze;function Ve(e){return e?`open`:`closed`}var He=Te,Ue=ke,We=Me,Ge=Ne;function Ke({...e}){return(0,q.jsx)(He,{"data-slot":`popover`,...e})}function qe({...e}){return(0,q.jsx)(Ue,{"data-slot":`popover-trigger`,...e})}function Je({className:e,align:t=`center`,sideOffset:n=4,...r}){return(0,q.jsx)(We,{children:(0,q.jsx)(Ge,{"data-slot":`popover-content`,align:t,sideOffset:n,className:m(`z-50 flex w-72 origin-(--radix-popover-content-transform-origin) flex-col gap-2.5 rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r})})}function Ye({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`popover-header`,className:m(`flex flex-col gap-0.5 text-sm`,e),...t})}function Xe({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`popover-title`,className:m(`font-medium`,e),...t})}function Ze({agent:e,childAgents:a=[],parentAgent:c}){let l=v();y(e=>e.set);let u=y(e=>e.switchView),f=y(e=>e.openInboxThread),p=y(e=>e.openAgentDetail),m=y(e=>e.openPairInvite),w=y(e=>e.openRename),T=y(e=>e.openConfirm),E=y(e=>e.doAgentAction),D=y(e=>e.doDeleteAgent),O=y(e=>e.openFilesForAgent),k=y(e=>e.workspaceAction),A=y(e=>e.openWorkspaceFocus),{terminalOpen:j,terminalTarget:M,terminalOpening:N,openTerminal:P,closeTerminal:ie}=be(e.id),ae=_e(),F=ne(l,e,le(e),ae[e.id]||null),I=S(e,`shutdown`),oe=S(e,`compact`),se=S(e,`clearContext`),L=!!(e.providerCapabilities?.terminal?.live?.read||e.providerCapabilities?.terminal?.attach?.create),R=!!(e.providerCapabilities?.terminal?.live?.write||e.providerCapabilities?.model?.provider===`claude`),V=re(e),H=c?C(c):e.spawnedBy,W=a.length>0;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(ye,{className:`group hover:border-zinc-600 transition-colors cursor-pointer`,onClick:()=>p(e),children:(0,q.jsxs)(ve,{className:`p-4`,children:[(0,q.jsxs)(`div`,{className:`flex items-start gap-2.5 mb-2.5`,children:[(0,q.jsx)(U,{agent:e,now:l,className:`mt-0.5`}),(0,q.jsx)(G,{agent:e}),(0,q.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,q.jsx)(`div`,{className:`text-sm font-medium truncate`,children:C(e)}),(0,q.jsx)(`div`,{className:`text-xs mt-0.5 ${te(F.tone)}`,children:F.label}),typeof e.meta?.cwd==`string`&&e.meta.cwd&&(0,q.jsx)(`button`,{type:`button`,className:`mt-0.5 block max-w-full truncate font-mono text-[10px] text-muted-foreground hover:text-foreground`,title:`Open ${e.meta.cwd} in Files`,onClick:t=>{t.stopPropagation(),O(e)},children:b(e.meta.cwd)})]}),e.branchState&&e.branchWorkspaceId&&(0,q.jsx)(xe,{state:e.branchState,className:`mt-0.5 shrink-0`,onClick:t=>{t.stopPropagation(),A(e.branchWorkspaceId)}})]}),F.badges.length>0&&(0,q.jsx)(`div`,{className:`flex flex-wrap gap-1 mb-2`,children:F.badges.map(e=>(0,q.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded-full font-medium ${e.className}`,children:e.label},e.label))}),(W||e.spawnedBy&&H)&&(0,q.jsxs)(`div`,{className:`mb-2 flex flex-wrap gap-1.5`,onClick:e=>e.stopPropagation(),children:[W&&(0,q.jsxs)(Ke,{children:[(0,q.jsx)(qe,{asChild:!0,children:(0,q.jsxs)(`button`,{type:`button`,className:`inline-flex h-6 max-w-full items-center gap-1.5 rounded-full border border-sky-500/30 bg-sky-500/10 px-2 text-[10px] font-medium text-sky-300 transition-colors hover:bg-sky-500/15`,title:`${a.length} live child ${a.length===1?`agent`:`agents`}`,children:[(0,q.jsx)(h,{className:`h-3 w-3`}),(0,q.jsx)(`span`,{children:a.length}),(0,q.jsx)(`span`,{className:`flex -space-x-1`,children:a.slice(0,4).map(e=>(0,q.jsx)(U,{agent:e,now:l,className:`h-2 w-2 ring-1 ring-background`},e.id))})]})}),(0,q.jsxs)(Je,{align:`start`,className:`w-80`,onClick:e=>e.stopPropagation(),children:[(0,q.jsx)(Ye,{children:(0,q.jsx)(Xe,{children:`Team`})}),(0,q.jsx)(`div`,{className:`space-y-1.5`,children:a.map(e=>(0,q.jsxs)(`div`,{className:`rounded-md border border-border bg-card/60 p-2`,children:[(0,q.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,q.jsx)(U,{agent:e,now:l,className:`mt-1`}),(0,q.jsx)(G,{agent:e}),(0,q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,q.jsx)(`div`,{className:`truncate text-xs font-medium`,children:C(e)}),(0,q.jsx)(`div`,{className:`truncate text-[10px] text-muted-foreground`,children:e.providerCapabilities?.model?.alias||e.providerCapabilities?.model?.id||e.providerCapabilities?.model?.provider||e.status})]}),(0,q.jsx)(z,{variant:`outline`,className:`h-4 px-1.5 text-[9px]`,children:e.status})]}),(0,q.jsxs)(`div`,{className:`mt-2 flex gap-1`,children:[(0,q.jsx)(B,{size:`xs`,variant:`outline`,onClick:()=>p(e),children:`Open`}),(0,q.jsxs)(B,{size:`xs`,variant:`ghost`,onClick:()=>{f(e.id),u(`chat`)},children:[(0,q.jsx)(o,{className:`h-3 w-3`}),`Chat`]})]})]},e.id))})]})]}),e.spawnedBy&&H&&(0,q.jsx)(z,{variant:`outline`,className:`max-w-full text-[10px] text-muted-foreground`,children:(0,q.jsxs)(`span`,{className:`truncate`,children:[`spawned by `,H]})})]}),(e.tags.length>0||x(e.capabilities).length>0)&&(0,q.jsxs)(`div`,{className:`flex flex-wrap gap-1 mb-2`,children:[e.tags.slice(0,3).map(e=>(0,q.jsx)(z,{variant:`outline`,className:`text-[9px] px-1 py-0 h-4`,children:e},e)),x(e.capabilities).slice(0,2).map(e=>(0,q.jsx)(z,{variant:`secondary`,className:`text-[9px] px-1 py-0 h-4`,children:e},e))]}),(0,q.jsxs)(`div`,{className:`space-y-2 mb-2`,children:[(0,q.jsx)(fe,{agent:e}),(0,q.jsx)(me,{agent:e,compact:!0}),(0,q.jsx)(de,{agent:e})]}),(0,q.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:e.id!==`user`&&e.id!==`system`&&ee(l,e.lastSeen)}),(0,q.jsxs)(`div`,{className:`flex gap-1 mt-2.5 opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-opacity`,onClick:e=>e.stopPropagation(),children:[(0,q.jsx)(ce,{value:e.id,label:`Copy agent ID`,size:`icon`,className:`h-7 w-7`,iconClassName:`w-3 h-3`}),(0,q.jsx)(B,{size:`icon`,variant:`ghost`,className:`h-7 w-7`,title:`Chat`,onClick:()=>{f(e.id),u(`chat`)},children:(0,q.jsx)(o,{className:`w-3 h-3`})}),(0,q.jsx)(B,{size:`icon`,variant:`ghost`,className:`h-7 w-7`,title:`Pair`,onClick:()=>m(e.id),children:(0,q.jsx)(_,{className:`w-3 h-3`})}),(0,q.jsx)(B,{size:`icon`,variant:`ghost`,className:`h-7 w-7`,title:`Rename`,onClick:()=>w(e),children:(0,q.jsx)(t,{className:`w-3 h-3`})}),L&&(0,q.jsx)(B,{size:`icon`,variant:`ghost`,className:`h-7 w-7`,title:`Terminal`,disabled:N,onClick:()=>void P(),children:(0,q.jsx)(d,{className:`w-3 h-3`})}),(e.branchState===`changes`||e.branchState===`idle`)&&e.branchWorkspaceId&&(0,q.jsx)(B,{size:`icon`,variant:`ghost`,className:`h-7 w-7 text-amber-400 hover:text-amber-300`,title:`Mark workspace ready — hand off to the auto-merge`,onClick:()=>T(`Mark Workspace Ready`,`Mark ${C(e)}'s branch ready to land? The relay auto-merge will rebase and land it.`,()=>k(e.branchWorkspaceId,`ready`)),children:(0,q.jsx)(n,{className:`w-3 h-3`})}),oe&&(0,q.jsx)(B,{size:`icon`,variant:`ghost`,className:`h-7 w-7`,title:`Compact`,onClick:()=>T(`Compact Agent`,`Compact context for ${C(e)}?`,()=>E(e,`compact`,`agents-grid`)),children:(0,q.jsx)(i,{className:`w-3 h-3`})}),se&&(0,q.jsx)(B,{size:`icon`,variant:`ghost`,className:`h-7 w-7`,title:`Clear Context`,onClick:()=>T(`Clear Context`,`Clear context for ${C(e)}?`,()=>E(e,`clearContext`,`agents-grid`)),children:(0,q.jsx)(r,{className:`w-3 h-3`})}),I&&(0,q.jsx)(B,{size:`icon`,variant:`ghost`,className:`h-7 w-7 text-red-400 hover:text-red-300`,title:`Shutdown`,onClick:()=>T(`Shutdown Agent`,`Shutdown ${C(e)}?`,()=>E(e,`shutdown`,`agents-grid`)),children:(0,q.jsx)(s,{className:`w-3 h-3`})}),V&&(0,q.jsx)(B,{size:`icon`,variant:`ghost`,className:`h-7 w-7 text-red-400 hover:text-red-300`,title:`Forget stale agent`,onClick:()=>T(`Forget Agent`,`Forget ${C(e)}?`,()=>D(e.id)),children:(0,q.jsx)(g,{className:`w-3 h-3`})})]})]})}),M&&(0,q.jsx)(he,{open:j,onOpenChange:ie,orchestratorId:M.orchestratorId,session:M.session,interactive:M.interactive||R})]})}function Qe(){let e=y(e=>e.agentPresetFilter),t=y(e=>e.agentStatusFilter),n=y(e=>e.agentTagFilter),r=y(e=>e.agentHostFilter),i=y(e=>e.agentSort),o=y(e=>e.agentSortDir),s=y(e=>e.showOffline),l=y(e=>e.set),d=y(e=>e.openAgentSpawn),p=y(e=>e.agentsById),m=v(),h=V(),g=H(),_=W(),b=pe(h,m),x=ue(h,m),ee=e||t||n||r;function te(){l({agentPresetFilter:``,agentStatusFilter:``,agentTagFilter:``,agentHostFilter:``})}function S(){l({agentSortDir:o===`asc`?`desc`:`asc`})}return(0,q.jsxs)(`div`,{className:`space-y-4`,children:[(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,q.jsxs)(`select`,{value:e,onChange:e=>l({agentPresetFilter:e.target.value}),className:`h-8 rounded-md border border-border bg-card text-sm px-2 text-foreground`,children:[(0,q.jsx)(`option`,{value:``,children:`All agents`}),(0,q.jsx)(`option`,{value:`active`,children:`Active`}),(0,q.jsx)(`option`,{value:`claude`,children:`Claude`}),(0,q.jsx)(`option`,{value:`codex`,children:`Codex`}),(0,q.jsx)(`option`,{value:`paired`,children:`Paired`}),(0,q.jsx)(`option`,{value:`unpaired`,children:`Unpaired`}),(0,q.jsx)(`option`,{value:`offline_stale`,children:`Offline / Stale`})]}),(0,q.jsxs)(`select`,{value:t,onChange:e=>l({agentStatusFilter:e.target.value}),className:`h-8 rounded-md border border-border bg-card text-sm px-2 text-foreground`,children:[(0,q.jsx)(`option`,{value:``,children:`Any status`}),(0,q.jsx)(`option`,{value:`online`,children:`Online`}),(0,q.jsx)(`option`,{value:`idle`,children:`Idle`}),(0,q.jsx)(`option`,{value:`busy`,children:`Busy`}),(0,q.jsx)(`option`,{value:`offline`,children:`Offline`}),(0,q.jsx)(`option`,{value:`starting`,children:`Starting`})]}),g.length>0&&(0,q.jsxs)(`select`,{value:n,onChange:e=>l({agentTagFilter:e.target.value}),className:`h-8 rounded-md border border-border bg-card text-sm px-2 text-foreground`,children:[(0,q.jsx)(`option`,{value:``,children:`Any tag`}),g.map(e=>(0,q.jsx)(`option`,{value:e,children:e},e))]}),_.length>1&&(0,q.jsxs)(`select`,{value:r,onChange:e=>l({agentHostFilter:e.target.value}),className:`h-8 rounded-md border border-border bg-card text-sm px-2 text-foreground`,children:[(0,q.jsx)(`option`,{value:``,children:`Any host`}),_.map(e=>(0,q.jsx)(`option`,{value:e,children:e},e))]}),(0,q.jsxs)(`select`,{value:i,onChange:e=>l({agentSort:e.target.value}),className:`h-8 rounded-md border border-border bg-card text-sm px-2 text-foreground`,children:[(0,q.jsx)(`option`,{value:`status`,children:`Sort: Status`}),(0,q.jsx)(`option`,{value:`name`,children:`Sort: Name`}),(0,q.jsx)(`option`,{value:`lastSeen`,children:`Sort: Last seen`}),(0,q.jsx)(`option`,{value:`created`,children:`Sort: Created`})]}),(0,q.jsx)(B,{size:`icon`,variant:`outline`,className:`h-8 w-8`,title:`Toggle sort direction`,onClick:S,children:o===`asc`?(0,q.jsx)(u,{className:`w-3.5 h-3.5`}):(0,q.jsx)(c,{className:`w-3.5 h-3.5`})}),(0,q.jsxs)(`label`,{className:`flex items-center gap-1.5 text-sm text-muted-foreground cursor-pointer select-none`,children:[(0,q.jsx)(`input`,{type:`checkbox`,checked:s,onChange:e=>l({showOffline:e.target.checked}),className:`rounded`}),`Show offline`]}),ee&&(0,q.jsxs)(B,{size:`sm`,variant:`ghost`,className:`h-8 text-muted-foreground hover:text-foreground gap-1`,onClick:te,children:[(0,q.jsx)(f,{className:`w-3 h-3`}),`Clear filters`]}),(0,q.jsx)(`div`,{className:`ml-auto`,children:(0,q.jsxs)(B,{size:`sm`,onClick:d,className:`gap-1`,children:[(0,q.jsx)(a,{className:`w-3.5 h-3.5`}),`Spawn`]})})]}),x.length===0?(0,q.jsx)(`div`,{className:`text-center py-16 text-muted-foreground text-sm`,children:`No agents match the current filters.`}):(0,q.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 xl:grid-cols-4 gap-3`,children:x.map(e=>(0,q.jsx)(Ze,{agent:e,parentAgent:e.spawnedBy?p[e.spawnedBy]??null:null,childAgents:ge(b.get(e.id)??[])},e.id))})]})}export{Qe as AgentsView};
2
+ //# sourceMappingURL=agents-atr6HZ1e.js.map