madarx 2.12.0 → 2.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (335) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/app-build-manifest.json +582 -582
  3. package/.next/standalone/.next/app-path-routes-manifest.json +83 -83
  4. package/.next/standalone/.next/build-manifest.json +5 -5
  5. package/.next/standalone/.next/prerender-manifest.json +3 -3
  6. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  7. package/.next/standalone/.next/server/app/_not-found.html +1 -1
  8. package/.next/standalone/.next/server/app/_not-found.rsc +1 -1
  9. package/.next/standalone/.next/server/app/activity/page_client-reference-manifest.js +1 -1
  10. package/.next/standalone/.next/server/app/admin/page.js +3 -3
  11. package/.next/standalone/.next/server/app/admin/page_client-reference-manifest.js +1 -1
  12. package/.next/standalone/.next/server/app/agents/[id]/page.js +4 -4
  13. package/.next/standalone/.next/server/app/agents/[id]/page_client-reference-manifest.js +1 -1
  14. package/.next/standalone/.next/server/app/agents/page.js +1 -1
  15. package/.next/standalone/.next/server/app/agents/page_client-reference-manifest.js +1 -1
  16. package/.next/standalone/.next/server/app/api/activity/route_client-reference-manifest.js +1 -1
  17. package/.next/standalone/.next/server/app/api/admin/audit-export/route_client-reference-manifest.js +1 -1
  18. package/.next/standalone/.next/server/app/api/admin/share-links/route_client-reference-manifest.js +1 -1
  19. package/.next/standalone/.next/server/app/api/agent-memory/route_client-reference-manifest.js +1 -1
  20. package/.next/standalone/.next/server/app/api/agent-runs/[id]/cancel/route_client-reference-manifest.js +1 -1
  21. package/.next/standalone/.next/server/app/api/agent-runs/[id]/events/route_client-reference-manifest.js +1 -1
  22. package/.next/standalone/.next/server/app/api/agent-runs/[id]/log/route_client-reference-manifest.js +1 -1
  23. package/.next/standalone/.next/server/app/api/agent-runs/[id]/route_client-reference-manifest.js +1 -1
  24. package/.next/standalone/.next/server/app/api/agent-runs/route_client-reference-manifest.js +1 -1
  25. package/.next/standalone/.next/server/app/api/agents/[id]/chain/route_client-reference-manifest.js +1 -1
  26. package/.next/standalone/.next/server/app/api/agents/[id]/memory/route_client-reference-manifest.js +1 -1
  27. package/.next/standalone/.next/server/app/api/agents/[id]/reports/route_client-reference-manifest.js +1 -1
  28. package/.next/standalone/.next/server/app/api/agents/[id]/run/route_client-reference-manifest.js +1 -1
  29. package/.next/standalone/.next/server/app/api/agents/[id]/skills/route_client-reference-manifest.js +1 -1
  30. package/.next/standalone/.next/server/app/api/agents/create/route_client-reference-manifest.js +1 -1
  31. package/.next/standalone/.next/server/app/api/agents/ops/route_client-reference-manifest.js +1 -1
  32. package/.next/standalone/.next/server/app/api/approvals/[id]/route_client-reference-manifest.js +1 -1
  33. package/.next/standalone/.next/server/app/api/approvals/route_client-reference-manifest.js +1 -1
  34. package/.next/standalone/.next/server/app/api/artifacts/[id]/acl/route_client-reference-manifest.js +1 -1
  35. package/.next/standalone/.next/server/app/api/artifacts/[id]/protect/route_client-reference-manifest.js +1 -1
  36. package/.next/standalone/.next/server/app/api/artifacts/[id]/raw/route_client-reference-manifest.js +1 -1
  37. package/.next/standalone/.next/server/app/api/artifacts/[id]/route_client-reference-manifest.js +1 -1
  38. package/.next/standalone/.next/server/app/api/artifacts/[id]/share-link/[linkId]/route_client-reference-manifest.js +1 -1
  39. package/.next/standalone/.next/server/app/api/artifacts/[id]/share-link/route_client-reference-manifest.js +1 -1
  40. package/.next/standalone/.next/server/app/api/artifacts/upload/route_client-reference-manifest.js +1 -1
  41. package/.next/standalone/.next/server/app/api/audit/list/route_client-reference-manifest.js +1 -1
  42. package/.next/standalone/.next/server/app/api/audit/search/route_client-reference-manifest.js +1 -1
  43. package/.next/standalone/.next/server/app/api/auth/callback/route_client-reference-manifest.js +1 -1
  44. package/.next/standalone/.next/server/app/api/auth/config/route_client-reference-manifest.js +1 -1
  45. package/.next/standalone/.next/server/app/api/auth/join-bootstrap/route_client-reference-manifest.js +1 -1
  46. package/.next/standalone/.next/server/app/api/auth/session/route_client-reference-manifest.js +1 -1
  47. package/.next/standalone/.next/server/app/api/brand/route_client-reference-manifest.js +1 -1
  48. package/.next/standalone/.next/server/app/api/chat/sessions/[id]/route_client-reference-manifest.js +1 -1
  49. package/.next/standalone/.next/server/app/api/chat/sessions/route_client-reference-manifest.js +1 -1
  50. package/.next/standalone/.next/server/app/api/config/env/route_client-reference-manifest.js +1 -1
  51. package/.next/standalone/.next/server/app/api/config/route_client-reference-manifest.js +1 -1
  52. package/.next/standalone/.next/server/app/api/connections/[service]/route_client-reference-manifest.js +1 -1
  53. package/.next/standalone/.next/server/app/api/connections/[service]/verify/route_client-reference-manifest.js +1 -1
  54. package/.next/standalone/.next/server/app/api/connections/route_client-reference-manifest.js +1 -1
  55. package/.next/standalone/.next/server/app/api/cron/tick/route_client-reference-manifest.js +1 -1
  56. package/.next/standalone/.next/server/app/api/dashboard/spaces/[id]/move/route_client-reference-manifest.js +1 -1
  57. package/.next/standalone/.next/server/app/api/dashboard/spaces/[id]/route_client-reference-manifest.js +1 -1
  58. package/.next/standalone/.next/server/app/api/dashboard/spaces/[id]/share-link/[linkId]/route_client-reference-manifest.js +1 -1
  59. package/.next/standalone/.next/server/app/api/dashboard/spaces/[id]/share-link/route_client-reference-manifest.js +1 -1
  60. package/.next/standalone/.next/server/app/api/dashboard/spaces/import/route_client-reference-manifest.js +1 -1
  61. package/.next/standalone/.next/server/app/api/dashboard/spaces/route_client-reference-manifest.js +1 -1
  62. package/.next/standalone/.next/server/app/api/disk/files/[id]/blob/route_client-reference-manifest.js +1 -1
  63. package/.next/standalone/.next/server/app/api/disk/files/[id]/route_client-reference-manifest.js +1 -1
  64. package/.next/standalone/.next/server/app/api/disk/files/[id]/transcribe/route_client-reference-manifest.js +1 -1
  65. package/.next/standalone/.next/server/app/api/disk/files/route_client-reference-manifest.js +1 -1
  66. package/.next/standalone/.next/server/app/api/disk/folders/route_client-reference-manifest.js +1 -1
  67. package/.next/standalone/.next/server/app/api/events/since/[cursor]/route_client-reference-manifest.js +1 -1
  68. package/.next/standalone/.next/server/app/api/events/stream/route_client-reference-manifest.js +1 -1
  69. package/.next/standalone/.next/server/app/api/fs/create-folder/route_client-reference-manifest.js +1 -1
  70. package/.next/standalone/.next/server/app/api/fs/pick-folder/route_client-reference-manifest.js +1 -1
  71. package/.next/standalone/.next/server/app/api/hail/engagements/[id]/blueprint/route_client-reference-manifest.js +1 -1
  72. package/.next/standalone/.next/server/app/api/hail/engagements/[id]/diagnostic/route_client-reference-manifest.js +1 -1
  73. package/.next/standalone/.next/server/app/api/hail/engagements/[id]/governance/route_client-reference-manifest.js +1 -1
  74. package/.next/standalone/.next/server/app/api/hail/engagements/[id]/interview/route_client-reference-manifest.js +1 -1
  75. package/.next/standalone/.next/server/app/api/hail/engagements/[id]/pilot/route_client-reference-manifest.js +1 -1
  76. package/.next/standalone/.next/server/app/api/hail/engagements/[id]/quarterly/route_client-reference-manifest.js +1 -1
  77. package/.next/standalone/.next/server/app/api/hail/engagements/[id]/route_client-reference-manifest.js +1 -1
  78. package/.next/standalone/.next/server/app/api/hail/engagements/[id]/setup-package/route_client-reference-manifest.js +1 -1
  79. package/.next/standalone/.next/server/app/api/hail/engagements/route_client-reference-manifest.js +1 -1
  80. package/.next/standalone/.next/server/app/api/hail/interviews/[id]/responses/route_client-reference-manifest.js +1 -1
  81. package/.next/standalone/.next/server/app/api/hail/interviews/[id]/route_client-reference-manifest.js +1 -1
  82. package/.next/standalone/.next/server/app/api/hail/setup-packages/[id]/apply/route_client-reference-manifest.js +1 -1
  83. package/.next/standalone/.next/server/app/api/hail/setup-packages/validate/route_client-reference-manifest.js +1 -1
  84. package/.next/standalone/.next/server/app/api/heartbeat/tick/route_client-reference-manifest.js +1 -1
  85. package/.next/standalone/.next/server/app/api/heartbeat/worker/route_client-reference-manifest.js +1 -1
  86. package/.next/standalone/.next/server/app/api/help/route_client-reference-manifest.js +1 -1
  87. package/.next/standalone/.next/server/app/api/hermes/jobs/[id]/events/route_client-reference-manifest.js +1 -1
  88. package/.next/standalone/.next/server/app/api/hermes/jobs/[id]/route_client-reference-manifest.js +1 -1
  89. package/.next/standalone/.next/server/app/api/hermes/jobs/route_client-reference-manifest.js +1 -1
  90. package/.next/standalone/.next/server/app/api/integrations/google/callback/route_client-reference-manifest.js +1 -1
  91. package/.next/standalone/.next/server/app/api/integrations/google/oauth/route_client-reference-manifest.js +1 -1
  92. package/.next/standalone/.next/server/app/api/marketplace/[id]/route_client-reference-manifest.js +1 -1
  93. package/.next/standalone/.next/server/app/api/marketplace/open-design/route_client-reference-manifest.js +1 -1
  94. package/.next/standalone/.next/server/app/api/marketplace/route_client-reference-manifest.js +1 -1
  95. package/.next/standalone/.next/server/app/api/mines/import-roots/route_client-reference-manifest.js +1 -1
  96. package/.next/standalone/.next/server/app/api/mines/portfolio/route_client-reference-manifest.js +1 -1
  97. package/.next/standalone/.next/server/app/api/mines/projects/[id]/chunks/route_client-reference-manifest.js +1 -1
  98. package/.next/standalone/.next/server/app/api/mines/projects/[id]/diligence/route_client-reference-manifest.js +1 -1
  99. package/.next/standalone/.next/server/app/api/mines/projects/[id]/import/route_client-reference-manifest.js +1 -1
  100. package/.next/standalone/.next/server/app/api/mines/projects/[id]/publish/route_client-reference-manifest.js +1 -1
  101. package/.next/standalone/.next/server/app/api/mines/projects/route_client-reference-manifest.js +1 -1
  102. package/.next/standalone/.next/server/app/api/missions/route_client-reference-manifest.js +1 -1
  103. package/.next/standalone/.next/server/app/api/models/route_client-reference-manifest.js +1 -1
  104. package/.next/standalone/.next/server/app/api/onboarding/blueprint/route_client-reference-manifest.js +1 -1
  105. package/.next/standalone/.next/server/app/api/onboarding/launch/route_client-reference-manifest.js +1 -1
  106. package/.next/standalone/.next/server/app/api/orchestrator/command/route_client-reference-manifest.js +1 -1
  107. package/.next/standalone/.next/server/app/api/orchestrator/stream/route.js +12 -12
  108. package/.next/standalone/.next/server/app/api/orchestrator/stream/route_client-reference-manifest.js +1 -1
  109. package/.next/standalone/.next/server/app/api/orchestrator/upload/route_client-reference-manifest.js +1 -1
  110. package/.next/standalone/.next/server/app/api/org/route_client-reference-manifest.js +1 -1
  111. package/.next/standalone/.next/server/app/api/orgs/[id]/invites/[inviteId]/route_client-reference-manifest.js +1 -1
  112. package/.next/standalone/.next/server/app/api/orgs/[id]/invites/route_client-reference-manifest.js +1 -1
  113. package/.next/standalone/.next/server/app/api/orgs/[id]/members/[userId]/role/route_client-reference-manifest.js +1 -1
  114. package/.next/standalone/.next/server/app/api/orgs/[id]/members/[userId]/route_client-reference-manifest.js +1 -1
  115. package/.next/standalone/.next/server/app/api/orgs/[id]/members/route_client-reference-manifest.js +1 -1
  116. package/.next/standalone/.next/server/app/api/orgs/[id]/route_client-reference-manifest.js +1 -1
  117. package/.next/standalone/.next/server/app/api/orgs/invites/pending/route_client-reference-manifest.js +1 -1
  118. package/.next/standalone/.next/server/app/api/orgs/join/route_client-reference-manifest.js +1 -1
  119. package/.next/standalone/.next/server/app/api/orgs/join-complete/route_client-reference-manifest.js +1 -1
  120. package/.next/standalone/.next/server/app/api/orgs/route_client-reference-manifest.js +1 -1
  121. package/.next/standalone/.next/server/app/api/printing-press/clis/route_client-reference-manifest.js +1 -1
  122. package/.next/standalone/.next/server/app/api/printing-press/install/route_client-reference-manifest.js +1 -1
  123. package/.next/standalone/.next/server/app/api/printing-press/security-mode/route_client-reference-manifest.js +1 -1
  124. package/.next/standalone/.next/server/app/api/privacy/config/route_client-reference-manifest.js +1 -1
  125. package/.next/standalone/.next/server/app/api/privacy/verify/route_client-reference-manifest.js +1 -1
  126. package/.next/standalone/.next/server/app/api/processes/[id]/route_client-reference-manifest.js +1 -1
  127. package/.next/standalone/.next/server/app/api/processes/[id]/share-link/route_client-reference-manifest.js +1 -1
  128. package/.next/standalone/.next/server/app/api/processes/[id]/stages/[stageId]/override/route_client-reference-manifest.js +1 -1
  129. package/.next/standalone/.next/server/app/api/processes/[id]/stages/[stageId]/retry/route_client-reference-manifest.js +1 -1
  130. package/.next/standalone/.next/server/app/api/processes/[id]/stages/[stageId]/submit/route_client-reference-manifest.js +1 -1
  131. package/.next/standalone/.next/server/app/api/processes/definitions/[slug]/route_client-reference-manifest.js +1 -1
  132. package/.next/standalone/.next/server/app/api/processes/definitions/[slug]/settings/route_client-reference-manifest.js +1 -1
  133. package/.next/standalone/.next/server/app/api/processes/definitions/route_client-reference-manifest.js +1 -1
  134. package/.next/standalone/.next/server/app/api/processes/definitions/validate/route_client-reference-manifest.js +1 -1
  135. package/.next/standalone/.next/server/app/api/processes/route_client-reference-manifest.js +1 -1
  136. package/.next/standalone/.next/server/app/api/processes/start-and-route/route_client-reference-manifest.js +1 -1
  137. package/.next/standalone/.next/server/app/api/projects/[slug]/library/route_client-reference-manifest.js +1 -1
  138. package/.next/standalone/.next/server/app/api/projects/[slug]/route_client-reference-manifest.js +1 -1
  139. package/.next/standalone/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
  140. package/.next/standalone/.next/server/app/api/runs/approve-claude-run/route_client-reference-manifest.js +1 -1
  141. package/.next/standalone/.next/server/app/api/runs/claude-code-dry-run/route_client-reference-manifest.js +1 -1
  142. package/.next/standalone/.next/server/app/api/runs/competitor-report/route_client-reference-manifest.js +1 -1
  143. package/.next/standalone/.next/server/app/api/runs/engine-ping/route_client-reference-manifest.js +1 -1
  144. package/.next/standalone/.next/server/app/api/runs/marketing-plan/route_client-reference-manifest.js +1 -1
  145. package/.next/standalone/.next/server/app/api/schedules/upsert/route_client-reference-manifest.js +1 -1
  146. package/.next/standalone/.next/server/app/api/secrets/[name]/route_client-reference-manifest.js +1 -1
  147. package/.next/standalone/.next/server/app/api/secrets/route_client-reference-manifest.js +1 -1
  148. package/.next/standalone/.next/server/app/api/settings/trust-mode/route_client-reference-manifest.js +1 -1
  149. package/.next/standalone/.next/server/app/api/share/[token]/otp/route_client-reference-manifest.js +1 -1
  150. package/.next/standalone/.next/server/app/api/share/[token]/route_client-reference-manifest.js +1 -1
  151. package/.next/standalone/.next/server/app/api/share/[token]/verify/route_client-reference-manifest.js +1 -1
  152. package/.next/standalone/.next/server/app/api/share/space/[token]/otp/route_client-reference-manifest.js +1 -1
  153. package/.next/standalone/.next/server/app/api/share/space/[token]/route_client-reference-manifest.js +1 -1
  154. package/.next/standalone/.next/server/app/api/share/space/[token]/verify/route_client-reference-manifest.js +1 -1
  155. package/.next/standalone/.next/server/app/api/shared/spaces/[id]/acl/route_client-reference-manifest.js +1 -1
  156. package/.next/standalone/.next/server/app/api/shared/spaces/publish/route_client-reference-manifest.js +1 -1
  157. package/.next/standalone/.next/server/app/api/shared/spaces/route_client-reference-manifest.js +1 -1
  158. package/.next/standalone/.next/server/app/api/shared/spaces/status/route_client-reference-manifest.js +1 -1
  159. package/.next/standalone/.next/server/app/api/shared/spaces/unpublish/route_client-reference-manifest.js +1 -1
  160. package/.next/standalone/.next/server/app/api/state/route_client-reference-manifest.js +1 -1
  161. package/.next/standalone/.next/server/app/api/system/update/route_client-reference-manifest.js +1 -1
  162. package/.next/standalone/.next/server/app/api/tasks/[id]/active-run/route_client-reference-manifest.js +1 -1
  163. package/.next/standalone/.next/server/app/api/tasks/[id]/attachments/route_client-reference-manifest.js +1 -1
  164. package/.next/standalone/.next/server/app/api/tasks/[id]/checklist/[itemId]/route_client-reference-manifest.js +1 -1
  165. package/.next/standalone/.next/server/app/api/tasks/[id]/checklist/route_client-reference-manifest.js +1 -1
  166. package/.next/standalone/.next/server/app/api/tasks/[id]/checkout/route_client-reference-manifest.js +1 -1
  167. package/.next/standalone/.next/server/app/api/tasks/[id]/children/route_client-reference-manifest.js +1 -1
  168. package/.next/standalone/.next/server/app/api/tasks/[id]/comments/route_client-reference-manifest.js +1 -1
  169. package/.next/standalone/.next/server/app/api/tasks/[id]/events/route_client-reference-manifest.js +1 -1
  170. package/.next/standalone/.next/server/app/api/tasks/[id]/live-runs/route_client-reference-manifest.js +1 -1
  171. package/.next/standalone/.next/server/app/api/tasks/[id]/release/route_client-reference-manifest.js +1 -1
  172. package/.next/standalone/.next/server/app/api/tasks/[id]/route_client-reference-manifest.js +1 -1
  173. package/.next/standalone/.next/server/app/api/tasks/route_client-reference-manifest.js +1 -1
  174. package/.next/standalone/.next/server/app/api/tool-allowlists/[id]/route_client-reference-manifest.js +1 -1
  175. package/.next/standalone/.next/server/app/api/tool-allowlists/route_client-reference-manifest.js +1 -1
  176. package/.next/standalone/.next/server/app/api/tool-egress/route_client-reference-manifest.js +1 -1
  177. package/.next/standalone/.next/server/app/api/tools/[name]/approve/route_client-reference-manifest.js +1 -1
  178. package/.next/standalone/.next/server/app/api/tools/[name]/route_client-reference-manifest.js +1 -1
  179. package/.next/standalone/.next/server/app/api/tools/route_client-reference-manifest.js +1 -1
  180. package/.next/standalone/.next/server/app/api/transcripts/route_client-reference-manifest.js +1 -1
  181. package/.next/standalone/.next/server/app/api/voice/providers/route_client-reference-manifest.js +1 -1
  182. package/.next/standalone/.next/server/app/api/voice/realtime/context/route_client-reference-manifest.js +1 -1
  183. package/.next/standalone/.next/server/app/api/voice/realtime/session/route_client-reference-manifest.js +1 -1
  184. package/.next/standalone/.next/server/app/api/voice/realtime/tool-result/route_client-reference-manifest.js +1 -1
  185. package/.next/standalone/.next/server/app/api/voice/realtime/tools/route_client-reference-manifest.js +1 -1
  186. package/.next/standalone/.next/server/app/api/voice/tts/route_client-reference-manifest.js +1 -1
  187. package/.next/standalone/.next/server/app/api/whatsapp/allowlist/route_client-reference-manifest.js +1 -1
  188. package/.next/standalone/.next/server/app/api/whatsapp/disconnect/route_client-reference-manifest.js +1 -1
  189. package/.next/standalone/.next/server/app/api/whatsapp/messages/route_client-reference-manifest.js +1 -1
  190. package/.next/standalone/.next/server/app/api/whatsapp/qr/route_client-reference-manifest.js +1 -1
  191. package/.next/standalone/.next/server/app/api/whatsapp/send/route_client-reference-manifest.js +1 -1
  192. package/.next/standalone/.next/server/app/api/whatsapp/status/route_client-reference-manifest.js +1 -1
  193. package/.next/standalone/.next/server/app/approvals/page.js +2 -2
  194. package/.next/standalone/.next/server/app/approvals/page_client-reference-manifest.js +1 -1
  195. package/.next/standalone/.next/server/app/architecture/page_client-reference-manifest.js +1 -1
  196. package/.next/standalone/.next/server/app/architecture.html +2 -2
  197. package/.next/standalone/.next/server/app/architecture.rsc +1 -1
  198. package/.next/standalone/.next/server/app/audit/live/page_client-reference-manifest.js +1 -1
  199. package/.next/standalone/.next/server/app/audit/page_client-reference-manifest.js +1 -1
  200. package/.next/standalone/.next/server/app/brand/page_client-reference-manifest.js +1 -1
  201. package/.next/standalone/.next/server/app/brand.html +1 -1
  202. package/.next/standalone/.next/server/app/brand.rsc +1 -1
  203. package/.next/standalone/.next/server/app/disk/page_client-reference-manifest.js +1 -1
  204. package/.next/standalone/.next/server/app/federated-ai/page_client-reference-manifest.js +1 -1
  205. package/.next/standalone/.next/server/app/federated-ai.html +2 -2
  206. package/.next/standalone/.next/server/app/federated-ai.rsc +1 -1
  207. package/.next/standalone/.next/server/app/hail/[id]/governance/page_client-reference-manifest.js +1 -1
  208. package/.next/standalone/.next/server/app/hail/[id]/interview/page.js +2 -2
  209. package/.next/standalone/.next/server/app/hail/[id]/interview/page_client-reference-manifest.js +1 -1
  210. package/.next/standalone/.next/server/app/hail/[id]/page.js +1 -1
  211. package/.next/standalone/.next/server/app/hail/[id]/page_client-reference-manifest.js +1 -1
  212. package/.next/standalone/.next/server/app/hail/[id]/setup/page.js +2 -2
  213. package/.next/standalone/.next/server/app/hail/[id]/setup/page_client-reference-manifest.js +1 -1
  214. package/.next/standalone/.next/server/app/hail/page.js +2 -2
  215. package/.next/standalone/.next/server/app/hail/page_client-reference-manifest.js +1 -1
  216. package/.next/standalone/.next/server/app/help/[slug]/page_client-reference-manifest.js +1 -1
  217. package/.next/standalone/.next/server/app/help/page_client-reference-manifest.js +1 -1
  218. package/.next/standalone/.next/server/app/index.html +2 -2
  219. package/.next/standalone/.next/server/app/index.rsc +1 -1
  220. package/.next/standalone/.next/server/app/join/page_client-reference-manifest.js +1 -1
  221. package/.next/standalone/.next/server/app/join.html +1 -1
  222. package/.next/standalone/.next/server/app/join.rsc +1 -1
  223. package/.next/standalone/.next/server/app/login/page_client-reference-manifest.js +1 -1
  224. package/.next/standalone/.next/server/app/marketplace/page.js +2 -2
  225. package/.next/standalone/.next/server/app/marketplace/page_client-reference-manifest.js +1 -1
  226. package/.next/standalone/.next/server/app/mines/[projectId]/page_client-reference-manifest.js +1 -1
  227. package/.next/standalone/.next/server/app/mines/[projectId]/results/page_client-reference-manifest.js +1 -1
  228. package/.next/standalone/.next/server/app/mines/page_client-reference-manifest.js +1 -1
  229. package/.next/standalone/.next/server/app/missions/page.js +1 -1
  230. package/.next/standalone/.next/server/app/missions/page_client-reference-manifest.js +1 -1
  231. package/.next/standalone/.next/server/app/onboarding/org/page_client-reference-manifest.js +1 -1
  232. package/.next/standalone/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
  233. package/.next/standalone/.next/server/app/onboarding.html +2 -2
  234. package/.next/standalone/.next/server/app/onboarding.rsc +1 -1
  235. package/.next/standalone/.next/server/app/org/page.js +1 -1
  236. package/.next/standalone/.next/server/app/org/page.js.nft.json +1 -1
  237. package/.next/standalone/.next/server/app/org/page_client-reference-manifest.js +1 -1
  238. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  239. package/.next/standalone/.next/server/app/projects/[slug]/log/page_client-reference-manifest.js +1 -1
  240. package/.next/standalone/.next/server/app/projects/[slug]/page_client-reference-manifest.js +1 -1
  241. package/.next/standalone/.next/server/app/projects/new/page.js +1 -1
  242. package/.next/standalone/.next/server/app/projects/new/page_client-reference-manifest.js +1 -1
  243. package/.next/standalone/.next/server/app/projects/new.html +1 -1
  244. package/.next/standalone/.next/server/app/projects/new.rsc +2 -2
  245. package/.next/standalone/.next/server/app/projects/page.js +30 -30
  246. package/.next/standalone/.next/server/app/projects/page_client-reference-manifest.js +1 -1
  247. package/.next/standalone/.next/server/app/reports/[file]/route_client-reference-manifest.js +1 -1
  248. package/.next/standalone/.next/server/app/reports/page_client-reference-manifest.js +1 -1
  249. package/.next/standalone/.next/server/app/runtime/page_client-reference-manifest.js +1 -1
  250. package/.next/standalone/.next/server/app/schedules/page.js +2 -2
  251. package/.next/standalone/.next/server/app/schedules/page_client-reference-manifest.js +1 -1
  252. package/.next/standalone/.next/server/app/settings/account/page_client-reference-manifest.js +1 -1
  253. package/.next/standalone/.next/server/app/settings/advanced/page_client-reference-manifest.js +1 -1
  254. package/.next/standalone/.next/server/app/settings/appearance/page_client-reference-manifest.js +1 -1
  255. package/.next/standalone/.next/server/app/settings/brand/page_client-reference-manifest.js +1 -1
  256. package/.next/standalone/.next/server/app/settings/brand.html +2 -2
  257. package/.next/standalone/.next/server/app/settings/brand.rsc +1 -1
  258. package/.next/standalone/.next/server/app/settings/connectors/page_client-reference-manifest.js +1 -1
  259. package/.next/standalone/.next/server/app/settings/engines/page_client-reference-manifest.js +1 -1
  260. package/.next/standalone/.next/server/app/settings/onboarding/page_client-reference-manifest.js +1 -1
  261. package/.next/standalone/.next/server/app/settings/onboarding.html +2 -2
  262. package/.next/standalone/.next/server/app/settings/onboarding.rsc +1 -1
  263. package/.next/standalone/.next/server/app/settings/organization/page.js +1 -1
  264. package/.next/standalone/.next/server/app/settings/organization/page.js.nft.json +1 -1
  265. package/.next/standalone/.next/server/app/settings/organization/page_client-reference-manifest.js +1 -1
  266. package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  267. package/.next/standalone/.next/server/app/settings/runtime/page_client-reference-manifest.js +1 -1
  268. package/.next/standalone/.next/server/app/settings/team/page_client-reference-manifest.js +1 -1
  269. package/.next/standalone/.next/server/app/settings/tools/page_client-reference-manifest.js +1 -1
  270. package/.next/standalone/.next/server/app/settings.html +2 -2
  271. package/.next/standalone/.next/server/app/settings.rsc +1 -1
  272. package/.next/standalone/.next/server/app/share/[token]/page_client-reference-manifest.js +1 -1
  273. package/.next/standalone/.next/server/app/share/space/[token]/page_client-reference-manifest.js +1 -1
  274. package/.next/standalone/.next/server/app/tasks/[id]/page.js +1 -1
  275. package/.next/standalone/.next/server/app/tasks/[id]/page_client-reference-manifest.js +1 -1
  276. package/.next/standalone/.next/server/app/tasks/page.js +2 -2
  277. package/.next/standalone/.next/server/app/tasks/page_client-reference-manifest.js +1 -1
  278. package/.next/standalone/.next/server/app/team/[agentId]/page_client-reference-manifest.js +1 -1
  279. package/.next/standalone/.next/server/app/team/page_client-reference-manifest.js +1 -1
  280. package/.next/standalone/.next/server/app/tools/page_client-reference-manifest.js +1 -1
  281. package/.next/standalone/.next/server/app/whatsapp/page_client-reference-manifest.js +1 -1
  282. package/.next/standalone/.next/server/app/whatsapp.html +1 -1
  283. package/.next/standalone/.next/server/app/whatsapp.rsc +1 -1
  284. package/.next/standalone/.next/server/app/workflows/[caseId]/page_client-reference-manifest.js +1 -1
  285. package/.next/standalone/.next/server/app/workflows/new/[caseId]/page_client-reference-manifest.js +1 -1
  286. package/.next/standalone/.next/server/app/workflows/new/definition/page_client-reference-manifest.js +1 -1
  287. package/.next/standalone/.next/server/app/workflows/new/page_client-reference-manifest.js +1 -1
  288. package/.next/standalone/.next/server/app/workflows/page_client-reference-manifest.js +1 -1
  289. package/.next/standalone/.next/server/app/workflows/share/[caseId]/page_client-reference-manifest.js +1 -1
  290. package/.next/standalone/.next/server/app-paths-manifest.json +83 -83
  291. package/.next/standalone/.next/server/chunks/{8332.js → 1092.js} +1 -1
  292. package/.next/standalone/.next/server/chunks/1699.js +44 -44
  293. package/.next/standalone/.next/server/functions-config-manifest.json +46 -46
  294. package/.next/standalone/.next/server/middleware-build-manifest.js +1 -1
  295. package/.next/standalone/.next/server/middleware-manifest.json +5 -5
  296. package/.next/standalone/.next/server/pages/404.html +1 -1
  297. package/.next/standalone/.next/server/pages/500.html +1 -1
  298. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  299. package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
  300. package/.next/standalone/.next/static/chunks/app/projects/page-2166c214f854766e.js +1 -0
  301. package/.next/standalone/.next/static/chunks/{webpack-86ee88827adb756d.js → webpack-0cfb048137bd7fce.js} +1 -1
  302. package/.next/standalone/CHANGELOG.md +21 -0
  303. package/.next/standalone/data/.artifacts-migrated-v1 +1 -1
  304. package/.next/standalone/data/.default-project-seeded +1 -1
  305. package/.next/standalone/data/madarx.sqlite +0 -0
  306. package/.next/standalone/data/madarx.sqlite-shm +0 -0
  307. package/.next/standalone/data/madarx.sqlite-wal +0 -0
  308. package/.next/standalone/package.json +4 -1
  309. package/.next/standalone/workspace/agents/ops-agent/skills.md +24 -0
  310. package/.next/standalone/workspace/agents/tool-smith-agent/skills.md +24 -0
  311. package/.next/static/chunks/app/projects/page-2166c214f854766e.js +1 -0
  312. package/.next/static/chunks/{webpack-86ee88827adb756d.js → webpack-0cfb048137bd7fce.js} +1 -1
  313. package/CHANGELOG.md +21 -0
  314. package/ai-docs/key-constraints.md +5 -0
  315. package/app/api/orchestrator/stream/route.js +39 -3
  316. package/lib/agent-engines.js +4 -1
  317. package/lib/agent-runner.js +24 -0
  318. package/lib/cli/banner.js +200 -21
  319. package/lib/cli/run.js +33 -11
  320. package/lib/cli/splash.js +120 -0
  321. package/lib/engine-capabilities.js +92 -0
  322. package/lib/fabricated-tool-output.js +77 -0
  323. package/lib/marketplace-seeds.js +141 -3
  324. package/lib/runtime.js +52 -3
  325. package/lib/seeds.js +5 -1
  326. package/lib/tools/registry.js +20 -0
  327. package/package.json +4 -1
  328. package/scripts/postinstall-splash.mjs +81 -0
  329. package/scripts/preview-banner.mjs +24 -0
  330. package/.next/standalone/.next/static/chunks/app/projects/page-e51d5f90e549d669.js +0 -1
  331. package/.next/static/chunks/app/projects/page-e51d5f90e549d669.js +0 -1
  332. /package/.next/standalone/.next/static/{61oz5Ag6h45ZPi6uZn01m → cR6E_4o8_rHXujVNesWiZ}/_buildManifest.js +0 -0
  333. /package/.next/standalone/.next/static/{61oz5Ag6h45ZPi6uZn01m → cR6E_4o8_rHXujVNesWiZ}/_ssgManifest.js +0 -0
  334. /package/.next/static/{61oz5Ag6h45ZPi6uZn01m → cR6E_4o8_rHXujVNesWiZ}/_buildManifest.js +0 -0
  335. /package/.next/static/{61oz5Ag6h45ZPi6uZn01m → cR6E_4o8_rHXujVNesWiZ}/_ssgManifest.js +0 -0
