madarx 2.15.1 → 2.16.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 (377) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/app-build-manifest.json +322 -321
  3. package/.next/standalone/.next/app-path-routes-manifest.json +81 -81
  4. package/.next/standalone/.next/build-manifest.json +2 -2
  5. package/.next/standalone/.next/prerender-manifest.json +9 -9
  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 +2 -2
  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 +2 -2
  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 +6 -6
  13. package/.next/standalone/.next/server/app/agents/[id]/page.js.nft.json +1 -1
  14. package/.next/standalone/.next/server/app/agents/[id]/page_client-reference-manifest.js +1 -1
  15. package/.next/standalone/.next/server/app/agents/page.js +1 -1
  16. package/.next/standalone/.next/server/app/agents/page.js.nft.json +1 -1
  17. package/.next/standalone/.next/server/app/agents/page_client-reference-manifest.js +1 -1
  18. package/.next/standalone/.next/server/app/api/activity/route_client-reference-manifest.js +1 -1
  19. package/.next/standalone/.next/server/app/api/admin/audit-export/route_client-reference-manifest.js +1 -1
  20. package/.next/standalone/.next/server/app/api/admin/share-links/route_client-reference-manifest.js +1 -1
  21. package/.next/standalone/.next/server/app/api/agent-memory/route_client-reference-manifest.js +1 -1
  22. package/.next/standalone/.next/server/app/api/agent-runs/[id]/cancel/route_client-reference-manifest.js +1 -1
  23. package/.next/standalone/.next/server/app/api/agent-runs/[id]/events/route_client-reference-manifest.js +1 -1
  24. package/.next/standalone/.next/server/app/api/agent-runs/[id]/log/route_client-reference-manifest.js +1 -1
  25. package/.next/standalone/.next/server/app/api/agent-runs/[id]/route_client-reference-manifest.js +1 -1
  26. package/.next/standalone/.next/server/app/api/agent-runs/route_client-reference-manifest.js +1 -1
  27. package/.next/standalone/.next/server/app/api/agents/[id]/chain/route_client-reference-manifest.js +1 -1
  28. package/.next/standalone/.next/server/app/api/agents/[id]/memory/route_client-reference-manifest.js +1 -1
  29. package/.next/standalone/.next/server/app/api/agents/[id]/reports/route_client-reference-manifest.js +1 -1
  30. package/.next/standalone/.next/server/app/api/agents/[id]/run/route_client-reference-manifest.js +1 -1
  31. package/.next/standalone/.next/server/app/api/agents/[id]/skills/route_client-reference-manifest.js +1 -1
  32. package/.next/standalone/.next/server/app/api/agents/create/route_client-reference-manifest.js +1 -1
  33. package/.next/standalone/.next/server/app/api/agents/ops/route_client-reference-manifest.js +1 -1
  34. package/.next/standalone/.next/server/app/api/approvals/[id]/route_client-reference-manifest.js +1 -1
  35. package/.next/standalone/.next/server/app/api/approvals/route_client-reference-manifest.js +1 -1
  36. package/.next/standalone/.next/server/app/api/artifacts/[id]/acl/route_client-reference-manifest.js +1 -1
  37. package/.next/standalone/.next/server/app/api/artifacts/[id]/protect/route_client-reference-manifest.js +1 -1
  38. package/.next/standalone/.next/server/app/api/artifacts/[id]/raw/route_client-reference-manifest.js +1 -1
  39. package/.next/standalone/.next/server/app/api/artifacts/[id]/route_client-reference-manifest.js +1 -1
  40. package/.next/standalone/.next/server/app/api/artifacts/[id]/share-link/[linkId]/route_client-reference-manifest.js +1 -1
  41. package/.next/standalone/.next/server/app/api/artifacts/[id]/share-link/route_client-reference-manifest.js +1 -1
  42. package/.next/standalone/.next/server/app/api/artifacts/upload/route_client-reference-manifest.js +1 -1
  43. package/.next/standalone/.next/server/app/api/audit/list/route_client-reference-manifest.js +1 -1
  44. package/.next/standalone/.next/server/app/api/audit/search/route_client-reference-manifest.js +1 -1
  45. package/.next/standalone/.next/server/app/api/auth/callback/route_client-reference-manifest.js +1 -1
  46. package/.next/standalone/.next/server/app/api/auth/config/route_client-reference-manifest.js +1 -1
  47. package/.next/standalone/.next/server/app/api/auth/join-bootstrap/route_client-reference-manifest.js +1 -1
  48. package/.next/standalone/.next/server/app/api/auth/session/route_client-reference-manifest.js +1 -1
  49. package/.next/standalone/.next/server/app/api/brand/route_client-reference-manifest.js +1 -1
  50. package/.next/standalone/.next/server/app/api/chat/sessions/[id]/route_client-reference-manifest.js +1 -1
  51. package/.next/standalone/.next/server/app/api/chat/sessions/route_client-reference-manifest.js +1 -1
  52. package/.next/standalone/.next/server/app/api/config/env/route_client-reference-manifest.js +1 -1
  53. package/.next/standalone/.next/server/app/api/config/route_client-reference-manifest.js +1 -1
  54. package/.next/standalone/.next/server/app/api/connections/[service]/route_client-reference-manifest.js +1 -1
  55. package/.next/standalone/.next/server/app/api/connections/[service]/verify/route.js +2 -2
  56. package/.next/standalone/.next/server/app/api/connections/[service]/verify/route_client-reference-manifest.js +1 -1
  57. package/.next/standalone/.next/server/app/api/connections/route_client-reference-manifest.js +1 -1
  58. package/.next/standalone/.next/server/app/api/cron/tick/route_client-reference-manifest.js +1 -1
  59. package/.next/standalone/.next/server/app/api/dashboard/spaces/[id]/move/route_client-reference-manifest.js +1 -1
  60. package/.next/standalone/.next/server/app/api/dashboard/spaces/[id]/route_client-reference-manifest.js +1 -1
  61. package/.next/standalone/.next/server/app/api/dashboard/spaces/[id]/share-link/[linkId]/route_client-reference-manifest.js +1 -1
  62. package/.next/standalone/.next/server/app/api/dashboard/spaces/[id]/share-link/route_client-reference-manifest.js +1 -1
  63. package/.next/standalone/.next/server/app/api/dashboard/spaces/import/route_client-reference-manifest.js +1 -1
  64. package/.next/standalone/.next/server/app/api/dashboard/spaces/route_client-reference-manifest.js +1 -1
  65. package/.next/standalone/.next/server/app/api/disk/files/[id]/blob/route_client-reference-manifest.js +1 -1
  66. package/.next/standalone/.next/server/app/api/disk/files/[id]/route_client-reference-manifest.js +1 -1
  67. package/.next/standalone/.next/server/app/api/disk/files/[id]/transcribe/route_client-reference-manifest.js +1 -1
  68. package/.next/standalone/.next/server/app/api/disk/files/route_client-reference-manifest.js +1 -1
  69. package/.next/standalone/.next/server/app/api/disk/folders/route_client-reference-manifest.js +1 -1
  70. package/.next/standalone/.next/server/app/api/events/since/[cursor]/route_client-reference-manifest.js +1 -1
  71. package/.next/standalone/.next/server/app/api/events/stream/route_client-reference-manifest.js +1 -1
  72. package/.next/standalone/.next/server/app/api/fs/create-folder/route_client-reference-manifest.js +1 -1
  73. package/.next/standalone/.next/server/app/api/fs/pick-folder/route_client-reference-manifest.js +1 -1
  74. package/.next/standalone/.next/server/app/api/hail/engagements/[id]/blueprint/route_client-reference-manifest.js +1 -1
  75. package/.next/standalone/.next/server/app/api/hail/engagements/[id]/diagnostic/route_client-reference-manifest.js +1 -1
  76. package/.next/standalone/.next/server/app/api/hail/engagements/[id]/governance/route_client-reference-manifest.js +1 -1
  77. package/.next/standalone/.next/server/app/api/hail/engagements/[id]/interview/route_client-reference-manifest.js +1 -1
  78. package/.next/standalone/.next/server/app/api/hail/engagements/[id]/pilot/route_client-reference-manifest.js +1 -1
  79. package/.next/standalone/.next/server/app/api/hail/engagements/[id]/quarterly/route_client-reference-manifest.js +1 -1
  80. package/.next/standalone/.next/server/app/api/hail/engagements/[id]/route_client-reference-manifest.js +1 -1
  81. package/.next/standalone/.next/server/app/api/hail/engagements/[id]/setup-package/route_client-reference-manifest.js +1 -1
  82. package/.next/standalone/.next/server/app/api/hail/engagements/route_client-reference-manifest.js +1 -1
  83. package/.next/standalone/.next/server/app/api/hail/interviews/[id]/responses/route_client-reference-manifest.js +1 -1
  84. package/.next/standalone/.next/server/app/api/hail/interviews/[id]/route_client-reference-manifest.js +1 -1
  85. package/.next/standalone/.next/server/app/api/hail/setup-packages/[id]/apply/route_client-reference-manifest.js +1 -1
  86. package/.next/standalone/.next/server/app/api/hail/setup-packages/validate/route_client-reference-manifest.js +1 -1
  87. package/.next/standalone/.next/server/app/api/heartbeat/tick/route_client-reference-manifest.js +1 -1
  88. package/.next/standalone/.next/server/app/api/heartbeat/worker/route_client-reference-manifest.js +1 -1
  89. package/.next/standalone/.next/server/app/api/help/route_client-reference-manifest.js +1 -1
  90. package/.next/standalone/.next/server/app/api/hermes/jobs/[id]/events/route_client-reference-manifest.js +1 -1
  91. package/.next/standalone/.next/server/app/api/hermes/jobs/[id]/route_client-reference-manifest.js +1 -1
  92. package/.next/standalone/.next/server/app/api/hermes/jobs/route_client-reference-manifest.js +1 -1
  93. package/.next/standalone/.next/server/app/api/integrations/google/callback/route_client-reference-manifest.js +1 -1
  94. package/.next/standalone/.next/server/app/api/integrations/google/oauth/route_client-reference-manifest.js +1 -1
  95. package/.next/standalone/.next/server/app/api/marketplace/[id]/route_client-reference-manifest.js +1 -1
  96. package/.next/standalone/.next/server/app/api/marketplace/open-design/route_client-reference-manifest.js +1 -1
  97. package/.next/standalone/.next/server/app/api/marketplace/route_client-reference-manifest.js +1 -1
  98. package/.next/standalone/.next/server/app/api/mines/import-roots/route_client-reference-manifest.js +1 -1
  99. package/.next/standalone/.next/server/app/api/mines/portfolio/route_client-reference-manifest.js +1 -1
  100. package/.next/standalone/.next/server/app/api/mines/projects/[id]/chunks/route_client-reference-manifest.js +1 -1
  101. package/.next/standalone/.next/server/app/api/mines/projects/[id]/diligence/route_client-reference-manifest.js +1 -1
  102. package/.next/standalone/.next/server/app/api/mines/projects/[id]/import/route_client-reference-manifest.js +1 -1
  103. package/.next/standalone/.next/server/app/api/mines/projects/[id]/publish/route_client-reference-manifest.js +1 -1
  104. package/.next/standalone/.next/server/app/api/mines/projects/route_client-reference-manifest.js +1 -1
  105. package/.next/standalone/.next/server/app/api/missions/route_client-reference-manifest.js +1 -1
  106. package/.next/standalone/.next/server/app/api/models/route_client-reference-manifest.js +1 -1
  107. package/.next/standalone/.next/server/app/api/onboarding/blueprint/route_client-reference-manifest.js +1 -1
  108. package/.next/standalone/.next/server/app/api/onboarding/launch/route_client-reference-manifest.js +1 -1
  109. package/.next/standalone/.next/server/app/api/orchestrator/command/route_client-reference-manifest.js +1 -1
  110. package/.next/standalone/.next/server/app/api/orchestrator/stream/route_client-reference-manifest.js +1 -1
  111. package/.next/standalone/.next/server/app/api/orchestrator/upload/route_client-reference-manifest.js +1 -1
  112. package/.next/standalone/.next/server/app/api/org/route_client-reference-manifest.js +1 -1
  113. package/.next/standalone/.next/server/app/api/orgs/[id]/invites/[inviteId]/route_client-reference-manifest.js +1 -1
  114. package/.next/standalone/.next/server/app/api/orgs/[id]/invites/route_client-reference-manifest.js +1 -1
  115. package/.next/standalone/.next/server/app/api/orgs/[id]/members/[userId]/role/route_client-reference-manifest.js +1 -1
  116. package/.next/standalone/.next/server/app/api/orgs/[id]/members/[userId]/route_client-reference-manifest.js +1 -1
  117. package/.next/standalone/.next/server/app/api/orgs/[id]/members/route_client-reference-manifest.js +1 -1
  118. package/.next/standalone/.next/server/app/api/orgs/[id]/route_client-reference-manifest.js +1 -1
  119. package/.next/standalone/.next/server/app/api/orgs/invites/pending/route_client-reference-manifest.js +1 -1
  120. package/.next/standalone/.next/server/app/api/orgs/join/route_client-reference-manifest.js +1 -1
  121. package/.next/standalone/.next/server/app/api/orgs/join-complete/route_client-reference-manifest.js +1 -1
  122. package/.next/standalone/.next/server/app/api/orgs/route_client-reference-manifest.js +1 -1
  123. package/.next/standalone/.next/server/app/api/printing-press/clis/route_client-reference-manifest.js +1 -1
  124. package/.next/standalone/.next/server/app/api/printing-press/install/route_client-reference-manifest.js +1 -1
  125. package/.next/standalone/.next/server/app/api/printing-press/security-mode/route_client-reference-manifest.js +1 -1
  126. package/.next/standalone/.next/server/app/api/privacy/config/route_client-reference-manifest.js +1 -1
  127. package/.next/standalone/.next/server/app/api/privacy/verify/route_client-reference-manifest.js +1 -1
  128. package/.next/standalone/.next/server/app/api/processes/[id]/route_client-reference-manifest.js +1 -1
  129. package/.next/standalone/.next/server/app/api/processes/[id]/share-link/route_client-reference-manifest.js +1 -1
  130. package/.next/standalone/.next/server/app/api/processes/[id]/stages/[stageId]/override/route_client-reference-manifest.js +1 -1
  131. package/.next/standalone/.next/server/app/api/processes/[id]/stages/[stageId]/retry/route_client-reference-manifest.js +1 -1
  132. package/.next/standalone/.next/server/app/api/processes/[id]/stages/[stageId]/submit/route_client-reference-manifest.js +1 -1
  133. package/.next/standalone/.next/server/app/api/processes/definitions/[slug]/route_client-reference-manifest.js +1 -1
  134. package/.next/standalone/.next/server/app/api/processes/definitions/[slug]/settings/route_client-reference-manifest.js +1 -1
  135. package/.next/standalone/.next/server/app/api/processes/definitions/route_client-reference-manifest.js +1 -1
  136. package/.next/standalone/.next/server/app/api/processes/definitions/validate/route_client-reference-manifest.js +1 -1
  137. package/.next/standalone/.next/server/app/api/processes/route_client-reference-manifest.js +1 -1
  138. package/.next/standalone/.next/server/app/api/processes/start-and-route/route_client-reference-manifest.js +1 -1
  139. package/.next/standalone/.next/server/app/api/projects/[slug]/library/route_client-reference-manifest.js +1 -1
  140. package/.next/standalone/.next/server/app/api/projects/[slug]/route_client-reference-manifest.js +1 -1
  141. package/.next/standalone/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
  142. package/.next/standalone/.next/server/app/api/runs/approve-claude-run/route_client-reference-manifest.js +1 -1
  143. package/.next/standalone/.next/server/app/api/runs/claude-code-dry-run/route_client-reference-manifest.js +1 -1
  144. package/.next/standalone/.next/server/app/api/runs/competitor-report/route_client-reference-manifest.js +1 -1
  145. package/.next/standalone/.next/server/app/api/runs/engine-ping/route_client-reference-manifest.js +1 -1
  146. package/.next/standalone/.next/server/app/api/runs/marketing-plan/route_client-reference-manifest.js +1 -1
  147. package/.next/standalone/.next/server/app/api/schedules/upsert/route_client-reference-manifest.js +1 -1
  148. package/.next/standalone/.next/server/app/api/secrets/[name]/route_client-reference-manifest.js +1 -1
  149. package/.next/standalone/.next/server/app/api/secrets/route_client-reference-manifest.js +1 -1
  150. package/.next/standalone/.next/server/app/api/settings/trust-mode/route_client-reference-manifest.js +1 -1
  151. package/.next/standalone/.next/server/app/api/share/[token]/otp/route_client-reference-manifest.js +1 -1
  152. package/.next/standalone/.next/server/app/api/share/[token]/route_client-reference-manifest.js +1 -1
  153. package/.next/standalone/.next/server/app/api/share/[token]/verify/route_client-reference-manifest.js +1 -1
  154. package/.next/standalone/.next/server/app/api/share/space/[token]/otp/route_client-reference-manifest.js +1 -1
  155. package/.next/standalone/.next/server/app/api/share/space/[token]/route_client-reference-manifest.js +1 -1
  156. package/.next/standalone/.next/server/app/api/share/space/[token]/verify/route_client-reference-manifest.js +1 -1
  157. package/.next/standalone/.next/server/app/api/shared/spaces/[id]/acl/route_client-reference-manifest.js +1 -1
  158. package/.next/standalone/.next/server/app/api/shared/spaces/publish/route_client-reference-manifest.js +1 -1
  159. package/.next/standalone/.next/server/app/api/shared/spaces/route_client-reference-manifest.js +1 -1
  160. package/.next/standalone/.next/server/app/api/shared/spaces/status/route_client-reference-manifest.js +1 -1
  161. package/.next/standalone/.next/server/app/api/shared/spaces/unpublish/route_client-reference-manifest.js +1 -1
  162. package/.next/standalone/.next/server/app/api/state/route_client-reference-manifest.js +1 -1
  163. package/.next/standalone/.next/server/app/api/system/update/route_client-reference-manifest.js +1 -1
  164. package/.next/standalone/.next/server/app/api/tasks/[id]/active-run/route_client-reference-manifest.js +1 -1
  165. package/.next/standalone/.next/server/app/api/tasks/[id]/attachments/route_client-reference-manifest.js +1 -1
  166. package/.next/standalone/.next/server/app/api/tasks/[id]/checklist/[itemId]/route_client-reference-manifest.js +1 -1
  167. package/.next/standalone/.next/server/app/api/tasks/[id]/checklist/route_client-reference-manifest.js +1 -1
  168. package/.next/standalone/.next/server/app/api/tasks/[id]/checkout/route_client-reference-manifest.js +1 -1
  169. package/.next/standalone/.next/server/app/api/tasks/[id]/children/route_client-reference-manifest.js +1 -1
  170. package/.next/standalone/.next/server/app/api/tasks/[id]/comments/route_client-reference-manifest.js +1 -1
  171. package/.next/standalone/.next/server/app/api/tasks/[id]/events/route_client-reference-manifest.js +1 -1
  172. package/.next/standalone/.next/server/app/api/tasks/[id]/live-runs/route_client-reference-manifest.js +1 -1
  173. package/.next/standalone/.next/server/app/api/tasks/[id]/release/route_client-reference-manifest.js +1 -1
  174. package/.next/standalone/.next/server/app/api/tasks/[id]/route_client-reference-manifest.js +1 -1
  175. package/.next/standalone/.next/server/app/api/tasks/route_client-reference-manifest.js +1 -1
  176. package/.next/standalone/.next/server/app/api/tool-allowlists/[id]/route_client-reference-manifest.js +1 -1
  177. package/.next/standalone/.next/server/app/api/tool-allowlists/route_client-reference-manifest.js +1 -1
  178. package/.next/standalone/.next/server/app/api/tool-egress/route_client-reference-manifest.js +1 -1
  179. package/.next/standalone/.next/server/app/api/tools/[name]/approve/route_client-reference-manifest.js +1 -1
  180. package/.next/standalone/.next/server/app/api/tools/[name]/route_client-reference-manifest.js +1 -1
  181. package/.next/standalone/.next/server/app/api/tools/route_client-reference-manifest.js +1 -1
  182. package/.next/standalone/.next/server/app/api/transcripts/route_client-reference-manifest.js +1 -1
  183. package/.next/standalone/.next/server/app/api/voice/providers/route_client-reference-manifest.js +1 -1
  184. package/.next/standalone/.next/server/app/api/voice/realtime/context/route_client-reference-manifest.js +1 -1
  185. package/.next/standalone/.next/server/app/api/voice/realtime/session/route_client-reference-manifest.js +1 -1
  186. package/.next/standalone/.next/server/app/api/voice/realtime/tool-result/route_client-reference-manifest.js +1 -1
  187. package/.next/standalone/.next/server/app/api/voice/realtime/tools/route_client-reference-manifest.js +1 -1
  188. package/.next/standalone/.next/server/app/api/voice/tts/route_client-reference-manifest.js +1 -1
  189. package/.next/standalone/.next/server/app/api/whatsapp/allowlist/route_client-reference-manifest.js +1 -1
  190. package/.next/standalone/.next/server/app/api/whatsapp/disconnect/route_client-reference-manifest.js +1 -1
  191. package/.next/standalone/.next/server/app/api/whatsapp/messages/route_client-reference-manifest.js +1 -1
  192. package/.next/standalone/.next/server/app/api/whatsapp/qr/route_client-reference-manifest.js +1 -1
  193. package/.next/standalone/.next/server/app/api/whatsapp/send/route_client-reference-manifest.js +1 -1
  194. package/.next/standalone/.next/server/app/api/whatsapp/status/route_client-reference-manifest.js +1 -1
  195. package/.next/standalone/.next/server/app/approvals/page.js +1 -1
  196. package/.next/standalone/.next/server/app/approvals/page_client-reference-manifest.js +1 -1
  197. package/.next/standalone/.next/server/app/architecture/page_client-reference-manifest.js +1 -1
  198. package/.next/standalone/.next/server/app/architecture.html +2 -2
  199. package/.next/standalone/.next/server/app/architecture.rsc +2 -2
  200. package/.next/standalone/.next/server/app/audit/live/page_client-reference-manifest.js +1 -1
  201. package/.next/standalone/.next/server/app/audit/page_client-reference-manifest.js +1 -1
  202. package/.next/standalone/.next/server/app/brand/page_client-reference-manifest.js +1 -1
  203. package/.next/standalone/.next/server/app/brand.html +1 -1
  204. package/.next/standalone/.next/server/app/brand.rsc +2 -2
  205. package/.next/standalone/.next/server/app/disk/page_client-reference-manifest.js +1 -1
  206. package/.next/standalone/.next/server/app/federated-ai/page_client-reference-manifest.js +1 -1
  207. package/.next/standalone/.next/server/app/federated-ai.html +2 -2
  208. package/.next/standalone/.next/server/app/federated-ai.rsc +2 -2
  209. package/.next/standalone/.next/server/app/hail/[id]/governance/page_client-reference-manifest.js +1 -1
  210. package/.next/standalone/.next/server/app/hail/[id]/interview/page.js +1 -1
  211. package/.next/standalone/.next/server/app/hail/[id]/interview/page_client-reference-manifest.js +1 -1
  212. package/.next/standalone/.next/server/app/hail/[id]/page.js +1 -1
  213. package/.next/standalone/.next/server/app/hail/[id]/page_client-reference-manifest.js +1 -1
  214. package/.next/standalone/.next/server/app/hail/[id]/setup/page.js +2 -2
  215. package/.next/standalone/.next/server/app/hail/[id]/setup/page_client-reference-manifest.js +1 -1
  216. package/.next/standalone/.next/server/app/hail/page.js +1 -1
  217. package/.next/standalone/.next/server/app/hail/page_client-reference-manifest.js +1 -1
  218. package/.next/standalone/.next/server/app/help/[slug]/page_client-reference-manifest.js +1 -1
  219. package/.next/standalone/.next/server/app/help/page_client-reference-manifest.js +1 -1
  220. package/.next/standalone/.next/server/app/index.html +2 -2
  221. package/.next/standalone/.next/server/app/index.rsc +2 -2
  222. package/.next/standalone/.next/server/app/join/page_client-reference-manifest.js +1 -1
  223. package/.next/standalone/.next/server/app/join.html +1 -1
  224. package/.next/standalone/.next/server/app/join.rsc +2 -2
  225. package/.next/standalone/.next/server/app/login/page_client-reference-manifest.js +1 -1
  226. package/.next/standalone/.next/server/app/marketplace/page.js +4 -3
  227. package/.next/standalone/.next/server/app/marketplace/page.js.nft.json +1 -1
  228. package/.next/standalone/.next/server/app/marketplace/page_client-reference-manifest.js +1 -1
  229. package/.next/standalone/.next/server/app/mines/[projectId]/page_client-reference-manifest.js +1 -1
  230. package/.next/standalone/.next/server/app/mines/[projectId]/results/page_client-reference-manifest.js +1 -1
  231. package/.next/standalone/.next/server/app/mines/page_client-reference-manifest.js +1 -1
  232. package/.next/standalone/.next/server/app/missions/page.js +2 -2
  233. package/.next/standalone/.next/server/app/missions/page_client-reference-manifest.js +1 -1
  234. package/.next/standalone/.next/server/app/onboarding/org/page_client-reference-manifest.js +1 -1
  235. package/.next/standalone/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
  236. package/.next/standalone/.next/server/app/onboarding.html +2 -2
  237. package/.next/standalone/.next/server/app/onboarding.rsc +2 -2
  238. package/.next/standalone/.next/server/app/org/page.js +1 -1
  239. package/.next/standalone/.next/server/app/org/page.js.nft.json +1 -1
  240. package/.next/standalone/.next/server/app/org/page_client-reference-manifest.js +1 -1
  241. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  242. package/.next/standalone/.next/server/app/projects/[slug]/log/page_client-reference-manifest.js +1 -1
  243. package/.next/standalone/.next/server/app/projects/[slug]/page_client-reference-manifest.js +1 -1
  244. package/.next/standalone/.next/server/app/projects/new/page.js +3 -2
  245. package/.next/standalone/.next/server/app/projects/new/page.js.nft.json +1 -1
  246. package/.next/standalone/.next/server/app/projects/new/page_client-reference-manifest.js +1 -1
  247. package/.next/standalone/.next/server/app/projects/new.html +1 -1
  248. package/.next/standalone/.next/server/app/projects/new.rsc +3 -3
  249. package/.next/standalone/.next/server/app/projects/page.js +32 -15
  250. package/.next/standalone/.next/server/app/projects/page_client-reference-manifest.js +1 -1
  251. package/.next/standalone/.next/server/app/reports/[file]/route_client-reference-manifest.js +1 -1
  252. package/.next/standalone/.next/server/app/reports/page_client-reference-manifest.js +1 -1
  253. package/.next/standalone/.next/server/app/runtime/page_client-reference-manifest.js +1 -1
  254. package/.next/standalone/.next/server/app/schedules/page.js +2 -2
  255. package/.next/standalone/.next/server/app/schedules/page_client-reference-manifest.js +1 -1
  256. package/.next/standalone/.next/server/app/settings/account/page_client-reference-manifest.js +1 -1
  257. package/.next/standalone/.next/server/app/settings/advanced/page_client-reference-manifest.js +1 -1
  258. package/.next/standalone/.next/server/app/settings/appearance/page.js +1 -1
  259. package/.next/standalone/.next/server/app/settings/appearance/page_client-reference-manifest.js +1 -1
  260. package/.next/standalone/.next/server/app/settings/brand/page.js +1 -1
  261. package/.next/standalone/.next/server/app/settings/brand/page_client-reference-manifest.js +1 -1
  262. package/.next/standalone/.next/server/app/settings/brand.html +2 -2
  263. package/.next/standalone/.next/server/app/settings/brand.rsc +3 -3
  264. package/.next/standalone/.next/server/app/settings/connectors/page_client-reference-manifest.js +1 -1
  265. package/.next/standalone/.next/server/app/settings/engines/page_client-reference-manifest.js +1 -1
  266. package/.next/standalone/.next/server/app/settings/onboarding/page.js +1 -1
  267. package/.next/standalone/.next/server/app/settings/onboarding/page_client-reference-manifest.js +1 -1
  268. package/.next/standalone/.next/server/app/settings/onboarding.html +2 -2
  269. package/.next/standalone/.next/server/app/settings/onboarding.rsc +3 -3
  270. package/.next/standalone/.next/server/app/settings/organization/page.js +2 -2
  271. package/.next/standalone/.next/server/app/settings/organization/page.js.nft.json +1 -1
  272. package/.next/standalone/.next/server/app/settings/organization/page_client-reference-manifest.js +1 -1
  273. package/.next/standalone/.next/server/app/settings/page.js +1 -1
  274. package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  275. package/.next/standalone/.next/server/app/settings/runtime/page.js +1 -1
  276. package/.next/standalone/.next/server/app/settings/runtime/page_client-reference-manifest.js +1 -1
  277. package/.next/standalone/.next/server/app/settings/team/page.js +1 -1
  278. package/.next/standalone/.next/server/app/settings/team/page_client-reference-manifest.js +1 -1
  279. package/.next/standalone/.next/server/app/settings/tools/page_client-reference-manifest.js +1 -1
  280. package/.next/standalone/.next/server/app/settings.html +2 -2
  281. package/.next/standalone/.next/server/app/settings.rsc +3 -3
  282. package/.next/standalone/.next/server/app/share/[token]/page_client-reference-manifest.js +1 -1
  283. package/.next/standalone/.next/server/app/share/space/[token]/page_client-reference-manifest.js +1 -1
  284. package/.next/standalone/.next/server/app/tasks/[id]/page.js +2 -2
  285. package/.next/standalone/.next/server/app/tasks/[id]/page_client-reference-manifest.js +1 -1
  286. package/.next/standalone/.next/server/app/tasks/page.js +2 -2
  287. package/.next/standalone/.next/server/app/tasks/page_client-reference-manifest.js +1 -1
  288. package/.next/standalone/.next/server/app/team/[agentId]/page_client-reference-manifest.js +1 -1
  289. package/.next/standalone/.next/server/app/team/page_client-reference-manifest.js +1 -1
  290. package/.next/standalone/.next/server/app/tools/page_client-reference-manifest.js +1 -1
  291. package/.next/standalone/.next/server/app/whatsapp/page_client-reference-manifest.js +1 -1
  292. package/.next/standalone/.next/server/app/whatsapp.html +1 -1
  293. package/.next/standalone/.next/server/app/whatsapp.rsc +2 -2
  294. package/.next/standalone/.next/server/app/workflows/[caseId]/page_client-reference-manifest.js +1 -1
  295. package/.next/standalone/.next/server/app/workflows/new/[caseId]/page_client-reference-manifest.js +1 -1
  296. package/.next/standalone/.next/server/app/workflows/new/definition/page_client-reference-manifest.js +1 -1
  297. package/.next/standalone/.next/server/app/workflows/page_client-reference-manifest.js +1 -1
  298. package/.next/standalone/.next/server/app/workflows/share/[caseId]/page_client-reference-manifest.js +1 -1
  299. package/.next/standalone/.next/server/app-paths-manifest.json +81 -81
  300. package/.next/standalone/.next/server/chunks/1648.js +1 -1
  301. package/.next/standalone/.next/server/chunks/1699.js +39 -22
  302. package/.next/standalone/.next/server/chunks/3230.js +2 -2
  303. package/.next/standalone/.next/server/chunks/5093.js +1 -0
  304. package/.next/standalone/.next/server/chunks/5864.js +1 -0
  305. package/.next/standalone/.next/server/chunks/{9801.js → 7500.js} +1 -1
  306. package/.next/standalone/.next/server/functions-config-manifest.json +42 -42
  307. package/.next/standalone/.next/server/middleware-manifest.json +5 -5
  308. package/.next/standalone/.next/server/pages/404.html +1 -1
  309. package/.next/standalone/.next/server/pages/500.html +1 -1
  310. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  311. package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
  312. package/.next/standalone/.next/static/chunks/7695-04c7f1a5233de027.js +1 -0
  313. package/.next/standalone/.next/static/chunks/app/agents/[id]/page-474f640e84f7b4b5.js +1 -0
  314. package/.next/standalone/.next/static/chunks/app/agents/page-b79b611acd56712b.js +1 -0
  315. package/.next/standalone/.next/static/chunks/app/marketplace/page-0b7d3a6309302de3.js +1 -0
  316. package/.next/standalone/.next/static/chunks/app/projects/page-e1cfb0b17418e719.js +1 -0
  317. package/.next/standalone/.next/static/chunks/app/settings/layout-08f6b30132b26dd1.js +1 -0
  318. package/.next/standalone/.next/static/chunks/app/settings/team/page-9a2e675124de6aac.js +1 -0
  319. package/.next/standalone/.next/static/css/{65c472079b6fd086.css → 9fbf057b7ce95c36.css} +1 -1
  320. package/.next/standalone/CHANGELOG.md +14 -0
  321. package/.next/standalone/data/.artifacts-migrated-v1 +1 -1
  322. package/.next/standalone/data/.default-project-seeded +1 -1
  323. package/.next/standalone/data/madarx.sqlite +0 -0
  324. package/.next/standalone/data/madarx.sqlite-shm +0 -0
  325. package/.next/standalone/data/madarx.sqlite-wal +0 -0
  326. package/.next/standalone/package.json +1 -1
  327. package/.next/static/chunks/7695-04c7f1a5233de027.js +1 -0
  328. package/.next/static/chunks/app/agents/[id]/page-474f640e84f7b4b5.js +1 -0
  329. package/.next/static/chunks/app/agents/page-b79b611acd56712b.js +1 -0
  330. package/.next/static/chunks/app/marketplace/page-0b7d3a6309302de3.js +1 -0
  331. package/.next/static/chunks/app/projects/page-e1cfb0b17418e719.js +1 -0
  332. package/.next/static/chunks/app/settings/layout-08f6b30132b26dd1.js +1 -0
  333. package/.next/static/chunks/app/settings/team/page-9a2e675124de6aac.js +1 -0
  334. package/.next/static/css/{65c472079b6fd086.css → 9fbf057b7ce95c36.css} +1 -1
  335. package/CHANGELOG.md +14 -0
  336. package/app/agents/[id]/agent-activity-feed.tsx +96 -0
  337. package/app/agents/[id]/agent-detail-simple.tsx +71 -83
  338. package/app/agents/[id]/agent-quick-controls.tsx +497 -0
  339. package/app/agents/[id]/page.js +90 -2
  340. package/app/api/connections/[service]/verify/route.js +17 -2
  341. package/app/globals.css +347 -32
  342. package/lib/agent-templates.js +12 -0
  343. package/lib/connection-grant.js +106 -0
  344. package/lib/connection-seeds.js +126 -0
  345. package/lib/connections/health-check-verify.js +114 -0
  346. package/lib/connections/manifest-validator.js +161 -0
  347. package/lib/marketplace-modules.js +45 -0
  348. package/lib/marketplace-seeds.js +105 -0
  349. package/lib/marketplace.js +1 -0
  350. package/lib/oauth/flow.js +204 -0
  351. package/lib/oauth/provider-registry.js +102 -0
  352. package/lib/runtime.js +74 -1
  353. package/lib/schema.js +17 -0
  354. package/lib/tools/adapters/http-api-call.js +92 -28
  355. package/lib/tools/connectors/connector-validator.js +27 -1
  356. package/package.json +1 -1
  357. package/.next/standalone/.next/server/chunks/1887.js +0 -2
  358. package/.next/standalone/.next/server/chunks/3711.js +0 -1
  359. package/.next/standalone/.next/server/chunks/6098.js +0 -1
  360. package/.next/standalone/.next/static/chunks/9077-f54ea987eb597e43.js +0 -1
  361. package/.next/standalone/.next/static/chunks/app/agents/[id]/page-66477263de089865.js +0 -1
  362. package/.next/standalone/.next/static/chunks/app/agents/page-64d6bdc6ba3ad4d7.js +0 -1
  363. package/.next/standalone/.next/static/chunks/app/marketplace/page-45c6d49f8eddad67.js +0 -1
  364. package/.next/standalone/.next/static/chunks/app/projects/page-15a7a85fa216b575.js +0 -1
  365. package/.next/standalone/.next/static/chunks/app/settings/layout-2c1e6807acb6fdad.js +0 -1
  366. package/.next/standalone/.next/static/chunks/app/settings/team/page-0aee40dfa9e7a430.js +0 -1
  367. package/.next/static/chunks/9077-f54ea987eb597e43.js +0 -1
  368. package/.next/static/chunks/app/agents/[id]/page-66477263de089865.js +0 -1
  369. package/.next/static/chunks/app/agents/page-64d6bdc6ba3ad4d7.js +0 -1
  370. package/.next/static/chunks/app/marketplace/page-45c6d49f8eddad67.js +0 -1
  371. package/.next/static/chunks/app/projects/page-15a7a85fa216b575.js +0 -1
  372. package/.next/static/chunks/app/settings/layout-2c1e6807acb6fdad.js +0 -1
  373. package/.next/static/chunks/app/settings/team/page-0aee40dfa9e7a430.js +0 -1
  374. /package/.next/standalone/.next/static/{JcJc6PlL89SQvtZvP-LnU → JGJBLnQfb05RAKCcECbJt}/_buildManifest.js +0 -0
  375. /package/.next/standalone/.next/static/{JcJc6PlL89SQvtZvP-LnU → JGJBLnQfb05RAKCcECbJt}/_ssgManifest.js +0 -0
  376. /package/.next/static/{JcJc6PlL89SQvtZvP-LnU → JGJBLnQfb05RAKCcECbJt}/_buildManifest.js +0 -0
  377. /package/.next/static/{JcJc6PlL89SQvtZvP-LnU → JGJBLnQfb05RAKCcECbJt}/_ssgManifest.js +0 -0
