nodal-agents 0.7.0 → 0.7.2

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 (165) hide show
  1. package/cli.js +335 -35
  2. package/migrations/0054_audit2_db_integrity.sql +52 -0
  3. package/migrations/0055_entity_settings.sql +22 -0
  4. package/migrations/0056_agents_skills_entity_scoped_unique.sql +23 -0
  5. package/migrations/0057_telegram_allowed_chats.sql +34 -0
  6. package/migrations/meta/_journal.json +28 -0
  7. package/package.json +1 -1
  8. package/runner.js +47123 -35332
  9. package/web/.next/BUILD_ID +1 -1
  10. package/web/.next/app-path-routes-manifest.json +4 -4
  11. package/web/.next/build-manifest.json +2 -2
  12. package/web/.next/prerender-manifest.json +3 -3
  13. package/web/.next/server/app/(dashboard)/agents/[id]/edit/page.js +3 -3
  14. package/web/.next/server/app/(dashboard)/agents/[id]/edit/page.js.nft.json +1 -1
  15. package/web/.next/server/app/(dashboard)/agents/[id]/edit/page_client-reference-manifest.js +1 -1
  16. package/web/.next/server/app/(dashboard)/agents/[id]/telegram/page.js +2 -2
  17. package/web/.next/server/app/(dashboard)/agents/[id]/telegram/page.js.nft.json +1 -1
  18. package/web/.next/server/app/(dashboard)/agents/[id]/telegram/page_client-reference-manifest.js +1 -1
  19. package/web/.next/server/app/(dashboard)/agents/page.js +2 -2
  20. package/web/.next/server/app/(dashboard)/agents/page.js.nft.json +1 -1
  21. package/web/.next/server/app/(dashboard)/agents/page_client-reference-manifest.js +1 -1
  22. package/web/.next/server/app/(dashboard)/approvals/page.js +2 -2
  23. package/web/.next/server/app/(dashboard)/approvals/page.js.nft.json +1 -1
  24. package/web/.next/server/app/(dashboard)/approvals/page_client-reference-manifest.js +1 -1
  25. package/web/.next/server/app/(dashboard)/automations/page.js +2 -2
  26. package/web/.next/server/app/(dashboard)/automations/page.js.nft.json +1 -1
  27. package/web/.next/server/app/(dashboard)/automations/page_client-reference-manifest.js +1 -1
  28. package/web/.next/server/app/(dashboard)/chat/page.js +2 -2
  29. package/web/.next/server/app/(dashboard)/chat/page.js.nft.json +1 -1
  30. package/web/.next/server/app/(dashboard)/chat/page_client-reference-manifest.js +1 -1
  31. package/web/.next/server/app/(dashboard)/connectors/page.js +1 -1
  32. package/web/.next/server/app/(dashboard)/connectors/page.js.nft.json +1 -1
  33. package/web/.next/server/app/(dashboard)/connectors/page_client-reference-manifest.js +1 -1
  34. package/web/.next/server/app/(dashboard)/credentials/page.js +1 -1
  35. package/web/.next/server/app/(dashboard)/credentials/page.js.nft.json +1 -1
  36. package/web/.next/server/app/(dashboard)/credentials/page_client-reference-manifest.js +1 -1
  37. package/web/.next/server/app/(dashboard)/jobs/[id]/page.js +2 -2
  38. package/web/.next/server/app/(dashboard)/jobs/[id]/page.js.nft.json +1 -1
  39. package/web/.next/server/app/(dashboard)/jobs/[id]/page_client-reference-manifest.js +1 -1
  40. package/web/.next/server/app/(dashboard)/jobs/page.js +2 -2
  41. package/web/.next/server/app/(dashboard)/jobs/page.js.nft.json +1 -1
  42. package/web/.next/server/app/(dashboard)/jobs/page_client-reference-manifest.js +1 -1
  43. package/web/.next/server/app/(dashboard)/learned-skills/page.js +2 -2
  44. package/web/.next/server/app/(dashboard)/learned-skills/page.js.nft.json +1 -1
  45. package/web/.next/server/app/(dashboard)/learned-skills/page_client-reference-manifest.js +1 -1
  46. package/web/.next/server/app/(dashboard)/llm-providers/page.js +1 -1
  47. package/web/.next/server/app/(dashboard)/llm-providers/page.js.nft.json +1 -1
  48. package/web/.next/server/app/(dashboard)/llm-providers/page_client-reference-manifest.js +1 -1
  49. package/web/.next/server/app/(dashboard)/logs/page.js +2 -2
  50. package/web/.next/server/app/(dashboard)/logs/page.js.nft.json +1 -1
  51. package/web/.next/server/app/(dashboard)/logs/page_client-reference-manifest.js +1 -1
  52. package/web/.next/server/app/(dashboard)/mcp/page.js +2 -2
  53. package/web/.next/server/app/(dashboard)/mcp/page.js.nft.json +1 -1
  54. package/web/.next/server/app/(dashboard)/mcp/page_client-reference-manifest.js +1 -1
  55. package/web/.next/server/app/(dashboard)/memories/page.js +2 -2
  56. package/web/.next/server/app/(dashboard)/memories/page.js.nft.json +1 -1
  57. package/web/.next/server/app/(dashboard)/memories/page_client-reference-manifest.js +1 -1
  58. package/web/.next/server/app/(dashboard)/page.js +2 -2
  59. package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
  60. package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
  61. package/web/.next/server/app/(dashboard)/settings/page.js +2 -2
  62. package/web/.next/server/app/(dashboard)/settings/page.js.nft.json +1 -1
  63. package/web/.next/server/app/(dashboard)/settings/page_client-reference-manifest.js +1 -1
  64. package/web/.next/server/app/(dashboard)/settings/root-context/page.js +2 -2
  65. package/web/.next/server/app/(dashboard)/settings/root-context/page.js.nft.json +1 -1
  66. package/web/.next/server/app/(dashboard)/settings/root-context/page_client-reference-manifest.js +1 -1
  67. package/web/.next/server/app/(dashboard)/skills/[id]/edit/page.js +2 -2
  68. package/web/.next/server/app/(dashboard)/skills/[id]/edit/page.js.nft.json +1 -1
  69. package/web/.next/server/app/(dashboard)/skills/[id]/edit/page_client-reference-manifest.js +1 -1
  70. package/web/.next/server/app/(dashboard)/skills/new/page.js +2 -2
  71. package/web/.next/server/app/(dashboard)/skills/new/page.js.nft.json +1 -1
  72. package/web/.next/server/app/(dashboard)/skills/new/page_client-reference-manifest.js +1 -1
  73. package/web/.next/server/app/(dashboard)/skills/page.js +2 -2
  74. package/web/.next/server/app/(dashboard)/skills/page.js.nft.json +1 -1
  75. package/web/.next/server/app/(dashboard)/skills/page_client-reference-manifest.js +1 -1
  76. package/web/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  77. package/web/.next/server/app/_global-error.html +1 -1
  78. package/web/.next/server/app/_global-error.rsc +2 -2
  79. package/web/.next/server/app/_global-error.segments/_full.segment.rsc +2 -2
  80. package/web/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  81. package/web/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  82. package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  83. package/web/.next/server/app/_global-error.segments/_index.segment.rsc +2 -2
  84. package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  85. package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  86. package/web/.next/server/app/_not-found.html +1 -1
  87. package/web/.next/server/app/_not-found.rsc +3 -3
  88. package/web/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
  89. package/web/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  90. package/web/.next/server/app/_not-found.segments/_index.segment.rsc +3 -3
  91. package/web/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  92. package/web/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  93. package/web/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  94. package/web/.next/server/app/api/auth/[...all]/route.js +1 -1
  95. package/web/.next/server/app/api/auth/[...all]/route.js.nft.json +1 -1
  96. package/web/.next/server/app/api/oauth/[provider]/callback/route.js +1 -1
  97. package/web/.next/server/app/api/oauth/[provider]/callback/route.js.nft.json +1 -1
  98. package/web/.next/server/app/api/oauth/[provider]/start/route.js +1 -1
  99. package/web/.next/server/app/api/oauth/[provider]/start/route.js.nft.json +1 -1
  100. package/web/.next/server/app/login/page_client-reference-manifest.js +1 -1
  101. package/web/.next/server/app/onboarding/page.js +205 -185
  102. package/web/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
  103. package/web/.next/server/app-paths-manifest.json +4 -4
  104. package/web/.next/server/chunks/2713.js +47 -27
  105. package/web/.next/server/chunks/3223.js +1 -1
  106. package/web/.next/server/chunks/4574.js +1 -1
  107. package/web/.next/server/chunks/5515.js +1 -0
  108. package/web/.next/server/chunks/6468.js +1 -0
  109. package/web/.next/server/chunks/8410.js +1 -0
  110. package/web/.next/server/chunks/{4488.js → 8810.js} +2 -2
  111. package/web/.next/server/chunks/{3154.js → 960.js} +10 -10
  112. package/web/.next/server/middleware-build-manifest.js +1 -1
  113. package/web/.next/server/pages/404.html +1 -1
  114. package/web/.next/server/pages/500.html +1 -1
  115. package/web/.next/server/server-reference-manifest.js +1 -1
  116. package/web/.next/server/server-reference-manifest.json +1 -1
  117. package/web/.next/static/chunks/4964-c6711d3d479b6085.js +1 -0
  118. package/web/.next/static/chunks/{9836-6830cb9d49ad261f.js → 9836-177f6ca2f15ff703.js} +1 -1
  119. package/web/.next/static/chunks/app/(dashboard)/agents/[id]/edit/page-cfce874f4acede5e.js +6 -0
  120. package/web/.next/static/chunks/app/(dashboard)/agents/[id]/telegram/page-9249c2839f551ba1.js +1 -0
  121. package/web/.next/static/chunks/app/(dashboard)/agents/page-7d784d737acedccf.js +1 -0
  122. package/web/.next/static/chunks/app/(dashboard)/approvals/{page-9a01cb723a6ccff0.js → page-b3a838ecbc94a030.js} +1 -1
  123. package/web/.next/static/chunks/app/(dashboard)/automations/page-b1b548de4f52696c.js +1 -0
  124. package/web/.next/static/chunks/app/(dashboard)/chat/{page-a6cc7a58986c0340.js → page-bcf6dcc73b370eb0.js} +1 -1
  125. package/web/.next/static/chunks/app/(dashboard)/connectors/{page-21d6c042800c8cd3.js → page-2c6f913cc6aea4b7.js} +1 -1
  126. package/web/.next/static/chunks/app/(dashboard)/jobs/[id]/page-43f033251eddcc4b.js +1 -0
  127. package/web/.next/static/chunks/app/(dashboard)/jobs/page-1f892f950bb30403.js +1 -0
  128. package/web/.next/static/chunks/app/(dashboard)/layout-e184673151ff8a05.js +1 -0
  129. package/web/.next/static/chunks/app/(dashboard)/learned-skills/page-f873bb6f8539e47e.js +1 -0
  130. package/web/.next/static/chunks/app/(dashboard)/llm-providers/page-64adda30176f4ccb.js +1 -0
  131. package/web/.next/static/chunks/app/(dashboard)/logs/page-79cfd9141c39d8ef.js +1 -0
  132. package/web/.next/static/chunks/app/(dashboard)/mcp/page-d276d7bab25286a1.js +1 -0
  133. package/web/.next/static/chunks/app/(dashboard)/memories/page-c66720494a340503.js +1 -0
  134. package/web/.next/static/chunks/app/(dashboard)/page-3649204dd27a0ad0.js +1 -0
  135. package/web/.next/static/chunks/app/(dashboard)/settings/page-1cab404d2eccfd80.js +1 -0
  136. package/web/.next/static/chunks/app/(dashboard)/settings/root-context/page-b5898c5444f88c9a.js +1 -0
  137. package/web/.next/static/chunks/app/(dashboard)/skills/[id]/edit/page-82d91fc6b6acc161.js +1 -0
  138. package/web/.next/static/chunks/app/(dashboard)/skills/new/page-58b5ed04583ca7d4.js +1 -0
  139. package/web/.next/static/chunks/app/(dashboard)/skills/page-312bd4ae8ddc8114.js +1 -0
  140. package/web/.next/static/chunks/app/onboarding/{page-a4116e2f430eaff8.js → page-f2f04878e81fdf23.js} +2 -2
  141. package/web/.next/static/css/{eff119dd24f92093.css → 4d808b91d7b58fce.css} +1 -1
  142. package/web/.next/server/chunks/4626.js +0 -1
  143. package/web/.next/server/chunks/8971.js +0 -1
  144. package/web/.next/server/chunks/9043.js +0 -1
  145. package/web/.next/static/chunks/4964-08171c654e41b0a4.js +0 -1
  146. package/web/.next/static/chunks/app/(dashboard)/agents/[id]/edit/page-fa5717f0d0450659.js +0 -6
  147. package/web/.next/static/chunks/app/(dashboard)/agents/[id]/telegram/page-73012222871598aa.js +0 -1
  148. package/web/.next/static/chunks/app/(dashboard)/agents/page-7e9616b28c098e9e.js +0 -1
  149. package/web/.next/static/chunks/app/(dashboard)/automations/page-85c985cd687406ed.js +0 -1
  150. package/web/.next/static/chunks/app/(dashboard)/jobs/[id]/page-f6b993a88c70a2fe.js +0 -1
  151. package/web/.next/static/chunks/app/(dashboard)/jobs/page-d0d6b9db1b68451f.js +0 -1
  152. package/web/.next/static/chunks/app/(dashboard)/layout-d2ac2646967496bb.js +0 -1
  153. package/web/.next/static/chunks/app/(dashboard)/learned-skills/page-ec6312f6dfd7ee23.js +0 -1
  154. package/web/.next/static/chunks/app/(dashboard)/llm-providers/page-1fb26463eddf509c.js +0 -1
  155. package/web/.next/static/chunks/app/(dashboard)/logs/page-0bca733315e8a208.js +0 -1
  156. package/web/.next/static/chunks/app/(dashboard)/mcp/page-ff56ecf2f65f5466.js +0 -1
  157. package/web/.next/static/chunks/app/(dashboard)/memories/page-fe4d9438c93750d6.js +0 -1
  158. package/web/.next/static/chunks/app/(dashboard)/page-9402fe2931216f4b.js +0 -1
  159. package/web/.next/static/chunks/app/(dashboard)/settings/page-995662f10ebff365.js +0 -1
  160. package/web/.next/static/chunks/app/(dashboard)/settings/root-context/page-785b6ce3e4c5890b.js +0 -1
  161. package/web/.next/static/chunks/app/(dashboard)/skills/[id]/edit/page-2106201c4df8b5a4.js +0 -1
  162. package/web/.next/static/chunks/app/(dashboard)/skills/new/page-0135bcb86ab60dc2.js +0 -1
  163. package/web/.next/static/chunks/app/(dashboard)/skills/page-54e939d40c8b5b6d.js +0 -1
  164. /package/web/.next/static/{KFac7DQ7gdp9XPQ2bnb-2 → SgnP_MouhUmw0bBf-lUmD}/_buildManifest.js +0 -0
  165. /package/web/.next/static/{KFac7DQ7gdp9XPQ2bnb-2 → SgnP_MouhUmw0bBf-lUmD}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4964],{14964:(e,t,a)=>{a.d(t,{EB:()=>S,YT:()=>O,zw:()=>H,SV:()=>z,mV:()=>A,eS:()=>D});var i=a(96831);let o=i.k5(["telegram","api","whatsapp","internal","cron","task-board","slack","discord","dashboard"]),l=i.k5(["pending","processing","completed","failed","awaiting_approval","awaiting_delegation","cancelled"]),n=i.k5(["todo","in_progress","done","cancelled","blocked"]),s=i.k5(["low","medium","high"]),r=i.k5(["agent","orchestrator","system"]),d=i.k5(["router","planner"]),c=i.k5(["api_key","oauth2","bearer","basic","none"]),u=i.k5(["pending","approved","rejected","expired"]),p=i.k5(["auto_approve","require_approval","block"]),g=i.k5(["preference","context","outcome","learned_rule"]),m=i.k5(["agent","reflection","manual"]),b=i.k5(["L1","L2","L3"]),h=i.k5(["cron","heartbeat"]),_=i.k5(["success","failed","no_action"]),Y=i.k5(["owner","admin","member","viewer"]),j=i.k5(["agency","startup","personal","studio","enterprise","other"]),k=i.k5(["read","write","destructive"]);i.k5(["webhook","transform","schedule"]),i.k5(["pre_task","post_task","pre_tool","post_tool","on_memory_save"]),i.k5(["http","stdio"]),i.Yj().guid().brand(),i.Yj().guid().brand(),i.Yj().guid().brand(),i.Yj().guid().brand(),i.Yj().guid().brand(),i.Yj().guid().brand(),i.Yj().guid().brand(),i.Yj().guid().brand(),i.Yj().guid().brand(),i.Yj().guid().brand(),i.Yj().guid().brand(),i.Yj().guid().brand(),i.Yj().guid().brand(),i.Yj().guid().brand(),i.Yj().guid().brand(),i.Yj().guid().brand(),i.Ik({id:i.Yj().guid(),user_id:i.Yj().guid(),name:i.Yj().min(1).max(120),slug:i.Yj().min(1).max(80).regex(/^[a-z0-9-]+$/),description:i.Yj().max(500).nullable(),icon:i.Yj().max(4),industry:j.nullable(),goal:i.Yj().max(1e3).nullable(),mcp_token:i.Yj().guid().nullable(),created_at:i.Yj().datetime(),updated_at:i.Yj().datetime()}).strict().omit({id:!0,mcp_token:!0,created_at:!0,updated_at:!0}).extend({description:i.Yj().max(500).nullable().optional(),icon:i.Yj().max(4).default("\uD83C\uDFE2"),industry:j.nullable().optional(),goal:i.Yj().max(1e3).nullable().optional()}),i.Ik({id:i.Yj().guid(),entity_id:i.Yj().guid(),user_id:i.Yj().guid(),role:Y,created_at:i.Yj().datetime()}).strict().omit({id:!0,created_at:!0}).extend({role:Y.default("owner")}),i.Ik({user_id:i.Yj().guid(),display_name:i.Yj().max(120).nullable(),avatar_url:i.Yj().max(500).nullable(),timezone:i.Yj().max(80),locale:i.Yj().max(10),created_at:i.Yj().datetime(),updated_at:i.Yj().datetime()}).strict().omit({created_at:!0,updated_at:!0}).extend({display_name:i.Yj().max(120).nullable().optional(),avatar_url:i.Yj().max(500).nullable().optional(),timezone:i.Yj().max(80).default("UTC"),locale:i.Yj().max(10).default("en")}),i.Ik({id:i.Yj().guid(),entity_id:i.Yj().guid().nullable(),name:i.Yj().min(1).max(120),slug:i.Yj().min(1).max(80).regex(/^[a-z0-9-]+$/),personality:i.Yj().min(1),model:i.Yj().min(1),active:i.zM(),is_default:i.zM(),role:r,orchestrator_mode:d.nullable(),telegram_bot_token:i.Yj().nullable(),telegram_bot_username:i.Yj().nullable(),telegram_offset:i.ai().int().nonnegative().nullable(),requires_approval:i.YO(i.Yj()),capabilities:i.YO(i.Yj()),task_context_template:i.Yj().nullable(),avatar_url:i.Yj().nullable(),system_agent:i.zM(),max_tokens_per_job:i.ai().int().min(0),created_at:i.Yj().datetime(),updated_at:i.Yj().datetime()}).strict().omit({id:!0,created_at:!0,updated_at:!0,telegram_offset:!0,capabilities:!0,system_agent:!0}).extend({active:i.zM().default(!0),is_default:i.zM().default(!1),role:r.default("agent"),orchestrator_mode:d.nullable().optional(),telegram_bot_token:i.Yj().nullable().optional(),telegram_bot_username:i.Yj().nullable().optional(),requires_approval:i.YO(i.Yj()).default([]),task_context_template:i.Yj().nullable().optional(),avatar_url:i.Yj().nullable().optional(),max_tokens_per_job:i.ai().int().min(0).max(5e5).default(0)});let f=i.ai().int().min(0),y=i.ai().int().min(0);i.Ik({id:i.Yj().guid(),entity_id:i.Yj().guid().nullable(),agent_id:i.Yj().guid().nullable(),status:l,channel:o,task:i.Yj().min(1),original_task:i.Yj().nullable(),chat_id:i.Yj().nullable(),system_prompt:i.Yj().nullable(),messages:i.YO(i.g1(i.Yj(),i.L5())),tools_used:i.YO(i.Yj()),turn:i.ai().int().min(0),result:i.Yj().nullable(),error:i.Yj().nullable(),chain_count:f,request_id:i.Yj().nullable(),parent_job_id:i.Yj().guid().nullable(),parent_request_id:i.Yj().nullable(),total_duration_ms:i.ai().int().min(0),input_tokens:i.ai().int().min(0),output_tokens:i.ai().int().min(0),delegation_depth:y,pending_delegation:i.g1(i.Yj(),i.L5()).nullable(),completed_at:i.Yj().datetime().nullable(),created_at:i.Yj().datetime(),updated_at:i.Yj().datetime()}).strict().omit({id:!0,created_at:!0,updated_at:!0,completed_at:!0,messages:!0,tools_used:!0,turn:!0,result:!0,error:!0,chain_count:!0,total_duration_ms:!0,input_tokens:!0,output_tokens:!0,delegation_depth:!0,pending_delegation:!0,parent_request_id:!0}).extend({status:l.default("pending"),original_task:i.Yj().nullable().optional(),chat_id:i.Yj().nullable().optional(),system_prompt:i.Yj().nullable().optional(),request_id:i.Yj().nullable().optional(),parent_job_id:i.Yj().guid().nullable().optional()});let w=i.Yj().max(2e3).nullable(),x=i.Yj().min(1).max(200);i.Ik({id:i.Yj().guid(),entity_id:i.Yj().guid(),orchestrator_id:i.Yj().guid(),title:x,description:w,status:n,priority:s,job_id:i.Yj().guid().nullable(),result:i.Yj().nullable(),created_by_agent_id:i.Yj().guid().nullable(),assigned_agent_id:i.Yj().guid().nullable(),input_tokens:i.ai().int().min(0),output_tokens:i.ai().int().min(0),cost_usd:i.ai().min(0),depends_on:i.YO(i.Yj().guid()),context:i.g1(i.Yj(),i.L5()),root_job_id:i.Yj().guid().nullable(),locked_at:i.Yj().datetime().nullable(),locked_by:i.Yj().nullable(),created_at:i.Yj().datetime(),updated_at:i.Yj().datetime()}).strict().omit({id:!0,created_at:!0,updated_at:!0,job_id:!0,result:!0,created_by_agent_id:!0,assigned_agent_id:!0,input_tokens:!0,output_tokens:!0,cost_usd:!0,depends_on:!0,context:!0,root_job_id:!0,locked_at:!0,locked_by:!0}).extend({status:n.default("todo"),priority:s.default("medium"),description:w.optional(),depends_on:i.YO(i.Yj().guid()).default([]),context:i.g1(i.Yj(),i.L5()).default({}),root_job_id:i.Yj().guid().nullable().optional()}),i.Ik({id:i.Yj().guid(),owner_user_id:i.Yj().guid(),name:i.Yj().min(1),type:i.k5(["google-oauth","notion-oauth","airtable-oauth"]),payload:i.Yj(),created_at:i.p6().nullable(),updated_at:i.p6().nullable()}),i.Ik({clientId:i.Yj(),clientSecret:i.Yj(),refreshToken:i.Yj().nullable(),accessToken:i.Yj(),expiresAt:i.Yj().nullable(),scopes:i.Yj(),accountName:i.Yj(),tokenUrl:i.Yj().url()}),i.Ik({id:i.Yj().guid(),entity_id:i.Yj().guid().nullable(),name:i.Yj().min(1).max(120),slug:i.Yj().min(1).max(80).regex(/^[a-z0-9-]+$/),base_url:i.Yj().nullable(),api_key:i.Yj().nullable(),active:i.zM(),auth_type:c,credential_id:i.Yj().guid().nullable(),created_at:i.Yj().datetime(),updated_at:i.Yj().datetime()}).strict().omit({id:!0,created_at:!0,updated_at:!0}).extend({active:i.zM().default(!0),auth_type:c.default("api_key"),base_url:i.Yj().nullable().optional(),api_key:i.Yj().nullable().optional(),credential_id:i.Yj().guid().nullable().optional()}),i.Ik({id:i.Yj().guid(),entity_id:i.Yj().guid().nullable(),job_id:i.Yj().guid().nullable(),tool_name:i.Yj().min(1),tool_input:i.g1(i.Yj(),i.L5()).nullable(),tool_output:i.Yj().nullable(),duration_ms:i.ai().int().min(0).nullable(),turn:i.ai().int().min(0).nullable(),created_at:i.Yj().datetime()}).strict().omit({id:!0,created_at:!0}).extend({tool_input:i.g1(i.Yj(),i.L5()).nullable().optional(),tool_output:i.Yj().nullable().optional(),duration_ms:i.ai().int().min(0).nullable().optional(),turn:i.ai().int().min(0).nullable().optional()}),i.Ik({id:i.Yj().guid(),entity_id:i.Yj().guid().nullable(),job_id:i.Yj().guid(),agent_id:i.Yj().guid().nullable(),tool_name:i.Yj().min(1),tool_input:i.g1(i.Yj(),i.L5()),status:u,requested_at:i.Yj().datetime(),resolved_at:i.Yj().datetime().nullable(),resolved_by:i.Yj().nullable(),expires_at:i.Yj().datetime().nullable(),notes:i.Yj().nullable()}).strict().omit({id:!0,requested_at:!0,resolved_at:!0,resolved_by:!0,expires_at:!0}).extend({status:u.default("pending"),notes:i.Yj().nullable().optional()}),i.Ik({id:i.Yj().guid(),entity_id:i.Yj().guid().nullable(),agent_id:i.Yj().guid().nullable(),tool_name:i.Yj().min(1),action:p,condition_json:i.g1(i.Yj(),i.L5()),created_at:i.Yj().datetime(),updated_at:i.Yj().datetime()}).strict().omit({id:!0,created_at:!0,updated_at:!0}).extend({agent_id:i.Yj().guid().nullable().optional(),condition_json:i.g1(i.Yj(),i.L5()).default({})});let v=i.ai().int().min(1).max(5);i.Ik({id:i.Yj().guid(),entity_id:i.Yj().guid().nullable(),agent_id:i.Yj().guid().nullable(),fact:i.Yj().min(1),category:g,importance:v,source:m,skill_tags:i.YO(i.Yj().max(60)),memory_layer:b.nullable(),valid_from:i.Yj().datetime().nullable(),valid_to:i.Yj().datetime().nullable(),fact_hash:i.Yj().nullable(),archived:i.zM(),importance_locked:i.zM().default(!1),last_accessed_at:i.Yj().datetime().nullable(),access_count:i.ai().int().min(0),created_at:i.Yj().datetime(),updated_at:i.Yj().datetime()}).strict().omit({id:!0,created_at:!0,updated_at:!0,fact_hash:!0,archived:!0,importance_locked:!0,last_accessed_at:!0,access_count:!0,valid_from:!0,valid_to:!0}).extend({agent_id:i.Yj().guid().nullable().optional(),category:g.default("context"),importance:v.default(3),source:m.default("manual"),skill_tags:i.YO(i.Yj().max(60)).max(20).default([]),memory_layer:b.nullable().optional()}),i.Ik({id:i.Yj().guid(),entity_id:i.Yj().guid().nullable(),agent_id:i.Yj().guid().nullable(),name:i.Yj().min(1).max(120),slug:i.Yj().min(1).max(80).regex(/^[a-z0-9-]+$/),task_template:i.Yj().min(1),active:i.zM(),secret:i.Yj().nullable(),last_triggered_at:i.Yj().datetime().nullable(),trigger_count:i.ai().int().min(0),created_at:i.Yj().datetime(),updated_at:i.Yj().datetime()}).strict().omit({id:!0,created_at:!0,updated_at:!0,secret:!0,last_triggered_at:!0,trigger_count:!0}).extend({active:i.zM().default(!0)});let M=i.Ik({name:i.Yj().min(1),slug:i.Yj().min(1).regex(/^[a-z0-9-]+$/),risk:k,requires_approval:i.zM()}).strict(),C=i.Ik({label:i.Yj().min(1),description:i.Yj().min(1),type:i.k5(["connector_slug","manual"]),value:i.Yj().optional(),critical:i.zM()}).strict();i.Ik({id:i.Yj().guid(),entity_id:i.Yj().guid().nullable(),name:i.Yj().min(1).max(120),slug:i.Yj().min(1).max(80).regex(/^[a-z0-9-]+$/),content:i.Yj().min(1),active:i.zM(),description:i.Yj().max(300).nullable(),default_content:i.Yj().nullable(),content_overridden:i.zM(),required_config:i.YO(C),operations:i.YO(M),required_builtins:i.YO(i.Yj()),created_at:i.Yj().datetime(),updated_at:i.Yj().datetime()}).strict().omit({id:!0,created_at:!0,updated_at:!0}).extend({active:i.zM().default(!0),description:i.Yj().max(300).nullable().optional(),default_content:i.Yj().nullable().optional(),content_overridden:i.zM().default(!1),required_config:i.YO(C).default([]),operations:i.YO(M).default([]),required_builtins:i.YO(i.Yj()).default([])}),i.Ik({id:i.Yj().guid(),entity_id:i.Yj().guid(),agent_id:i.Yj().guid(),skill_id:i.Yj().guid(),approval_overrides:i.g1(i.Yj(),i.zM()),use_custom_instructions:i.zM(),enabled_operations:i.YO(i.Yj()).nullable(),created_at:i.Yj().datetime()}).strict().omit({id:!0,created_at:!0}).extend({approval_overrides:i.g1(i.Yj(),i.zM()).default({}),use_custom_instructions:i.zM().default(!1),enabled_operations:i.YO(i.Yj()).nullable().optional()}),i.Ik({id:i.Yj().guid(),entity_id:i.Yj().guid().nullable(),agent_id:i.Yj().guid(),type:h,name:i.Yj().min(1).max(120),cron_expr:i.Yj().min(1),task:i.Yj().nullable(),objectives:i.Yj().nullable(),active:i.zM(),last_run:i.Yj().datetime().nullable(),next_run:i.Yj().datetime().nullable(),last_status:_.nullable(),chat_id:i.Yj().nullable(),created_at:i.Yj().datetime(),updated_at:i.Yj().datetime()}).strict().omit({id:!0,created_at:!0,updated_at:!0,last_run:!0,next_run:!0,last_status:!0}).extend({type:h.default("cron"),active:i.zM().default(!0),task:i.Yj().nullable().optional(),objectives:i.Yj().nullable().optional(),chat_id:i.Yj().nullable().optional()}),i.Ik({id:i.Yj().guid(),entity_id:i.Yj().guid(),provider:i.Yj().min(1),api_key:i.Yj(),base_url:i.Yj().nullable(),nickname:i.Yj().max(80).nullable(),is_active:i.zM(),created_at:i.Yj().datetime(),updated_at:i.Yj().datetime()}).strict().omit({id:!0,created_at:!0,updated_at:!0}).extend({api_key:i.Yj().default(""),base_url:i.Yj().nullable().optional(),nickname:i.Yj().max(80).nullable().optional(),is_active:i.zM().default(!0)});let I=["https://www.googleapis.com/auth/userinfo.email","openid"];[...I],[...I],[...I],[...I],[...I];let T=i.k5(["propose_confirm","destructive_gate","fully_autonomous"]);i.Ik({createAgent:i.zM(),updateAgent:i.zM(),attachAgent:i.zM(),createSkill:i.zM(),updateSkill:i.zM(),assignSkill:i.zM(),createMcp:i.zM(),attachMcp:i.zM(),createConnector:i.zM(),attachConnector:i.zM(),manageSchedules:i.zM(),autonomy:T});let H={createAgent:!0,updateAgent:!0,attachAgent:!0,createSkill:!0,updateSkill:!0,assignSkill:!0,createMcp:!0,attachMcp:!0,createConnector:!0,attachConnector:!0,manageSchedules:!0,autonomy:"propose_confirm"},O=[{slug:"notion",label:"Notion",authType:"api_key",docsHint:"Create a Notion integration at notion.so/my-integrations and copy its internal secret."},{slug:"notion-oauth",label:"Notion (OAuth)",authType:"oauth2",credentialType:"notion-oauth",docsHint:"Public Integration via OAuth — create one at notion.so/my-integrations (Public type) and authorize from your dashboard."},{slug:"google-drive",label:"Google Drive",authType:"oauth2",credentialType:"google-oauth",docsHint:"OAuth flow — uses your Google credential (create one under Credentials)."},{slug:"gmail",label:"Gmail",authType:"oauth2",credentialType:"google-oauth",docsHint:"OAuth flow — uses your Google credential (create one under Credentials)."},{slug:"google-calendar",label:"Google Calendar",authType:"oauth2",credentialType:"google-oauth",docsHint:"OAuth flow — uses your Google credential (create one under Credentials)."},{slug:"google-sheets",label:"Google Sheets",authType:"oauth2",credentialType:"google-oauth",docsHint:"OAuth flow — uses your Google credential (create one under Credentials)."},{slug:"google-docs",label:"Google Docs",authType:"oauth2",credentialType:"google-oauth",docsHint:"OAuth flow — uses your Google credential (create one under Credentials)."},{slug:"airtable-oauth",label:"Airtable (OAuth)",authType:"oauth2",credentialType:"airtable-oauth",docsHint:"OAuth flow for Airtable Public Integrations (recommended)."},{slug:"airtable",label:"Airtable",authType:"api_key",docsHint:"Personal Access Token — airtable.com/create/tokens."},{slug:"apify",label:"Apify",authType:"api_key",docsHint:"Apify API token — console.apify.com/account/integrations."},{slug:"firecrawl",label:"Firecrawl",authType:"api_key",docsHint:"Firecrawl API key — firecrawl.dev/account."},{slug:"tavily",label:"Tavily",authType:"api_key",docsHint:"Tavily API key — app.tavily.com."},{slug:"poyo",label:"Poyo",authType:"api_key",docsHint:"Poyo API key — poyo.ai (API Console). Sent as a Bearer token."}],S=[{slug:"comfyui",name:"ComfyUI",description:"Generate images, video and audio with your own ComfyUI (local, Desktop or Cloud) — run any workflow with parameter injection. Requires a running ComfyUI + python3.",source:"NousResearch/hermes-agent/skills/creative/comfyui",sourceHost:"github",category:"Creative"},{slug:"excel-author",name:"Excel author",description:"Build auditable Excel workbooks headlessly (openpyxl) — real formulas instead of hardcoded values, cell-colour conventions and balance checks. Needs python3.",source:"NousResearch/hermes-agent/optional-skills/finance/excel-author",sourceHost:"github",category:"Office & documents"},{slug:"pptx-author",name:"PowerPoint author",description:"Generate PowerPoint decks headlessly (python-pptx) — slides, speaker notes and templates, with numbers traceable back to a workbook. Needs python3.",source:"NousResearch/hermes-agent/optional-skills/finance/pptx-author",sourceHost:"github",category:"Office & documents"},{slug:"ocr-and-documents",name:"PDF & OCR",description:"Extract text from PDFs and scanned images (pymupdf, marker-pdf) — searchable text out of documents that have none. Needs python3.",source:"NousResearch/hermes-agent/skills/productivity/ocr-and-documents",sourceHost:"github",category:"Office & documents"},{slug:"nano-pdf",name:"PDF editor",description:"Edit PDF text, fix typos and change titles from natural-language prompts (nano-pdf CLI) — no re-export from the source document.",source:"NousResearch/hermes-agent/skills/productivity/nano-pdf",sourceHost:"github",category:"Office & documents"},{slug:"youtube-content",name:"YouTube content",description:"Turn YouTube videos into summaries, threads and blog posts from their transcripts — no video download.",source:"NousResearch/hermes-agent/skills/media/youtube-content",sourceHost:"github",category:"Media"},{slug:"whisper",name:"Whisper speech-to-text",description:"Local speech-to-text in 99 languages (OpenAI Whisper) — transcription and translation, offline. Needs python3.",source:"NousResearch/hermes-agent/optional-skills/mlops/whisper",sourceHost:"github",category:"Media"},{slug:"osint-investigation",name:"OSINT investigation",description:"Public-records OSINT — SEC EDGAR filings, USAspending contracts, sanctions lists and court records, with entity resolution. No API key (stdlib only).",source:"NousResearch/hermes-agent/optional-skills/research/osint-investigation",sourceHost:"github",category:"Research"},{slug:"stocks",name:"Stocks & crypto",description:"Stock quotes, history, comparison and crypto prices via Yahoo Finance. No API key.",source:"NousResearch/hermes-agent/optional-skills/finance/stocks",sourceHost:"github",category:"Finance"},{slug:"doc-coauthoring",name:"Doc co-authoring",description:"Structured workflow to co-author docs, proposals, specs and decision documents.",source:"anthropics/skills/skills/doc-coauthoring",sourceHost:"github",category:"Office & documents"},{slug:"skill-creator",name:"Skill creator",description:"Create, evaluate and package new agent skills — Anthropic's official skill scaffolder.",source:"anthropics/skills/skills/skill-creator",sourceHost:"github",category:"Development"},{slug:"mcp-builder",name:"MCP builder",description:"Guidance for building well-designed MCP servers with good tools.",source:"anthropics/skills/skills/mcp-builder",sourceHost:"github",category:"Development"},{slug:"webapp-testing",name:"Web app testing",description:"Test and debug local web apps with Playwright — screenshots, console logs, server lifecycle. Needs python3.",source:"anthropics/skills/skills/webapp-testing",sourceHost:"github",category:"Development"},{slug:"frontend-design",name:"Frontend design",description:"Opinionated guidance for distinctive, intentional UI and visual design (one of the most-installed skills).",source:"anthropics/skills/skills/frontend-design",sourceHost:"github",category:"Design"},{slug:"canvas-design",name:"Canvas design",description:"Design-philosophy-driven visual art as PNG/PDF compositions.",source:"anthropics/skills/skills/canvas-design",sourceHost:"github",category:"Design"},{slug:"theme-factory",name:"Theme factory",description:"Style artifacts (slides, docs, HTML) with preset or custom themes.",source:"anthropics/skills/skills/theme-factory",sourceHost:"github",category:"Design"},{slug:"algorithmic-art",name:"Algorithmic art",description:"Generative art via p5.js (flow fields, particles) as self-contained HTML.",source:"anthropics/skills/skills/algorithmic-art",sourceHost:"github",category:"Media"},{slug:"internal-comms",name:"Internal comms",description:"Write internal company communications in preferred formats.",source:"anthropics/skills/skills/internal-comms",sourceHost:"github",category:"Productivity"},{slug:"test-driven-development",name:"Test-driven development",description:"Enforce RED-GREEN-REFACTOR — write tests before code (Superpowers).",source:"obra/superpowers/skills/test-driven-development",sourceHost:"github",category:"Development"},{slug:"systematic-debugging",name:"Systematic debugging",description:"Hypothesis-first structured debugging — understand before fixing (Superpowers).",source:"obra/superpowers/skills/systematic-debugging",sourceHost:"github",category:"Development"},{slug:"writing-plans",name:"Writing plans",description:"Turn a spec into an actionable, checkpointed implementation plan (Superpowers).",source:"obra/superpowers/skills/writing-plans",sourceHost:"github",category:"Development"},{slug:"verification-before-completion",name:"Verify before done",description:"Show real evidence before claiming a task is complete (Superpowers).",source:"obra/superpowers/skills/verification-before-completion",sourceHost:"github",category:"Development"},{slug:"using-git-worktrees",name:"Git worktrees",description:"Isolated parallel workspaces with git worktrees (Superpowers).",source:"obra/superpowers/skills/using-git-worktrees",sourceHost:"github",category:"Development"},{slug:"find-skills",name:"Find skills",description:"Discover and install agent skills on demand (Vercel) — the most-installed skill.",source:"vercel-labs/skills/skills/find-skills",sourceHost:"github",category:"Development"},{slug:"agent-browser",name:"Agent browser",description:"Drive a real browser for agent tasks (Vercel). Needs the browser runtime.",source:"vercel-labs/agent-browser/skills/agent-browser",sourceHost:"github",category:"Web"},{slug:"react-best-practices",name:"React best practices",description:"React patterns and performance guidance (Vercel).",source:"vercel-labs/agent-skills/skills/react-best-practices",sourceHost:"github",category:"Development"},{slug:"web-design-guidelines",name:"Web design guidelines",description:"Practical web design heuristics and guidelines (Vercel).",source:"vercel-labs/agent-skills/skills/web-design-guidelines",sourceHost:"github",category:"Design"},{slug:"playwright",name:"Playwright browser",description:"Browser automation — navigate, fill forms, scrape (OpenAI). Needs the Playwright runtime.",source:"openai/skills/skills/.curated/playwright",sourceHost:"github",category:"Web"},{slug:"supabase-postgres-best-practices",name:"Supabase / Postgres",description:"Postgres & Supabase schema, RLS and query best practices (Supabase).",source:"supabase/agent-skills/skills/supabase-postgres-best-practices",sourceHost:"github",category:"Development"},{slug:"workers-best-practices",name:"Cloudflare Workers",description:"Author and review Cloudflare Workers code (Cloudflare).",source:"cloudflare/skills/skills/workers-best-practices",sourceHost:"github",category:"Development"},{slug:"firecrawl-scrape",name:"Firecrawl scrape",description:"Scrape any page to clean markdown via Firecrawl. Needs a Firecrawl API key.",source:"firecrawl/firecrawl-claude-plugin/skills/firecrawl-scrape",sourceHost:"github",category:"Web"},{slug:"firecrawl-search",name:"Firecrawl search",description:"Web search via Firecrawl. Needs a Firecrawl API key.",source:"firecrawl/firecrawl-claude-plugin/skills/firecrawl-search",sourceHost:"github",category:"Web"},{slug:"semgrep",name:"Semgrep static analysis",description:"Find security bugs with Semgrep static analysis (Trail of Bits). Needs python3.",source:"trailofbits/skills/plugins/static-analysis/skills/semgrep",sourceHost:"github",category:"Security"},{slug:"codeql",name:"CodeQL static analysis",description:"CodeQL static analysis for security review (Trail of Bits).",source:"trailofbits/skills/plugins/static-analysis/skills/codeql",sourceHost:"github",category:"Security"},{slug:"dcf-model",name:"DCF model",description:"Build institutional-quality DCF valuation models in Excel. Needs python3.",source:"NousResearch/hermes-agent/optional-skills/finance/dcf-model",sourceHost:"github",category:"Finance"},{slug:"3-statement-model",name:"3-statement model",description:"Build fully-integrated 3-statement models (income, balance, cash flow) in Excel.",source:"NousResearch/hermes-agent/optional-skills/finance/3-statement-model",sourceHost:"github",category:"Finance"},{slug:"lbo-model",name:"LBO model",description:"Leveraged-buyout models — sources & uses, debt schedule, IRR/MOIC, in Excel.",source:"NousResearch/hermes-agent/optional-skills/finance/lbo-model",sourceHost:"github",category:"Finance"},{slug:"comps-analysis",name:"Comps analysis",description:"Comparable-company analysis — trading multiples and benchmarking, in Excel.",source:"NousResearch/hermes-agent/optional-skills/finance/comps-analysis",sourceHost:"github",category:"Finance"},{slug:"merger-model",name:"Merger model",description:"Accretion/dilution merger models — pro-forma P&L and EPS impact, in Excel.",source:"NousResearch/hermes-agent/optional-skills/finance/merger-model",sourceHost:"github",category:"Finance"},{slug:"remotion",name:"Remotion video",description:"Programmatic video with React via Remotion (official). Needs node.",source:"remotion-dev/skills/skills/remotion",sourceHost:"github",category:"Media"}],z={deepseek:[{modelId:"deepseek-chat",label:"DeepSeek Chat (V3)",capabilities:{tools:!0,forcedToolChoice:!0},contextWindow:128e3,pricing:{inputPerMillionUsd:.27,outputPerMillionUsd:1.1}},{modelId:"deepseek-reasoner",label:"DeepSeek Reasoner (R1)",capabilities:{tools:!0,forcedToolChoice:!0,reasoning:!0},contextWindow:128e3,pricing:{inputPerMillionUsd:.55,outputPerMillionUsd:2.19}}],minimax:[{modelId:"MiniMax-M3",label:"MiniMax M3",capabilities:{tools:!0,forcedToolChoice:!1,reasoning:!0},contextWindow:1048576},{modelId:"MiniMax-M2.7",label:"MiniMax M2.7",capabilities:{tools:!0,forcedToolChoice:!1},contextWindow:2e5},{modelId:"MiniMax-M2",label:"MiniMax M2",capabilities:{tools:!0,forcedToolChoice:!1},contextWindow:2e5}],anthropic:[{modelId:"claude-opus-4-8",label:"Claude Opus 4.8",capabilities:{tools:!0,forcedToolChoice:!0},contextWindow:2e5},{modelId:"claude-sonnet-4-6",label:"Claude Sonnet 4.6",capabilities:{tools:!0,forcedToolChoice:!0},contextWindow:2e5},{modelId:"claude-haiku-4-5-20251001",label:"Claude Haiku 4.5",capabilities:{tools:!0,forcedToolChoice:!0},contextWindow:2e5}],openai:[{modelId:"gpt-5",label:"GPT-5",capabilities:{tools:!0,forcedToolChoice:!0},contextWindow:4e5},{modelId:"gpt-5-mini",label:"GPT-5 mini",capabilities:{tools:!0,forcedToolChoice:!0},contextWindow:4e5}],google:[{modelId:"gemini-2.0-flash",label:"Gemini 2.0 Flash",capabilities:{tools:!0,forcedToolChoice:!0},contextWindow:1048576},{modelId:"gemini-2.5-pro",label:"Gemini 2.5 Pro",capabilities:{tools:!0,forcedToolChoice:!0},contextWindow:1048576}],groq:[{modelId:"llama-3.3-70b-versatile",label:"Llama 3.3 70B",capabilities:{tools:!0,forcedToolChoice:!0},contextWindow:131072}],mistral:[{modelId:"mistral-large-latest",label:"Mistral Large",capabilities:{tools:!0,forcedToolChoice:!0},contextWindow:131072}],openrouter:[{modelId:"anthropic/claude-haiku-4.5",label:"Claude Haiku 4.5",capabilities:{tools:!0,forcedToolChoice:!0},contextWindow:2e5},{modelId:"anthropic/claude-opus-4.7",label:"Claude Opus 4.7",capabilities:{tools:!0,forcedToolChoice:!0},contextWindow:1e6},{modelId:"anthropic/claude-opus-4.7-fast",label:"Claude Opus 4.7 (fast)",capabilities:{tools:!0,forcedToolChoice:!0},contextWindow:1e6},{modelId:"anthropic/claude-opus-4.8",label:"Claude Opus 4.8",capabilities:{tools:!0,forcedToolChoice:!0},contextWindow:1e6},{modelId:"anthropic/claude-opus-4.8-fast",label:"Claude Opus 4.8 (fast)",capabilities:{tools:!0,forcedToolChoice:!0},contextWindow:1e6},{modelId:"anthropic/claude-sonnet-4.6",label:"Claude Sonnet 4.6",capabilities:{tools:!0,forcedToolChoice:!0},contextWindow:1e6},{modelId:"deepseek/deepseek-v3.2",label:"DeepSeek V3.2",capabilities:{tools:!0,forcedToolChoice:!0},contextWindow:131072},{modelId:"deepseek/deepseek-v4-flash",label:"DeepSeek V4 Flash",capabilities:{tools:!0,forcedToolChoice:!0,reasoning:!0},contextWindow:1048576,providerOrder:["deepseek"]},{modelId:"deepseek/deepseek-v4-pro",label:"DeepSeek V4 Pro",capabilities:{tools:!0,forcedToolChoice:!0,reasoning:!0},contextWindow:1048576,providerOrder:["deepseek"]},{modelId:"google/gemini-3.1-flash-lite-preview",label:"Gemini 3.1 Flash Lite (preview)",capabilities:{tools:!0,forcedToolChoice:!0},contextWindow:1048576},{modelId:"google/gemini-3.1-pro-preview",label:"Gemini 3.1 Pro (preview)",capabilities:{tools:!0,forcedToolChoice:!0},contextWindow:1048576},{modelId:"google/gemini-3.5-flash",label:"Gemini 3.5 Flash",capabilities:{tools:!0,forcedToolChoice:!0},contextWindow:1048576},{modelId:"google/gemma-4-31b-it",label:"Gemma 4 31B-IT",capabilities:{tools:!0,forcedToolChoice:!0},contextWindow:262144},{modelId:"minimax/minimax-m3",label:"MiniMax M3",capabilities:{tools:!0,forcedToolChoice:!1,reasoning:!0},contextWindow:1048576},{modelId:"z-ai/glm-5.2",label:"GLM 5.2",capabilities:{tools:!0,forcedToolChoice:!1,reasoning:!0},contextWindow:1048576},{modelId:"moonshotai/kimi-k2.7-code",label:"Kimi K2.7 Code",capabilities:{tools:!0,forcedToolChoice:!1,reasoning:!0},contextWindow:262144}]},P=new Set(["anthropic/claude-haiku-4.5","anthropic/claude-opus-4.7","anthropic/claude-opus-4.7-fast","anthropic/claude-opus-4.8","anthropic/claude-opus-4.8-fast","anthropic/claude-sonnet-4.6","google/gemini-3.1-flash-lite-preview","google/gemini-3.1-pro-preview","google/gemini-3.5-flash","google/gemma-4-31b-it","minimax/minimax-m3","moonshotai/kimi-k2.7-code","claude-opus-4-8","claude-sonnet-4-6","claude-haiku-4-5-20251001","gpt-5","gpt-5-mini","gemini-2.0-flash","gemini-2.5-pro","mistral-large-latest","MiniMax-M3"]);for(let e of Object.values(z))for(let t of e)t.capabilities.vision=P.has(t.modelId);function A(e,t){return z[e]?.find(e=>e.modelId===t)}let W={anthropic:"Anthropic",openai:"OpenAI",google:"Google",deepseek:"DeepSeek",minimax:"MiniMax",mistral:"Mistral",meta:"Meta",qwen:"Qwen","meta-llama":"Meta"};function D(e){let t=new Map;for(let a of e){let e=function(e){let t=e.indexOf("/");if(t<0)return null;let a=e.slice(0,t);return W[a]??a.charAt(0).toUpperCase()+a.slice(1)}(a.modelId),i=t.get(e)??[];i.push(a),t.set(e,i)}return[...t.entries()].map(([e,t])=>({group:e,models:[...t].sort((e,t)=>e.label.localeCompare(t.label))})).sort((e,t)=>(e.group??"").localeCompare(t.group??""))}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9836],{11248:(e,t,n)=>{n.d(t,{default:()=>o});var r=n(3680),a=n(78604),s=n(32895),l=n(97713);function o(){let[e,t]=(0,a.useState)("light"),[n,o]=(0,a.useState)(!1);(0,a.useEffect)(()=>{t("u"<typeof document?"light":"dark"===document.documentElement.getAttribute("data-theme")?"dark":"light"),o(!0)},[]);let i="dark"===e?s.b:l.A,d="dark"===e?"Switch to light theme":"Switch to dark theme";return(0,r.jsx)("button",{type:"button",onClick:()=>{let n="dark"===e?"light":"dark";document.documentElement.setAttribute("data-theme",n);try{localStorage.setItem("nodal.theme",n)}catch{}t(n)},"aria-label":d,title:d,className:"flex h-[34px] w-[34px] items-center justify-center rounded-md border border-rule-2 bg-paper text-ink-2 transition-colors hover:text-ink",suppressHydrationWarning:!0,children:n?(0,r.jsx)(i,{size:15}):(0,r.jsx)(l.A,{size:15})})}},14308:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(3680),a=n(78604),s=n(51869);function l({open:e,title:t,message:n,confirmLabel:o="Confirm",cancelLabel:i="Cancel",destructive:d=!0,onConfirm:c,onCancel:u}){let p=(0,a.useRef)(null),[x,m]=(0,a.useState)(!1);return((0,a.useEffect)(()=>{m(!0)},[]),(0,a.useEffect)(()=>{if(e)return p.current?.focus(),window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t);function t(e){"Escape"===e.key&&u()}},[e,u]),e&&x)?(0,s.createPortal)((0,r.jsxs)("div",{role:"dialog","aria-modal":"true","aria-labelledby":"confirm-dialog-title",className:"fixed inset-0 z-50 flex items-center justify-center px-4 text-left",children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:u,"aria-hidden":"true"}),(0,r.jsxs)("div",{className:"relative bg-paper border border-rule-2 rounded-xl p-6 max-w-md w-full shadow-2xl",children:[(0,r.jsx)("h2",{id:"confirm-dialog-title",className:"text-base font-semibold text-ink",children:t}),n&&(0,r.jsx)("p",{className:"mt-2 text-sm text-ink-3 leading-relaxed",children:n}),(0,r.jsxs)("div",{className:"mt-6 flex justify-end gap-2",children:[(0,r.jsx)("button",{ref:p,type:"button",onClick:u,className:"px-4 py-2 text-sm font-medium border border-rule text-ink-2 rounded-lg hover:border-rule hover:text-ink transition-colors",children:i}),(0,r.jsx)("button",{type:"button",onClick:c,className:`px-4 py-2 text-sm font-semibold rounded-lg transition-colors ${d?"bg-err hover:brightness-[0.94] text-ink":"bg-ink hover:brightness-[0.92] text-canvas"}`,children:o})]})]})]}),document.body):null}},39186:(e,t,n)=>{n.d(t,{ApprovalsProvider:()=>i,e:()=>c});var r=n(3680),a=n(78604),s=n(64678);let l=(0,s.createServerReference)("4091a56ae49f9692f037a27b1733ac3e62709ec8ea",s.callServer,void 0,s.findSourceMapURL,"listApprovalsAction"),o=(0,a.createContext)(null);function i({initial:e,children:t}){let[n,s]=(0,a.useState)(e),d=(0,a.useCallback)(async()=>{let e=await l({status:"pending"});e.ok&&s(e.data.map(e=>({id:e.id,jobId:e.jobId,toolName:e.toolName,agentName:e.agentName,toolInput:e.toolInput,requestedAt:e.requestedAt})))},[]);(0,a.useEffect)(()=>{let e=setInterval(()=>{document.hidden||d()},15e3);function t(){document.hidden||d()}return document.addEventListener("visibilitychange",t),()=>{clearInterval(e),document.removeEventListener("visibilitychange",t)}},[d]);let c=(0,a.useCallback)(()=>{d()},[d]);return(0,r.jsx)(o.Provider,{value:{pending:n,refresh:c},children:t})}let d={pending:[],refresh:()=>{}};function c(){let e=(0,a.useContext)(o);return e||(console.warn("[useApprovals] called outside <ApprovalsProvider> — returning empty state."),d)}},47663:(e,t,n)=>{n.d(t,{C:()=>a});var r=n(64678);let a=(0,r.createServerReference)("406589af82ec340355335d69e976a33b4a5205acdc",r.callServer,void 0,r.findSourceMapURL,"resolveApprovalAction")},64676:(e,t,n)=>{n.d(t,{default:()=>l});var r=n(3680),a=n(32928),s=n(78604);function l({placeholder:e="Search agents, skills, runs…",keyboardShortcut:t=!0,onSubmit:n,className:o=""}){let i=(0,s.useRef)(null);return(0,s.useEffect)(()=>{if(!t)return;let e=e=>{if("/"!==e.key)return;let t=e.target;t&&/^(input|textarea|select)$/i.test(t.tagName)||t?.isContentEditable||(e.preventDefault(),i.current?.focus())};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[t]),(0,r.jsxs)("form",{onSubmit:e=>{e.preventDefault(),n?.(i.current?.value??"")},className:`flex h-[34px] min-w-[280px] items-center gap-2 rounded-md border border-rule-2 bg-paper px-3 text-[13px] text-ink-4 ${o}`,children:[(0,r.jsx)(a.e,{size:13,className:"shrink-0"}),(0,r.jsx)("input",{ref:i,type:"search",placeholder:e,className:"flex-1 border-0 bg-transparent text-[14px] leading-none text-ink outline-none placeholder:text-ink-4"}),(0,r.jsx)("span",{className:"rounded-[5px] border border-rule bg-black/5 px-1.5 py-[1px] font-mono text-[12px] leading-none text-ink-4 dark:bg-white/[0.06]",children:"/"})]})}},88563:(e,t,n)=>{n.d(t,{default:()=>x});var r=n(3680),a=n(78604),s=n(63363),l=n.n(s),o=n(7101),i=n(39504),d=n(47663),c=n(39186);function u({item:e,onApproved:t}){let[n,s]=(0,a.useTransition)();return(0,r.jsx)("button",{type:"button",onClick:n=>{n.preventDefault(),n.stopPropagation(),s(async()=>{let n=await (0,d.C)({approvalRequestId:e.id,decision:"approve"});n.ok?(i.oR.success("Approved"),t()):i.oR.error(n.message)})},disabled:n,className:"shrink-0 rounded-md bg-ok px-2.5 py-1 text-[12px] font-semibold text-canvas transition-[filter] hover:brightness-[0.92] disabled:opacity-40",children:n?"…":"Approve"})}function p({items:e,onClose:t,onApproved:n}){let s=(0,a.useRef)(null);return(0,a.useEffect)(()=>{function e(e){s.current&&!s.current.contains(e.target)&&t()}return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[t]),(0,a.useEffect)(()=>{function e(e){"Escape"===e.key&&t()}return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[t]),(0,r.jsxs)("div",{ref:s,className:"absolute right-0 top-full z-50 mt-1.5 w-[340px] rounded-xl border border-rule-2 bg-paper shadow-lg",role:"dialog","aria-label":"Pending approvals",children:[(0,r.jsx)("div",{className:"border-b border-rule-2 px-4 py-3",children:(0,r.jsxs)("p",{className:"text-[14px] font-semibold text-ink",children:["Pending approvals (",e.length,")"]})}),0===e.length?(0,r.jsx)("p",{className:"px-4 py-5 text-center text-[13px] text-ink-3",children:"No pending approvals."}):(0,r.jsx)("ul",{className:"max-h-[340px] divide-y divide-rule-2 overflow-y-auto",children:e.map(e=>(0,r.jsx)("li",{children:(0,r.jsxs)(l(),{href:`/jobs/${e.jobId}`,onClick:t,className:"flex items-start gap-3 px-4 py-3 transition-colors hover:bg-hover",children:[(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsxs)("p",{className:"truncate text-[13px] font-medium text-ink",children:[e.agentName??"Agent",(0,r.jsx)("span",{className:"mx-1 text-ink-4",children:"\xb7"}),(0,r.jsx)("code",{className:"rounded bg-canvas px-1 py-0.5 font-mono text-[12px] text-ink-2",children:e.toolName})]}),(0,r.jsx)("p",{className:"mt-0.5 truncate text-[12px] text-ink-3",children:function(e){if(!e)return"—";if("string"==typeof e.purpose&&e.purpose.trim()){let t=e.purpose.trim();return t.length>80?t.slice(0,77)+"…":t}if("string"==typeof e.command){let t=e.command;return t.length>60?t.slice(0,57)+"…":t}let t=JSON.stringify(e);return t.length>60?t.slice(0,57)+"…":t}(e.toolInput)}),(0,r.jsx)("p",{className:"mt-0.5 text-[11px] text-ink-4",children:function(e){if(!e)return"—";let t=Math.floor((Date.now()-new Date(e).getTime())/1e3);if(t<60)return`${t}s ago`;let n=Math.floor(t/60);if(n<60)return`${n}m ago`;let r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}(e.requestedAt)})]}),(0,r.jsx)(u,{item:e,onApproved:n})]})},e.id))}),(0,r.jsx)("div",{className:"border-t border-rule-2 px-4 py-2.5",children:(0,r.jsx)(l(),{href:"/approvals",onClick:t,className:"text-[13px] font-medium text-ink-2 transition-colors hover:text-ink",children:"See all approvals →"})})]})}function x(){let{pending:e,refresh:t}=(0,c.e)(),[n,s]=(0,a.useState)(!1),l=(0,a.useRef)(null),i=e.length,d=(0,a.useCallback)(()=>s(!1),[]),u=(0,a.useCallback)(()=>s(e=>!e),[]),x=(0,a.useCallback)(()=>{t()},[t]);return(0,r.jsxs)("div",{ref:l,className:"relative",children:[(0,r.jsxs)("button",{type:"button","aria-label":"Notifications",title:"Notifications",onClick:u,className:"relative flex h-[34px] w-[34px] shrink-0 items-center justify-center rounded-md border border-rule-2 bg-paper text-ink-2 transition-colors hover:text-ink",children:[(0,r.jsx)(o.I,{size:15}),i>0&&(0,r.jsx)("span",{className:"absolute -top-1 -right-1 flex h-4 min-w-[16px] items-center justify-center rounded-full bg-err px-1 text-[11px] font-bold leading-none text-canvas",children:i>99?"99+":i})]}),n&&(0,r.jsx)(p,{items:e,onClose:d,onApproved:x})]})}}}]);
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9836],{11248:(e,t,n)=>{n.d(t,{default:()=>o});var r=n(3680),a=n(78604),s=n(32895),l=n(97713);function o(){let[e,t]=(0,a.useState)("light"),[n,o]=(0,a.useState)(!1);(0,a.useEffect)(()=>{t("u"<typeof document?"light":"dark"===document.documentElement.getAttribute("data-theme")?"dark":"light"),o(!0)},[]);let i="dark"===e?s.b:l.A,d="dark"===e?"Switch to light theme":"Switch to dark theme";return(0,r.jsx)("button",{type:"button",onClick:()=>{let n="dark"===e?"light":"dark";document.documentElement.setAttribute("data-theme",n);try{localStorage.setItem("nodal.theme",n)}catch{}t(n)},"aria-label":d,title:d,className:"flex h-[34px] w-[34px] items-center justify-center rounded-md border border-rule-2 bg-paper text-ink-2 transition-colors hover:text-ink",suppressHydrationWarning:!0,children:n?(0,r.jsx)(i,{size:15}):(0,r.jsx)(l.A,{size:15})})}},14308:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(3680),a=n(78604),s=n(51869);function l({open:e,title:t,message:n,confirmLabel:o="Confirm",cancelLabel:i="Cancel",destructive:d=!0,onConfirm:c,onCancel:u}){let p=(0,a.useRef)(null),[x,m]=(0,a.useState)(!1);return((0,a.useEffect)(()=>{m(!0)},[]),(0,a.useEffect)(()=>{if(e)return p.current?.focus(),window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t);function t(e){"Escape"===e.key&&u()}},[e,u]),e&&x)?(0,s.createPortal)((0,r.jsxs)("div",{role:"dialog","aria-modal":"true","aria-labelledby":"confirm-dialog-title",className:"fixed inset-0 z-50 flex items-center justify-center px-4 text-left",children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:u,"aria-hidden":"true"}),(0,r.jsxs)("div",{className:"relative bg-paper border border-rule-2 rounded-xl p-6 max-w-md w-full shadow-2xl",children:[(0,r.jsx)("h2",{id:"confirm-dialog-title",className:"text-base font-semibold text-ink",children:t}),n&&(0,r.jsx)("p",{className:"mt-2 text-sm text-ink-3 leading-relaxed",children:n}),(0,r.jsxs)("div",{className:"mt-6 flex justify-end gap-2",children:[(0,r.jsx)("button",{ref:p,type:"button",onClick:u,className:"px-4 py-2 text-sm font-medium border border-rule text-ink-2 rounded-lg hover:border-rule hover:text-ink transition-colors",children:i}),(0,r.jsx)("button",{type:"button",onClick:c,className:`px-4 py-2 text-sm font-semibold rounded-lg transition-colors ${d?"bg-err hover:brightness-[0.94] text-ink":"bg-ink hover:brightness-[0.92] text-canvas"}`,children:o})]})]})]}),document.body):null}},39062:(e,t,n)=>{n.d(t,{C:()=>a});var r=n(64678);let a=(0,r.createServerReference)("405714e3103acb8a86e8816a240e218d68c7bfe422",r.callServer,void 0,r.findSourceMapURL,"resolveApprovalAction")},64676:(e,t,n)=>{n.d(t,{default:()=>l});var r=n(3680),a=n(32928),s=n(78604);function l({placeholder:e="Search agents, skills, runs…",keyboardShortcut:t=!0,onSubmit:n,className:o=""}){let i=(0,s.useRef)(null);return(0,s.useEffect)(()=>{if(!t)return;let e=e=>{if("/"!==e.key)return;let t=e.target;t&&/^(input|textarea|select)$/i.test(t.tagName)||t?.isContentEditable||(e.preventDefault(),i.current?.focus())};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[t]),(0,r.jsxs)("form",{onSubmit:e=>{e.preventDefault(),n?.(i.current?.value??"")},className:`flex h-[34px] min-w-[280px] items-center gap-2 rounded-md border border-rule-2 bg-paper px-3 text-[13px] text-ink-4 ${o}`,children:[(0,r.jsx)(a.e,{size:13,className:"shrink-0"}),(0,r.jsx)("input",{ref:i,type:"search",placeholder:e,className:"flex-1 border-0 bg-transparent text-[14px] leading-none text-ink outline-none placeholder:text-ink-4"}),(0,r.jsx)("span",{className:"rounded-[5px] border border-rule bg-black/5 px-1.5 py-[1px] font-mono text-[12px] leading-none text-ink-4 dark:bg-white/[0.06]",children:"/"})]})}},88459:(e,t,n)=>{n.d(t,{ApprovalsProvider:()=>i,e:()=>c});var r=n(3680),a=n(78604),s=n(64678);let l=(0,s.createServerReference)("4097f6d231fec2cd16168a9412d1b68b03b108fe6a",s.callServer,void 0,s.findSourceMapURL,"listApprovalsAction"),o=(0,a.createContext)(null);function i({initial:e,children:t}){let[n,s]=(0,a.useState)(e),d=(0,a.useCallback)(async()=>{let e=await l({status:"pending"});e.ok&&s(e.data.map(e=>({id:e.id,jobId:e.jobId,toolName:e.toolName,agentName:e.agentName,toolInput:e.toolInput,requestedAt:e.requestedAt})))},[]);(0,a.useEffect)(()=>{let e=setInterval(()=>{document.hidden||d()},15e3);function t(){document.hidden||d()}return document.addEventListener("visibilitychange",t),()=>{clearInterval(e),document.removeEventListener("visibilitychange",t)}},[d]);let c=(0,a.useCallback)(()=>{d()},[d]);return(0,r.jsx)(o.Provider,{value:{pending:n,refresh:c},children:t})}let d={pending:[],refresh:()=>{}};function c(){let e=(0,a.useContext)(o);return e||(console.warn("[useApprovals] called outside <ApprovalsProvider> — returning empty state."),d)}},88563:(e,t,n)=>{n.d(t,{default:()=>x});var r=n(3680),a=n(78604),s=n(63363),l=n.n(s),o=n(7101),i=n(39504),d=n(39062),c=n(88459);function u({item:e,onApproved:t}){let[n,s]=(0,a.useTransition)();return(0,r.jsx)("button",{type:"button",onClick:n=>{n.preventDefault(),n.stopPropagation(),s(async()=>{let n=await (0,d.C)({approvalRequestId:e.id,decision:"approve"});n.ok?(i.oR.success("Approved"),t()):i.oR.error(n.message)})},disabled:n,className:"shrink-0 rounded-md bg-ok px-2.5 py-1 text-[12px] font-semibold text-canvas transition-[filter] hover:brightness-[0.92] disabled:opacity-40",children:n?"…":"Approve"})}function p({items:e,onClose:t,onApproved:n}){let s=(0,a.useRef)(null);return(0,a.useEffect)(()=>{function e(e){s.current&&!s.current.contains(e.target)&&t()}return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[t]),(0,a.useEffect)(()=>{function e(e){"Escape"===e.key&&t()}return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[t]),(0,r.jsxs)("div",{ref:s,className:"absolute right-0 top-full z-50 mt-1.5 w-[340px] rounded-xl border border-rule-2 bg-paper shadow-lg",role:"dialog","aria-label":"Pending approvals",children:[(0,r.jsx)("div",{className:"border-b border-rule-2 px-4 py-3",children:(0,r.jsxs)("p",{className:"text-[14px] font-semibold text-ink",children:["Pending approvals (",e.length,")"]})}),0===e.length?(0,r.jsx)("p",{className:"px-4 py-5 text-center text-[13px] text-ink-3",children:"No pending approvals."}):(0,r.jsx)("ul",{className:"max-h-[340px] divide-y divide-rule-2 overflow-y-auto",children:e.map(e=>(0,r.jsx)("li",{children:(0,r.jsxs)(l(),{href:`/jobs/${e.jobId}`,onClick:t,className:"flex items-start gap-3 px-4 py-3 transition-colors hover:bg-hover",children:[(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsxs)("p",{className:"truncate text-[13px] font-medium text-ink",children:[e.agentName??"Agent",(0,r.jsx)("span",{className:"mx-1 text-ink-4",children:"\xb7"}),(0,r.jsx)("code",{className:"rounded bg-canvas px-1 py-0.5 font-mono text-[12px] text-ink-2",children:e.toolName})]}),(0,r.jsx)("p",{className:"mt-0.5 truncate text-[12px] text-ink-3",children:function(e){if(!e)return"—";if("string"==typeof e.purpose&&e.purpose.trim()){let t=e.purpose.trim();return t.length>80?t.slice(0,77)+"…":t}if("string"==typeof e.command){let t=e.command;return t.length>60?t.slice(0,57)+"…":t}let t=JSON.stringify(e);return t.length>60?t.slice(0,57)+"…":t}(e.toolInput)}),(0,r.jsx)("p",{className:"mt-0.5 text-[11px] text-ink-4",children:function(e){if(!e)return"—";let t=Math.floor((Date.now()-new Date(e).getTime())/1e3);if(t<60)return`${t}s ago`;let n=Math.floor(t/60);if(n<60)return`${n}m ago`;let r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}(e.requestedAt)})]}),(0,r.jsx)(u,{item:e,onApproved:n})]})},e.id))}),(0,r.jsx)("div",{className:"border-t border-rule-2 px-4 py-2.5",children:(0,r.jsx)(l(),{href:"/approvals",onClick:t,className:"text-[13px] font-medium text-ink-2 transition-colors hover:text-ink",children:"See all approvals →"})})]})}function x(){let{pending:e,refresh:t}=(0,c.e)(),[n,s]=(0,a.useState)(!1),l=(0,a.useRef)(null),i=e.length,d=(0,a.useCallback)(()=>s(!1),[]),u=(0,a.useCallback)(()=>s(e=>!e),[]),x=(0,a.useCallback)(()=>{t()},[t]);return(0,r.jsxs)("div",{ref:l,className:"relative",children:[(0,r.jsxs)("button",{type:"button","aria-label":"Notifications",title:"Notifications",onClick:u,className:"relative flex h-[34px] w-[34px] shrink-0 items-center justify-center rounded-md border border-rule-2 bg-paper text-ink-2 transition-colors hover:text-ink",children:[(0,r.jsx)(o.I,{size:15}),i>0&&(0,r.jsx)("span",{className:"absolute -top-1 -right-1 flex h-4 min-w-[16px] items-center justify-center rounded-full bg-err px-1 text-[11px] font-bold leading-none text-canvas",children:i>99?"99+":i})]}),n&&(0,r.jsx)(p,{items:e,onClose:d,onApproved:x})]})}}}]);
@@ -0,0 +1,6 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3990],{10396:(e,t,n)=>{"use strict";n.d(t,{f:()=>l});var s=n(64678);let l=(0,s.createServerReference)("408df2b11931bbea4429c0a7c374cb7ade9635b895",s.callServer,void 0,s.findSourceMapURL,"updateAgentAction")},21021:(e,t,n)=>{"use strict";n.d(t,{CT:()=>i,Zr:()=>o,ah:()=>s,d3:()=>r});let s={gmail:"#ea4335","google-drive":"#4285f4","google-sheets":"#0f9d58","google-docs":"#4285f4","google-calendar":"#4285f4",notion:"#000000","notion-oauth":"#000000",airtable:"#f82b60","airtable-oauth":"#f82b60",github:"#24292f",linear:"#5e6ad2",hubspot:"#ff7a59",slack:"#4a154b",intercom:"#1f8ced",stripe:"#635bff",postgres:"#336791",apify:"#00aeff",firecrawl:"#f97316",tavily:"#6366f1",composio:"#000000",poyo:"#7c3aed"},l={gmail:"Gm","google-drive":"GD","google-sheets":"GS","google-docs":"GD","google-calendar":"GC",notion:"No","notion-oauth":"No",airtable:"At","airtable-oauth":"At",github:"Gh",linear:"Li",hubspot:"HS",slack:"Sl",intercom:"IC",stripe:"St",postgres:"PG",apify:"Ap",firecrawl:"FC",tavily:"Tv",composio:"Co","custom-http-mcp":"+","custom-stdio-mcp":"+","cogni-cortex":"CX",keyshot:"KS",photoshop:"Ps",poyo:"Po"};function r(e,t){return l[e]??t.slice(0,2).toUpperCase()}let a={notion:"/connector-icons/notion.svg","notion-oauth":"/connector-icons/notion.svg","google-drive":"/connector-icons/google-drive.svg",gmail:"/connector-icons/gmail.svg","google-sheets":"/connector-icons/google-sheets.svg","google-docs":"/connector-icons/google-docs.svg","google-calendar":"/connector-icons/google-calendar.svg",airtable:"/connector-icons/airtable.svg","airtable-oauth":"/connector-icons/airtable.svg",stripe:"/connector-icons/stripe.svg",sentry:"/connector-icons/sentry.svg","mcp-github":"/connector-icons/github.svg","mcp-postgres":"/connector-icons/postgresql.svg","mcp-git":"/connector-icons/git.svg",blender:"/connector-icons/blender.svg",unity:"/connector-icons/unity.svg","unreal-engine":"/connector-icons/unreal-engine.svg",photoshop:"/connector-icons/photoshop.svg","mcp-playwright":"/connector-icons/playwright.svg",supabase:"/connector-icons/supabase.svg",perplexity:"/connector-icons/perplexity.svg",linear:"/connector-icons/linear.svg",n8n:"/connector-icons/n8n.svg",firecrawl:"/connector-icons/firecrawl.svg",apify:"/connector-icons/apify.svg",tavily:"/connector-icons/tavily.svg","mcp-fetch":"/connector-icons/fetch.svg",keyshot:"/connector-icons/keyshot.svg",composio:"/connector-icons/composio.png"};function i(e){return a[e]??null}function o(e){return"mcp-filesystem"===e?"\uD83D\uDCC1":null}},32767:(e,t,n)=>{"use strict";n.d(t,{default:()=>el});var s=n(3680),l=n(78604),r=n(63363),a=n.n(r),i=n(27540),o=n(73868),c=n(39504),d=n(22799),x=n(56662),p=n(61453),u=n(81906),m=n(80957),h=n(14099),g=n(98968),b=n(64678);let f=(0,b.createServerReference)("40cc515a6f0f6f3bdb9607287ae9531189c0ba1541",b.callServer,void 0,b.findSourceMapURL,"listAgentWorkspacesAction");var v=n(52637),k=n(10396);let j=(0,b.createServerReference)("40de30a334259c82d756d3eb017a4a0d9402d86a91",b.callServer,void 0,b.findSourceMapURL,"listAgentApprovalRulesAction"),w=(0,b.createServerReference)("4054e0a82931897c7444f29711df8d4fda90fca470",b.callServer,void 0,b.findSourceMapURL,"setAgentApprovalRuleAction"),N=(0,b.createServerReference)("403f1c1da0489dadeb23050c8464c4d6cd873eb68c",b.callServer,void 0,b.findSourceMapURL,"setRunCommandYoloAction"),y=(0,b.createServerReference)("40a4519096db6470bb8434ac9e0b4b0d613af322bf",b.callServer,void 0,b.findSourceMapURL,"setSkillScriptsAuthorizedAction"),S=(0,b.createServerReference)("4099860aad72be08a9a28709f8a1ff32eb1736bccd",b.callServer,void 0,b.findSourceMapURL,"setSkillFilesWritableAction"),C=(0,b.createServerReference)("605f7c75a0f45cae6282b52dcfe1bdf75a30089259",b.callServer,void 0,b.findSourceMapURL,"listWorkspaceFilesAction"),A=(0,b.createServerReference)("70590053974fb747b319578c031c5c846d9e2fc371",b.callServer,void 0,b.findSourceMapURL,"uploadToWorkspaceAction"),R=(0,b.createServerReference)("706d110d48e1718ed892cc0d5ae420c8d18a6cde6e",b.callServer,void 0,b.findSourceMapURL,"deleteWorkspaceFileAction"),M=(0,b.createServerReference)("70e3d92f9d3f3db7bb5de1894c29d0576420aeee94",b.callServer,void 0,b.findSourceMapURL,"addAgentWorkspaceAction"),I=(0,b.createServerReference)("40224a127742dd27b8bd9a9f77616ee50a4611a1d3",b.callServer,void 0,b.findSourceMapURL,"removeAgentWorkspaceAction");var $=n(14308),L=n(14964),_=n(63217),O=n(37955),T=n(81630);function U({glyph:e,name:t,description:n,meta:l,actions:r,expanded:a,className:i=""}){return(0,s.jsxs)("div",{className:`overflow-hidden rounded-[10px] border border-rule-2 bg-paper ${i}`,children:[(0,s.jsxs)("div",{className:"flex items-center gap-3.5 px-4 py-3.5",children:[e&&(0,s.jsx)("div",{className:"flex-shrink-0",children:e}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsx)("div",{className:"text-[14px] font-medium leading-[1.2] text-ink",children:t}),n&&(0,s.jsx)("div",{className:"mt-0.5 truncate text-[13px] leading-[1.3] text-ink-3",children:n})]}),l&&(0,s.jsx)("div",{className:"flex-shrink-0 font-mono text-[11px] tracking-[0.04em] text-ink-4",children:l}),r&&(0,s.jsx)("div",{className:"flex flex-shrink-0 items-center gap-2",children:r})]}),a&&(0,s.jsx)("div",{className:"space-y-2 border-t border-rule-2 bg-canvas/40 px-4 py-3",children:a})]})}function P({onClick:e,title:t,children:n,ariaLabel:l}){return(0,s.jsx)("button",{type:"button",onClick:e,title:t,"aria-label":l??t,className:"flex h-7 w-7 items-center justify-center rounded-md border border-rule text-ink-3 transition-colors hover:bg-hover hover:text-ink",children:n})}var F=n(67108),W=n(93606),D=n(99203),z=n(32928);let E=[{value:"All",label:"All"},{value:"Running",label:"Running"},{value:"Failed",label:"Failed"}];function B({jobs:e,agents:t,agentId:n}){let[r,i]=(0,l.useState)("All"),[o,c]=(0,l.useState)(""),d=(0,l.useMemo)(()=>new Map(t.map(e=>[e.id,e])),[t]),x=(0,l.useMemo)(()=>{let t=n?e.filter(e=>e.agentId===n):e;if("Running"===r?t=t.filter(e=>{let t=e.status??"";return"processing"===t||"pending"===t||t.startsWith("awaiting")}):"Failed"===r&&(t=t.filter(e=>"failed"===e.status||"cancelled"===e.status)),o.trim()){let e=o.toLowerCase();t=t.filter(t=>{let n=t.agentId?d.get(t.agentId)?.name??"":"";return t.task.toLowerCase().includes(e)||n.toLowerCase().includes(e)||t.channel.toLowerCase().includes(e)})}return t},[e,n,r,o,d]);return(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"mb-3.5 flex flex-wrap items-center gap-2.5",children:[(0,s.jsx)(F.A,{tabs:E,defaultValue:"All",variant:"dark-active",onChange:e=>i(e)}),(0,s.jsxs)("div",{className:"ml-auto flex h-[34px] min-w-[240px] items-center gap-2 rounded-md border border-rule-2 bg-paper px-3 text-[13px] text-ink-4",children:[(0,s.jsx)(z.e,{size:13,className:"shrink-0"}),(0,s.jsx)("input",{type:"search",value:o,onChange:e=>c(e.target.value),placeholder:"Search by task or agent…",className:"flex-1 border-0 bg-transparent text-[14px] leading-none text-ink outline-none placeholder:text-ink-4"})]})]}),(0,s.jsx)("div",{className:"overflow-hidden rounded-2xl border border-rule-2 bg-paper",children:0===x.length?(0,s.jsx)("div",{className:"px-6 py-12 text-center text-[14px] text-ink-4",children:0===e.length?"No runs yet. Use the form above to send your first task to an agent.":"No runs match the current filter."}):(0,s.jsx)("div",{className:"overflow-x-auto",children:(0,s.jsxs)("table",{className:"w-full border-collapse text-sm",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)(K,{children:"Agent"}),(0,s.jsx)(K,{children:"Task"}),(0,s.jsx)(K,{className:"hidden md:table-cell",children:"Channel"}),(0,s.jsx)(K,{className:"hidden lg:table-cell",children:"Started"}),(0,s.jsx)(K,{align:"right",children:"Status"})]})}),(0,s.jsx)("tbody",{children:x.map(e=>{var t,n,l,r;let i=e.agentId?d.get(e.agentId):null,o="completed"===(t=e.status)?"done":"failed"===t||"cancelled"===t?"warn":"processing"===t||"pending"===t||t?.startsWith("awaiting")?"run":"idle";return(0,s.jsxs)("tr",{className:"border-b border-dashed border-rule-2 last:border-0 hover:bg-hover transition-colors",children:[(0,s.jsx)("td",{className:"px-[18px] py-3 align-middle",children:i?(0,s.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,s.jsx)(D.A,{name:i.name,imageUrl:i.avatarUrl,size:"md",shape:"round"}),(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("div",{className:"truncate text-[14px] font-medium leading-[1.2] text-ink",children:i.name}),(0,s.jsx)("div",{className:"truncate font-mono text-[11px] leading-none text-ink-4",children:i.slug})]})]}):(0,s.jsx)("span",{className:"font-mono text-[12px] text-ink-4",children:"—"})}),(0,s.jsx)("td",{className:"max-w-[320px] px-[18px] py-3 align-middle",children:(0,s.jsx)(a(),{href:`/jobs/${e.id}`,className:"line-clamp-1 text-[14px] text-ink-2 hover:text-ink transition-colors",title:e.task,children:(n=e.task).length>72?n.slice(0,72)+"…":n})}),(0,s.jsx)("td",{className:"hidden px-[18px] py-3 align-middle font-mono text-[12px] text-ink-4 md:table-cell",children:e.channel}),(0,s.jsx)("td",{className:"hidden px-[18px] py-3 align-middle font-mono text-[12px] text-ink-4 lg:table-cell",children:(l=e.createdAt)?("string"==typeof l?new Date(l):l).toLocaleString(void 0,{weekday:"short",hour:"2-digit",minute:"2-digit"}):"—"}),(0,s.jsx)("td",{className:"px-[18px] py-3 align-middle text-right",children:(0,s.jsx)(W.A,{variant:o,label:(r=e.status)?({pending:"Pending",processing:"Running",completed:"Done",failed:"Failed",awaiting_approval:"Awaiting",awaiting_delegation:"Awaiting",cancelled:"Cancelled"})[r]??r:"Pending"})})]},e.id)})})]})})})]})}function K({children:e,align:t="left",className:n=""}){return(0,s.jsx)("th",{className:`border-b border-rule-2 px-[18px] pt-1.5 pb-2.5 font-mono text-[11px] font-normal whitespace-nowrap uppercase tracking-[0.16em] text-ink-4 ${"right"===t?"text-right":"text-left"} ${n}`,children:e})}var q=n(21021);let Y=(0,b.createServerReference)("78f711f46e63ddd4787714f658f99b4aa34eb4c229",b.callServer,void 0,b.findSourceMapURL,"setAgentConnectorAssignmentAction"),G=(0,b.createServerReference)("783b8b1ba4b89453f1cf1064c34a8453b8c45c7f7f",b.callServer,void 0,b.findSourceMapURL,"setAgentMcpServerAssignmentAction");function H({onClick:e,href:t,children:n,className:l=""}){let r=`flex h-[42px] w-full items-center justify-center gap-2 rounded-[10px] border border-dashed border-rule bg-paper/40 text-[14px] font-medium text-ink-3 transition-colors hover:bg-paper/60 hover:text-ink-2 ${l}`,a=(0,s.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:(0,s.jsx)("path",{d:"M7 2v10M2 7h10"})});return t?(0,s.jsxs)("a",{href:t,className:r,children:[a,n]}):(0,s.jsxs)("button",{type:"button",onClick:e,className:r,children:[a,n]})}function V({agentId:e,connectors:t,mcpServers:n}){let[r,a]=(0,l.useState)(()=>{let e=new Map;for(let n of t)e.set(n.connectorId,{assigned:n.assigned,enabledOperations:n.enabledOperations});return e}),[i,o]=(0,l.useState)(()=>{let e=new Map;for(let t of n)e.set(t.mcpServerId,{assigned:t.assigned,enabledTools:t.enabledTools});return e}),[d,x]=(0,l.useState)(new Set),p=(0,l.useRef)(new Map),u=(0,l.useCallback)((t,n,s)=>{let l=`conn:${t}`,r=p.current.get(l);r&&clearTimeout(r);let a=setTimeout(()=>{p.current.delete(l),Y(e,t,n,s).then(e=>{e.ok||c.oR.error(e.message)})},300);p.current.set(l,a)},[e]),m=(0,l.useCallback)((t,n,s)=>{let l=`mcp:${t}`,r=p.current.get(l);r&&clearTimeout(r);let a=setTimeout(()=>{p.current.delete(l),G(e,t,n,s).then(e=>{e.ok||c.oR.error(e.message)})},300);p.current.set(l,a)},[e]);function h(e,t){a(n=>{let s=new Map(n);return s.set(e,{assigned:t,enabledOperations:null}),u(e,t,null),s}),t||f(e)}function g(e,t){o(n=>{let s=new Map(n);return s.set(e,{assigned:t,enabledTools:null}),m(e,t,null),s}),t||f(e)}function b(e){x(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}function f(e){x(t=>{let n=new Set(t);return n.delete(e),n})}let{connected:v,available:k}=(0,l.useMemo)(()=>{let e=[],s=[];for(let n of t){let t=r.get(n.connectorId)??n,l={kind:"api",row:n};t.assigned?e.push(l):s.push(l)}for(let t of n){let n=i.get(t.mcpServerId)??t,l={kind:"mcp",row:t};n.assigned?e.push(l):s.push(l)}return{connected:e,available:s}},[t,n,r,i]);if(0===t.length&&0===n.length)return(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsx)("p",{className:"text-[13px] text-ink-3",children:"No connectors or MCP servers installed on this workspace yet. Add some first; you'll then be able to attach them to this agent."}),(0,s.jsx)(H,{href:"/connectors",children:"Browse connectors marketplace"}),(0,s.jsx)(H,{href:"/mcp",children:"Browse MCP servers"})]});return(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)(J,{label:`Connected \xb7 ${v.length}`,hint:"Revoke any to detach everywhere. Per-op (API) / per-tool (MCP) whitelist via the gear icon.",children:[0===v.length&&(0,s.jsx)("p",{className:"text-[13px] text-ink-3",children:"No connectors or MCP servers attached to this agent yet. Pick from the list below."}),v.map(e=>j(e,!0))]}),k.length>0&&(0,s.jsx)(J,{label:`Available on this workspace \xb7 ${k.length}`,hint:"Already installed at the workspace level; click + to attach to this agent.",children:k.map(e=>j(e,!1))}),(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsx)(H,{href:"/connectors",children:"Browse connectors marketplace"}),(0,s.jsx)(H,{href:"/mcp",children:"Browse MCP servers"})]})]});function j(e,t){if("api"===e.kind){let n=e.row,l=r.get(n.connectorId)??n,i=d.has(n.connectorId),o=n.availableOperations,c=null===l.enabledOperations?`all ${o.length} ops`:`${l.enabledOperations.length} of ${o.length} ops`;return(0,s.jsx)(U,{glyph:(0,s.jsx)(T.A,{variant:"conn",size:"lg",shape:"square",background:q.ah[n.slug],children:(0,s.jsx)("span",{className:"font-mono text-[11px] font-semibold",children:(0,q.d3)(n.slug,n.label)})}),name:(0,s.jsxs)(s.Fragment,{children:[n.label,(0,s.jsx)(X,{kind:"API"})]}),description:n.credentialName??void 0,meta:t?c:`${o.length} ops`,actions:t?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(P,{title:i?"Hide operations":"Configure operations",ariaLabel:"Configure",onClick:()=>b(n.connectorId),children:(0,s.jsx)(ee,{})}),(0,s.jsx)(P,{title:"Detach from this agent",ariaLabel:"Detach",onClick:()=>h(n.connectorId,!1),children:(0,s.jsx)(et,{})})]}):(0,s.jsx)(P,{title:"Attach to this agent",ariaLabel:"Attach",onClick:()=>h(n.connectorId,!0),children:(0,s.jsx)(en,{})}),expanded:t&&i?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(Q,{onClick:()=>{var e;return e=n.connectorId,void a(t=>{let n=new Map(t);return n.set(e,{assigned:!0,enabledOperations:null}),u(e,!0,null),n})},children:"Enable all"}),(0,s.jsx)(Q,{onClick:()=>h(n.connectorId,!1),children:"Uncheck all"})]}),(0,s.jsx)("div",{className:"space-y-0.5",children:o.map(e=>{let t=null===l.enabledOperations||l.enabledOperations.includes(e.slug);return(0,s.jsxs)("label",{className:"flex cursor-pointer items-center gap-2 rounded px-1 py-1 text-[13px] transition-colors hover:bg-hover",children:[(0,s.jsx)("input",{type:"checkbox",checked:t,onChange:()=>{var t,s;return t=n.connectorId,s=e.slug,void a(e=>{let n,l=e.get(t)??{assigned:!0,enabledOperations:null},r=o.map(e=>e.slug);null!==(n=null===l.enabledOperations?r.filter(e=>e!==s):l.enabledOperations.includes(s)?l.enabledOperations.filter(e=>e!==s):[...l.enabledOperations,s])&&n.length===r.length&&(n=null);let a=new Map(e);return null!==n&&0===n.length?(a.set(t,{assigned:!1,enabledOperations:null}),u(t,!1,null),f(t)):(a.set(t,{...l,enabledOperations:n}),u(t,!0,n)),a})},className:"shrink-0 accent-agent-vivid"}),(0,s.jsx)("code",{className:"shrink-0 font-mono text-[12px] text-ink-2",children:e.slug}),(0,s.jsx)(Z,{op:e}),e.description&&(0,s.jsx)("span",{className:"truncate text-[12px] italic text-ink-4",children:e.description})]},e.slug)})})]}):null},`conn:${n.connectorId}`)}let n=e.row,l=i.get(n.mcpServerId)??n,c=d.has(n.mcpServerId),x=n.availableTools.map(e=>e.name),p=null===l.enabledTools?`all ${x.length} tools`:`${l.enabledTools.length} of ${x.length} tools`;return(0,s.jsx)(U,{glyph:(0,s.jsx)(T.A,{variant:"conn",size:"lg",shape:"square",children:(0,s.jsx)("span",{className:"font-mono text-[11px] font-semibold",children:"MCP"})}),name:(0,s.jsxs)(s.Fragment,{children:[n.label,(0,s.jsx)(X,{kind:"MCP"})]}),meta:t?p:`${x.length} tools`,actions:t?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(P,{title:c?"Hide tools":"Configure tools",ariaLabel:"Configure",onClick:()=>b(n.mcpServerId),children:(0,s.jsx)(ee,{})}),(0,s.jsx)(P,{title:"Detach from this agent",ariaLabel:"Detach",onClick:()=>g(n.mcpServerId,!1),children:(0,s.jsx)(et,{})})]}):(0,s.jsx)(P,{title:"Attach to this agent",ariaLabel:"Attach",onClick:()=>g(n.mcpServerId,!0),children:(0,s.jsx)(en,{})}),expanded:t&&c?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(Q,{onClick:()=>{var e;return e=n.mcpServerId,void o(t=>{let n=new Map(t);return n.set(e,{assigned:!0,enabledTools:null}),m(e,!0,null),n})},children:"Enable all"}),(0,s.jsx)(Q,{onClick:()=>g(n.mcpServerId,!1),children:"Uncheck all"})]}),(0,s.jsx)("div",{className:"space-y-0.5",children:n.availableTools.map(e=>{let t=null===l.enabledTools||l.enabledTools.includes(e.name);return(0,s.jsxs)("label",{className:"flex cursor-pointer items-center gap-2 rounded px-1 py-1 text-[13px] transition-colors hover:bg-hover",children:[(0,s.jsx)("input",{type:"checkbox",checked:t,onChange:()=>{var t,s;return t=n.mcpServerId,s=e.name,void o(e=>{let n,l=e.get(t)??{assigned:!0,enabledTools:null};null!==(n=null===l.enabledTools?x.filter(e=>e!==s):l.enabledTools.includes(s)?l.enabledTools.filter(e=>e!==s):[...l.enabledTools,s])&&n.length===x.length&&(n=null);let r=new Map(e);return null!==n&&0===n.length?(r.set(t,{assigned:!1,enabledTools:null}),m(t,!1,null),f(t)):(r.set(t,{assigned:!0,enabledTools:n}),m(t,!0,n)),r})},className:"shrink-0 accent-agent-vivid"}),(0,s.jsx)("code",{className:"shrink-0 font-mono text-[12px] text-ink-2",children:e.name}),e.description&&(0,s.jsx)("span",{className:"truncate text-[12px] italic text-ink-4",children:e.description})]},e.name)})})]}):null},`mcp:${n.mcpServerId}`)}}function J({label:e,hint:t,children:n}){return(0,s.jsxs)("section",{className:"space-y-2",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"font-mono text-[11px] uppercase tracking-[0.12em] text-ink-4",children:e}),t&&(0,s.jsx)("p",{className:"mt-1 text-[12px] leading-[1.5] text-ink-3",children:t})]}),(0,s.jsx)("div",{className:"space-y-2",children:n})]})}function X({kind:e}){return(0,s.jsx)("span",{className:"ml-2 font-mono text-[11px] uppercase tracking-[0.04em] text-ink-4",children:e})}function Q({children:e,onClick:t}){return(0,s.jsx)("button",{type:"button",onClick:t,className:"rounded border border-rule px-2 py-1 text-[12px] font-medium text-ink-3 transition-colors hover:border-rule-2 hover:text-ink",children:e})}function Z({op:e}){let t="inline-flex shrink-0 items-center rounded px-1.5 py-0.5 text-[11px] font-semibold uppercase tracking-wider";return"read"===e.risk?(0,s.jsx)("span",{className:`${t} bg-agent-vivid/10 text-ok`,children:"read"}):"write"===e.risk?(0,s.jsxs)("span",{className:`${t} bg-warn/10 text-warn`,children:[e.requiresApproval?"⚠ ":"","write"]}):(0,s.jsx)("span",{className:`${t} bg-warn-bg text-err`,children:"⚠ destr"})}function ee(){return(0,s.jsxs)("svg",{width:"13",height:"13",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.4",children:[(0,s.jsx)("circle",{cx:"8",cy:"8",r:"2"}),(0,s.jsx)("circle",{cx:"8",cy:"8",r:"6"})]})}function et(){return(0,s.jsx)("svg",{width:"11",height:"11",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.4",children:(0,s.jsx)("path",{d:"M3 3l6 6M9 3l-6 6"})})}function en(){return(0,s.jsx)("svg",{width:"11",height:"11",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.6",children:(0,s.jsx)("path",{d:"M6 2v8M2 6h8"})})}var es=n(70448);function el({agent:e,peers:t,allAgents:n,llmKeys:r,connectors:a,mcpServers:d,jobs:x,attachedSkills:p,lanCommandYolo:u=!1,isOwner:m=!1}){var h,g;let b=(0,i.useRouter)(),[j,w]=(0,l.useTransition)(),[N,y]=(0,l.useState)("overview"),S=(h=e.role??null,g=e.orchestratorMode??null,"orchestrator"===h&&"planner"===g?"planner":"orchestrator"===h?"router":"worker"),C=(0,l.useMemo)(()=>r.filter(e=>e.isActive),[r]),A=e.llmKeyId??C[0]?.id??"",[R,M]=(0,l.useState)(e.name),[I,$]=(0,l.useState)(e.personality??""),[O,T]=(0,l.useState)(S),[U,P]=(0,l.useState)(e.subAgentIds),[F,W]=(0,l.useState)(A),[D,z]=(0,l.useState)(e.fallbackChain??[]),[E,K]=(0,l.useState)(e.model??""),[q,Y]=(0,l.useState)(e.avatarUrl??null),[G,H]=(0,l.useState)({}),[J,X]=(0,l.useState)(!1),[Q,Z]=(0,l.useState)([]),[ee,et]=(0,l.useState)(!1);(0,l.useEffect)(()=>{f(e.id).then(e=>{e.ok&&Z(e.data),et(!0)})},[e.id]),(0,l.useEffect)(()=>{F&&void 0===G[F]&&(X(!0),(0,v.W)(F).then(e=>{H(t=>({...t,[F]:e.ok?e.data:[]})),X(!1)}))},[F]);let en=(0,l.useMemo)(()=>r.find(e=>e.id===F)??null,[r,F]),es=0===C.length,eo=(e.name||e.slug).slice(0,1).toUpperCase(),ec=a.filter(e=>e.assigned),ed=ec.length,eu=d.filter(e=>e.assigned).length,eh="worker"===O?0:U.length,eg=(I||"").split(/\n+/).filter(Boolean)[0]?.trim()??"No description yet.",eb=x.length,ev=x.filter(e=>"completed"===e.status).length,ej=R!==e.name||I!==(e.personality??"")||O!==S||JSON.stringify([...U].sort())!==JSON.stringify([...e.subAgentIds].sort())||F!==A||JSON.stringify(D)!==JSON.stringify(e.fallbackChain??[])||E!==(e.model??"")||q!==(e.avatarUrl??null);return(0,s.jsx)(o.A,{title:"Edit agent",subtitle:e.name,children:(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsx)(er,{}),(0,s.jsx)(ea,{agents:n,activeId:e.id}),(0,s.jsx)(ei,{initial:eo,avatarUrl:q,name:e.name,personaPreview:eg,role:S,slug:e.slug,model:e.model,llmKeyLabel:r.find(t=>t.id===e.llmKeyId)?.nickname??(r.find(t=>t.id===e.llmKeyId)?.provider?(0,_.R)(r.find(t=>t.id===e.llmKeyId).provider):null),stats:{connectors:ed,mcps:eu,subAgents:eh,skills:p.length,totalRuns:eb,successfulRuns:ev},onConfigure:()=>y("settings")}),(0,s.jsx)(ex,{tab:N,onChange:y,counts:{skills:p.length,connectors:ed+eu,runs:eb}}),"overview"===N&&(0,s.jsx)(em,{jobs:x,attachedSkills:p,connectorsAssigned:ec,mcpsAssignedCount:eu,onOpenSkills:()=>y("skills"),onOpenConnectors:()=>y("connectors")}),"skills"===N&&(0,s.jsx)(ef,{skills:p}),"connectors"===N&&(0,s.jsx)(ep,{children:(0,s.jsx)(V,{agentId:e.id,connectors:a,mcpServers:d},e.id)}),"runs"===N&&(0,s.jsx)(B,{jobs:x,agents:[{id:e.id,name:e.name,slug:e.slug},...t],agentId:e.id}),"autonomy"===N&&(0,s.jsx)(ek,{agentId:e.id,connectors:a,hasTelegramBot:!!e.telegramBotToken,attachedSkills:p,lanCommandYolo:u,isOwner:m}),"settings"===N&&(0,s.jsx)(eR,{name:R,slug:e.slug,avatarUrl:q,personality:I,role:O,showSubAgents:"worker"!==O,subAgentIds:U,peers:t,llmKeyId:F,fallbackChain:D,activeKeys:C,selectedKey:en,model:E,noLlmKeys:es,workspaces:Q,workspacesLoaded:ee,onWorkspacesChange:Z,agentId:e.id,dirty:ej,isPending:j,onChangeName:M,onChangeAvatar:Y,onChangePersonality:$,onChangeRole:T,onToggleSubAgent:function(e){P(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},onToggleFallback:function(e){z(t=>{if(t.some(t=>t.keyId===e))return t.filter(t=>t.keyId!==e);let n=r.find(t=>t.id===e);return[...t,{keyId:e,model:n?L.SV[n.provider]?.[0]?.modelId??"":""}]})},onChangeFallbackModel:function(e,t){z(n=>n.map(n=>n.keyId===e?{...n,model:t}:n))},onChangeLlmKey:function(e){let t=r.find(t=>t.id===e);W(e),K(t?L.SV[t.provider]?.[0]?.modelId??"":""),e&&void 0===G[e]&&(X(!0),(0,v.W)(e).then(t=>{H(n=>({...n,[e]:t.ok?t.data:[]})),X(!1)}))},onChangeModel:function(e){K(e)},onSave:function(){if(es||j||!ej)return;let t={id:e.id,name:R,personality:I,model:E,llmKeyId:F||null,fallbackChain:D.filter(e=>e.keyId!==F),role:O,subAgentIds:"worker"===O?[]:U,avatarUrl:q};w(async()=>{let e=await (0,k.f)(t);e.ok?(c.oR.success("Agent updated"),b.refresh()):c.oR.error(e.message)})},onReset:function(){M(e.name),$(e.personality??""),T(S),P(e.subAgentIds),W(A),z(e.fallbackChain??[]),K(e.model??""),Y(e.avatarUrl??null)},liveModelsCache:G,liveModelsLoading:J})]})})}function er(){return(0,s.jsxs)(a(),{href:"/agents",className:"inline-flex items-center gap-1.5 text-[13px] text-ink-3 transition-colors hover:text-ink-2",children:[(0,s.jsx)("span",{className:"text-[15px] leading-none",children:"‹"}),"Back to agents"]})}function ea({agents:e,activeId:t}){return e.length<=1?null:(0,s.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map(e=>{let n=e.id===t;return(0,s.jsxs)(a(),{href:`/agents/${e.id}/edit`,className:["inline-flex h-[34px] items-center gap-2 rounded-full border px-3.5 text-[14px] font-medium transition-colors",n?"border-rule-2 bg-paper text-ink":"border-rule bg-canvas text-ink-3 hover:border-rule-2 hover:text-ink-2"].join(" "),children:[(0,s.jsx)("span",{className:"inline-block h-[7px] w-[7px] rounded-full bg-agent-vivid"}),e.name]},e.id)})})}function ei({initial:e,avatarUrl:t,name:n,personaPreview:l,role:r,slug:a,model:i,llmKeyLabel:o,stats:c,onConfigure:d}){let x=c.totalRuns>0?`${Math.round(c.successfulRuns/c.totalRuns*100)}%`:"—";return(0,s.jsxs)("div",{className:"overflow-hidden rounded-2xl border border-rule-2 bg-paper",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-5 p-6 lg:flex-row lg:items-start",children:[t?(0,s.jsx)("img",{src:t,alt:"",className:"h-[80px] w-[80px] flex-shrink-0 rounded-2xl object-cover"}):(0,s.jsx)("div",{className:"flex h-[80px] w-[80px] flex-shrink-0 items-center justify-center rounded-2xl bg-agent-vivid text-[28px] font-semibold text-canvas",children:e}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,s.jsx)("h1",{className:"m-0 text-[22px] font-semibold leading-none tracking-[-0.01em] text-ink",children:n}),(0,s.jsxs)("span",{className:"inline-flex h-[24px] items-center gap-1.5 rounded-full border border-rule-2 bg-canvas px-2.5 text-[12px] font-medium text-ink-3",children:[(0,s.jsx)("span",{className:"h-[6px] w-[6px] rounded-full bg-ink-3"}),"Idle"]})]}),(0,s.jsx)("p",{className:"mt-2 text-[14px] leading-[1.55] text-ink-3",children:l}),(0,s.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-x-4 gap-y-1.5 text-[12px] text-ink-3",children:[i&&(0,s.jsxs)("span",{children:[(0,s.jsx)("span",{className:"text-ink-4",children:"Model:"})," ",(0,s.jsx)("code",{className:"rounded border border-rule-2 bg-canvas px-1.5 py-0.5 font-mono text-[12px] text-ink-2",children:i})]}),o&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(eo,{}),(0,s.jsxs)("span",{children:[(0,s.jsx)("span",{className:"text-ink-4",children:"LLM:"})," ",(0,s.jsx)("span",{className:"text-ink-2",children:o})]})]}),(0,s.jsx)(eo,{}),(0,s.jsxs)("span",{children:[(0,s.jsx)("span",{className:"text-ink-4",children:"Role:"})," ",(0,s.jsx)("span",{className:"capitalize text-ink-2",children:r})]}),(0,s.jsx)(eo,{}),(0,s.jsxs)("span",{className:"font-mono text-ink-4",children:["@",a]})]})]}),(0,s.jsx)("div",{className:"flex flex-shrink-0 flex-wrap gap-2",children:(0,s.jsxs)("button",{type:"button",onClick:d,className:"inline-flex h-[34px] items-center gap-1.5 rounded-lg border border-rule bg-paper px-3.5 text-[13px] font-medium text-ink-2 transition-colors hover:border-rule-2 hover:text-ink",children:[(0,s.jsx)(ed,{}),"Configure"]})})]}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-2 px-6 pb-6 sm:grid-cols-3 lg:grid-cols-6",children:[(0,s.jsx)(ec,{label:"Skills",value:String(c.skills)}),(0,s.jsx)(ec,{label:"Connectors",value:String(c.connectors)}),(0,s.jsx)(ec,{label:"MCPs",value:String(c.mcps)}),(0,s.jsx)(ec,{label:"Sub-agents",value:"worker"===r?"—":String(c.subAgents),dim:"worker"===r}),(0,s.jsx)(ec,{label:"Runs",value:String(c.totalRuns),dim:0===c.totalRuns}),(0,s.jsx)(ec,{label:"Success rate",value:x,dim:0===c.totalRuns})]})]})}function eo(){return(0,s.jsx)("span",{className:"text-ink-4",children:"\xb7"})}function ec({label:e,value:t,dim:n}){return(0,s.jsxs)("div",{className:"rounded-lg border border-rule-2 bg-canvas/40 px-4 py-3",children:[(0,s.jsx)("div",{className:"font-mono text-[11px] uppercase tracking-[0.14em] text-ink-4",children:e}),(0,s.jsx)("div",{className:`mt-1.5 text-[20px] font-semibold leading-none tracking-[-0.01em] ${n?"text-ink-4":"text-ink"}`,children:t})]})}function ed(){return(0,s.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.4",children:[(0,s.jsx)("circle",{cx:"8",cy:"8",r:"2"}),(0,s.jsx)("path",{d:"M8 1v2M8 13v2M1 8h2M13 8h2M3.5 3.5l1.5 1.5M11 11l1.5 1.5M3.5 12.5L5 11M11 5l1.5-1.5"})]})}function ex({tab:e,onChange:t,counts:n}){let l=[{id:"overview",label:"Overview"},{id:"skills",label:"Skills",count:n.skills},{id:"connectors",label:"Connectors",count:n.connectors},{id:"runs",label:"Runs",count:n.runs},{id:"autonomy",label:"Autonomy"},{id:"settings",label:"Settings"}];return(0,s.jsx)("div",{className:"flex gap-1 border-b border-rule-2",children:l.map(n=>{let l=e===n.id;return(0,s.jsxs)("button",{type:"button",onClick:()=>t(n.id),className:["relative -mb-px border-b-2 px-4 pt-2.5 pb-3 text-[14px] font-medium transition-colors",l?"border-ink text-ink":"border-transparent text-ink-3 hover:text-ink-2"].join(" "),children:[n.label,void 0!==n.count&&n.count>0&&(0,s.jsx)("span",{className:`ml-1.5 font-mono text-[11px] ${l?"text-ink-2":"text-ink-4"}`,children:n.count})]},n.id)})})}function ep({children:e}){return(0,s.jsx)("div",{className:"rounded-2xl border border-rule-2 bg-paper p-6",children:e})}function eu({label:e,hint:t,right:n}){return(0,s.jsxs)("div",{className:"mb-4 flex items-start justify-between gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"font-mono text-[11px] uppercase tracking-[0.12em] text-ink-4",children:e}),t&&(0,s.jsx)("p",{className:"mt-1 text-[13px] leading-[1.5] text-ink-3",children:t})]}),n]})}function em({jobs:e,attachedSkills:t,connectorsAssigned:n,mcpsAssignedCount:l,onOpenSkills:r,onOpenConnectors:i}){let o=t.length>0,c=n.length>0;return(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)("div",{className:"grid grid-cols-1 gap-6 lg:grid-cols-3",children:[(0,s.jsx)("div",{className:"lg:col-span-2",children:(0,s.jsx)(ep,{children:(0,s.jsx)(eh,{jobs:e})})}),(0,s.jsxs)(ep,{children:[(0,s.jsx)(eu,{label:`Connectors used \xb7 ${n.length}`,right:c?(0,s.jsx)("button",{type:"button",onClick:i,className:"text-[12px] text-ink-3 underline hover:text-ink-2",children:"Manage"}):void 0}),c?(0,s.jsx)("div",{className:"space-y-2",children:n.map(e=>(0,s.jsx)(eb,{row:e},e.connectorId))}):(0,s.jsxs)("p",{className:"text-[13px] text-ink-3",children:["No connectors assigned yet."," ",(0,s.jsx)("button",{type:"button",onClick:i,className:"underline hover:text-ink-2",children:"Wire one →"})]}),l>0&&(0,s.jsxs)("p",{className:"mt-3 border-t border-rule-2 pt-3 text-[12px] text-ink-4",children:["+ ",l," MCP server",l>1?"s":""," attached (Settings → Knowledge)."]})]})]}),(0,s.jsxs)(ep,{children:[(0,s.jsx)(eu,{label:`Skills attached \xb7 ${t.length}`,right:o?(0,s.jsx)("button",{type:"button",onClick:r,className:"text-[12px] text-ink-3 underline hover:text-ink-2",children:"Manage"}):void 0}),o?(0,s.jsx)("div",{className:"grid grid-cols-1 gap-2 lg:grid-cols-2 xl:grid-cols-3",children:t.map(e=>(0,s.jsx)(eg,{skill:e},e.id))}):(0,s.jsxs)("p",{className:"text-[13px] text-ink-3",children:["No skills attached yet. Read-only view — manage on the"," ",(0,s.jsx)(a(),{href:"/skills",className:"underline hover:text-ink-2",children:"Skills page"}),"."]})]})]})}function eh({jobs:e}){let{data:t,total:n}=(0,l.useMemo)(()=>{let t=new Date;t.setHours(0,0,0,0);let n=[];for(let e=6;e>=0;e-=1){let s=new Date(t.getTime()-864e5*e);n.push({day:s.toLocaleDateString("en-US",{weekday:"short"}),iso:s.toISOString().slice(0,10),runs:0})}let s=new Map(n.map(e=>[e.iso,e])),l=0;for(let t of e){if("completed"!==t.status||!t.createdAt)continue;let e="string"==typeof t.createdAt?new Date(t.createdAt):t.createdAt,n=new Date(e.getFullYear(),e.getMonth(),e.getDate()).toISOString().slice(0,10),r=s.get(n);r&&(r.runs+=1,l+=1)}return{data:n,total:l}},[e]);return(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"mb-3 flex items-baseline gap-2",children:(0,s.jsx)("span",{className:"font-mono text-[11px] uppercase tracking-[0.12em] text-ink-4",children:"Runs \xb7 7 days"})}),(0,s.jsxs)("div",{className:"mb-4 flex items-baseline gap-3",children:[(0,s.jsx)("span",{className:"text-[34px] font-semibold leading-none tracking-[-0.015em] text-ink",children:n.toLocaleString()}),(0,s.jsxs)("span",{className:"text-[14px] text-ink-3",children:["successful run",1===n?"":"s"]})]}),(0,s.jsx)("div",{className:"h-[200px]",children:(0,s.jsx)(d.u,{width:"100%",height:"100%",children:(0,s.jsxs)(x.Q,{data:t,margin:{top:6,right:10,left:-20,bottom:0},children:[(0,s.jsx)("defs",{children:(0,s.jsxs)("linearGradient",{id:"agentWeeklyFill",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,s.jsx)("stop",{offset:"0%",stopColor:"var(--c-agent-vivid)",stopOpacity:.55}),(0,s.jsx)("stop",{offset:"100%",stopColor:"var(--c-agent-vivid)",stopOpacity:.05})]})}),(0,s.jsx)(p.d,{stroke:"var(--c-rule-2)",vertical:!1}),(0,s.jsx)(u.W,{dataKey:"day",stroke:"var(--c-ink-4)",tick:{fill:"var(--c-ink-4)",fontSize:12},axisLine:!1,tickLine:!1}),(0,s.jsx)(m.h,{stroke:"var(--c-ink-4)",tick:{fill:"var(--c-ink-4)",fontSize:12},axisLine:!1,tickLine:!1,allowDecimals:!1}),(0,s.jsx)(h.m,{cursor:{stroke:"var(--c-ink-4)",strokeDasharray:"3 3"},contentStyle:{background:"var(--c-paper)",border:"1px solid var(--c-rule)",borderRadius:10,fontSize:13,color:"var(--c-ink)",boxShadow:"0 6px 20px rgba(0,0,0,0.08)"},labelStyle:{color:"var(--c-ink-3)"}}),(0,s.jsx)(g.Gk,{type:"monotone",dataKey:"runs",stroke:"var(--c-agent-vivid)",strokeWidth:2,fill:"url(#agentWeeklyFill)"})]})})})]})}function eg({skill:e}){return(0,s.jsx)(U,{glyph:(0,s.jsx)(T.A,{variant:"skill",size:"lg",shape:"square",children:(0,s.jsx)("span",{className:"font-mono text-[11px] font-semibold uppercase",children:e.slug.slice(0,2)})}),name:e.name,description:e.description??void 0,meta:`@${e.slug}`,actions:(0,s.jsx)(a(),{href:`/skills/${e.id}/edit`,className:"flex h-7 items-center gap-1 rounded-md border border-rule px-2 text-[12px] font-medium text-ink-3 transition-colors hover:border-rule-2 hover:text-ink",children:"Open ›"})})}function eb({row:e}){return(0,s.jsx)(U,{glyph:(0,s.jsx)(T.A,{variant:"conn",size:"lg",shape:"square",background:q.ah[e.slug],children:(0,s.jsx)("span",{className:"font-mono text-[11px] font-semibold",children:(0,q.d3)(e.slug,e.label)})}),name:(0,s.jsxs)(s.Fragment,{children:[e.label,(0,s.jsx)("span",{className:"ml-2 font-mono text-[11px] uppercase tracking-[0.04em] text-ink-4",children:e.slug.toUpperCase()})]}),description:e.credentialName??void 0,actions:(0,s.jsxs)("span",{className:"inline-flex items-center gap-1.5 font-mono text-[11px] uppercase tracking-[0.08em] text-ink-3",children:[(0,s.jsx)("span",{className:"h-[6px] w-[6px] rounded-full bg-agent-vivid"}),"on"]})})}function ef({skills:e}){return 0===e.length?(0,s.jsx)(ep,{children:(0,s.jsx)(eu,{label:"No skills attached",hint:"Read-only view. Manage attachments on the /skills page."})}):(0,s.jsxs)(ep,{children:[(0,s.jsx)(eu,{label:`Attached \xb7 ${e.length}`}),(0,s.jsx)("div",{className:"space-y-2",children:e.map(e=>(0,s.jsx)(eg,{skill:e},e.id))})]})}let ev={slug:"telegram_send_message",name:"Send Telegram message",risk:"destructive",requiresApproval:!0,description:"Deliver a message to the user via the configured Telegram bot (irreversible)."};function ek({agentId:e,connectors:t,hasTelegramBot:n,attachedSkills:r,lanCommandYolo:a,isOwner:i}){let[o,d]=(0,l.useState)([]),[x,p]=(0,l.useState)(!1),[u,m]=(0,l.useState)(new Set);(0,l.useEffect)(()=>{j(e).then(e=>{e.ok&&d(e.data),p(!0)})},[e]);let h=(0,l.useMemo)(()=>{let e=[];for(let n of t)if(n.assigned)for(let t of n.availableOperations)"read"!==t.risk&&(null===n.enabledOperations||n.enabledOperations.includes(t.slug))&&e.push(t);return n&&e.push(ev),e},[t,n]);return x?(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)(ep,{children:[(0,s.jsx)(eu,{label:"Autonomy / Approvals",hint:"Control whether this agent acts freely, must ask you first, or is blocked — per outward tool. Read-only tools are always autonomous and not shown."}),0===h.length?(0,s.jsx)("p",{className:"text-[13px] text-ink-3",children:"No write or destructive tools are currently assigned to this agent. Assign a connector (e.g. Gmail) or configure a Telegram bot to see its gateable tools here."}):(0,s.jsx)("div",{className:"divide-y divide-rule-2 overflow-hidden rounded-xl border border-rule-2","data-testid":"autonomy-tool-list",children:h.map(t=>{var n;return(0,s.jsx)(eA,{op:t,value:(n=t.slug,o.find(e=>e.toolName===n)?.action??"auto_approve"),saving:u.has(t.slug),onChange:n=>{var s;return s=t.slug,void(d(e=>{let t=e.filter(e=>e.toolName!==s);return"auto_approve"===n?t:[...t,{id:"",toolName:s,action:n}]}),m(e=>new Set([...e,s])),w({agentId:e,toolName:s,action:n}).then(t=>{m(e=>{let t=new Set(e);return t.delete(s),t}),t.ok||(c.oR.error(t.message),j(e).then(e=>{e.ok&&d(e.data)}))}))}},t.slug)})}),(0,s.jsxs)("p",{className:"mt-4 text-[12px] text-ink-4",children:["Default when no rule is set: ",(0,s.jsx)("span",{className:"font-medium text-ink-3",children:"Autonomous"}),". Rules take effect on the next job — already-running jobs are not affected."]})]}),(0,s.jsx)(ew,{agentId:e,attachedSkills:r,rules:o,onRulesChange:d,lanCommandYolo:a,isOwner:i}),(0,s.jsx)(eN,{agentId:e,attachedSkills:r,isOwner:i}),(0,s.jsx)(eS,{agentId:e,attachedSkills:r,isOwner:i})]}):(0,s.jsx)(ep,{children:(0,s.jsx)("p",{className:"text-[13px] text-ink-4",children:"Loading…"})})}let ej="run_command";function ew({agentId:e,attachedSkills:t,rules:n,onRulesChange:r,lanCommandYolo:a,isOwner:i}){let o=t.some(e=>"command-execution"===e.slug),d=(es.env.NEXT_PUBLIC_AUTH_MODE??"local-trust")==="local-trust",x=d||a&&i,[p,u]=(0,l.useState)(!1),[m,h]=(0,l.useState)(!1),g=n.some(e=>e.toolName===ej&&"auto_approve"===e.action),b=d||i,f=x||g&&b,v=g&&!x;function k(e){r(e?[...n.filter(e=>e.toolName!==ej),{id:"",toolName:ej,action:"auto_approve"}]:n.filter(e=>e.toolName!==ej))}async function j(t){u(!0),k(t);let n=await N({agentId:e,enabled:t});u(!1),n.ok?c.oR.success(t?"Yolo mode enabled — commands run without approval.":"Yolo mode disabled — commands require approval again."):(c.oR.error(n.message),k(!t))}return o?(0,s.jsxs)(ep,{children:[(0,s.jsx)(eu,{label:"Command execution",hint:"Controls whether shell commands (run_command) require human approval before running. By default, every command pauses for your approval."}),(0,s.jsxs)("div",{className:"flex items-start gap-4",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-[14px] font-medium text-ink",children:"Auto-run commands without approval (Yolo)"}),(0,s.jsx)("span",{className:"inline-flex h-[18px] items-center rounded-full bg-err/10 px-2 font-mono text-[11px] uppercase tracking-[0.1em] text-err",children:"irreversible"})]}),(0,s.jsx)("p",{className:"mt-1 text-[13px] leading-[1.4] text-ink-3",children:"When on, this agent runs any shell command immediately with no approval gate. Commands are still logged. Only enable for agents you fully trust."}),v&&b&&(0,s.jsxs)("p",{className:"mt-2 text-[12px] text-warn",children:["This agent's Yolo is ",(0,s.jsx)("b",{className:"font-semibold",children:"dormant"})," — workspace Yolo is off, so its commands still require approval. Turn it off here to clear it, or re-enable Yolo in"," ",(0,s.jsx)("a",{href:"/settings",className:"underline decoration-rule underline-offset-[3px] hover:decoration-ink-3",children:"Settings → Command execution"}),"."]}),!x&&!v&&!d&&!a&&(0,s.jsxs)("p",{className:"mt-2 text-[12px] text-ink-4",children:["Yolo is off for this workspace. The owner can enable it in"," ",(0,s.jsx)("a",{href:"/settings",className:"underline decoration-rule underline-offset-[3px] hover:decoration-ink-3",children:"Settings → Command execution"}),", or switch to loopback mode."]}),!x&&a&&!i&&(0,s.jsx)("p",{className:"mt-2 text-[12px] text-ink-4",children:"The workspace owner has enabled Yolo for this workspace, but only the owner can toggle it per agent."})]}),(0,s.jsx)("button",{type:"button",role:"switch","aria-checked":g,disabled:p||!f,onClick:()=>{g?j(!1):h(!0)},className:["relative mt-0.5 inline-flex h-[22px] w-[38px] shrink-0 cursor-pointer items-center rounded-full border transition-colors focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",v?"border-ink-4/40 bg-ink-4/20":g?"border-err/40 bg-err/20":"border-rule-2 bg-canvas"].join(" "),children:(0,s.jsx)("span",{className:["inline-block h-[16px] w-[16px] rounded-full shadow-sm transition-transform",g?"translate-x-[18px]":"translate-x-[2px]",v?"bg-ink-4":g?"bg-err":"bg-ink-3"].join(" ")})})]}),(0,s.jsx)($.A,{open:m,title:"Enable Yolo mode?",message:"Yolo mode lets this agent run ANY shell command on this machine with no approval. Only enable for an agent you fully trust. The command is still logged.",confirmLabel:"Enable Yolo",destructive:!0,onConfirm:()=>{h(!1),j(!0)},onCancel:()=>h(!1)})]}):null}function eN({agentId:e,attachedSkills:t,isOwner:n}){let l=t.filter(e=>e.isCommunity&&e.installedScripts&&e.installedScripts.length>0);return 0===l.length?null:(0,s.jsxs)(ep,{children:[(0,s.jsx)(eu,{label:"Community skill scripts",hint:"These community skills ship bundled scripts (Python / shell). By default scripts never run — enable only for skills you trust. The runner will only execute these exact files."}),(0,s.jsx)("div",{className:"divide-y divide-rule-2 overflow-hidden rounded-xl border border-rule-2","data-testid":"script-auth-list",children:l.map(t=>(0,s.jsx)(ey,{skill:t,agentId:e,isOwner:n},t.id))}),(0,s.jsx)("p",{className:"mt-4 text-[12px] text-ink-4",children:"Granting script access lets this agent run the skill's bundled scripts on your machine without per-command approval."})]})}function ey({skill:e,agentId:t,isOwner:n}){let[r,a]=(0,l.useState)(e.scriptsAuthorized??!1),[i,o]=(0,l.useState)(!1),[d,x]=(0,l.useState)(!1),p=e.installedScripts??[],u=(es.env.NEXT_PUBLIC_AUTH_MODE??"local-trust")==="local-trust"||n;async function m(n){o(!0),a(n);let s=await y({agentId:t,skillId:e.id,authorized:n});o(!1),s.ok?c.oR.success(n?`Scripts allowed for "${e.name}"`:`Script access revoked for "${e.name}"`):(c.oR.error(s.message),a(!n))}let h=`This lets ${e.name} run its bundled scripts on your machine without per-command approval:
2
+
3
+ `+p.map(e=>`• ${e.path} (${e.language})`).join("\n")+"\n\nOnly enable for skills you fully trust.";return(0,s.jsxs)("div",{className:"flex flex-col gap-3 px-4 py-3 sm:flex-row sm:items-start sm:gap-4",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{className:"text-[14px] font-medium text-ink",children:e.name}),(0,s.jsx)("span",{className:"inline-flex h-[18px] items-center rounded-full bg-skill-vivid/10 px-2 font-mono text-[11px] uppercase tracking-[0.1em] text-skill-vivid",children:"community"}),(0,s.jsxs)("span",{className:"inline-flex h-[18px] items-center rounded-full bg-warn/10 px-2 font-mono text-[11px] uppercase tracking-[0.1em] text-warn",children:[p.length," script",p.length>1?"s":""]})]}),(0,s.jsx)("div",{className:"mt-1 flex flex-wrap gap-x-3 gap-y-0.5",children:p.map(e=>(0,s.jsx)("code",{className:"font-mono text-[11px] text-ink-4",children:e.path},e.path))}),!u&&(0,s.jsx)("p",{className:"mt-1.5 text-[12px] text-ink-4",children:"Only the workspace owner can authorize scripts."})]}),(0,s.jsx)("button",{type:"button",role:"switch","aria-checked":r,"aria-label":`Allow scripts for ${e.name}`,disabled:i||!u,onClick:function(){r?m(!1):x(!0)},className:["relative mt-0.5 inline-flex h-[22px] w-[38px] shrink-0 cursor-pointer items-center rounded-full border transition-colors focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",r?"border-warn/40 bg-warn/20":"border-rule-2 bg-canvas"].join(" "),children:(0,s.jsx)("span",{className:["inline-block h-[16px] w-[16px] rounded-full shadow-sm transition-transform",r?"translate-x-[18px] bg-warn":"translate-x-[2px] bg-ink-3"].join(" ")})}),(0,s.jsx)($.A,{open:d,title:`Allow scripts for "${e.name}"?`,message:h,confirmLabel:"Allow scripts",destructive:!0,onConfirm:()=>{x(!1),m(!0)},onCancel:()=>x(!1)})]})}function eS({agentId:e,attachedSkills:t,isOwner:n}){let l=t.filter(e=>e.isCommunity);return 0===l.length?null:(0,s.jsxs)(ep,{children:[(0,s.jsx)(eu,{label:"Community skill file writes",hint:"Let this agent write files into a community skill's bundle (e.g. save a new ComfyUI workflow) without a shell. Reading is always allowed; writing is off until you enable it here."}),(0,s.jsx)("div",{className:"divide-y divide-rule-2 overflow-hidden rounded-xl border border-rule-2","data-testid":"file-write-auth-list",children:l.map(t=>(0,s.jsx)(eC,{skill:t,agentId:e,isOwner:n},t.id))}),(0,s.jsx)("p",{className:"mt-4 text-[12px] text-ink-4",children:"Writes are bounded to the skill's own folder (no path escape) and require approval by default — far narrower than granting shell access."})]})}function eC({skill:e,agentId:t,isOwner:n}){let[r,a]=(0,l.useState)(e.filesWritable??!1),[i,o]=(0,l.useState)(!1),[d,x]=(0,l.useState)(!1),p=(es.env.NEXT_PUBLIC_AUTH_MODE??"local-trust")==="local-trust"||n;async function u(n){o(!0),a(n);let s=await S({agentId:t,skillId:e.id,writable:n});o(!1),s.ok?c.oR.success(n?`File writes allowed for "${e.name}"`:`File writes revoked for "${e.name}"`):(c.oR.error(s.message),a(!n))}let m=`This lets ${e.name} create and overwrite files inside its own skill folder (e.g. workflows, references) without per-write approval defaults applying to the toggle itself. Writes can never escape the skill folder.
4
+
5
+ Only enable for skills you trust to manage their own bundle.`;return(0,s.jsxs)("div",{className:"flex flex-col gap-3 px-4 py-3 sm:flex-row sm:items-start sm:gap-4",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{className:"text-[14px] font-medium text-ink",children:e.name}),(0,s.jsx)("span",{className:"inline-flex h-[18px] items-center rounded-full bg-skill-vivid/10 px-2 font-mono text-[11px] uppercase tracking-[0.1em] text-skill-vivid",children:"community"})]}),!p&&(0,s.jsx)("p",{className:"mt-1.5 text-[12px] text-ink-4",children:"Only the workspace owner can authorize file writes."})]}),(0,s.jsx)("button",{type:"button",role:"switch","aria-checked":r,"aria-label":`Allow file writes for ${e.name}`,disabled:i||!p,onClick:function(){r?u(!1):x(!0)},className:["relative mt-0.5 inline-flex h-[22px] w-[38px] shrink-0 cursor-pointer items-center rounded-full border transition-colors focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",r?"border-warn/40 bg-warn/20":"border-rule-2 bg-canvas"].join(" "),children:(0,s.jsx)("span",{className:["inline-block h-[16px] w-[16px] rounded-full shadow-sm transition-transform",r?"translate-x-[18px] bg-warn":"translate-x-[2px] bg-ink-3"].join(" ")})}),(0,s.jsx)($.A,{open:d,title:`Allow file writes for "${e.name}"?`,message:m,confirmLabel:"Allow file writes",destructive:!0,onConfirm:()=>{x(!1),u(!0)},onCancel:()=>x(!1)})]})}function eA({op:e,value:t,saving:n,onChange:l}){return(0,s.jsxs)("div",{className:"flex flex-col gap-3 px-4 py-3 sm:flex-row sm:items-center sm:gap-4",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{className:"text-[14px] font-medium text-ink",children:e.name}),(0,s.jsx)("span",{className:["inline-flex h-[18px] items-center rounded-full px-2 font-mono text-[11px] uppercase tracking-[0.1em]","destructive"===e.risk?"bg-err/10 text-err":"bg-warn/10 text-warn"].join(" "),children:{write:"write",destructive:"irreversible"}[e.risk]??e.risk})]}),e.description&&(0,s.jsx)("p",{className:"mt-0.5 text-[13px] leading-[1.4] text-ink-3",children:e.description}),(0,s.jsx)("code",{className:"mt-1 block font-mono text-[11px] text-ink-4",children:e.slug})]}),(0,s.jsx)("div",{className:"flex shrink-0 overflow-hidden rounded-lg border border-rule-2",role:"group","aria-label":`Approval policy for ${e.name}`,children:[{action:"auto_approve",label:"Autonomous"},{action:"require_approval",label:"Ask first"},{action:"block",label:"Block"}].map(({action:r,label:a},i)=>{let o=t===r,c="block"===r?"bg-err/15 text-err border-err/30":"require_approval"===r?"bg-warn/15 text-warn border-warn/30":"bg-agent-vivid/15 text-agent-vivid border-agent-vivid/30";return(0,s.jsx)("button",{type:"button",disabled:n,onClick:()=>l(r),"data-testid":`autonomy-btn-${e.slug}-${r}`,className:["relative h-[32px] px-3 text-[13px] font-medium transition-colors",i>0?"border-l border-rule-2":"",o?c:"bg-canvas text-ink-3 hover:bg-hover hover:text-ink-2",n?"cursor-wait opacity-60":""].join(" "),children:a},r)})})]})}function eR(e){let{name:t,slug:n,avatarUrl:r,personality:i,role:o,showSubAgents:d,subAgentIds:x,peers:p,llmKeyId:u,fallbackChain:m,activeKeys:h,selectedKey:g,model:b,noLlmKeys:v,workspaces:k,workspacesLoaded:j,onWorkspacesChange:w,agentId:N,dirty:y,isPending:S,onChangeName:T,onChangeAvatar:U,onChangePersonality:P,onChangeRole:F,onToggleSubAgent:W,onToggleFallback:D,onChangeFallbackModel:z,onChangeLlmKey:E,onChangeModel:B,onSave:K,onReset:q,liveModelsCache:Y,liveModelsLoading:G}=e,H=h.filter(e=>e.id!==u),V=g?L.SV[g.provider]??[]:[],J=!!(0,L.mV)(g?.provider??"",b),X=g?Y[g.id]??[]:[],Q=new Set(V.map(e=>e.modelId)),Z=X.filter(e=>!Q.has(e)),ee=J||X.includes(b),[et,en]=(0,l.useState)(""),[es,el]=(0,l.useState)(""),[er,ea]=(0,l.useState)(!1),[ei,eo]=(0,l.useState)(null),[ec,ed]=(0,l.useTransition)(),[ex,em]=(0,l.useState)({}),[eh,eg]=(0,l.useState)({}),[eb,ef]=(0,l.useState)(""),[ev,ek]=(0,l.useState)(!1),[ej,ew]=(0,l.useState)(null),[eN,ey]=(0,l.useTransition)();async function eS(e,t){ek(!0);let n=new FormData;n.append("file",t);let s=await A(N,e,n);if(ek(!1),!s.ok)return void c.oR.error(s.message);c.oR.success(`Uploaded ${s.data.filename}`);let l=await C(N,e);l.ok&&em(t=>({...t,[e]:l.data}))}return(0,l.useEffect)(()=>{for(let e of k)eh[e.label]||C(N,e.label).then(t=>{t.ok&&em(n=>({...n,[e.label]:t.data})),eg(t=>({...t,[e.label]:!0}))})},[k,N]),(0,s.jsxs)("div",{className:"space-y-6 pb-24",children:[(0,s.jsxs)(ep,{children:[(0,s.jsx)(eu,{label:"Identity",hint:"Slug is immutable. Avatar is used across the app."}),(0,s.jsxs)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[(0,s.jsx)(eM,{label:"Name",children:(0,s.jsx)("input",{type:"text",value:t,onChange:e=>T(e.target.value),placeholder:"Agent name",className:"w-full rounded-lg border border-rule bg-canvas px-3 py-2 text-[14px] text-ink placeholder:text-ink-4 focus:border-ink-3 focus:outline-none"})}),(0,s.jsx)(eM,{label:"Slug (read-only)",children:(0,s.jsx)("code",{className:"block w-full rounded-lg border border-rule-2 bg-hover px-3 py-2 font-mono text-[12px] tracking-[0.02em] text-ink-3",children:n})}),(0,s.jsx)("div",{className:"sm:col-span-2",children:(0,s.jsx)(eM,{label:"Avatar",children:(0,s.jsx)(O.A,{value:r,onChange:U})})})]})]}),(0,s.jsxs)(ep,{children:[(0,s.jsx)(eu,{label:"Behavior",hint:"Persona is the system prompt. Updating it invalidates the prompt cache for new jobs."}),(0,s.jsx)(eM,{label:"Persona / system prompt",children:(0,s.jsx)("textarea",{value:i,onChange:e=>P(e.target.value),rows:24,placeholder:"You are a helpful assistant…",className:"min-h-[560px] w-full resize-y rounded-lg border border-rule bg-canvas px-3 py-2 font-mono text-[13px] leading-[1.55] text-ink placeholder:text-ink-4 focus:border-ink-3 focus:outline-none"})}),(0,s.jsx)("div",{className:"mt-4",children:(0,s.jsx)(eM,{label:"Role",children:(0,s.jsxs)("select",{value:o,onChange:e=>F(e.target.value),className:"w-full rounded-lg border border-rule bg-canvas px-3 py-2 text-[14px] text-ink focus:border-ink-3 focus:outline-none",children:[(0,s.jsx)("option",{value:"worker",children:"Worker — runs its own tools"}),(0,s.jsx)("option",{value:"router",children:"Router — delegates one at a time"}),(0,s.jsx)("option",{value:"planner",children:"Planner — parallel sub-agents"})]})})}),d&&(0,s.jsx)("div",{className:"mt-4",children:(0,s.jsx)(eM,{label:`Sub-agents \xb7 ${x.length} selected`,children:0===p.length?(0,s.jsx)("p",{className:"text-[13px] text-warn",children:"Create at least one worker agent first — orchestrators need someone to delegate to."}):(0,s.jsx)("div",{className:"divide-y divide-rule-2 overflow-hidden rounded-lg border border-rule-2 bg-canvas/30",children:p.map(e=>{let t=x.includes(e.id);return(0,s.jsxs)("label",{className:"flex cursor-pointer items-center gap-3 px-3 py-2 text-[14px] transition-colors hover:bg-hover",children:[(0,s.jsx)("input",{type:"checkbox",checked:t,onChange:()=>W(e.id),className:"accent-agent-vivid"}),(0,s.jsx)("span",{className:"text-ink",children:e.name}),(0,s.jsx)("span",{className:"ml-auto font-mono text-[12px] text-ink-3",children:e.slug})]},e.id)})})})})]}),(0,s.jsxs)(ep,{children:[(0,s.jsx)(eu,{label:"Model",hint:"LLM key + model identifier passed to the runner."}),(0,s.jsxs)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[(0,s.jsx)(eM,{label:"LLM provider",children:v?(0,s.jsxs)("p",{className:"text-[13px] text-warn",children:["No active LLM keys."," ",(0,s.jsx)(a(),{href:"/llm-providers",className:"underline",children:"Add one"}),"."]}):(0,s.jsx)("select",{value:u,onChange:e=>E(e.target.value),className:"w-full rounded-lg border border-rule bg-canvas px-3 py-2 text-[14px] text-ink focus:border-ink-3 focus:outline-none",children:h.map(e=>(0,s.jsx)("option",{value:e.id,children:(e.nickname??(0,_.R)(e.provider))+" ("+(0,_.R)(e.provider)+")"},e.id))})}),(0,s.jsxs)(eM,{label:G&&g?.id!==void 0&&void 0===Y[g.id]?"Model (loading…)":"Model",children:[(V.length>0||Z.length>0)&&(0,s.jsxs)("select",{value:ee?b:"__custom__",onChange:e=>B("__custom__"===e.target.value?"":e.target.value),className:"mb-2 w-full rounded-lg border border-rule bg-canvas px-3 py-2 text-[14px] text-ink focus:border-ink-3 focus:outline-none",children:[(0,L.eS)(V).map(({group:e,models:t})=>e?(0,s.jsx)("optgroup",{label:e,children:t.map(e=>(0,s.jsx)("option",{value:e.modelId,children:e.label},e.modelId))},e):t.map(e=>(0,s.jsx)("option",{value:e.modelId,children:e.label},e.modelId))),Z.length>0&&(0,s.jsx)("optgroup",{label:"Live from provider",children:Z.map(e=>(0,s.jsx)("option",{value:e,children:e},e))}),(0,s.jsx)("option",{value:"__custom__",children:"Custom…"})]}),!ee&&(0,s.jsx)("input",{type:"text",value:b,onChange:e=>B(e.target.value),placeholder:L.SV[g?.provider??""]?.[0]?.modelId??"e.g. claude-haiku-4-5-20251001",className:"w-full rounded-lg border border-rule bg-canvas px-3 py-2 font-mono text-[13px] text-ink placeholder:text-ink-4 focus:border-ink-3 focus:outline-none"})]})]}),!v&&(0,s.jsx)("div",{className:"mt-3",children:(0,s.jsx)(eM,{label:"Fallback providers (failover order)",children:0===H.length?(0,s.jsxs)("p",{className:"text-[13px] text-ink-4",children:["Add another LLM key in"," ",(0,s.jsx)(a(),{href:"/llm-providers",className:"underline",children:"LLM providers"})," ","to enable failover."]}):(0,s.jsxs)("div",{className:"space-y-2.5",children:[(0,s.jsx)("p",{className:"text-[13px] text-ink-4",children:"If the primary is down (5xx / timeout / quota) mid-job, the runner fails over to these in order. Pick the model each fallback should run on."}),H.map(e=>{let t=m.findIndex(t=>t.keyId===e.id),n=-1!==t,l=L.SV[e.provider]??[],r=n?m[t]?.model??"":"";return(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsxs)("label",{className:"flex cursor-pointer items-center gap-2.5 select-none",children:[(0,s.jsx)("input",{type:"checkbox",checked:n,onChange:()=>D(e.id),className:"accent-ink"}),(0,s.jsx)("span",{className:"text-[14px] text-ink-2",children:(e.nickname??(0,_.R)(e.provider))+" ("+(0,_.R)(e.provider)+")"}),n&&(0,s.jsxs)("span",{className:"ml-auto rounded-full border border-rule-2 px-2 py-0.5 text-[11px] font-medium text-ink-4",children:["#",t+1]})]}),n&&(l.length>0?(0,s.jsx)("select",{value:r,onChange:t=>z(e.id,t.target.value),className:"ml-[1.6rem] w-[calc(100%-1.6rem)] rounded-lg border border-rule bg-canvas px-3 py-1.5 text-[13px] text-ink focus:border-ink-3 focus:outline-none",children:(0,L.eS)(l).map(({group:e,models:t})=>e?(0,s.jsx)("optgroup",{label:e,children:t.map(e=>(0,s.jsx)("option",{value:e.modelId,children:e.label},e.modelId))},e):t.map(e=>(0,s.jsx)("option",{value:e.modelId,children:e.label},e.modelId)))}):(0,s.jsx)("input",{type:"text",value:r,onChange:t=>z(e.id,t.target.value),placeholder:"model id (e.g. llama-3.3-70b)",className:"ml-[1.6rem] w-[calc(100%-1.6rem)] rounded-lg border border-rule bg-canvas px-3 py-1.5 font-mono text-[13px] text-ink placeholder:text-ink-4 focus:border-ink-3 focus:outline-none"}))]},e.id)})]})})})]}),(0,s.jsxs)(ep,{children:[(0,s.jsx)(eu,{label:"Knowledge",hint:"Folders scope file_* tools. Add multiple paths with distinct labels."}),j?0===k.length?(0,s.jsx)("p",{className:"text-[13px] text-ink-4",children:"No folders configured."}):(0,s.jsx)("div",{className:"space-y-4 mb-4",children:k.map(e=>(0,s.jsxs)("div",{className:"rounded-lg border border-rule bg-hover/50 overflow-hidden",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-3 px-3 py-2 border-b border-rule",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsx)("span",{className:"font-mono text-[12px] font-semibold text-ink-2 mr-2",children:e.label}),(0,s.jsx)("span",{className:"font-mono text-[12px] text-ink-3 break-all",children:e.path})]}),(0,s.jsx)("button",{type:"button",onClick:()=>eo(e.id),disabled:ec,className:"shrink-0 rounded border border-rule px-2 py-0.5 text-[12px] text-err hover:border-err/40 hover:bg-err/5 disabled:opacity-50",children:"Remove"})]}),(0,s.jsxs)("div",{className:"px-3 pt-2 pb-1",children:[eh[e.label]?0===(ex[e.label]??[]).length?(0,s.jsx)("p",{className:"text-[12px] text-ink-4 py-1",children:"No files uploaded yet."}):(0,s.jsx)("div",{className:"space-y-1 mb-2",children:(ex[e.label]??[]).map(t=>(0,s.jsxs)("div",{className:"flex items-center justify-between gap-2 rounded px-2 py-1 bg-canvas border border-rule-2 text-[12px]",children:[(0,s.jsx)("span",{className:"font-mono text-ink-2 truncate min-w-0",children:t.name}),(0,s.jsx)("span",{className:"shrink-0 text-ink-4",children:t.size>=1048576?`${(t.size/1024/1024).toFixed(1)} MB`:t.size>=1024?`${(t.size/1024).toFixed(0)} KB`:`${t.size} B`}),(0,s.jsx)("button",{type:"button",onClick:()=>{ew({label:e.label,name:t.name})},disabled:eN,className:"shrink-0 rounded border border-rule px-1.5 py-0.5 text-[11px] text-err hover:border-err/40 hover:bg-err/5 disabled:opacity-50",children:"Delete"})]},t.name))}):(0,s.jsx)("p",{className:"text-[12px] text-ink-4 py-1",children:"Loading files…"}),(0,s.jsxs)("label",{className:`flex items-center gap-2 cursor-pointer rounded-lg border border-dashed px-3 py-2 text-[13px] transition-colors mb-2
6
+ ${ev&&eb===e.label?"border-ink-3 text-ink-3 bg-hover":"border-rule text-ink-4 hover:border-ink-3 hover:text-ink-3"}`,children:[(0,s.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"shrink-0",children:[(0,s.jsx)("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,s.jsx)("polyline",{points:"17 8 12 3 7 8"}),(0,s.jsx)("line",{x1:"12",y1:"3",x2:"12",y2:"15"})]}),ev&&eb===e.label?"Uploading…":"Upload file (.docx .xlsx .pptx .pdf .txt .md .csv — max 25 MB)",(0,s.jsx)("input",{type:"file",className:"sr-only",accept:".docx,.xlsx,.pptx,.pdf,.txt,.md,.csv",disabled:ev,onChange:t=>{let n=t.target.files?.[0];n&&(t.target.value="",ef(e.label),eS(e.label,n))}})]})]})]},e.id))}):(0,s.jsx)("p",{className:"text-[13px] text-ink-4",children:"Loading…"}),(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsx)(eM,{label:"Add folder",children:(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("input",{type:"text",value:et,onChange:e=>en(e.target.value),placeholder:"Label (e.g. notes)",maxLength:80,className:"w-28 shrink-0 rounded-lg border border-rule bg-canvas px-3 py-2 font-mono text-[13px] text-ink placeholder:text-ink-4 focus:border-ink-3 focus:outline-none"}),(0,s.jsx)("input",{type:"text",value:es,onChange:e=>el(e.target.value),placeholder:"/home/you/notes or C:\\Users\\you\\docs",className:"min-w-0 flex-1 rounded-lg border border-rule bg-canvas px-3 py-2 font-mono text-[13px] text-ink placeholder:text-ink-4 focus:border-ink-3 focus:outline-none"}),(0,s.jsx)("button",{type:"button",onClick:function(){et.trim()&&es.trim()&&ed(async()=>{ea(!0);let e=await M(N,et.trim(),es.trim());if(ea(!1),!e.ok)return void c.oR.error(e.message);let t=await f(N);t.ok&&w(t.data),en(""),el(""),c.oR.success("Folder added")})},disabled:ec||er||!et.trim()||!es.trim(),className:"shrink-0 rounded-lg border border-rule px-4 py-2 text-[14px] font-medium text-ink-2 hover:border-rule-2 hover:text-ink disabled:cursor-not-allowed disabled:opacity-50",children:er?"Adding…":"Add"})]})}),(0,s.jsxs)("p",{className:"text-[12px] text-ink-4",children:["Absolute path. Label is the prefix the agent uses (e.g."," ",(0,s.jsx)("code",{className:"font-mono",children:"notes/file.md"}),"). Leave label blank if a single folder — label is then optional."]})]}),(0,s.jsx)($.A,{open:null!==ei,title:"Remove folder",message:"The agent will lose file access to this path. Existing files are NOT deleted.",confirmLabel:"Remove",destructive:!0,onConfirm:()=>ei&&void ed(async()=>{let e=await I(ei);if(eo(null),!e.ok)return void c.oR.error(e.message);let t=await f(N);t.ok&&w(t.data),c.oR.success("Folder removed")}),onCancel:()=>eo(null)}),(0,s.jsx)($.A,{open:null!==ej,title:"Delete file",message:ej?`Delete "${ej.name}" from folder "${ej.label}"? This cannot be undone.`:"",confirmLabel:"Delete",destructive:!0,onConfirm:function(){if(!ej)return;let{label:e,name:t}=ej;ey(async()=>{ew(null);let n=await R(N,e,t);if(!n.ok)return void c.oR.error(n.message);c.oR.success(`Deleted ${t}`);let s=await C(N,e);s.ok&&em(t=>({...t,[e]:s.data}))})},onCancel:()=>ew(null)})]}),(0,s.jsxs)("div",{className:"sticky bottom-4 z-10 flex items-center justify-between gap-3 rounded-2xl border border-rule-2 bg-paper px-4 py-3 shadow-lg",children:[(0,s.jsx)("div",{className:"text-[13px] text-ink-3",children:y?(0,s.jsxs)("span",{children:[(0,s.jsx)("span",{className:"mr-1.5 inline-block h-[7px] w-[7px] rounded-full bg-skill-vivid"}),"Unsaved changes"]}):(0,s.jsx)("span",{className:"text-ink-4",children:"No changes"})}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("button",{type:"button",onClick:q,disabled:S||!y,className:"rounded-lg border border-rule px-4 py-2 text-[14px] font-medium text-ink-3 transition-colors hover:border-rule-2 hover:text-ink-2 disabled:cursor-not-allowed disabled:opacity-50",children:"Reset"}),(0,s.jsx)("button",{type:"button",onClick:K,disabled:S||v||!y,title:y?void 0:"No changes to save",className:"rounded-lg bg-ink px-5 py-2 text-[14px] font-semibold text-canvas transition-colors hover:brightness-[0.92] disabled:cursor-not-allowed disabled:opacity-50",children:S?"Saving…":"Save"})]})]})]})}function eM({label:e,children:t}){return(0,s.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,s.jsx)("label",{className:"font-mono text-[11px] uppercase tracking-[0.1em] text-ink-4",children:e}),(0,s.jsx)("div",{children:t})]})}},37955:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var s=n(3680),l=n(78604),r=n(51869);let a=Array.from({length:42},(e,t)=>{let n=String(t+1).padStart(2,"0");return{id:`avatar-${n}`,url:`/avatars/avatar-${n}.png`}});function i({value:e,onChange:t,label:n="Avatar"}){let[d,x]=(0,l.useState)(!1),[p,u]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{u(!0)},[]),(0,l.useEffect)(()=>{if(d)return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e);function e(e){"Escape"===e.key&&x(!1)}},[d]),(0,s.jsxs)("div",{children:[n&&(0,s.jsx)("label",{className:"block text-xs text-ink-3 mb-1",children:n}),(0,s.jsxs)("button",{type:"button",onClick:()=>x(!0),className:"group flex items-center gap-3 bg-hover border border-rule hover:border-rule rounded-md px-3 py-2 text-left transition-colors w-full max-w-xs",children:[(0,s.jsx)(o,{url:e,size:36}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("p",{className:"text-sm text-ink truncate",children:e?e.split("/").pop()?.replace(".png",""):"No avatar"}),(0,s.jsxs)("p",{className:"text-[12px] text-ink-3",children:["Click to ",e?"change":"pick"]})]})]}),p&&d&&(0,r.createPortal)((0,s.jsx)("div",{role:"dialog","aria-modal":"true","aria-label":"Pick an avatar",onClick:()=>x(!1),className:"fixed inset-0 z-50 bg-black/70 backdrop-blur-sm flex items-center justify-center p-4",children:(0,s.jsxs)("div",{onClick:e=>e.stopPropagation(),className:"bg-paper border border-rule-2 rounded-2xl p-5 max-w-2xl w-full max-h-[80vh] overflow-y-auto",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,s.jsx)("h3",{className:"text-sm font-semibold text-ink",children:"Pick an avatar"}),(0,s.jsx)("button",{type:"button",onClick:()=>x(!1),className:"text-ink-3 hover:text-ink text-xs",children:"Close (Esc)"})]}),(0,s.jsxs)("div",{className:"grid grid-cols-6 gap-3",children:[(0,s.jsx)(c,{selected:null===e,onClick:()=>void(t(null),x(!1)),label:"None",url:null}),a.map(n=>(0,s.jsx)(c,{selected:e===n.url,onClick:()=>{t(n.url),x(!1)},label:n.id,url:n.url},n.id))]})]})}),document.body)]})}function o({url:e,size:t=32}){return e?(0,s.jsx)("img",{src:e,alt:"",width:t,height:t,style:{width:t,height:t},className:"rounded-full object-cover border border-rule shrink-0"}):(0,s.jsx)("div",{style:{width:t,height:t},className:"rounded-full bg-hover border border-dashed border-rule text-ink-3 text-xs flex items-center justify-center shrink-0",children:"?"})}function c({selected:e,onClick:t,label:n,url:l}){return(0,s.jsx)("button",{type:"button",onClick:t,title:n,"aria-label":n,"aria-pressed":e,className:`aspect-square rounded-lg p-1 flex items-center justify-center transition-all ${e?"bg-ink/10 ring-2 ring-emerald-400":"bg-hover hover:bg-hover ring-1 ring-transparent hover:ring-neutral-700"}`,children:(0,s.jsx)(o,{url:l,size:56})})}},52637:(e,t,n)=>{"use strict";n.d(t,{W:()=>l});var s=n(64678);let l=(0,s.createServerReference)("40ae693984abe2a327713b38a1c552f6df8ea1678b",s.callServer,void 0,s.findSourceMapURL,"listKeyModelsAction")},63217:(e,t,n)=>{"use strict";function s(e){switch(e){case"openai-compatible":return"Local LLM";case"anthropic":return"Anthropic";case"openai":return"OpenAI";case"ollama":return"Ollama";case"openrouter":return"OpenRouter";case"google":return"Google";case"mistral":return"Mistral";case"groq":return"Groq";case"deepseek":return"DeepSeek";case"minimax":return"MiniMax";default:return e}}n.d(t,{R:()=>s})},67108:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});var s=n(3680),l=n(78604);function r({tabs:e,value:t,defaultValue:n,onChange:a,variant:i="inset"}){let[o,c]=(0,l.useState)(t??n??e[0].value),d=t??o,x="inset"===i?"bg-paper text-ink shadow-[0_1px_2px_rgba(0,0,0,0.06)]":"bg-ink text-canvas";return(0,s.jsx)("div",{className:`inline-flex gap-0.5 rounded-md p-[3px] ${"inset"===i?"bg-black/[0.05]":"bg-black/[0.04]"}`,role:"tablist",children:e.map(e=>{let n=e.value===d;return(0,s.jsxs)("button",{type:"button",role:"tab","aria-selected":n,onClick:()=>{void 0===t&&c(e.value),a?.(e.value)},className:`inline-flex h-[26px] items-center gap-1.5 rounded-[6px] border-0 px-3 text-[12px] font-medium leading-none transition-colors ${n?x:"bg-transparent text-ink-3 hover:text-ink-2"}`,children:[e.label,void 0!==e.count&&(0,s.jsx)("span",{className:`font-mono text-[11px] ${n?"opacity-85":"opacity-65"}`,children:e.count})]},e.value)})})}},73868:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(3680),l=n(64676),r=n(11248),a=n(88563);function i({title:e,subtitle:t}){return(0,s.jsxs)("header",{className:"flex items-center justify-between gap-4 border-b border-rule-2 px-5 pt-5 pb-4 sm:px-8 lg:px-9",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsx)("h1",{className:"text-[28px] leading-[1.15] font-semibold tracking-[-0.015em] text-ink",children:e}),t&&(0,s.jsx)("p",{className:"mt-1.5 text-[14px] leading-[1.5] text-ink-3",children:t})]}),(0,s.jsxs)("div",{className:"hidden shrink-0 items-center gap-2 lg:flex",children:[(0,s.jsx)(l.default,{className:"hidden md:flex"}),(0,s.jsx)(a.default,{}),(0,s.jsx)(r.default,{})]})]})}function o({title:e,subtitle:t,toolbar:n,children:l,fluid:r=!1,bodyClassName:a=""}){return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(i,{title:e,subtitle:t}),(0,s.jsxs)("div",{className:`px-5 pt-6 pb-10 sm:px-8 lg:px-9 ${r?"":"max-w-6xl"} ${a}`,children:[n&&(0,s.jsx)("div",{className:"mb-5",children:n}),l]})]})}},81630:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var s=n(3680);let l={agent:"bg-agent-vivid text-[#0a0a0a]",skill:"bg-skill-vivid text-white",conn:"bg-conn-vivid text-white",ink:"bg-ink text-canvas",neutral:"bg-hover text-ink-3"},r={sm:"h-[30px] w-[30px]",md:"h-[34px] w-[34px]",lg:"h-[38px] w-[38px]",xl:"h-[42px] w-[42px]"},a={sm:"[&_svg]:h-[13px] [&_svg]:w-[13px]",md:"[&_svg]:h-[14px] [&_svg]:w-[14px]",lg:"[&_svg]:h-[16px] [&_svg]:w-[16px]",xl:"[&_svg]:h-[18px] [&_svg]:w-[18px]"};function i({variant:e,size:t="md",shape:n="round",background:o,children:c,className:d=""}){let x=o?"":l[e];return(0,s.jsx)("span",{style:o?{background:o}:void 0,className:`inline-flex shrink-0 items-center justify-center ${r[t]} ${a[t]} ${"round"===n?"rounded-full":"rounded-[9px]"} ${x} ${o?"text-white":""} ${d}`,children:c})}},82592:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var s=n(3680);let l={ok:"bg-ok",lime:"bg-agent-vivid",coral:"bg-skill-vivid",blue:"bg-conn-vivid"},r={ok:"animate-[blip_1.4s_ease-out_infinite]",lime:"animate-[blip-lime_1.5s_ease-out_infinite]",coral:"animate-[blip-coral_1.4s_ease-out_infinite]",blue:"animate-[blip-blue_1.4s_ease-out_infinite]"};function a({variant:e="ok",size:t="sm",animate:n=!0,className:i=""}){return(0,s.jsx)("span",{className:`inline-block shrink-0 rounded-full ${"sm"===t?"h-[7px] w-[7px]":"h-2 w-2"} ${l[e]} ${n?r[e]:""} ${i}`})}},88812:(e,t,n)=>{Promise.resolve().then(n.bind(n,32767))},93606:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var s=n(3680),l=n(86127),r=n(50131),a=n(82592);let i={done:"Done",warn:"Attention",run:"Running",idle:"Idle","lvl-info":"INFO","lvl-ok":"OK","lvl-warn":"WARN","lvl-err":"ERR"},o={done:"bg-ok-bg text-ok",warn:"bg-warn-bg text-warn",run:"bg-run-bg text-run",idle:"bg-black/5 text-ink-3 dark:bg-white/5","lvl-info":"bg-black/5 text-ink-3 dark:bg-white/5","lvl-ok":"bg-ok-bg text-ok","lvl-warn":"bg-warn-bg text-warn","lvl-err":"bg-warn-bg text-err"};function c({variant:e,label:t,icon:n,className:d=""}){let x=t??i[e],p=null;return void 0!==n?p=n:"done"===e?p=(0,s.jsx)(l.r,{size:11,weight:"regular"}):"warn"===e?p=(0,s.jsx)(r.N,{size:11,weight:"regular"}):"run"===e&&(p=(0,s.jsx)(a.A,{variant:"blue",size:"sm"})),(0,s.jsxs)("span",{className:`inline-flex h-[22px] items-center gap-1.5 rounded-[5px] px-2.5 text-[12px] font-medium leading-none ${o[e]} ${d}`,children:[p,x]})}},99203:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var s=n(3680),l=n(22575);let r={sm:{box:"h-6 w-6",text:"text-[11px]",px:24},md:{box:"h-[30px] w-[30px]",text:"text-[11px]",px:30},lg:{box:"h-[42px] w-[42px]",text:"text-[15px]",px:42}};function a({name:e,imageUrl:t,size:n="md",shape:i="round",className:o=""}){let c=r[n],d=`inline-flex shrink-0 items-center justify-center overflow-hidden bg-hover font-mono font-semibold tracking-[0.04em] text-ink-2 ${c.box} ${c.text} ${"round"===i?"rounded-full":"rounded-[8px]"} ${o}`;return t?(0,s.jsx)("span",{className:d,children:(0,s.jsx)(l.default,{src:t,alt:e,width:c.px,height:c.px,className:"h-full w-full object-cover"})}):(0,s.jsx)("span",{className:d,children:function(e){let t=e.trim();if(!t)return"?";let n=t.split(/\s+/);return n.length>=2?((n[0][0]??"")+(n[1][0]??"")).toUpperCase():t.slice(0,2).toUpperCase()}(e)})}}},e=>{e.O(0,[3363,8161,7424,9782,8502,3763,9836,4964,1065,8724,7358],()=>e(e.s=88812)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2925],{27540:(e,t,r)=>{"use strict";var a=r(71268);r.o(a,"usePathname")&&r.d(t,{usePathname:function(){return a.usePathname}}),r.o(a,"useRouter")&&r.d(t,{useRouter:function(){return a.useRouter}}),r.o(a,"useSearchParams")&&r.d(t,{useSearchParams:function(){return a.useSearchParams}})},32928:(e,t,r)=>{"use strict";r.d(t,{e:()=>l});var a=r(78604),n=r(53087);let s=new Map([["bold",a.createElement(a.Fragment,null,a.createElement("path",{d:"M232.49,215.51,185,168a92.12,92.12,0,1,0-17,17l47.53,47.54a12,12,0,0,0,17-17ZM44,112a68,68,0,1,1,68,68A68.07,68.07,0,0,1,44,112Z"}))],["duotone",a.createElement(a.Fragment,null,a.createElement("path",{d:"M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z",opacity:"0.2"}),a.createElement("path",{d:"M229.66,218.34,179.6,168.28a88.21,88.21,0,1,0-11.32,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z"}))],["fill",a.createElement(a.Fragment,null,a.createElement("path",{d:"M168,112a56,56,0,1,1-56-56A56,56,0,0,1,168,112Zm61.66,117.66a8,8,0,0,1-11.32,0l-50.06-50.07a88,88,0,1,1,11.32-11.31l50.06,50.06A8,8,0,0,1,229.66,229.66ZM112,184a72,72,0,1,0-72-72A72.08,72.08,0,0,0,112,184Z"}))],["light",a.createElement(a.Fragment,null,a.createElement("path",{d:"M228.24,219.76l-51.38-51.38a86.15,86.15,0,1,0-8.48,8.48l51.38,51.38a6,6,0,0,0,8.48-8.48ZM38,112a74,74,0,1,1,74,74A74.09,74.09,0,0,1,38,112Z"}))],["regular",a.createElement(a.Fragment,null,a.createElement("path",{d:"M229.66,218.34l-50.07-50.06a88.11,88.11,0,1,0-11.31,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z"}))],["thin",a.createElement(a.Fragment,null,a.createElement("path",{d:"M226.83,221.17l-52.7-52.7a84.1,84.1,0,1,0-5.66,5.66l52.7,52.7a4,4,0,0,0,5.66-5.66ZM36,112a76,76,0,1,1,76,76A76.08,76.08,0,0,1,36,112Z"}))]]),o=a.forwardRef((e,t)=>a.createElement(n.A,{ref:t,...e,weights:s}));o.displayName="MagnifyingGlassIcon";let l=o},35843:(e,t,r)=>{"use strict";r.d(t,{default:()=>m});var a=r(3680),n=r(78604),s=r(27540),o=r(39504),l=r(64678);let c=(0,l.createServerReference)("404ac94514d8619417640c43b3416a82ac42f252e5",l.callServer,void 0,l.findSourceMapURL,"configureAgentTelegramAction"),i=(0,l.createServerReference)("40df123f9b04c75f024f545f011643493659139a2b",l.callServer,void 0,l.findSourceMapURL,"disconnectAgentTelegramAction");var d=r(14308);function m({agentId:e,initialConfig:t}){let r=(0,s.useRouter)(),[l,u]=(0,n.useState)(t),[h,p]=(0,n.useState)(""),[x,b]=(0,n.useTransition)(),[f,g]=(0,n.useState)(!1),v="connected"===l.status;return(0,a.jsxs)("div",{className:"space-y-5",children:[(0,a.jsxs)("div",{className:"bg-paper border border-rule-2/60 rounded-xl px-5 py-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:v?"inline-block w-2 h-2 rounded-full bg-agent-vivid":"inline-block w-2 h-2 rounded-full bg-ink-4","aria-hidden":"true"}),(0,a.jsx)("span",{className:"text-sm font-medium text-ink",children:v?"Connected":"Not connected"})]}),l.botUsername&&(0,a.jsxs)("p",{className:"text-xs text-ink-3 mt-1.5",children:["Bot:"," ",(0,a.jsxs)("a",{href:`https://t.me/${l.botUsername}`,target:"_blank",rel:"noopener noreferrer",className:"font-mono text-ink-2 hover:text-ok",children:["@",l.botUsername]})]})]}),(0,a.jsxs)("form",{onSubmit:function(t){t.preventDefault(),h&&b(async()=>{let t=await c({agentId:e,botToken:h});t.ok?(u(t.data),p(""),o.oR.success(`Connected as @${t.data.botUsername}`),r.refresh()):o.oR.error(t.message)})},className:"space-y-3",children:[(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"text-xs font-medium text-ink-2 uppercase tracking-wider",children:"Bot token"}),(0,a.jsx)("input",{type:"text",autoComplete:"off",spellCheck:!1,value:h,onChange:e=>p(e.target.value),placeholder:"123456789:ABCDEF…",className:"mt-2 w-full px-3 py-2 bg-canvas border border-rule-2 rounded-lg text-sm font-mono text-ink placeholder:text-ink-4 focus:outline-none focus:border-rule"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("button",{type:"submit",disabled:x||!h,className:"px-4 py-2 text-sm font-medium bg-ok text-ink rounded-lg hover:bg-agent-vivid transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:x?"Saving…":v?"Replace token":"Connect"}),v&&(0,a.jsx)("button",{type:"button",onClick:()=>g(!0),disabled:x,className:"px-4 py-2 text-sm font-medium border border-rule-2 text-ink-3 rounded-lg hover:border-err hover:text-err transition-colors disabled:opacity-50",children:"Disconnect"})]})]}),(0,a.jsx)(d.A,{open:f,title:"Disconnect Telegram bot?",message:"Incoming messages to this bot will stop being processed. You can reconnect later by pasting the token again.",confirmLabel:"Disconnect",onConfirm:function(){g(!1),b(async()=>{let t=await i(e);t.ok?(u({...l,status:"disconnected",botUsername:null}),o.oR.success("Telegram disconnected"),r.refresh()):o.oR.error(t.message)})},onCancel:()=>g(!1)})]})}},54030:(e,t,r)=>{Promise.resolve().then(r.bind(r,56186)),Promise.resolve().then(r.bind(r,35843)),Promise.resolve().then(r.bind(r,88563)),Promise.resolve().then(r.bind(r,64676)),Promise.resolve().then(r.bind(r,11248)),Promise.resolve().then(r.t.bind(r,63363,23))},56186:(e,t,r)=>{"use strict";r.d(t,{default:()=>m});var a=r(3680),n=r(78604),s=r(27540),o=r(39504),l=r(64678);let c=(0,l.createServerReference)("60cadb5ce28b559a8f145eec69f118015a83c5022d",l.callServer,void 0,l.findSourceMapURL,"resolveTelegramChatAction"),i=(0,l.createServerReference)("40691a0da2455c343c08f1395b3001a5dc40b8c2c8",l.callServer,void 0,l.findSourceMapURL,"revokeTelegramChatAction");var d=r(14308);function m({chats:e}){let t=(0,s.useRouter)(),[r,l]=(0,n.useTransition)(),[u,h]=(0,n.useState)(null),p=e.filter(e=>"pending"===e.status),x=e.filter(e=>"active"===e.status);function b(e,r){l(async()=>{let a=await c(e,r);a.ok?(o.oR.success("approve"===r?"Chat authorized":"Chat denied"),t.refresh()):o.oR.error(a.message)})}return(0,a.jsxs)("div",{className:"bg-paper border border-rule-2 rounded-xl px-5 py-4 space-y-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-xs font-medium text-ink-3 uppercase tracking-wide",children:"Authorized chats"}),(0,a.jsx)("p",{className:"text-sm text-ink-3 mt-1",children:"Only these chats can put this agent to work. The first person to DM the bot becomes its owner; anyone new is held here until you approve them."})]}),0===e.length?(0,a.jsx)("p",{className:"text-sm text-ink-3",children:"No chats yet — DM the bot from your Telegram account to claim ownership."}):(0,a.jsxs)("div",{className:"space-y-2",children:[p.map(e=>(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3 rounded-lg border border-warn/40 bg-warn-bg px-3 py-2",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("p",{className:"text-sm text-ink-2 truncate",children:[e.requesterName??"Unknown"," ",(0,a.jsxs)("span",{className:"text-ink-3 font-mono text-xs",children:["(",e.chatId,")"]})]}),(0,a.jsx)("p",{className:"text-xs text-warn",children:"Waiting for your approval"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[(0,a.jsx)("button",{type:"button",disabled:r,onClick:()=>b(e.id,"approve"),className:"text-xs rounded-md bg-ok/15 text-ok px-2.5 py-1 hover:bg-ok/25 transition-colors disabled:opacity-50",children:"Approve"}),(0,a.jsx)("button",{type:"button",disabled:r,onClick:()=>b(e.id,"deny"),className:"text-xs rounded-md bg-err/15 text-err px-2.5 py-1 hover:bg-err/25 transition-colors disabled:opacity-50",children:"Deny"})]})]},e.id)),x.map(e=>(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3 rounded-lg border border-rule-2 px-3 py-2",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("p",{className:"text-sm text-ink-2 truncate",children:[e.requesterName??("owner"===e.role?"Owner":"Member")," ",(0,a.jsxs)("span",{className:"text-ink-3 font-mono text-xs",children:["(",e.chatId,")"]})]}),(0,a.jsx)("p",{className:"text-xs text-ink-3",children:"owner"===e.role?"Owner — controls this bot":"Authorized"})]}),"owner"===e.role?(0,a.jsx)("span",{className:"text-xs rounded-md bg-ok/15 text-ok px-2.5 py-1 shrink-0",children:"Owner"}):(0,a.jsx)("button",{type:"button",disabled:r,onClick:()=>h(e),className:"text-xs rounded-md border border-rule-2 text-ink-3 px-2.5 py-1 hover:text-err hover:border-err/40 transition-colors disabled:opacity-50 shrink-0",children:"Revoke"})]},e.id))]}),(0,a.jsx)(d.A,{open:null!==u,title:"Revoke access?",message:`${u?.requesterName??"This chat"} (${u?.chatId??""}) will no longer be able to message this agent. If they DM again, you'll be asked to approve them.`,confirmLabel:"Revoke",onConfirm:function(){h(null),u&&l(async()=>{let e=await i(u.id);e.ok?(o.oR.success("Access revoked"),t.refresh()):o.oR.error(e.message)})},onCancel:()=>h(null)})]})}}},e=>{e.O(0,[3363,8161,9836,1065,8724,7358],()=>e(e.s=54030)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[797],{10396:(e,t,r)=>{"use strict";r.d(t,{f:()=>n});var s=r(64678);let n=(0,s.createServerReference)("408df2b11931bbea4429c0a7c374cb7ade9635b895",s.callServer,void 0,s.findSourceMapURL,"updateAgentAction")},17177:(e,t,r)=>{Promise.resolve().then(r.bind(r,52232)),Promise.resolve().then(r.bind(r,36877)),Promise.resolve().then(r.bind(r,79065)),Promise.resolve().then(r.bind(r,88563)),Promise.resolve().then(r.bind(r,64676)),Promise.resolve().then(r.bind(r,11248))},20567:(e,t,r)=>{"use strict";r.d(t,{V:()=>n});var s=r(64678);let n=(0,s.createServerReference)("00f4b3acc107dcaff1c41e8f9d5b8145ac214f6379",s.callServer,void 0,s.findSourceMapURL,"getActiveJobsByAgentAction")},36877:(e,t,r)=>{"use strict";r.d(t,{default:()=>k});var s=r(3680),n=r(63363),l=r.n(n),a=r(78604),i=r(27540),o=r(39504),d=r(34767),c=r(35436),u=r(62182),x=r(14739),m=r(57390),h=r(20567),p=r(64678);let g=(0,p.createServerReference)("40579337f2db185bdba19b691873fd80639183b430",p.callServer,void 0,p.findSourceMapURL,"reorderAgentsAction"),b=(0,p.createServerReference)("40d912a4ab8fa1fff5a87cd3963ced9894de782dca",p.callServer,void 0,p.findSourceMapURL,"deleteAgentAction");var f=r(18771),v=r(14308);function j({id:e,name:t,deleteAction:r}){let n=(0,i.useRouter)(),[l,d]=(0,a.useTransition)(),[c,u]=(0,a.useState)(!1);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("button",{onClick:()=>u(!0),disabled:l,"aria-label":"Delete",title:"Delete",className:"inline-flex items-center gap-1.5 rounded-lg border border-rule-2 px-2.5 py-1.5 text-xs font-medium text-ink-3 transition-colors hover:border-err hover:text-err disabled:opacity-50 sm:px-3",children:[(0,s.jsx)(f.l,{size:15,className:"sm:hidden"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:l?"Deleting…":"Delete"})]}),(0,s.jsx)(v.A,{open:c,title:`Delete agent "${t}"?`,message:"The agent and its assignments will be removed. Past job history is preserved.",confirmLabel:"Delete",onConfirm:function(){u(!1),d(async()=>{let t=await r(e);t.ok?(o.oR.success("Agent deleted"),n.refresh()):o.oR.error(t.message)})},onCancel:()=>u(!1)})]})}function k({initialGroups:e,initialActivity:t}){let r=(0,a.useMemo)(()=>e.flatMap(e=>[e.orchestrator?.id??"",...e.workers.map(e=>e.id)]).join("|"),[e]),[{displayed:n,seenKey:l},u]=(0,a.useState)({displayed:null,seenKey:r});l!==r&&u({displayed:null,seenKey:r});let x=(l===r?n:null)??e,[m,p]=(0,a.useState)(t),[b,f]=(0,a.useTransition)(),v=(0,i.useRouter)(),j=(0,a.useSyncExternalStore)(()=>()=>{},()=>!0,()=>!1),w=(0,a.useMemo)(()=>{let e=new Map;for(let t of m)e.set(t.agentId,t);return e},[m]);(0,a.useEffect)(()=>{let e=!1,t=async()=>{let t=await (0,h.V)();!e&&t.ok&&p(t.data)},r=setInterval(()=>void t(),5e3);return()=>{e=!0,clearInterval(r)}},[]);let C=(0,d.FR)((0,d.MS)(d.AN,{activationConstraint:{distance:8}}),(0,d.MS)(d.uN,{coordinateGetter:c.JR}));function _(e){u(t=>({...t,displayed:e})),f(async()=>{let t=await g(function(e){let t=[];for(let r of e)for(let e of(r.orchestrator&&t.push(r.orchestrator.id),r.workers))t.push(e.id);return t}(e));if(!t.ok){o.oR.error(t.message),u(e=>({...e,displayed:x}));return}v.refresh()})}if(0===x.length)return(0,s.jsx)("div",{className:"bg-paper border border-rule-2 rounded-xl overflow-hidden",children:(0,s.jsx)("div",{className:"px-6 py-12 text-center text-ink-4 text-sm",children:"No agents yet. Create one above."})});let A=x.map(e=>e.orchestrator?.id).filter(e=>!!e);return j?(0,s.jsx)(d.Mp,{sensors:C,collisionDetection:d.fp,onDragEnd:function(e){let{active:t,over:r}=e;if(!r||t.id===r.id)return;let s=x.findIndex(e=>e.orchestrator?.id===t.id),n=x.findIndex(e=>e.orchestrator?.id===r.id);s<0||n<0||_((0,c.be)(x,s,n))},children:(0,s.jsx)(c.gB,{items:A,strategy:c._G,children:(0,s.jsx)("div",{className:"space-y-6",children:x.map((e,t)=>{let r=null===e.orchestrator;return(0,s.jsxs)("div",{children:[e.orchestrator?(0,s.jsx)(N,{orchestrator:e.orchestrator,disabled:b}):(0,s.jsx)("h2",{className:"mb-2 text-xs font-semibold text-ink-3 uppercase tracking-wider",children:"Standalone"}),(0,s.jsx)(y,{workers:e.workers,indent:!!e.orchestrator,orchestrator:e.orchestrator,disabled:b,onWorkerDragEnd:e=>(function(e,t){let{active:r,over:s}=t;if(!s||r.id===s.id)return;let n=x[e];if(!n)return;let l=n.workers.findIndex(e=>e.id===r.id),a=n.workers.findIndex(e=>e.id===s.id);if(l<0||a<0)return;let i=(0,c.be)(n.workers,l,a);_(x.map((t,r)=>r===e?{...t,workers:i}:t))})(t,e),sensors:C,activityByAgent:w})]},r?"__standalone__":e.orchestrator?.id??"")})})})}):(0,s.jsx)("div",{className:"space-y-6",children:x.map(e=>{let t=null===e.orchestrator;return(0,s.jsxs)("div",{children:[e.orchestrator?(0,s.jsxs)("div",{className:"mb-2 flex items-center gap-2",children:[(0,s.jsx)("span",{className:"leading-none text-ink-4","aria-hidden":!0,children:"⋮⋮"}),(0,s.jsxs)("h2",{className:"text-xs font-semibold uppercase tracking-wider text-ink-3",children:["Team — ",e.orchestrator.name]})]}):(0,s.jsx)("h2",{className:"mb-2 text-xs font-semibold uppercase tracking-wider text-ink-3",children:"Standalone"}),(0,s.jsx)("div",{className:"overflow-hidden rounded-xl border border-rule-2 bg-paper",children:(0,s.jsx)("table",{className:"w-full text-sm",children:(0,s.jsxs)("tbody",{children:[e.orchestrator&&(0,s.jsx)(S,{agent:e.orchestrator,indent:!1,activity:w.get(e.orchestrator.id)??null}),e.workers.map(t=>(0,s.jsx)(S,{agent:t,indent:!!e.orchestrator,activity:w.get(t.id)??null},t.id))]})})})]},t?"__standalone__":e.orchestrator?.id??"")})})}function N({orchestrator:e,disabled:t}){let{attributes:r,listeners:n,setNodeRef:l,transform:a,transition:i,isDragging:o}=(0,c.gl)({id:e.id,disabled:t});return(0,s.jsxs)("div",{ref:l,style:{transform:u.Ks.Transform.toString(a),transition:i},className:`mb-2 flex items-center gap-2 ${o?"opacity-50":""}`,children:[(0,s.jsx)("button",{type:"button",...r,...n,"aria-label":"Drag team",title:"Drag to reorder team",className:"cursor-grab active:cursor-grabbing text-ink-4 hover:text-ink-2 transition-colors leading-none touch-none",children:"⋮⋮"}),(0,s.jsxs)("h2",{className:"text-xs font-semibold text-ink-3 uppercase tracking-wider",children:["Team — ",e.name]})]})}function y({workers:e,indent:t,orchestrator:r,disabled:n,onWorkerDragEnd:l,sensors:a,activityByAgent:i}){let o=e.map(e=>e.id);return(0,s.jsx)(d.Mp,{sensors:a,collisionDetection:d.fp,onDragEnd:l,children:(0,s.jsx)("div",{className:"bg-paper border border-rule-2 rounded-xl overflow-hidden",children:(0,s.jsx)("table",{className:"w-full text-sm",children:(0,s.jsx)("tbody",{children:(0,s.jsxs)(c.gB,{items:o,strategy:c._G,children:[r&&(0,s.jsx)(S,{agent:r,indent:!1,activity:i.get(r.id)??null}),e.map(e=>(0,s.jsx)(w,{agent:e,indent:t,disabled:n,activity:i.get(e.id)??null},e.id))]})})})})})}function w({agent:e,indent:t,disabled:r,activity:n}){let{attributes:l,listeners:a,setNodeRef:i,transform:o,transition:d,isDragging:x}=(0,c.gl)({id:e.id,disabled:r});return(0,s.jsxs)("tr",{ref:i,style:{transform:u.Ks.Transform.toString(o),transition:d},className:`border-b border-rule-2 last:border-0 ${x?"opacity-50 bg-hover":""}`,children:[(0,s.jsx)("td",{className:`px-5 py-3 ${t?"pl-10":""}`,children:(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("button",{type:"button",...l,...a,"aria-label":"Drag row",title:"Drag to reorder",className:"cursor-grab active:cursor-grabbing text-ink-4 hover:text-ink-3 transition-colors leading-none touch-none select-none",children:"⋮⋮"}),(0,s.jsx)(C,{agent:e}),(0,s.jsx)(_,{agent:e}),(0,s.jsx)(A,{agent:e,activity:n})]})}),(0,s.jsx)(R,{agent:e})]})}function S({agent:e,indent:t,activity:r}){return(0,s.jsxs)("tr",{className:"border-b border-rule-2 last:border-0",children:[(0,s.jsx)("td",{className:`px-5 py-3 ${t?"pl-10":""}`,children:(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("span",{className:"w-4 inline-block","aria-hidden":!0}),(0,s.jsx)(C,{agent:e}),(0,s.jsx)(_,{agent:e}),(0,s.jsx)(A,{agent:e,activity:r})]})}),(0,s.jsx)(R,{agent:e})]})}function C({agent:e}){return e.avatarUrl?(0,s.jsx)("img",{src:e.avatarUrl,alt:"",width:32,height:32,className:"w-8 h-8 rounded-full object-cover border border-rule-2 shrink-0"}):(0,s.jsx)("div",{className:"w-8 h-8 rounded-full bg-hover text-ink-3 text-xs font-semibold flex items-center justify-center shrink-0",children:e.name.charAt(0).toUpperCase()})}function _({agent:e}){return(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-ink font-medium truncate",children:e.name}),e.isDefault&&(0,s.jsx)("span",{className:"text-[10px] font-semibold text-run uppercase tracking-wider",children:"default"}),"orchestrator"===e.role&&(0,s.jsx)("span",{className:"text-[10px] font-semibold text-indigo-400 uppercase tracking-wider",children:"orchestrator"})]}),(0,s.jsx)("span",{className:"font-mono text-ink-3 text-[11px]",children:e.slug}),e.model&&(0,s.jsxs)("span",{className:"ml-2 text-ink-4 text-[11px]",children:["\xb7 ",e.model]})]})}function A({agent:e,activity:t}){if(!t||0===t.total)return null;let r=t.processing>0?{color:"bg-run",pulse:!0,label:`${t.processing} running`}:t.awaiting>0?{color:"bg-warn",pulse:!0,label:`${t.awaiting} awaiting`}:{color:"bg-warn",pulse:!1,label:`${t.pending} pending`},n=[];return t.processing>0&&n.push(`${t.processing} processing`),t.awaiting>0&&n.push(`${t.awaiting} awaiting`),t.pending>0&&n.push(`${t.pending} pending`),(0,s.jsxs)(l(),{href:`/jobs?agentId=${e.id}`,title:n.join(" \xb7 "),onPointerDown:e=>e.stopPropagation(),className:"ml-1 inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full bg-hover hover:bg-hover border border-rule text-[11px] text-ink-2 transition-colors shrink-0",children:[(0,s.jsxs)("span",{className:"relative inline-flex w-2 h-2 shrink-0",children:[r.pulse&&(0,s.jsx)("span",{className:`absolute inset-0 inline-flex h-full w-full rounded-full opacity-60 animate-ping ${r.color}`}),(0,s.jsx)("span",{className:`relative inline-flex w-2 h-2 rounded-full ${r.color}`})]}),(0,s.jsx)("span",{className:"font-mono tabular-nums",children:t.total}),(0,s.jsx)("span",{className:"text-ink-3 text-[10px]",children:"active"})]})}function R({agent:e}){return(0,s.jsx)("td",{className:"px-5 py-3 text-right",children:(0,s.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,s.jsxs)(l(),{href:`/agents/${e.id}/telegram`,"aria-label":"Telegram",title:"Telegram",className:"inline-flex items-center gap-1.5 rounded-lg border border-rule-2 px-2.5 py-1.5 text-xs font-medium text-ink-3 transition-colors hover:border-rule hover:text-ink sm:px-3",children:[(0,s.jsx)(x.M,{size:15,className:"sm:hidden"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:"Telegram"})]}),(0,s.jsxs)(l(),{href:`/agents/${e.id}/edit`,"aria-label":"Edit",title:"Edit",className:"inline-flex items-center gap-1.5 rounded-lg border border-rule-2 px-2.5 py-1.5 text-xs font-medium text-ink-3 transition-colors hover:border-rule hover:text-ink sm:px-3",children:[(0,s.jsx)(m.I,{size:15,className:"sm:hidden"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:"Edit"})]}),(0,s.jsx)(j,{id:e.id,name:e.name,deleteAction:b})]})})}},37955:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var s=r(3680),n=r(78604),l=r(51869);let a=Array.from({length:42},(e,t)=>{let r=String(t+1).padStart(2,"0");return{id:`avatar-${r}`,url:`/avatars/avatar-${r}.png`}});function i({value:e,onChange:t,label:r="Avatar"}){let[c,u]=(0,n.useState)(!1),[x,m]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{m(!0)},[]),(0,n.useEffect)(()=>{if(c)return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e);function e(e){"Escape"===e.key&&u(!1)}},[c]),(0,s.jsxs)("div",{children:[r&&(0,s.jsx)("label",{className:"block text-xs text-ink-3 mb-1",children:r}),(0,s.jsxs)("button",{type:"button",onClick:()=>u(!0),className:"group flex items-center gap-3 bg-hover border border-rule hover:border-rule rounded-md px-3 py-2 text-left transition-colors w-full max-w-xs",children:[(0,s.jsx)(o,{url:e,size:36}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("p",{className:"text-sm text-ink truncate",children:e?e.split("/").pop()?.replace(".png",""):"No avatar"}),(0,s.jsxs)("p",{className:"text-[12px] text-ink-3",children:["Click to ",e?"change":"pick"]})]})]}),x&&c&&(0,l.createPortal)((0,s.jsx)("div",{role:"dialog","aria-modal":"true","aria-label":"Pick an avatar",onClick:()=>u(!1),className:"fixed inset-0 z-50 bg-black/70 backdrop-blur-sm flex items-center justify-center p-4",children:(0,s.jsxs)("div",{onClick:e=>e.stopPropagation(),className:"bg-paper border border-rule-2 rounded-2xl p-5 max-w-2xl w-full max-h-[80vh] overflow-y-auto",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,s.jsx)("h3",{className:"text-sm font-semibold text-ink",children:"Pick an avatar"}),(0,s.jsx)("button",{type:"button",onClick:()=>u(!1),className:"text-ink-3 hover:text-ink text-xs",children:"Close (Esc)"})]}),(0,s.jsxs)("div",{className:"grid grid-cols-6 gap-3",children:[(0,s.jsx)(d,{selected:null===e,onClick:()=>void(t(null),u(!1)),label:"None",url:null}),a.map(r=>(0,s.jsx)(d,{selected:e===r.url,onClick:()=>{t(r.url),u(!1)},label:r.id,url:r.url},r.id))]})]})}),document.body)]})}function o({url:e,size:t=32}){return e?(0,s.jsx)("img",{src:e,alt:"",width:t,height:t,style:{width:t,height:t},className:"rounded-full object-cover border border-rule shrink-0"}):(0,s.jsx)("div",{style:{width:t,height:t},className:"rounded-full bg-hover border border-dashed border-rule text-ink-3 text-xs flex items-center justify-center shrink-0",children:"?"})}function d({selected:e,onClick:t,label:r,url:n}){return(0,s.jsx)("button",{type:"button",onClick:t,title:r,"aria-label":r,"aria-pressed":e,className:`aspect-square rounded-lg p-1 flex items-center justify-center transition-all ${e?"bg-ink/10 ring-2 ring-emerald-400":"bg-hover hover:bg-hover ring-1 ring-transparent hover:ring-neutral-700"}`,children:(0,s.jsx)(o,{url:n,size:56})})}},52232:(e,t,r)=>{"use strict";r.d(t,{default:()=>l});var s=r(3680),n=r(27540);function l({message:e}){let t=(0,n.useRouter)();return(0,s.jsxs)("div",{className:"bg-warn-bg border border-err/30 rounded-xl px-5 py-4 flex items-center justify-between gap-4",children:[(0,s.jsx)("p",{className:"text-sm text-err",children:e}),(0,s.jsx)("button",{onClick:()=>t.refresh(),className:"shrink-0 px-3 py-1.5 text-xs font-medium border border-err/30 text-err rounded-lg hover:border-err hover:text-err transition-colors",children:"Retry"})]})}},52637:(e,t,r)=>{"use strict";r.d(t,{W:()=>n});var s=r(64678);let n=(0,s.createServerReference)("40ae693984abe2a327713b38a1c552f6df8ea1678b",s.callServer,void 0,s.findSourceMapURL,"listKeyModelsAction")},63217:(e,t,r)=>{"use strict";function s(e){switch(e){case"openai-compatible":return"Local LLM";case"anthropic":return"Anthropic";case"openai":return"OpenAI";case"ollama":return"Ollama";case"openrouter":return"OpenRouter";case"google":return"Google";case"mistral":return"Mistral";case"groq":return"Groq";case"deepseek":return"DeepSeek";case"minimax":return"MiniMax";default:return e}}r.d(t,{R:()=>s})},77045:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var s=r(3680),n=r(63363),l=r.n(n);let a={ink:"bg-ink text-canvas border-0 hover:brightness-[0.92]",agent:"bg-agent-vivid text-[#1a2200] border-0 hover:brightness-[0.96]",coral:"bg-skill-vivid text-white border-0 hover:brightness-[0.94]",blue:"bg-conn-vivid text-white border-0 hover:brightness-[0.94]",neutral:"border border-rule-2 bg-paper text-ink hover:bg-hover"};function i(e){let{children:t,variant:r="ink",size:n="md",className:i=""}=e,o=`inline-flex cursor-pointer items-center justify-center gap-1.5 rounded-md font-medium leading-none transition-[filter,background-color] ${"md"===n?"h-[34px] px-3.5 text-[14px]":"h-[30px] px-3 text-[13px]"} ${a[r]} ${i}`;if("href"in e&&e.href){let{href:r,variant:n,size:a,className:i,children:d,...c}=e;return(0,s.jsx)(l(),{href:r,className:o,...c,children:t})}let{variant:d,size:c,className:u,children:x,...m}=e;return(0,s.jsx)("button",{type:"button",className:o,...m,children:t})}},79065:(e,t,r)=>{"use strict";r.d(t,{default:()=>g});var s=r(3680),n=r(78604),l=r(51869),a=r(27540),i=r(39504),o=r(52637),d=r(10396),c=r(89773),u=r(14964),x=r(63217),m=r(40189),h=r(77045),p=r(37955);function g(e){var t,r;let g="edit"===e.mode,b=(0,a.useRouter)(),f=(0,n.useRef)(null),[v,j]=(0,n.useTransition)(),[k,N]=(0,n.useState)(g),y=g?(t=e.initial.role??null,r=e.initial.orchestratorMode??null,"orchestrator"===t&&"planner"===r?"planner":"orchestrator"===t?"router":"worker"):"worker",[w,S]=(0,n.useState)(y),[C,_]=(0,n.useState)(g?e.initial.subAgentIds:[]),A=(0,n.useMemo)(()=>e.llmKeys.filter(e=>e.isActive),[e.llmKeys]),R=(g?e.initial.llmKeyId:null)??A[0]?.id??"",[M,I]=(0,n.useState)(R),[L,E]=(0,n.useState)(g?e.initial.model??"":""),[$,D]=(0,n.useState)(g?e.initial.avatarUrl??null:null),[F,P]=(0,n.useState)({}),[q,z]=(0,n.useState)(!1),K=(0,n.useMemo)(()=>e.llmKeys.find(e=>e.id===M)??null,[e.llmKeys,M]);function T(t){let r=e.llmKeys.find(e=>e.id===t);I(t),E(u.SV[r?.provider??""]?.[0]?.modelId??""),t&&void 0===F[t]&&(z(!0),(0,o.W)(t).then(e=>{P(r=>({...r,[t]:e.ok?e.data:[]})),z(!1)}))}function U(t){t.preventDefault();let r=new FormData(t.currentTarget);if(g&&"edit"===e.mode){let t={id:e.initial.id,name:r.get("name"),personality:r.get("personality"),model:L,llmKeyId:M||null,role:w,subAgentIds:"worker"===w?[]:C,avatarUrl:$};j(async()=>{let e=await (0,d.f)(t);e.ok?(i.oR.success("Agent updated"),b.push("/agents")):i.oR.error(e.message)})}else{let e={slug:r.get("slug"),name:r.get("name"),personality:r.get("personality"),model:L,llmKeyId:M||void 0,role:w,subAgentIds:"worker"===w?[]:C,avatarUrl:$};j(async()=>{let t=await (0,c.C)(e);t.ok?(i.oR.success("Agent created"),f.current?.reset(),S("worker"),_([]),I(A[0]?.id??""),E(""),D(null),N(!1),b.refresh()):i.oR.error(t.message)})}}function V(e){_(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])}(0,n.useEffect)(()=>{if(k&&!g)return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e);function e(e){"Escape"===e.key&&N(!1)}},[k,g]),(0,n.useEffect)(()=>{M&&void 0===F[M]&&(z(!0),(0,o.W)(M).then(e=>{P(t=>({...t,[M]:e.ok?e.data:[]})),z(!1)}))},[M]);let O=e.agents??[],W=0===A.length,G="worker"!==w,B=0===O.length,J=K?u.SV[K.provider]??[]:[],Y=K?F[K.id]??[]:[],H=new Set(J.map(e=>e.modelId)),Q=Y.filter(e=>!H.has(e)),X=!!(0,u.mV)(K?.provider??"",L)||Y.includes(L);if(g){let t=e.initial;return(0,s.jsxs)("form",{ref:f,onSubmit:U,className:"w-full max-w-lg space-y-4",children:[(0,s.jsx)("h3",{className:"text-sm font-semibold text-ink",children:"Edit agent"}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs text-ink-3 mb-1",htmlFor:"agent-slug",children:"Slug"}),(0,s.jsx)("input",{id:"agent-slug",name:"slug",readOnly:!0,defaultValue:t.slug,title:"Slug is not editable",className:"w-full bg-hover border border-rule rounded-lg px-3 py-2 text-sm text-ink-3 cursor-not-allowed"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs text-ink-3 mb-1",htmlFor:"agent-name",children:"Name"}),(0,s.jsx)("input",{id:"agent-name",name:"name",required:!0,defaultValue:t.name,placeholder:"My Agent",className:"w-full bg-hover border border-rule rounded-lg px-3 py-2 text-sm text-ink placeholder:text-ink-4 focus:border-ink-3 focus:outline-none"})]})]}),(0,s.jsx)(p.A,{value:$,onChange:D}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs text-ink-3 mb-1",htmlFor:"agent-personality",children:"Personality / System prompt"}),(0,s.jsx)("textarea",{id:"agent-personality",name:"personality",required:!0,rows:6,defaultValue:t.personality,placeholder:"You are a helpful assistant...",className:"w-full bg-hover border border-rule rounded-lg px-3 py-2 text-sm text-ink placeholder:text-ink-4 focus:border-ink-3 focus:outline-none resize-y"})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs text-ink-3 mb-1",htmlFor:"agent-llm-key",children:"LLM provider"}),W?(0,s.jsxs)("p",{className:"text-xs text-warn mt-1",children:["No active LLM providers. Add one in"," ",(0,s.jsx)("a",{href:"/settings",className:"underline",children:"Settings → LLM providers"}),"."]}):(0,s.jsx)("select",{id:"agent-llm-key",value:M,onChange:e=>T(e.target.value),required:!0,className:"w-full bg-hover border border-rule rounded-lg px-3 py-2 text-sm text-ink focus:border-ink-3 focus:outline-none",children:A.map(e=>(0,s.jsx)("option",{value:e.id,children:(e.nickname??(0,x.R)(e.provider))+" ("+(0,x.R)(e.provider)+")"},e.id))})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs text-ink-3 mb-1",htmlFor:"agent-model",children:q&&K?.id!==void 0&&void 0===F[K.id]?"Model (loading…)":"Model"}),(J.length>0||Q.length>0)&&(0,s.jsxs)("select",{id:"agent-model",value:X?L:"__custom__",onChange:e=>{E("__custom__"===e.target.value?"":e.target.value)},required:X,className:"w-full bg-hover border border-rule rounded-lg px-3 py-2 text-sm text-ink focus:border-ink-3 focus:outline-none mb-2",children:[(0,u.eS)(J).map(({group:e,models:t})=>e?(0,s.jsx)("optgroup",{label:e,children:t.map(e=>(0,s.jsx)("option",{value:e.modelId,children:e.label},e.modelId))},e):t.map(e=>(0,s.jsx)("option",{value:e.modelId,children:e.label},e.modelId))),Q.length>0&&(0,s.jsx)("optgroup",{label:"Live from provider",children:Q.map(e=>(0,s.jsx)("option",{value:e,children:e},e))}),(0,s.jsx)("option",{value:"__custom__",children:"Custom…"})]}),!X&&(0,s.jsx)("input",{id:"agent-model",name:"model",type:"text",required:!0,value:L,onChange:e=>{E(e.target.value)},placeholder:u.SV[K?.provider??""]?.[0]?.modelId??"e.g. claude-haiku-4-5-20251001",className:"w-full bg-hover border border-rule rounded-lg px-3 py-2 text-sm text-ink placeholder:text-ink-4 focus:border-ink-3 focus:outline-none font-mono"}),null]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs text-ink-3 mb-1",htmlFor:"agent-role",children:"Role"}),(0,s.jsxs)("select",{id:"agent-role",value:w,onChange:e=>S(e.target.value),className:"w-full bg-hover border border-rule rounded-lg px-3 py-2 text-sm text-ink focus:border-ink-3 focus:outline-none",children:[(0,s.jsx)("option",{value:"worker",children:"Worker — runs its own tools and tasks"}),(0,s.jsx)("option",{value:"router",children:"Router — delegates to one sub-agent at a time"}),(0,s.jsx)("option",{value:"planner",children:"Planner — creates parallel tasks for sub-agents"})]})]}),G&&(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"block text-xs text-ink-3 mb-1",children:["Sub-agents ",(0,s.jsxs)("span",{className:"text-ink-4",children:["(",C.length," selected)"]})]}),B?(0,s.jsx)("p",{className:"text-xs text-warn mt-1",children:"Create at least one worker agent first — orchestrators need someone to delegate to."}):(0,s.jsx)("div",{className:"max-h-40 overflow-y-auto bg-hover border border-rule rounded-lg divide-y divide-neutral-800",children:O.map(e=>{let t=C.includes(e.id);return(0,s.jsxs)("label",{className:"flex items-center gap-2 px-3 py-2 text-sm cursor-pointer hover:bg-hover/80",children:[(0,s.jsx)("input",{type:"checkbox",checked:t,onChange:()=>V(e.id),className:"accent-violet-500"}),(0,s.jsx)("span",{className:"text-ink",children:e.name}),(0,s.jsx)("span",{className:"font-mono text-xs text-ink-3 ml-auto",children:e.slug})]},e.id)})})]}),(0,s.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,s.jsx)("button",{type:"submit",disabled:v||W,className:"px-4 py-2 text-sm font-semibold bg-ink text-canvas rounded-lg hover:brightness-[0.92] transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:v?"Saving…":"Save changes"}),(0,s.jsx)("button",{type:"button",onClick:()=>b.push("/agents"),className:"px-4 py-2 text-sm font-medium border border-rule text-ink-3 rounded-lg hover:border-rule transition-colors",children:"Cancel"})]})]})}let Z=k?(0,l.createPortal)((0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"fixed inset-0 bg-black/60 z-40 animate-[fadeIn_150ms_ease]",onClick:()=>N(!1),"aria-hidden":"true"}),(0,s.jsx)("div",{role:"dialog","aria-modal":"true","aria-label":"New agent",className:"fixed inset-0 z-50 flex items-center justify-center p-4 pointer-events-none",children:(0,s.jsxs)("form",{ref:f,onSubmit:U,className:"pointer-events-auto w-full max-w-lg max-h-[90vh] overflow-y-auto bg-paper border border-rule-2 rounded-xl p-6 space-y-4 shadow-2xl animate-[scaleIn_150ms_ease]",children:[(0,s.jsx)("h3",{className:"text-sm font-semibold text-ink",children:"New agent"}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs text-ink-3 mb-1",htmlFor:"agent-slug",children:"Slug"}),(0,s.jsx)("input",{id:"agent-slug",name:"slug",required:!0,pattern:"[a-z0-9\\-]+",placeholder:"my-agent",className:"w-full bg-hover border border-rule rounded-lg px-3 py-2 text-sm text-ink placeholder:text-ink-4 focus:border-ink-3 focus:outline-none"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs text-ink-3 mb-1",htmlFor:"agent-name",children:"Name"}),(0,s.jsx)("input",{id:"agent-name",name:"name",required:!0,placeholder:"My Agent",className:"w-full bg-hover border border-rule rounded-lg px-3 py-2 text-sm text-ink placeholder:text-ink-4 focus:border-ink-3 focus:outline-none"})]})]}),(0,s.jsx)(p.A,{value:$,onChange:D}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs text-ink-3 mb-1",htmlFor:"agent-personality",children:"Personality / System prompt"}),(0,s.jsx)("textarea",{id:"agent-personality",name:"personality",required:!0,rows:4,placeholder:"You are a helpful assistant...",className:"w-full bg-hover border border-rule rounded-lg px-3 py-2 text-sm text-ink placeholder:text-ink-4 focus:border-ink-3 focus:outline-none resize-none"})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs text-ink-3 mb-1",htmlFor:"agent-llm-key",children:"LLM provider"}),W?(0,s.jsxs)("p",{className:"text-xs text-warn mt-1",children:["No active LLM providers. Add one in"," ",(0,s.jsx)("a",{href:"/settings",className:"underline",children:"Settings → LLM providers"}),"."]}):(0,s.jsx)("select",{id:"agent-llm-key",value:M,onChange:e=>T(e.target.value),required:!0,className:"w-full bg-hover border border-rule rounded-lg px-3 py-2 text-sm text-ink focus:border-ink-3 focus:outline-none",children:A.map(e=>(0,s.jsx)("option",{value:e.id,children:(e.nickname??(0,x.R)(e.provider))+" ("+(0,x.R)(e.provider)+")"},e.id))})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs text-ink-3 mb-1",htmlFor:"agent-model",children:q&&K?.id!==void 0&&void 0===F[K.id]?"Model (loading…)":"Model"}),(J.length>0||Q.length>0)&&(0,s.jsxs)("select",{id:"agent-model",value:X?L:"__custom__",onChange:e=>{E("__custom__"===e.target.value?"":e.target.value)},required:X,className:"w-full bg-hover border border-rule rounded-lg px-3 py-2 text-sm text-ink focus:border-ink-3 focus:outline-none mb-2",children:[(0,u.eS)(J).map(({group:e,models:t})=>e?(0,s.jsx)("optgroup",{label:e,children:t.map(e=>(0,s.jsx)("option",{value:e.modelId,children:e.label},e.modelId))},e):t.map(e=>(0,s.jsx)("option",{value:e.modelId,children:e.label},e.modelId))),Q.length>0&&(0,s.jsx)("optgroup",{label:"Live from provider",children:Q.map(e=>(0,s.jsx)("option",{value:e,children:e},e))}),(0,s.jsx)("option",{value:"__custom__",children:"Custom…"})]}),!X&&(0,s.jsx)("input",{id:"agent-model",name:"model",type:"text",required:!0,value:L,onChange:e=>{E(e.target.value)},placeholder:u.SV[K?.provider??""]?.[0]?.modelId??"e.g. claude-haiku-4-5-20251001",className:"w-full bg-hover border border-rule rounded-lg px-3 py-2 text-sm text-ink placeholder:text-ink-4 focus:border-ink-3 focus:outline-none font-mono"}),null]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs text-ink-3 mb-1",htmlFor:"agent-role",children:"Role"}),(0,s.jsxs)("select",{id:"agent-role",value:w,onChange:e=>S(e.target.value),className:"w-full bg-hover border border-rule rounded-lg px-3 py-2 text-sm text-ink focus:border-ink-3 focus:outline-none",children:[(0,s.jsx)("option",{value:"worker",children:"Worker — runs its own tools and tasks"}),(0,s.jsx)("option",{value:"router",children:"Router — delegates to one sub-agent at a time"}),(0,s.jsx)("option",{value:"planner",children:"Planner — creates parallel tasks for sub-agents"})]})]}),G&&(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"block text-xs text-ink-3 mb-1",children:["Sub-agents ",(0,s.jsxs)("span",{className:"text-ink-4",children:["(",C.length," selected)"]})]}),B?(0,s.jsx)("p",{className:"text-xs text-warn mt-1",children:"Create at least one worker agent first — orchestrators need someone to delegate to."}):(0,s.jsx)("div",{className:"max-h-40 overflow-y-auto bg-hover border border-rule rounded-lg divide-y divide-neutral-800",children:O.map(e=>{let t=C.includes(e.id);return(0,s.jsxs)("label",{className:"flex items-center gap-2 px-3 py-2 text-sm cursor-pointer hover:bg-hover/80",children:[(0,s.jsx)("input",{type:"checkbox",checked:t,onChange:()=>V(e.id),className:"accent-violet-500"}),(0,s.jsx)("span",{className:"text-ink",children:e.name}),(0,s.jsx)("span",{className:"font-mono text-xs text-ink-3 ml-auto",children:e.slug})]},e.id)})})]}),(0,s.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,s.jsx)("button",{type:"submit",disabled:v||W,className:"px-4 py-2 text-sm font-semibold bg-ink text-canvas rounded-lg hover:brightness-[0.92] transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:v?"Creating…":"Create agent"}),(0,s.jsx)("button",{type:"button",onClick:()=>N(!1),className:"px-4 py-2 text-sm font-medium border border-rule text-ink-3 rounded-lg hover:border-rule transition-colors",children:"Cancel"})]})]})})]}),document.body):null;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(h.A,{variant:"agent",onClick:()=>N(!0),children:[(0,s.jsx)(m.F,{size:13,weight:"bold"}),"New agent"]}),Z]})}},89773:(e,t,r)=>{"use strict";r.d(t,{C:()=>n});var s=r(64678);let n=(0,s.createServerReference)("40ee1dadf791a661179a364ced1053a3313c55a4eb",s.callServer,void 0,s.findSourceMapURL,"createAgentAction")}},e=>{e.O(0,[3363,8161,7424,3798,9836,4964,1065,8724,7358],()=>e(e.s=17177)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2253],{11248:(e,t,n)=>{"use strict";n.d(t,{default:()=>o});var r=n(3680),a=n(78604),s=n(32895),l=n(97713);function o(){let[e,t]=(0,a.useState)("light"),[n,o]=(0,a.useState)(!1);(0,a.useEffect)(()=>{t("u"<typeof document?"light":"dark"===document.documentElement.getAttribute("data-theme")?"dark":"light"),o(!0)},[]);let i="dark"===e?s.b:l.A,d="dark"===e?"Switch to light theme":"Switch to dark theme";return(0,r.jsx)("button",{type:"button",onClick:()=>{let n="dark"===e?"light":"dark";document.documentElement.setAttribute("data-theme",n);try{localStorage.setItem("nodal.theme",n)}catch{}t(n)},"aria-label":d,title:d,className:"flex h-[34px] w-[34px] items-center justify-center rounded-md border border-rule-2 bg-paper text-ink-2 transition-colors hover:text-ink",suppressHydrationWarning:!0,children:n?(0,r.jsx)(i,{size:15}):(0,r.jsx)(l.A,{size:15})})}},32928:(e,t,n)=>{"use strict";n.d(t,{e:()=>o});var r=n(78604),a=n(53087);let s=new Map([["bold",r.createElement(r.Fragment,null,r.createElement("path",{d:"M232.49,215.51,185,168a92.12,92.12,0,1,0-17,17l47.53,47.54a12,12,0,0,0,17-17ZM44,112a68,68,0,1,1,68,68A68.07,68.07,0,0,1,44,112Z"}))],["duotone",r.createElement(r.Fragment,null,r.createElement("path",{d:"M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z",opacity:"0.2"}),r.createElement("path",{d:"M229.66,218.34,179.6,168.28a88.21,88.21,0,1,0-11.32,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z"}))],["fill",r.createElement(r.Fragment,null,r.createElement("path",{d:"M168,112a56,56,0,1,1-56-56A56,56,0,0,1,168,112Zm61.66,117.66a8,8,0,0,1-11.32,0l-50.06-50.07a88,88,0,1,1,11.32-11.31l50.06,50.06A8,8,0,0,1,229.66,229.66ZM112,184a72,72,0,1,0-72-72A72.08,72.08,0,0,0,112,184Z"}))],["light",r.createElement(r.Fragment,null,r.createElement("path",{d:"M228.24,219.76l-51.38-51.38a86.15,86.15,0,1,0-8.48,8.48l51.38,51.38a6,6,0,0,0,8.48-8.48ZM38,112a74,74,0,1,1,74,74A74.09,74.09,0,0,1,38,112Z"}))],["regular",r.createElement(r.Fragment,null,r.createElement("path",{d:"M229.66,218.34l-50.07-50.06a88.11,88.11,0,1,0-11.31,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z"}))],["thin",r.createElement(r.Fragment,null,r.createElement("path",{d:"M226.83,221.17l-52.7-52.7a84.1,84.1,0,1,0-5.66,5.66l52.7,52.7a4,4,0,0,0,5.66-5.66ZM36,112a76,76,0,1,1,76,76A76.08,76.08,0,0,1,36,112Z"}))]]),l=r.forwardRef((e,t)=>r.createElement(a.A,{ref:t,...e,weights:s}));l.displayName="MagnifyingGlassIcon";let o=l},39186:(e,t,n)=>{"use strict";n.d(t,{ApprovalsProvider:()=>i,e:()=>c});var r=n(3680),a=n(78604),s=n(64678);let l=(0,s.createServerReference)("4091a56ae49f9692f037a27b1733ac3e62709ec8ea",s.callServer,void 0,s.findSourceMapURL,"listApprovalsAction"),o=(0,a.createContext)(null);function i({initial:e,children:t}){let[n,s]=(0,a.useState)(e),d=(0,a.useCallback)(async()=>{let e=await l({status:"pending"});e.ok&&s(e.data.map(e=>({id:e.id,jobId:e.jobId,toolName:e.toolName,agentName:e.agentName,toolInput:e.toolInput,requestedAt:e.requestedAt})))},[]);(0,a.useEffect)(()=>{let e=setInterval(()=>{document.hidden||d()},15e3);function t(){document.hidden||d()}return document.addEventListener("visibilitychange",t),()=>{clearInterval(e),document.removeEventListener("visibilitychange",t)}},[d]);let c=(0,a.useCallback)(()=>{d()},[d]);return(0,r.jsx)(o.Provider,{value:{pending:n,refresh:c},children:t})}let d={pending:[],refresh:()=>{}};function c(){let e=(0,a.useContext)(o);return e||(console.warn("[useApprovals] called outside <ApprovalsProvider> — returning empty state."),d)}},47663:(e,t,n)=>{"use strict";n.d(t,{C:()=>a});var r=n(64678);let a=(0,r.createServerReference)("406589af82ec340355335d69e976a33b4a5205acdc",r.callServer,void 0,r.findSourceMapURL,"resolveApprovalAction")},64676:(e,t,n)=>{"use strict";n.d(t,{default:()=>l});var r=n(3680),a=n(32928),s=n(78604);function l({placeholder:e="Search agents, skills, runs…",keyboardShortcut:t=!0,onSubmit:n,className:o=""}){let i=(0,s.useRef)(null);return(0,s.useEffect)(()=>{if(!t)return;let e=e=>{if("/"!==e.key)return;let t=e.target;t&&/^(input|textarea|select)$/i.test(t.tagName)||t?.isContentEditable||(e.preventDefault(),i.current?.focus())};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[t]),(0,r.jsxs)("form",{onSubmit:e=>{e.preventDefault(),n?.(i.current?.value??"")},className:`flex h-[34px] min-w-[280px] items-center gap-2 rounded-md border border-rule-2 bg-paper px-3 text-[13px] text-ink-4 ${o}`,children:[(0,r.jsx)(a.e,{size:13,className:"shrink-0"}),(0,r.jsx)("input",{ref:i,type:"search",placeholder:e,className:"flex-1 border-0 bg-transparent text-[14px] leading-none text-ink outline-none placeholder:text-ink-4"}),(0,r.jsx)("span",{className:"rounded-[5px] border border-rule bg-black/5 px-1.5 py-[1px] font-mono text-[12px] leading-none text-ink-4 dark:bg-white/[0.06]",children:"/"})]})}},69564:(e,t,n)=>{"use strict";n.d(t,{default:()=>o});var r=n(3680),a=n(78604),s=n(39504),l=n(47663);function o({approvalId:e}){let[t,n]=(0,a.useTransition)(),[i,d]=(0,a.useState)(!1),[c,u]=(0,a.useState)("");return(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)("button",{type:"button",onClick:function(){n(async()=>{let t=await (0,l.C)({approvalRequestId:e,decision:"approve"});t.ok?s.oR.success("Approved"):s.oR.error(t.message)})},disabled:t,className:"rounded-md bg-ok px-3 py-1.5 text-xs font-semibold text-canvas transition-[filter] hover:brightness-[0.92] disabled:opacity-40",children:"Approve"}),(0,r.jsx)("button",{type:"button",onClick:function(){i?n(async()=>{let t=await (0,l.C)({approvalRequestId:e,decision:"reject",notes:c.trim()||void 0});t.ok?(s.oR.success("Rejected"),d(!1),u("")):s.oR.error(t.message)}):d(!0)},disabled:t,className:"rounded-md border border-err/30 px-3 py-1.5 text-xs font-semibold text-err transition-colors hover:border-err/60 disabled:opacity-40",children:i?"Confirm reject":"Reject"}),i&&(0,r.jsx)("button",{type:"button",onClick:()=>{d(!1),u("")},className:"px-3 py-1.5 text-xs text-ink-3 hover:text-ink",children:"Cancel"})]}),i&&(0,r.jsx)("textarea",{value:c,onChange:e=>u(e.target.value),placeholder:"Reason for rejection (optional, shown to the agent)",rows:2,maxLength:500,className:"w-full resize-none rounded-md border border-rule bg-canvas px-2 py-1.5 text-xs text-ink placeholder-ink-4 focus:border-ink-3 focus:outline-none"})]})}},88563:(e,t,n)=>{"use strict";n.d(t,{default:()=>m});var r=n(3680),a=n(78604),s=n(63363),l=n.n(s),o=n(7101),i=n(39504),d=n(47663),c=n(39186);function u({item:e,onApproved:t}){let[n,s]=(0,a.useTransition)();return(0,r.jsx)("button",{type:"button",onClick:n=>{n.preventDefault(),n.stopPropagation(),s(async()=>{let n=await (0,d.C)({approvalRequestId:e.id,decision:"approve"});n.ok?(i.oR.success("Approved"),t()):i.oR.error(n.message)})},disabled:n,className:"shrink-0 rounded-md bg-ok px-2.5 py-1 text-[12px] font-semibold text-canvas transition-[filter] hover:brightness-[0.92] disabled:opacity-40",children:n?"…":"Approve"})}function p({items:e,onClose:t,onApproved:n}){let s=(0,a.useRef)(null);return(0,a.useEffect)(()=>{function e(e){s.current&&!s.current.contains(e.target)&&t()}return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[t]),(0,a.useEffect)(()=>{function e(e){"Escape"===e.key&&t()}return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[t]),(0,r.jsxs)("div",{ref:s,className:"absolute right-0 top-full z-50 mt-1.5 w-[340px] rounded-xl border border-rule-2 bg-paper shadow-lg",role:"dialog","aria-label":"Pending approvals",children:[(0,r.jsx)("div",{className:"border-b border-rule-2 px-4 py-3",children:(0,r.jsxs)("p",{className:"text-[14px] font-semibold text-ink",children:["Pending approvals (",e.length,")"]})}),0===e.length?(0,r.jsx)("p",{className:"px-4 py-5 text-center text-[13px] text-ink-3",children:"No pending approvals."}):(0,r.jsx)("ul",{className:"max-h-[340px] divide-y divide-rule-2 overflow-y-auto",children:e.map(e=>(0,r.jsx)("li",{children:(0,r.jsxs)(l(),{href:`/jobs/${e.jobId}`,onClick:t,className:"flex items-start gap-3 px-4 py-3 transition-colors hover:bg-hover",children:[(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsxs)("p",{className:"truncate text-[13px] font-medium text-ink",children:[e.agentName??"Agent",(0,r.jsx)("span",{className:"mx-1 text-ink-4",children:"\xb7"}),(0,r.jsx)("code",{className:"rounded bg-canvas px-1 py-0.5 font-mono text-[12px] text-ink-2",children:e.toolName})]}),(0,r.jsx)("p",{className:"mt-0.5 truncate text-[12px] text-ink-3",children:function(e){if(!e)return"—";if("string"==typeof e.purpose&&e.purpose.trim()){let t=e.purpose.trim();return t.length>80?t.slice(0,77)+"…":t}if("string"==typeof e.command){let t=e.command;return t.length>60?t.slice(0,57)+"…":t}let t=JSON.stringify(e);return t.length>60?t.slice(0,57)+"…":t}(e.toolInput)}),(0,r.jsx)("p",{className:"mt-0.5 text-[11px] text-ink-4",children:function(e){if(!e)return"—";let t=Math.floor((Date.now()-new Date(e).getTime())/1e3);if(t<60)return`${t}s ago`;let n=Math.floor(t/60);if(n<60)return`${n}m ago`;let r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}(e.requestedAt)})]}),(0,r.jsx)(u,{item:e,onApproved:n})]})},e.id))}),(0,r.jsx)("div",{className:"border-t border-rule-2 px-4 py-2.5",children:(0,r.jsx)(l(),{href:"/approvals",onClick:t,className:"text-[13px] font-medium text-ink-2 transition-colors hover:text-ink",children:"See all approvals →"})})]})}function m(){let{pending:e,refresh:t}=(0,c.e)(),[n,s]=(0,a.useState)(!1),l=(0,a.useRef)(null),i=e.length,d=(0,a.useCallback)(()=>s(!1),[]),u=(0,a.useCallback)(()=>s(e=>!e),[]),m=(0,a.useCallback)(()=>{t()},[t]);return(0,r.jsxs)("div",{ref:l,className:"relative",children:[(0,r.jsxs)("button",{type:"button","aria-label":"Notifications",title:"Notifications",onClick:u,className:"relative flex h-[34px] w-[34px] shrink-0 items-center justify-center rounded-md border border-rule-2 bg-paper text-ink-2 transition-colors hover:text-ink",children:[(0,r.jsx)(o.I,{size:15}),i>0&&(0,r.jsx)("span",{className:"absolute -top-1 -right-1 flex h-4 min-w-[16px] items-center justify-center rounded-full bg-err px-1 text-[11px] font-bold leading-none text-canvas",children:i>99?"99+":i})]}),n&&(0,r.jsx)(p,{items:e,onClose:d,onApproved:m})]})}},95241:(e,t,n)=>{Promise.resolve().then(n.bind(n,69564)),Promise.resolve().then(n.bind(n,88563)),Promise.resolve().then(n.bind(n,64676)),Promise.resolve().then(n.bind(n,11248)),Promise.resolve().then(n.t.bind(n,63363,23))}},e=>{e.O(0,[3363,8161,1065,8724,7358],()=>e(e.s=95241)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2253],{11248:(e,t,n)=>{"use strict";n.d(t,{default:()=>o});var r=n(3680),a=n(78604),s=n(32895),l=n(97713);function o(){let[e,t]=(0,a.useState)("light"),[n,o]=(0,a.useState)(!1);(0,a.useEffect)(()=>{t("u"<typeof document?"light":"dark"===document.documentElement.getAttribute("data-theme")?"dark":"light"),o(!0)},[]);let i="dark"===e?s.b:l.A,d="dark"===e?"Switch to light theme":"Switch to dark theme";return(0,r.jsx)("button",{type:"button",onClick:()=>{let n="dark"===e?"light":"dark";document.documentElement.setAttribute("data-theme",n);try{localStorage.setItem("nodal.theme",n)}catch{}t(n)},"aria-label":d,title:d,className:"flex h-[34px] w-[34px] items-center justify-center rounded-md border border-rule-2 bg-paper text-ink-2 transition-colors hover:text-ink",suppressHydrationWarning:!0,children:n?(0,r.jsx)(i,{size:15}):(0,r.jsx)(l.A,{size:15})})}},32928:(e,t,n)=>{"use strict";n.d(t,{e:()=>o});var r=n(78604),a=n(53087);let s=new Map([["bold",r.createElement(r.Fragment,null,r.createElement("path",{d:"M232.49,215.51,185,168a92.12,92.12,0,1,0-17,17l47.53,47.54a12,12,0,0,0,17-17ZM44,112a68,68,0,1,1,68,68A68.07,68.07,0,0,1,44,112Z"}))],["duotone",r.createElement(r.Fragment,null,r.createElement("path",{d:"M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z",opacity:"0.2"}),r.createElement("path",{d:"M229.66,218.34,179.6,168.28a88.21,88.21,0,1,0-11.32,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z"}))],["fill",r.createElement(r.Fragment,null,r.createElement("path",{d:"M168,112a56,56,0,1,1-56-56A56,56,0,0,1,168,112Zm61.66,117.66a8,8,0,0,1-11.32,0l-50.06-50.07a88,88,0,1,1,11.32-11.31l50.06,50.06A8,8,0,0,1,229.66,229.66ZM112,184a72,72,0,1,0-72-72A72.08,72.08,0,0,0,112,184Z"}))],["light",r.createElement(r.Fragment,null,r.createElement("path",{d:"M228.24,219.76l-51.38-51.38a86.15,86.15,0,1,0-8.48,8.48l51.38,51.38a6,6,0,0,0,8.48-8.48ZM38,112a74,74,0,1,1,74,74A74.09,74.09,0,0,1,38,112Z"}))],["regular",r.createElement(r.Fragment,null,r.createElement("path",{d:"M229.66,218.34l-50.07-50.06a88.11,88.11,0,1,0-11.31,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z"}))],["thin",r.createElement(r.Fragment,null,r.createElement("path",{d:"M226.83,221.17l-52.7-52.7a84.1,84.1,0,1,0-5.66,5.66l52.7,52.7a4,4,0,0,0,5.66-5.66ZM36,112a76,76,0,1,1,76,76A76.08,76.08,0,0,1,36,112Z"}))]]),l=r.forwardRef((e,t)=>r.createElement(a.A,{ref:t,...e,weights:s}));l.displayName="MagnifyingGlassIcon";let o=l},39062:(e,t,n)=>{"use strict";n.d(t,{C:()=>a});var r=n(64678);let a=(0,r.createServerReference)("405714e3103acb8a86e8816a240e218d68c7bfe422",r.callServer,void 0,r.findSourceMapURL,"resolveApprovalAction")},64676:(e,t,n)=>{"use strict";n.d(t,{default:()=>l});var r=n(3680),a=n(32928),s=n(78604);function l({placeholder:e="Search agents, skills, runs…",keyboardShortcut:t=!0,onSubmit:n,className:o=""}){let i=(0,s.useRef)(null);return(0,s.useEffect)(()=>{if(!t)return;let e=e=>{if("/"!==e.key)return;let t=e.target;t&&/^(input|textarea|select)$/i.test(t.tagName)||t?.isContentEditable||(e.preventDefault(),i.current?.focus())};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[t]),(0,r.jsxs)("form",{onSubmit:e=>{e.preventDefault(),n?.(i.current?.value??"")},className:`flex h-[34px] min-w-[280px] items-center gap-2 rounded-md border border-rule-2 bg-paper px-3 text-[13px] text-ink-4 ${o}`,children:[(0,r.jsx)(a.e,{size:13,className:"shrink-0"}),(0,r.jsx)("input",{ref:i,type:"search",placeholder:e,className:"flex-1 border-0 bg-transparent text-[14px] leading-none text-ink outline-none placeholder:text-ink-4"}),(0,r.jsx)("span",{className:"rounded-[5px] border border-rule bg-black/5 px-1.5 py-[1px] font-mono text-[12px] leading-none text-ink-4 dark:bg-white/[0.06]",children:"/"})]})}},69564:(e,t,n)=>{"use strict";n.d(t,{default:()=>o});var r=n(3680),a=n(78604),s=n(39504),l=n(39062);function o({approvalId:e}){let[t,n]=(0,a.useTransition)(),[i,d]=(0,a.useState)(!1),[c,u]=(0,a.useState)("");return(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)("button",{type:"button",onClick:function(){n(async()=>{let t=await (0,l.C)({approvalRequestId:e,decision:"approve"});t.ok?s.oR.success("Approved"):s.oR.error(t.message)})},disabled:t,className:"rounded-md bg-ok px-3 py-1.5 text-xs font-semibold text-canvas transition-[filter] hover:brightness-[0.92] disabled:opacity-40",children:"Approve"}),(0,r.jsx)("button",{type:"button",onClick:function(){i?n(async()=>{let t=await (0,l.C)({approvalRequestId:e,decision:"reject",notes:c.trim()||void 0});t.ok?(s.oR.success("Rejected"),d(!1),u("")):s.oR.error(t.message)}):d(!0)},disabled:t,className:"rounded-md border border-err/30 px-3 py-1.5 text-xs font-semibold text-err transition-colors hover:border-err/60 disabled:opacity-40",children:i?"Confirm reject":"Reject"}),i&&(0,r.jsx)("button",{type:"button",onClick:()=>{d(!1),u("")},className:"px-3 py-1.5 text-xs text-ink-3 hover:text-ink",children:"Cancel"})]}),i&&(0,r.jsx)("textarea",{value:c,onChange:e=>u(e.target.value),placeholder:"Reason for rejection (optional, shown to the agent)",rows:2,maxLength:500,className:"w-full resize-none rounded-md border border-rule bg-canvas px-2 py-1.5 text-xs text-ink placeholder-ink-4 focus:border-ink-3 focus:outline-none"})]})}},88459:(e,t,n)=>{"use strict";n.d(t,{ApprovalsProvider:()=>i,e:()=>c});var r=n(3680),a=n(78604),s=n(64678);let l=(0,s.createServerReference)("4097f6d231fec2cd16168a9412d1b68b03b108fe6a",s.callServer,void 0,s.findSourceMapURL,"listApprovalsAction"),o=(0,a.createContext)(null);function i({initial:e,children:t}){let[n,s]=(0,a.useState)(e),d=(0,a.useCallback)(async()=>{let e=await l({status:"pending"});e.ok&&s(e.data.map(e=>({id:e.id,jobId:e.jobId,toolName:e.toolName,agentName:e.agentName,toolInput:e.toolInput,requestedAt:e.requestedAt})))},[]);(0,a.useEffect)(()=>{let e=setInterval(()=>{document.hidden||d()},15e3);function t(){document.hidden||d()}return document.addEventListener("visibilitychange",t),()=>{clearInterval(e),document.removeEventListener("visibilitychange",t)}},[d]);let c=(0,a.useCallback)(()=>{d()},[d]);return(0,r.jsx)(o.Provider,{value:{pending:n,refresh:c},children:t})}let d={pending:[],refresh:()=>{}};function c(){let e=(0,a.useContext)(o);return e||(console.warn("[useApprovals] called outside <ApprovalsProvider> — returning empty state."),d)}},88563:(e,t,n)=>{"use strict";n.d(t,{default:()=>m});var r=n(3680),a=n(78604),s=n(63363),l=n.n(s),o=n(7101),i=n(39504),d=n(39062),c=n(88459);function u({item:e,onApproved:t}){let[n,s]=(0,a.useTransition)();return(0,r.jsx)("button",{type:"button",onClick:n=>{n.preventDefault(),n.stopPropagation(),s(async()=>{let n=await (0,d.C)({approvalRequestId:e.id,decision:"approve"});n.ok?(i.oR.success("Approved"),t()):i.oR.error(n.message)})},disabled:n,className:"shrink-0 rounded-md bg-ok px-2.5 py-1 text-[12px] font-semibold text-canvas transition-[filter] hover:brightness-[0.92] disabled:opacity-40",children:n?"…":"Approve"})}function p({items:e,onClose:t,onApproved:n}){let s=(0,a.useRef)(null);return(0,a.useEffect)(()=>{function e(e){s.current&&!s.current.contains(e.target)&&t()}return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[t]),(0,a.useEffect)(()=>{function e(e){"Escape"===e.key&&t()}return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[t]),(0,r.jsxs)("div",{ref:s,className:"absolute right-0 top-full z-50 mt-1.5 w-[340px] rounded-xl border border-rule-2 bg-paper shadow-lg",role:"dialog","aria-label":"Pending approvals",children:[(0,r.jsx)("div",{className:"border-b border-rule-2 px-4 py-3",children:(0,r.jsxs)("p",{className:"text-[14px] font-semibold text-ink",children:["Pending approvals (",e.length,")"]})}),0===e.length?(0,r.jsx)("p",{className:"px-4 py-5 text-center text-[13px] text-ink-3",children:"No pending approvals."}):(0,r.jsx)("ul",{className:"max-h-[340px] divide-y divide-rule-2 overflow-y-auto",children:e.map(e=>(0,r.jsx)("li",{children:(0,r.jsxs)(l(),{href:`/jobs/${e.jobId}`,onClick:t,className:"flex items-start gap-3 px-4 py-3 transition-colors hover:bg-hover",children:[(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsxs)("p",{className:"truncate text-[13px] font-medium text-ink",children:[e.agentName??"Agent",(0,r.jsx)("span",{className:"mx-1 text-ink-4",children:"\xb7"}),(0,r.jsx)("code",{className:"rounded bg-canvas px-1 py-0.5 font-mono text-[12px] text-ink-2",children:e.toolName})]}),(0,r.jsx)("p",{className:"mt-0.5 truncate text-[12px] text-ink-3",children:function(e){if(!e)return"—";if("string"==typeof e.purpose&&e.purpose.trim()){let t=e.purpose.trim();return t.length>80?t.slice(0,77)+"…":t}if("string"==typeof e.command){let t=e.command;return t.length>60?t.slice(0,57)+"…":t}let t=JSON.stringify(e);return t.length>60?t.slice(0,57)+"…":t}(e.toolInput)}),(0,r.jsx)("p",{className:"mt-0.5 text-[11px] text-ink-4",children:function(e){if(!e)return"—";let t=Math.floor((Date.now()-new Date(e).getTime())/1e3);if(t<60)return`${t}s ago`;let n=Math.floor(t/60);if(n<60)return`${n}m ago`;let r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}(e.requestedAt)})]}),(0,r.jsx)(u,{item:e,onApproved:n})]})},e.id))}),(0,r.jsx)("div",{className:"border-t border-rule-2 px-4 py-2.5",children:(0,r.jsx)(l(),{href:"/approvals",onClick:t,className:"text-[13px] font-medium text-ink-2 transition-colors hover:text-ink",children:"See all approvals →"})})]})}function m(){let{pending:e,refresh:t}=(0,c.e)(),[n,s]=(0,a.useState)(!1),l=(0,a.useRef)(null),i=e.length,d=(0,a.useCallback)(()=>s(!1),[]),u=(0,a.useCallback)(()=>s(e=>!e),[]),m=(0,a.useCallback)(()=>{t()},[t]);return(0,r.jsxs)("div",{ref:l,className:"relative",children:[(0,r.jsxs)("button",{type:"button","aria-label":"Notifications",title:"Notifications",onClick:u,className:"relative flex h-[34px] w-[34px] shrink-0 items-center justify-center rounded-md border border-rule-2 bg-paper text-ink-2 transition-colors hover:text-ink",children:[(0,r.jsx)(o.I,{size:15}),i>0&&(0,r.jsx)("span",{className:"absolute -top-1 -right-1 flex h-4 min-w-[16px] items-center justify-center rounded-full bg-err px-1 text-[11px] font-bold leading-none text-canvas",children:i>99?"99+":i})]}),n&&(0,r.jsx)(p,{items:e,onClose:d,onApproved:m})]})}},95241:(e,t,n)=>{Promise.resolve().then(n.bind(n,69564)),Promise.resolve().then(n.bind(n,88563)),Promise.resolve().then(n.bind(n,64676)),Promise.resolve().then(n.bind(n,11248)),Promise.resolve().then(n.t.bind(n,63363,23))}},e=>{e.O(0,[3363,8161,1065,8724,7358],()=>e(e.s=95241)),_N_E=e.O()}]);