@@ -161,6 +161,99 @@ const SKILL_SEEDS = [
161
161
  },
162
162
  ];
163
163
 
164
+ // Business-default skill pack — the capabilities most teams reach for first, so
165
+ // a fresh agent can do real work out of the box (research, comms, documents,
166
+ // data, web). Each is a builtin skill catalog item backed by the default tools
167
+ // (web/email/calendar/files/supabase/browser). These are what the banner
168
+ // showcases; the design/QA skills above stay in the marketplace but are not the
169
+ // default highlight reel.
170
+ const BUSINESS_SKILL_SEEDS = [
171
+ {
172
+ slug: 'market-research', title: 'Market Research', category: 'research',
173
+ description: 'Research any market, company, or topic across the web and deliver a cited, structured brief.',
174
+ tools: ['web_search', 'web_fetch', 'file_write'], risk_summary: 'Read-only research; writes only the report file.',
175
+ tags: ['research', 'web', 'brief'], invocation: '/research',
176
+ trigger_examples: ['research this market', 'competitive landscape for X', 'brief me on company Y'],
177
+ },
178
+ {
179
+ slug: 'competitor-watch', title: 'Competitor Watch', category: 'research',
180
+ description: 'Track competitor pricing, features, and news on a schedule and alert you when something changes.',
181
+ tools: ['web_fetch', 'web_extract', 'email_send'], risk_summary: 'Read-only monitoring; sends a summary email.',
182
+ tags: ['research', 'monitoring', 'competitive'], invocation: '/watch',
183
+ trigger_examples: ['watch competitor pricing', 'alert me when X changes', 'track this page weekly'],
184
+ },
185
+ {
186
+ slug: 'inbox-triage', title: 'Inbox Triage', category: 'comms',
187
+ description: 'Summarize, prioritize, and draft replies across your inbox so you act on what matters first.',
188
+ tools: ['gmail_messages_list', 'gmail_thread_read', 'email_send'], risk_summary: 'Drafts replies; sending is approval-gated.',
189
+ tags: ['email', 'inbox', 'comms'], invocation: '/inbox',
190
+ trigger_examples: ['triage my inbox', 'summarize unread email', 'draft replies'],
191
+ },
192
+ {
193
+ slug: 'meeting-scheduler', title: 'Meeting Scheduler', category: 'comms',
194
+ description: 'Find times, schedule meetings, and send invites from your calendar and email.',
195
+ tools: ['calendar_events_list', 'calendar_event_read', 'email_send'], risk_summary: 'Proposes times; invites are approval-gated.',
196
+ tags: ['calendar', 'scheduling', 'comms'], invocation: '/schedule-meeting',
197
+ trigger_examples: ['schedule a meeting', 'find a time with X', 'book a call next week'],
198
+ },
199
+ {
200
+ slug: 'document-extract', title: 'Document Extraction', category: 'documents',
201
+ description: 'Pull structured data and key facts from PDFs, documents, and audio into clean, usable output.',
202
+ tools: ['file_read', 'transcribe_audio', 'file_write'], risk_summary: 'Read-only extraction; writes only the output file.',
203
+ tags: ['documents', 'extraction', 'pdf'], invocation: '/extract',
204
+ trigger_examples: ['extract data from this PDF', 'pull the numbers from these docs', 'transcribe this audio'],
205
+ },
206
+ {
207
+ slug: 'report-builder', title: 'Report Builder', category: 'documents',
208
+ description: 'Turn raw data and notes into a polished, formatted report or one-pager ready to share.',
209
+ tools: ['file_read', 'file_write'], risk_summary: 'Generates a document; no external writes.',
210
+ tags: ['documents', 'reporting', 'writing'], invocation: '/report',
211
+ trigger_examples: ['build a report from this data', 'write a one-pager', 'summarize into a deck outline'],
212
+ },
213
+ {
214
+ slug: 'database-query', title: 'Database Q&A', category: 'data',
215
+ description: 'Ask questions of your database in plain English and get answers, tables, and charts.',
216
+ tools: ['supabase_rest_select', 'supabase_sql'], risk_summary: 'Read-only queries by default; writes are approval-gated.',
217
+ tags: ['data', 'sql', 'analytics'], invocation: '/ask-data',
218
+ trigger_examples: ['how many orders last month', 'query the users table', 'top customers by revenue'],
219
+ },
220
+ {
221
+ slug: 'spreadsheet-analysis', title: 'Spreadsheet Analysis', category: 'data',
222
+ description: 'Clean, analyze, and summarize spreadsheets and CSVs — pivots, trends, and outliers.',
223
+ tools: ['file_read', 'file_write'], risk_summary: 'Local file analysis; no external writes.',
224
+ tags: ['data', 'spreadsheet', 'csv'], invocation: '/analyze-sheet',
225
+ trigger_examples: ['analyze this spreadsheet', 'summarize this CSV', 'find trends in this data'],
226
+ },
227
+ {
228
+ slug: 'web-automation', title: 'Web Automation', category: 'web',
229
+ description: 'Fill forms, extract data, and run repetitive flows in a real browser, end to end.',
230
+ tools: ['browser_open', 'browser_act', 'browser_extract'], risk_summary: 'Browser actions are bounded and audited.',
231
+ tags: ['web', 'automation', 'browser'], invocation: '/automate-web',
232
+ trigger_examples: ['automate this form', 'scrape this site', 'run this flow for each row'],
233
+ },
234
+ ];
235
+
236
+ function buildBusinessSkillSeed(s) {
237
+ return {
238
+ slug: s.slug,
239
+ title: s.title,
240
+ description: s.description,
241
+ category: s.category,
242
+ author: 'madarx',
243
+ source_kind: 'builtin',
244
+ source_url: null,
245
+ version: null,
246
+ risk_summary: s.risk_summary,
247
+ tags: s.tags,
248
+ manifest: {
249
+ invocation: s.invocation,
250
+ default: true,
251
+ uses_tools: s.tools,
252
+ trigger_examples: s.trigger_examples,
253
+ },
254
+ };
255
+ }
256
+
164
257
  const BUNDLE_SEEDS = [
165
258
  {
166
259
  slug: 'gstack',
@@ -240,10 +333,13 @@ function upsertItem(db, kind, seed) {
240
333
  new Date().toISOString(),
241
334
  );
242
335
 
336
+ // Default-on capabilities (manifest.default) seed as installed so the
337
+ // marketplace reflects what the agent ships with out of the box.
338
+ const installedDefault = seed?.manifest?.default ? 1 : 0;
243
339
  db.prepare(`
244
- INSERT OR IGNORE INTO marketplace_installations (item_id, installed)
245
- VALUES (?, 0)
246
- `).run(id);
340
+ INSERT OR IGNORE INTO marketplace_installations (item_id, installed, installed_at)
341
+ VALUES (?, ?, ?)
342
+ `).run(id, installedDefault, installedDefault ? new Date().toISOString() : null);
247
343
  }
248
344
  }
249
345
 
@@ -288,6 +384,7 @@ const MINES_MODULE_SEED = {
288
384
 
289
385
  export function seedMarketplaceItems(db) {
290
386
  try {
387
+ for (const s of BUSINESS_SKILL_SEEDS) upsertItem(db, 'skill', buildBusinessSkillSeed(s));
291
388
  for (const seed of SKILL_SEEDS) upsertItem(db, 'skill', seed);
292
389
  for (const seed of BUNDLE_SEEDS) upsertItem(db, 'bundle', seed);
293
390
  for (const curated of OPEN_DESIGN_CURATED_SKILLS) {
@@ -302,6 +399,47 @@ export function seedMarketplaceItems(db) {
302
399
  }
303
400
  }
304
401
 
402
+ // The default business skills, grouped by category for the CLI banner showcase.
403
+ export const DEFAULT_SKILL_SLUGS = BUSINESS_SKILL_SEEDS.map(s => s.slug);
404
+ const DEFAULT_SKILL_CATEGORY_ORDER = ['research', 'comms', 'documents', 'data', 'web'];
405
+ export function listDefaultSkillGroups() {
406
+ const byCat = new Map();
407
+ for (const s of BUSINESS_SKILL_SEEDS) {
408
+ if (!byCat.has(s.category)) byCat.set(s.category, []);
409
+ byCat.get(s.category).push(s.slug);
410
+ }
411
+ return DEFAULT_SKILL_CATEGORY_ORDER
412
+ .filter(c => byCat.has(c))
413
+ .map(category => ({ category, count: byCat.get(category).length, names: byCat.get(category) }));
414
+ }
415
+
416
+ /**
417
+ * The default business skills rendered as a `skills.md` section — injected into
418
+ * an agent's skills file so the runtime (which reads skills.md) actually surfaces
419
+ * them. Grouped by category, with invocation, description, and the tools each
420
+ * leans on.
421
+ */
422
+ export function defaultSkillsMarkdown() {
423
+ const titleCase = (s) => s.charAt(0).toUpperCase() + s.slice(1);
424
+ const lines = [
425
+ '## Default skills',
426
+ '',
427
+ 'You ship with these ready-to-use business skills. Reach for them by intent;',
428
+ 'each is backed by your enabled tools and stays within the usual approval gates.',
429
+ '',
430
+ ];
431
+ for (const g of listDefaultSkillGroups()) {
432
+ lines.push(`### ${titleCase(g.category)}`);
433
+ for (const slug of g.names) {
434
+ const s = BUSINESS_SKILL_SEEDS.find((x) => x.slug === slug);
435
+ if (!s) continue;
436
+ lines.push(`- **${s.title}** (\`${s.invocation}\`) — ${s.description} _Tools: ${s.tools.join(', ')}._`);
437
+ }
438
+ lines.push('');
439
+ }
440
+ return lines.join('\n').trimEnd() + '\n';
441
+ }
442
+
305
443
  export const PHASE1_SKILL_SLUGS = SKILL_SEEDS.map(s => s.slug);