@@ -7,8 +7,72 @@
7
7
  //
8
8
  // Setup kinds:
9
9
  // - api_key — collect one or more passwords, verify with provider
10
+ // - oauth2 — "Sign in with…" authorization-code flow (tokens in vault)
10
11
  // - qr_pair — WhatsApp pairing through the Baileys bridge daemon
11
12
  // - binary_detect — local binary / directory probe (Hermes)
13
+ //
14
+ // OAuth2 connections never embed a secret: the operator's app client id/secret
15
+ // are collected once as `api_key`-style fields and referenced from the vault by
16
+ // name (`*_ref`); the minted access/refresh tokens land in `*_ACCESS_TOKEN` /
17
+ // `*_REFRESH_TOKEN`. A declarative `health_check` block gives them a generic
18
+ // "Test connection" through verifyViaHealthCheck — no per-service route code.
19
+
20
+ /**
21
+ * Build an OAuth2 business-connection seed from a compact descriptor. Keeps the
22
+ * (verbose, security-sensitive) manifest shape consistent across every provider.
23
+ */
24
+ function oauthConnectionSeed({
25
+ slug, title, description, category = 'integration', provider, scopes,
26
+ prefix, extraCredentials = [], unlocks, healthEndpoint, risk, tags,
27
+ }) {
28
+ const accessRef = `${prefix}_ACCESS_TOKEN`;
29
+ return {
30
+ slug,
31
+ title,
32
+ description,
33
+ category,
34
+ author: 'madarx',
35
+ source_kind: 'builtin',
36
+ source_url: null,
37
+ version: null,
38
+ risk_summary: risk,
39
+ tags,
40
+ manifest: {
41
+ service_key: slug,
42
+ setup_kind: 'oauth2',
43
+ benefit: `Sign in with ${title} to unlock ${unlocks.length} tool${unlocks.length === 1 ? '' : 's'}. No code, no .env editing.`,
44
+ // Operator app credentials, supplied once. Referenced by the oauth block via *_ref.
45
+ credentials: [
46
+ { name: `${prefix}_CLIENT_ID`, label: `${title} client ID`, type: 'text', required: true, help_text: `Create an app on the ${title} developer console and paste its client ID.` },
47
+ { name: `${prefix}_CLIENT_SECRET`, label: `${title} client secret`, type: 'password', required: true, help_text: 'Stored encrypted in the local vault — never echoed back.' },
48
+ ...extraCredentials,
49
+ ],
50
+ oauth: {
51
+ provider,
52
+ scopes,
53
+ pkce: provider === 'google' || provider === 'tiktok',
54
+ redirect_path: `/api/connections/${slug}/oauth/callback`,
55
+ client_id_ref: `${prefix}_CLIENT_ID`,
56
+ client_secret_ref: `${prefix}_CLIENT_SECRET`,
57
+ access_token_ref: accessRef,
58
+ refresh_token_ref: `${prefix}_REFRESH_TOKEN`,
59
+ },
60
+ health_check: {
61
+ endpoint: healthEndpoint,
62
+ method: 'GET',
63
+ expect_status: 200,
64
+ auth: { in: 'header', name: 'Authorization', prefix: 'Bearer ', credential: accessRef },
65
+ },
66
+ verify_endpoint: `/api/connections/${slug}/verify`,
67
+ verify_supported: true,
68
+ deep_link: null,
69
+ supports_scopes: ['global', 'project', 'agent'],
70
+ unlocks_tool_slugs: unlocks,
71
+ engines: [],
72
+ logo_glyph: slug,
73
+ },
74
+ };
75
+ }
12
76
 