306
444
  export const PHASE1_BUNDLE_SLUGS = BUNDLE_SEEDS.map(s => s.slug);
307
445
  export const OPEN_DESIGN_SKILL_SLUGS = OPEN_DESIGN_CURATED_SKILLS.map(s => `open-design-${s.slug}`);
package/lib/runtime.js CHANGED
@@ -13,6 +13,7 @@ import { defaultModelForEngine, normalizeAgentEngine } from './agent-engines.js'
13
13
  import { DEFAULT_PROJECT_ID, appendProjectChangelog, getProject } from './projects.js';
14
14
  import { listActivity, listTasks, reportingSnapshot } from './delegation.js';
15
15
  import { getMainAgentTrustMode } from './tools/registry.js';
16
+ import { defaultSkillsMarkdown } from './marketplace-seeds.js';
16
17
  import { publishLiveEvent, publishStateChanged } from './live-events.js';
17
18
  import { resolveTargetSpace } from './dashboard-spaces.js';
18
19
 
@@ -777,9 +778,17 @@ function writeAgentFiles(agent) {
777
778
  fs.writeFileSync(path.join(dir, 'AGENTS.md'),
778
779
  `# ${agent.name}\n\nParent orchestrator: madarX Main Agent.\n\n## Mission\n${agent.mission}\n\n## Runtime\n- Engine: ${agent.engine}\n- Model: ${agent.model || 'default'}\n- Schedule: ${agent.schedule}\n- Approval: human-in-loop before external sends/posts/deployments.\n\n## Operating rules\n1. Work only inside the approved local project/workspace unless the orchestrator grants a path.\n2. Use web/social/email tools in read or draft mode first.\n3. Save artifacts under your project's artifacts folder (workspace/projects/<slug>/artifacts/).\n4. Never send emails, WhatsApp messages, social posts, deployments, purchases, or destructive commands without explicit approval.\n5. Update heartbeat.json after each run.\n`);
779
780
 
780
- const skillsMarkdown = typeof agent.skills_markdown === 'string' && agent.skills_markdown.trim()
781
- ? agent.skills_markdown.trim() + '\n'
782
- : `# ${agent.name} Skills\n\n## Mission\n${agent.mission}\n\n## Core playbooks\n- Plan each run from the mission, then execute against the ${agent.schedule} window.\n- Use only the approved tools (${(agent.tools || []).join(', ') || 'web-search, browser, files'}); never reach for tools the owner has not enabled.\n- Save every output as a local artifact under your project's artifacts folder (workspace/projects/<slug>/artifacts/).\n- Hand off any external send, post, deployment, or destructive command to the main agent for approval.\n- After each run, update heartbeat.json with status, summary, and next-run plan.\n`;
781
+ let skillsMarkdown;
782
+ if (typeof agent.skills_markdown === 'string' && agent.skills_markdown.trim()) {
783
+ skillsMarkdown = agent.skills_markdown.trim() + '\n';
784
+ } else {
785
+ // Default skills.md: mission + core playbooks + the business-default skill
786
+ // pack so a fresh agent can do real work out of the box (the runtime reads
787
+ // this file into the prompt; the default skills are gated by the same tools).
788
+ let defaultSkills = '';
789
+ try { defaultSkills = '\n' + defaultSkillsMarkdown(); } catch { /* optional */ }
790
+ skillsMarkdown = `# ${agent.name} Skills\n\n## Mission\n${agent.mission}\n\n## Core playbooks\n- Plan each run from the mission, then execute against the ${agent.schedule} window.\n- Use only the approved tools (${(agent.tools || []).join(', ') || 'web-search, browser, files'}); never reach for tools the owner has not enabled.\n- Save every output as a local artifact under your project's artifacts folder (workspace/projects/<slug>/artifacts/).\n- Hand off any external send, post, deployment, or destructive command to the main agent for approval.\n- After each run, update heartbeat.json with status, summary, and next-run plan.\n${defaultSkills}`;
791
+ }
783
792
  fs.writeFileSync(path.join(dir, 'skills.md'), skillsMarkdown);
784
793
 
785
794
  fs.writeFileSync(path.join(dir, 'tools.md'),
@@ -806,6 +815,46 @@ function writeAgentFiles(agent) {
806
815
  return files;
807
816
  }
808
817
 
818
+ /**
819
+ * One-time migration: refresh the business-default skills block in existing
820
+ * agents' skills.md. Only touches files that are the GENERATED DEFAULT (they
821
+ * carry the `## Core playbooks` header) — a user-customized skills.md is left
822
+ * untouched. Idempotent: re-running replaces an existing `## Default skills`
823
+ * section in place rather than appending, and is a no-op once current.
824
+ *
825
+ * @returns {{ scanned: number, updated: number }}
826
+ */
827
+ export function migrateDefaultAgentSkills() {
828
+ let scanned = 0;
829
+ let updated = 0;
830
+ let block;
831
+ try { block = defaultSkillsMarkdown().trimEnd() + '\n'; } catch { return { scanned, updated }; }
832
+ let dirs = [];
833
+ try { dirs = fs.readdirSync(AGENTS_DIR, { withFileTypes: true }).filter(d => d.isDirectory()); } catch { return { scanned, updated }; }
834
+
835
+ for (const d of dirs) {
836
+ const p = path.join(AGENTS_DIR, d.name, 'skills.md');
837
+ let body;
838
+ try { body = fs.readFileSync(p, 'utf8'); } catch { continue; }
839
+ scanned++;
840
+ // Only refresh the generated-default shape; never overwrite custom content.
841
+ if (!body.includes('## Core playbooks')) continue;
842
+
843
+ let next;
844
+ const marker = '\n## Default skills';
845
+ const idx = body.indexOf(marker);
846
+ if (idx >= 0) {
847
+ next = body.slice(0, idx).trimEnd() + '\n\n' + block; // replace old section
848
+ } else {
849
+ next = body.trimEnd() + '\n\n' + block; // append, was missing
850
+ }
851
+ if (next !== body) {
852
+ try { fs.writeFileSync(p, next); updated++; } catch { /* best-effort */ }
853
+ }
854
+ }
855
+ return { scanned, updated };
856
+ }
857
+
809
858
  export function createAgent(payload = {}) {
810
859
  const db = getDb();
811
860
  const name = payload.name || 'Client Workspace Custom Agent';
package/lib/seeds.js CHANGED
@@ -5,7 +5,7 @@ import { ROOT } from './paths.js';
5
5
  import { seedMarketplaceItems } from './marketplace-seeds.js';
6
6
  import { ensureDefaultProject } from './projects.js';
7
7
  import { seedAgentTemplates, installAgentTemplate } from './agent-templates.js';
8
- import { ensureOpsAgent, createArtifact } from './runtime.js';
8
+ import { ensureOpsAgent, createArtifact, migrateDefaultAgentSkills } from './runtime.js';
9
9
  import { renderChangelogHtml } from './artifact-format.js';
10
10
  import { migrateArtifactsToProjects } from './artifact-migration.js';
11
11
  import { runAuthV1Migration } from '../scripts/migrate-auth-v1.mjs';
@@ -538,6 +538,10 @@ export function seedDefaults(db) {
538
538
  // Auto-seed the Tool Smith agent so request_capability delegation has a target.
539
539
  seedToolSmithAgentIfMissing(db);
540
540
 
541
+ // Refresh the business-default skills in existing default-shaped skills.md
542
+ // files (no-op for fresh installs and user-customized agents). Idempotent.
543
+ try { migrateDefaultAgentSkills(); } catch (err) { console.warn('[seeds] migrateDefaultAgentSkills failed:', err?.message || err); }
544
+
541
545
  // Dashboard spaces: seed the 'default' space and backfill any NULL-space
542
546
  // artifacts so the dashboard never has to reconcile orphans client-side.
543
547
  // Idempotent. Must run after schema migration adds artifacts.space_id.
@@ -1971,6 +1971,26 @@ export function listPrimitiveToolMeta() {
1971
1971
  return { names, riskByName };
1972
1972
  }
1973
1973
 
1974
+ /**
1975
+ * Static tool catalog grouped by category — pure read of MARKETPLACE_TOOLS, no
1976
+ * DB, no install state. Used by the CLI banner (which runs in the DB-free
1977
+ * supervisor) to render a grouped capability list à la Hermes.
1978
+ *
1979
+ * @returns {Array<{category: string, count: number, names: string[]}>}
1980
+ * sorted by descending count.
1981
+ */
1982
+ export function listToolCategories() {
1983
+ const byCat = new Map();
1984
+ for (const t of MARKETPLACE_TOOLS) {
1985
+ const cat = t.category || 'other';
1986
+ if (!byCat.has(cat)) byCat.set(cat, []);
1987
+ byCat.get(cat).push(t.name);
1988
+ }
1989
+ return [...byCat.entries()]
1990
+ .map(([category, names]) => ({ category, count: names.length, names }))
1991
+ .sort((a, b) => b.count - a.count || a.category.localeCompare(b.category));
1992
+ }
1993
+
1974
1994
  /**
1975
1995
  * Dynamic tool descriptors (composites + connector endpoints), normalized into
1976
1996
  * the SAME shape as a static row so every downstream consumer (executeRegistryTool
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "madarx",
3
- "version": "2.12.0",
3
+ "version": "2.13.0",
4
4
  "type": "module",
5
5
  "description": "Madarx OS — Next.js product with SQLite-backed runtime, scheduled cron daemon, and approval-gated local runners.",
6
6
  "license": "MIT",
@@ -44,6 +44,9 @@
44
44
  "prepublishOnly": "npm run build",
45
45
  "build": "NODE_OPTIONS=--no-warnings next build",
46
46
  "postbuild": "node --no-warnings scripts/postbuild-standalone.mjs",
47
+ "postinstall": "node --no-warnings scripts/postinstall-splash.mjs",
48
+ "splash": "MADARX_FORCE_SPLASH=1 FORCE_COLOR=1 node --no-warnings scripts/postinstall-splash.mjs",
49
+ "banner": "FORCE_COLOR=1 node --no-warnings scripts/preview-banner.mjs",
47
50
  "start": "next start -p 8787 -H 127.0.0.1",
48
51
  "test": "node --no-warnings --test tests/*.test.js",
49
52
  "daemon": "node --no-warnings --env-file-if-exists=.env.local scripts/cron-daemon.mjs",
@@ -0,0 +1,81 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Post-install splash for `npm i -g madarx`.
4
+ *
5
+ * Prints the madarX wordmark, runs a short animated sequence over REAL read-only
6
+ * checks (no fake sleeps, no side effects — it never creates the data home or
7
+ * touches the DB), and closes on a framed next-steps panel.
8
+ *
9
+ * Guards (an install must NEVER fail or spam because of a splash):
10
+ * - skips entirely on non-TTY, NO_COLOR, CI, or MADARX_NO_SPLASH=1
11
+ * - skips when madarx is installed as a dependency of another package
12
+ * (only the top-level / global install gets the splash)
13
+ * - wraps everything; any error exits 0 so `npm install` is never broken
14
+ */
15
+
16
+ import path from 'node:path';
17
+ import fs from 'node:fs';
18
+ import { fileURLToPath } from 'node:url';
19
+
20
+ const PKG_ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
21
+
22
+ function shouldSkip() {
23
+ // Force bypass for the `npm run splash` preview (renders regardless of TTY/global).
24
+ if (process.env.MADARX_FORCE_SPLASH === '1') return false;
25
+ if (process.env.MADARX_NO_SPLASH === '1') return true;
26
+ if (process.env.NO_COLOR) return true;
27
+ if (process.env.CI) return true;
28
+ if (!process.stdout || !process.stdout.isTTY) return true;
29
+ // Only the global install (`npm i -g madarx`) gets the splash. A local/dev
30
+ // `npm install` in the checkout, or a transitive dep install, stays silent —
31
+ // npm sets npm_config_global=true only for `-g`.
32
+ if (process.env.npm_config_global !== 'true') return true;
33
+ return false;
34
+ }
35
+
36
+ async function main() {
37
+ if (shouldSkip()) return;
38
+
39
+ // Lazy import so a skipped run does zero work and pulls no ANSI machinery.
40
+ const { wordmark, fg, _palette: P } = await import('../lib/cli/banner.js');
41
+ const { bootSequence, dateline } = await import('../lib/cli/splash.js');
42
+
43
+ let version = '0.0.0';
44
+ try { version = JSON.parse(fs.readFileSync(path.join(PKG_ROOT, 'package.json'), 'utf8')).version || version; } catch {}
45
+
46
+ const home = process.env.MADARX_HOME
47
+ || (process.env.HOME ? path.join(process.env.HOME, '.madarx') : '~/.madarx');
48
+
49
+ // $ install context line (Muted), then the wordmark + Muted subtitle.
50
+ console.log();
51
+ console.log(' ' + fg(P.muted, '$ npm i -g madarx'));
52
+ console.log();
53
+ console.log(wordmark());
54
+ console.log();
55
+ console.log(' ' + fg(P.muted, 'local-first agent runtime'));
56
+ console.log();
57
+
58
+ // Honest, read-only checks — the spinner spins over genuine work, never a
59
+ // timer; nothing here creates the data home or opens the DB (setup does that).
60
+ await bootSequence([
61
+ { label: 'Resolving madarX from npm registry', work: async () => true /* npm just did */ },
62
+ {
63
+ label: `Verifying Node ${process.version} (node:sqlite needs ≥ 22.5)`,
64
+ work: async () => {
65
+ const [maj, min] = process.versions.node.split('.').map(Number);
66
+ if (maj < 22 || (maj === 22 && min < 5)) throw new Error('Node >= 22.5 required');
67
+ },
68
+ },
69
+ { label: 'Locating prebuilt web tier .next/standalone', work: async () => fs.existsSync(path.join(PKG_ROOT, '.next', 'standalone', 'server.js')) },
70
+ { label: 'Registering engines claude-code · anthropic · ollama · codex · hermes', work: async () => fs.existsSync(path.join(PKG_ROOT, 'lib', 'agent-engines.js')) },
71
+ { label: `Data home ${home}`, work: async () => fs.existsSync(home) /* read-only; setup creates it */ },
72
+ { label: 'Linking madarx CLI → lib/cli', work: async () => fs.existsSync(path.join(PKG_ROOT, 'bin', 'madarx.mjs')) },
73
+ ]).catch(() => { /* a failed check still shows ✗; never break the install */ });
74
+
75
+ console.log();
76
+ console.log(' ' + fg(P.muted, 'run') + ' ' + fg(P.mars, 'madarx setup') + ' ' + fg(P.muted, 'to configure, then') + ' ' + fg(P.mars, 'madarx') + ' ' + fg(P.muted, 'to launch'));
77
+ console.log(' ' + dateline(version));
78
+ console.log();
79
+ }
80
+
81
+ main().catch(() => {}).finally(() => process.exit(0));
@@ -0,0 +1,24 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Preview the `madarx` hero boot banner with live catalog data, without booting
4
+ * the stack. Dev-only: `npm run banner`.
5
+ */
6
+ import os from 'node:os';
7
+ import path from 'node:path';
8
+ import { renderHeroBanner } from '../lib/cli/banner.js';
9
+ import { listToolCategories, MARKETPLACE_TOOL_COUNT } from '../lib/tools/registry.js';
10
+ import * as S from '../lib/marketplace-seeds.js';
11
+
12
+ console.log(renderHeroBanner({
13
+ version: '2.12.1',
14
+ home: path.join(os.homedir(), '.madarx'),
15
+ url: 'http://127.0.0.1:8787',
16
+ engine: 'claude-code',
17
+ commit: process.env.MADARX_COMMIT || undefined,
18
+ session: '20260604_5fb045',
19
+ toolCats: listToolCategories(),
20
+ toolCount: MARKETPLACE_TOOL_COUNT,
21
+ skillGroups: S.listDefaultSkillGroups(),
22
+ skillCount: (S.DEFAULT_SKILL_SLUGS || []).length,
23
+ behind: false,
24
+ }));
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[893],{45:(e,a,t)=>{"use strict";t.d(a,{default:()=>o});var s=t(12115),n={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},l=t(64250);let r=(0,s.createContext)({}),o=(0,s.forwardRef)((e,a)=>{var t,o,c;let{color:i,size:d,strokeWidth:u,absoluteStrokeWidth:m,className:h="",children:p,iconNode:f,...j}=e,{size:x=24,strokeWidth:g=2,absoluteStrokeWidth:v=!1,color:b="currentColor",className:y=""}=null!=(t=(0,s.useContext)(r))?t:{},k=(null!=m?m:v)?24*Number(null!=u?u:g)/Number(null!=d?d:x):null!=u?u:g;return(0,s.createElement)("svg",{ref:a,...n,width:null!=(o=null!=d?d:x)?o:n.width,height:null!=(c=null!=d?d:x)?c:n.height,stroke:null!=i?i:b,strokeWidth:k,className:(0,l.z)("lucide",y,h),...!p&&!(e=>{for(let a in e)if(a.startsWith("aria-")||"role"===a||"title"===a)return!0;return!1})(j)&&{"aria-hidden":"true"},...j},[...f.map(e=>{let[a,t]=e;return(0,s.createElement)(a,t)}),...Array.isArray(p)?p:[p]])})},7423:(e,a,t)=>{"use strict";t.d(a,{default:()=>d});var s=t(95155),n=t(12115),l=t(47650),r=t(85649),o=t(30926);let c=(0,o.createServerReference)("4048fd09593e150627365c8fa0b2bb1bd30b09148a",o.callServer,void 0,o.findSourceMapURL,"deleteProjectAction");function i(e){let{disabled:a}=e,{pending:t}=(0,l.useFormStatus)();return(0,s.jsx)("button",{type:"submit",className:"admin-button danger",disabled:t||a,"aria-busy":t?"true":void 0,children:t?"Deleting…":"Delete project"})}function d(e){let{projectId:a,projectName:t,projectSlug:l,isProtected:o}=e,[d,u]=n.useState(!1),[m,h]=n.useState("");if(o)return(0,s.jsxs)("span",{className:"admin-button secondary project-delete is-locked","aria-disabled":"true",title:"The Personal project is the default scope and cannot be deleted.",children:[(0,s.jsxs)("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{marginRight:6,verticalAlign:"-1px"},children:[(0,s.jsx)("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2"}),(0,s.jsx)("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),"Protected"]});n.useEffect(()=>{d||h("")},[d]);let p=m.trim()===l;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("button",{type:"button",className:"admin-button secondary project-delete",onClick:()=>u(!0),"aria-label":"Delete ".concat(t),children:"Delete"}),(0,s.jsx)(r.A,{open:d,onClose:()=>u(!1),eyebrow:"Delete project",title:"Delete ".concat(t,"?"),tone:"danger",children:(0,s.jsxs)("form",{className:"agents-modal-form",action:c,children:[(0,s.jsx)("input",{type:"hidden",name:"project_id",value:a}),(0,s.jsx)("p",{className:"agents-modal-help",children:"This removes the project, its agents, Disk files, memory, secrets, and audit history. The folder on your local drive is left untouched."}),(0,s.jsx)("section",{className:"agents-modal-section",children:(0,s.jsxs)("label",{className:"agents-modal-field wide",children:[(0,s.jsxs)("span",{children:["Type ",(0,s.jsx)("code",{className:"agents-modal-inline-code",children:l})," to confirm"]}),(0,s.jsx)("input",{type:"text",autoComplete:"off",spellCheck:!1,value:m,onChange:e=>h(e.target.value),placeholder:l,autoFocus:!0})]})}),(0,s.jsxs)("footer",{className:"agents-modal-foot",children:[(0,s.jsx)("button",{type:"button",className:"admin-button secondary",onClick:()=>u(!1),children:"Cancel"}),(0,s.jsx)(i,{disabled:!p})]})]})})]})}},10677:(e,a,t)=>{"use strict";t.d(a,{default:()=>l});var s=t(95155),n=t(12115);function l(){let[e,a]=(0,n.useState)([]),[t,l]=(0,n.useState)("");return(0,n.useEffect)(()=>{l(localStorage.getItem("madarx.activeProjectId")||""),fetch("/api/projects").then(e=>e.json()).then(e=>a(e.projects||[])).catch(()=>{})},[]),(0,s.jsx)("div",{className:"project-switcher","data-project-switcher":!0,children:(0,s.jsxs)("select",{value:t,onChange:e=>{var a;l(a=e.target.value),a?localStorage.setItem("madarx.activeProjectId",a):localStorage.removeItem("madarx.activeProjectId"),window.dispatchEvent(new CustomEvent("madarx:project-change",{detail:{project_id:a||null}}))},"aria-label":"Active project",children:[(0,s.jsx)("option",{value:"",children:"All projects"}),e.map(e=>(0,s.jsx)("option",{value:e.id,children:e.name},e.id))]})})}},13185:(e,a,t)=>{"use strict";t.d(a,{A:()=>o});var s=t(12115),n=t(64250);let l=e=>{let a=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,a,t)=>t?t.toUpperCase():a.toLowerCase());return a.charAt(0).toUpperCase()+a.slice(1)};var r=t(45);let o=(e,a)=>{let t=(0,s.forwardRef)((t,o)=>{let{className:c,...i}=t;return(0,s.createElement)(r.default,{ref:o,iconNode:a,className:(0,n.z)("lucide-".concat(l(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),"lucide-".concat(e),c),...i})});return t.displayName=l(e),t}},30926:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),!function(e,a){for(var t in a)Object.defineProperty(e,t,{enumerable:!0,get:a[t]})}(a,{callServer:function(){return s.callServer},createServerReference:function(){return l.createServerReference},findSourceMapURL:function(){return n.findSourceMapURL}});let s=t(41209),n=t(85153),l=t(77197)},34788:(e,a,t)=>{"use strict";t.d(a,{A:()=>s});let s=(0,t(13185).A)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},50145:(e,a,t)=>{"use strict";t.d(a,{default:()=>m});var s=t(95155),n=t(12115),l=t(47650),r=t(85649),o=t(30926);let c=(0,o.createServerReference)("40c37e06b6315b9cee65db8b1aba313605ee308f25",o.callServer,void 0,o.findSourceMapURL,"createProjectAction");var i=t(59097);let d=[{value:"#c2452a",name:"Mars Red"},{value:"#a83a22",name:"Deep Red"},{value:"#7c2b19",name:"Dark Red"},{value:"#111318",name:"Charcoal"},{value:"#3f3a30",name:"Warm Black"},{value:"#68707b",name:"Slate"},{value:"#cdb78a",name:"Warm Sand"},{value:"#1f6c9f",name:"Skill Blue"}];function u(){let{pending:e}=(0,l.useFormStatus)();return(0,s.jsx)("button",{type:"submit",className:"admin-button",disabled:e,"aria-busy":e?"true":void 0,children:e?"Creating…":"Create project"})}function m(e){let{workspaceRoot:a="~/workspace/projects"}=e,[t,l]=n.useState(!1),[o,m]=n.useState(""),[h,p]=n.useState("workspace"),[f,j]=n.useState(""),x=n.useRef(null),g=n.useMemo(()=>"".concat(a.replace(/\/$/,""),"/").concat(String(o||"").toLowerCase().trim().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,64)||"project"),[a,o]);return n.useEffect(()=>{var e;"custom"===h&&(null==(e=x.current)||e.focus())},[h]),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("button",{type:"button",className:"admin-button agents-new-cta",onClick:()=>l(!0),children:[(0,s.jsx)("span",{"aria-hidden":!0,className:"agents-new-cta-glyph",children:"+"}),"New project"]}),(0,s.jsx)(r.A,{open:t,onClose:()=>l(!1),eyebrow:"New project",title:"Create a project",children:(0,s.jsxs)("form",{className:"agents-modal-form",action:c,children:[(0,s.jsx)("p",{className:"agents-modal-help",children:"Scope agents, documents, memory, and integrations together."}),(0,s.jsx)("section",{className:"agents-modal-section",children:(0,s.jsxs)("label",{className:"agents-modal-field wide",children:[(0,s.jsx)("span",{children:"Name"}),(0,s.jsx)("input",{name:"name",type:"text",required:!0,placeholder:"Acme Co.",autoComplete:"off",value:o,onChange:e=>m(e.target.value),autoFocus:!0})]})}),(0,s.jsxs)("section",{className:"agents-modal-section",children:[(0,s.jsxs)("div",{className:"agents-modal-section-head",children:[(0,s.jsx)("span",{children:"Folder location"}),(0,s.jsx)("small",{children:"Where this project lives on disk."})]}),(0,s.jsxs)("div",{className:"agents-modal-radio-group",children:[(0,s.jsxs)("label",{className:"agents-modal-radio ".concat("workspace"===h?"on":""),children:[(0,s.jsx)("input",{type:"radio",name:"folder_mode",value:"workspace",checked:"workspace"===h,onChange:()=>p("workspace")}),(0,s.jsxs)("span",{className:"agents-modal-radio-body",children:[(0,s.jsx)("b",{children:"madarX workspace"}),(0,s.jsx)("code",{title:g,children:function(e){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:48;if(!e||e.length<=a)return e;let t=e.slice(0,Math.floor(a/2)-1),s=e.slice(e.length-Math.floor(a/2)+2);return"".concat(t,"…").concat(s)}(g)})]})]}),(0,s.jsxs)("label",{className:"agents-modal-radio ".concat("custom"===h?"on":""),children:[(0,s.jsx)("input",{type:"radio",name:"folder_mode",value:"custom",checked:"custom"===h,onChange:()=>p("custom")}),(0,s.jsxs)("span",{className:"agents-modal-radio-body",children:[(0,s.jsx)("b",{children:"Custom path"}),(0,s.jsx)("small",{children:"Any absolute folder. Created if missing."})]})]})]}),"custom"===h?(0,s.jsx)(i.A,{inputRef:x,value:f,onChange:j}):(0,s.jsx)("input",{type:"hidden",name:"folder_path",value:""})]}),(0,s.jsxs)("section",{className:"agents-modal-section",children:[(0,s.jsxs)("div",{className:"agents-modal-section-head",children:[(0,s.jsx)("span",{children:"Color"}),(0,s.jsx)("small",{children:"Used for the project tile across the app."})]}),(0,s.jsxs)("fieldset",{className:"agents-modal-swatches",children:[(0,s.jsx)("legend",{className:"visually-hidden",children:"Project color"}),d.map(e=>(0,s.jsxs)("label",{className:"agents-modal-swatch",style:{"--swatch":e.value},children:[(0,s.jsx)("input",{type:"radio",name:"color",value:e.value,defaultChecked:"#c2452a"===e.value}),(0,s.jsx)("span",{className:"agents-modal-swatch-ring","aria-hidden":"true"}),(0,s.jsx)("span",{className:"visually-hidden",children:e.name})]},e.value))]})]}),(0,s.jsxs)("section",{className:"agents-modal-section",children:[(0,s.jsxs)("div",{className:"agents-modal-section-head",children:[(0,s.jsx)("span",{children:"Description"}),(0,s.jsx)("small",{children:"Used as context for agents working in this project."})]}),(0,s.jsx)("label",{className:"agents-modal-field wide",children:(0,s.jsx)("textarea",{name:"description",rows:3,placeholder:"What is this project for? Goals, audience, voice, constraints."})})]}),(0,s.jsxs)("footer",{className:"agents-modal-foot",children:[(0,s.jsx)("button",{type:"button",className:"admin-button secondary",onClick:()=>l(!1),children:"Cancel"}),(0,s.jsx)(u,{})]})]})})]})}},59097:(e,a,t)=>{"use strict";t.d(a,{A:()=>l});var s=t(95155),n=t(12115);function l(e){let{name:a="folder_path",value:t,onChange:l,inputRef:r,placeholder:o="/Users/you/Documents/my-project"}=e,[c,i]=n.useState(null),[d,u]=n.useState(!1),[m,h]=n.useState(""),[p,f]=n.useState(""),[j,x]=n.useState(null);async function g(){var e;let a;if(i(null),!(null==(e=navigator.clipboard)?void 0:e.readText))return void i({kind:"error",message:"Clipboard not available."});try{a=await navigator.clipboard.readText()}catch(e){i({kind:"error",message:"Allow clipboard access."});return}let t=(a||"").trim();if((t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'"))&&(t=t.slice(1,-1)),t.startsWith("file://"))try{t=decodeURI(t.slice(7))}catch(e){}return t?t.startsWith("/")||t.startsWith("~")?void(l(t),i({kind:"success",message:"Pasted."})):void i({kind:"error",message:"Path must be absolute."}):void i({kind:"error",message:"Clipboard is empty."})}async function v(){i(null),x("pick");try{let e=await fetch("/api/fs/pick-folder",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({title:"Choose project folder",start_path:t&&t.startsWith("/")?t:void 0})});if(499===e.status)return void i({kind:"error",message:"Cancelled."});let a=await e.json();if(!e.ok)return void i({kind:"error",message:a.error||"Picker failed."});l(a.folder_path),i({kind:"success",message:"Selected ".concat(a.folder_path)})}catch(e){i({kind:"error",message:String((null==e?void 0:e.message)||e)})}finally{x(null)}}async function b(){if(i(null),!m.trim()||!p.trim())return void i({kind:"error",message:"Parent and name required."});x("create");try{let e=await fetch("/api/fs/create-folder",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({parent:m.trim(),name:p.trim()})}),a=await e.json();if(!e.ok)return void i({kind:"error",message:a.error||"Create failed."});l(a.folder_path),u(!1),f(""),i({kind:"success",message:"Created ".concat(a.folder_path)})}catch(e){i({kind:"error",message:String((null==e?void 0:e.message)||e)})}finally{x(null)}}return n.useEffect(()=>{d&&!m&&h(t||"~/Documents")},[d,t,m]),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"agents-modal-paste-row",children:[(0,s.jsx)("input",{ref:r,name:a,type:"text",placeholder:o,autoComplete:"off",spellCheck:!1,value:t||"",onChange:e=>{l(e.target.value),c&&i(null)},required:!0}),(0,s.jsx)("button",{type:"button",className:"admin-button secondary",onClick:v,disabled:"pick"===j,children:"pick"===j?"Opening…":"Choose folder…"})]}),(0,s.jsxs)("div",{className:"agents-modal-folder-tools",children:[(0,s.jsx)("button",{type:"button",className:"admin-button secondary",onClick:g,children:"Paste from clipboard"}),(0,s.jsx)("button",{type:"button",className:"admin-button secondary",onClick:()=>l("~/Documents"),children:"~/Documents"}),(0,s.jsx)("button",{type:"button",className:"admin-button secondary",onClick:()=>l("~/Desktop"),children:"~/Desktop"}),(0,s.jsx)("button",{type:"button",className:"admin-button secondary",onClick:()=>u(e=>!e),children:d?"Cancel new folder":"+ New folder"})]}),d?(0,s.jsxs)("div",{className:"agents-modal-create-folder",children:[(0,s.jsx)("small",{children:"Create a folder anywhere outside system directories. Parent must exist."}),(0,s.jsx)("div",{className:"agents-modal-create-row",children:(0,s.jsx)("input",{type:"text",placeholder:"Parent (e.g. ~/Documents)",value:m,onChange:e=>h(e.target.value),spellCheck:!1,autoComplete:"off"})}),(0,s.jsxs)("div",{className:"agents-modal-create-row",children:[(0,s.jsx)("input",{type:"text",placeholder:"New folder name",value:p,onChange:e=>f(e.target.value),spellCheck:!1,autoComplete:"off"}),(0,s.jsx)("button",{type:"button",className:"admin-button",onClick:b,disabled:"create"===j,children:"create"===j?"Creating…":"Create"})]})]}):null,c?(0,s.jsx)("p",{className:"agents-modal-feedback ".concat(c.kind),role:"status","aria-live":"polite",children:c.message}):null]})}},64250:(e,a,t)=>{"use strict";t.d(a,{z:()=>s});let s=function(){for(var e=arguments.length,a=Array(e),t=0;t<e;t++)a[t]=arguments[t];return a.filter((e,a,t)=>!!e&&""!==e.trim()&&t.indexOf(e)===a).join(" ").trim()}},73555:(e,a,t)=>{"use strict";t.d(a,{default:()=>m});var s=t(95155),n=t(12115),l=t(47650),r=t(85649),o=t(30926);let c=(0,o.createServerReference)("40c718127a16c0f0ecea73b387f241ed95608fedfd",o.callServer,void 0,o.findSourceMapURL,"updateProjectAction");var i=t(59097);let d=[{value:"#c2452a",name:"Mars Red"},{value:"#a83a22",name:"Deep Red"},{value:"#7c2b19",name:"Dark Red"},{value:"#111318",name:"Charcoal"},{value:"#3f3a30",name:"Warm Black"},{value:"#68707b",name:"Slate"},{value:"#cdb78a",name:"Warm Sand"},{value:"#1f6c9f",name:"Skill Blue"}];function u(){let{pending:e}=(0,l.useFormStatus)();return(0,s.jsx)("button",{type:"submit",className:"admin-button",disabled:e,"aria-busy":e?"true":void 0,children:e?"Saving…":"Save changes"})}function m(e){let{projectId:a,projectName:t,projectColor:l,projectDescription:o,projectFolderPath:m}=e,[h,p]=n.useState(!1),[f,j]=n.useState("keep"),[x,g]=n.useState(m||""),v=n.useRef(null);return n.useEffect(()=>{h&&(j("keep"),g(m||""))},[h,m]),n.useEffect(()=>{var e;"custom"===f&&(null==(e=v.current)||e.focus())},[f]),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("button",{type:"button",className:"admin-button secondary project-edit",onClick:()=>p(!0),"aria-label":"Edit ".concat(t),children:"Edit"}),(0,s.jsx)(r.A,{open:h,onClose:()=>p(!1),eyebrow:"Edit project",title:"Edit ".concat(t),children:(0,s.jsxs)("form",{className:"agents-modal-form",action:c,children:[(0,s.jsx)("input",{type:"hidden",name:"project_id",value:a}),(0,s.jsx)("section",{className:"agents-modal-section",children:(0,s.jsxs)("label",{className:"agents-modal-field wide",children:[(0,s.jsx)("span",{children:"Name"}),(0,s.jsx)("input",{name:"name",type:"text",defaultValue:t,autoComplete:"off",required:!0})]})}),(0,s.jsxs)("section",{className:"agents-modal-section",children:[(0,s.jsxs)("div",{className:"agents-modal-section-head",children:[(0,s.jsx)("span",{children:"Folder location"}),(0,s.jsx)("small",{children:"Where project files live on disk. Move only if you've already moved the folder yourself."})]}),(0,s.jsxs)("div",{className:"agents-modal-radio-group",children:[(0,s.jsxs)("label",{className:"agents-modal-radio ".concat("keep"===f?"on":""),children:[(0,s.jsx)("input",{type:"radio",name:"folder_mode",value:"keep",checked:"keep"===f,onChange:()=>j("keep")}),(0,s.jsxs)("span",{className:"agents-modal-radio-body",children:[(0,s.jsx)("b",{children:"Keep current"}),(0,s.jsx)("code",{title:m||"",children:function(e){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:48;if(!e||e.length<=a)return e;let t=e.slice(0,Math.floor(a/2)-1),s=e.slice(e.length-Math.floor(a/2)+2);return"".concat(t,"…").concat(s)}(m)||"(not set)"})]})]}),(0,s.jsxs)("label",{className:"agents-modal-radio ".concat("custom"===f?"on":""),children:[(0,s.jsx)("input",{type:"radio",name:"folder_mode",value:"custom",checked:"custom"===f,onChange:()=>j("custom")}),(0,s.jsxs)("span",{className:"agents-modal-radio-body",children:[(0,s.jsx)("b",{children:"Change to…"}),(0,s.jsx)("small",{children:"Absolute path. Must already exist or be writable."})]})]})]}),"custom"===f?(0,s.jsx)(i.A,{inputRef:v,value:x,onChange:g}):(0,s.jsx)("input",{type:"hidden",name:"folder_path",value:""})]}),(0,s.jsxs)("section",{className:"agents-modal-section",children:[(0,s.jsxs)("div",{className:"agents-modal-section-head",children:[(0,s.jsx)("span",{children:"Color"}),(0,s.jsx)("small",{children:"Tile color across the app."})]}),(0,s.jsxs)("fieldset",{className:"agents-modal-swatches",children:[(0,s.jsx)("legend",{className:"visually-hidden",children:"Project color"}),d.map(e=>(0,s.jsxs)("label",{className:"agents-modal-swatch",style:{"--swatch":e.value},children:[(0,s.jsx)("input",{type:"radio",name:"color",value:e.value,defaultChecked:e.value===(l||"#c2452a")}),(0,s.jsx)("span",{className:"agents-modal-swatch-ring","aria-hidden":"true"}),(0,s.jsx)("span",{className:"visually-hidden",children:e.name})]},e.value))]})]}),(0,s.jsxs)("section",{className:"agents-modal-section",children:[(0,s.jsxs)("div",{className:"agents-modal-section-head",children:[(0,s.jsx)("span",{children:"Description"}),(0,s.jsx)("small",{children:"Used as context for agents working in this project."})]}),(0,s.jsx)("label",{className:"agents-modal-field wide",children:(0,s.jsx)("textarea",{name:"description",rows:3,defaultValue:o||"",placeholder:"What is this project for? Goals, audience, voice, constraints."})})]}),(0,s.jsxs)("footer",{className:"agents-modal-foot",children:[(0,s.jsx)("button",{type:"button",className:"admin-button secondary",onClick:()=>p(!1),children:"Cancel"}),(0,s.jsx)(u,{})]})]})})]})}},85649:(e,a,t)=>{"use strict";t.d(a,{A:()=>r});var s=t(95155),n=t(12115),l=t(34788);function r(e){let{open:a,onClose:t,eyebrow:r,title:o,tone:c="default",size:i="default",children:d}=e,u=n.useRef(null);return n.useEffect(()=>{let e=u.current;e&&(a&&!e.open&&("function"==typeof e.showModal?e.showModal():e.setAttribute("open","")),!a&&e.open&&e.close())},[a]),n.useEffect(()=>{let e=u.current;if(!e)return;let a=e=>{e.preventDefault(),t()};return e.addEventListener("cancel",a),()=>e.removeEventListener("cancel",a)},[t]),(0,s.jsx)("dialog",{ref:u,className:"agents-modal".concat("wide"===i?" agents-modal--wide":""),onClick:e=>{e.target===u.current&&t()},children:a?(0,s.jsxs)("div",{className:"agents-modal-card".concat("danger"===c?" agents-modal-card--danger":""),onClick:e=>e.stopPropagation(),children:[(0,s.jsxs)("header",{className:"agents-modal-head",children:[(0,s.jsxs)("div",{children:[r?(0,s.jsx)("span",{className:"admin-kicker",children:r}):null,(0,s.jsx)("h2",{children:o})]}),(0,s.jsx)("button",{type:"button",className:"agents-modal-close",onClick:t,"aria-label":"Close",children:(0,s.jsx)(l.A,{size:14})})]}),d]}):null})}},99168:(e,a,t)=>{Promise.resolve().then(t.bind(t,10677)),Promise.resolve().then(t.bind(t,7423)),Promise.resolve().then(t.bind(t,73555)),Promise.resolve().then(t.bind(t,50145)),Promise.resolve().then(t.t.bind(t,52619,23))}},e=>{e.O(0,[2619,8441,1255,7358],()=>e(e.s=99168)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[893],{45:(e,a,t)=>{"use strict";t.d(a,{default:()=>o});var s=t(12115),n={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},l=t(64250);let r=(0,s.createContext)({}),o=(0,s.forwardRef)((e,a)=>{var t,o,c;let{color:i,size:d,strokeWidth:u,absoluteStrokeWidth:m,className:h="",children:p,iconNode:f,...j}=e,{size:x=24,strokeWidth:g=2,absoluteStrokeWidth:v=!1,color:b="currentColor",className:y=""}=null!=(t=(0,s.useContext)(r))?t:{},k=(null!=m?m:v)?24*Number(null!=u?u:g)/Number(null!=d?d:x):null!=u?u:g;return(0,s.createElement)("svg",{ref:a,...n,width:null!=(o=null!=d?d:x)?o:n.width,height:null!=(c=null!=d?d:x)?c:n.height,stroke:null!=i?i:b,strokeWidth:k,className:(0,l.z)("lucide",y,h),...!p&&!(e=>{for(let a in e)if(a.startsWith("aria-")||"role"===a||"title"===a)return!0;return!1})(j)&&{"aria-hidden":"true"},...j},[...f.map(e=>{let[a,t]=e;return(0,s.createElement)(a,t)}),...Array.isArray(p)?p:[p]])})},7423:(e,a,t)=>{"use strict";t.d(a,{default:()=>d});var s=t(95155),n=t(12115),l=t(47650),r=t(85649),o=t(30926);let c=(0,o.createServerReference)("4048fd09593e150627365c8fa0b2bb1bd30b09148a",o.callServer,void 0,o.findSourceMapURL,"deleteProjectAction");function i(e){let{disabled:a}=e,{pending:t}=(0,l.useFormStatus)();return(0,s.jsx)("button",{type:"submit",className:"admin-button danger",disabled:t||a,"aria-busy":t?"true":void 0,children:t?"Deleting…":"Delete project"})}function d(e){let{projectId:a,projectName:t,projectSlug:l,isProtected:o}=e,[d,u]=n.useState(!1),[m,h]=n.useState("");if(o)return(0,s.jsxs)("span",{className:"admin-button secondary project-delete is-locked","aria-disabled":"true",title:"The Personal project is the default scope and cannot be deleted.",children:[(0,s.jsxs)("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{marginRight:6,verticalAlign:"-1px"},children:[(0,s.jsx)("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2"}),(0,s.jsx)("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),"Protected"]});n.useEffect(()=>{d||h("")},[d]);let p=m.trim()===l;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("button",{type:"button",className:"admin-button secondary project-delete",onClick:()=>u(!0),"aria-label":"Delete ".concat(t),children:"Delete"}),(0,s.jsx)(r.A,{open:d,onClose:()=>u(!1),eyebrow:"Delete project",title:"Delete ".concat(t,"?"),tone:"danger",children:(0,s.jsxs)("form",{className:"agents-modal-form",action:c,children:[(0,s.jsx)("input",{type:"hidden",name:"project_id",value:a}),(0,s.jsx)("p",{className:"agents-modal-help",children:"This removes the project, its agents, Disk files, memory, secrets, and audit history. The folder on your local drive is left untouched."}),(0,s.jsx)("section",{className:"agents-modal-section",children:(0,s.jsxs)("label",{className:"agents-modal-field wide",children:[(0,s.jsxs)("span",{children:["Type ",(0,s.jsx)("code",{className:"agents-modal-inline-code",children:l})," to confirm"]}),(0,s.jsx)("input",{type:"text",autoComplete:"off",spellCheck:!1,value:m,onChange:e=>h(e.target.value),placeholder:l,autoFocus:!0})]})}),(0,s.jsxs)("footer",{className:"agents-modal-foot",children:[(0,s.jsx)("button",{type:"button",className:"admin-button secondary",onClick:()=>u(!1),children:"Cancel"}),(0,s.jsx)(i,{disabled:!p})]})]})})]})}},10677:(e,a,t)=>{"use strict";t.d(a,{default:()=>l});var s=t(95155),n=t(12115);function l(){let[e,a]=(0,n.useState)([]),[t,l]=(0,n.useState)("");return(0,n.useEffect)(()=>{l(localStorage.getItem("madarx.activeProjectId")||""),fetch("/api/projects").then(e=>e.json()).then(e=>a(e.projects||[])).catch(()=>{})},[]),(0,s.jsx)("div",{className:"project-switcher","data-project-switcher":!0,children:(0,s.jsxs)("select",{value:t,onChange:e=>{var a;l(a=e.target.value),a?localStorage.setItem("madarx.activeProjectId",a):localStorage.removeItem("madarx.activeProjectId"),window.dispatchEvent(new CustomEvent("madarx:project-change",{detail:{project_id:a||null}}))},"aria-label":"Active project",children:[(0,s.jsx)("option",{value:"",children:"All projects"}),e.map(e=>(0,s.jsx)("option",{value:e.id,children:e.name},e.id))]})})}},13185:(e,a,t)=>{"use strict";t.d(a,{A:()=>o});var s=t(12115),n=t(64250);let l=e=>{let a=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,a,t)=>t?t.toUpperCase():a.toLowerCase());return a.charAt(0).toUpperCase()+a.slice(1)};var r=t(45);let o=(e,a)=>{let t=(0,s.forwardRef)((t,o)=>{let{className:c,...i}=t;return(0,s.createElement)(r.default,{ref:o,iconNode:a,className:(0,n.z)("lucide-".concat(l(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),"lucide-".concat(e),c),...i})});return t.displayName=l(e),t}},30926:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),!function(e,a){for(var t in a)Object.defineProperty(e,t,{enumerable:!0,get:a[t]})}(a,{callServer:function(){return s.callServer},createServerReference:function(){return l.createServerReference},findSourceMapURL:function(){return n.findSourceMapURL}});let s=t(41209),n=t(85153),l=t(77197)},34788:(e,a,t)=>{"use strict";t.d(a,{A:()=>s});let s=(0,t(13185).A)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},50145:(e,a,t)=>{"use strict";t.d(a,{default:()=>m});var s=t(95155),n=t(12115),l=t(47650),r=t(85649),o=t(30926);let c=(0,o.createServerReference)("40c37e06b6315b9cee65db8b1aba313605ee308f25",o.callServer,void 0,o.findSourceMapURL,"createProjectAction");var i=t(59097);let d=[{value:"#c2452a",name:"Mars Red"},{value:"#a83a22",name:"Deep Red"},{value:"#7c2b19",name:"Dark Red"},{value:"#111318",name:"Charcoal"},{value:"#3f3a30",name:"Warm Black"},{value:"#68707b",name:"Slate"},{value:"#cdb78a",name:"Warm Sand"},{value:"#1f6c9f",name:"Skill Blue"}];function u(){let{pending:e}=(0,l.useFormStatus)();return(0,s.jsx)("button",{type:"submit",className:"admin-button",disabled:e,"aria-busy":e?"true":void 0,children:e?"Creating…":"Create project"})}function m(e){let{workspaceRoot:a="~/workspace/projects"}=e,[t,l]=n.useState(!1),[o,m]=n.useState(""),[h,p]=n.useState("workspace"),[f,j]=n.useState(""),x=n.useRef(null),g=n.useMemo(()=>"".concat(a.replace(/\/$/,""),"/").concat(String(o||"").toLowerCase().trim().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,64)||"project"),[a,o]);return n.useEffect(()=>{var e;"custom"===h&&(null==(e=x.current)||e.focus())},[h]),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("button",{type:"button",className:"admin-button agents-new-cta",onClick:()=>l(!0),children:[(0,s.jsx)("span",{"aria-hidden":!0,className:"agents-new-cta-glyph",children:"+"}),"New project"]}),(0,s.jsx)(r.A,{open:t,onClose:()=>l(!1),eyebrow:"New project",title:"Create a project",children:(0,s.jsxs)("form",{className:"agents-modal-form",action:c,children:[(0,s.jsx)("p",{className:"agents-modal-help",children:"Scope agents, documents, memory, and integrations together."}),(0,s.jsx)("section",{className:"agents-modal-section",children:(0,s.jsxs)("label",{className:"agents-modal-field wide",children:[(0,s.jsx)("span",{children:"Name"}),(0,s.jsx)("input",{name:"name",type:"text",required:!0,placeholder:"Acme Co.",autoComplete:"off",value:o,onChange:e=>m(e.target.value),autoFocus:!0})]})}),(0,s.jsxs)("section",{className:"agents-modal-section",children:[(0,s.jsxs)("div",{className:"agents-modal-section-head",children:[(0,s.jsx)("span",{children:"Folder location"}),(0,s.jsx)("small",{children:"Where this project lives on disk."})]}),(0,s.jsxs)("div",{className:"agents-modal-radio-group",children:[(0,s.jsxs)("label",{className:"agents-modal-radio ".concat("workspace"===h?"on":""),children:[(0,s.jsx)("input",{type:"radio",name:"folder_mode",value:"workspace",checked:"workspace"===h,onChange:()=>p("workspace")}),(0,s.jsxs)("span",{className:"agents-modal-radio-body",children:[(0,s.jsx)("b",{children:"madarX workspace"}),(0,s.jsx)("code",{title:g,children:function(e){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:48;if(!e||e.length<=a)return e;let t=e.slice(0,Math.floor(a/2)-1),s=e.slice(e.length-Math.floor(a/2)+2);return"".concat(t,"…").concat(s)}(g)})]})]}),(0,s.jsxs)("label",{className:"agents-modal-radio ".concat("custom"===h?"on":""),children:[(0,s.jsx)("input",{type:"radio",name:"folder_mode",value:"custom",checked:"custom"===h,onChange:()=>p("custom")}),(0,s.jsxs)("span",{className:"agents-modal-radio-body",children:[(0,s.jsx)("b",{children:"Custom path"}),(0,s.jsx)("small",{children:"Any absolute folder. Created if missing."})]})]})]}),"custom"===h?(0,s.jsx)(i.A,{inputRef:x,value:f,onChange:j}):(0,s.jsx)("input",{type:"hidden",name:"folder_path",value:""})]}),(0,s.jsxs)("section",{className:"agents-modal-section",children:[(0,s.jsxs)("div",{className:"agents-modal-section-head",children:[(0,s.jsx)("span",{children:"Color"}),(0,s.jsx)("small",{children:"Used for the project tile across the app."})]}),(0,s.jsxs)("fieldset",{className:"agents-modal-swatches",children:[(0,s.jsx)("legend",{className:"visually-hidden",children:"Project color"}),d.map(e=>(0,s.jsxs)("label",{className:"agents-modal-swatch",style:{"--swatch":e.value},children:[(0,s.jsx)("input",{type:"radio",name:"color",value:e.value,defaultChecked:"#c2452a"===e.value}),(0,s.jsx)("span",{className:"agents-modal-swatch-ring","aria-hidden":"true"}),(0,s.jsx)("span",{className:"visually-hidden",children:e.name})]},e.value))]})]}),(0,s.jsxs)("section",{className:"agents-modal-section",children:[(0,s.jsxs)("div",{className:"agents-modal-section-head",children:[(0,s.jsx)("span",{children:"Description"}),(0,s.jsx)("small",{children:"Used as context for agents working in this project."})]}),(0,s.jsx)("label",{className:"agents-modal-field wide",children:(0,s.jsx)("textarea",{name:"description",rows:3,placeholder:"What is this project for? Goals, audience, voice, constraints."})})]}),(0,s.jsxs)("footer",{className:"agents-modal-foot",children:[(0,s.jsx)("button",{type:"button",className:"admin-button secondary",onClick:()=>l(!1),children:"Cancel"}),(0,s.jsx)(u,{})]})]})})]})}},59097:(e,a,t)=>{"use strict";t.d(a,{A:()=>l});var s=t(95155),n=t(12115);function l(e){let{name:a="folder_path",value:t,onChange:l,inputRef:r,placeholder:o="/Users/you/Documents/my-project"}=e,[c,i]=n.useState(null),[d,u]=n.useState(!1),[m,h]=n.useState(""),[p,f]=n.useState(""),[j,x]=n.useState(null);async function g(){var e;let a;if(i(null),!(null==(e=navigator.clipboard)?void 0:e.readText))return void i({kind:"error",message:"Clipboard not available."});try{a=await navigator.clipboard.readText()}catch(e){i({kind:"error",message:"Allow clipboard access."});return}let t=(a||"").trim();if((t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'"))&&(t=t.slice(1,-1)),t.startsWith("file://"))try{t=decodeURI(t.slice(7))}catch(e){}return t?t.startsWith("/")||t.startsWith("~")?void(l(t),i({kind:"success",message:"Pasted."})):void i({kind:"error",message:"Path must be absolute."}):void i({kind:"error",message:"Clipboard is empty."})}async function v(){i(null),x("pick");try{let e=await fetch("/api/fs/pick-folder",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({title:"Choose project folder",start_path:t&&t.startsWith("/")?t:void 0})});if(499===e.status)return void i({kind:"error",message:"Cancelled."});let a=await e.json();if(!e.ok)return void i({kind:"error",message:a.error||"Picker failed."});l(a.folder_path),i({kind:"success",message:"Selected ".concat(a.folder_path)})}catch(e){i({kind:"error",message:String((null==e?void 0:e.message)||e)})}finally{x(null)}}async function b(){if(i(null),!m.trim()||!p.trim())return void i({kind:"error",message:"Parent and name required."});x("create");try{let e=await fetch("/api/fs/create-folder",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({parent:m.trim(),name:p.trim()})}),a=await e.json();if(!e.ok)return void i({kind:"error",message:a.error||"Create failed."});l(a.folder_path),u(!1),f(""),i({kind:"success",message:"Created ".concat(a.folder_path)})}catch(e){i({kind:"error",message:String((null==e?void 0:e.message)||e)})}finally{x(null)}}return n.useEffect(()=>{d&&!m&&h(t||"~/Documents")},[d,t,m]),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"agents-modal-paste-row",children:[(0,s.jsx)("input",{ref:r,name:a,type:"text",placeholder:o,autoComplete:"off",spellCheck:!1,value:t||"",onChange:e=>{l(e.target.value),c&&i(null)},required:!0}),(0,s.jsx)("button",{type:"button",className:"admin-button secondary",onClick:v,disabled:"pick"===j,children:"pick"===j?"Opening…":"Choose folder…"})]}),(0,s.jsxs)("div",{className:"agents-modal-folder-tools",children:[(0,s.jsx)("button",{type:"button",className:"admin-button secondary",onClick:g,children:"Paste from clipboard"}),(0,s.jsx)("button",{type:"button",className:"admin-button secondary",onClick:()=>l("~/Documents"),children:"~/Documents"}),(0,s.jsx)("button",{type:"button",className:"admin-button secondary",onClick:()=>l("~/Desktop"),children:"~/Desktop"}),(0,s.jsx)("button",{type:"button",className:"admin-button secondary",onClick:()=>u(e=>!e),children:d?"Cancel new folder":"+ New folder"})]}),d?(0,s.jsxs)("div",{className:"agents-modal-create-folder",children:[(0,s.jsx)("small",{children:"Create a folder anywhere outside system directories. Parent must exist."}),(0,s.jsx)("div",{className:"agents-modal-create-row",children:(0,s.jsx)("input",{type:"text",placeholder:"Parent (e.g. ~/Documents)",value:m,onChange:e=>h(e.target.value),spellCheck:!1,autoComplete:"off"})}),(0,s.jsxs)("div",{className:"agents-modal-create-row",children:[(0,s.jsx)("input",{type:"text",placeholder:"New folder name",value:p,onChange:e=>f(e.target.value),spellCheck:!1,autoComplete:"off"}),(0,s.jsx)("button",{type:"button",className:"admin-button",onClick:b,disabled:"create"===j,children:"create"===j?"Creating…":"Create"})]})]}):null,c?(0,s.jsx)("p",{className:"agents-modal-feedback ".concat(c.kind),role:"status","aria-live":"polite",children:c.message}):null]})}},64250:(e,a,t)=>{"use strict";t.d(a,{z:()=>s});let s=function(){for(var e=arguments.length,a=Array(e),t=0;t<e;t++)a[t]=arguments[t];return a.filter((e,a,t)=>!!e&&""!==e.trim()&&t.indexOf(e)===a).join(" ").trim()}},73555:(e,a,t)=>{"use strict";t.d(a,{default:()=>m});var s=t(95155),n=t(12115),l=t(47650),r=t(85649),o=t(30926);let c=(0,o.createServerReference)("40c718127a16c0f0ecea73b387f241ed95608fedfd",o.callServer,void 0,o.findSourceMapURL,"updateProjectAction");var i=t(59097);let d=[{value:"#c2452a",name:"Mars Red"},{value:"#a83a22",name:"Deep Red"},{value:"#7c2b19",name:"Dark Red"},{value:"#111318",name:"Charcoal"},{value:"#3f3a30",name:"Warm Black"},{value:"#68707b",name:"Slate"},{value:"#cdb78a",name:"Warm Sand"},{value:"#1f6c9f",name:"Skill Blue"}];function u(){let{pending:e}=(0,l.useFormStatus)();return(0,s.jsx)("button",{type:"submit",className:"admin-button",disabled:e,"aria-busy":e?"true":void 0,children:e?"Saving…":"Save changes"})}function m(e){let{projectId:a,projectName:t,projectColor:l,projectDescription:o,projectFolderPath:m}=e,[h,p]=n.useState(!1),[f,j]=n.useState("keep"),[x,g]=n.useState(m||""),v=n.useRef(null);return n.useEffect(()=>{h&&(j("keep"),g(m||""))},[h,m]),n.useEffect(()=>{var e;"custom"===f&&(null==(e=v.current)||e.focus())},[f]),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("button",{type:"button",className:"admin-button secondary project-edit",onClick:()=>p(!0),"aria-label":"Edit ".concat(t),children:"Edit"}),(0,s.jsx)(r.A,{open:h,onClose:()=>p(!1),eyebrow:"Edit project",title:"Edit ".concat(t),children:(0,s.jsxs)("form",{className:"agents-modal-form",action:c,children:[(0,s.jsx)("input",{type:"hidden",name:"project_id",value:a}),(0,s.jsx)("section",{className:"agents-modal-section",children:(0,s.jsxs)("label",{className:"agents-modal-field wide",children:[(0,s.jsx)("span",{children:"Name"}),(0,s.jsx)("input",{name:"name",type:"text",defaultValue:t,autoComplete:"off",required:!0})]})}),(0,s.jsxs)("section",{className:"agents-modal-section",children:[(0,s.jsxs)("div",{className:"agents-modal-section-head",children:[(0,s.jsx)("span",{children:"Folder location"}),(0,s.jsx)("small",{children:"Where project files live on disk. Move only if you've already moved the folder yourself."})]}),(0,s.jsxs)("div",{className:"agents-modal-radio-group",children:[(0,s.jsxs)("label",{className:"agents-modal-radio ".concat("keep"===f?"on":""),children:[(0,s.jsx)("input",{type:"radio",name:"folder_mode",value:"keep",checked:"keep"===f,onChange:()=>j("keep")}),(0,s.jsxs)("span",{className:"agents-modal-radio-body",children:[(0,s.jsx)("b",{children:"Keep current"}),(0,s.jsx)("code",{title:m||"",children:function(e){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:48;if(!e||e.length<=a)return e;let t=e.slice(0,Math.floor(a/2)-1),s=e.slice(e.length-Math.floor(a/2)+2);return"".concat(t,"…").concat(s)}(m)||"(not set)"})]})]}),(0,s.jsxs)("label",{className:"agents-modal-radio ".concat("custom"===f?"on":""),children:[(0,s.jsx)("input",{type:"radio",name:"folder_mode",value:"custom",checked:"custom"===f,onChange:()=>j("custom")}),(0,s.jsxs)("span",{className:"agents-modal-radio-body",children:[(0,s.jsx)("b",{children:"Change to…"}),(0,s.jsx)("small",{children:"Absolute path. Must already exist or be writable."})]})]})]}),"custom"===f?(0,s.jsx)(i.A,{inputRef:v,value:x,onChange:g}):(0,s.jsx)("input",{type:"hidden",name:"folder_path",value:""})]}),(0,s.jsxs)("section",{className:"agents-modal-section",children:[(0,s.jsxs)("div",{className:"agents-modal-section-head",children:[(0,s.jsx)("span",{children:"Color"}),(0,s.jsx)("small",{children:"Tile color across the app."})]}),(0,s.jsxs)("fieldset",{className:"agents-modal-swatches",children:[(0,s.jsx)("legend",{className:"visually-hidden",children:"Project color"}),d.map(e=>(0,s.jsxs)("label",{className:"agents-modal-swatch",style:{"--swatch":e.value},children:[(0,s.jsx)("input",{type:"radio",name:"color",value:e.value,defaultChecked:e.value===(l||"#c2452a")}),(0,s.jsx)("span",{className:"agents-modal-swatch-ring","aria-hidden":"true"}),(0,s.jsx)("span",{className:"visually-hidden",children:e.name})]},e.value))]})]}),(0,s.jsxs)("section",{className:"agents-modal-section",children:[(0,s.jsxs)("div",{className:"agents-modal-section-head",children:[(0,s.jsx)("span",{children:"Description"}),(0,s.jsx)("small",{children:"Used as context for agents working in this project."})]}),(0,s.jsx)("label",{className:"agents-modal-field wide",children:(0,s.jsx)("textarea",{name:"description",rows:3,defaultValue:o||"",placeholder:"What is this project for? Goals, audience, voice, constraints."})})]}),(0,s.jsxs)("footer",{className:"agents-modal-foot",children:[(0,s.jsx)("button",{type:"button",className:"admin-button secondary",onClick:()=>p(!1),children:"Cancel"}),(0,s.jsx)(u,{})]})]})})]})}},85649:(e,a,t)=>{"use strict";t.d(a,{A:()=>r});var s=t(95155),n=t(12115),l=t(34788);function r(e){let{open:a,onClose:t,eyebrow:r,title:o,tone:c="default",size:i="default",children:d}=e,u=n.useRef(null);return n.useEffect(()=>{let e=u.current;e&&(a&&!e.open&&("function"==typeof e.showModal?e.showModal():e.setAttribute("open","")),!a&&e.open&&e.close())},[a]),n.useEffect(()=>{let e=u.current;if(!e)return;let a=e=>{e.preventDefault(),t()};return e.addEventListener("cancel",a),()=>e.removeEventListener("cancel",a)},[t]),(0,s.jsx)("dialog",{ref:u,className:"agents-modal".concat("wide"===i?" agents-modal--wide":""),onClick:e=>{e.target===u.current&&t()},children:a?(0,s.jsxs)("div",{className:"agents-modal-card".concat("danger"===c?" agents-modal-card--danger":""),onClick:e=>e.stopPropagation(),children:[(0,s.jsxs)("header",{className:"agents-modal-head",children:[(0,s.jsxs)("div",{children:[r?(0,s.jsx)("span",{className:"admin-kicker",children:r}):null,(0,s.jsx)("h2",{children:o})]}),(0,s.jsx)("button",{type:"button",className:"agents-modal-close",onClick:t,"aria-label":"Close",children:(0,s.jsx)(l.A,{size:14})})]}),d]}):null})}},99168:(e,a,t)=>{Promise.resolve().then(t.bind(t,10677)),Promise.resolve().then(t.bind(t,7423)),Promise.resolve().then(t.bind(t,73555)),Promise.resolve().then(t.bind(t,50145)),Promise.resolve().then(t.t.bind(t,52619,23))}},e=>{e.O(0,[2619,8441,1255,7358],()=>e(e.s=99168)),_N_E=e.O()}]);