13
77
  const CONNECTION_SEEDS = [
14
78
  {
@@ -397,6 +461,68 @@ const CONNECTION_SEEDS = [
397
461
  logo_glyph: 'hermes',
398
462
  },
399
463
  },
464
+
465
+ // ── Business OAuth2 connections (P0/P1 foundation) ──────────────────────────
466
+ // These collect the operator's provider-app credentials once, then use the
467
+ // local-first authorization-code flow to mint tokens into the vault. The tools
468
+ // they unlock are authored as connectors (Tool-Smith) or shipped later; the
469
+ // connection + grant machinery is ready for them today. All ad/spend writes
470
+ // they unlock remain irreversible_external → always approval-gated.
471
+ oauthConnectionSeed({
472
+ slug: 'meta-ads',
473
+ title: 'Meta Ads',
474
+ description: 'Build and report on Facebook + Instagram ad campaigns. Campaign/budget writes are always approval-gated.',
475
+ category: 'marketing',
476
+ provider: 'meta',
477
+ prefix: 'META',
478
+ scopes: ['ads_management', 'ads_read', 'business_management'],
479
+ unlocks: ['meta_ads.insights_read', 'meta_ads.campaign_create', 'meta_ads.adset_create', 'meta_ads.budget_set'],
480
+ healthEndpoint: 'https://graph.facebook.com/v19.0/me',
481
+ risk: 'Campaign create, budget set, and audience create are irreversible and always require approval.',
482
+ tags: ['marketing', 'ads', 'meta', 'oauth'],
483
+ }),
484
+ oauthConnectionSeed({
485
+ slug: 'google-ads',
486
+ title: 'Google Ads',
487
+ description: 'Manage Google Ads campaigns and pull GAQL reports. Requires a developer token in addition to OAuth sign-in.',
488
+ category: 'marketing',
489
+ provider: 'google',
490
+ prefix: 'GOOGLE_ADS',
491
+ scopes: ['https://www.googleapis.com/auth/adwords'],
492
+ extraCredentials: [
493
+ { name: 'GOOGLE_ADS_DEVELOPER_TOKEN', label: 'Developer token', type: 'password', required: true, help_text: 'Google Ads API access requires a developer token alongside OAuth.' },
494
+ ],
495
+ unlocks: ['google_ads.report', 'google_ads.campaign_create', 'google_ads.budget_set'],
496
+ healthEndpoint: 'https://googleads.googleapis.com/v17/customers:listAccessibleCustomers',
497
+ risk: 'Campaign create and budget set are irreversible and always require approval.',
498
+ tags: ['marketing', 'ads', 'google', 'oauth'],
499
+ }),
500
+ oauthConnectionSeed({
501
+ slug: 'ga4',
502
+ title: 'Google Analytics 4',
503
+ description: 'Read GA4 metrics for marketing reports. Read-only — no external writes.',
504
+ category: 'analytics',
505
+ provider: 'google',
506
+ prefix: 'GA4',
507
+ scopes: ['https://www.googleapis.com/auth/analytics.readonly'],
508
+ unlocks: ['ga4.run_report', 'ga4.realtime_report'],
509
+ healthEndpoint: 'https://analyticsdata.googleapis.com/v1beta/properties',
510
+ risk: 'Read-only analytics access.',
511
+ tags: ['analytics', 'ga4', 'google', 'oauth'],
512
+ }),
513
+ oauthConnectionSeed({
514
+ slug: 'hubspot-crm',
515
+ title: 'HubSpot CRM',
516
+ description: 'Read and (with approval) write contacts, deals, and activity in HubSpot.',
517
+ category: 'sales',
518
+ provider: 'hubspot',
519
+ prefix: 'HUBSPOT',
520
+ scopes: ['crm.objects.contacts.read', 'crm.objects.deals.read', 'crm.objects.contacts.write'],
521
+ unlocks: ['hubspot.contacts_read', 'hubspot.deals_read', 'hubspot.contact_upsert'],
522
+ healthEndpoint: 'https://api.hubapi.com/crm/v3/objects/contacts',
523
+ risk: 'CRM writes (contact/deal upsert) require approval.',
524
+ tags: ['sales', 'crm', 'hubspot', 'oauth'],
525
+ }),
400
526
  ];
401
527
 
402
528
  function upsertConnection(db, seed) {
@@ -0,0 +1,114 @@
1
+ // lib/connections/health-check-verify.js — generic "Test connection" verifier.
2
+ //
3
+ // The curated VERIFIERS map in app/api/connections/[service]/verify/route.js
4
+ // covers the 9 seeded services with bespoke logic. This is the FALLBACK: any
5
+ // connection manifest that declares a `health_check` block gets a working "Test
6
+ // connection" with no edits to the route — closing the verify_supported:false gap
7
+ // for Tool-Smith-authored connectors and the new OAuth connections.
8
+ //
9
+ // SECURITY: the resolved credential is injected into the outbound request and is
10
+ // NEVER returned, logged, or echoed. The result carries only non-secret display
11
+ // metadata (account_label, last_4 fingerprint). Error reasons are generic codes,
12
+ // never the credential value.
13
+ //
14
+ // health_check shape (declared in the connection manifest):
15
+ // {
16
+ // endpoint: 'https://api.example.com/me', // required, https
17
+ // method: 'GET', // optional, default GET
18
+ // expect_status: 200, // optional, default: any 2xx
19
+ // auth: { // optional credential injection
20
+ // in: 'header', // 'header' | 'query'
21
+ // name: 'Authorization', // header/param name
22
+ // prefix: 'Bearer ', // value prefix
23
+ // credential: 'META_ACCESS_TOKEN' // key into the credentials map
24
+ // }
25
+ // }
26
+
27
+ import { wrapFetch } from '../egress.js';
28
+
29
+ function isHttpsUrl(value) {
30
+ if (typeof value !== 'string') return false;
31
+ try {
32
+ return new URL(value).protocol === 'https:';
33
+ } catch {
34
+ return false;
35
+ }
36
+ }
37
+
38
+ function last4(value) {
39
+ const s = String(value || '');
40
+ return s.length >= 4 ? s.slice(-4) : null;
41
+ }
42
+
43
+ /**
44
+ * Run a manifest-declared health check.
45
+ *
46
+ * @param {object} healthCheck manifest.health_check
47
+ * @param {object} credentials { NAME: value } resolved for this attempt
48
+ * @param {object} [opts] { fetchFn, serviceKey, agentId }
49
+ * @returns {Promise<{ ok, reason?, account_label?, last_4?, summary? }>}
50
+ */
51
+ export async function verifyViaHealthCheck(healthCheck, credentials = {}, opts = {}) {
52
+ if (!healthCheck || typeof healthCheck !== 'object') {
53
+ return { ok: false, reason: 'unsupported' };
54
+ }
55
+ if (!isHttpsUrl(healthCheck.endpoint)) {
56
+ return { ok: false, reason: 'unsupported' };
57
+ }
58
+
59
+ const method = /^(GET|POST|PUT|PATCH|DELETE|HEAD)$/.test(String(healthCheck.method || ''))
60
+ ? String(healthCheck.method)
61
+ : 'GET';
62
+
63
+ let url;
64
+ try {
65
+ url = new URL(healthCheck.endpoint);
66
+ } catch {
67
+ return { ok: false, reason: 'unsupported' };
68
+ }
69
+
70
+ const headers = { Accept: 'application/json' };
71
+ let injectedCredentialValue = null;
72
+
73
+ const auth = healthCheck.auth;
74
+ if (auth && typeof auth === 'object' && auth.credential) {
75
+ const value = credentials[auth.credential];
76
+ if (typeof value !== 'string' || !value.trim()) {
77
+ // The credential the health check needs wasn't provided — treat as missing.
78
+ return { ok: false, reason: 'missing_field', field: auth.credential };
79
+ }
80
+ injectedCredentialValue = value.trim();
81
+ const composed = `${auth.prefix || ''}${injectedCredentialValue}`;
82
+ if (auth.in === 'query') {
83
+ url.searchParams.set(auth.name || 'access_token', composed);
84
+ } else {
85
+ headers[auth.name || 'Authorization'] = composed;
86
+ }
87
+ }
88
+
89
+ const fetchFn = opts.fetchFn || wrapFetch(`connection.verify.health.${opts.serviceKey || 'generic'}`, opts.agentId || null, fetch);
90
+
91
+ let res;
92
+ try {
93
+ res = await fetchFn(url.toString(), { method, headers });
94
+ } catch {
95
+ // Never surface the underlying error string — it could contain the URL with
96
+ // an injected query credential.
97
+ return { ok: false, reason: 'network' };
98
+ }
99
+
100
+ const expect = Number.isInteger(healthCheck.expect_status) ? healthCheck.expect_status : null;
101
+ const passed = expect != null ? res.status === expect : (res.status >= 200 && res.status < 300);
102
+
103
+ if (!passed) {
104
+ if (res.status === 401 || res.status === 403) return { ok: false, reason: 'unauthorized' };
105
+ return { ok: false, reason: 'invalid_key' };
106
+ }
107
+
108
+ return {
109
+ ok: true,
110
+ account_label: opts.accountLabel || (opts.serviceKey ? String(opts.serviceKey) : 'Connected'),
111
+ last_4: injectedCredentialValue ? last4(injectedCredentialValue) : null,
112
+ summary: { health_check: true, status: res.status },
113
+ };
114
+ }
@@ -0,0 +1,161 @@
1
+ // lib/connections/manifest-validator.js — pure validator for connection manifests.
2
+ //
3
+ // A connection manifest is INERT DATA describing how the setup assistant collects
4
+ // credentials for a service. This validator enforces the security envelope for the
5
+ // new `setup_kind:'oauth2'` shape and the generic `health_check` block, so a
6
+ // malformed/malicious manifest cannot embed a raw secret or point a health check
7
+ // at a private host.
8
+ //
9
+ // Load-bearing properties (mirrors connector-validator.js):
10
+ // • OAuth client id/secret + tokens are referenced by *_ref ONLY (vault names),
11
+ // never inline. Any key carrying a raw secret value is rejected.
12
+ // • authorize_url / token_url / health_check.endpoint must be https.
13
+ // • No private/loopback hosts in health_check.endpoint.
14
+ //
15
+ // Pure ESM — no DB/fs/network imports. Returns { ok, errors, warnings }.
16
+
17
+ const SECRET_REF_REGEX = /^[A-Z][A-Z0-9_]{1,63}$/;
18
+ const VALID_SETUP_KINDS = new Set(['api_key', 'oauth2', 'qr_pair', 'binary_detect']);
19
+
20
+ // Exact key names that must never hold a raw secret value in the oauth block.
21
+ const RAW_SECRET_KEYS = new Set([
22
+ 'client_id', 'client_secret', 'access_token', 'refresh_token', 'token', 'secret', 'password', 'api_key',
23
+ ]);
24
+
25
+ const OAUTH_REF_FIELDS = ['client_id_ref', 'client_secret_ref', 'access_token_ref', 'refresh_token_ref'];
26
+
27
+ function isPlainObject(v) {
28
+ return v !== null && typeof v === 'object' && !Array.isArray(v);
29
+ }
30
+
31
+ function isHttpsUrl(value) {
32
+ if (typeof value !== 'string') return false;
33
+ try {
34
+ return new URL(value).protocol === 'https:';
35
+ } catch {
36
+ return false;
37
+ }
38
+ }
39
+
40
+ function isPrivateOrLocalHost(host) {
41
+ if (!host) return false;
42
+ const h = String(host).toLowerCase().replace(/^\[|\]$/g, '');
43
+ if (h === 'localhost' || h === '::1' || h === '0.0.0.0') return true;
44
+ if (h.endsWith('.localhost') || h.endsWith('.local')) return true;
45
+ const ipv4 = h.match(/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/);
46
+ if (!ipv4) return false;
47
+ const [a, b] = [Number(ipv4[1]), Number(ipv4[2])];
48
+ if (a === 10 || a === 127 || a === 0) return true;
49
+ if (a === 169 && b === 254) return true;
50
+ if (a === 192 && b === 168) return true;
51
+ if (a === 172 && b >= 16 && b <= 31) return true;
52
+ return false;
53
+ }
54
+
55
+ function validateOauthBlock(oauth, errors) {
56
+ if (!isPlainObject(oauth)) {
57
+ errors.push('oauth: required (plain object) for setup_kind oauth2');
58
+ return;
59
+ }
60
+
61
+ // SECURITY: reject any raw-secret key (must use *_ref instead).
62
+ for (const key of Object.keys(oauth)) {
63
+ if (RAW_SECRET_KEYS.has(key.toLowerCase())) {
64
+ errors.push(`oauth: raw secrets are not allowed; reference by *_ref only (found '${key}')`);
65
+ }
66
+ }
67
+
68
+ if (!oauth.provider || typeof oauth.provider !== 'string') {
69
+ errors.push('oauth.provider: required (string)');
70
+ }
71
+
72
+ // authorize_url / token_url may be omitted IF the provider is catalogued; the
73
+ // validator can't see the registry, so when present they must be https.
74
+ if (oauth.authorize_url != null && !isHttpsUrl(oauth.authorize_url)) {
75
+ errors.push('oauth.authorize_url: must be https');
76
+ }
77
+ if (oauth.token_url != null && !isHttpsUrl(oauth.token_url)) {
78
+ errors.push('oauth.token_url: must be https');
79
+ }
80
+
81
+ if (oauth.scopes != null && !Array.isArray(oauth.scopes)) {
82
+ errors.push('oauth.scopes: must be an array of strings');
83
+ }
84
+
85
+ // client_id_ref is required so the operator's app credentials resolve from the
86
+ // vault; access_token_ref is required so the minted token has a home.
87
+ if (!oauth.client_id_ref || typeof oauth.client_id_ref !== 'string') {
88
+ errors.push('oauth.client_id_ref: required (vault ref, e.g. META_CLIENT_ID)');
89
+ }
90
+ if (!oauth.access_token_ref || typeof oauth.access_token_ref !== 'string') {
91
+ errors.push('oauth.access_token_ref: required (vault ref, e.g. META_ACCESS_TOKEN)');
92
+ }
93
+
94
+ for (const field of OAUTH_REF_FIELDS) {
95
+ const val = oauth[field];
96
+ if (val == null) continue;
97
+ if (typeof val !== 'string' || !SECRET_REF_REGEX.test(val)) {
98
+ errors.push(`oauth.${field}: must match ${SECRET_REF_REGEX} (uppercase vault ref)`);
99
+ }
100
+ }
101
+ }
102
+
103
+ function validateHealthCheck(hc, errors) {
104
+ if (!isPlainObject(hc)) {
105
+ errors.push('health_check: must be a plain object');
106
+ return;
107
+ }
108
+ if (!hc.endpoint || !isHttpsUrl(hc.endpoint)) {
109
+ errors.push('health_check.endpoint: required (https URL)');
110
+ } else {
111
+ let host;
112
+ try { host = new URL(hc.endpoint).hostname; } catch { host = null; }
113
+ if (host && isPrivateOrLocalHost(host)) {
114
+ errors.push(`health_check.endpoint: private/local hosts are not allowed ('${host}')`);
115
+ }
116
+ }
117
+ if (hc.method != null && !/^(GET|POST|PUT|PATCH|DELETE|HEAD)$/.test(String(hc.method))) {
118
+ errors.push('health_check.method: must be a valid HTTP method (uppercase)');
119
+ }
120
+ if (hc.expect_status != null && !Number.isInteger(hc.expect_status)) {
121
+ errors.push('health_check.expect_status: must be an integer status code');
122
+ }
123
+ }
124
+
125
+ /**
126
+ * Validate a connection manifest. Strict for the oauth2 + health_check additions;
127
+ * permissive (warnings only) for the legacy api_key/qr_pair/binary_detect kinds so
128
+ * existing seeds keep validating.
129
+ *
130
+ * @param {object} manifest
131
+ * @returns {{ ok: boolean, errors: string[], warnings: string[] }}
132
+ */
133
+ export function validateConnectionManifest(manifest) {
134
+ const errors = [];
135
+ const warnings = [];
136
+
137
+ if (!isPlainObject(manifest)) {
138
+ return { ok: false, errors: ['manifest: must be a plain object'], warnings };
139
+ }
140
+
141
+ const setupKind = manifest.setup_kind || 'api_key';
142
+ if (!VALID_SETUP_KINDS.has(setupKind)) {
143
+ errors.push(`setup_kind: must be one of ${[...VALID_SETUP_KINDS].join(', ')}`);
144
+ }
145
+
146
+ if (setupKind === 'oauth2') {
147
+ validateOauthBlock(manifest.oauth, errors);
148
+ }
149
+
150
+ if (manifest.health_check != null) {
151
+ validateHealthCheck(manifest.health_check, errors);
152
+ }
153
+
154
+ if (manifest.unlocks_tool_slugs != null && !Array.isArray(manifest.unlocks_tool_slugs)) {
155
+ errors.push('unlocks_tool_slugs: must be an array of tool slug strings');
156
+ }
157
+
158
+ return { ok: errors.length === 0, errors, warnings };
159
+ }
160
+
161
+ export { VALID_SETUP_KINDS };
@@ -27,6 +27,45 @@
27
27
  import { getDb, nowIso } from './db.js';
28
28
  import { appendComplianceAudit } from './compliance-audit.js';
29
29
  import { seedMinesAgents, removeMinesAgents } from './mines/seeds.js';
30
+ import { installAgentTemplate, uninstallAgent } from './agent-templates.js';
31
+
32
+ // Generic module provisioning: provision each agent TEMPLATE the module declares
33
+ // (manifest.agents are template slugs). Idempotent — installAgentTemplate returns
34
+ // the existing install without re-creating. Returns the count provisioned.
35
+ function provisionTemplateAgents(item) {
36
+ const slugs = Array.isArray(item?.module?.agents) ? item.module.agents : [];
37
+ let count = 0;
38
+ for (const slug of slugs) {
39
+ try {
40
+ installAgentTemplate(slug, 'personal');
41
+ count += 1;
42
+ } catch {
43
+ // A missing template slug must not abort the whole install.
44
+ }
45
+ }
46
+ return count;
47
+ }
48
+
49
+ // Remove the agents this module provisioned, resolving each template slug back to
50
+ // its installed agent_id via the installation table. Returns the count removed.
51
+ function deprovisionTemplateAgents(db, item) {
52
+ const slugs = Array.isArray(item?.module?.agents) ? item.module.agents : [];
53
+ let count = 0;
54
+ for (const slug of slugs) {
55
+ try {
56
+ const row = db.prepare(
57
+ "SELECT agent_id FROM agent_template_installations WHERE template_slug = ? AND project_id = 'personal'"
58
+ ).get(slug);
59
+ if (row?.agent_id) {
60
+ uninstallAgent(row.agent_id);
61
+ count += 1;
62
+ }
63
+ } catch {
64
+ // best-effort teardown
65
+ }
66
+ }
67
+ return count;
68
+ }
30
69
 
31
70
  const AUDIT_ORG_ID = 'personal-org';
32
71
  const AUDIT_USER_ID = 'system';
@@ -91,6 +130,9 @@ export function installModule(item, getItem) {
91
130
  const moduleId = item?.module?.module_id || item?.slug;
92
131
  if (moduleId === 'mines') {
93
132
  seedMinesAgents();
133
+ } else {
134
+ // Generic module: provision the agent templates it declares.
135
+ provisionTemplateAgents(item);
94
136
  }
95
137
 
96
138
  writeInstallRow(db, item.id, true, now);
@@ -146,6 +188,9 @@ export function uninstallModule(item, getItem) {
146
188
  if (moduleId === 'mines') {
147
189
  removedProjects = deleteMinesProjects(db);
148
190
  removedAgents = removeMinesAgents();
191
+ } else {
192
+ // Generic module: tear down the agent templates it provisioned.
193
+ removedAgents = deprovisionTemplateAgents(db, item);
149
194
  }
150
195
  writeInstallRow(db, item.id, false, now);
151
196
  db.exec('COMMIT');
@@ -233,6 +233,62 @@ const BUSINESS_SKILL_SEEDS = [
233
233
  },
234
234
  ];
235
235
 
236
+ // Business Agent Suite skill packs (P4). Department-grouped skills that lean on
237
+ // the planned/connected business tools. NOT default-on (no manifest.default) so
238
+ // they don't crowd the fresh-install showcase — they install with the module.
239
+ const BUSINESS_SUITE_SKILL_SEEDS = [
240
+ { slug: 'paid-campaign-build', title: 'Paid Campaign Build', category: 'marketing',
241
+ description: 'Structure a paid campaign — objective, audiences, ad sets, creative spec, and budget — ready for approval-gated launch.',
242
+ tools: ['create_artifact', 'web_search'], risk_summary: 'Plans campaigns; every publish/budget set stays approval-gated.',
243
+ tags: ['marketing', 'ads', 'campaign'], invocation: '/paid-campaign',
244
+ trigger_examples: ['build a Meta campaign', 'plan a paid launch', 'structure ad sets'] },
245
+ { slug: 'ads-reporting', title: 'Ads Reporting', category: 'marketing',
246
+ description: 'Pull spend, CPA, ROAS, and reach from connected ad accounts into one weekly performance report.',
247
+ tools: ['create_artifact', 'file_write'], risk_summary: 'Read-only reporting; no external writes.',
248
+ tags: ['marketing', 'ads', 'reporting'], invocation: '/ads-report',
249
+ trigger_examples: ['weekly ads report', 'how did campaigns perform', 'ROAS summary'] },
250
+ { slug: 'content-calendar', title: 'Content Calendar', category: 'content',
251
+ description: 'Plan a multi-channel content calendar with post drafts, captions, and a scheduled queue.',
252
+ tools: ['create_artifact', 'file_write'], risk_summary: 'Drafts and schedules; every publish stays approval-gated.',
253
+ tags: ['content', 'social', 'calendar'], invocation: '/content-calendar',
254
+ trigger_examples: ['plan this month of content', 'build a content calendar', 'draft social posts'] },
255
+ { slug: 'lead-research', title: 'Lead Research', category: 'sales',
256
+ description: 'Build a qualified target list, enrich it, and prep a personalized outreach sequence.',
257
+ tools: ['web_search', 'web_fetch', 'create_artifact'], risk_summary: 'Research + drafts; sequence enrollment and bulk sends are approval-gated.',
258
+ tags: ['sales', 'outreach', 'leads'], invocation: '/lead-research',
259
+ trigger_examples: ['build a target list', 'find leads for X', 'prep an outreach sequence'] },
260
+ { slug: 'ticket-reply', title: 'Ticket Reply', category: 'support',
261
+ description: 'Triage support tickets, draft replies in brand voice, and flag escalations.',
262
+ tools: ['gmail_messages_list', 'file_write'], risk_summary: 'Drafts replies; outbound sends/status changes are approval-gated.',
263
+ tags: ['support', 'helpdesk', 'tickets'], invocation: '/ticket-reply',
264
+ trigger_examples: ['triage support tickets', 'draft ticket replies', 'escalate this ticket'] },
265
+ { slug: 'runway-model', title: 'Runway Model', category: 'finance',
266
+ description: 'Turn revenue/expense data into a runway model and P&L summary with scenario sensitivity.',
267
+ tools: ['file_read', 'create_artifact'], risk_summary: 'Advisory analysis; any money movement is approval-gated.',
268
+ tags: ['finance', 'runway', 'modeling'], invocation: '/runway',
269
+ trigger_examples: ['model our runway', 'P&L summary', 'how many months of cash'] },
270
+ ];
271
+
272
+ function buildSuiteSkillSeed(s) {
273
+ return {
274
+ slug: s.slug,
275
+ title: s.title,
276
+ description: s.description,
277
+ category: s.category,
278
+ author: 'madarx',
279
+ source_kind: 'builtin',
280
+ source_url: null,
281
+ version: null,
282
+ risk_summary: s.risk_summary,
283
+ tags: s.tags,
284
+ manifest: {
285
+ invocation: s.invocation,
286
+ uses_tools: s.tools,
287
+ trigger_examples: s.trigger_examples,
288
+ },
289
+ };
290
+ }
291
+
236
292
  function buildBusinessSkillSeed(s) {
237
293
  return {
238
294
  slug: s.slug,
@@ -382,9 +438,54 @@ const MINES_MODULE_SEED = {
382
438
  },
383
439
  };
384
440
 
441
+ // ── Business Agent Suite module (P4) ─────────────────────────────────────────
442
+ // A "whole company in a box": one click provisions the cross-department agent
443
+ // roster, installs the department skill packs, enables the safe built-in tools,
444
+ // and points the operator at the connections to authenticate. External-write
445
+ // capabilities (ads, sends, CRM, deploys) stay disabled until the matching
446
+ // connection is set up and granted — nothing dangerous installs hot.
447
+ //
448
+ // manifest.agents are AGENT TEMPLATE SLUGS — installModule provisions each via
449
+ // installAgentTemplate (generic provisioning path in lib/marketplace-modules.js).
450
+ // manifest.connections lists the connection slugs the suite expects (seeded as
451
+ // kind:'connection' items the operator connects on demand).
452
+ const BUSINESS_SUITE_MODULE_SEED = {
453
+ slug: 'business-suite',
454
+ title: 'Business Agent Suite',
455
+ description: 'A whole company in a box: a cross-department roster of business agents, department skill packs, and the connections they need. Marketing, ads, content, sales, support, ops, finance, legal, product, web, analyst, and a Chief of Staff to run the cadence.',
456
+ category: 'business',
457
+ author: 'madarx',
458
+ source_kind: 'builtin',
459
+ source_url: null,
460
+ version: '0.1.0',
461
+ risk_summary: 'Agents install with safe built-in tools only. Ad spend, sends, CRM writes, and deploys stay approval-gated and require connecting + granting the matching service first.',
462
+ tags: ['business', 'company', 'marketing', 'sales', 'ops', 'starter'],
463
+ manifest: {
464
+ module_id: 'business-suite',
465
+ agents: [
466
+ 'chief-of-staff', 'marketing-lead', 'ads-media-buyer', 'content-social',
467
+ 'sales-bd', 'customer-support', 'ops-manager', 'finance-ops',
468
+ 'legal-compliance', 'product-pm', 'web-ecommerce', 'competitor-scout',
469
+ ],
470
+ tools: [
471
+ 'web_search', 'web_fetch', 'file_read', 'file_write', 'create_artifact',
472
+ 'email_send', 'gmail_messages_list', 'calendar_events_list',
473
+ 'create_workflow_definition',
474
+ ],
475
+ skill_packs: [
476
+ 'market-research', 'report-builder', 'paid-campaign-build', 'ads-reporting',
477
+ 'content-calendar', 'lead-research', 'ticket-reply', 'runway-model',
478
+ ],
479
+ connections: ['resend', 'meta-ads', 'google-ads', 'ga4', 'hubspot-crm'],
480
+ workflow_templates: [],
481
+ nav: [],
482
+ },
483
+ };
484
+
385
485
  export function seedMarketplaceItems(db) {
386
486
  try {
387
487
  for (const s of BUSINESS_SKILL_SEEDS) upsertItem(db, 'skill', buildBusinessSkillSeed(s));
488
+ for (const s of BUSINESS_SUITE_SKILL_SEEDS) upsertItem(db, 'skill', buildSuiteSkillSeed(s));
388
489
  for (const seed of SKILL_SEEDS) upsertItem(db, 'skill', seed);
389
490
  for (const seed of BUNDLE_SEEDS) upsertItem(db, 'bundle', seed);
390
491
  for (const curated of OPEN_DESIGN_CURATED_SKILLS) {
@@ -394,6 +495,8 @@ export function seedMarketplaceItems(db) {
394
495
  seedConnections(db);
395
496
  // Mines module entry (kind:'module').
396
497
  upsertItem(db, 'module', MINES_MODULE_SEED);
498
+ // Business Agent Suite module entry (kind:'module').
499
+ upsertItem(db, 'module', BUSINESS_SUITE_MODULE_SEED);
397
500
  } catch (err) {
398
501
  console.warn('[marketplace-seeds] seed failed:', err?.message || err);
399
502
  }
@@ -440,6 +543,8 @@ export function defaultSkillsMarkdown() {
440
543
  return lines.join('\n').trimEnd() + '\n';
441
544
  }
442
545
 
546
+ export const BUSINESS_SUITE_SKILL_SLUGS = BUSINESS_SUITE_SKILL_SEEDS.map(s => s.slug);
547
+ export { BUSINESS_SUITE_MODULE_SEED };
443
548
  export const PHASE1_SKILL_SLUGS = SKILL_SEEDS.map(s => s.slug);
444
549
  export const PHASE1_BUNDLE_SLUGS = BUNDLE_SEEDS.map(s => s.slug);
445
550
  export const OPEN_DESIGN_SKILL_SLUGS = OPEN_DESIGN_CURATED_SKILLS.map(s => `open-design-${s.slug}`);
@@ -195,6 +195,7 @@ function shapeNonToolItem(row, installRow) {
195
195
  agents: Array.isArray(manifest.agents) ? manifest.agents : [],
196
196
  tools: Array.isArray(manifest.tools) ? manifest.tools : [],
197
197
  skill_packs: Array.isArray(manifest.skill_packs) ? manifest.skill_packs : [],
198
+ connections: Array.isArray(manifest.connections) ? manifest.connections : [],
198
199
  workflow_templates: Array.isArray(manifest.workflow_templates)
199
200
  ? manifest.workflow_templates
200
201
  : [],