@agent-native/core 0.109.4 → 0.110.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 (1522) hide show
  1. package/corpus/README.md +1 -1
  2. package/corpus/core/CHANGELOG.md +11 -0
  3. package/corpus/core/docs/content/actions.mdx +2 -4
  4. package/corpus/core/docs/content/agent-surfaces.mdx +2 -4
  5. package/corpus/core/docs/content/audit-log.mdx +1 -2
  6. package/corpus/core/docs/content/authentication.mdx +3 -2
  7. package/corpus/core/docs/content/client.mdx +19 -18
  8. package/corpus/core/docs/content/components.mdx +1 -1
  9. package/corpus/core/docs/content/context-awareness.mdx +4 -7
  10. package/corpus/core/docs/content/creating-templates.mdx +7 -5
  11. package/corpus/core/docs/content/doctor.mdx +27 -6
  12. package/corpus/core/docs/content/drop-in-agent.mdx +6 -11
  13. package/corpus/core/docs/content/embedding-sdk.mdx +8 -10
  14. package/corpus/core/docs/content/getting-started.mdx +4 -2
  15. package/corpus/core/docs/content/internationalization.mdx +9 -6
  16. package/corpus/core/docs/content/key-concepts.mdx +2 -4
  17. package/corpus/core/docs/content/locales/ar-SA/actions.mdx +2 -4
  18. package/corpus/core/docs/content/locales/ar-SA/agent-surfaces.mdx +2 -4
  19. package/corpus/core/docs/content/locales/ar-SA/audit-log.mdx +1 -2
  20. package/corpus/core/docs/content/locales/ar-SA/authentication.mdx +3 -2
  21. package/corpus/core/docs/content/locales/ar-SA/client.mdx +19 -18
  22. package/corpus/core/docs/content/locales/ar-SA/components.mdx +1 -1
  23. package/corpus/core/docs/content/locales/ar-SA/context-awareness.mdx +4 -7
  24. package/corpus/core/docs/content/locales/ar-SA/creating-templates.mdx +7 -5
  25. package/corpus/core/docs/content/locales/ar-SA/doctor.mdx +10 -0
  26. package/corpus/core/docs/content/locales/ar-SA/drop-in-agent.mdx +6 -11
  27. package/corpus/core/docs/content/locales/ar-SA/embedding-sdk.mdx +8 -10
  28. package/corpus/core/docs/content/locales/ar-SA/internationalization.mdx +9 -6
  29. package/corpus/core/docs/content/locales/ar-SA/key-concepts.mdx +2 -4
  30. package/corpus/core/docs/content/locales/ar-SA/observability.mdx +1 -2
  31. package/corpus/core/docs/content/locales/ar-SA/package-lifecycle.mdx +6 -0
  32. package/corpus/core/docs/content/locales/ar-SA/real-time-collaboration.mdx +4 -7
  33. package/corpus/core/docs/content/locales/ar-SA/sharing.mdx +1 -2
  34. package/corpus/core/docs/content/locales/ar-SA/template-chat.mdx +1 -2
  35. package/corpus/core/docs/content/locales/ar-SA/tracking.mdx +2 -4
  36. package/corpus/core/docs/content/locales/ar-SA/what-is-agent-native.mdx +1 -2
  37. package/corpus/core/docs/content/locales/de-DE/actions.mdx +2 -4
  38. package/corpus/core/docs/content/locales/de-DE/agent-surfaces.mdx +2 -4
  39. package/corpus/core/docs/content/locales/de-DE/audit-log.mdx +1 -2
  40. package/corpus/core/docs/content/locales/de-DE/authentication.mdx +3 -2
  41. package/corpus/core/docs/content/locales/de-DE/client.mdx +19 -18
  42. package/corpus/core/docs/content/locales/de-DE/components.mdx +1 -1
  43. package/corpus/core/docs/content/locales/de-DE/context-awareness.mdx +4 -7
  44. package/corpus/core/docs/content/locales/de-DE/creating-templates.mdx +7 -5
  45. package/corpus/core/docs/content/locales/de-DE/doctor.mdx +10 -0
  46. package/corpus/core/docs/content/locales/de-DE/drop-in-agent.mdx +6 -11
  47. package/corpus/core/docs/content/locales/de-DE/embedding-sdk.mdx +8 -10
  48. package/corpus/core/docs/content/locales/de-DE/internationalization.mdx +9 -6
  49. package/corpus/core/docs/content/locales/de-DE/key-concepts.mdx +2 -4
  50. package/corpus/core/docs/content/locales/de-DE/observability.mdx +1 -2
  51. package/corpus/core/docs/content/locales/de-DE/package-lifecycle.mdx +6 -0
  52. package/corpus/core/docs/content/locales/de-DE/real-time-collaboration.mdx +4 -7
  53. package/corpus/core/docs/content/locales/de-DE/sharing.mdx +1 -2
  54. package/corpus/core/docs/content/locales/de-DE/template-chat.mdx +1 -2
  55. package/corpus/core/docs/content/locales/de-DE/tracking.mdx +2 -4
  56. package/corpus/core/docs/content/locales/de-DE/what-is-agent-native.mdx +1 -2
  57. package/corpus/core/docs/content/locales/es-ES/actions.mdx +2 -4
  58. package/corpus/core/docs/content/locales/es-ES/agent-surfaces.mdx +2 -4
  59. package/corpus/core/docs/content/locales/es-ES/audit-log.mdx +1 -2
  60. package/corpus/core/docs/content/locales/es-ES/authentication.mdx +3 -2
  61. package/corpus/core/docs/content/locales/es-ES/client.mdx +19 -18
  62. package/corpus/core/docs/content/locales/es-ES/components.mdx +1 -1
  63. package/corpus/core/docs/content/locales/es-ES/context-awareness.mdx +4 -7
  64. package/corpus/core/docs/content/locales/es-ES/creating-templates.mdx +7 -5
  65. package/corpus/core/docs/content/locales/es-ES/doctor.mdx +10 -0
  66. package/corpus/core/docs/content/locales/es-ES/drop-in-agent.mdx +6 -11
  67. package/corpus/core/docs/content/locales/es-ES/embedding-sdk.mdx +8 -10
  68. package/corpus/core/docs/content/locales/es-ES/internationalization.mdx +9 -6
  69. package/corpus/core/docs/content/locales/es-ES/key-concepts.mdx +2 -4
  70. package/corpus/core/docs/content/locales/es-ES/observability.mdx +1 -2
  71. package/corpus/core/docs/content/locales/es-ES/package-lifecycle.mdx +6 -0
  72. package/corpus/core/docs/content/locales/es-ES/real-time-collaboration.mdx +4 -7
  73. package/corpus/core/docs/content/locales/es-ES/sharing.mdx +1 -2
  74. package/corpus/core/docs/content/locales/es-ES/template-chat.mdx +1 -2
  75. package/corpus/core/docs/content/locales/es-ES/tracking.mdx +2 -4
  76. package/corpus/core/docs/content/locales/es-ES/what-is-agent-native.mdx +1 -2
  77. package/corpus/core/docs/content/locales/fr-FR/actions.mdx +2 -4
  78. package/corpus/core/docs/content/locales/fr-FR/agent-surfaces.mdx +2 -4
  79. package/corpus/core/docs/content/locales/fr-FR/audit-log.mdx +1 -2
  80. package/corpus/core/docs/content/locales/fr-FR/authentication.mdx +3 -2
  81. package/corpus/core/docs/content/locales/fr-FR/client.mdx +19 -18
  82. package/corpus/core/docs/content/locales/fr-FR/components.mdx +1 -1
  83. package/corpus/core/docs/content/locales/fr-FR/context-awareness.mdx +4 -7
  84. package/corpus/core/docs/content/locales/fr-FR/creating-templates.mdx +7 -5
  85. package/corpus/core/docs/content/locales/fr-FR/doctor.mdx +10 -0
  86. package/corpus/core/docs/content/locales/fr-FR/drop-in-agent.mdx +6 -11
  87. package/corpus/core/docs/content/locales/fr-FR/embedding-sdk.mdx +8 -10
  88. package/corpus/core/docs/content/locales/fr-FR/internationalization.mdx +9 -6
  89. package/corpus/core/docs/content/locales/fr-FR/key-concepts.mdx +2 -4
  90. package/corpus/core/docs/content/locales/fr-FR/observability.mdx +1 -2
  91. package/corpus/core/docs/content/locales/fr-FR/package-lifecycle.mdx +6 -0
  92. package/corpus/core/docs/content/locales/fr-FR/real-time-collaboration.mdx +4 -7
  93. package/corpus/core/docs/content/locales/fr-FR/sharing.mdx +1 -2
  94. package/corpus/core/docs/content/locales/fr-FR/template-chat.mdx +1 -2
  95. package/corpus/core/docs/content/locales/fr-FR/tracking.mdx +2 -4
  96. package/corpus/core/docs/content/locales/fr-FR/what-is-agent-native.mdx +1 -2
  97. package/corpus/core/docs/content/locales/hi-IN/actions.mdx +2 -4
  98. package/corpus/core/docs/content/locales/hi-IN/agent-surfaces.mdx +2 -4
  99. package/corpus/core/docs/content/locales/hi-IN/audit-log.mdx +1 -2
  100. package/corpus/core/docs/content/locales/hi-IN/authentication.mdx +3 -2
  101. package/corpus/core/docs/content/locales/hi-IN/client.mdx +19 -18
  102. package/corpus/core/docs/content/locales/hi-IN/components.mdx +1 -1
  103. package/corpus/core/docs/content/locales/hi-IN/context-awareness.mdx +4 -7
  104. package/corpus/core/docs/content/locales/hi-IN/creating-templates.mdx +7 -5
  105. package/corpus/core/docs/content/locales/hi-IN/doctor.mdx +10 -0
  106. package/corpus/core/docs/content/locales/hi-IN/drop-in-agent.mdx +6 -11
  107. package/corpus/core/docs/content/locales/hi-IN/embedding-sdk.mdx +8 -10
  108. package/corpus/core/docs/content/locales/hi-IN/internationalization.mdx +9 -6
  109. package/corpus/core/docs/content/locales/hi-IN/key-concepts.mdx +2 -4
  110. package/corpus/core/docs/content/locales/hi-IN/observability.mdx +1 -2
  111. package/corpus/core/docs/content/locales/hi-IN/package-lifecycle.mdx +6 -0
  112. package/corpus/core/docs/content/locales/hi-IN/real-time-collaboration.mdx +4 -7
  113. package/corpus/core/docs/content/locales/hi-IN/sharing.mdx +1 -2
  114. package/corpus/core/docs/content/locales/hi-IN/template-chat.mdx +1 -2
  115. package/corpus/core/docs/content/locales/hi-IN/tracking.mdx +2 -4
  116. package/corpus/core/docs/content/locales/hi-IN/what-is-agent-native.mdx +1 -2
  117. package/corpus/core/docs/content/locales/ja-JP/actions.mdx +2 -4
  118. package/corpus/core/docs/content/locales/ja-JP/agent-surfaces.mdx +2 -4
  119. package/corpus/core/docs/content/locales/ja-JP/audit-log.mdx +1 -2
  120. package/corpus/core/docs/content/locales/ja-JP/authentication.mdx +3 -2
  121. package/corpus/core/docs/content/locales/ja-JP/client.mdx +19 -18
  122. package/corpus/core/docs/content/locales/ja-JP/components.mdx +1 -1
  123. package/corpus/core/docs/content/locales/ja-JP/context-awareness.mdx +4 -7
  124. package/corpus/core/docs/content/locales/ja-JP/creating-templates.mdx +7 -5
  125. package/corpus/core/docs/content/locales/ja-JP/doctor.mdx +10 -0
  126. package/corpus/core/docs/content/locales/ja-JP/drop-in-agent.mdx +6 -11
  127. package/corpus/core/docs/content/locales/ja-JP/embedding-sdk.mdx +8 -10
  128. package/corpus/core/docs/content/locales/ja-JP/internationalization.mdx +9 -6
  129. package/corpus/core/docs/content/locales/ja-JP/key-concepts.mdx +2 -4
  130. package/corpus/core/docs/content/locales/ja-JP/observability.mdx +1 -2
  131. package/corpus/core/docs/content/locales/ja-JP/package-lifecycle.mdx +6 -0
  132. package/corpus/core/docs/content/locales/ja-JP/real-time-collaboration.mdx +4 -7
  133. package/corpus/core/docs/content/locales/ja-JP/sharing.mdx +1 -2
  134. package/corpus/core/docs/content/locales/ja-JP/template-chat.mdx +1 -2
  135. package/corpus/core/docs/content/locales/ja-JP/tracking.mdx +2 -4
  136. package/corpus/core/docs/content/locales/ja-JP/what-is-agent-native.mdx +1 -2
  137. package/corpus/core/docs/content/locales/ko-KR/actions.mdx +2 -4
  138. package/corpus/core/docs/content/locales/ko-KR/agent-surfaces.mdx +2 -4
  139. package/corpus/core/docs/content/locales/ko-KR/audit-log.mdx +1 -2
  140. package/corpus/core/docs/content/locales/ko-KR/authentication.mdx +3 -2
  141. package/corpus/core/docs/content/locales/ko-KR/client.mdx +19 -18
  142. package/corpus/core/docs/content/locales/ko-KR/components.mdx +1 -1
  143. package/corpus/core/docs/content/locales/ko-KR/context-awareness.mdx +4 -7
  144. package/corpus/core/docs/content/locales/ko-KR/creating-templates.mdx +7 -5
  145. package/corpus/core/docs/content/locales/ko-KR/doctor.mdx +10 -0
  146. package/corpus/core/docs/content/locales/ko-KR/drop-in-agent.mdx +6 -11
  147. package/corpus/core/docs/content/locales/ko-KR/embedding-sdk.mdx +8 -10
  148. package/corpus/core/docs/content/locales/ko-KR/internationalization.mdx +9 -6
  149. package/corpus/core/docs/content/locales/ko-KR/key-concepts.mdx +2 -4
  150. package/corpus/core/docs/content/locales/ko-KR/observability.mdx +1 -2
  151. package/corpus/core/docs/content/locales/ko-KR/package-lifecycle.mdx +6 -0
  152. package/corpus/core/docs/content/locales/ko-KR/real-time-collaboration.mdx +4 -7
  153. package/corpus/core/docs/content/locales/ko-KR/sharing.mdx +1 -2
  154. package/corpus/core/docs/content/locales/ko-KR/template-chat.mdx +1 -2
  155. package/corpus/core/docs/content/locales/ko-KR/tracking.mdx +2 -4
  156. package/corpus/core/docs/content/locales/ko-KR/what-is-agent-native.mdx +1 -2
  157. package/corpus/core/docs/content/locales/pt-BR/actions.mdx +2 -4
  158. package/corpus/core/docs/content/locales/pt-BR/agent-surfaces.mdx +2 -4
  159. package/corpus/core/docs/content/locales/pt-BR/audit-log.mdx +1 -2
  160. package/corpus/core/docs/content/locales/pt-BR/authentication.mdx +3 -2
  161. package/corpus/core/docs/content/locales/pt-BR/client.mdx +19 -18
  162. package/corpus/core/docs/content/locales/pt-BR/components.mdx +1 -1
  163. package/corpus/core/docs/content/locales/pt-BR/context-awareness.mdx +4 -7
  164. package/corpus/core/docs/content/locales/pt-BR/creating-templates.mdx +7 -5
  165. package/corpus/core/docs/content/locales/pt-BR/doctor.mdx +10 -0
  166. package/corpus/core/docs/content/locales/pt-BR/drop-in-agent.mdx +6 -11
  167. package/corpus/core/docs/content/locales/pt-BR/embedding-sdk.mdx +8 -10
  168. package/corpus/core/docs/content/locales/pt-BR/internationalization.mdx +9 -6
  169. package/corpus/core/docs/content/locales/pt-BR/key-concepts.mdx +2 -4
  170. package/corpus/core/docs/content/locales/pt-BR/observability.mdx +1 -2
  171. package/corpus/core/docs/content/locales/pt-BR/package-lifecycle.mdx +6 -0
  172. package/corpus/core/docs/content/locales/pt-BR/real-time-collaboration.mdx +4 -7
  173. package/corpus/core/docs/content/locales/pt-BR/sharing.mdx +1 -2
  174. package/corpus/core/docs/content/locales/pt-BR/template-chat.mdx +1 -2
  175. package/corpus/core/docs/content/locales/pt-BR/tracking.mdx +2 -4
  176. package/corpus/core/docs/content/locales/pt-BR/what-is-agent-native.mdx +1 -2
  177. package/corpus/core/docs/content/locales/zh-CN/actions.mdx +2 -4
  178. package/corpus/core/docs/content/locales/zh-CN/agent-surfaces.mdx +2 -4
  179. package/corpus/core/docs/content/locales/zh-CN/audit-log.mdx +1 -2
  180. package/corpus/core/docs/content/locales/zh-CN/authentication.mdx +3 -2
  181. package/corpus/core/docs/content/locales/zh-CN/client.mdx +19 -18
  182. package/corpus/core/docs/content/locales/zh-CN/components.mdx +1 -1
  183. package/corpus/core/docs/content/locales/zh-CN/context-awareness.mdx +4 -7
  184. package/corpus/core/docs/content/locales/zh-CN/creating-templates.mdx +7 -5
  185. package/corpus/core/docs/content/locales/zh-CN/doctor.mdx +10 -0
  186. package/corpus/core/docs/content/locales/zh-CN/drop-in-agent.mdx +6 -11
  187. package/corpus/core/docs/content/locales/zh-CN/embedding-sdk.mdx +8 -10
  188. package/corpus/core/docs/content/locales/zh-CN/internationalization.mdx +9 -6
  189. package/corpus/core/docs/content/locales/zh-CN/key-concepts.mdx +2 -4
  190. package/corpus/core/docs/content/locales/zh-CN/observability.mdx +1 -2
  191. package/corpus/core/docs/content/locales/zh-CN/package-lifecycle.mdx +6 -0
  192. package/corpus/core/docs/content/locales/zh-CN/real-time-collaboration.mdx +4 -7
  193. package/corpus/core/docs/content/locales/zh-CN/sharing.mdx +1 -2
  194. package/corpus/core/docs/content/locales/zh-CN/template-chat.mdx +1 -2
  195. package/corpus/core/docs/content/locales/zh-CN/tracking.mdx +2 -4
  196. package/corpus/core/docs/content/locales/zh-CN/what-is-agent-native.mdx +1 -2
  197. package/corpus/core/docs/content/locales/zh-TW/actions.mdx +2 -4
  198. package/corpus/core/docs/content/locales/zh-TW/agent-surfaces.mdx +2 -4
  199. package/corpus/core/docs/content/locales/zh-TW/audit-log.mdx +1 -2
  200. package/corpus/core/docs/content/locales/zh-TW/authentication.mdx +3 -2
  201. package/corpus/core/docs/content/locales/zh-TW/client.mdx +19 -18
  202. package/corpus/core/docs/content/locales/zh-TW/components.mdx +1 -1
  203. package/corpus/core/docs/content/locales/zh-TW/context-awareness.mdx +4 -7
  204. package/corpus/core/docs/content/locales/zh-TW/creating-templates.mdx +7 -5
  205. package/corpus/core/docs/content/locales/zh-TW/doctor.mdx +10 -0
  206. package/corpus/core/docs/content/locales/zh-TW/drop-in-agent.mdx +6 -11
  207. package/corpus/core/docs/content/locales/zh-TW/embedding-sdk.mdx +8 -10
  208. package/corpus/core/docs/content/locales/zh-TW/internationalization.mdx +9 -6
  209. package/corpus/core/docs/content/locales/zh-TW/key-concepts.mdx +2 -4
  210. package/corpus/core/docs/content/locales/zh-TW/observability.mdx +1 -2
  211. package/corpus/core/docs/content/locales/zh-TW/package-lifecycle.mdx +6 -0
  212. package/corpus/core/docs/content/locales/zh-TW/real-time-collaboration.mdx +4 -7
  213. package/corpus/core/docs/content/locales/zh-TW/sharing.mdx +1 -2
  214. package/corpus/core/docs/content/locales/zh-TW/template-chat.mdx +1 -2
  215. package/corpus/core/docs/content/locales/zh-TW/tracking.mdx +2 -4
  216. package/corpus/core/docs/content/locales/zh-TW/what-is-agent-native.mdx +1 -2
  217. package/corpus/core/docs/content/observability.mdx +1 -2
  218. package/corpus/core/docs/content/package-lifecycle.mdx +29 -0
  219. package/corpus/core/docs/content/real-time-collaboration.mdx +8 -7
  220. package/corpus/core/docs/content/sharing.mdx +1 -2
  221. package/corpus/core/docs/content/template-chat.mdx +1 -2
  222. package/corpus/core/docs/content/toolkit-agent-ux.mdx +3 -2
  223. package/corpus/core/docs/content/toolkit-observability.mdx +1 -2
  224. package/corpus/core/docs/content/toolkit-settings.mdx +2 -2
  225. package/corpus/core/docs/content/toolkit-sharing.mdx +5 -2
  226. package/corpus/core/docs/content/tracking.mdx +2 -4
  227. package/corpus/core/docs/content/what-is-agent-native.mdx +1 -2
  228. package/corpus/core/export-snapshot.json +324 -0
  229. package/corpus/core/migration-manifest.json +1353 -0
  230. package/corpus/core/package.json +21 -3
  231. package/corpus/core/src/cli/doctor.ts +77 -7
  232. package/corpus/core/src/cli/migration-codemod.ts +569 -0
  233. package/corpus/core/src/cli/upgrade.ts +63 -7
  234. package/corpus/core/src/client/agent-chat/index.ts +279 -0
  235. package/corpus/core/src/client/agent-page/AgentContextTab.tsx +3 -1
  236. package/corpus/core/src/client/analytics/index.ts +40 -0
  237. package/corpus/core/src/client/api-path.ts +2 -2
  238. package/corpus/core/src/client/automation/index.ts +4 -0
  239. package/corpus/core/src/client/changelog/index.ts +1 -0
  240. package/corpus/core/src/client/chat/widgets/InlineExtensionWidget.tsx +5 -84
  241. package/corpus/core/src/client/chat/widgets/builtin-tool-renderers.tsx +52 -14
  242. package/corpus/core/src/client/chat/widgets/inline-extension-result.ts +86 -0
  243. package/corpus/core/src/client/client-bootstrap.ts +7 -0
  244. package/corpus/core/src/client/context-xray/ContextXRayPanel.tsx +1 -1
  245. package/corpus/core/src/client/hooks/index.ts +46 -0
  246. package/corpus/core/src/client/host/index.ts +170 -0
  247. package/corpus/core/src/client/index.ts +20 -664
  248. package/corpus/core/src/client/navigation/index.ts +54 -0
  249. package/corpus/core/src/client/resources/ResourcesPanel.tsx +1 -1
  250. package/corpus/core/src/client/resources/index.ts +2 -1
  251. package/corpus/core/src/client/resources/use-resources.ts +0 -20
  252. package/corpus/core/src/client/route-chunk-recovery/index.ts +1 -0
  253. package/corpus/core/src/client/ui/index.ts +55 -0
  254. package/corpus/core/src/client/uploads/index.ts +1 -0
  255. package/corpus/core/src/client/uploads/use-upload-resource.ts +24 -0
  256. package/corpus/core/src/client/widgets/index.ts +41 -0
  257. package/corpus/core/src/localization/default-messages.ts +2 -1
  258. package/corpus/core/src/package-lifecycle/deprecated-imports.ts +179 -0
  259. package/corpus/core/src/package-lifecycle/index.ts +5 -0
  260. package/corpus/core/src/package-lifecycle/migration-manifest.ts +159 -0
  261. package/corpus/core/src/package-lifecycle/migration-message.ts +6 -0
  262. package/corpus/core/src/package-lifecycle/tombstone.ts +44 -0
  263. package/corpus/core/src/package-lifecycle/upgrade-error.ts +19 -0
  264. package/corpus/core/src/templates/default/.agents/skills/actions/SKILL.md +3 -3
  265. package/corpus/core/src/templates/default/.agents/skills/adding-a-feature/SKILL.md +1 -1
  266. package/corpus/core/src/templates/default/.agents/skills/delegate-to-agent/SKILL.md +3 -3
  267. package/corpus/core/src/templates/default/.agents/skills/feature-flags/SKILL.md +1 -1
  268. package/corpus/core/src/templates/default/.agents/skills/real-time-collab/SKILL.md +4 -4
  269. package/corpus/core/src/templates/default/.agents/skills/real-time-sync/SKILL.md +4 -4
  270. package/corpus/core/src/templates/default/.agents/skills/storing-data/SKILL.md +1 -1
  271. package/corpus/core/src/templates/default/.agents/skills/upgrade-agent-native/SKILL.md +12 -5
  272. package/corpus/core/src/templates/default/app/hooks/use-navigation-state.ts +2 -5
  273. package/corpus/core/src/templates/default/app/i18n/index.ts +1 -1
  274. package/corpus/core/src/templates/default/app/lib/utils.ts +1 -1
  275. package/corpus/core/src/templates/default/app/root.tsx +8 -6
  276. package/corpus/core/src/templates/default/app/routes/_index.tsx +2 -1
  277. package/corpus/core/src/templates/default/app/routes/agent.tsx +2 -1
  278. package/corpus/core/src/templates/default/app/routes/settings.tsx +2 -3
  279. package/corpus/core/src/templates/headless/.agents/skills/feature-flags/SKILL.md +1 -1
  280. package/corpus/core/src/templates/headless/.agents/skills/upgrade-agent-native/SKILL.md +12 -5
  281. package/corpus/core/src/templates/workspace-core/.agents/skills/actions/SKILL.md +3 -3
  282. package/corpus/core/src/templates/workspace-core/.agents/skills/adding-a-feature/SKILL.md +1 -1
  283. package/corpus/core/src/templates/workspace-core/.agents/skills/authentication/SKILL.md +1 -1
  284. package/corpus/core/src/templates/workspace-core/.agents/skills/changelog/SKILL.md +1 -1
  285. package/corpus/core/src/templates/workspace-core/.agents/skills/client-methods/SKILL.md +10 -10
  286. package/corpus/core/src/templates/workspace-core/.agents/skills/context-awareness/SKILL.md +1 -1
  287. package/corpus/core/src/templates/workspace-core/.agents/skills/delegate-to-agent/SKILL.md +3 -3
  288. package/corpus/core/src/templates/workspace-core/.agents/skills/feature-flags/SKILL.md +1 -1
  289. package/corpus/core/src/templates/workspace-core/.agents/skills/observability/SKILL.md +1 -1
  290. package/corpus/core/src/templates/workspace-core/.agents/skills/real-time-collab/SKILL.md +4 -4
  291. package/corpus/core/src/templates/workspace-core/.agents/skills/real-time-sync/SKILL.md +4 -4
  292. package/corpus/core/src/templates/workspace-core/.agents/skills/sharing/SKILL.md +1 -1
  293. package/corpus/core/src/templates/workspace-core/.agents/skills/storing-data/SKILL.md +1 -1
  294. package/corpus/core/src/templates/workspace-core/.agents/skills/upgrade-agent-native/SKILL.md +12 -5
  295. package/corpus/core/src/vite/action-types-plugin.ts +4 -0
  296. package/corpus/core/src/vite/client.ts +80 -65
  297. package/corpus/templates/analytics/.agents/skills/actions/SKILL.md +3 -3
  298. package/corpus/templates/analytics/.agents/skills/delegate-to-agent/SKILL.md +3 -3
  299. package/corpus/templates/analytics/.agents/skills/feature-flags/SKILL.md +1 -1
  300. package/corpus/templates/analytics/.agents/skills/real-time-sync/SKILL.md +4 -4
  301. package/corpus/templates/analytics/.agents/skills/storing-data/SKILL.md +1 -1
  302. package/corpus/templates/analytics/.agents/skills/upgrade-agent-native/SKILL.md +12 -5
  303. package/corpus/templates/analytics/app/components/Markdown.tsx +1 -1
  304. package/corpus/templates/analytics/app/components/ProviderCorpusJobNotifier.tsx +2 -1
  305. package/corpus/templates/analytics/app/components/agents/FeatureFlagsFleetPanel.tsx +6 -4
  306. package/corpus/templates/analytics/app/components/analysis/AnalysisHistoryPanel.tsx +1 -1
  307. package/corpus/templates/analytics/app/components/auth/AuthProvider.tsx +2 -2
  308. package/corpus/templates/analytics/app/components/dashboard/CumulativeNetChart.tsx +1 -1
  309. package/corpus/templates/analytics/app/components/dashboard/DashboardHistoryPanel.tsx +1 -1
  310. package/corpus/templates/analytics/app/components/dashboard/DataTable.tsx +1 -1
  311. package/corpus/templates/analytics/app/components/dashboard/RecentActivity.tsx +1 -1
  312. package/corpus/templates/analytics/app/components/dashboard/RevenueChart.tsx +1 -1
  313. package/corpus/templates/analytics/app/components/dashboard/RevenueComparisonChart.tsx +1 -1
  314. package/corpus/templates/analytics/app/components/dashboard/SqlChart.tsx +2 -1
  315. package/corpus/templates/analytics/app/components/dashboard/TimeSeriesChart.tsx +1 -1
  316. package/corpus/templates/analytics/app/components/layout/CommandPalette.tsx +4 -6
  317. package/corpus/templates/analytics/app/components/layout/DashboardHeader.tsx +1 -1
  318. package/corpus/templates/analytics/app/components/layout/Header.tsx +2 -2
  319. package/corpus/templates/analytics/app/components/layout/HeaderActions.tsx +1 -1
  320. package/corpus/templates/analytics/app/components/layout/Layout.tsx +3 -3
  321. package/corpus/templates/analytics/app/components/layout/MobileNav.tsx +1 -1
  322. package/corpus/templates/analytics/app/components/layout/NewAnalysisDialog.tsx +4 -6
  323. package/corpus/templates/analytics/app/components/layout/NewDashboardDialog.tsx +3 -5
  324. package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +10 -10
  325. package/corpus/templates/analytics/app/entry.client.tsx +2 -4
  326. package/corpus/templates/analytics/app/hooks/use-analysis-revisions.ts +4 -1
  327. package/corpus/templates/analytics/app/hooks/use-dashboard-chat-context.ts +6 -4
  328. package/corpus/templates/analytics/app/hooks/use-dashboard-revisions.ts +4 -1
  329. package/corpus/templates/analytics/app/hooks/use-dashboard-views.ts +1 -1
  330. package/corpus/templates/analytics/app/hooks/use-navigation-state.ts +2 -4
  331. package/corpus/templates/analytics/app/hooks/use-replay-storage-status.ts +1 -1
  332. package/corpus/templates/analytics/app/hooks/use-user-pref.ts +1 -1
  333. package/corpus/templates/analytics/app/i18n/index.ts +1 -1
  334. package/corpus/templates/analytics/app/i18n-data.ts +1 -1
  335. package/corpus/templates/analytics/app/lib/api-hooks.ts +1 -1
  336. package/corpus/templates/analytics/app/lib/item-popularity.ts +1 -1
  337. package/corpus/templates/analytics/app/lib/query-metrics.ts +1 -1
  338. package/corpus/templates/analytics/app/lib/sql-query.ts +1 -1
  339. package/corpus/templates/analytics/app/lib/tab-id.ts +1 -1
  340. package/corpus/templates/analytics/app/lib/track-metric.ts +1 -1
  341. package/corpus/templates/analytics/app/lib/user-info.ts +1 -1
  342. package/corpus/templates/analytics/app/lib/utils.ts +1 -1
  343. package/corpus/templates/analytics/app/pages/Agents.tsx +5 -6
  344. package/corpus/templates/analytics/app/pages/Ask.tsx +2 -2
  345. package/corpus/templates/analytics/app/pages/DataDictionary.tsx +3 -3
  346. package/corpus/templates/analytics/app/pages/DataSources.tsx +7 -5
  347. package/corpus/templates/analytics/app/pages/NotFound.tsx +1 -1
  348. package/corpus/templates/analytics/app/pages/Placeholder.tsx +1 -1
  349. package/corpus/templates/analytics/app/pages/Settings.tsx +5 -6
  350. package/corpus/templates/analytics/app/pages/adhoc/BlankDashboard.tsx +1 -1
  351. package/corpus/templates/analytics/app/pages/adhoc/_shared/KpiChart.tsx +1 -1
  352. package/corpus/templates/analytics/app/pages/adhoc/explorer/components/EventCombobox.tsx +1 -1
  353. package/corpus/templates/analytics/app/pages/adhoc/explorer/components/EventPanel.tsx +1 -1
  354. package/corpus/templates/analytics/app/pages/adhoc/explorer/components/ExplorerChart.tsx +1 -1
  355. package/corpus/templates/analytics/app/pages/adhoc/explorer/components/FilterBuilder.tsx +1 -1
  356. package/corpus/templates/analytics/app/pages/adhoc/explorer/components/GroupByPicker.tsx +1 -1
  357. package/corpus/templates/analytics/app/pages/adhoc/explorer/components/PropertyCombobox.tsx +1 -1
  358. package/corpus/templates/analytics/app/pages/adhoc/explorer/components/PropertyValueCombobox.tsx +1 -1
  359. package/corpus/templates/analytics/app/pages/adhoc/explorer/components/SqlPreview.tsx +1 -1
  360. package/corpus/templates/analytics/app/pages/adhoc/explorer/index.tsx +1 -1
  361. package/corpus/templates/analytics/app/pages/adhoc/explorer/use-explorer-config.ts +2 -1
  362. package/corpus/templates/analytics/app/pages/adhoc/explorer-dashboard/ChartCard.tsx +2 -1
  363. package/corpus/templates/analytics/app/pages/adhoc/explorer-dashboard/index.tsx +8 -6
  364. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/DashboardFilterBar.tsx +1 -1
  365. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/EmailReportDialog.tsx +2 -2
  366. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/PanelEditorDialog.tsx +4 -6
  367. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/SqlChartCard.tsx +1 -1
  368. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/ViewSqlPopover.tsx +2 -1
  369. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/ViewsMenu.tsx +1 -1
  370. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/index.tsx +9 -7
  371. package/corpus/templates/analytics/app/pages/analyses/AnalysesList.tsx +3 -6
  372. package/corpus/templates/analytics/app/pages/analyses/AnalysisDetail.tsx +4 -4
  373. package/corpus/templates/analytics/app/pages/analyses/LegacyFusionAnalysis.tsx +2 -1
  374. package/corpus/templates/analytics/app/pages/monitoring/ErrorsPanel.tsx +1 -11
  375. package/corpus/templates/analytics/app/pages/monitoring/MonitoringPage.tsx +2 -1
  376. package/corpus/templates/analytics/app/pages/monitoring/UptimePanel.tsx +1 -14
  377. package/corpus/templates/analytics/app/pages/monitoring/errors/IssueDetail.tsx +1 -1
  378. package/corpus/templates/analytics/app/pages/monitoring/errors/IssueList.tsx +1 -1
  379. package/corpus/templates/analytics/app/pages/monitoring/errors/i18n.ts +1 -6
  380. package/corpus/templates/analytics/app/pages/monitoring/uptime/MonitorDetail.tsx +1 -8
  381. package/corpus/templates/analytics/app/pages/monitoring/uptime/MonitorFormPage.tsx +4 -10
  382. package/corpus/templates/analytics/app/pages/monitoring/uptime/i18n.ts +1 -6
  383. package/corpus/templates/analytics/app/pages/monitoring/uptime/status-pages/StatusPageEditor.tsx +4 -8
  384. package/corpus/templates/analytics/app/pages/monitoring/uptime/status-pages/StatusPagesView.tsx +4 -10
  385. package/corpus/templates/analytics/app/pages/monitoring/uptime/status-pages/i18n.ts +1 -6
  386. package/corpus/templates/analytics/app/pages/sessions/SessionDetailPage.tsx +5 -6
  387. package/corpus/templates/analytics/app/pages/sessions/SessionDevToolsPanel.tsx +1 -1
  388. package/corpus/templates/analytics/app/pages/sessions/SessionsPage.tsx +5 -5
  389. package/corpus/templates/analytics/app/pages/settings/AlertRulesSettingsCard.tsx +2 -2
  390. package/corpus/templates/analytics/app/pages/settings/settings-search.ts +1 -1
  391. package/corpus/templates/analytics/app/root.tsx +6 -6
  392. package/corpus/templates/analytics/app/routes/agent.tsx +1 -1
  393. package/corpus/templates/analytics/app/routes/catalog.tsx +2 -2
  394. package/corpus/templates/analytics/app/routes/chart.tsx +1 -1
  395. package/corpus/templates/analytics/app/routes/status.$slug.tsx +1 -13
  396. package/corpus/templates/assets/.agents/skills/actions/SKILL.md +3 -3
  397. package/corpus/templates/assets/.agents/skills/delegate-to-agent/SKILL.md +3 -3
  398. package/corpus/templates/assets/.agents/skills/feature-flags/SKILL.md +1 -1
  399. package/corpus/templates/assets/.agents/skills/real-time-collab/SKILL.md +4 -4
  400. package/corpus/templates/assets/.agents/skills/real-time-sync/SKILL.md +4 -4
  401. package/corpus/templates/assets/.agents/skills/storing-data/SKILL.md +1 -1
  402. package/corpus/templates/assets/.agents/skills/upgrade-agent-native/SKILL.md +12 -5
  403. package/corpus/templates/assets/app/components/create/RecentDraftsSection.tsx +2 -1
  404. package/corpus/templates/assets/app/components/generation/GenerationResults.tsx +3 -3
  405. package/corpus/templates/assets/app/components/layout/Header.tsx +3 -5
  406. package/corpus/templates/assets/app/components/layout/Layout.tsx +4 -4
  407. package/corpus/templates/assets/app/components/layout/Sidebar.tsx +6 -6
  408. package/corpus/templates/assets/app/components/library/CreateLibraryDialog.tsx +2 -2
  409. package/corpus/templates/assets/app/components/library/GenerationPresetsPanel.tsx +2 -1
  410. package/corpus/templates/assets/app/components/library/LibraryCard.tsx +1 -1
  411. package/corpus/templates/assets/app/components/library/LibraryPresetGrid.tsx +1 -1
  412. package/corpus/templates/assets/app/hooks/use-image-model-menu.ts +2 -2
  413. package/corpus/templates/assets/app/hooks/use-navigation-state.ts +3 -3
  414. package/corpus/templates/assets/app/i18n/index.ts +1 -1
  415. package/corpus/templates/assets/app/i18n-data.ts +1 -1
  416. package/corpus/templates/assets/app/lib/asset-urls.ts +1 -1
  417. package/corpus/templates/assets/app/lib/utils.ts +1 -1
  418. package/corpus/templates/assets/app/root.tsx +10 -9
  419. package/corpus/templates/assets/app/routes/_index.tsx +3 -3
  420. package/corpus/templates/assets/app/routes/agent.tsx +1 -1
  421. package/corpus/templates/assets/app/routes/asset.$id.tsx +3 -3
  422. package/corpus/templates/assets/app/routes/asset.$id_.embed.tsx +1 -1
  423. package/corpus/templates/assets/app/routes/audit.tsx +2 -2
  424. package/corpus/templates/assets/app/routes/brand-kits.$id.tsx +6 -4
  425. package/corpus/templates/assets/app/routes/brand-kits.$id_.presets.$presetId.tsx +4 -4
  426. package/corpus/templates/assets/app/routes/brand-kits.$id_.settings.tsx +3 -3
  427. package/corpus/templates/assets/app/routes/library.tsx +13 -9
  428. package/corpus/templates/assets/app/routes/run.$id_.embed.tsx +1 -1
  429. package/corpus/templates/assets/app/routes/settings.tsx +11 -12
  430. package/corpus/templates/brain/.agents/skills/actions/SKILL.md +3 -3
  431. package/corpus/templates/brain/.agents/skills/adding-a-feature/SKILL.md +1 -1
  432. package/corpus/templates/brain/.agents/skills/delegate-to-agent/SKILL.md +3 -3
  433. package/corpus/templates/brain/.agents/skills/feature-flags/SKILL.md +1 -1
  434. package/corpus/templates/brain/.agents/skills/real-time-sync/SKILL.md +4 -4
  435. package/corpus/templates/brain/.agents/skills/upgrade-agent-native/SKILL.md +12 -5
  436. package/corpus/templates/brain/app/components/brain/CanonicalPreviewSheet.tsx +1 -1
  437. package/corpus/templates/brain/app/components/layout/Layout.tsx +2 -2
  438. package/corpus/templates/brain/app/components/layout/Sidebar.tsx +5 -5
  439. package/corpus/templates/brain/app/hooks/use-distillation-bridge.ts +3 -6
  440. package/corpus/templates/brain/app/hooks/use-navigation-state.ts +3 -4
  441. package/corpus/templates/brain/app/i18n/index.ts +1 -1
  442. package/corpus/templates/brain/app/i18n-data.ts +1 -1
  443. package/corpus/templates/brain/app/lib/utils.ts +1 -1
  444. package/corpus/templates/brain/app/root.tsx +10 -9
  445. package/corpus/templates/brain/app/routes/_index.tsx +2 -2
  446. package/corpus/templates/brain/app/routes/agent.tsx +1 -1
  447. package/corpus/templates/brain/app/routes/knowledge.tsx +2 -2
  448. package/corpus/templates/brain/app/routes/ops.tsx +2 -2
  449. package/corpus/templates/brain/app/routes/review.tsx +2 -2
  450. package/corpus/templates/brain/app/routes/search.tsx +2 -1
  451. package/corpus/templates/brain/app/routes/settings.tsx +8 -7
  452. package/corpus/templates/brain/app/routes/sources.tsx +2 -2
  453. package/corpus/templates/calendar/.agents/skills/actions/SKILL.md +3 -3
  454. package/corpus/templates/calendar/.agents/skills/delegate-to-agent/SKILL.md +3 -3
  455. package/corpus/templates/calendar/.agents/skills/feature-flags/SKILL.md +1 -1
  456. package/corpus/templates/calendar/.agents/skills/real-time-sync/SKILL.md +4 -4
  457. package/corpus/templates/calendar/.agents/skills/storing-data/SKILL.md +1 -1
  458. package/corpus/templates/calendar/.agents/skills/upgrade-agent-native/SKILL.md +12 -5
  459. package/corpus/templates/calendar/app/components/CloudUpgrade.tsx +1 -1
  460. package/corpus/templates/calendar/app/components/ThemeToggle.tsx +1 -1
  461. package/corpus/templates/calendar/app/components/TimezoneCombobox.tsx +1 -1
  462. package/corpus/templates/calendar/app/components/booking/BookingConfirmation.tsx +1 -1
  463. package/corpus/templates/calendar/app/components/booking/BookingForm.tsx +2 -1
  464. package/corpus/templates/calendar/app/components/booking/TimeSlotPicker.tsx +1 -1
  465. package/corpus/templates/calendar/app/components/calendar/AddCalendarDialog.tsx +2 -1
  466. package/corpus/templates/calendar/app/components/calendar/ApolloPanel.tsx +2 -1
  467. package/corpus/templates/calendar/app/components/calendar/AttendeeAutocomplete.tsx +1 -1
  468. package/corpus/templates/calendar/app/components/calendar/CommandPalette.tsx +2 -1
  469. package/corpus/templates/calendar/app/components/calendar/CreateEventDialog.tsx +3 -5
  470. package/corpus/templates/calendar/app/components/calendar/DayView.tsx +1 -1
  471. package/corpus/templates/calendar/app/components/calendar/DeleteEventDialog.tsx +1 -1
  472. package/corpus/templates/calendar/app/components/calendar/EventAttendeesSection.tsx +1 -1
  473. package/corpus/templates/calendar/app/components/calendar/EventCard.tsx +1 -1
  474. package/corpus/templates/calendar/app/components/calendar/EventDescription.tsx +1 -1
  475. package/corpus/templates/calendar/app/components/calendar/EventDetailPanel.tsx +1 -1
  476. package/corpus/templates/calendar/app/components/calendar/EventDetailPopover.tsx +2 -1
  477. package/corpus/templates/calendar/app/components/calendar/EventDialog.tsx +1 -1
  478. package/corpus/templates/calendar/app/components/calendar/EventOptionControls.tsx +2 -1
  479. package/corpus/templates/calendar/app/components/calendar/FindTimePanel.tsx +2 -1
  480. package/corpus/templates/calendar/app/components/calendar/GoogleConnectBanner.tsx +3 -3
  481. package/corpus/templates/calendar/app/components/calendar/GoogleSetupWizard.tsx +3 -5
  482. package/corpus/templates/calendar/app/components/calendar/GoogleSyncButton.tsx +1 -1
  483. package/corpus/templates/calendar/app/components/calendar/GuestNotificationDialog.tsx +1 -1
  484. package/corpus/templates/calendar/app/components/calendar/IntegrationsSidebar.tsx +2 -1
  485. package/corpus/templates/calendar/app/components/calendar/KeyboardShortcutsHelp.tsx +1 -1
  486. package/corpus/templates/calendar/app/components/calendar/PeopleSearchDialog.tsx +2 -1
  487. package/corpus/templates/calendar/app/components/calendar/WeekView.tsx +1 -1
  488. package/corpus/templates/calendar/app/components/calendar/WorkingLocationEditor.tsx +1 -1
  489. package/corpus/templates/calendar/app/components/layout/AppLayout.tsx +3 -3
  490. package/corpus/templates/calendar/app/components/layout/Sidebar.tsx +4 -6
  491. package/corpus/templates/calendar/app/hooks/use-apollo.ts +1 -1
  492. package/corpus/templates/calendar/app/hooks/use-attendee-timezones.ts +4 -1
  493. package/corpus/templates/calendar/app/hooks/use-availability.ts +4 -1
  494. package/corpus/templates/calendar/app/hooks/use-booking-links.ts +4 -1
  495. package/corpus/templates/calendar/app/hooks/use-bookings.ts +1 -1
  496. package/corpus/templates/calendar/app/hooks/use-db-status.ts +1 -1
  497. package/corpus/templates/calendar/app/hooks/use-events.ts +1 -1
  498. package/corpus/templates/calendar/app/hooks/use-external-calendars.ts +1 -1
  499. package/corpus/templates/calendar/app/hooks/use-google-auth.ts +2 -2
  500. package/corpus/templates/calendar/app/hooks/use-integrations.ts +1 -1
  501. package/corpus/templates/calendar/app/hooks/use-navigation-state.ts +3 -2
  502. package/corpus/templates/calendar/app/hooks/use-overlay-people.ts +1 -1
  503. package/corpus/templates/calendar/app/hooks/use-people.ts +1 -1
  504. package/corpus/templates/calendar/app/hooks/use-settings.ts +4 -1
  505. package/corpus/templates/calendar/app/hooks/use-view-preferences.ts +2 -1
  506. package/corpus/templates/calendar/app/hooks/use-zoom-auth.ts +2 -1
  507. package/corpus/templates/calendar/app/i18n/index.ts +1 -1
  508. package/corpus/templates/calendar/app/i18n-data.ts +1 -1
  509. package/corpus/templates/calendar/app/lib/api-path.ts +1 -1
  510. package/corpus/templates/calendar/app/lib/utils.ts +1 -1
  511. package/corpus/templates/calendar/app/pages/AvailabilitySettings.tsx +1 -1
  512. package/corpus/templates/calendar/app/pages/BookingLinksPage.tsx +3 -1
  513. package/corpus/templates/calendar/app/pages/BookingPage.tsx +2 -3
  514. package/corpus/templates/calendar/app/pages/BookingsList.tsx +1 -1
  515. package/corpus/templates/calendar/app/pages/CalendarView.tsx +3 -5
  516. package/corpus/templates/calendar/app/pages/ManageBookingPage.tsx +1 -1
  517. package/corpus/templates/calendar/app/pages/NotFound.tsx +1 -1
  518. package/corpus/templates/calendar/app/pages/Settings.tsx +9 -8
  519. package/corpus/templates/calendar/app/root.tsx +15 -9
  520. package/corpus/templates/calendar/app/routes/_app.agent.tsx +2 -1
  521. package/corpus/templates/calendar/app/routes/_app.settings.tsx +1 -1
  522. package/corpus/templates/calendar/app/routes/event.tsx +3 -3
  523. package/corpus/templates/chat/.agents/skills/actions/SKILL.md +3 -3
  524. package/corpus/templates/chat/.agents/skills/adding-a-feature/SKILL.md +1 -1
  525. package/corpus/templates/chat/.agents/skills/delegate-to-agent/SKILL.md +3 -3
  526. package/corpus/templates/chat/.agents/skills/feature-flags/SKILL.md +1 -1
  527. package/corpus/templates/chat/.agents/skills/real-time-sync/SKILL.md +4 -4
  528. package/corpus/templates/chat/.agents/skills/upgrade-agent-native/SKILL.md +12 -5
  529. package/corpus/templates/chat/app/components/layout/Header.tsx +2 -1
  530. package/corpus/templates/chat/app/components/layout/Layout.tsx +2 -2
  531. package/corpus/templates/chat/app/components/layout/Sidebar.tsx +4 -4
  532. package/corpus/templates/chat/app/hooks/use-navigation-state.ts +3 -4
  533. package/corpus/templates/chat/app/i18n/index.ts +1 -1
  534. package/corpus/templates/chat/app/i18n-data.ts +1 -1
  535. package/corpus/templates/chat/app/lib/utils.ts +1 -1
  536. package/corpus/templates/chat/app/root.tsx +10 -9
  537. package/corpus/templates/chat/app/routes/_index.tsx +2 -2
  538. package/corpus/templates/chat/app/routes/agent.tsx +10 -3
  539. package/corpus/templates/chat/app/routes/database.tsx +1 -1
  540. package/corpus/templates/chat/app/routes/observability.tsx +2 -1
  541. package/corpus/templates/chat/app/routes/settings.tsx +4 -5
  542. package/corpus/templates/clips/.agents/skills/actions/SKILL.md +3 -3
  543. package/corpus/templates/clips/.agents/skills/delegate-to-agent/SKILL.md +3 -3
  544. package/corpus/templates/clips/.agents/skills/feature-flags/SKILL.md +1 -1
  545. package/corpus/templates/clips/.agents/skills/upgrade-agent-native/SKILL.md +12 -5
  546. package/corpus/templates/clips/app/components/capture-install-options.tsx +2 -1
  547. package/corpus/templates/clips/app/components/dictate/vocabulary-section.tsx +2 -2
  548. package/corpus/templates/clips/app/components/editable-recording-title.tsx +2 -1
  549. package/corpus/templates/clips/app/components/editor/chapters-editor.tsx +2 -1
  550. package/corpus/templates/clips/app/components/editor/editor-layout.tsx +4 -14
  551. package/corpus/templates/clips/app/components/editor/editor-toolbar.tsx +2 -1
  552. package/corpus/templates/clips/app/components/editor/split-button.tsx +2 -1
  553. package/corpus/templates/clips/app/components/editor/stitch-manager.tsx +3 -3
  554. package/corpus/templates/clips/app/components/editor/thumbnail-picker.tsx +2 -1
  555. package/corpus/templates/clips/app/components/editor/transcript-editor.tsx +1 -1
  556. package/corpus/templates/clips/app/components/layout/Header.tsx +2 -1
  557. package/corpus/templates/clips/app/components/library/bulk-action-toolbar.tsx +1 -1
  558. package/corpus/templates/clips/app/components/library/create-folder-dialog.tsx +1 -1
  559. package/corpus/templates/clips/app/components/library/create-space-dialog.tsx +1 -1
  560. package/corpus/templates/clips/app/components/library/empty-state.tsx +1 -1
  561. package/corpus/templates/clips/app/components/library/folder-tree.tsx +1 -1
  562. package/corpus/templates/clips/app/components/library/library-grid.tsx +2 -2
  563. package/corpus/templates/clips/app/components/library/library-layout.tsx +6 -6
  564. package/corpus/templates/clips/app/components/library/organization-switcher.tsx +1 -1
  565. package/corpus/templates/clips/app/components/library/recording-card.tsx +1 -1
  566. package/corpus/templates/clips/app/components/library/search-bar.tsx +1 -1
  567. package/corpus/templates/clips/app/components/meetings/auto-record-prompt.tsx +1 -17
  568. package/corpus/templates/clips/app/components/meetings/canvas-editor.tsx +1 -1
  569. package/corpus/templates/clips/app/components/meetings/meeting-card.tsx +1 -1
  570. package/corpus/templates/clips/app/components/meetings/quick-ask-sidebar.tsx +2 -20
  571. package/corpus/templates/clips/app/components/meetings/share-meeting-dialog.tsx +3 -1
  572. package/corpus/templates/clips/app/components/meetings/transcript-bubbles.tsx +1 -1
  573. package/corpus/templates/clips/app/components/player/access-password-prompt.tsx +1 -1
  574. package/corpus/templates/clips/app/components/player/captions-overlay.tsx +1 -1
  575. package/corpus/templates/clips/app/components/player/comments-panel.tsx +2 -1
  576. package/corpus/templates/clips/app/components/player/delete-recording-menu.tsx +2 -1
  577. package/corpus/templates/clips/app/components/player/insights-panel.tsx +2 -1
  578. package/corpus/templates/clips/app/components/player/player-controls.tsx +1 -1
  579. package/corpus/templates/clips/app/components/player/settings-panel.tsx +2 -2
  580. package/corpus/templates/clips/app/components/player/share-dialog.tsx +3 -3
  581. package/corpus/templates/clips/app/components/player/sign-in-prompt-dialog.tsx +1 -1
  582. package/corpus/templates/clips/app/components/player/timestamped-comment-button.tsx +2 -1
  583. package/corpus/templates/clips/app/components/player/transcript-panel.tsx +3 -6
  584. package/corpus/templates/clips/app/components/player/video-player.tsx +3 -5
  585. package/corpus/templates/clips/app/components/recorder/camera-visualizer.tsx +1 -1
  586. package/corpus/templates/clips/app/components/recorder/countdown-overlay.tsx +1 -1
  587. package/corpus/templates/clips/app/components/recorder/microphone-visualizer.tsx +1 -1
  588. package/corpus/templates/clips/app/components/recorder/pre-record-panel.tsx +2 -1
  589. package/corpus/templates/clips/app/components/recorder/recorder-engine.ts +3 -13
  590. package/corpus/templates/clips/app/components/recorder/recording-toolbar.tsx +1 -1
  591. package/corpus/templates/clips/app/components/recorder/storage-setup-card.tsx +3 -6
  592. package/corpus/templates/clips/app/components/sharing/share-ui.tsx +2 -2
  593. package/corpus/templates/clips/app/components/sharing/viewed-by-popover.tsx +2 -1
  594. package/corpus/templates/clips/app/components/workspace/branding-editor.tsx +3 -5
  595. package/corpus/templates/clips/app/components/workspace/engagement-chart.tsx +1 -1
  596. package/corpus/templates/clips/app/components/workspace/insights-hub.tsx +3 -1
  597. package/corpus/templates/clips/app/components/workspace/invite-dialog.tsx +2 -1
  598. package/corpus/templates/clips/app/components/workspace/members-list.tsx +2 -1
  599. package/corpus/templates/clips/app/components/workspace/notifications-list.tsx +1 -1
  600. package/corpus/templates/clips/app/components/workspace/top-creators-table.tsx +1 -1
  601. package/corpus/templates/clips/app/entry.client.tsx +2 -4
  602. package/corpus/templates/clips/app/hooks/use-auto-title.ts +3 -17
  603. package/corpus/templates/clips/app/hooks/use-library.ts +4 -1
  604. package/corpus/templates/clips/app/hooks/use-navigation-state.ts +2 -1
  605. package/corpus/templates/clips/app/hooks/use-video-storage-status.ts +1 -1
  606. package/corpus/templates/clips/app/hooks/use-view-tracking.ts +1 -1
  607. package/corpus/templates/clips/app/i18n/index.ts +5 -5
  608. package/corpus/templates/clips/app/lib/camera-blur.ts +1 -1
  609. package/corpus/templates/clips/app/lib/capture-install-options.ts +1 -1
  610. package/corpus/templates/clips/app/lib/thumbnail-capture.ts +1 -1
  611. package/corpus/templates/clips/app/lib/utils.ts +1 -1
  612. package/corpus/templates/clips/app/root.tsx +13 -9
  613. package/corpus/templates/clips/app/routes/_app.agent.tsx +2 -1
  614. package/corpus/templates/clips/app/routes/_app.archive.tsx +1 -1
  615. package/corpus/templates/clips/app/routes/_app.dictate.tsx +2 -2
  616. package/corpus/templates/clips/app/routes/_app.extensions.$id.tsx +1 -1
  617. package/corpus/templates/clips/app/routes/_app.extensions._index.tsx +1 -1
  618. package/corpus/templates/clips/app/routes/_app.library._index.tsx +1 -1
  619. package/corpus/templates/clips/app/routes/_app.library.folder.$folderId.tsx +1 -1
  620. package/corpus/templates/clips/app/routes/_app.meetings.$meetingId.tsx +2 -2
  621. package/corpus/templates/clips/app/routes/_app.meetings._index.tsx +3 -5
  622. package/corpus/templates/clips/app/routes/_app.notifications.tsx +2 -2
  623. package/corpus/templates/clips/app/routes/_app.settings._index.tsx +7 -7
  624. package/corpus/templates/clips/app/routes/_app.settings.organization.tsx +2 -1
  625. package/corpus/templates/clips/app/routes/_app.shared.tsx +1 -1
  626. package/corpus/templates/clips/app/routes/_app.spaces.$spaceId.folder.$folderId.tsx +1 -1
  627. package/corpus/templates/clips/app/routes/_app.spaces.$spaceId.tsx +1 -1
  628. package/corpus/templates/clips/app/routes/_app.spaces._index.tsx +1 -1
  629. package/corpus/templates/clips/app/routes/_app.trash.tsx +2 -1
  630. package/corpus/templates/clips/app/routes/_index.tsx +1 -1
  631. package/corpus/templates/clips/app/routes/bug-report.done.tsx +2 -1
  632. package/corpus/templates/clips/app/routes/bug-report.tsx +2 -1
  633. package/corpus/templates/clips/app/routes/download.tsx +2 -1
  634. package/corpus/templates/clips/app/routes/embed.$shareId.tsx +2 -1
  635. package/corpus/templates/clips/app/routes/invite.$token.tsx +2 -1
  636. package/corpus/templates/clips/app/routes/r.$recordingId.tsx +4 -5
  637. package/corpus/templates/clips/app/routes/record.tsx +4 -4
  638. package/corpus/templates/clips/app/routes/share.$shareId.tsx +5 -6
  639. package/corpus/templates/clips/app/routes/share.meeting.$meetingId.tsx +3 -1
  640. package/corpus/templates/content/.agents/skills/actions/SKILL.md +3 -3
  641. package/corpus/templates/content/.agents/skills/delegate-to-agent/SKILL.md +3 -3
  642. package/corpus/templates/content/.agents/skills/feature-flags/SKILL.md +1 -1
  643. package/corpus/templates/content/.agents/skills/real-time-sync/SKILL.md +4 -4
  644. package/corpus/templates/content/.agents/skills/storing-data/SKILL.md +1 -1
  645. package/corpus/templates/content/.agents/skills/upgrade-agent-native/SKILL.md +12 -5
  646. package/corpus/templates/content/app/blocks/SourceComponentBlock.tsx +1 -1
  647. package/corpus/templates/content/app/blocks/contentBlockRegistry.tsx +1 -1
  648. package/corpus/templates/content/app/components/EmptyState.tsx +1 -1
  649. package/corpus/templates/content/app/components/QueryErrorState.tsx +1 -1
  650. package/corpus/templates/content/app/components/ThemeToggle.tsx +1 -1
  651. package/corpus/templates/content/app/components/editor/BubbleToolbar.tsx +1 -1
  652. package/corpus/templates/content/app/components/editor/CommentsSidebar.tsx +3 -1
  653. package/corpus/templates/content/app/components/editor/ContentReferencePreview.tsx +1 -1
  654. package/corpus/templates/content/app/components/editor/DocumentBlockFields.tsx +1 -1
  655. package/corpus/templates/content/app/components/editor/DocumentEditor.tsx +7 -5
  656. package/corpus/templates/content/app/components/editor/DocumentProperties.tsx +3 -6
  657. package/corpus/templates/content/app/components/editor/DocumentToolbar.tsx +7 -9
  658. package/corpus/templates/content/app/components/editor/EmojiPicker.tsx +1 -1
  659. package/corpus/templates/content/app/components/editor/LinkHoverPreview.tsx +1 -1
  660. package/corpus/templates/content/app/components/editor/NotionConflictBanner.tsx +1 -1
  661. package/corpus/templates/content/app/components/editor/NotionSyncBar.tsx +1 -1
  662. package/corpus/templates/content/app/components/editor/SlashCommandMenu.tsx +2 -1
  663. package/corpus/templates/content/app/components/editor/TableHoverControls.tsx +1 -1
  664. package/corpus/templates/content/app/components/editor/VersionHistoryPanel.tsx +2 -1
  665. package/corpus/templates/content/app/components/editor/VisualEditor.tsx +6 -4
  666. package/corpus/templates/content/app/components/editor/database/DatabaseView.tsx +5 -6
  667. package/corpus/templates/content/app/components/editor/database/FormView.tsx +1 -1
  668. package/corpus/templates/content/app/components/editor/database/settings.tsx +2 -2
  669. package/corpus/templates/content/app/components/editor/database-sources/BuilderSourceReviewDialog.tsx +1 -1
  670. package/corpus/templates/content/app/components/editor/extensions/AudioBlock.tsx +2 -1
  671. package/corpus/templates/content/app/components/editor/extensions/CodeBlockNode.tsx +1 -1
  672. package/corpus/templates/content/app/components/editor/extensions/ImageBlock.tsx +2 -1
  673. package/corpus/templates/content/app/components/editor/extensions/LocalMdxComponentNode.tsx +1 -1
  674. package/corpus/templates/content/app/components/editor/extensions/VideoBlock.tsx +2 -1
  675. package/corpus/templates/content/app/components/editor/extensions/registryBlocks.ts +1 -1
  676. package/corpus/templates/content/app/components/editor/image-upload.ts +1 -1
  677. package/corpus/templates/content/app/components/editor/registrySlashItems.ts +1 -1
  678. package/corpus/templates/content/app/components/layout/Header.tsx +1 -1
  679. package/corpus/templates/content/app/components/layout/Layout.tsx +3 -1
  680. package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +9 -9
  681. package/corpus/templates/content/app/components/sidebar/DocumentTreeItem.tsx +1 -1
  682. package/corpus/templates/content/app/components/sidebar/NotionButton.tsx +5 -1
  683. package/corpus/templates/content/app/entry.client.tsx +2 -4
  684. package/corpus/templates/content/app/hooks/use-comments.ts +4 -1
  685. package/corpus/templates/content/app/hooks/use-content-database.ts +4 -1
  686. package/corpus/templates/content/app/hooks/use-content-spaces.ts +4 -1
  687. package/corpus/templates/content/app/hooks/use-db-sync.ts +1 -1
  688. package/corpus/templates/content/app/hooks/use-document-properties.ts +4 -1
  689. package/corpus/templates/content/app/hooks/use-document-versions.ts +4 -1
  690. package/corpus/templates/content/app/hooks/use-documents.ts +4 -1
  691. package/corpus/templates/content/app/hooks/use-mention-members.ts +1 -1
  692. package/corpus/templates/content/app/hooks/use-navigation-state.ts +2 -1
  693. package/corpus/templates/content/app/hooks/use-notion.ts +2 -2
  694. package/corpus/templates/content/app/i18n/index.ts +1 -1
  695. package/corpus/templates/content/app/i18n-data.ts +1 -1
  696. package/corpus/templates/content/app/lib/local-control-resources.ts +1 -1
  697. package/corpus/templates/content/app/lib/utils.ts +1 -1
  698. package/corpus/templates/content/app/root.tsx +15 -9
  699. package/corpus/templates/content/app/routes/_app.agent.tsx +2 -1
  700. package/corpus/templates/content/app/routes/_app.local-files.tsx +2 -1
  701. package/corpus/templates/content/app/routes/_app.page.$id.tsx +1 -1
  702. package/corpus/templates/content/app/routes/_app.settings.tsx +4 -5
  703. package/corpus/templates/content/app/routes/p.$id.tsx +2 -1
  704. package/corpus/templates/design/.agents/skills/actions/SKILL.md +3 -3
  705. package/corpus/templates/design/.agents/skills/delegate-to-agent/SKILL.md +3 -3
  706. package/corpus/templates/design/.agents/skills/feature-flags/SKILL.md +1 -1
  707. package/corpus/templates/design/.agents/skills/upgrade-agent-native/SKILL.md +12 -5
  708. package/corpus/templates/design/app/components/QueryErrorState.tsx +1 -1
  709. package/corpus/templates/design/app/components/ThemeToggle.tsx +1 -1
  710. package/corpus/templates/design/app/components/design/AutoLayoutSuggestionDialog.tsx +1 -1
  711. package/corpus/templates/design/app/components/design/BreakpointBar.tsx +1 -30
  712. package/corpus/templates/design/app/components/design/DesignCanvas.tsx +4 -3
  713. package/corpus/templates/design/app/components/design/DesignExtensionsPanel.tsx +4 -4
  714. package/corpus/templates/design/app/components/design/DesignImportPanel.tsx +2 -5
  715. package/corpus/templates/design/app/components/design/DrawOverlay.tsx +1 -1
  716. package/corpus/templates/design/app/components/design/EditPanel.tsx +2 -2
  717. package/corpus/templates/design/app/components/design/FusionAppBanner.tsx +4 -1
  718. package/corpus/templates/design/app/components/design/KeyboardShortcutsPanel.tsx +1 -1
  719. package/corpus/templates/design/app/components/design/LayersPanel.tsx +1 -1
  720. package/corpus/templates/design/app/components/design/LocalhostWriteConsentDialog.tsx +1 -1
  721. package/corpus/templates/design/app/components/design/MotionDock.tsx +1 -19
  722. package/corpus/templates/design/app/components/design/MultiScreenCanvas.tsx +2 -2
  723. package/corpus/templates/design/app/components/design/QuestionFlow.tsx +2 -2
  724. package/corpus/templates/design/app/components/design/ReadOnlyDesignBanner.tsx +1 -1
  725. package/corpus/templates/design/app/components/design/ReviewCommentsPanel.tsx +2 -2
  726. package/corpus/templates/design/app/components/design/ReviewPanel.tsx +1 -22
  727. package/corpus/templates/design/app/components/design/ReviewStatusControl.tsx +2 -2
  728. package/corpus/templates/design/app/components/design/StatesPanel.tsx +4 -14
  729. package/corpus/templates/design/app/components/design/TokensPanel.tsx +2 -17
  730. package/corpus/templates/design/app/components/design/TweaksPanel.tsx +1 -1
  731. package/corpus/templates/design/app/components/design/code-workbench/CodeWorkbench.tsx +1 -1
  732. package/corpus/templates/design/app/components/design/code-workbench/editor/BufferSync.tsx +1 -1
  733. package/corpus/templates/design/app/components/design/code-workbench/explorer/ExplorerView.tsx +1 -1
  734. package/corpus/templates/design/app/components/design/code-workbench/workspace/inline-provider.ts +1 -1
  735. package/corpus/templates/design/app/components/design/code-workbench/workspace/localhost-provider.ts +1 -1
  736. package/corpus/templates/design/app/components/design/design-canvas/annotation-snapshot.ts +1 -1
  737. package/corpus/templates/design/app/components/design/edit-panel/appearance-properties.tsx +1 -1
  738. package/corpus/templates/design/app/components/design/edit-panel/component-section.tsx +2 -2
  739. package/corpus/templates/design/app/components/design/edit-panel/effects-properties.tsx +1 -1
  740. package/corpus/templates/design/app/components/design/edit-panel/field-primitives.tsx +1 -1
  741. package/corpus/templates/design/app/components/design/edit-panel/fill-properties.tsx +1 -1
  742. package/corpus/templates/design/app/components/design/edit-panel/frame-presets-panel.tsx +1 -1
  743. package/corpus/templates/design/app/components/design/edit-panel/layout-properties.tsx +1 -1
  744. package/corpus/templates/design/app/components/design/edit-panel/position-layout-properties.tsx +1 -1
  745. package/corpus/templates/design/app/components/design/edit-panel/stroke-properties.tsx +1 -1
  746. package/corpus/templates/design/app/components/design/edit-panel/typography-properties.tsx +1 -1
  747. package/corpus/templates/design/app/components/design/inspector/BreakpointOverrideIndicator.tsx +1 -16
  748. package/corpus/templates/design/app/components/design/inspector/GlslShaderPanel.tsx +2 -34
  749. package/corpus/templates/design/app/components/design/inspector/ImageFillControls.tsx +2 -1
  750. package/corpus/templates/design/app/components/design/inspector/InteractionStatePanel.tsx +1 -25
  751. package/corpus/templates/design/app/components/design/inspector/MotionKeyframeDiamond.tsx +1 -30
  752. package/corpus/templates/design/app/components/design/inspector/ShaderFillsPanel.tsx +1 -1
  753. package/corpus/templates/design/app/components/design-system/ProductionDesignSystemShowcase.tsx +1 -1
  754. package/corpus/templates/design/app/components/editor/FigmaLinkComposerBubble.tsx +1 -1
  755. package/corpus/templates/design/app/components/editor/PromptDialog.tsx +3 -3
  756. package/corpus/templates/design/app/components/layout/Header.tsx +4 -4
  757. package/corpus/templates/design/app/components/layout/Layout.tsx +4 -5
  758. package/corpus/templates/design/app/components/layout/Sidebar.tsx +4 -6
  759. package/corpus/templates/design/app/components/visual-editor/CanvasCommentPins.tsx +1 -1
  760. package/corpus/templates/design/app/components/visual-editor/DrawOverlay.tsx +1 -1
  761. package/corpus/templates/design/app/components/visual-editor/NodeRewriteProposal.tsx +2 -2
  762. package/corpus/templates/design/app/components/visual-editor/ReviewCanvasPins.tsx +3 -4
  763. package/corpus/templates/design/app/components/visual-editor/SaveStatusIndicator.tsx +1 -1
  764. package/corpus/templates/design/app/hooks/use-agent-generating.ts +1 -1
  765. package/corpus/templates/design/app/hooks/use-design-system.ts +1 -1
  766. package/corpus/templates/design/app/hooks/use-design-systems.ts +1 -1
  767. package/corpus/templates/design/app/hooks/use-navigation-state.ts +2 -2
  768. package/corpus/templates/design/app/hooks/use-question-flow.ts +1 -1
  769. package/corpus/templates/design/app/i18n/index.ts +1 -1
  770. package/corpus/templates/design/app/i18n-data.ts +1 -1
  771. package/corpus/templates/design/app/i18n-keyboard-shortcuts.ts +1 -1
  772. package/corpus/templates/design/app/lib/agent-chat.ts +1 -1
  773. package/corpus/templates/design/app/lib/design-save-outbox.ts +1 -1
  774. package/corpus/templates/design/app/lib/desktop-design-preview.ts +1 -1
  775. package/corpus/templates/design/app/lib/figma-connection.ts +2 -1
  776. package/corpus/templates/design/app/lib/figma-svg-copy.ts +1 -1
  777. package/corpus/templates/design/app/lib/pending-generation.ts +1 -1
  778. package/corpus/templates/design/app/lib/utils.ts +1 -1
  779. package/corpus/templates/design/app/pages/DesignSystemSetup.tsx +4 -6
  780. package/corpus/templates/design/app/pages/DesignSystems.tsx +4 -4
  781. package/corpus/templates/design/app/pages/Index.tsx +5 -5
  782. package/corpus/templates/design/app/pages/NotFound.tsx +3 -5
  783. package/corpus/templates/design/app/pages/Present.tsx +7 -6
  784. package/corpus/templates/design/app/pages/Templates.tsx +4 -4
  785. package/corpus/templates/design/app/pages/VisualEdit.tsx +3 -1
  786. package/corpus/templates/design/app/pages/design-editor/editor-session.ts +1 -1
  787. package/corpus/templates/design/app/pages/design-editor/generation-prompt-directives.ts +1 -1
  788. package/corpus/templates/design/app/root.tsx +10 -9
  789. package/corpus/templates/design/app/routes/agent.tsx +2 -1
  790. package/corpus/templates/design/app/routes/observability.tsx +1 -1
  791. package/corpus/templates/design/app/routes/settings.tsx +4 -5
  792. package/corpus/templates/dispatch/.agents/skills/actions/SKILL.md +3 -3
  793. package/corpus/templates/dispatch/.agents/skills/delegate-to-agent/SKILL.md +3 -3
  794. package/corpus/templates/dispatch/.agents/skills/feature-flags/SKILL.md +1 -1
  795. package/corpus/templates/dispatch/.agents/skills/upgrade-agent-native/SKILL.md +12 -5
  796. package/corpus/templates/dispatch/app/hooks/use-navigation-state.ts +3 -4
  797. package/corpus/templates/dispatch/app/i18n/index.ts +1 -1
  798. package/corpus/templates/dispatch/app/i18n-data.ts +1 -1
  799. package/corpus/templates/dispatch/app/root.tsx +10 -9
  800. package/corpus/templates/dispatch/app/routes/agent.tsx +2 -1
  801. package/corpus/templates/dispatch/app/routes/integrations.tsx +3 -3
  802. package/corpus/templates/dispatch/app/routes/settings.tsx +4 -5
  803. package/corpus/templates/forms/.agents/skills/actions/SKILL.md +3 -3
  804. package/corpus/templates/forms/.agents/skills/delegate-to-agent/SKILL.md +3 -3
  805. package/corpus/templates/forms/.agents/skills/feature-flags/SKILL.md +1 -1
  806. package/corpus/templates/forms/.agents/skills/real-time-sync/SKILL.md +4 -4
  807. package/corpus/templates/forms/.agents/skills/storing-data/SKILL.md +1 -1
  808. package/corpus/templates/forms/.agents/skills/upgrade-agent-native/SKILL.md +12 -5
  809. package/corpus/templates/forms/app/components/CloudUpgrade.tsx +1 -1
  810. package/corpus/templates/forms/app/components/ThemeToggle.tsx +1 -1
  811. package/corpus/templates/forms/app/components/builder/FieldPropertiesPanel.tsx +1 -1
  812. package/corpus/templates/forms/app/components/layout/Header.tsx +2 -1
  813. package/corpus/templates/forms/app/components/layout/Layout.tsx +2 -2
  814. package/corpus/templates/forms/app/components/layout/Sidebar.tsx +5 -5
  815. package/corpus/templates/forms/app/hooks/use-db-status.ts +1 -1
  816. package/corpus/templates/forms/app/hooks/use-forms.ts +2 -2
  817. package/corpus/templates/forms/app/hooks/use-navigation-state.ts +3 -3
  818. package/corpus/templates/forms/app/hooks/use-responses.ts +1 -1
  819. package/corpus/templates/forms/app/i18n/index.ts +1 -1
  820. package/corpus/templates/forms/app/lib/utils.ts +1 -1
  821. package/corpus/templates/forms/app/pages/AskPage.tsx +2 -2
  822. package/corpus/templates/forms/app/pages/FormBuilderPage.tsx +5 -6
  823. package/corpus/templates/forms/app/pages/FormFillPage.tsx +2 -1
  824. package/corpus/templates/forms/app/pages/FormsListPage.tsx +3 -6
  825. package/corpus/templates/forms/app/pages/ResponseInsightsPage.tsx +1 -1
  826. package/corpus/templates/forms/app/pages/ResponsesPage.tsx +1 -1
  827. package/corpus/templates/forms/app/root.tsx +15 -12
  828. package/corpus/templates/forms/app/routes/_app.agent.tsx +2 -1
  829. package/corpus/templates/forms/app/routes/_app.settings.tsx +4 -5
  830. package/corpus/templates/forms/app/routes/_index.tsx +1 -1
  831. package/corpus/templates/forms/app/routes/form-preview.tsx +5 -1
  832. package/corpus/templates/macros/.agents/skills/feature-flags/SKILL.md +1 -1
  833. package/corpus/templates/macros/.agents/skills/upgrade-agent-native/SKILL.md +12 -5
  834. package/corpus/templates/macros/app/components/AddExerciseDialog.tsx +2 -1
  835. package/corpus/templates/macros/app/components/AddMealDialog.tsx +2 -1
  836. package/corpus/templates/macros/app/components/AddWeightDialog.tsx +2 -1
  837. package/corpus/templates/macros/app/components/DailyProgress.tsx +2 -1
  838. package/corpus/templates/macros/app/components/ExerciseCard.tsx +1 -1
  839. package/corpus/templates/macros/app/components/MealCard.tsx +1 -1
  840. package/corpus/templates/macros/app/components/QueryErrorState.tsx +1 -1
  841. package/corpus/templates/macros/app/components/VoiceDictation.tsx +2 -1
  842. package/corpus/templates/macros/app/components/WeeklyCaloriesChart.tsx +1 -1
  843. package/corpus/templates/macros/app/components/WeightCard.tsx +1 -1
  844. package/corpus/templates/macros/app/components/WeightTracker.tsx +2 -2
  845. package/corpus/templates/macros/app/components/layout/AppLayout.tsx +5 -8
  846. package/corpus/templates/macros/app/components/layout/Header.tsx +2 -1
  847. package/corpus/templates/macros/app/i18n/index.ts +1 -1
  848. package/corpus/templates/macros/app/lib/api.ts +1 -1
  849. package/corpus/templates/macros/app/lib/utils.ts +1 -1
  850. package/corpus/templates/macros/app/root.tsx +10 -9
  851. package/corpus/templates/macros/app/routes/_index.tsx +2 -2
  852. package/corpus/templates/macros/app/routes/agent.tsx +2 -1
  853. package/corpus/templates/macros/app/routes/analytics.tsx +2 -1
  854. package/corpus/templates/macros/app/routes/settings.tsx +4 -5
  855. package/corpus/templates/mail/.agents/skills/actions/SKILL.md +3 -3
  856. package/corpus/templates/mail/.agents/skills/delegate-to-agent/SKILL.md +3 -3
  857. package/corpus/templates/mail/.agents/skills/feature-flags/SKILL.md +1 -1
  858. package/corpus/templates/mail/.agents/skills/real-time-sync/SKILL.md +4 -4
  859. package/corpus/templates/mail/.agents/skills/storing-data/SKILL.md +1 -1
  860. package/corpus/templates/mail/.agents/skills/upgrade-agent-native/SKILL.md +12 -5
  861. package/corpus/templates/mail/app/components/GoogleConnectBanner.tsx +3 -3
  862. package/corpus/templates/mail/app/components/ThemeToggle.tsx +1 -1
  863. package/corpus/templates/mail/app/components/agent-engine-picker.tsx +2 -1
  864. package/corpus/templates/mail/app/components/email/AttachmentStrip.tsx +1 -1
  865. package/corpus/templates/mail/app/components/email/CodeBlockLangPicker.tsx +1 -1
  866. package/corpus/templates/mail/app/components/email/ComposeBubbleToolbar.tsx +1 -1
  867. package/corpus/templates/mail/app/components/email/ComposeEditor.tsx +1 -1
  868. package/corpus/templates/mail/app/components/email/ComposeModal.tsx +2 -1
  869. package/corpus/templates/mail/app/components/email/ComposeSlashMenu.tsx +1 -1
  870. package/corpus/templates/mail/app/components/email/EmailList.tsx +1 -1
  871. package/corpus/templates/mail/app/components/email/EmailListItem.tsx +1 -1
  872. package/corpus/templates/mail/app/components/email/EmailThread.tsx +2 -1
  873. package/corpus/templates/mail/app/components/email/InlineReplyComposer.tsx +2 -1
  874. package/corpus/templates/mail/app/components/email/IntegrationsSidebar.tsx +2 -1
  875. package/corpus/templates/mail/app/components/email/MobileActionBar.tsx +1 -1
  876. package/corpus/templates/mail/app/components/email/RecipientInput.tsx +1 -1
  877. package/corpus/templates/mail/app/components/email/SendLaterButton.tsx +1 -1
  878. package/corpus/templates/mail/app/components/email/SnoozeModal.tsx +1 -1
  879. package/corpus/templates/mail/app/components/email/SnoozePopover.tsx +1 -1
  880. package/corpus/templates/mail/app/components/email/extensions/ComposeImageBlock.tsx +1 -1
  881. package/corpus/templates/mail/app/components/layout/AppLayout.tsx +6 -6
  882. package/corpus/templates/mail/app/components/layout/CommandPalette.tsx +2 -1
  883. package/corpus/templates/mail/app/components/layout/SearchBar.tsx +1 -1
  884. package/corpus/templates/mail/app/components/settings/GmailFiltersSection.tsx +1 -1
  885. package/corpus/templates/mail/app/components/settings/SnippetsSection.tsx +1 -1
  886. package/corpus/templates/mail/app/entry.client.tsx +1 -6
  887. package/corpus/templates/mail/app/hooks/use-aliases.ts +1 -1
  888. package/corpus/templates/mail/app/hooks/use-apollo.ts +1 -1
  889. package/corpus/templates/mail/app/hooks/use-automations.ts +1 -1
  890. package/corpus/templates/mail/app/hooks/use-compose-state.ts +2 -2
  891. package/corpus/templates/mail/app/hooks/use-draft-queue.ts +4 -1
  892. package/corpus/templates/mail/app/hooks/use-emails.ts +3 -1
  893. package/corpus/templates/mail/app/hooks/use-gmail-filters.ts +1 -1
  894. package/corpus/templates/mail/app/hooks/use-google-auth.ts +2 -1
  895. package/corpus/templates/mail/app/hooks/use-integrations.ts +2 -2
  896. package/corpus/templates/mail/app/hooks/use-navigation-state.ts +1 -1
  897. package/corpus/templates/mail/app/hooks/use-scheduled-jobs.ts +2 -2
  898. package/corpus/templates/mail/app/hooks/use-snippets.ts +1 -1
  899. package/corpus/templates/mail/app/i18n/index.ts +1 -1
  900. package/corpus/templates/mail/app/lib/agent-generate.ts +1 -1
  901. package/corpus/templates/mail/app/lib/gmail-mutation-queue.ts +1 -10
  902. package/corpus/templates/mail/app/lib/mcp-chat-bridge.ts +1 -1
  903. package/corpus/templates/mail/app/lib/thread-cache.ts +1 -1
  904. package/corpus/templates/mail/app/lib/upload.ts +1 -1
  905. package/corpus/templates/mail/app/lib/utils.ts +1 -1
  906. package/corpus/templates/mail/app/pages/DraftQueuePage.tsx +1 -1
  907. package/corpus/templates/mail/app/pages/InboxPage.tsx +1 -1
  908. package/corpus/templates/mail/app/pages/NotFound.tsx +1 -1
  909. package/corpus/templates/mail/app/pages/SettingsPage.tsx +9 -8
  910. package/corpus/templates/mail/app/root.tsx +11 -8
  911. package/corpus/templates/mail/app/routes/agent.tsx +2 -1
  912. package/corpus/templates/mail/app/routes/email.tsx +5 -1
  913. package/corpus/templates/plan/.agents/skills/actions/SKILL.md +3 -3
  914. package/corpus/templates/plan/.agents/skills/adding-a-feature/SKILL.md +1 -1
  915. package/corpus/templates/plan/.agents/skills/delegate-to-agent/SKILL.md +3 -3
  916. package/corpus/templates/plan/.agents/skills/feature-flags/SKILL.md +1 -1
  917. package/corpus/templates/plan/.agents/skills/real-time-sync/SKILL.md +4 -4
  918. package/corpus/templates/plan/.agents/skills/upgrade-agent-native/SKILL.md +12 -5
  919. package/corpus/templates/plan/app/components/editor/PlanBlockNode.tsx +2 -2
  920. package/corpus/templates/plan/app/components/editor/PlanDocumentEditor.tsx +3 -3
  921. package/corpus/templates/plan/app/components/editor/planSlashCommands.ts +1 -1
  922. package/corpus/templates/plan/app/components/layout/Header.tsx +2 -1
  923. package/corpus/templates/plan/app/components/layout/Layout.tsx +2 -2
  924. package/corpus/templates/plan/app/components/layout/Sidebar.tsx +8 -9
  925. package/corpus/templates/plan/app/components/plan/CanvasArea.tsx +1 -1
  926. package/corpus/templates/plan/app/components/plan/DocumentArea.tsx +3 -5
  927. package/corpus/templates/plan/app/components/plan/GuestModeBanner.tsx +1 -1
  928. package/corpus/templates/plan/app/components/plan/LocalCodebasePicker.tsx +2 -1
  929. package/corpus/templates/plan/app/components/plan/PlanContentRenderer.tsx +7 -5
  930. package/corpus/templates/plan/app/components/plan/PlanImageNode.tsx +2 -1
  931. package/corpus/templates/plan/app/components/plan/PlanImageViewer.tsx +1 -1
  932. package/corpus/templates/plan/app/components/plan/PlanMarkdownEditor.tsx +3 -3
  933. package/corpus/templates/plan/app/components/plan/PlanMarkdownReader.tsx +1 -1
  934. package/corpus/templates/plan/app/components/plan/PlanTableOfContents.tsx +1 -1
  935. package/corpus/templates/plan/app/components/plan/PlanVisualSurface.tsx +1 -1
  936. package/corpus/templates/plan/app/components/plan/PrototypeViewer.tsx +1 -1
  937. package/corpus/templates/plan/app/components/plan/VisualAnswerInline.tsx +1 -1
  938. package/corpus/templates/plan/app/components/plan/planBlocks.tsx +3 -5
  939. package/corpus/templates/plan/app/components/plan/wireframe/LegacyRegionWireframe.tsx +1 -1
  940. package/corpus/templates/plan/app/components/plan/wireframe/Wireframe.tsx +1 -1
  941. package/corpus/templates/plan/app/hooks/use-navigation-state.ts +5 -3
  942. package/corpus/templates/plan/app/hooks/use-plan-presence.ts +2 -2
  943. package/corpus/templates/plan/app/hooks/use-plans.ts +4 -1
  944. package/corpus/templates/plan/app/i18n/ar-SA.ts +4 -0
  945. package/corpus/templates/plan/app/i18n/de-DE.ts +4 -0
  946. package/corpus/templates/plan/app/i18n/en-US.ts +4 -0
  947. package/corpus/templates/plan/app/i18n/es-ES.ts +4 -0
  948. package/corpus/templates/plan/app/i18n/fr-FR.ts +4 -0
  949. package/corpus/templates/plan/app/i18n/hi-IN.ts +4 -0
  950. package/corpus/templates/plan/app/i18n/index.ts +1 -1
  951. package/corpus/templates/plan/app/i18n/ja-JP.ts +4 -0
  952. package/corpus/templates/plan/app/i18n/ko-KR.ts +4 -0
  953. package/corpus/templates/plan/app/i18n/pt-BR.ts +4 -0
  954. package/corpus/templates/plan/app/i18n/zh-CN.ts +4 -0
  955. package/corpus/templates/plan/app/i18n/zh-TW.ts +4 -0
  956. package/corpus/templates/plan/app/lib/local-codebase-context.ts +1 -1
  957. package/corpus/templates/plan/app/lib/local-control-resources.ts +1 -1
  958. package/corpus/templates/plan/app/lib/plan-comment-editor-helpers.ts +1 -1
  959. package/corpus/templates/plan/app/lib/plan-local-bridge.ts +1 -1
  960. package/corpus/templates/plan/app/lib/register-chat-renderers.tsx +1 -1
  961. package/corpus/templates/plan/app/lib/utils.ts +1 -1
  962. package/corpus/templates/plan/app/pages/PlanChatPage.tsx +2 -2
  963. package/corpus/templates/plan/app/pages/PlansPage.tsx +13 -14
  964. package/corpus/templates/plan/app/root.tsx +11 -10
  965. package/corpus/templates/plan/app/routes/agent.tsx +2 -1
  966. package/corpus/templates/plan/app/routes/settings.tsx +4 -5
  967. package/corpus/templates/plan/shared/plan-doc.ts +2 -47
  968. package/corpus/templates/slides/.agents/skills/actions/SKILL.md +3 -3
  969. package/corpus/templates/slides/.agents/skills/delegate-to-agent/SKILL.md +3 -3
  970. package/corpus/templates/slides/.agents/skills/feature-flags/SKILL.md +1 -1
  971. package/corpus/templates/slides/.agents/skills/upgrade-agent-native/SKILL.md +12 -5
  972. package/corpus/templates/slides/app/components/CloudUpgrade.tsx +1 -1
  973. package/corpus/templates/slides/app/components/ThemeToggle.tsx +1 -1
  974. package/corpus/templates/slides/app/components/comments/SlideCommentsPanel.tsx +1 -1
  975. package/corpus/templates/slides/app/components/deck/DeckCard.tsx +2 -1
  976. package/corpus/templates/slides/app/components/deck/SlideRenderer.tsx +1 -1
  977. package/corpus/templates/slides/app/components/design-system/DesignSystemCard.tsx +2 -1
  978. package/corpus/templates/slides/app/components/design-system/DesignSystemPreview.tsx +1 -1
  979. package/corpus/templates/slides/app/components/design-system/DesignSystemSetup.tsx +5 -5
  980. package/corpus/templates/slides/app/components/editor/AnimationsPanel.tsx +1 -1
  981. package/corpus/templates/slides/app/components/editor/AssetLibraryPanel.tsx +2 -1
  982. package/corpus/templates/slides/app/components/editor/BlockBubbleMenu.tsx +1 -1
  983. package/corpus/templates/slides/app/components/editor/EditorSidebar.tsx +6 -6
  984. package/corpus/templates/slides/app/components/editor/EditorToolbar.tsx +6 -8
  985. package/corpus/templates/slides/app/components/editor/ExportMenu.tsx +2 -1
  986. package/corpus/templates/slides/app/components/editor/GenerateSlidesDialog.tsx +2 -1
  987. package/corpus/templates/slides/app/components/editor/GeneratingOverlay.tsx +1 -1
  988. package/corpus/templates/slides/app/components/editor/GoogleDocImportHint.tsx +3 -5
  989. package/corpus/templates/slides/app/components/editor/HistoryPanel.tsx +1 -1
  990. package/corpus/templates/slides/app/components/editor/ImageDropPromptPopover.tsx +3 -1
  991. package/corpus/templates/slides/app/components/editor/ImageGenPanel.tsx +1 -1
  992. package/corpus/templates/slides/app/components/editor/ImageOverlay.tsx +1 -1
  993. package/corpus/templates/slides/app/components/editor/ImageSearchPanel.tsx +2 -1
  994. package/corpus/templates/slides/app/components/editor/ImportButton.tsx +5 -1
  995. package/corpus/templates/slides/app/components/editor/LogoSearchPanel.tsx +2 -1
  996. package/corpus/templates/slides/app/components/editor/MermaidToExcalidrawPanel.tsx +1 -1
  997. package/corpus/templates/slides/app/components/editor/PromptDialog.tsx +3 -1
  998. package/corpus/templates/slides/app/components/editor/QuestionFlow.tsx +1 -1
  999. package/corpus/templates/slides/app/components/editor/ShareDialog.tsx +2 -1
  1000. package/corpus/templates/slides/app/components/editor/SlideBubbleMenu.tsx +1 -1
  1001. package/corpus/templates/slides/app/components/editor/SlideEditor.tsx +12 -8
  1002. package/corpus/templates/slides/app/components/editor/SlideInlineEditor.tsx +2 -1
  1003. package/corpus/templates/slides/app/components/editor/SlideSlashMenu.tsx +1 -1
  1004. package/corpus/templates/slides/app/components/editor/SlideStyleInspector.tsx +1 -1
  1005. package/corpus/templates/slides/app/components/editor/SpeakerNotesPanel.tsx +1 -1
  1006. package/corpus/templates/slides/app/components/editor/TweaksPanel.tsx +1 -1
  1007. package/corpus/templates/slides/app/components/layout/AgentWorkIndicator.tsx +2 -1
  1008. package/corpus/templates/slides/app/components/layout/Header.tsx +2 -1
  1009. package/corpus/templates/slides/app/components/layout/Layout.tsx +2 -1
  1010. package/corpus/templates/slides/app/components/layout/Sidebar.tsx +4 -6
  1011. package/corpus/templates/slides/app/components/presentation/PresentationView.tsx +1 -1
  1012. package/corpus/templates/slides/app/components/visual-editor/CanvasCommentPins.tsx +2 -1
  1013. package/corpus/templates/slides/app/components/visual-editor/DrawOverlay.tsx +1 -1
  1014. package/corpus/templates/slides/app/components/visual-editor/MultiSelectChip.tsx +1 -1
  1015. package/corpus/templates/slides/app/components/visual-editor/SaveStatusIndicator.tsx +1 -1
  1016. package/corpus/templates/slides/app/context/DeckContext.tsx +5 -3
  1017. package/corpus/templates/slides/app/entry.client.tsx +2 -4
  1018. package/corpus/templates/slides/app/hooks/use-agent-generating.ts +1 -1
  1019. package/corpus/templates/slides/app/hooks/use-db-status.ts +1 -1
  1020. package/corpus/templates/slides/app/hooks/use-deck-design-system.ts +1 -1
  1021. package/corpus/templates/slides/app/hooks/use-deck-presence.ts +1 -1
  1022. package/corpus/templates/slides/app/hooks/use-deck-role.ts +1 -1
  1023. package/corpus/templates/slides/app/hooks/use-deck-versions.ts +4 -1
  1024. package/corpus/templates/slides/app/hooks/use-design-systems.ts +1 -1
  1025. package/corpus/templates/slides/app/hooks/use-navigation-state.ts +1 -1
  1026. package/corpus/templates/slides/app/hooks/use-slide-comments.ts +2 -2
  1027. package/corpus/templates/slides/app/i18n/index.ts +1 -1
  1028. package/corpus/templates/slides/app/lib/utils.ts +1 -1
  1029. package/corpus/templates/slides/app/pages/DeckEditor.tsx +5 -6
  1030. package/corpus/templates/slides/app/pages/DesignSystems.tsx +2 -1
  1031. package/corpus/templates/slides/app/pages/Index.tsx +4 -7
  1032. package/corpus/templates/slides/app/pages/NotFound.tsx +1 -1
  1033. package/corpus/templates/slides/app/pages/Presentation.tsx +1 -1
  1034. package/corpus/templates/slides/app/pages/SharedPresentation.tsx +2 -1
  1035. package/corpus/templates/slides/app/root.tsx +13 -11
  1036. package/corpus/templates/slides/app/routes/agent.tsx +2 -1
  1037. package/corpus/templates/slides/app/routes/settings.tsx +4 -5
  1038. package/corpus/templates/slides/app/routes/slide.tsx +3 -3
  1039. package/corpus/templates/tasks/.agents/skills/actions/SKILL.md +3 -3
  1040. package/corpus/templates/tasks/.agents/skills/adding-a-feature/SKILL.md +1 -1
  1041. package/corpus/templates/tasks/.agents/skills/delegate-to-agent/SKILL.md +3 -3
  1042. package/corpus/templates/tasks/.agents/skills/feature-flags/SKILL.md +1 -1
  1043. package/corpus/templates/tasks/.agents/skills/real-time-sync/SKILL.md +4 -4
  1044. package/corpus/templates/tasks/.agents/skills/upgrade-agent-native/SKILL.md +12 -5
  1045. package/corpus/templates/tasks/app/components/custom-fields/FieldsList.tsx +1 -1
  1046. package/corpus/templates/tasks/app/components/layout/Header.tsx +1 -1
  1047. package/corpus/templates/tasks/app/components/layout/Layout.tsx +4 -1
  1048. package/corpus/templates/tasks/app/components/layout/Sidebar.tsx +2 -1
  1049. package/corpus/templates/tasks/app/components/shared/ListViewHeader.tsx +1 -1
  1050. package/corpus/templates/tasks/app/components/tasks/TaskList.tsx +1 -1
  1051. package/corpus/templates/tasks/app/hooks/use-custom-fields.ts +4 -1
  1052. package/corpus/templates/tasks/app/hooks/use-inbox-items.ts +4 -1
  1053. package/corpus/templates/tasks/app/hooks/use-navigation-state.ts +2 -1
  1054. package/corpus/templates/tasks/app/hooks/use-tasks.ts +4 -1
  1055. package/corpus/templates/tasks/app/hooks/use-visible-task-fields.ts +4 -1
  1056. package/corpus/templates/tasks/app/lib/utils.ts +1 -1
  1057. package/corpus/templates/tasks/app/root.tsx +9 -7
  1058. package/dist/cli/doctor.d.ts +4 -1
  1059. package/dist/cli/doctor.d.ts.map +1 -1
  1060. package/dist/cli/doctor.js +57 -5
  1061. package/dist/cli/doctor.js.map +1 -1
  1062. package/dist/cli/migration-codemod.d.ts +21 -0
  1063. package/dist/cli/migration-codemod.d.ts.map +1 -0
  1064. package/dist/cli/migration-codemod.js +363 -0
  1065. package/dist/cli/migration-codemod.js.map +1 -0
  1066. package/dist/cli/upgrade.d.ts +7 -0
  1067. package/dist/cli/upgrade.d.ts.map +1 -1
  1068. package/dist/cli/upgrade.js +52 -7
  1069. package/dist/cli/upgrade.js.map +1 -1
  1070. package/dist/client/agent-chat/index.d.ts +40 -0
  1071. package/dist/client/agent-chat/index.d.ts.map +1 -0
  1072. package/dist/client/agent-chat/index.js +39 -0
  1073. package/dist/client/agent-chat/index.js.map +1 -0
  1074. package/dist/client/agent-page/AgentContextTab.d.ts.map +1 -1
  1075. package/dist/client/agent-page/AgentContextTab.js +3 -1
  1076. package/dist/client/agent-page/AgentContextTab.js.map +1 -1
  1077. package/dist/client/analytics/index.d.ts +3 -0
  1078. package/dist/client/analytics/index.d.ts.map +1 -0
  1079. package/dist/client/analytics/index.js +3 -0
  1080. package/dist/client/analytics/index.js.map +1 -0
  1081. package/dist/client/api-path.js +2 -2
  1082. package/dist/client/api-path.js.map +1 -1
  1083. package/dist/client/automation/index.d.ts +2 -0
  1084. package/dist/client/automation/index.d.ts.map +1 -0
  1085. package/dist/client/automation/index.js +2 -0
  1086. package/dist/client/automation/index.js.map +1 -0
  1087. package/dist/client/changelog/index.d.ts +2 -0
  1088. package/dist/client/changelog/index.d.ts.map +1 -0
  1089. package/dist/client/changelog/index.js +2 -0
  1090. package/dist/client/changelog/index.js.map +1 -0
  1091. package/dist/client/chat/widgets/InlineExtensionWidget.d.ts +1 -12
  1092. package/dist/client/chat/widgets/InlineExtensionWidget.d.ts.map +1 -1
  1093. package/dist/client/chat/widgets/InlineExtensionWidget.js +2 -66
  1094. package/dist/client/chat/widgets/InlineExtensionWidget.js.map +1 -1
  1095. package/dist/client/chat/widgets/builtin-tool-renderers.d.ts.map +1 -1
  1096. package/dist/client/chat/widgets/builtin-tool-renderers.js +21 -8
  1097. package/dist/client/chat/widgets/builtin-tool-renderers.js.map +1 -1
  1098. package/dist/client/chat/widgets/inline-extension-result.d.ts +14 -0
  1099. package/dist/client/chat/widgets/inline-extension-result.d.ts.map +1 -0
  1100. package/dist/client/chat/widgets/inline-extension-result.js +67 -0
  1101. package/dist/client/chat/widgets/inline-extension-result.js.map +1 -0
  1102. package/dist/client/client-bootstrap.d.ts +2 -0
  1103. package/dist/client/client-bootstrap.d.ts.map +1 -0
  1104. package/dist/client/client-bootstrap.js +7 -0
  1105. package/dist/client/client-bootstrap.js.map +1 -0
  1106. package/dist/client/context-xray/ContextXRayPanel.js +1 -1
  1107. package/dist/client/context-xray/ContextXRayPanel.js.map +1 -1
  1108. package/dist/client/hooks/index.d.ts +13 -0
  1109. package/dist/client/hooks/index.d.ts.map +1 -0
  1110. package/dist/client/hooks/index.js +13 -0
  1111. package/dist/client/hooks/index.js.map +1 -0
  1112. package/dist/client/host/index.d.ts +20 -0
  1113. package/dist/client/host/index.d.ts.map +1 -0
  1114. package/dist/client/host/index.js +18 -0
  1115. package/dist/client/host/index.js.map +1 -0
  1116. package/dist/client/index.d.ts +19 -100
  1117. package/dist/client/index.d.ts.map +1 -1
  1118. package/dist/client/index.js +19 -106
  1119. package/dist/client/index.js.map +1 -1
  1120. package/dist/client/navigation/index.d.ts +6 -0
  1121. package/dist/client/navigation/index.d.ts.map +1 -0
  1122. package/dist/client/navigation/index.js +6 -0
  1123. package/dist/client/navigation/index.js.map +1 -0
  1124. package/dist/client/resources/ResourcesPanel.d.ts.map +1 -1
  1125. package/dist/client/resources/ResourcesPanel.js +2 -1
  1126. package/dist/client/resources/ResourcesPanel.js.map +1 -1
  1127. package/dist/client/resources/index.d.ts +2 -1
  1128. package/dist/client/resources/index.d.ts.map +1 -1
  1129. package/dist/client/resources/index.js +1 -0
  1130. package/dist/client/resources/index.js.map +1 -1
  1131. package/dist/client/resources/use-resources.d.ts +0 -1
  1132. package/dist/client/resources/use-resources.d.ts.map +1 -1
  1133. package/dist/client/resources/use-resources.js +0 -17
  1134. package/dist/client/resources/use-resources.js.map +1 -1
  1135. package/dist/client/route-chunk-recovery/index.d.ts +2 -0
  1136. package/dist/client/route-chunk-recovery/index.d.ts.map +1 -0
  1137. package/dist/client/route-chunk-recovery/index.js +2 -0
  1138. package/dist/client/route-chunk-recovery/index.js.map +1 -0
  1139. package/dist/client/ui/index.d.ts +18 -0
  1140. package/dist/client/ui/index.d.ts.map +1 -0
  1141. package/dist/client/ui/index.js +18 -0
  1142. package/dist/client/ui/index.js.map +1 -0
  1143. package/dist/client/uploads/index.d.ts +2 -0
  1144. package/dist/client/uploads/index.d.ts.map +1 -0
  1145. package/dist/client/uploads/index.js +2 -0
  1146. package/dist/client/uploads/index.js.map +1 -0
  1147. package/dist/client/uploads/use-upload-resource.d.ts +3 -0
  1148. package/dist/client/uploads/use-upload-resource.d.ts.map +1 -0
  1149. package/dist/client/uploads/use-upload-resource.js +20 -0
  1150. package/dist/client/uploads/use-upload-resource.js.map +1 -0
  1151. package/dist/client/widgets/index.d.ts +3 -0
  1152. package/dist/client/widgets/index.d.ts.map +1 -0
  1153. package/dist/client/widgets/index.js +3 -0
  1154. package/dist/client/widgets/index.js.map +1 -0
  1155. package/dist/collab/awareness.d.ts +2 -2
  1156. package/dist/collab/awareness.d.ts.map +1 -1
  1157. package/dist/collab/struct-routes.d.ts +1 -1
  1158. package/dist/localization/default-messages.d.ts +2 -1
  1159. package/dist/localization/default-messages.d.ts.map +1 -1
  1160. package/dist/localization/default-messages.js +2 -1
  1161. package/dist/localization/default-messages.js.map +1 -1
  1162. package/dist/notifications/routes.d.ts +3 -3
  1163. package/dist/package-lifecycle/deprecated-imports.d.ts +15 -0
  1164. package/dist/package-lifecycle/deprecated-imports.d.ts.map +1 -0
  1165. package/dist/package-lifecycle/deprecated-imports.js +141 -0
  1166. package/dist/package-lifecycle/deprecated-imports.js.map +1 -0
  1167. package/dist/package-lifecycle/index.d.ts +5 -0
  1168. package/dist/package-lifecycle/index.d.ts.map +1 -1
  1169. package/dist/package-lifecycle/index.js +5 -0
  1170. package/dist/package-lifecycle/index.js.map +1 -1
  1171. package/dist/package-lifecycle/migration-manifest.d.ts +28 -0
  1172. package/dist/package-lifecycle/migration-manifest.d.ts.map +1 -0
  1173. package/dist/package-lifecycle/migration-manifest.js +102 -0
  1174. package/dist/package-lifecycle/migration-manifest.js.map +1 -0
  1175. package/dist/package-lifecycle/migration-message.d.ts +3 -0
  1176. package/dist/package-lifecycle/migration-message.d.ts.map +1 -0
  1177. package/dist/package-lifecycle/migration-message.js +5 -0
  1178. package/dist/package-lifecycle/migration-message.js.map +1 -0
  1179. package/dist/package-lifecycle/tombstone.d.ts +10 -0
  1180. package/dist/package-lifecycle/tombstone.d.ts.map +1 -0
  1181. package/dist/package-lifecycle/tombstone.js +23 -0
  1182. package/dist/package-lifecycle/tombstone.js.map +1 -0
  1183. package/dist/package-lifecycle/upgrade-error.d.ts +11 -0
  1184. package/dist/package-lifecycle/upgrade-error.d.ts.map +1 -0
  1185. package/dist/package-lifecycle/upgrade-error.js +11 -0
  1186. package/dist/package-lifecycle/upgrade-error.js.map +1 -0
  1187. package/dist/secrets/routes.d.ts +9 -9
  1188. package/dist/server/agent-engine-api-key-route.d.ts +1 -1
  1189. package/dist/server/transcribe-voice.d.ts +1 -1
  1190. package/dist/templates/chat/.agents/skills/actions/SKILL.md +3 -3
  1191. package/dist/templates/chat/.agents/skills/adding-a-feature/SKILL.md +1 -1
  1192. package/dist/templates/chat/.agents/skills/delegate-to-agent/SKILL.md +3 -3
  1193. package/dist/templates/chat/.agents/skills/feature-flags/SKILL.md +1 -1
  1194. package/dist/templates/chat/.agents/skills/real-time-sync/SKILL.md +4 -4
  1195. package/dist/templates/chat/.agents/skills/upgrade-agent-native/SKILL.md +12 -5
  1196. package/dist/templates/chat/app/components/layout/Header.tsx +2 -1
  1197. package/dist/templates/chat/app/components/layout/Layout.tsx +2 -2
  1198. package/dist/templates/chat/app/components/layout/Sidebar.tsx +4 -4
  1199. package/dist/templates/chat/app/hooks/use-navigation-state.ts +3 -4
  1200. package/dist/templates/chat/app/i18n/index.ts +1 -1
  1201. package/dist/templates/chat/app/i18n-data.ts +1 -1
  1202. package/dist/templates/chat/app/lib/utils.ts +1 -1
  1203. package/dist/templates/chat/app/root.tsx +10 -9
  1204. package/dist/templates/chat/app/routes/_index.tsx +2 -2
  1205. package/dist/templates/chat/app/routes/agent.tsx +10 -3
  1206. package/dist/templates/chat/app/routes/database.tsx +1 -1
  1207. package/dist/templates/chat/app/routes/observability.tsx +2 -1
  1208. package/dist/templates/chat/app/routes/settings.tsx +4 -5
  1209. package/dist/templates/default/.agents/skills/actions/SKILL.md +3 -3
  1210. package/dist/templates/default/.agents/skills/adding-a-feature/SKILL.md +1 -1
  1211. package/dist/templates/default/.agents/skills/delegate-to-agent/SKILL.md +3 -3
  1212. package/dist/templates/default/.agents/skills/feature-flags/SKILL.md +1 -1
  1213. package/dist/templates/default/.agents/skills/real-time-collab/SKILL.md +4 -4
  1214. package/dist/templates/default/.agents/skills/real-time-sync/SKILL.md +4 -4
  1215. package/dist/templates/default/.agents/skills/storing-data/SKILL.md +1 -1
  1216. package/dist/templates/default/.agents/skills/upgrade-agent-native/SKILL.md +12 -5
  1217. package/dist/templates/default/app/hooks/use-navigation-state.ts +2 -5
  1218. package/dist/templates/default/app/i18n/index.ts +1 -1
  1219. package/dist/templates/default/app/lib/utils.ts +1 -1
  1220. package/dist/templates/default/app/root.tsx +8 -6
  1221. package/dist/templates/default/app/routes/_index.tsx +2 -1
  1222. package/dist/templates/default/app/routes/agent.tsx +2 -1
  1223. package/dist/templates/default/app/routes/settings.tsx +2 -3
  1224. package/dist/templates/headless/.agents/skills/feature-flags/SKILL.md +1 -1
  1225. package/dist/templates/headless/.agents/skills/upgrade-agent-native/SKILL.md +12 -5
  1226. package/dist/templates/workspace-core/.agents/skills/actions/SKILL.md +3 -3
  1227. package/dist/templates/workspace-core/.agents/skills/adding-a-feature/SKILL.md +1 -1
  1228. package/dist/templates/workspace-core/.agents/skills/authentication/SKILL.md +1 -1
  1229. package/dist/templates/workspace-core/.agents/skills/changelog/SKILL.md +1 -1
  1230. package/dist/templates/workspace-core/.agents/skills/client-methods/SKILL.md +10 -10
  1231. package/dist/templates/workspace-core/.agents/skills/context-awareness/SKILL.md +1 -1
  1232. package/dist/templates/workspace-core/.agents/skills/delegate-to-agent/SKILL.md +3 -3
  1233. package/dist/templates/workspace-core/.agents/skills/feature-flags/SKILL.md +1 -1
  1234. package/dist/templates/workspace-core/.agents/skills/observability/SKILL.md +1 -1
  1235. package/dist/templates/workspace-core/.agents/skills/real-time-collab/SKILL.md +4 -4
  1236. package/dist/templates/workspace-core/.agents/skills/real-time-sync/SKILL.md +4 -4
  1237. package/dist/templates/workspace-core/.agents/skills/sharing/SKILL.md +1 -1
  1238. package/dist/templates/workspace-core/.agents/skills/storing-data/SKILL.md +1 -1
  1239. package/dist/templates/workspace-core/.agents/skills/upgrade-agent-native/SKILL.md +12 -5
  1240. package/dist/vite/action-types-plugin.d.ts.map +1 -1
  1241. package/dist/vite/action-types-plugin.js +4 -0
  1242. package/dist/vite/action-types-plugin.js.map +1 -1
  1243. package/dist/vite/client.d.ts.map +1 -1
  1244. package/dist/vite/client.js +35 -64
  1245. package/dist/vite/client.js.map +1 -1
  1246. package/docs/content/actions.mdx +2 -4
  1247. package/docs/content/agent-surfaces.mdx +2 -4
  1248. package/docs/content/audit-log.mdx +1 -2
  1249. package/docs/content/authentication.mdx +3 -2
  1250. package/docs/content/client.mdx +19 -18
  1251. package/docs/content/components.mdx +1 -1
  1252. package/docs/content/context-awareness.mdx +4 -7
  1253. package/docs/content/creating-templates.mdx +7 -5
  1254. package/docs/content/doctor.mdx +27 -6
  1255. package/docs/content/drop-in-agent.mdx +6 -11
  1256. package/docs/content/embedding-sdk.mdx +8 -10
  1257. package/docs/content/getting-started.mdx +4 -2
  1258. package/docs/content/internationalization.mdx +9 -6
  1259. package/docs/content/key-concepts.mdx +2 -4
  1260. package/docs/content/locales/ar-SA/actions.mdx +2 -4
  1261. package/docs/content/locales/ar-SA/agent-surfaces.mdx +2 -4
  1262. package/docs/content/locales/ar-SA/audit-log.mdx +1 -2
  1263. package/docs/content/locales/ar-SA/authentication.mdx +3 -2
  1264. package/docs/content/locales/ar-SA/client.mdx +19 -18
  1265. package/docs/content/locales/ar-SA/components.mdx +1 -1
  1266. package/docs/content/locales/ar-SA/context-awareness.mdx +4 -7
  1267. package/docs/content/locales/ar-SA/creating-templates.mdx +7 -5
  1268. package/docs/content/locales/ar-SA/doctor.mdx +10 -0
  1269. package/docs/content/locales/ar-SA/drop-in-agent.mdx +6 -11
  1270. package/docs/content/locales/ar-SA/embedding-sdk.mdx +8 -10
  1271. package/docs/content/locales/ar-SA/internationalization.mdx +9 -6
  1272. package/docs/content/locales/ar-SA/key-concepts.mdx +2 -4
  1273. package/docs/content/locales/ar-SA/observability.mdx +1 -2
  1274. package/docs/content/locales/ar-SA/package-lifecycle.mdx +6 -0
  1275. package/docs/content/locales/ar-SA/real-time-collaboration.mdx +4 -7
  1276. package/docs/content/locales/ar-SA/sharing.mdx +1 -2
  1277. package/docs/content/locales/ar-SA/template-chat.mdx +1 -2
  1278. package/docs/content/locales/ar-SA/tracking.mdx +2 -4
  1279. package/docs/content/locales/ar-SA/what-is-agent-native.mdx +1 -2
  1280. package/docs/content/locales/de-DE/actions.mdx +2 -4
  1281. package/docs/content/locales/de-DE/agent-surfaces.mdx +2 -4
  1282. package/docs/content/locales/de-DE/audit-log.mdx +1 -2
  1283. package/docs/content/locales/de-DE/authentication.mdx +3 -2
  1284. package/docs/content/locales/de-DE/client.mdx +19 -18
  1285. package/docs/content/locales/de-DE/components.mdx +1 -1
  1286. package/docs/content/locales/de-DE/context-awareness.mdx +4 -7
  1287. package/docs/content/locales/de-DE/creating-templates.mdx +7 -5
  1288. package/docs/content/locales/de-DE/doctor.mdx +10 -0
  1289. package/docs/content/locales/de-DE/drop-in-agent.mdx +6 -11
  1290. package/docs/content/locales/de-DE/embedding-sdk.mdx +8 -10
  1291. package/docs/content/locales/de-DE/internationalization.mdx +9 -6
  1292. package/docs/content/locales/de-DE/key-concepts.mdx +2 -4
  1293. package/docs/content/locales/de-DE/observability.mdx +1 -2
  1294. package/docs/content/locales/de-DE/package-lifecycle.mdx +6 -0
  1295. package/docs/content/locales/de-DE/real-time-collaboration.mdx +4 -7
  1296. package/docs/content/locales/de-DE/sharing.mdx +1 -2
  1297. package/docs/content/locales/de-DE/template-chat.mdx +1 -2
  1298. package/docs/content/locales/de-DE/tracking.mdx +2 -4
  1299. package/docs/content/locales/de-DE/what-is-agent-native.mdx +1 -2
  1300. package/docs/content/locales/es-ES/actions.mdx +2 -4
  1301. package/docs/content/locales/es-ES/agent-surfaces.mdx +2 -4
  1302. package/docs/content/locales/es-ES/audit-log.mdx +1 -2
  1303. package/docs/content/locales/es-ES/authentication.mdx +3 -2
  1304. package/docs/content/locales/es-ES/client.mdx +19 -18
  1305. package/docs/content/locales/es-ES/components.mdx +1 -1
  1306. package/docs/content/locales/es-ES/context-awareness.mdx +4 -7
  1307. package/docs/content/locales/es-ES/creating-templates.mdx +7 -5
  1308. package/docs/content/locales/es-ES/doctor.mdx +10 -0
  1309. package/docs/content/locales/es-ES/drop-in-agent.mdx +6 -11
  1310. package/docs/content/locales/es-ES/embedding-sdk.mdx +8 -10
  1311. package/docs/content/locales/es-ES/internationalization.mdx +9 -6
  1312. package/docs/content/locales/es-ES/key-concepts.mdx +2 -4
  1313. package/docs/content/locales/es-ES/observability.mdx +1 -2
  1314. package/docs/content/locales/es-ES/package-lifecycle.mdx +6 -0
  1315. package/docs/content/locales/es-ES/real-time-collaboration.mdx +4 -7
  1316. package/docs/content/locales/es-ES/sharing.mdx +1 -2
  1317. package/docs/content/locales/es-ES/template-chat.mdx +1 -2
  1318. package/docs/content/locales/es-ES/tracking.mdx +2 -4
  1319. package/docs/content/locales/es-ES/what-is-agent-native.mdx +1 -2
  1320. package/docs/content/locales/fr-FR/actions.mdx +2 -4
  1321. package/docs/content/locales/fr-FR/agent-surfaces.mdx +2 -4
  1322. package/docs/content/locales/fr-FR/audit-log.mdx +1 -2
  1323. package/docs/content/locales/fr-FR/authentication.mdx +3 -2
  1324. package/docs/content/locales/fr-FR/client.mdx +19 -18
  1325. package/docs/content/locales/fr-FR/components.mdx +1 -1
  1326. package/docs/content/locales/fr-FR/context-awareness.mdx +4 -7
  1327. package/docs/content/locales/fr-FR/creating-templates.mdx +7 -5
  1328. package/docs/content/locales/fr-FR/doctor.mdx +10 -0
  1329. package/docs/content/locales/fr-FR/drop-in-agent.mdx +6 -11
  1330. package/docs/content/locales/fr-FR/embedding-sdk.mdx +8 -10
  1331. package/docs/content/locales/fr-FR/internationalization.mdx +9 -6
  1332. package/docs/content/locales/fr-FR/key-concepts.mdx +2 -4
  1333. package/docs/content/locales/fr-FR/observability.mdx +1 -2
  1334. package/docs/content/locales/fr-FR/package-lifecycle.mdx +6 -0
  1335. package/docs/content/locales/fr-FR/real-time-collaboration.mdx +4 -7
  1336. package/docs/content/locales/fr-FR/sharing.mdx +1 -2
  1337. package/docs/content/locales/fr-FR/template-chat.mdx +1 -2
  1338. package/docs/content/locales/fr-FR/tracking.mdx +2 -4
  1339. package/docs/content/locales/fr-FR/what-is-agent-native.mdx +1 -2
  1340. package/docs/content/locales/hi-IN/actions.mdx +2 -4
  1341. package/docs/content/locales/hi-IN/agent-surfaces.mdx +2 -4
  1342. package/docs/content/locales/hi-IN/audit-log.mdx +1 -2
  1343. package/docs/content/locales/hi-IN/authentication.mdx +3 -2
  1344. package/docs/content/locales/hi-IN/client.mdx +19 -18
  1345. package/docs/content/locales/hi-IN/components.mdx +1 -1
  1346. package/docs/content/locales/hi-IN/context-awareness.mdx +4 -7
  1347. package/docs/content/locales/hi-IN/creating-templates.mdx +7 -5
  1348. package/docs/content/locales/hi-IN/doctor.mdx +10 -0
  1349. package/docs/content/locales/hi-IN/drop-in-agent.mdx +6 -11
  1350. package/docs/content/locales/hi-IN/embedding-sdk.mdx +8 -10
  1351. package/docs/content/locales/hi-IN/internationalization.mdx +9 -6
  1352. package/docs/content/locales/hi-IN/key-concepts.mdx +2 -4
  1353. package/docs/content/locales/hi-IN/observability.mdx +1 -2
  1354. package/docs/content/locales/hi-IN/package-lifecycle.mdx +6 -0
  1355. package/docs/content/locales/hi-IN/real-time-collaboration.mdx +4 -7
  1356. package/docs/content/locales/hi-IN/sharing.mdx +1 -2
  1357. package/docs/content/locales/hi-IN/template-chat.mdx +1 -2
  1358. package/docs/content/locales/hi-IN/tracking.mdx +2 -4
  1359. package/docs/content/locales/hi-IN/what-is-agent-native.mdx +1 -2
  1360. package/docs/content/locales/ja-JP/actions.mdx +2 -4
  1361. package/docs/content/locales/ja-JP/agent-surfaces.mdx +2 -4
  1362. package/docs/content/locales/ja-JP/audit-log.mdx +1 -2
  1363. package/docs/content/locales/ja-JP/authentication.mdx +3 -2
  1364. package/docs/content/locales/ja-JP/client.mdx +19 -18
  1365. package/docs/content/locales/ja-JP/components.mdx +1 -1
  1366. package/docs/content/locales/ja-JP/context-awareness.mdx +4 -7
  1367. package/docs/content/locales/ja-JP/creating-templates.mdx +7 -5
  1368. package/docs/content/locales/ja-JP/doctor.mdx +10 -0
  1369. package/docs/content/locales/ja-JP/drop-in-agent.mdx +6 -11
  1370. package/docs/content/locales/ja-JP/embedding-sdk.mdx +8 -10
  1371. package/docs/content/locales/ja-JP/internationalization.mdx +9 -6
  1372. package/docs/content/locales/ja-JP/key-concepts.mdx +2 -4
  1373. package/docs/content/locales/ja-JP/observability.mdx +1 -2
  1374. package/docs/content/locales/ja-JP/package-lifecycle.mdx +6 -0
  1375. package/docs/content/locales/ja-JP/real-time-collaboration.mdx +4 -7
  1376. package/docs/content/locales/ja-JP/sharing.mdx +1 -2
  1377. package/docs/content/locales/ja-JP/template-chat.mdx +1 -2
  1378. package/docs/content/locales/ja-JP/tracking.mdx +2 -4
  1379. package/docs/content/locales/ja-JP/what-is-agent-native.mdx +1 -2
  1380. package/docs/content/locales/ko-KR/actions.mdx +2 -4
  1381. package/docs/content/locales/ko-KR/agent-surfaces.mdx +2 -4
  1382. package/docs/content/locales/ko-KR/audit-log.mdx +1 -2
  1383. package/docs/content/locales/ko-KR/authentication.mdx +3 -2
  1384. package/docs/content/locales/ko-KR/client.mdx +19 -18
  1385. package/docs/content/locales/ko-KR/components.mdx +1 -1
  1386. package/docs/content/locales/ko-KR/context-awareness.mdx +4 -7
  1387. package/docs/content/locales/ko-KR/creating-templates.mdx +7 -5
  1388. package/docs/content/locales/ko-KR/doctor.mdx +10 -0
  1389. package/docs/content/locales/ko-KR/drop-in-agent.mdx +6 -11
  1390. package/docs/content/locales/ko-KR/embedding-sdk.mdx +8 -10
  1391. package/docs/content/locales/ko-KR/internationalization.mdx +9 -6
  1392. package/docs/content/locales/ko-KR/key-concepts.mdx +2 -4
  1393. package/docs/content/locales/ko-KR/observability.mdx +1 -2
  1394. package/docs/content/locales/ko-KR/package-lifecycle.mdx +6 -0
  1395. package/docs/content/locales/ko-KR/real-time-collaboration.mdx +4 -7
  1396. package/docs/content/locales/ko-KR/sharing.mdx +1 -2
  1397. package/docs/content/locales/ko-KR/template-chat.mdx +1 -2
  1398. package/docs/content/locales/ko-KR/tracking.mdx +2 -4
  1399. package/docs/content/locales/ko-KR/what-is-agent-native.mdx +1 -2
  1400. package/docs/content/locales/pt-BR/actions.mdx +2 -4
  1401. package/docs/content/locales/pt-BR/agent-surfaces.mdx +2 -4
  1402. package/docs/content/locales/pt-BR/audit-log.mdx +1 -2
  1403. package/docs/content/locales/pt-BR/authentication.mdx +3 -2
  1404. package/docs/content/locales/pt-BR/client.mdx +19 -18
  1405. package/docs/content/locales/pt-BR/components.mdx +1 -1
  1406. package/docs/content/locales/pt-BR/context-awareness.mdx +4 -7
  1407. package/docs/content/locales/pt-BR/creating-templates.mdx +7 -5
  1408. package/docs/content/locales/pt-BR/doctor.mdx +10 -0
  1409. package/docs/content/locales/pt-BR/drop-in-agent.mdx +6 -11
  1410. package/docs/content/locales/pt-BR/embedding-sdk.mdx +8 -10
  1411. package/docs/content/locales/pt-BR/internationalization.mdx +9 -6
  1412. package/docs/content/locales/pt-BR/key-concepts.mdx +2 -4
  1413. package/docs/content/locales/pt-BR/observability.mdx +1 -2
  1414. package/docs/content/locales/pt-BR/package-lifecycle.mdx +6 -0
  1415. package/docs/content/locales/pt-BR/real-time-collaboration.mdx +4 -7
  1416. package/docs/content/locales/pt-BR/sharing.mdx +1 -2
  1417. package/docs/content/locales/pt-BR/template-chat.mdx +1 -2
  1418. package/docs/content/locales/pt-BR/tracking.mdx +2 -4
  1419. package/docs/content/locales/pt-BR/what-is-agent-native.mdx +1 -2
  1420. package/docs/content/locales/zh-CN/actions.mdx +2 -4
  1421. package/docs/content/locales/zh-CN/agent-surfaces.mdx +2 -4
  1422. package/docs/content/locales/zh-CN/audit-log.mdx +1 -2
  1423. package/docs/content/locales/zh-CN/authentication.mdx +3 -2
  1424. package/docs/content/locales/zh-CN/client.mdx +19 -18
  1425. package/docs/content/locales/zh-CN/components.mdx +1 -1
  1426. package/docs/content/locales/zh-CN/context-awareness.mdx +4 -7
  1427. package/docs/content/locales/zh-CN/creating-templates.mdx +7 -5
  1428. package/docs/content/locales/zh-CN/doctor.mdx +10 -0
  1429. package/docs/content/locales/zh-CN/drop-in-agent.mdx +6 -11
  1430. package/docs/content/locales/zh-CN/embedding-sdk.mdx +8 -10
  1431. package/docs/content/locales/zh-CN/internationalization.mdx +9 -6
  1432. package/docs/content/locales/zh-CN/key-concepts.mdx +2 -4
  1433. package/docs/content/locales/zh-CN/observability.mdx +1 -2
  1434. package/docs/content/locales/zh-CN/package-lifecycle.mdx +6 -0
  1435. package/docs/content/locales/zh-CN/real-time-collaboration.mdx +4 -7
  1436. package/docs/content/locales/zh-CN/sharing.mdx +1 -2
  1437. package/docs/content/locales/zh-CN/template-chat.mdx +1 -2
  1438. package/docs/content/locales/zh-CN/tracking.mdx +2 -4
  1439. package/docs/content/locales/zh-CN/what-is-agent-native.mdx +1 -2
  1440. package/docs/content/locales/zh-TW/actions.mdx +2 -4
  1441. package/docs/content/locales/zh-TW/agent-surfaces.mdx +2 -4
  1442. package/docs/content/locales/zh-TW/audit-log.mdx +1 -2
  1443. package/docs/content/locales/zh-TW/authentication.mdx +3 -2
  1444. package/docs/content/locales/zh-TW/client.mdx +19 -18
  1445. package/docs/content/locales/zh-TW/components.mdx +1 -1
  1446. package/docs/content/locales/zh-TW/context-awareness.mdx +4 -7
  1447. package/docs/content/locales/zh-TW/creating-templates.mdx +7 -5
  1448. package/docs/content/locales/zh-TW/doctor.mdx +10 -0
  1449. package/docs/content/locales/zh-TW/drop-in-agent.mdx +6 -11
  1450. package/docs/content/locales/zh-TW/embedding-sdk.mdx +8 -10
  1451. package/docs/content/locales/zh-TW/internationalization.mdx +9 -6
  1452. package/docs/content/locales/zh-TW/key-concepts.mdx +2 -4
  1453. package/docs/content/locales/zh-TW/observability.mdx +1 -2
  1454. package/docs/content/locales/zh-TW/package-lifecycle.mdx +6 -0
  1455. package/docs/content/locales/zh-TW/real-time-collaboration.mdx +4 -7
  1456. package/docs/content/locales/zh-TW/sharing.mdx +1 -2
  1457. package/docs/content/locales/zh-TW/template-chat.mdx +1 -2
  1458. package/docs/content/locales/zh-TW/tracking.mdx +2 -4
  1459. package/docs/content/locales/zh-TW/what-is-agent-native.mdx +1 -2
  1460. package/docs/content/observability.mdx +1 -2
  1461. package/docs/content/package-lifecycle.mdx +29 -0
  1462. package/docs/content/real-time-collaboration.mdx +8 -7
  1463. package/docs/content/sharing.mdx +1 -2
  1464. package/docs/content/template-chat.mdx +1 -2
  1465. package/docs/content/toolkit-agent-ux.mdx +3 -2
  1466. package/docs/content/toolkit-observability.mdx +1 -2
  1467. package/docs/content/toolkit-settings.mdx +2 -2
  1468. package/docs/content/toolkit-sharing.mdx +5 -2
  1469. package/docs/content/tracking.mdx +2 -4
  1470. package/docs/content/what-is-agent-native.mdx +1 -2
  1471. package/migration-manifest.json +1353 -0
  1472. package/package.json +22 -4
  1473. package/src/templates/chat/.agents/skills/actions/SKILL.md +3 -3
  1474. package/src/templates/chat/.agents/skills/adding-a-feature/SKILL.md +1 -1
  1475. package/src/templates/chat/.agents/skills/delegate-to-agent/SKILL.md +3 -3
  1476. package/src/templates/chat/.agents/skills/feature-flags/SKILL.md +1 -1
  1477. package/src/templates/chat/.agents/skills/real-time-sync/SKILL.md +4 -4
  1478. package/src/templates/chat/.agents/skills/upgrade-agent-native/SKILL.md +12 -5
  1479. package/src/templates/chat/app/components/layout/Header.tsx +2 -1
  1480. package/src/templates/chat/app/components/layout/Layout.tsx +2 -2
  1481. package/src/templates/chat/app/components/layout/Sidebar.tsx +4 -4
  1482. package/src/templates/chat/app/hooks/use-navigation-state.ts +3 -4
  1483. package/src/templates/chat/app/i18n/index.ts +1 -1
  1484. package/src/templates/chat/app/i18n-data.ts +1 -1
  1485. package/src/templates/chat/app/lib/utils.ts +1 -1
  1486. package/src/templates/chat/app/root.tsx +10 -9
  1487. package/src/templates/chat/app/routes/_index.tsx +2 -2
  1488. package/src/templates/chat/app/routes/agent.tsx +10 -3
  1489. package/src/templates/chat/app/routes/database.tsx +1 -1
  1490. package/src/templates/chat/app/routes/observability.tsx +2 -1
  1491. package/src/templates/chat/app/routes/settings.tsx +4 -5
  1492. package/src/templates/default/.agents/skills/actions/SKILL.md +3 -3
  1493. package/src/templates/default/.agents/skills/adding-a-feature/SKILL.md +1 -1
  1494. package/src/templates/default/.agents/skills/delegate-to-agent/SKILL.md +3 -3
  1495. package/src/templates/default/.agents/skills/feature-flags/SKILL.md +1 -1
  1496. package/src/templates/default/.agents/skills/real-time-collab/SKILL.md +4 -4
  1497. package/src/templates/default/.agents/skills/real-time-sync/SKILL.md +4 -4
  1498. package/src/templates/default/.agents/skills/storing-data/SKILL.md +1 -1
  1499. package/src/templates/default/.agents/skills/upgrade-agent-native/SKILL.md +12 -5
  1500. package/src/templates/default/app/hooks/use-navigation-state.ts +2 -5
  1501. package/src/templates/default/app/i18n/index.ts +1 -1
  1502. package/src/templates/default/app/lib/utils.ts +1 -1
  1503. package/src/templates/default/app/root.tsx +8 -6
  1504. package/src/templates/default/app/routes/_index.tsx +2 -1
  1505. package/src/templates/default/app/routes/agent.tsx +2 -1
  1506. package/src/templates/default/app/routes/settings.tsx +2 -3
  1507. package/src/templates/headless/.agents/skills/feature-flags/SKILL.md +1 -1
  1508. package/src/templates/headless/.agents/skills/upgrade-agent-native/SKILL.md +12 -5
  1509. package/src/templates/workspace-core/.agents/skills/actions/SKILL.md +3 -3
  1510. package/src/templates/workspace-core/.agents/skills/adding-a-feature/SKILL.md +1 -1
  1511. package/src/templates/workspace-core/.agents/skills/authentication/SKILL.md +1 -1
  1512. package/src/templates/workspace-core/.agents/skills/changelog/SKILL.md +1 -1
  1513. package/src/templates/workspace-core/.agents/skills/client-methods/SKILL.md +10 -10
  1514. package/src/templates/workspace-core/.agents/skills/context-awareness/SKILL.md +1 -1
  1515. package/src/templates/workspace-core/.agents/skills/delegate-to-agent/SKILL.md +3 -3
  1516. package/src/templates/workspace-core/.agents/skills/feature-flags/SKILL.md +1 -1
  1517. package/src/templates/workspace-core/.agents/skills/observability/SKILL.md +1 -1
  1518. package/src/templates/workspace-core/.agents/skills/real-time-collab/SKILL.md +4 -4
  1519. package/src/templates/workspace-core/.agents/skills/real-time-sync/SKILL.md +4 -4
  1520. package/src/templates/workspace-core/.agents/skills/sharing/SKILL.md +1 -1
  1521. package/src/templates/workspace-core/.agents/skills/storing-data/SKILL.md +1 -1
  1522. package/src/templates/workspace-core/.agents/skills/upgrade-agent-native/SKILL.md +12 -5
@@ -1 +1 @@
1
- {"version":3,"file":"ResourcesPanel.js","sourceRoot":"","sources":["../../../src/client/resources/ResourcesPanel.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,QAAQ,EACR,UAAU,EACV,aAAa,EACb,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,OAAO,EACP,QAAQ,EACR,SAAS,EACT,cAAc,EACd,gBAAgB,EAChB,QAAQ,EACR,iBAAiB,GAClB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,EACZ,QAAQ,EACR,MAAM,EACN,WAAW,EACX,SAAS,EACT,OAAO,GACR,MAAM,OAAO,CAAC;AAEf,OAAO,EACL,sBAAsB,EACtB,yBAAyB,GAC1B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EACL,OAAO,EACP,cAAc,EACd,cAAc,GACf,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,OAAO,EACP,cAAc,EACd,eAAe,EACf,cAAc,GACf,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACz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AAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,EAClD,aAAa,EAAE,qBAAqB,CAAC,QAAQ,CAAC,GAC9C,CACH,IACG,CACP,GACG,EACL,KAAK,IAAI,CACR,cAAK,SAAS,EAAC,yEAAyE,YACtF,eACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,EAAE,CACX,6GAA6G,EAC7G,KAAK,CAAC,IAAI,KAAK,IAAI;wBACjB,CAAC,CAAC,gFAAgF;wBAClF,CAAC,CAAC,gEAAgE,CACrE,aAED,eAAM,SAAS,EAAC,yBAAyB,YAAE,KAAK,CAAC,OAAO,GAAQ,EAC/D,KAAK,CAAC,IAAI,KAAK,IAAI,IAAI,KAAK,CAAC,UAAU,IAAI,CAC1C,iBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,GAAG,EAAE;gCACZ,qBAAqB,CAAC,KAAK,CAAC,UAAW,CAAC,CAAC;gCACzC,QAAQ,CAAC,IAAI,CAAC,CAAC;4BACjB,CAAC,EACD,SAAS,EAAC,2FAA2F,qBAG9F,CACV,EACD,iBACE,IAAI,EAAC,QAAQ,gBACF,SAAS,EACpB,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,EAC7B,SAAS,EAAC,6CAA6C,uBAGhD,IACL,GACF,CACP,IACG,CACP,CAAC;AACJ,CAAC","sourcesContent":["import {\n IconPlus,\n IconUpload,\n IconArrowLeft,\n IconPencil,\n IconBulb,\n IconBolt,\n IconTrash,\n IconEye,\n IconCode,\n IconClock,\n IconHierarchy2,\n IconExternalLink,\n IconHelp,\n IconPlugConnected,\n} from \"@tabler/icons-react\";\nimport React, {\n useState,\n useRef,\n useCallback,\n useEffect,\n useMemo,\n} from \"react\";\n\nimport {\n CLAUDE_SONNET_MODEL_ID,\n CLAUDE_SONNET_MODEL_LABEL,\n} from \"../../agent/model-config.js\";\nimport { serializeFrontmatter } from \"../../resources/metadata.js\";\nimport { sendToAgentChat } from \"../agent-chat.js\";\nimport { agentNativePath } from \"../api-path.js\";\nimport {\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from \"../components/ui/popover.js\";\nimport {\n Tooltip,\n TooltipContent,\n TooltipProvider,\n TooltipTrigger,\n} from \"../components/ui/tooltip.js\";\nimport { PromptComposer } from \"../composer/PromptComposer.js\";\nimport { useT } from \"../i18n.js\";\nimport { useOrg } from \"../org/hooks.js\";\nimport { cn } from \"../utils.js\";\nimport { BuiltinCapabilityDetail } from \"./BuiltinCapabilityDetail.js\";\nimport { isMcpIntegrationCatalogAvailable } from \"./mcp-integration-catalog.js\";\nimport { McpIntegrationDialog } from \"./McpIntegrationDialog.js\";\nimport { McpServerDetail } from \"./McpServerDetail.js\";\nimport { ResourceEditor } from \"./ResourceEditor.js\";\nimport { ResourceTree } from \"./ResourceTree.js\";\nimport {\n parseMcpBuiltinVirtualId,\n useBuiltinCapabilities,\n} from \"./use-builtin-capabilities.js\";\nimport {\n useMcpServers,\n useCreateMcpServer,\n useDeleteMcpServer,\n parseMcpVirtualId,\n type McpServerScope,\n} from \"./use-mcp-servers.js\";\nimport {\n useResourceTree,\n useResource,\n useCreateResource,\n useUpdateResource,\n useDeleteResource,\n useUploadResource,\n withMcpServersFolder,\n withAgentScratchFolder,\n type ResourceScope,\n type ResourceMeta,\n type Resource,\n type TreeNode,\n} from \"./use-resources.js\";\n\nconst WORKSPACE_DOCS_URL = \"https://agent-native.com/docs/workspace\";\nconst LOCAL_WORKSPACE_RESOURCE_METADATA_SOURCE = \"local-workspace-resource\";\n\nexport type ResourceView =\n | \"files\"\n | \"instructions\"\n | \"agents\"\n | \"memory\"\n | \"skills\"\n | \"learnings\"\n | \"remote-agents\";\n\nexport type ResourceTreeVariant = \"tree\" | \"collection\";\n\nconst SPECIAL_RESOURCE_ROOTS = new Set([\n \"agents\",\n \"agent-scratch\",\n \"jobs\",\n \"memory\",\n \"remote-agents\",\n \"skills\",\n]);\nconst SPECIAL_RESOURCE_FILES = new Set([\"agents.md\", \"learnings.md\"]);\n\nfunction normalizedResourcePath(path: string): string {\n return path.replace(/^\\/+/, \"\").toLowerCase();\n}\n\nfunction resourceMatchesView(node: TreeNode, view: ResourceView): boolean {\n const path = normalizedResourcePath(node.path);\n switch (view) {\n case \"files\":\n return (\n !SPECIAL_RESOURCE_ROOTS.has(path.split(\"/\", 1)[0]) &&\n !SPECIAL_RESOURCE_FILES.has(path.split(\"/\").pop() ?? \"\")\n );\n case \"instructions\":\n return path.split(\"/\").pop() === \"agents.md\";\n case \"agents\":\n return node.kind === \"agent\";\n case \"memory\":\n return path === \"memory\" || path.startsWith(\"memory/\");\n case \"skills\":\n return node.kind === \"skill\";\n case \"learnings\":\n return path.split(\"/\").pop() === \"learnings.md\";\n case \"remote-agents\":\n return node.kind === \"remote-agent\";\n }\n}\n\nexport function filterResourceTree(\n tree: TreeNode[],\n view: ResourceView | undefined,\n): TreeNode[] {\n if (!view) return tree;\n return tree.flatMap((node) => {\n if (node.type === \"folder\") {\n if (\n view === \"files\" &&\n (SPECIAL_RESOURCE_ROOTS.has(\n normalizedResourcePath(node.path).split(\"/\", 1)[0],\n ) ||\n SPECIAL_RESOURCE_FILES.has(\n normalizedResourcePath(node.path).split(\"/\").pop() ?? \"\",\n ))\n ) {\n return [];\n }\n const children = filterResourceTree(node.children ?? [], view);\n return children.length > 0 ? [{ ...node, children }] : [];\n }\n return resourceMatchesView(node, view) ? [node] : [];\n });\n}\n\n// ─── Create Menu (unified + button) ────────────────────────────────────────\n\ntype CreateMenuView =\n | \"menu\"\n | \"file\"\n | \"skill\"\n | \"skill-upload\"\n | \"job\"\n | \"agent-mode\"\n | \"agent-prompt\"\n | \"agent-form\";\n\nconst AGENT_MODEL_OPTIONS = [\n { value: \"inherit\", label: \"Default model\" },\n { value: \"claude-fable-5\", label: \"Claude Fable 5\" },\n { value: \"claude-opus-4-8\", label: \"Claude Opus 4.8\" },\n { value: CLAUDE_SONNET_MODEL_ID, label: CLAUDE_SONNET_MODEL_LABEL },\n { value: \"claude-haiku-4-5-20251001\", label: \"Claude Haiku 4.5\" },\n] as const;\n\nfunction slugifyName(value: string): string {\n return (\n value\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, \"-\")\n .replace(/^-+|-+$/g, \"\") || \"agent\"\n );\n}\n\nfunction isLocalWorkspaceResource(resource: Resource | null | undefined) {\n if (!resource?.metadata) return false;\n try {\n const metadata = JSON.parse(resource.metadata) as { source?: unknown };\n return metadata.source === LOCAL_WORKSPACE_RESOURCE_METADATA_SOURCE;\n } catch {\n return false;\n }\n}\n\nfunction buildAgentResourceContent({\n name,\n description,\n model,\n tools,\n body,\n}: {\n name: string;\n description: string;\n model: string;\n tools: string;\n body: string;\n}): string {\n const fields = [\n { key: \"name\", value: name },\n { key: \"description\", value: description },\n { key: \"model\", value: model },\n { key: \"tools\", value: tools },\n { key: \"delegate-default\", value: \"false\" },\n ];\n return serializeFrontmatter(fields) + body.trim() + \"\\n\";\n}\n\nfunction CreateMenu({\n scope,\n resourceFilter,\n onCreateFile,\n onCreateResource,\n onCreateMcpServer,\n canCreateOrgMcp,\n hasOrg,\n onCreated,\n showToast,\n}: {\n scope: ResourceScope;\n resourceFilter?: ResourceView;\n onCreateFile: (name: string) => void;\n onCreateResource: (\n path: string,\n content: string,\n mimeType?: string,\n opts?: {\n onSuccess?: (resource: ResourceMeta) => void;\n onError?: (err: unknown) => void;\n },\n ) => void;\n onCreateMcpServer: (args: {\n scope: McpServerScope;\n name: string;\n url: string;\n headers?: Record<string, string>;\n description?: string;\n }) => Promise<void>;\n canCreateOrgMcp: boolean;\n hasOrg: boolean;\n onCreated?: () => void;\n showToast?: (\n kind: \"ok\" | \"err\",\n message: string,\n opts?: { resourceId?: string; durationMs?: number },\n ) => void;\n}) {\n const t = useT();\n const [open, setOpen] = useState(false);\n const [mcpDialogOpen, setMcpDialogOpen] = useState(false);\n const [view, setView] = useState<CreateMenuView>(\"menu\");\n const showMcpIntegrations = useMemo(\n () => isMcpIntegrationCatalogAvailable(),\n [],\n );\n const [value, setValue] = useState(\"\");\n const [agentName, setAgentName] = useState(\"\");\n const [agentDescription, setAgentDescription] = useState(\"\");\n const [agentModel, setAgentModel] = useState<string>(\"inherit\");\n const [agentInstructions, setAgentInstructions] = useState(\n `# Role\\n\\nDefine how this agent should work.\\n\\n## Focus\\n\\n- What kinds of tasks it should handle\\n- What tone or approach it should use\\n- Important constraints or preferences\\n`,\n );\n const defaultMcpScope: McpServerScope =\n scope === \"shared\" && canCreateOrgMcp ? \"org\" : \"user\";\n const inputRef = useRef<HTMLInputElement | HTMLTextAreaElement>(null);\n const skillFileInputRef = useRef<HTMLInputElement>(null);\n const skillHoverTimerRef = useRef<number | null>(null);\n const [skillFlyoutOpen, setSkillFlyoutOpen] = useState(false);\n const [skillFlyoutSide, setSkillFlyoutSide] = useState<\"right\" | \"left\">(\n \"right\",\n );\n const skillFlyoutCloseTimerRef = useRef<number | null>(null);\n const openSkillFlyout = (rowEl?: HTMLElement | null) => {\n if (skillFlyoutCloseTimerRef.current) {\n window.clearTimeout(skillFlyoutCloseTimerRef.current);\n skillFlyoutCloseTimerRef.current = null;\n }\n if (rowEl && typeof window !== \"undefined\") {\n const rect = rowEl.getBoundingClientRect();\n const FLYOUT_WIDTH = 248;\n setSkillFlyoutSide(\n window.innerWidth - rect.right < FLYOUT_WIDTH ? \"left\" : \"right\",\n );\n }\n setSkillFlyoutOpen(true);\n };\n const scheduleSkillFlyoutClose = () => {\n if (skillFlyoutCloseTimerRef.current)\n window.clearTimeout(skillFlyoutCloseTimerRef.current);\n skillFlyoutCloseTimerRef.current = window.setTimeout(() => {\n setSkillFlyoutOpen(false);\n }, 160);\n };\n const [skillUploadSlug, setSkillUploadSlug] = useState(\"\");\n const [skillUploadContent, setSkillUploadContent] = useState(\"\");\n const [skillUploadFileName, setSkillUploadFileName] = useState(\"\");\n\n useEffect(() => {\n if (open) {\n setView(\"menu\");\n setValue(\"\");\n setAgentName(\"\");\n setAgentDescription(\"\");\n setAgentModel(\"inherit\");\n setAgentInstructions(\n `# Role\\n\\nDefine how this agent should work.\\n\\n## Focus\\n\\n- What kinds of tasks it should handle\\n- What tone or approach it should use\\n- Important constraints or preferences\\n`,\n );\n setSkillUploadSlug(\"\");\n setSkillUploadContent(\"\");\n setSkillUploadFileName(\"\");\n setSkillFlyoutOpen(false);\n }\n }, [open]);\n\n useEffect(() => {\n if (view !== \"menu\" && view !== \"agent-form\") {\n setValue(\"\");\n const t = setTimeout(() => inputRef.current?.focus(), 50);\n return () => clearTimeout(t);\n }\n }, [view]);\n\n const submitFile = () => {\n const trimmed = value.trim();\n if (trimmed) {\n onCreateFile(trimmed);\n setOpen(false);\n }\n };\n\n const submitSkill = (text: string = value) => {\n const trimmed = text.trim();\n if (!trimmed) return;\n\n sendToAgentChat({\n message: `Create a skill: ${trimmed}`,\n newTab: true,\n context: `The user wants to create an agent skill. Their description: \"${trimmed}\"\n\nFollow the create-skill pattern to build this. Before writing:\n\n1. **Determine the skill name** — derive a hyphen-case name from the description (e.g. \"code review\" → \"code-review\")\n2. **Determine the skill type** — Pattern (architectural rule), Workflow (step-by-step), or Generator (scaffolding)\n3. **Write the skill** as a ${scope} resource at path \"skills/<name>/SKILL.md\" using the \\`resources\\` tool with \\`action: \"write\"\\`\n\nThe skill file MUST have YAML frontmatter with name and description (under 40 words), then markdown with:\n- Clear rule/purpose statement\n- Why this skill exists\n- How to follow it (with code examples where helpful)\n- Common violations to avoid\n- Related skills\n\nTemplate for a Pattern skill:\n\\`\\`\\`markdown\n---\nname: <hyphen-case-name>\ndescription: >-\n <Under 40 words. When should this trigger?>\n---\n\n# <Skill Name>\n\n## Rule\n<One sentence: what must be true>\n\n## Why\n<Why this rule exists>\n\n## How\n<How to follow it, with code examples>\n\n## Don't\n<Common violations>\n\\`\\`\\`\n\nTemplate for a Workflow skill:\n\\`\\`\\`markdown\n---\nname: <hyphen-case-name>\ndescription: >-\n <Under 40 words. When should this trigger?>\n---\n\n# <Workflow Name>\n\n## Prerequisites\n<What must be in place>\n\n## Steps\n<Numbered steps with code examples>\n\n## Verification\n<How to confirm it worked>\n\\`\\`\\`\n\nAfter creating, update the shared AGENTS.md resource to reference the new skill in its skills table.\n\nKeep the skill concise (under 500 lines) and actionable.`,\n submit: true,\n });\n\n setOpen(false);\n onCreated?.();\n };\n\n const handleUploadSkillFiles = async (files: FileList | null) => {\n if (!files || files.length === 0) return;\n const file = files[0];\n const text = await file.text();\n const baseName = file.name.replace(/\\.[^./]+$/, \"\");\n const slug = slugifyName(\n baseName.toLowerCase() === \"skill\" ? \"uploaded-skill\" : baseName,\n );\n setSkillUploadSlug(slug);\n setSkillUploadContent(text);\n setSkillUploadFileName(file.name);\n setView(\"skill-upload\");\n };\n\n const saveUploadedSkill = () => {\n const slug = slugifyName(skillUploadSlug || \"uploaded-skill\");\n const path = `skills/${slug}/SKILL.md`;\n const fileLabel = skillUploadFileName || `${slug}/SKILL.md`;\n onCreateResource(path, skillUploadContent, \"text/markdown\", {\n onSuccess: (resource) => {\n showToast?.(\"ok\", `Skill \"${fileLabel}\" added`, {\n resourceId: resource.id,\n });\n },\n onError: (err) => {\n const msg =\n err instanceof Error && err.message\n ? err.message\n : \"Failed to save skill file\";\n showToast?.(\"err\", msg);\n },\n });\n setOpen(false);\n onCreated?.();\n };\n\n const submitJob = (text: string = value) => {\n const trimmed = text.trim();\n if (!trimmed) return;\n\n sendToAgentChat({\n message: `Create a recurring job: ${trimmed}`,\n newTab: true,\n context: `The user wants to create a recurring job. Their description: \"${trimmed}\"\n\nUse the manage-jobs tool with action \"create\" to create this. You need to:\n1. Derive a hyphen-case name from the description\n2. Convert the schedule to a cron expression (e.g., \"every weekday at 9am\" → \"0 9 * * 1-5\")\n3. Write clear, self-contained instructions for what the agent should do each time the job runs\n4. Create it in ${scope} scope\n\nThe job will run automatically on the schedule. Make the instructions specific — include which actions to call and what to do with results.`,\n submit: true,\n });\n\n setOpen(false);\n };\n\n const submitAgentPrompt = (text: string = value) => {\n const trimmed = text.trim();\n if (!trimmed) return;\n\n sendToAgentChat({\n message: `Create a custom agent: ${trimmed}`,\n newTab: true,\n context: `The user wants a reusable custom sub-agent profile for the workspace. Their description: \"${trimmed}\"\n\nCreate it as a ${scope} resource under \"agents/<name>.md\" using the \\`resources\\` tool with \\`action: \"write\"\\`.\n\nRequirements:\n1. Derive a hyphen-case file name from the intent\n2. Use YAML frontmatter with:\n - name\n - description\n - model (use \"inherit\" unless the request clearly needs a different model)\n - tools (set to \"inherit\")\n - delegate-default (set to false)\n3. Put the main operating instructions in the markdown body\n4. Keep it concise and directive, similar to a Claude Code-style custom agent\n\nTemplate:\n\\`\\`\\`markdown\n---\nname: Design\ndescription: >-\n Helps with product and interface design decisions.\nmodel: inherit\ntools: inherit\ndelegate-default: false\n---\n\n# Role\n\nYou are a focused design agent.\n\n## Responsibilities\n\n- ...\n\n## Approach\n\n- ...\n\\`\\`\\`\n\nThe result should be a reusable agent profile, not a one-off task response.`,\n submit: true,\n });\n\n setOpen(false);\n onCreated?.();\n };\n\n const submitAgentManual = () => {\n const trimmedName = agentName.trim();\n const trimmedDescription = agentDescription.trim();\n const trimmedInstructions = agentInstructions.trim();\n if (!trimmedName || !trimmedDescription || !trimmedInstructions) return;\n\n const slug = slugifyName(trimmedName);\n onCreateResource(\n `agents/${slug}.md`,\n buildAgentResourceContent({\n name: trimmedName,\n description: trimmedDescription,\n model: agentModel,\n tools: \"inherit\",\n body: trimmedInstructions,\n }),\n \"text/markdown\",\n );\n setOpen(false);\n onCreated?.();\n };\n\n const menuItems: {\n icon: React.ReactNode;\n label: string;\n desc: string;\n action: () => void;\n hoverAction?: () => void;\n }[] = [\n {\n icon: <IconPlus className=\"h-3.5 w-3.5\" />,\n label: \"Create File\",\n desc: \"Add a new file at a path\",\n action: () => setView(\"file\"),\n },\n {\n icon: <IconBulb className=\"h-3.5 w-3.5\" />,\n label: \"Create Skill\",\n desc: \"Teach the agent a new ability\",\n action: openSkillFlyout,\n hoverAction: openSkillFlyout,\n },\n {\n icon: <IconClock className=\"h-3.5 w-3.5\" />,\n label: \"Schedule Task\",\n desc: \"Run something on a schedule\",\n action: () => setView(\"job\"),\n },\n {\n icon: <IconHierarchy2 className=\"h-3.5 w-3.5\" />,\n label: \"Create Custom Agent\",\n desc: \"Add a reusable sub-agent profile\",\n action: () => setView(\"agent-mode\"),\n },\n {\n icon: <IconBolt className=\"h-3.5 w-3.5\" />,\n label: \"Create Automation\",\n desc: \"Set up a when-X-do-Y rule\",\n action: () => {\n setOpen(false);\n window.dispatchEvent(\n new CustomEvent(\"agent-panel:set-mode\", {\n detail: { mode: \"chat\" },\n }),\n );\n sendToAgentChat({\n message:\n \"Help me create a new automation. Ask me what I want to automate.\",\n context: `The user wants to create a new automation. Scope: personal. Use manage-automations with action=define to create it. Ask clarifying questions if needed about what event to trigger on, conditions, and what actions to take.`,\n submit: true,\n newTab: true,\n });\n onCreated?.();\n },\n },\n ...(showMcpIntegrations\n ? [\n {\n icon: <IconPlugConnected className=\"h-3.5 w-3.5\" />,\n label: t(\"mcpIntegrations.menuLabel\"),\n desc: t(\"mcpIntegrations.menuDescription\"),\n action: () => {\n setOpen(false);\n setMcpDialogOpen(true);\n },\n },\n ]\n : []),\n ];\n const visibleMenuItems = menuItems.filter((item) => {\n if (!resourceFilter || resourceFilter === \"files\") return true;\n if (resourceFilter === \"agents\")\n return item.label === \"Create Custom Agent\";\n if (resourceFilter === \"skills\") return item.label === \"Create Skill\";\n return false;\n });\n\n return (\n <>\n <Popover open={open} onOpenChange={setOpen}>\n <input\n ref={skillFileInputRef}\n type=\"file\"\n accept=\".md,text/markdown\"\n multiple\n className=\"hidden\"\n onChange={(e) => {\n handleUploadSkillFiles(e.target.files);\n e.target.value = \"\";\n }}\n />\n <Tooltip>\n <TooltipTrigger asChild>\n <PopoverTrigger asChild>\n <button\n type=\"button\"\n className={cn(\n \"flex h-6 w-6 items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-accent/50\",\n open && \"bg-accent/50 text-foreground\",\n )}\n >\n <IconPlus className=\"h-3.5 w-3.5\" />\n </button>\n </PopoverTrigger>\n </TooltipTrigger>\n <TooltipContent>Create new...</TooltipContent>\n </Tooltip>\n <PopoverContent\n align=\"end\"\n sideOffset={6}\n collisionPadding={8}\n className={cn(\n \"z-[260] p-0 text-[13px] leading-normal\",\n view === \"menu\" || view === \"file\"\n ? \"w-[260px]\"\n : \"max-h-[70vh] w-[calc(100vw-24px)] max-w-[380px] overflow-y-auto\",\n )}\n >\n {view === \"menu\" && (\n <div className=\"py-1\">\n {visibleMenuItems.map((item) => {\n const isSkill = item.label === \"Create Skill\";\n return (\n <div\n key={item.label}\n className=\"relative\"\n onMouseEnter={(e) => {\n if (isSkill) {\n openSkillFlyout(e.currentTarget);\n return;\n }\n if (!item.hoverAction) return;\n if (skillHoverTimerRef.current)\n window.clearTimeout(skillHoverTimerRef.current);\n skillHoverTimerRef.current = window.setTimeout(() => {\n item.hoverAction?.();\n }, 180);\n }}\n onMouseLeave={() => {\n if (isSkill) {\n scheduleSkillFlyoutClose();\n return;\n }\n if (skillHoverTimerRef.current) {\n window.clearTimeout(skillHoverTimerRef.current);\n skillHoverTimerRef.current = null;\n }\n }}\n >\n <button\n type=\"button\"\n onClick={item.action}\n className={cn(\n \"flex w-full items-center gap-2.5 px-3 py-2 text-left hover:bg-accent/50\",\n isSkill && skillFlyoutOpen && \"bg-accent/50\",\n )}\n >\n <span className=\"text-muted-foreground\">{item.icon}</span>\n <div className=\"min-w-0 flex-1\">\n <div className=\"text-[12px] font-medium text-foreground\">\n {item.label}\n </div>\n <div className=\"mt-0.5 text-[10px] text-muted-foreground/60\">\n {item.desc}\n </div>\n </div>\n {isSkill && (\n <span className=\"ml-auto text-muted-foreground/60\">\n ›\n </span>\n )}\n </button>\n {isSkill && skillFlyoutOpen && (\n <div\n role=\"menu\"\n onMouseEnter={() => openSkillFlyout()}\n onMouseLeave={scheduleSkillFlyoutClose}\n className={cn(\n \"absolute top-0 z-20 w-[240px] rounded-lg border border-border bg-popover py-1 shadow-md\",\n skillFlyoutSide === \"right\"\n ? \"left-full ml-1\"\n : \"right-full mr-1\",\n )}\n >\n <button\n type=\"button\"\n onClick={() => {\n setSkillFlyoutOpen(false);\n setView(\"skill\");\n }}\n className=\"flex w-full items-center gap-2.5 px-3 py-2 text-left hover:bg-accent/50\"\n >\n <span className=\"text-muted-foreground\">\n <IconBulb className=\"h-3.5 w-3.5\" />\n </span>\n <div className=\"min-w-0\">\n <div className=\"text-[12px] font-medium text-foreground\">\n Create new skill\n </div>\n <div className=\"mt-0.5 text-[10px] text-muted-foreground/60\">\n Describe a skill and let the agent draft it\n </div>\n </div>\n </button>\n <button\n type=\"button\"\n onClick={() => {\n setSkillFlyoutOpen(false);\n skillFileInputRef.current?.click();\n }}\n className=\"flex w-full items-center gap-2.5 px-3 py-2 text-left hover:bg-accent/50\"\n >\n <span className=\"text-muted-foreground\">\n <IconUpload className=\"h-3.5 w-3.5\" />\n </span>\n <div className=\"min-w-0\">\n <div className=\"text-[12px] font-medium text-foreground\">\n Upload skill file\n </div>\n <div className=\"mt-0.5 text-[10px] text-muted-foreground/60\">\n Import an existing SKILL.md file\n </div>\n </div>\n </button>\n </div>\n )}\n </div>\n );\n })}\n </div>\n )}\n\n {view === \"file\" && (\n <div className=\"p-3\">\n <label className=\"mb-1.5 block text-[11px] font-medium text-muted-foreground\">\n File path\n </label>\n <input\n ref={inputRef as React.RefObject<HTMLInputElement>}\n value={value}\n onChange={(e) => setValue(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === \"Enter\") submitFile();\n if (e.key === \"Escape\") {\n e.stopPropagation();\n setView(\"menu\");\n }\n }}\n className=\"w-full rounded-md border border-border bg-background px-2.5 py-1.5 text-[13px] text-foreground outline-none placeholder:text-muted-foreground/50 focus:ring-1 focus:ring-accent\"\n placeholder=\"notes/ideas.md\"\n />\n <div className=\"mt-2.5 flex justify-end\">\n <button\n onClick={submitFile}\n disabled={!value.trim()}\n className=\"rounded-md bg-accent px-3 py-1.5 text-[12px] font-medium text-foreground hover:bg-accent/80 disabled:opacity-40 disabled:pointer-events-none\"\n >\n Create\n </button>\n </div>\n </div>\n )}\n\n {view === \"skill\" && (\n <div className=\"p-3\">\n <label className=\"mb-1 block text-[11px] font-semibold text-foreground\">\n Create Skill\n </label>\n <p className=\"mb-2 text-[10px] text-muted-foreground/60 leading-relaxed\">\n Describe what kind of skill you want and the agent will create\n it.\n </p>\n <PromptComposer\n autoFocus\n placeholder=\"e.g. A skill that reviews PRs for security issues and OWASP top 10 vulnerabilities\"\n draftScope=\"resources:create-skill\"\n onSubmit={(text) => submitSkill(text)}\n />\n </div>\n )}\n\n {view === \"skill-upload\" && (\n <div className=\"p-3\">\n <label className=\"mb-1 block text-[11px] font-semibold text-foreground\">\n Upload skill file\n </label>\n <p className=\"mb-2 text-[10px] text-muted-foreground/60 leading-relaxed\">\n Review the content from{\" \"}\n <span className=\"font-mono\">\n {skillUploadFileName || \"the selected file\"}\n </span>{\" \"}\n before saving.\n </p>\n <label className=\"mb-1 block text-[10px] font-medium text-muted-foreground\">\n Skill name\n </label>\n <input\n value={skillUploadSlug}\n onChange={(e) => setSkillUploadSlug(e.target.value)}\n className=\"mb-2 w-full rounded-md border border-border bg-background px-2.5 py-1.5 text-[12px] text-foreground outline-none placeholder:text-muted-foreground/50 focus:ring-1 focus:ring-accent\"\n placeholder=\"my-skill\"\n />\n <p className=\"mb-2 text-[10px] text-muted-foreground/60\">\n Will be saved at{\" \"}\n <span className=\"font-mono\">\n skills/{slugifyName(skillUploadSlug || \"uploaded-skill\")}\n /SKILL.md\n </span>\n </p>\n <label className=\"mb-1 block text-[10px] font-medium text-muted-foreground\">\n Content\n </label>\n <textarea\n value={skillUploadContent}\n onChange={(e) => setSkillUploadContent(e.target.value)}\n rows={14}\n className=\"w-full rounded-md border border-border bg-background px-2.5 py-1.5 font-mono text-[11px] leading-relaxed text-foreground outline-none focus:ring-1 focus:ring-accent\"\n />\n <div className=\"mt-2.5 flex justify-end gap-2\">\n <button\n onClick={() => setView(\"menu\")}\n className=\"rounded-md px-3 py-1.5 text-[12px] font-medium text-muted-foreground hover:bg-accent/40\"\n >\n Back\n </button>\n <button\n onClick={saveUploadedSkill}\n disabled={\n !skillUploadContent.trim() || !skillUploadSlug.trim()\n }\n className=\"rounded-md bg-accent px-3 py-1.5 text-[12px] font-medium text-foreground hover:bg-accent/80 disabled:opacity-40 disabled:pointer-events-none\"\n >\n Save\n </button>\n </div>\n </div>\n )}\n\n {view === \"job\" && (\n <div className=\"p-3\">\n <label className=\"mb-1 block text-[11px] font-semibold text-foreground\">\n Schedule Task\n </label>\n <p className=\"mb-2 text-[10px] text-muted-foreground/60 leading-relaxed\">\n Describe what should happen and when.\n </p>\n <PromptComposer\n autoFocus\n placeholder=\"e.g. Every weekday at 9am, check for overdue scorecards and send a Slack update\"\n draftScope=\"resources:create-job\"\n onSubmit={(text) => submitJob(text)}\n />\n </div>\n )}\n\n {view === \"agent-mode\" && (\n <div className=\"p-3\">\n <label className=\"mb-1 block text-[11px] font-semibold text-foreground\">\n Create Agent\n </label>\n <p className=\"mb-2 text-[10px] leading-relaxed text-muted-foreground/60\">\n Build a reusable sub-agent profile for this workspace.\n </p>\n <div className=\"space-y-2\">\n <button\n onClick={() => setView(\"agent-prompt\")}\n className=\"flex w-full items-start gap-2 rounded-md border border-border px-3 py-2 text-left hover:bg-accent/40\"\n >\n <IconPencil className=\"mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground\" />\n <div>\n <div className=\"text-[12px] font-medium text-foreground\">\n Describe It\n </div>\n <div className=\"text-[10px] text-muted-foreground/60\">\n Let the agent draft the profile from a prompt.\n </div>\n </div>\n </button>\n <button\n onClick={() => setView(\"agent-form\")}\n className=\"flex w-full items-start gap-2 rounded-md border border-border px-3 py-2 text-left hover:bg-accent/40\"\n >\n <IconHierarchy2 className=\"mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground\" />\n <div>\n <div className=\"text-[12px] font-medium text-foreground\">\n Fill Form\n </div>\n <div className=\"text-[10px] text-muted-foreground/60\">\n Set the fields manually and start with a markdown\n template.\n </div>\n </div>\n </button>\n </div>\n </div>\n )}\n\n {view === \"agent-prompt\" && (\n <div className=\"p-3\">\n <label className=\"mb-1 block text-[11px] font-semibold text-foreground\">\n Create Agent From Prompt\n </label>\n <p className=\"mb-2 text-[10px] text-muted-foreground/60 leading-relaxed\">\n Describe the agent you want. It will be saved under{\" \"}\n <code>agents/</code>.\n </p>\n <PromptComposer\n autoFocus\n placeholder=\"e.g. A design agent that critiques layouts, suggests UI direction, and prefers concise product reasoning\"\n draftScope=\"resources:create-agent\"\n onSubmit={(text) => submitAgentPrompt(text)}\n />\n </div>\n )}\n\n {view === \"agent-form\" && (\n <div className=\"p-3\">\n <label className=\"mb-2 block text-[11px] font-semibold text-foreground\">\n Create Agent Manually\n </label>\n <div className=\"space-y-2\">\n <input\n value={agentName}\n onChange={(e) => setAgentName(e.target.value)}\n className=\"w-full rounded-md border border-border bg-background px-2.5 py-1.5 text-[13px] text-foreground outline-none placeholder:text-muted-foreground/50 focus:ring-1 focus:ring-accent\"\n placeholder=\"Agent name\"\n />\n <input\n value={agentDescription}\n onChange={(e) => setAgentDescription(e.target.value)}\n className=\"w-full rounded-md border border-border bg-background px-2.5 py-1.5 text-[13px] text-foreground outline-none placeholder:text-muted-foreground/50 focus:ring-1 focus:ring-accent\"\n placeholder=\"Short description\"\n />\n <label className=\"block text-[11px] font-medium text-muted-foreground\">\n Model\n </label>\n <select\n value={agentModel}\n onChange={(e) => setAgentModel(e.target.value)}\n className=\"w-full rounded-md border border-border bg-background px-2.5 py-1.5 text-[13px] text-foreground outline-none focus:ring-1 focus:ring-accent\"\n >\n {AGENT_MODEL_OPTIONS.map((option) => (\n <option key={option.value} value={option.value}>\n {option.label}\n </option>\n ))}\n </select>\n <label className=\"block text-[11px] font-medium text-muted-foreground\">\n Instructions\n </label>\n <textarea\n value={agentInstructions}\n onChange={(e) => setAgentInstructions(e.target.value)}\n rows={8}\n className=\"w-full resize-y rounded-md border border-border bg-background px-2.5 py-1.5 text-[13px] text-foreground outline-none placeholder:text-muted-foreground/50 focus:ring-1 focus:ring-accent\"\n style={{\n fontFamily:\n 'ui-monospace, SFMono-Regular, \"SF Mono\", Menlo, Consolas, monospace',\n lineHeight: 1.5,\n }}\n />\n </div>\n <div className=\"mt-2.5 flex justify-end\">\n <button\n onClick={submitAgentManual}\n disabled={\n !agentName.trim() ||\n !agentDescription.trim() ||\n !agentInstructions.trim()\n }\n className=\"rounded-md bg-accent px-3 py-1.5 text-[12px] font-medium text-foreground hover:bg-accent/80 disabled:opacity-40 disabled:pointer-events-none\"\n >\n Create\n </button>\n </div>\n </div>\n )}\n </PopoverContent>\n </Popover>\n <McpIntegrationDialog\n open={mcpDialogOpen}\n onOpenChange={setMcpDialogOpen}\n defaultScope={defaultMcpScope}\n canCreateOrgMcp={canCreateOrgMcp}\n hasOrg={hasOrg}\n onCreateMcpServer={onCreateMcpServer}\n onCreated={onCreated}\n />\n </>\n );\n}\n\n// ─── PathBreadcrumb ─────────────────────────────────────────────────────────\n\nfunction PathBreadcrumb({ path }: { path: string }) {\n const parts = path.split(\"/\").filter(Boolean);\n return (\n <div className=\"flex items-center gap-0.5 text-[11px] text-muted-foreground/60 overflow-hidden\">\n {parts.map((part, i) => (\n <React.Fragment key={i}>\n {i > 0 && <span className=\"shrink-0\">/</span>}\n <span\n className={cn(\n \"truncate\",\n i === parts.length - 1 && \"text-muted-foreground\",\n )}\n >\n {part}\n </span>\n </React.Fragment>\n ))}\n </div>\n );\n}\n\n// ─── ResourcesPanel ─────────────────────────────────────────────────────────\n\nconst DEFAULT_AGENTS_MD_CLIENT = `# Agent Instructions\n\nThis file customizes how the AI agent behaves in this app. Edit it to add your own instructions, preferences, and context.\n\n## What to put here\n\n- **Preferences** — Tone, style, verbosity, response format\n- **Context** — Domain knowledge, terminology, team conventions\n- **Rules** — Things the agent should always/never do\n- **Skills** — Reference skill files for specialized tasks (create them in the \\`skills/\\` folder)\n\n## Skills\n\nCreate skill files under \\`skills/<name>/SKILL.md\\` to give the agent specialized knowledge. Reference them here:\n\n| Skill | Path | Description |\n|-------|------|-------------|\n| *(use the skill button to create one)* | \\`skills/example/SKILL.md\\` | |\n\n## Workspace files\n\nWorkspace resources are for files users intentionally add, edit, or manage. Agents may create hidden \\`agent_scratch\\` resources for temporary working notes, scripts, or intermediate results; only promote those files into workspace visibility when a user explicitly asks to keep them.\n`;\n\nconst WORKSPACE_RESOURCE_OWNER = \"__workspace__\";\nconst SHARED_RESOURCE_OWNER = \"__shared__\";\n\nexport interface ResourcesPanelProps {\n /** Hide the virtual MCP folder when Files is hosted by the Agent page. */\n showMcpServers?: boolean;\n /** Optional page-level scope to mirror in the resource toolbar. */\n scope?: ResourceScope;\n /** When set, show only the requested scope instead of both scope sections. */\n showOnlyRequestedScope?: boolean;\n /** Limit the tree to one agent-native resource collection. */\n resourceFilter?: ResourceView;\n /** Render special collections as cards instead of a nested file tree. */\n resourceTreeVariant?: ResourceTreeVariant;\n}\n\nexport function resolveInitialResourceScope(\n requestedScope: ResourceScope | undefined,\n canEditOrg: boolean,\n): ResourceScope {\n if (requestedScope === \"shared\") return \"shared\";\n if (requestedScope === \"personal\") return \"personal\";\n return canEditOrg ? \"shared\" : \"personal\";\n}\n\nexport function ResourcesPanel({\n showMcpServers = true,\n scope: requestedScope,\n showOnlyRequestedScope = false,\n resourceFilter,\n resourceTreeVariant = \"tree\",\n}: ResourcesPanelProps = {}) {\n const { data: org } = useOrg();\n // Non-admin org members get read-only access to organization resources.\n // Solo deployments (no orgId) behave as owner — users can edit their own.\n const canEditOrg =\n !org?.orgId || org.role === \"owner\" || org.role === \"admin\";\n\n const [activeScope, setActiveScope] = useState<ResourceScope>(() =>\n resolveInitialResourceScope(requestedScope, canEditOrg),\n );\n const [selectedResourceId, setSelectedResourceId] = useState<string | null>(\n null,\n );\n const [toolbarDeleteConfirmId, setToolbarDeleteConfirmId] = useState<\n string | null\n >(null);\n const [dragOver, setDragOver] = useState(false);\n const [toast, setToast] = useState<{\n kind: \"ok\" | \"err\";\n message: string;\n resourceId?: string;\n } | null>(null);\n const toastTimerRef = useRef<number | null>(null);\n const showToast = useCallback(\n (\n kind: \"ok\" | \"err\",\n message: string,\n opts?: { resourceId?: string; durationMs?: number },\n ) => {\n setToast({ kind, message, resourceId: opts?.resourceId });\n if (toastTimerRef.current) window.clearTimeout(toastTimerRef.current);\n toastTimerRef.current = window.setTimeout(\n () => setToast(null),\n opts?.durationMs ?? 5000,\n );\n },\n [],\n );\n const [editorView, setEditorView] = useState<\"visual\" | \"code\">(() => {\n try {\n const v = localStorage.getItem(\"resource-editor-view\");\n if (v === \"code\") return \"code\";\n } catch {}\n return \"visual\";\n });\n const [showAgentScratch, setShowAgentScratch] = useState(false);\n\n useEffect(() => {\n setToolbarDeleteConfirmId(null);\n }, [selectedResourceId]);\n const fileInputRef = useRef<HTMLInputElement>(null);\n\n const sharedTreeQuery = useResourceTree(\"shared\", {\n includeAgentScratch: showAgentScratch,\n });\n const personalTreeQuery = useResourceTree(\"personal\", {\n includeAgentScratch: showAgentScratch,\n });\n const workspaceTreeQuery = useResourceTree(\"workspace\");\n const mcpServersQuery = useMcpServers();\n const builtinCapabilitiesQuery = useBuiltinCapabilities();\n const createMcpServer = useCreateMcpServer();\n const deleteMcpServer = useDeleteMcpServer();\n\n // Merge MCP servers into each scope's tree as a virtual `mcp-servers/`\n // folder. The servers live in the settings store, not the resources\n // table — the virtual ids carry the `mcp:<scope>:<id>` prefix that\n // `handleSelect` and `handleDelete` below recognize to route back to\n // the MCP endpoints.\n const personalTree = withAgentScratchFolder(\n showMcpServers\n ? withMcpServersFolder(\n personalTreeQuery.data ?? [],\n mcpServersQuery.data?.user ?? [],\n {\n builtins: (builtinCapabilitiesQuery.data?.capabilities ?? []).map(\n (capability) => ({ capability, scope: \"user\" as const }),\n ),\n },\n )\n : (personalTreeQuery.data ?? []),\n { show: showAgentScratch },\n );\n const sharedTree = withAgentScratchFolder(\n showMcpServers\n ? withMcpServersFolder(\n sharedTreeQuery.data ?? [],\n mcpServersQuery.data?.org ?? [],\n {\n builtins: (builtinCapabilitiesQuery.data?.capabilities ?? []).map(\n (capability) => ({ capability, scope: \"org\" as const }),\n ),\n },\n )\n : (sharedTreeQuery.data ?? []),\n { show: showAgentScratch },\n );\n const workspaceTree = workspaceTreeQuery.data ?? [];\n const visiblePersonalTree = useMemo(\n () => filterResourceTree(personalTree, resourceFilter),\n [personalTree, resourceFilter],\n );\n const visibleSharedTree = useMemo(\n () => filterResourceTree(sharedTree, resourceFilter),\n [resourceFilter, sharedTree],\n );\n const visibleWorkspaceTree = useMemo(\n () => filterResourceTree(workspaceTree, resourceFilter),\n [resourceFilter, workspaceTree],\n );\n const displayedPersonalTree =\n showOnlyRequestedScope && activeScope !== \"personal\"\n ? []\n : visiblePersonalTree;\n const displayedSharedTree =\n showOnlyRequestedScope && activeScope !== \"shared\" ? [] : visibleSharedTree;\n const showSharedTree = !showOnlyRequestedScope || activeScope === \"shared\";\n const showPersonalTree =\n !showOnlyRequestedScope || activeScope === \"personal\";\n\n const orgRole = mcpServersQuery.data?.role ?? org?.role ?? null;\n const hasOrgForMcp = !!(mcpServersQuery.data?.orgId ?? org?.orgId);\n const canCreateOrgMcp =\n hasOrgForMcp && (orgRole === \"owner\" || orgRole === \"admin\");\n\n // Virtual MCP server currently selected in the tree (or null for a real\n // resource / nothing). Resolved by scanning both trees' mcp folders for\n // a matching virtual id.\n const selectedMcpServer = React.useMemo(() => {\n const parsed = selectedResourceId\n ? parseMcpVirtualId(selectedResourceId)\n : null;\n if (!parsed) return null;\n const list =\n parsed.scope === \"user\"\n ? (mcpServersQuery.data?.user ?? [])\n : (mcpServersQuery.data?.org ?? []);\n return list.find((s) => s.id === parsed.serverId) ?? null;\n }, [selectedResourceId, mcpServersQuery.data]);\n\n const selectedBuiltinCapability = React.useMemo(() => {\n const parsed = selectedResourceId\n ? parseMcpBuiltinVirtualId(selectedResourceId)\n : null;\n if (!parsed) return null;\n const capability = (builtinCapabilitiesQuery.data?.capabilities ?? []).find(\n (item) => item.id === parsed.capabilityId,\n );\n return capability ? { capability, scope: parsed.scope } : null;\n }, [selectedResourceId, builtinCapabilitiesQuery.data]);\n\n // Sync activeScope once the org role arrives (canEditOrg is resolved async).\n useEffect(() => {\n if (!requestedScope && !canEditOrg && activeScope === \"shared\") {\n setActiveScope(\"personal\");\n }\n }, [canEditOrg, activeScope, requestedScope]);\n\n useEffect(() => {\n if (!requestedScope) return;\n setActiveScope(requestedScope);\n }, [requestedScope]);\n // Virtual MCP ids aren't in the resources store — skip the fetch so\n // useResource doesn't 404-flash.\n const resourceQuery = useResource(\n selectedResourceId &&\n !parseMcpVirtualId(selectedResourceId) &&\n !parseMcpBuiltinVirtualId(selectedResourceId)\n ? selectedResourceId\n : null,\n );\n const createResource = useCreateResource();\n const updateResource = useUpdateResource();\n const deleteResource = useDeleteResource();\n const uploadResource = useUploadResource();\n const selectedResourceReadOnly =\n !!resourceQuery.data &&\n ((resourceQuery.data.owner === WORKSPACE_RESOURCE_OWNER &&\n !isLocalWorkspaceResource(resourceQuery.data)) ||\n (resourceQuery.data.owner === SHARED_RESOURCE_OWNER && !canEditOrg));\n\n // Ensure AGENTS.md exists in the organization scope when the panel opens.\n // The server also seeds it on table init; this is a safety net. Only attempt\n // for users who can write to organization resources — non-admins would just\n // get a 403.\n const seededRef = useRef(false);\n useEffect(() => {\n if (seededRef.current || !canEditOrg) return;\n seededRef.current = true;\n fetch(agentNativePath(\"/_agent-native/resources\"), {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n path: \"AGENTS.md\",\n content: DEFAULT_AGENTS_MD_CLIENT,\n shared: true,\n ifNotExists: true,\n }),\n }).catch(() => {});\n }, [canEditOrg]);\n\n // Are we viewing a file (editor) or the tree?\n const isEditing = selectedResourceId !== null;\n\n const handleSelect = useCallback((resource: ResourceMeta) => {\n setSelectedResourceId(resource.id);\n }, []);\n\n const handleBack = useCallback(() => {\n setSelectedResourceId(null);\n }, []);\n\n const handleCreateFile = useCallback(\n (parentPath: string, name: string, scope: ResourceScope) => {\n const path = parentPath ? `${parentPath}/${name}` : name;\n createResource.mutate(\n { path, content: \"\", shared: scope === \"shared\" },\n {\n onSuccess: (data) => {\n setSelectedResourceId(data.id);\n },\n },\n );\n },\n [createResource],\n );\n\n const handleCreateFolder = useCallback(\n (parentPath: string, name: string, scope: ResourceScope) => {\n const path = parentPath ? `${parentPath}/${name}/.keep` : `${name}/.keep`;\n createResource.mutate({ path, content: \"\", shared: scope === \"shared\" });\n },\n [createResource],\n );\n\n const handleCreateFromToolbar = useCallback(\n (targetScope: ResourceScope, name: string) => {\n createResource.mutate(\n { path: name, content: \"\", shared: targetScope === \"shared\" },\n {\n onSuccess: (data) => {\n setSelectedResourceId(data.id);\n },\n },\n );\n },\n [createResource],\n );\n\n const handleCreateResourceFromToolbar = useCallback(\n (\n targetScope: ResourceScope,\n path: string,\n content: string,\n mimeType?: string,\n opts?: {\n onSuccess?: (resource: ResourceMeta) => void;\n onError?: (err: unknown) => void;\n },\n ) => {\n createResource.mutate(\n { path, content, mimeType, shared: targetScope === \"shared\" },\n {\n onSuccess: (data) => {\n setSelectedResourceId(data.id);\n opts?.onSuccess?.(data);\n },\n onError: (err) => {\n opts?.onError?.(err);\n },\n },\n );\n },\n [createResource],\n );\n\n const handleDelete = useCallback(\n (id: string) => {\n const mcp = parseMcpVirtualId(id);\n if (mcp) {\n deleteMcpServer.mutate(\n { id: mcp.serverId, scope: mcp.scope },\n {\n onSuccess: () => {\n if (selectedResourceId === id) setSelectedResourceId(null);\n },\n },\n );\n return;\n }\n if (parseMcpBuiltinVirtualId(id)) return;\n deleteResource.mutate(id);\n if (selectedResourceId === id) {\n setSelectedResourceId(null);\n }\n },\n [deleteResource, deleteMcpServer, selectedResourceId],\n );\n\n const handleCreateMcpServer = useCallback(\n async (args: {\n scope: McpServerScope;\n name: string;\n url: string;\n headers?: Record<string, string>;\n description?: string;\n }) => {\n const server = await createMcpServer.mutateAsync(args);\n // Select the newly-created virtual entry so the detail view opens.\n setSelectedResourceId(`mcp:${args.scope}:${server.id}`);\n },\n [createMcpServer],\n );\n\n const handleRename = useCallback(\n (id: string, newPath: string) => {\n updateResource.mutate({ id, path: newPath });\n },\n [updateResource],\n );\n\n const handleSave = useCallback(\n (content: string) => {\n if (!selectedResourceId) return;\n if (selectedResourceReadOnly) return;\n updateResource.mutate({ id: selectedResourceId, content });\n },\n [updateResource, selectedResourceId, selectedResourceReadOnly],\n );\n\n const handleUploadFiles = useCallback(\n (files: FileList, targetScope: ResourceScope) => {\n for (let i = 0; i < files.length; i++) {\n const file = files[i];\n const formData = new FormData();\n formData.append(\"file\", file);\n formData.append(\"shared\", targetScope === \"shared\" ? \"true\" : \"false\");\n uploadResource.mutate(formData);\n }\n },\n [uploadResource],\n );\n\n const handleDragOver = useCallback((e: React.DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n setDragOver(true);\n }, []);\n\n const handleDragLeave = useCallback((e: React.DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n setDragOver(false);\n }, []);\n\n const handleDrop = useCallback(\n (e: React.DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n setDragOver(false);\n if (e.dataTransfer.files.length > 0) {\n handleUploadFiles(e.dataTransfer.files, activeScope);\n }\n },\n [activeScope, handleUploadFiles],\n );\n\n const renderScopeCreateMenu = (targetScope: ResourceScope) => {\n if (resourceFilter !== \"agents\" && resourceFilter !== \"skills\") {\n return null;\n }\n if (targetScope === \"shared\" && !canEditOrg) return null;\n return (\n <CreateMenu\n scope={targetScope}\n resourceFilter={resourceFilter}\n onCreateFile={(name) => handleCreateFromToolbar(targetScope, name)}\n onCreateResource={(path, content, mimeType, opts) =>\n handleCreateResourceFromToolbar(\n targetScope,\n path,\n content,\n mimeType,\n opts,\n )\n }\n onCreateMcpServer={handleCreateMcpServer}\n canCreateOrgMcp={canCreateOrgMcp}\n hasOrg={hasOrgForMcp}\n showToast={showToast}\n />\n );\n };\n\n return (\n <div\n className={cn(\n \"relative flex h-full flex-col min-h-0\",\n dragOver && \"ring-2 ring-inset ring-accent\",\n )}\n onDragOver={handleDragOver}\n onDragLeave={handleDragLeave}\n onDrop={handleDrop}\n >\n {/* Toolbar */}\n {isEditing ? (\n <div className=\"flex shrink-0 items-center justify-between border-b border-border px-2 py-1.5\">\n <div className=\"flex items-center gap-1.5 min-w-0\">\n <TooltipProvider delayDuration={200}>\n <Tooltip>\n <TooltipTrigger asChild>\n <button\n onClick={handleBack}\n aria-label=\"Back to workspace\"\n className=\"flex h-6 w-6 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-accent/50\"\n >\n <IconArrowLeft className=\"h-3.5 w-3.5\" />\n </button>\n </TooltipTrigger>\n <TooltipContent>Back to workspace</TooltipContent>\n </Tooltip>\n </TooltipProvider>\n {selectedMcpServer ? (\n <PathBreadcrumb\n path={`mcp-servers/${selectedMcpServer.name}.json`}\n />\n ) : selectedBuiltinCapability ? (\n <PathBreadcrumb\n path={`mcp-servers/${selectedBuiltinCapability.capability.name}.json`}\n />\n ) : resourceQuery.data ? (\n <PathBreadcrumb path={resourceQuery.data.path} />\n ) : null}\n </div>\n <div className=\"flex items-center gap-1 shrink-0\">\n {!selectedMcpServer &&\n resourceQuery.data &&\n selectedResourceReadOnly && (\n <span\n aria-live=\"polite\"\n className=\"mr-1 w-16 text-right text-[11px] text-muted-foreground/60\"\n >\n Read only\n </span>\n )}\n {!selectedMcpServer &&\n resourceQuery.data &&\n (resourceQuery.data.mimeType === \"text/markdown\" ||\n resourceQuery.data.path.endsWith(\".md\")) && (\n <div className=\"flex items-center gap-0.5 mr-1\">\n <TooltipProvider delayDuration={200}>\n <Tooltip>\n <TooltipTrigger asChild>\n <button\n onClick={() => setEditorView(\"visual\")}\n aria-label=\"Visual editor\"\n className={cn(\n \"flex h-6 w-6 items-center justify-center rounded-md\",\n editorView === \"visual\"\n ? \"bg-accent text-foreground\"\n : \"text-muted-foreground hover:text-foreground hover:bg-accent/50\",\n )}\n >\n <IconEye className=\"h-3.5 w-3.5\" />\n </button>\n </TooltipTrigger>\n <TooltipContent>Visual editor</TooltipContent>\n </Tooltip>\n <Tooltip>\n <TooltipTrigger asChild>\n <button\n onClick={() => setEditorView(\"code\")}\n aria-label=\"Code editor\"\n className={cn(\n \"flex h-6 w-6 items-center justify-center rounded-md\",\n editorView === \"code\"\n ? \"bg-accent text-foreground\"\n : \"text-muted-foreground hover:text-foreground hover:bg-accent/50\",\n )}\n >\n <IconCode className=\"h-3.5 w-3.5\" />\n </button>\n </TooltipTrigger>\n <TooltipContent>Code editor</TooltipContent>\n </Tooltip>\n </TooltipProvider>\n </div>\n )}\n {!selectedBuiltinCapability && !selectedResourceReadOnly && (\n <TooltipProvider delayDuration={200}>\n <Tooltip>\n <TooltipTrigger asChild>\n <button\n onClick={() => {\n if (!selectedResourceId) return;\n if (toolbarDeleteConfirmId === selectedResourceId) {\n handleDelete(selectedResourceId);\n setToolbarDeleteConfirmId(null);\n } else {\n setToolbarDeleteConfirmId(selectedResourceId);\n }\n }}\n aria-label={\n toolbarDeleteConfirmId === selectedResourceId\n ? \"Confirm delete resource\"\n : \"Delete resource\"\n }\n className={cn(\n \"flex h-6 w-6 items-center justify-center rounded-md text-muted-foreground hover:text-destructive hover:bg-accent/50\",\n toolbarDeleteConfirmId === selectedResourceId &&\n \"bg-destructive/10 text-destructive\",\n )}\n >\n <IconTrash className=\"h-3.5 w-3.5\" />\n </button>\n </TooltipTrigger>\n <TooltipContent>\n {toolbarDeleteConfirmId === selectedResourceId\n ? \"Click again to delete\"\n : \"Delete resource\"}\n </TooltipContent>\n </Tooltip>\n </TooltipProvider>\n )}\n </div>\n </div>\n ) : (\n /* Floating action buttons — absolute top-right over tree view */\n <div className=\"absolute top-1 right-1 z-10 flex items-center gap-1\">\n {(!resourceFilter || resourceFilter === \"files\") && (\n <CreateMenu\n scope={activeScope}\n resourceFilter={resourceFilter}\n onCreateFile={(name) =>\n handleCreateFromToolbar(activeScope, name)\n }\n onCreateResource={(path, content, mimeType, opts) =>\n handleCreateResourceFromToolbar(\n activeScope,\n path,\n content,\n mimeType,\n opts,\n )\n }\n onCreateMcpServer={handleCreateMcpServer}\n canCreateOrgMcp={canCreateOrgMcp}\n hasOrg={hasOrgForMcp}\n showToast={showToast}\n />\n )}\n {(!resourceFilter || resourceFilter === \"files\") && (\n <>\n <TooltipProvider delayDuration={200}>\n <Tooltip>\n <TooltipTrigger asChild>\n <button\n onClick={() => fileInputRef.current?.click()}\n aria-label=\"Upload file\"\n className=\"flex h-6 w-6 items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-accent/50\"\n >\n <IconUpload className=\"h-3.5 w-3.5\" />\n </button>\n </TooltipTrigger>\n <TooltipContent>Upload file</TooltipContent>\n </Tooltip>\n </TooltipProvider>\n <TooltipProvider delayDuration={200}>\n <Tooltip>\n <TooltipTrigger asChild>\n <button\n type=\"button\"\n onClick={() => setShowAgentScratch((value) => !value)}\n aria-label={\n showAgentScratch\n ? \"Hide agent scratch files\"\n : \"Show agent scratch files\"\n }\n className={cn(\n \"flex h-6 w-6 items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-accent/50\",\n showAgentScratch && \"bg-accent/50 text-foreground\",\n )}\n >\n <IconEye className=\"h-3.5 w-3.5\" />\n </button>\n </TooltipTrigger>\n <TooltipContent>\n {showAgentScratch\n ? \"Hide agent scratch files\"\n : \"Show agent scratch files\"}\n </TooltipContent>\n </Tooltip>\n </TooltipProvider>\n <TooltipProvider delayDuration={200}>\n <Tooltip>\n <TooltipTrigger asChild>\n <a\n href={WORKSPACE_DOCS_URL}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n aria-label=\"Open Workspace docs\"\n className=\"flex h-6 w-6 items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-accent/50\"\n >\n <IconHelp className=\"h-3.5 w-3.5\" />\n </a>\n </TooltipTrigger>\n <TooltipContent side=\"left\" sideOffset={8}>\n Open Workspace docs\n </TooltipContent>\n </Tooltip>\n </TooltipProvider>\n </>\n )}\n <input\n ref={fileInputRef}\n type=\"file\"\n multiple\n className=\"hidden\"\n onChange={(e) => {\n if (e.target.files && e.target.files.length > 0) {\n handleUploadFiles(e.target.files, activeScope);\n e.target.value = \"\";\n }\n }}\n />\n </div>\n )}\n\n {/* Content: either tree OR editor (single view) */}\n <div className=\"flex flex-1 flex-col min-h-0 overflow-hidden\">\n {isEditing ? (\n selectedMcpServer ? (\n <div className=\"flex-1 min-h-0 overflow-hidden\">\n <McpServerDetail server={selectedMcpServer} />\n </div>\n ) : selectedBuiltinCapability ? (\n <div className=\"flex-1 min-h-0 overflow-hidden\">\n <BuiltinCapabilityDetail\n capability={selectedBuiltinCapability.capability}\n scope={selectedBuiltinCapability.scope}\n canEditOrg={canEditOrg}\n />\n </div>\n ) : selectedResourceId && resourceQuery.data ? (\n <div className=\"flex flex-1 min-h-0 flex-col overflow-hidden\">\n <ResourceEditor\n resource={resourceQuery.data}\n onSave={handleSave}\n view={editorView}\n onViewChange={setEditorView}\n hideToolbar\n readOnly={selectedResourceReadOnly}\n />\n </div>\n ) : resourceQuery.isError ? (\n <div className=\"flex flex-1 items-center justify-center text-[12px] text-destructive/70\">\n Failed to load resource\n </div>\n ) : (\n <div className=\"flex flex-1 items-center justify-center text-[12px] text-muted-foreground/50\">\n Loading...\n </div>\n )\n ) : (\n <div className=\"flex-1 min-h-0 overflow-y-auto\">\n {!personalTreeQuery.isLoading &&\n !sharedTreeQuery.isLoading &&\n !workspaceTreeQuery.isLoading &&\n visibleWorkspaceTree.length === 0 &&\n displayedPersonalTree.length === 0 &&\n displayedSharedTree.length === 0 && (\n <div className=\"mx-2 mt-2 rounded-md border border-border bg-muted/30 p-2.5 text-[11px] text-muted-foreground\">\n <p className=\"mb-1 font-medium text-foreground\">\n This is your Workspace\n </p>\n <p className=\"mb-1.5 leading-snug\">\n Files the agent reads and writes — notes, instructions,\n skills, custom agents, scheduled jobs, and inherited\n workspace context. They live in the database or, in local\n file mode, in the attached repo.\n </p>\n <p className=\"mb-2 leading-snug\">\n <span className=\"text-foreground\">Workspace</span> is\n inherited from Dispatch or local file mode.{\" \"}\n <span className=\"text-foreground\">Organization</span> is\n visible to everyone in your organization\n {org?.orgId ? \" — only admins can edit. \" : \". \"}\n <span className=\"text-foreground\">Personal</span> is just\n for you.\n </p>\n <a\n href={WORKSPACE_DOCS_URL}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"inline-flex items-center gap-1 text-foreground hover:underline\"\n >\n Learn more\n <IconExternalLink className=\"h-3 w-3\" />\n </a>\n </div>\n )}\n {visibleWorkspaceTree.length > 0 && (\n <ResourceTree\n tree={visibleWorkspaceTree}\n variant={resourceTreeVariant}\n isLoading={workspaceTreeQuery.isLoading}\n deletingId={\n deleteResource.isPending\n ? (deleteResource.variables as string)\n : deleteMcpServer.isPending\n ? `mcp:${(deleteMcpServer.variables as { scope: string }).scope}:${(deleteMcpServer.variables as { id: string }).id}`\n : null\n }\n selectedId={selectedResourceId}\n onSelect={handleSelect}\n onCreateFile={() => {}}\n onCreateFolder={() => {}}\n onDelete={() => {}}\n onRename={() => {}}\n onDrop={() => {}}\n title=\"Workspace\"\n titleTooltip=\"Global resources inherited by every app. Dispatch resources are read-only; local file mode resources can be edited here.\"\n readOnly\n headingHint=\"Inherited\"\n />\n )}\n {showPersonalTree && (\n <ResourceTree\n tree={displayedPersonalTree}\n variant={resourceTreeVariant}\n isLoading={personalTreeQuery.isLoading}\n deletingId={\n deleteResource.isPending\n ? (deleteResource.variables as string)\n : deleteMcpServer.isPending\n ? `mcp:${(deleteMcpServer.variables as { scope: string }).scope}:${(deleteMcpServer.variables as { id: string }).id}`\n : null\n }\n selectedId={selectedResourceId}\n onSelect={handleSelect}\n onCreateFile={(parentPath, name) =>\n handleCreateFile(parentPath, name, \"personal\")\n }\n onCreateFolder={(parentPath, name) =>\n handleCreateFolder(parentPath, name, \"personal\")\n }\n onDelete={handleDelete}\n onRename={handleRename}\n onDrop={(files) => handleUploadFiles(files, \"personal\")}\n title=\"Personal\"\n titleTooltip=\"Files visible only to you\"\n sectionAction={renderScopeCreateMenu(\"personal\")}\n />\n )}\n {showSharedTree && (\n <ResourceTree\n tree={displayedSharedTree}\n variant={resourceTreeVariant}\n isLoading={sharedTreeQuery.isLoading}\n deletingId={\n deleteResource.isPending\n ? (deleteResource.variables as string)\n : deleteMcpServer.isPending\n ? `mcp:${(deleteMcpServer.variables as { scope: string }).scope}:${(deleteMcpServer.variables as { id: string }).id}`\n : null\n }\n selectedId={selectedResourceId}\n onSelect={handleSelect}\n onCreateFile={(parentPath, name) =>\n handleCreateFile(parentPath, name, \"shared\")\n }\n onCreateFolder={(parentPath, name) =>\n handleCreateFolder(parentPath, name, \"shared\")\n }\n onDelete={handleDelete}\n onRename={handleRename}\n onDrop={(files) => handleUploadFiles(files, \"shared\")}\n title=\"Organization\"\n titleTooltip={\n canEditOrg\n ? \"Files visible to everyone in your organization\"\n : \"Files visible to everyone in your organization. Read-only — only admins can edit.\"\n }\n readOnly={!canEditOrg}\n headingHint={!canEditOrg ? \"Read only\" : undefined}\n sectionAction={renderScopeCreateMenu(\"shared\")}\n />\n )}\n </div>\n )}\n </div>\n {toast && (\n <div className=\"pointer-events-none absolute bottom-3 left-1/2 z-[300] -translate-x-1/2\">\n <div\n role=\"status\"\n className={cn(\n \"pointer-events-auto flex max-w-[320px] items-center gap-3 rounded-md border px-3 py-2 text-[12px] shadow-md\",\n toast.kind === \"ok\"\n ? \"border-emerald-500/40 bg-emerald-500/10 text-emerald-600 dark:text-emerald-300\"\n : \"border-red-500/40 bg-red-500/10 text-red-600 dark:text-red-300\",\n )}\n >\n <span className=\"min-w-0 flex-1 truncate\">{toast.message}</span>\n {toast.kind === \"ok\" && toast.resourceId && (\n <button\n type=\"button\"\n onClick={() => {\n setSelectedResourceId(toast.resourceId!);\n setToast(null);\n }}\n className=\"shrink-0 rounded px-1.5 py-0.5 text-[11px] font-medium underline-offset-2 hover:underline\"\n >\n View\n </button>\n )}\n <button\n type=\"button\"\n aria-label=\"Dismiss\"\n onClick={() => setToast(null)}\n className=\"shrink-0 text-current/60 hover:text-current\"\n >\n ×\n </button>\n </div>\n </div>\n )}\n </div>\n );\n}\n"]}
1
+ {"version":3,"file":"ResourcesPanel.js","sourceRoot":"","sources":["../../../src/client/resources/ResourcesPanel.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,QAAQ,EACR,UAAU,EACV,aAAa,EACb,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,OAAO,EACP,QAAQ,EACR,SAAS,EACT,cAAc,EACd,gBAAgB,EAChB,QAAQ,EACR,iBAAiB,GAClB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,EACZ,QAAQ,EACR,MAAM,EACN,WAAW,EACX,SAAS,EACT,OAAO,GACR,MAAM,OAAO,CAAC;AAEf,OAAO,EACL,sBAAsB,EACtB,yBAAyB,GAC1B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EACL,OAAO,EACP,cAAc,EACd,cAAc,GACf,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,OAAO,EACP,cAAc,EACd,eAAe,EACf,cAAc,GACf,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,uBAAuB,EAAE,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C,CACH,IACG,CACP,GACG,EACL,KAAK,IAAI,CACR,cAAK,SAAS,EAAC,yEAAyE,YACtF,eACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,EAAE,CACX,6GAA6G,EAC7G,KAAK,CAAC,IAAI,KAAK,IAAI;wBACjB,CAAC,CAAC,gFAAgF;wBAClF,CAAC,CAAC,gEAAgE,CACrE,aAED,eAAM,SAAS,EAAC,yBAAyB,YAAE,KAAK,CAAC,OAAO,GAAQ,EAC/D,KAAK,CAAC,IAAI,KAAK,IAAI,IAAI,KAAK,CAAC,UAAU,IAAI,CAC1C,iBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,GAAG,EAAE;gCACZ,qBAAqB,CAAC,KAAK,CAAC,UAAW,CAAC,CAAC;gCACzC,QAAQ,CAAC,IAAI,CAAC,CAAC;4BACjB,CAAC,EACD,SAAS,EAAC,2FAA2F,qBAG9F,CACV,EACD,iBACE,IAAI,EAAC,QAAQ,gBACF,SAAS,EACpB,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,EAC7B,SAAS,EAAC,6CAA6C,uBAGhD,IACL,GACF,CACP,IACG,CACP,CAAC;AACJ,CAAC","sourcesContent":["import {\n IconPlus,\n IconUpload,\n IconArrowLeft,\n IconPencil,\n IconBulb,\n IconBolt,\n IconTrash,\n IconEye,\n IconCode,\n IconClock,\n IconHierarchy2,\n IconExternalLink,\n IconHelp,\n IconPlugConnected,\n} from \"@tabler/icons-react\";\nimport React, {\n useState,\n useRef,\n useCallback,\n useEffect,\n useMemo,\n} from \"react\";\n\nimport {\n CLAUDE_SONNET_MODEL_ID,\n CLAUDE_SONNET_MODEL_LABEL,\n} from \"../../agent/model-config.js\";\nimport { serializeFrontmatter } from \"../../resources/metadata.js\";\nimport { sendToAgentChat } from \"../agent-chat.js\";\nimport { agentNativePath } from \"../api-path.js\";\nimport {\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from \"../components/ui/popover.js\";\nimport {\n Tooltip,\n TooltipContent,\n TooltipProvider,\n TooltipTrigger,\n} from \"../components/ui/tooltip.js\";\nimport { PromptComposer } from \"../composer/PromptComposer.js\";\nimport { useT } from \"../i18n.js\";\nimport { useOrg } from \"../org/hooks.js\";\nimport { useUploadResource } from \"../uploads/use-upload-resource.js\";\nimport { cn } from \"../utils.js\";\nimport { BuiltinCapabilityDetail } from \"./BuiltinCapabilityDetail.js\";\nimport { isMcpIntegrationCatalogAvailable } from \"./mcp-integration-catalog.js\";\nimport { McpIntegrationDialog } from \"./McpIntegrationDialog.js\";\nimport { McpServerDetail } from \"./McpServerDetail.js\";\nimport { ResourceEditor } from \"./ResourceEditor.js\";\nimport { ResourceTree } from \"./ResourceTree.js\";\nimport {\n parseMcpBuiltinVirtualId,\n useBuiltinCapabilities,\n} from \"./use-builtin-capabilities.js\";\nimport {\n useMcpServers,\n useCreateMcpServer,\n useDeleteMcpServer,\n parseMcpVirtualId,\n type McpServerScope,\n} from \"./use-mcp-servers.js\";\nimport {\n useResourceTree,\n useResource,\n useCreateResource,\n useUpdateResource,\n useDeleteResource,\n withMcpServersFolder,\n withAgentScratchFolder,\n type ResourceScope,\n type ResourceMeta,\n type Resource,\n type TreeNode,\n} from \"./use-resources.js\";\n\nconst WORKSPACE_DOCS_URL = \"https://agent-native.com/docs/workspace\";\nconst LOCAL_WORKSPACE_RESOURCE_METADATA_SOURCE = \"local-workspace-resource\";\n\nexport type ResourceView =\n | \"files\"\n | \"instructions\"\n | \"agents\"\n | \"memory\"\n | \"skills\"\n | \"learnings\"\n | \"remote-agents\";\n\nexport type ResourceTreeVariant = \"tree\" | \"collection\";\n\nconst SPECIAL_RESOURCE_ROOTS = new Set([\n \"agents\",\n \"agent-scratch\",\n \"jobs\",\n \"memory\",\n \"remote-agents\",\n \"skills\",\n]);\nconst SPECIAL_RESOURCE_FILES = new Set([\"agents.md\", \"learnings.md\"]);\n\nfunction normalizedResourcePath(path: string): string {\n return path.replace(/^\\/+/, \"\").toLowerCase();\n}\n\nfunction resourceMatchesView(node: TreeNode, view: ResourceView): boolean {\n const path = normalizedResourcePath(node.path);\n switch (view) {\n case \"files\":\n return (\n !SPECIAL_RESOURCE_ROOTS.has(path.split(\"/\", 1)[0]) &&\n !SPECIAL_RESOURCE_FILES.has(path.split(\"/\").pop() ?? \"\")\n );\n case \"instructions\":\n return path.split(\"/\").pop() === \"agents.md\";\n case \"agents\":\n return node.kind === \"agent\";\n case \"memory\":\n return path === \"memory\" || path.startsWith(\"memory/\");\n case \"skills\":\n return node.kind === \"skill\";\n case \"learnings\":\n return path.split(\"/\").pop() === \"learnings.md\";\n case \"remote-agents\":\n return node.kind === \"remote-agent\";\n }\n}\n\nexport function filterResourceTree(\n tree: TreeNode[],\n view: ResourceView | undefined,\n): TreeNode[] {\n if (!view) return tree;\n return tree.flatMap((node) => {\n if (node.type === \"folder\") {\n if (\n view === \"files\" &&\n (SPECIAL_RESOURCE_ROOTS.has(\n normalizedResourcePath(node.path).split(\"/\", 1)[0],\n ) ||\n SPECIAL_RESOURCE_FILES.has(\n normalizedResourcePath(node.path).split(\"/\").pop() ?? \"\",\n ))\n ) {\n return [];\n }\n const children = filterResourceTree(node.children ?? [], view);\n return children.length > 0 ? [{ ...node, children }] : [];\n }\n return resourceMatchesView(node, view) ? [node] : [];\n });\n}\n\n// ─── Create Menu (unified + button) ────────────────────────────────────────\n\ntype CreateMenuView =\n | \"menu\"\n | \"file\"\n | \"skill\"\n | \"skill-upload\"\n | \"job\"\n | \"agent-mode\"\n | \"agent-prompt\"\n | \"agent-form\";\n\nconst AGENT_MODEL_OPTIONS = [\n { value: \"inherit\", label: \"Default model\" },\n { value: \"claude-fable-5\", label: \"Claude Fable 5\" },\n { value: \"claude-opus-4-8\", label: \"Claude Opus 4.8\" },\n { value: CLAUDE_SONNET_MODEL_ID, label: CLAUDE_SONNET_MODEL_LABEL },\n { value: \"claude-haiku-4-5-20251001\", label: \"Claude Haiku 4.5\" },\n] as const;\n\nfunction slugifyName(value: string): string {\n return (\n value\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, \"-\")\n .replace(/^-+|-+$/g, \"\") || \"agent\"\n );\n}\n\nfunction isLocalWorkspaceResource(resource: Resource | null | undefined) {\n if (!resource?.metadata) return false;\n try {\n const metadata = JSON.parse(resource.metadata) as { source?: unknown };\n return metadata.source === LOCAL_WORKSPACE_RESOURCE_METADATA_SOURCE;\n } catch {\n return false;\n }\n}\n\nfunction buildAgentResourceContent({\n name,\n description,\n model,\n tools,\n body,\n}: {\n name: string;\n description: string;\n model: string;\n tools: string;\n body: string;\n}): string {\n const fields = [\n { key: \"name\", value: name },\n { key: \"description\", value: description },\n { key: \"model\", value: model },\n { key: \"tools\", value: tools },\n { key: \"delegate-default\", value: \"false\" },\n ];\n return serializeFrontmatter(fields) + body.trim() + \"\\n\";\n}\n\nfunction CreateMenu({\n scope,\n resourceFilter,\n onCreateFile,\n onCreateResource,\n onCreateMcpServer,\n canCreateOrgMcp,\n hasOrg,\n onCreated,\n showToast,\n}: {\n scope: ResourceScope;\n resourceFilter?: ResourceView;\n onCreateFile: (name: string) => void;\n onCreateResource: (\n path: string,\n content: string,\n mimeType?: string,\n opts?: {\n onSuccess?: (resource: ResourceMeta) => void;\n onError?: (err: unknown) => void;\n },\n ) => void;\n onCreateMcpServer: (args: {\n scope: McpServerScope;\n name: string;\n url: string;\n headers?: Record<string, string>;\n description?: string;\n }) => Promise<void>;\n canCreateOrgMcp: boolean;\n hasOrg: boolean;\n onCreated?: () => void;\n showToast?: (\n kind: \"ok\" | \"err\",\n message: string,\n opts?: { resourceId?: string; durationMs?: number },\n ) => void;\n}) {\n const t = useT();\n const [open, setOpen] = useState(false);\n const [mcpDialogOpen, setMcpDialogOpen] = useState(false);\n const [view, setView] = useState<CreateMenuView>(\"menu\");\n const showMcpIntegrations = useMemo(\n () => isMcpIntegrationCatalogAvailable(),\n [],\n );\n const [value, setValue] = useState(\"\");\n const [agentName, setAgentName] = useState(\"\");\n const [agentDescription, setAgentDescription] = useState(\"\");\n const [agentModel, setAgentModel] = useState<string>(\"inherit\");\n const [agentInstructions, setAgentInstructions] = useState(\n `# Role\\n\\nDefine how this agent should work.\\n\\n## Focus\\n\\n- What kinds of tasks it should handle\\n- What tone or approach it should use\\n- Important constraints or preferences\\n`,\n );\n const defaultMcpScope: McpServerScope =\n scope === \"shared\" && canCreateOrgMcp ? \"org\" : \"user\";\n const inputRef = useRef<HTMLInputElement | HTMLTextAreaElement>(null);\n const skillFileInputRef = useRef<HTMLInputElement>(null);\n const skillHoverTimerRef = useRef<number | null>(null);\n const [skillFlyoutOpen, setSkillFlyoutOpen] = useState(false);\n const [skillFlyoutSide, setSkillFlyoutSide] = useState<\"right\" | \"left\">(\n \"right\",\n );\n const skillFlyoutCloseTimerRef = useRef<number | null>(null);\n const openSkillFlyout = (rowEl?: HTMLElement | null) => {\n if (skillFlyoutCloseTimerRef.current) {\n window.clearTimeout(skillFlyoutCloseTimerRef.current);\n skillFlyoutCloseTimerRef.current = null;\n }\n if (rowEl && typeof window !== \"undefined\") {\n const rect = rowEl.getBoundingClientRect();\n const FLYOUT_WIDTH = 248;\n setSkillFlyoutSide(\n window.innerWidth - rect.right < FLYOUT_WIDTH ? \"left\" : \"right\",\n );\n }\n setSkillFlyoutOpen(true);\n };\n const scheduleSkillFlyoutClose = () => {\n if (skillFlyoutCloseTimerRef.current)\n window.clearTimeout(skillFlyoutCloseTimerRef.current);\n skillFlyoutCloseTimerRef.current = window.setTimeout(() => {\n setSkillFlyoutOpen(false);\n }, 160);\n };\n const [skillUploadSlug, setSkillUploadSlug] = useState(\"\");\n const [skillUploadContent, setSkillUploadContent] = useState(\"\");\n const [skillUploadFileName, setSkillUploadFileName] = useState(\"\");\n\n useEffect(() => {\n if (open) {\n setView(\"menu\");\n setValue(\"\");\n setAgentName(\"\");\n setAgentDescription(\"\");\n setAgentModel(\"inherit\");\n setAgentInstructions(\n `# Role\\n\\nDefine how this agent should work.\\n\\n## Focus\\n\\n- What kinds of tasks it should handle\\n- What tone or approach it should use\\n- Important constraints or preferences\\n`,\n );\n setSkillUploadSlug(\"\");\n setSkillUploadContent(\"\");\n setSkillUploadFileName(\"\");\n setSkillFlyoutOpen(false);\n }\n }, [open]);\n\n useEffect(() => {\n if (view !== \"menu\" && view !== \"agent-form\") {\n setValue(\"\");\n const t = setTimeout(() => inputRef.current?.focus(), 50);\n return () => clearTimeout(t);\n }\n }, [view]);\n\n const submitFile = () => {\n const trimmed = value.trim();\n if (trimmed) {\n onCreateFile(trimmed);\n setOpen(false);\n }\n };\n\n const submitSkill = (text: string = value) => {\n const trimmed = text.trim();\n if (!trimmed) return;\n\n sendToAgentChat({\n message: `Create a skill: ${trimmed}`,\n newTab: true,\n context: `The user wants to create an agent skill. Their description: \"${trimmed}\"\n\nFollow the create-skill pattern to build this. Before writing:\n\n1. **Determine the skill name** — derive a hyphen-case name from the description (e.g. \"code review\" → \"code-review\")\n2. **Determine the skill type** — Pattern (architectural rule), Workflow (step-by-step), or Generator (scaffolding)\n3. **Write the skill** as a ${scope} resource at path \"skills/<name>/SKILL.md\" using the \\`resources\\` tool with \\`action: \"write\"\\`\n\nThe skill file MUST have YAML frontmatter with name and description (under 40 words), then markdown with:\n- Clear rule/purpose statement\n- Why this skill exists\n- How to follow it (with code examples where helpful)\n- Common violations to avoid\n- Related skills\n\nTemplate for a Pattern skill:\n\\`\\`\\`markdown\n---\nname: <hyphen-case-name>\ndescription: >-\n <Under 40 words. When should this trigger?>\n---\n\n# <Skill Name>\n\n## Rule\n<One sentence: what must be true>\n\n## Why\n<Why this rule exists>\n\n## How\n<How to follow it, with code examples>\n\n## Don't\n<Common violations>\n\\`\\`\\`\n\nTemplate for a Workflow skill:\n\\`\\`\\`markdown\n---\nname: <hyphen-case-name>\ndescription: >-\n <Under 40 words. When should this trigger?>\n---\n\n# <Workflow Name>\n\n## Prerequisites\n<What must be in place>\n\n## Steps\n<Numbered steps with code examples>\n\n## Verification\n<How to confirm it worked>\n\\`\\`\\`\n\nAfter creating, update the shared AGENTS.md resource to reference the new skill in its skills table.\n\nKeep the skill concise (under 500 lines) and actionable.`,\n submit: true,\n });\n\n setOpen(false);\n onCreated?.();\n };\n\n const handleUploadSkillFiles = async (files: FileList | null) => {\n if (!files || files.length === 0) return;\n const file = files[0];\n const text = await file.text();\n const baseName = file.name.replace(/\\.[^./]+$/, \"\");\n const slug = slugifyName(\n baseName.toLowerCase() === \"skill\" ? \"uploaded-skill\" : baseName,\n );\n setSkillUploadSlug(slug);\n setSkillUploadContent(text);\n setSkillUploadFileName(file.name);\n setView(\"skill-upload\");\n };\n\n const saveUploadedSkill = () => {\n const slug = slugifyName(skillUploadSlug || \"uploaded-skill\");\n const path = `skills/${slug}/SKILL.md`;\n const fileLabel = skillUploadFileName || `${slug}/SKILL.md`;\n onCreateResource(path, skillUploadContent, \"text/markdown\", {\n onSuccess: (resource) => {\n showToast?.(\"ok\", `Skill \"${fileLabel}\" added`, {\n resourceId: resource.id,\n });\n },\n onError: (err) => {\n const msg =\n err instanceof Error && err.message\n ? err.message\n : \"Failed to save skill file\";\n showToast?.(\"err\", msg);\n },\n });\n setOpen(false);\n onCreated?.();\n };\n\n const submitJob = (text: string = value) => {\n const trimmed = text.trim();\n if (!trimmed) return;\n\n sendToAgentChat({\n message: `Create a recurring job: ${trimmed}`,\n newTab: true,\n context: `The user wants to create a recurring job. Their description: \"${trimmed}\"\n\nUse the manage-jobs tool with action \"create\" to create this. You need to:\n1. Derive a hyphen-case name from the description\n2. Convert the schedule to a cron expression (e.g., \"every weekday at 9am\" → \"0 9 * * 1-5\")\n3. Write clear, self-contained instructions for what the agent should do each time the job runs\n4. Create it in ${scope} scope\n\nThe job will run automatically on the schedule. Make the instructions specific — include which actions to call and what to do with results.`,\n submit: true,\n });\n\n setOpen(false);\n };\n\n const submitAgentPrompt = (text: string = value) => {\n const trimmed = text.trim();\n if (!trimmed) return;\n\n sendToAgentChat({\n message: `Create a custom agent: ${trimmed}`,\n newTab: true,\n context: `The user wants a reusable custom sub-agent profile for the workspace. Their description: \"${trimmed}\"\n\nCreate it as a ${scope} resource under \"agents/<name>.md\" using the \\`resources\\` tool with \\`action: \"write\"\\`.\n\nRequirements:\n1. Derive a hyphen-case file name from the intent\n2. Use YAML frontmatter with:\n - name\n - description\n - model (use \"inherit\" unless the request clearly needs a different model)\n - tools (set to \"inherit\")\n - delegate-default (set to false)\n3. Put the main operating instructions in the markdown body\n4. Keep it concise and directive, similar to a Claude Code-style custom agent\n\nTemplate:\n\\`\\`\\`markdown\n---\nname: Design\ndescription: >-\n Helps with product and interface design decisions.\nmodel: inherit\ntools: inherit\ndelegate-default: false\n---\n\n# Role\n\nYou are a focused design agent.\n\n## Responsibilities\n\n- ...\n\n## Approach\n\n- ...\n\\`\\`\\`\n\nThe result should be a reusable agent profile, not a one-off task response.`,\n submit: true,\n });\n\n setOpen(false);\n onCreated?.();\n };\n\n const submitAgentManual = () => {\n const trimmedName = agentName.trim();\n const trimmedDescription = agentDescription.trim();\n const trimmedInstructions = agentInstructions.trim();\n if (!trimmedName || !trimmedDescription || !trimmedInstructions) return;\n\n const slug = slugifyName(trimmedName);\n onCreateResource(\n `agents/${slug}.md`,\n buildAgentResourceContent({\n name: trimmedName,\n description: trimmedDescription,\n model: agentModel,\n tools: \"inherit\",\n body: trimmedInstructions,\n }),\n \"text/markdown\",\n );\n setOpen(false);\n onCreated?.();\n };\n\n const menuItems: {\n icon: React.ReactNode;\n label: string;\n desc: string;\n action: () => void;\n hoverAction?: () => void;\n }[] = [\n {\n icon: <IconPlus className=\"h-3.5 w-3.5\" />,\n label: \"Create File\",\n desc: \"Add a new file at a path\",\n action: () => setView(\"file\"),\n },\n {\n icon: <IconBulb className=\"h-3.5 w-3.5\" />,\n label: \"Create Skill\",\n desc: \"Teach the agent a new ability\",\n action: openSkillFlyout,\n hoverAction: openSkillFlyout,\n },\n {\n icon: <IconClock className=\"h-3.5 w-3.5\" />,\n label: \"Schedule Task\",\n desc: \"Run something on a schedule\",\n action: () => setView(\"job\"),\n },\n {\n icon: <IconHierarchy2 className=\"h-3.5 w-3.5\" />,\n label: \"Create Custom Agent\",\n desc: \"Add a reusable sub-agent profile\",\n action: () => setView(\"agent-mode\"),\n },\n {\n icon: <IconBolt className=\"h-3.5 w-3.5\" />,\n label: \"Create Automation\",\n desc: \"Set up a when-X-do-Y rule\",\n action: () => {\n setOpen(false);\n window.dispatchEvent(\n new CustomEvent(\"agent-panel:set-mode\", {\n detail: { mode: \"chat\" },\n }),\n );\n sendToAgentChat({\n message:\n \"Help me create a new automation. Ask me what I want to automate.\",\n context: `The user wants to create a new automation. Scope: personal. Use manage-automations with action=define to create it. Ask clarifying questions if needed about what event to trigger on, conditions, and what actions to take.`,\n submit: true,\n newTab: true,\n });\n onCreated?.();\n },\n },\n ...(showMcpIntegrations\n ? [\n {\n icon: <IconPlugConnected className=\"h-3.5 w-3.5\" />,\n label: t(\"mcpIntegrations.menuLabel\"),\n desc: t(\"mcpIntegrations.menuDescription\"),\n action: () => {\n setOpen(false);\n setMcpDialogOpen(true);\n },\n },\n ]\n : []),\n ];\n const visibleMenuItems = menuItems.filter((item) => {\n if (!resourceFilter || resourceFilter === \"files\") return true;\n if (resourceFilter === \"agents\")\n return item.label === \"Create Custom Agent\";\n if (resourceFilter === \"skills\") return item.label === \"Create Skill\";\n return false;\n });\n\n return (\n <>\n <Popover open={open} onOpenChange={setOpen}>\n <input\n ref={skillFileInputRef}\n type=\"file\"\n accept=\".md,text/markdown\"\n multiple\n className=\"hidden\"\n onChange={(e) => {\n handleUploadSkillFiles(e.target.files);\n e.target.value = \"\";\n }}\n />\n <Tooltip>\n <TooltipTrigger asChild>\n <PopoverTrigger asChild>\n <button\n type=\"button\"\n className={cn(\n \"flex h-6 w-6 items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-accent/50\",\n open && \"bg-accent/50 text-foreground\",\n )}\n >\n <IconPlus className=\"h-3.5 w-3.5\" />\n </button>\n </PopoverTrigger>\n </TooltipTrigger>\n <TooltipContent>Create new...</TooltipContent>\n </Tooltip>\n <PopoverContent\n align=\"end\"\n sideOffset={6}\n collisionPadding={8}\n className={cn(\n \"z-[260] p-0 text-[13px] leading-normal\",\n view === \"menu\" || view === \"file\"\n ? \"w-[260px]\"\n : \"max-h-[70vh] w-[calc(100vw-24px)] max-w-[380px] overflow-y-auto\",\n )}\n >\n {view === \"menu\" && (\n <div className=\"py-1\">\n {visibleMenuItems.map((item) => {\n const isSkill = item.label === \"Create Skill\";\n return (\n <div\n key={item.label}\n className=\"relative\"\n onMouseEnter={(e) => {\n if (isSkill) {\n openSkillFlyout(e.currentTarget);\n return;\n }\n if (!item.hoverAction) return;\n if (skillHoverTimerRef.current)\n window.clearTimeout(skillHoverTimerRef.current);\n skillHoverTimerRef.current = window.setTimeout(() => {\n item.hoverAction?.();\n }, 180);\n }}\n onMouseLeave={() => {\n if (isSkill) {\n scheduleSkillFlyoutClose();\n return;\n }\n if (skillHoverTimerRef.current) {\n window.clearTimeout(skillHoverTimerRef.current);\n skillHoverTimerRef.current = null;\n }\n }}\n >\n <button\n type=\"button\"\n onClick={item.action}\n className={cn(\n \"flex w-full items-center gap-2.5 px-3 py-2 text-left hover:bg-accent/50\",\n isSkill && skillFlyoutOpen && \"bg-accent/50\",\n )}\n >\n <span className=\"text-muted-foreground\">{item.icon}</span>\n <div className=\"min-w-0 flex-1\">\n <div className=\"text-[12px] font-medium text-foreground\">\n {item.label}\n </div>\n <div className=\"mt-0.5 text-[10px] text-muted-foreground/60\">\n {item.desc}\n </div>\n </div>\n {isSkill && (\n <span className=\"ml-auto text-muted-foreground/60\">\n ›\n </span>\n )}\n </button>\n {isSkill && skillFlyoutOpen && (\n <div\n role=\"menu\"\n onMouseEnter={() => openSkillFlyout()}\n onMouseLeave={scheduleSkillFlyoutClose}\n className={cn(\n \"absolute top-0 z-20 w-[240px] rounded-lg border border-border bg-popover py-1 shadow-md\",\n skillFlyoutSide === \"right\"\n ? \"left-full ml-1\"\n : \"right-full mr-1\",\n )}\n >\n <button\n type=\"button\"\n onClick={() => {\n setSkillFlyoutOpen(false);\n setView(\"skill\");\n }}\n className=\"flex w-full items-center gap-2.5 px-3 py-2 text-left hover:bg-accent/50\"\n >\n <span className=\"text-muted-foreground\">\n <IconBulb className=\"h-3.5 w-3.5\" />\n </span>\n <div className=\"min-w-0\">\n <div className=\"text-[12px] font-medium text-foreground\">\n Create new skill\n </div>\n <div className=\"mt-0.5 text-[10px] text-muted-foreground/60\">\n Describe a skill and let the agent draft it\n </div>\n </div>\n </button>\n <button\n type=\"button\"\n onClick={() => {\n setSkillFlyoutOpen(false);\n skillFileInputRef.current?.click();\n }}\n className=\"flex w-full items-center gap-2.5 px-3 py-2 text-left hover:bg-accent/50\"\n >\n <span className=\"text-muted-foreground\">\n <IconUpload className=\"h-3.5 w-3.5\" />\n </span>\n <div className=\"min-w-0\">\n <div className=\"text-[12px] font-medium text-foreground\">\n Upload skill file\n </div>\n <div className=\"mt-0.5 text-[10px] text-muted-foreground/60\">\n Import an existing SKILL.md file\n </div>\n </div>\n </button>\n </div>\n )}\n </div>\n );\n })}\n </div>\n )}\n\n {view === \"file\" && (\n <div className=\"p-3\">\n <label className=\"mb-1.5 block text-[11px] font-medium text-muted-foreground\">\n File path\n </label>\n <input\n ref={inputRef as React.RefObject<HTMLInputElement>}\n value={value}\n onChange={(e) => setValue(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === \"Enter\") submitFile();\n if (e.key === \"Escape\") {\n e.stopPropagation();\n setView(\"menu\");\n }\n }}\n className=\"w-full rounded-md border border-border bg-background px-2.5 py-1.5 text-[13px] text-foreground outline-none placeholder:text-muted-foreground/50 focus:ring-1 focus:ring-accent\"\n placeholder=\"notes/ideas.md\"\n />\n <div className=\"mt-2.5 flex justify-end\">\n <button\n onClick={submitFile}\n disabled={!value.trim()}\n className=\"rounded-md bg-accent px-3 py-1.5 text-[12px] font-medium text-foreground hover:bg-accent/80 disabled:opacity-40 disabled:pointer-events-none\"\n >\n Create\n </button>\n </div>\n </div>\n )}\n\n {view === \"skill\" && (\n <div className=\"p-3\">\n <label className=\"mb-1 block text-[11px] font-semibold text-foreground\">\n Create Skill\n </label>\n <p className=\"mb-2 text-[10px] text-muted-foreground/60 leading-relaxed\">\n Describe what kind of skill you want and the agent will create\n it.\n </p>\n <PromptComposer\n autoFocus\n placeholder=\"e.g. A skill that reviews PRs for security issues and OWASP top 10 vulnerabilities\"\n draftScope=\"resources:create-skill\"\n onSubmit={(text) => submitSkill(text)}\n />\n </div>\n )}\n\n {view === \"skill-upload\" && (\n <div className=\"p-3\">\n <label className=\"mb-1 block text-[11px] font-semibold text-foreground\">\n Upload skill file\n </label>\n <p className=\"mb-2 text-[10px] text-muted-foreground/60 leading-relaxed\">\n Review the content from{\" \"}\n <span className=\"font-mono\">\n {skillUploadFileName || \"the selected file\"}\n </span>{\" \"}\n before saving.\n </p>\n <label className=\"mb-1 block text-[10px] font-medium text-muted-foreground\">\n Skill name\n </label>\n <input\n value={skillUploadSlug}\n onChange={(e) => setSkillUploadSlug(e.target.value)}\n className=\"mb-2 w-full rounded-md border border-border bg-background px-2.5 py-1.5 text-[12px] text-foreground outline-none placeholder:text-muted-foreground/50 focus:ring-1 focus:ring-accent\"\n placeholder=\"my-skill\"\n />\n <p className=\"mb-2 text-[10px] text-muted-foreground/60\">\n Will be saved at{\" \"}\n <span className=\"font-mono\">\n skills/{slugifyName(skillUploadSlug || \"uploaded-skill\")}\n /SKILL.md\n </span>\n </p>\n <label className=\"mb-1 block text-[10px] font-medium text-muted-foreground\">\n Content\n </label>\n <textarea\n value={skillUploadContent}\n onChange={(e) => setSkillUploadContent(e.target.value)}\n rows={14}\n className=\"w-full rounded-md border border-border bg-background px-2.5 py-1.5 font-mono text-[11px] leading-relaxed text-foreground outline-none focus:ring-1 focus:ring-accent\"\n />\n <div className=\"mt-2.5 flex justify-end gap-2\">\n <button\n onClick={() => setView(\"menu\")}\n className=\"rounded-md px-3 py-1.5 text-[12px] font-medium text-muted-foreground hover:bg-accent/40\"\n >\n Back\n </button>\n <button\n onClick={saveUploadedSkill}\n disabled={\n !skillUploadContent.trim() || !skillUploadSlug.trim()\n }\n className=\"rounded-md bg-accent px-3 py-1.5 text-[12px] font-medium text-foreground hover:bg-accent/80 disabled:opacity-40 disabled:pointer-events-none\"\n >\n Save\n </button>\n </div>\n </div>\n )}\n\n {view === \"job\" && (\n <div className=\"p-3\">\n <label className=\"mb-1 block text-[11px] font-semibold text-foreground\">\n Schedule Task\n </label>\n <p className=\"mb-2 text-[10px] text-muted-foreground/60 leading-relaxed\">\n Describe what should happen and when.\n </p>\n <PromptComposer\n autoFocus\n placeholder=\"e.g. Every weekday at 9am, check for overdue scorecards and send a Slack update\"\n draftScope=\"resources:create-job\"\n onSubmit={(text) => submitJob(text)}\n />\n </div>\n )}\n\n {view === \"agent-mode\" && (\n <div className=\"p-3\">\n <label className=\"mb-1 block text-[11px] font-semibold text-foreground\">\n Create Agent\n </label>\n <p className=\"mb-2 text-[10px] leading-relaxed text-muted-foreground/60\">\n Build a reusable sub-agent profile for this workspace.\n </p>\n <div className=\"space-y-2\">\n <button\n onClick={() => setView(\"agent-prompt\")}\n className=\"flex w-full items-start gap-2 rounded-md border border-border px-3 py-2 text-left hover:bg-accent/40\"\n >\n <IconPencil className=\"mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground\" />\n <div>\n <div className=\"text-[12px] font-medium text-foreground\">\n Describe It\n </div>\n <div className=\"text-[10px] text-muted-foreground/60\">\n Let the agent draft the profile from a prompt.\n </div>\n </div>\n </button>\n <button\n onClick={() => setView(\"agent-form\")}\n className=\"flex w-full items-start gap-2 rounded-md border border-border px-3 py-2 text-left hover:bg-accent/40\"\n >\n <IconHierarchy2 className=\"mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground\" />\n <div>\n <div className=\"text-[12px] font-medium text-foreground\">\n Fill Form\n </div>\n <div className=\"text-[10px] text-muted-foreground/60\">\n Set the fields manually and start with a markdown\n template.\n </div>\n </div>\n </button>\n </div>\n </div>\n )}\n\n {view === \"agent-prompt\" && (\n <div className=\"p-3\">\n <label className=\"mb-1 block text-[11px] font-semibold text-foreground\">\n Create Agent From Prompt\n </label>\n <p className=\"mb-2 text-[10px] text-muted-foreground/60 leading-relaxed\">\n Describe the agent you want. It will be saved under{\" \"}\n <code>agents/</code>.\n </p>\n <PromptComposer\n autoFocus\n placeholder=\"e.g. A design agent that critiques layouts, suggests UI direction, and prefers concise product reasoning\"\n draftScope=\"resources:create-agent\"\n onSubmit={(text) => submitAgentPrompt(text)}\n />\n </div>\n )}\n\n {view === \"agent-form\" && (\n <div className=\"p-3\">\n <label className=\"mb-2 block text-[11px] font-semibold text-foreground\">\n Create Agent Manually\n </label>\n <div className=\"space-y-2\">\n <input\n value={agentName}\n onChange={(e) => setAgentName(e.target.value)}\n className=\"w-full rounded-md border border-border bg-background px-2.5 py-1.5 text-[13px] text-foreground outline-none placeholder:text-muted-foreground/50 focus:ring-1 focus:ring-accent\"\n placeholder=\"Agent name\"\n />\n <input\n value={agentDescription}\n onChange={(e) => setAgentDescription(e.target.value)}\n className=\"w-full rounded-md border border-border bg-background px-2.5 py-1.5 text-[13px] text-foreground outline-none placeholder:text-muted-foreground/50 focus:ring-1 focus:ring-accent\"\n placeholder=\"Short description\"\n />\n <label className=\"block text-[11px] font-medium text-muted-foreground\">\n Model\n </label>\n <select\n value={agentModel}\n onChange={(e) => setAgentModel(e.target.value)}\n className=\"w-full rounded-md border border-border bg-background px-2.5 py-1.5 text-[13px] text-foreground outline-none focus:ring-1 focus:ring-accent\"\n >\n {AGENT_MODEL_OPTIONS.map((option) => (\n <option key={option.value} value={option.value}>\n {option.label}\n </option>\n ))}\n </select>\n <label className=\"block text-[11px] font-medium text-muted-foreground\">\n Instructions\n </label>\n <textarea\n value={agentInstructions}\n onChange={(e) => setAgentInstructions(e.target.value)}\n rows={8}\n className=\"w-full resize-y rounded-md border border-border bg-background px-2.5 py-1.5 text-[13px] text-foreground outline-none placeholder:text-muted-foreground/50 focus:ring-1 focus:ring-accent\"\n style={{\n fontFamily:\n 'ui-monospace, SFMono-Regular, \"SF Mono\", Menlo, Consolas, monospace',\n lineHeight: 1.5,\n }}\n />\n </div>\n <div className=\"mt-2.5 flex justify-end\">\n <button\n onClick={submitAgentManual}\n disabled={\n !agentName.trim() ||\n !agentDescription.trim() ||\n !agentInstructions.trim()\n }\n className=\"rounded-md bg-accent px-3 py-1.5 text-[12px] font-medium text-foreground hover:bg-accent/80 disabled:opacity-40 disabled:pointer-events-none\"\n >\n Create\n </button>\n </div>\n </div>\n )}\n </PopoverContent>\n </Popover>\n <McpIntegrationDialog\n open={mcpDialogOpen}\n onOpenChange={setMcpDialogOpen}\n defaultScope={defaultMcpScope}\n canCreateOrgMcp={canCreateOrgMcp}\n hasOrg={hasOrg}\n onCreateMcpServer={onCreateMcpServer}\n onCreated={onCreated}\n />\n </>\n );\n}\n\n// ─── PathBreadcrumb ─────────────────────────────────────────────────────────\n\nfunction PathBreadcrumb({ path }: { path: string }) {\n const parts = path.split(\"/\").filter(Boolean);\n return (\n <div className=\"flex items-center gap-0.5 text-[11px] text-muted-foreground/60 overflow-hidden\">\n {parts.map((part, i) => (\n <React.Fragment key={i}>\n {i > 0 && <span className=\"shrink-0\">/</span>}\n <span\n className={cn(\n \"truncate\",\n i === parts.length - 1 && \"text-muted-foreground\",\n )}\n >\n {part}\n </span>\n </React.Fragment>\n ))}\n </div>\n );\n}\n\n// ─── ResourcesPanel ─────────────────────────────────────────────────────────\n\nconst DEFAULT_AGENTS_MD_CLIENT = `# Agent Instructions\n\nThis file customizes how the AI agent behaves in this app. Edit it to add your own instructions, preferences, and context.\n\n## What to put here\n\n- **Preferences** — Tone, style, verbosity, response format\n- **Context** — Domain knowledge, terminology, team conventions\n- **Rules** — Things the agent should always/never do\n- **Skills** — Reference skill files for specialized tasks (create them in the \\`skills/\\` folder)\n\n## Skills\n\nCreate skill files under \\`skills/<name>/SKILL.md\\` to give the agent specialized knowledge. Reference them here:\n\n| Skill | Path | Description |\n|-------|------|-------------|\n| *(use the skill button to create one)* | \\`skills/example/SKILL.md\\` | |\n\n## Workspace files\n\nWorkspace resources are for files users intentionally add, edit, or manage. Agents may create hidden \\`agent_scratch\\` resources for temporary working notes, scripts, or intermediate results; only promote those files into workspace visibility when a user explicitly asks to keep them.\n`;\n\nconst WORKSPACE_RESOURCE_OWNER = \"__workspace__\";\nconst SHARED_RESOURCE_OWNER = \"__shared__\";\n\nexport interface ResourcesPanelProps {\n /** Hide the virtual MCP folder when Files is hosted by the Agent page. */\n showMcpServers?: boolean;\n /** Optional page-level scope to mirror in the resource toolbar. */\n scope?: ResourceScope;\n /** When set, show only the requested scope instead of both scope sections. */\n showOnlyRequestedScope?: boolean;\n /** Limit the tree to one agent-native resource collection. */\n resourceFilter?: ResourceView;\n /** Render special collections as cards instead of a nested file tree. */\n resourceTreeVariant?: ResourceTreeVariant;\n}\n\nexport function resolveInitialResourceScope(\n requestedScope: ResourceScope | undefined,\n canEditOrg: boolean,\n): ResourceScope {\n if (requestedScope === \"shared\") return \"shared\";\n if (requestedScope === \"personal\") return \"personal\";\n return canEditOrg ? \"shared\" : \"personal\";\n}\n\nexport function ResourcesPanel({\n showMcpServers = true,\n scope: requestedScope,\n showOnlyRequestedScope = false,\n resourceFilter,\n resourceTreeVariant = \"tree\",\n}: ResourcesPanelProps = {}) {\n const { data: org } = useOrg();\n // Non-admin org members get read-only access to organization resources.\n // Solo deployments (no orgId) behave as owner — users can edit their own.\n const canEditOrg =\n !org?.orgId || org.role === \"owner\" || org.role === \"admin\";\n\n const [activeScope, setActiveScope] = useState<ResourceScope>(() =>\n resolveInitialResourceScope(requestedScope, canEditOrg),\n );\n const [selectedResourceId, setSelectedResourceId] = useState<string | null>(\n null,\n );\n const [toolbarDeleteConfirmId, setToolbarDeleteConfirmId] = useState<\n string | null\n >(null);\n const [dragOver, setDragOver] = useState(false);\n const [toast, setToast] = useState<{\n kind: \"ok\" | \"err\";\n message: string;\n resourceId?: string;\n } | null>(null);\n const toastTimerRef = useRef<number | null>(null);\n const showToast = useCallback(\n (\n kind: \"ok\" | \"err\",\n message: string,\n opts?: { resourceId?: string; durationMs?: number },\n ) => {\n setToast({ kind, message, resourceId: opts?.resourceId });\n if (toastTimerRef.current) window.clearTimeout(toastTimerRef.current);\n toastTimerRef.current = window.setTimeout(\n () => setToast(null),\n opts?.durationMs ?? 5000,\n );\n },\n [],\n );\n const [editorView, setEditorView] = useState<\"visual\" | \"code\">(() => {\n try {\n const v = localStorage.getItem(\"resource-editor-view\");\n if (v === \"code\") return \"code\";\n } catch {}\n return \"visual\";\n });\n const [showAgentScratch, setShowAgentScratch] = useState(false);\n\n useEffect(() => {\n setToolbarDeleteConfirmId(null);\n }, [selectedResourceId]);\n const fileInputRef = useRef<HTMLInputElement>(null);\n\n const sharedTreeQuery = useResourceTree(\"shared\", {\n includeAgentScratch: showAgentScratch,\n });\n const personalTreeQuery = useResourceTree(\"personal\", {\n includeAgentScratch: showAgentScratch,\n });\n const workspaceTreeQuery = useResourceTree(\"workspace\");\n const mcpServersQuery = useMcpServers();\n const builtinCapabilitiesQuery = useBuiltinCapabilities();\n const createMcpServer = useCreateMcpServer();\n const deleteMcpServer = useDeleteMcpServer();\n\n // Merge MCP servers into each scope's tree as a virtual `mcp-servers/`\n // folder. The servers live in the settings store, not the resources\n // table — the virtual ids carry the `mcp:<scope>:<id>` prefix that\n // `handleSelect` and `handleDelete` below recognize to route back to\n // the MCP endpoints.\n const personalTree = withAgentScratchFolder(\n showMcpServers\n ? withMcpServersFolder(\n personalTreeQuery.data ?? [],\n mcpServersQuery.data?.user ?? [],\n {\n builtins: (builtinCapabilitiesQuery.data?.capabilities ?? []).map(\n (capability) => ({ capability, scope: \"user\" as const }),\n ),\n },\n )\n : (personalTreeQuery.data ?? []),\n { show: showAgentScratch },\n );\n const sharedTree = withAgentScratchFolder(\n showMcpServers\n ? withMcpServersFolder(\n sharedTreeQuery.data ?? [],\n mcpServersQuery.data?.org ?? [],\n {\n builtins: (builtinCapabilitiesQuery.data?.capabilities ?? []).map(\n (capability) => ({ capability, scope: \"org\" as const }),\n ),\n },\n )\n : (sharedTreeQuery.data ?? []),\n { show: showAgentScratch },\n );\n const workspaceTree = workspaceTreeQuery.data ?? [];\n const visiblePersonalTree = useMemo(\n () => filterResourceTree(personalTree, resourceFilter),\n [personalTree, resourceFilter],\n );\n const visibleSharedTree = useMemo(\n () => filterResourceTree(sharedTree, resourceFilter),\n [resourceFilter, sharedTree],\n );\n const visibleWorkspaceTree = useMemo(\n () => filterResourceTree(workspaceTree, resourceFilter),\n [resourceFilter, workspaceTree],\n );\n const displayedPersonalTree =\n showOnlyRequestedScope && activeScope !== \"personal\"\n ? []\n : visiblePersonalTree;\n const displayedSharedTree =\n showOnlyRequestedScope && activeScope !== \"shared\" ? [] : visibleSharedTree;\n const showSharedTree = !showOnlyRequestedScope || activeScope === \"shared\";\n const showPersonalTree =\n !showOnlyRequestedScope || activeScope === \"personal\";\n\n const orgRole = mcpServersQuery.data?.role ?? org?.role ?? null;\n const hasOrgForMcp = !!(mcpServersQuery.data?.orgId ?? org?.orgId);\n const canCreateOrgMcp =\n hasOrgForMcp && (orgRole === \"owner\" || orgRole === \"admin\");\n\n // Virtual MCP server currently selected in the tree (or null for a real\n // resource / nothing). Resolved by scanning both trees' mcp folders for\n // a matching virtual id.\n const selectedMcpServer = React.useMemo(() => {\n const parsed = selectedResourceId\n ? parseMcpVirtualId(selectedResourceId)\n : null;\n if (!parsed) return null;\n const list =\n parsed.scope === \"user\"\n ? (mcpServersQuery.data?.user ?? [])\n : (mcpServersQuery.data?.org ?? []);\n return list.find((s) => s.id === parsed.serverId) ?? null;\n }, [selectedResourceId, mcpServersQuery.data]);\n\n const selectedBuiltinCapability = React.useMemo(() => {\n const parsed = selectedResourceId\n ? parseMcpBuiltinVirtualId(selectedResourceId)\n : null;\n if (!parsed) return null;\n const capability = (builtinCapabilitiesQuery.data?.capabilities ?? []).find(\n (item) => item.id === parsed.capabilityId,\n );\n return capability ? { capability, scope: parsed.scope } : null;\n }, [selectedResourceId, builtinCapabilitiesQuery.data]);\n\n // Sync activeScope once the org role arrives (canEditOrg is resolved async).\n useEffect(() => {\n if (!requestedScope && !canEditOrg && activeScope === \"shared\") {\n setActiveScope(\"personal\");\n }\n }, [canEditOrg, activeScope, requestedScope]);\n\n useEffect(() => {\n if (!requestedScope) return;\n setActiveScope(requestedScope);\n }, [requestedScope]);\n // Virtual MCP ids aren't in the resources store — skip the fetch so\n // useResource doesn't 404-flash.\n const resourceQuery = useResource(\n selectedResourceId &&\n !parseMcpVirtualId(selectedResourceId) &&\n !parseMcpBuiltinVirtualId(selectedResourceId)\n ? selectedResourceId\n : null,\n );\n const createResource = useCreateResource();\n const updateResource = useUpdateResource();\n const deleteResource = useDeleteResource();\n const uploadResource = useUploadResource();\n const selectedResourceReadOnly =\n !!resourceQuery.data &&\n ((resourceQuery.data.owner === WORKSPACE_RESOURCE_OWNER &&\n !isLocalWorkspaceResource(resourceQuery.data)) ||\n (resourceQuery.data.owner === SHARED_RESOURCE_OWNER && !canEditOrg));\n\n // Ensure AGENTS.md exists in the organization scope when the panel opens.\n // The server also seeds it on table init; this is a safety net. Only attempt\n // for users who can write to organization resources — non-admins would just\n // get a 403.\n const seededRef = useRef(false);\n useEffect(() => {\n if (seededRef.current || !canEditOrg) return;\n seededRef.current = true;\n fetch(agentNativePath(\"/_agent-native/resources\"), {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({\n path: \"AGENTS.md\",\n content: DEFAULT_AGENTS_MD_CLIENT,\n shared: true,\n ifNotExists: true,\n }),\n }).catch(() => {});\n }, [canEditOrg]);\n\n // Are we viewing a file (editor) or the tree?\n const isEditing = selectedResourceId !== null;\n\n const handleSelect = useCallback((resource: ResourceMeta) => {\n setSelectedResourceId(resource.id);\n }, []);\n\n const handleBack = useCallback(() => {\n setSelectedResourceId(null);\n }, []);\n\n const handleCreateFile = useCallback(\n (parentPath: string, name: string, scope: ResourceScope) => {\n const path = parentPath ? `${parentPath}/${name}` : name;\n createResource.mutate(\n { path, content: \"\", shared: scope === \"shared\" },\n {\n onSuccess: (data) => {\n setSelectedResourceId(data.id);\n },\n },\n );\n },\n [createResource],\n );\n\n const handleCreateFolder = useCallback(\n (parentPath: string, name: string, scope: ResourceScope) => {\n const path = parentPath ? `${parentPath}/${name}/.keep` : `${name}/.keep`;\n createResource.mutate({ path, content: \"\", shared: scope === \"shared\" });\n },\n [createResource],\n );\n\n const handleCreateFromToolbar = useCallback(\n (targetScope: ResourceScope, name: string) => {\n createResource.mutate(\n { path: name, content: \"\", shared: targetScope === \"shared\" },\n {\n onSuccess: (data) => {\n setSelectedResourceId(data.id);\n },\n },\n );\n },\n [createResource],\n );\n\n const handleCreateResourceFromToolbar = useCallback(\n (\n targetScope: ResourceScope,\n path: string,\n content: string,\n mimeType?: string,\n opts?: {\n onSuccess?: (resource: ResourceMeta) => void;\n onError?: (err: unknown) => void;\n },\n ) => {\n createResource.mutate(\n { path, content, mimeType, shared: targetScope === \"shared\" },\n {\n onSuccess: (data) => {\n setSelectedResourceId(data.id);\n opts?.onSuccess?.(data);\n },\n onError: (err) => {\n opts?.onError?.(err);\n },\n },\n );\n },\n [createResource],\n );\n\n const handleDelete = useCallback(\n (id: string) => {\n const mcp = parseMcpVirtualId(id);\n if (mcp) {\n deleteMcpServer.mutate(\n { id: mcp.serverId, scope: mcp.scope },\n {\n onSuccess: () => {\n if (selectedResourceId === id) setSelectedResourceId(null);\n },\n },\n );\n return;\n }\n if (parseMcpBuiltinVirtualId(id)) return;\n deleteResource.mutate(id);\n if (selectedResourceId === id) {\n setSelectedResourceId(null);\n }\n },\n [deleteResource, deleteMcpServer, selectedResourceId],\n );\n\n const handleCreateMcpServer = useCallback(\n async (args: {\n scope: McpServerScope;\n name: string;\n url: string;\n headers?: Record<string, string>;\n description?: string;\n }) => {\n const server = await createMcpServer.mutateAsync(args);\n // Select the newly-created virtual entry so the detail view opens.\n setSelectedResourceId(`mcp:${args.scope}:${server.id}`);\n },\n [createMcpServer],\n );\n\n const handleRename = useCallback(\n (id: string, newPath: string) => {\n updateResource.mutate({ id, path: newPath });\n },\n [updateResource],\n );\n\n const handleSave = useCallback(\n (content: string) => {\n if (!selectedResourceId) return;\n if (selectedResourceReadOnly) return;\n updateResource.mutate({ id: selectedResourceId, content });\n },\n [updateResource, selectedResourceId, selectedResourceReadOnly],\n );\n\n const handleUploadFiles = useCallback(\n (files: FileList, targetScope: ResourceScope) => {\n for (let i = 0; i < files.length; i++) {\n const file = files[i];\n const formData = new FormData();\n formData.append(\"file\", file);\n formData.append(\"shared\", targetScope === \"shared\" ? \"true\" : \"false\");\n uploadResource.mutate(formData);\n }\n },\n [uploadResource],\n );\n\n const handleDragOver = useCallback((e: React.DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n setDragOver(true);\n }, []);\n\n const handleDragLeave = useCallback((e: React.DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n setDragOver(false);\n }, []);\n\n const handleDrop = useCallback(\n (e: React.DragEvent) => {\n e.preventDefault();\n e.stopPropagation();\n setDragOver(false);\n if (e.dataTransfer.files.length > 0) {\n handleUploadFiles(e.dataTransfer.files, activeScope);\n }\n },\n [activeScope, handleUploadFiles],\n );\n\n const renderScopeCreateMenu = (targetScope: ResourceScope) => {\n if (resourceFilter !== \"agents\" && resourceFilter !== \"skills\") {\n return null;\n }\n if (targetScope === \"shared\" && !canEditOrg) return null;\n return (\n <CreateMenu\n scope={targetScope}\n resourceFilter={resourceFilter}\n onCreateFile={(name) => handleCreateFromToolbar(targetScope, name)}\n onCreateResource={(path, content, mimeType, opts) =>\n handleCreateResourceFromToolbar(\n targetScope,\n path,\n content,\n mimeType,\n opts,\n )\n }\n onCreateMcpServer={handleCreateMcpServer}\n canCreateOrgMcp={canCreateOrgMcp}\n hasOrg={hasOrgForMcp}\n showToast={showToast}\n />\n );\n };\n\n return (\n <div\n className={cn(\n \"relative flex h-full flex-col min-h-0\",\n dragOver && \"ring-2 ring-inset ring-accent\",\n )}\n onDragOver={handleDragOver}\n onDragLeave={handleDragLeave}\n onDrop={handleDrop}\n >\n {/* Toolbar */}\n {isEditing ? (\n <div className=\"flex shrink-0 items-center justify-between border-b border-border px-2 py-1.5\">\n <div className=\"flex items-center gap-1.5 min-w-0\">\n <TooltipProvider delayDuration={200}>\n <Tooltip>\n <TooltipTrigger asChild>\n <button\n onClick={handleBack}\n aria-label=\"Back to workspace\"\n className=\"flex h-6 w-6 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-accent/50\"\n >\n <IconArrowLeft className=\"h-3.5 w-3.5\" />\n </button>\n </TooltipTrigger>\n <TooltipContent>Back to workspace</TooltipContent>\n </Tooltip>\n </TooltipProvider>\n {selectedMcpServer ? (\n <PathBreadcrumb\n path={`mcp-servers/${selectedMcpServer.name}.json`}\n />\n ) : selectedBuiltinCapability ? (\n <PathBreadcrumb\n path={`mcp-servers/${selectedBuiltinCapability.capability.name}.json`}\n />\n ) : resourceQuery.data ? (\n <PathBreadcrumb path={resourceQuery.data.path} />\n ) : null}\n </div>\n <div className=\"flex items-center gap-1 shrink-0\">\n {!selectedMcpServer &&\n resourceQuery.data &&\n selectedResourceReadOnly && (\n <span\n aria-live=\"polite\"\n className=\"mr-1 w-16 text-right text-[11px] text-muted-foreground/60\"\n >\n Read only\n </span>\n )}\n {!selectedMcpServer &&\n resourceQuery.data &&\n (resourceQuery.data.mimeType === \"text/markdown\" ||\n resourceQuery.data.path.endsWith(\".md\")) && (\n <div className=\"flex items-center gap-0.5 mr-1\">\n <TooltipProvider delayDuration={200}>\n <Tooltip>\n <TooltipTrigger asChild>\n <button\n onClick={() => setEditorView(\"visual\")}\n aria-label=\"Visual editor\"\n className={cn(\n \"flex h-6 w-6 items-center justify-center rounded-md\",\n editorView === \"visual\"\n ? \"bg-accent text-foreground\"\n : \"text-muted-foreground hover:text-foreground hover:bg-accent/50\",\n )}\n >\n <IconEye className=\"h-3.5 w-3.5\" />\n </button>\n </TooltipTrigger>\n <TooltipContent>Visual editor</TooltipContent>\n </Tooltip>\n <Tooltip>\n <TooltipTrigger asChild>\n <button\n onClick={() => setEditorView(\"code\")}\n aria-label=\"Code editor\"\n className={cn(\n \"flex h-6 w-6 items-center justify-center rounded-md\",\n editorView === \"code\"\n ? \"bg-accent text-foreground\"\n : \"text-muted-foreground hover:text-foreground hover:bg-accent/50\",\n )}\n >\n <IconCode className=\"h-3.5 w-3.5\" />\n </button>\n </TooltipTrigger>\n <TooltipContent>Code editor</TooltipContent>\n </Tooltip>\n </TooltipProvider>\n </div>\n )}\n {!selectedBuiltinCapability && !selectedResourceReadOnly && (\n <TooltipProvider delayDuration={200}>\n <Tooltip>\n <TooltipTrigger asChild>\n <button\n onClick={() => {\n if (!selectedResourceId) return;\n if (toolbarDeleteConfirmId === selectedResourceId) {\n handleDelete(selectedResourceId);\n setToolbarDeleteConfirmId(null);\n } else {\n setToolbarDeleteConfirmId(selectedResourceId);\n }\n }}\n aria-label={\n toolbarDeleteConfirmId === selectedResourceId\n ? \"Confirm delete resource\"\n : \"Delete resource\"\n }\n className={cn(\n \"flex h-6 w-6 items-center justify-center rounded-md text-muted-foreground hover:text-destructive hover:bg-accent/50\",\n toolbarDeleteConfirmId === selectedResourceId &&\n \"bg-destructive/10 text-destructive\",\n )}\n >\n <IconTrash className=\"h-3.5 w-3.5\" />\n </button>\n </TooltipTrigger>\n <TooltipContent>\n {toolbarDeleteConfirmId === selectedResourceId\n ? \"Click again to delete\"\n : \"Delete resource\"}\n </TooltipContent>\n </Tooltip>\n </TooltipProvider>\n )}\n </div>\n </div>\n ) : (\n /* Floating action buttons — absolute top-right over tree view */\n <div className=\"absolute top-1 right-1 z-10 flex items-center gap-1\">\n {(!resourceFilter || resourceFilter === \"files\") && (\n <CreateMenu\n scope={activeScope}\n resourceFilter={resourceFilter}\n onCreateFile={(name) =>\n handleCreateFromToolbar(activeScope, name)\n }\n onCreateResource={(path, content, mimeType, opts) =>\n handleCreateResourceFromToolbar(\n activeScope,\n path,\n content,\n mimeType,\n opts,\n )\n }\n onCreateMcpServer={handleCreateMcpServer}\n canCreateOrgMcp={canCreateOrgMcp}\n hasOrg={hasOrgForMcp}\n showToast={showToast}\n />\n )}\n {(!resourceFilter || resourceFilter === \"files\") && (\n <>\n <TooltipProvider delayDuration={200}>\n <Tooltip>\n <TooltipTrigger asChild>\n <button\n onClick={() => fileInputRef.current?.click()}\n aria-label=\"Upload file\"\n className=\"flex h-6 w-6 items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-accent/50\"\n >\n <IconUpload className=\"h-3.5 w-3.5\" />\n </button>\n </TooltipTrigger>\n <TooltipContent>Upload file</TooltipContent>\n </Tooltip>\n </TooltipProvider>\n <TooltipProvider delayDuration={200}>\n <Tooltip>\n <TooltipTrigger asChild>\n <button\n type=\"button\"\n onClick={() => setShowAgentScratch((value) => !value)}\n aria-label={\n showAgentScratch\n ? \"Hide agent scratch files\"\n : \"Show agent scratch files\"\n }\n className={cn(\n \"flex h-6 w-6 items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-accent/50\",\n showAgentScratch && \"bg-accent/50 text-foreground\",\n )}\n >\n <IconEye className=\"h-3.5 w-3.5\" />\n </button>\n </TooltipTrigger>\n <TooltipContent>\n {showAgentScratch\n ? \"Hide agent scratch files\"\n : \"Show agent scratch files\"}\n </TooltipContent>\n </Tooltip>\n </TooltipProvider>\n <TooltipProvider delayDuration={200}>\n <Tooltip>\n <TooltipTrigger asChild>\n <a\n href={WORKSPACE_DOCS_URL}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n aria-label=\"Open Workspace docs\"\n className=\"flex h-6 w-6 items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-accent/50\"\n >\n <IconHelp className=\"h-3.5 w-3.5\" />\n </a>\n </TooltipTrigger>\n <TooltipContent side=\"left\" sideOffset={8}>\n Open Workspace docs\n </TooltipContent>\n </Tooltip>\n </TooltipProvider>\n </>\n )}\n <input\n ref={fileInputRef}\n type=\"file\"\n multiple\n className=\"hidden\"\n onChange={(e) => {\n if (e.target.files && e.target.files.length > 0) {\n handleUploadFiles(e.target.files, activeScope);\n e.target.value = \"\";\n }\n }}\n />\n </div>\n )}\n\n {/* Content: either tree OR editor (single view) */}\n <div className=\"flex flex-1 flex-col min-h-0 overflow-hidden\">\n {isEditing ? (\n selectedMcpServer ? (\n <div className=\"flex-1 min-h-0 overflow-hidden\">\n <McpServerDetail server={selectedMcpServer} />\n </div>\n ) : selectedBuiltinCapability ? (\n <div className=\"flex-1 min-h-0 overflow-hidden\">\n <BuiltinCapabilityDetail\n capability={selectedBuiltinCapability.capability}\n scope={selectedBuiltinCapability.scope}\n canEditOrg={canEditOrg}\n />\n </div>\n ) : selectedResourceId && resourceQuery.data ? (\n <div className=\"flex flex-1 min-h-0 flex-col overflow-hidden\">\n <ResourceEditor\n resource={resourceQuery.data}\n onSave={handleSave}\n view={editorView}\n onViewChange={setEditorView}\n hideToolbar\n readOnly={selectedResourceReadOnly}\n />\n </div>\n ) : resourceQuery.isError ? (\n <div className=\"flex flex-1 items-center justify-center text-[12px] text-destructive/70\">\n Failed to load resource\n </div>\n ) : (\n <div className=\"flex flex-1 items-center justify-center text-[12px] text-muted-foreground/50\">\n Loading...\n </div>\n )\n ) : (\n <div className=\"flex-1 min-h-0 overflow-y-auto\">\n {!personalTreeQuery.isLoading &&\n !sharedTreeQuery.isLoading &&\n !workspaceTreeQuery.isLoading &&\n visibleWorkspaceTree.length === 0 &&\n displayedPersonalTree.length === 0 &&\n displayedSharedTree.length === 0 && (\n <div className=\"mx-2 mt-2 rounded-md border border-border bg-muted/30 p-2.5 text-[11px] text-muted-foreground\">\n <p className=\"mb-1 font-medium text-foreground\">\n This is your Workspace\n </p>\n <p className=\"mb-1.5 leading-snug\">\n Files the agent reads and writes — notes, instructions,\n skills, custom agents, scheduled jobs, and inherited\n workspace context. They live in the database or, in local\n file mode, in the attached repo.\n </p>\n <p className=\"mb-2 leading-snug\">\n <span className=\"text-foreground\">Workspace</span> is\n inherited from Dispatch or local file mode.{\" \"}\n <span className=\"text-foreground\">Organization</span> is\n visible to everyone in your organization\n {org?.orgId ? \" — only admins can edit. \" : \". \"}\n <span className=\"text-foreground\">Personal</span> is just\n for you.\n </p>\n <a\n href={WORKSPACE_DOCS_URL}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"inline-flex items-center gap-1 text-foreground hover:underline\"\n >\n Learn more\n <IconExternalLink className=\"h-3 w-3\" />\n </a>\n </div>\n )}\n {visibleWorkspaceTree.length > 0 && (\n <ResourceTree\n tree={visibleWorkspaceTree}\n variant={resourceTreeVariant}\n isLoading={workspaceTreeQuery.isLoading}\n deletingId={\n deleteResource.isPending\n ? (deleteResource.variables as string)\n : deleteMcpServer.isPending\n ? `mcp:${(deleteMcpServer.variables as { scope: string }).scope}:${(deleteMcpServer.variables as { id: string }).id}`\n : null\n }\n selectedId={selectedResourceId}\n onSelect={handleSelect}\n onCreateFile={() => {}}\n onCreateFolder={() => {}}\n onDelete={() => {}}\n onRename={() => {}}\n onDrop={() => {}}\n title=\"Workspace\"\n titleTooltip=\"Global resources inherited by every app. Dispatch resources are read-only; local file mode resources can be edited here.\"\n readOnly\n headingHint=\"Inherited\"\n />\n )}\n {showPersonalTree && (\n <ResourceTree\n tree={displayedPersonalTree}\n variant={resourceTreeVariant}\n isLoading={personalTreeQuery.isLoading}\n deletingId={\n deleteResource.isPending\n ? (deleteResource.variables as string)\n : deleteMcpServer.isPending\n ? `mcp:${(deleteMcpServer.variables as { scope: string }).scope}:${(deleteMcpServer.variables as { id: string }).id}`\n : null\n }\n selectedId={selectedResourceId}\n onSelect={handleSelect}\n onCreateFile={(parentPath, name) =>\n handleCreateFile(parentPath, name, \"personal\")\n }\n onCreateFolder={(parentPath, name) =>\n handleCreateFolder(parentPath, name, \"personal\")\n }\n onDelete={handleDelete}\n onRename={handleRename}\n onDrop={(files) => handleUploadFiles(files, \"personal\")}\n title=\"Personal\"\n titleTooltip=\"Files visible only to you\"\n sectionAction={renderScopeCreateMenu(\"personal\")}\n />\n )}\n {showSharedTree && (\n <ResourceTree\n tree={displayedSharedTree}\n variant={resourceTreeVariant}\n isLoading={sharedTreeQuery.isLoading}\n deletingId={\n deleteResource.isPending\n ? (deleteResource.variables as string)\n : deleteMcpServer.isPending\n ? `mcp:${(deleteMcpServer.variables as { scope: string }).scope}:${(deleteMcpServer.variables as { id: string }).id}`\n : null\n }\n selectedId={selectedResourceId}\n onSelect={handleSelect}\n onCreateFile={(parentPath, name) =>\n handleCreateFile(parentPath, name, \"shared\")\n }\n onCreateFolder={(parentPath, name) =>\n handleCreateFolder(parentPath, name, \"shared\")\n }\n onDelete={handleDelete}\n onRename={handleRename}\n onDrop={(files) => handleUploadFiles(files, \"shared\")}\n title=\"Organization\"\n titleTooltip={\n canEditOrg\n ? \"Files visible to everyone in your organization\"\n : \"Files visible to everyone in your organization. Read-only — only admins can edit.\"\n }\n readOnly={!canEditOrg}\n headingHint={!canEditOrg ? \"Read only\" : undefined}\n sectionAction={renderScopeCreateMenu(\"shared\")}\n />\n )}\n </div>\n )}\n </div>\n {toast && (\n <div className=\"pointer-events-none absolute bottom-3 left-1/2 z-[300] -translate-x-1/2\">\n <div\n role=\"status\"\n className={cn(\n \"pointer-events-auto flex max-w-[320px] items-center gap-3 rounded-md border px-3 py-2 text-[12px] shadow-md\",\n toast.kind === \"ok\"\n ? \"border-emerald-500/40 bg-emerald-500/10 text-emerald-600 dark:text-emerald-300\"\n : \"border-red-500/40 bg-red-500/10 text-red-600 dark:text-red-300\",\n )}\n >\n <span className=\"min-w-0 flex-1 truncate\">{toast.message}</span>\n {toast.kind === \"ok\" && toast.resourceId && (\n <button\n type=\"button\"\n onClick={() => {\n setSelectedResourceId(toast.resourceId!);\n setToast(null);\n }}\n className=\"shrink-0 rounded px-1.5 py-0.5 text-[11px] font-medium underline-offset-2 hover:underline\"\n >\n View\n </button>\n )}\n <button\n type=\"button\"\n aria-label=\"Dismiss\"\n onClick={() => setToast(null)}\n className=\"shrink-0 text-current/60 hover:text-current\"\n >\n ×\n </button>\n </div>\n </div>\n )}\n </div>\n );\n}\n"]}
@@ -1,6 +1,7 @@
1
- export { ResourcesPanel } from "./ResourcesPanel.js";
1
+ export { ResourcesPanel, type ResourcesPanelProps } from "./ResourcesPanel.js";
2
2
  export { ResourceTree, type ResourceTreeProps } from "./ResourceTree.js";
3
3
  export { ResourceEditor, type ResourceEditorProps } from "./ResourceEditor.js";
4
+ export { useUploadResource } from "../uploads/use-upload-resource.js";
4
5
  export * from "./use-resources.js";
5
6
  export * from "./use-builtin-capabilities.js";
6
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/resources/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC/E,cAAc,oBAAoB,CAAC;AACnC,cAAc,+BAA+B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/resources/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,cAAc,oBAAoB,CAAC;AACnC,cAAc,+BAA+B,CAAC"}
@@ -1,6 +1,7 @@
1
1
  export { ResourcesPanel } from "./ResourcesPanel.js";
2
2
  export { ResourceTree } from "./ResourceTree.js";
3
3
  export { ResourceEditor } from "./ResourceEditor.js";
4
+ export { useUploadResource } from "../uploads/use-upload-resource.js";
4
5
  export * from "./use-resources.js";
5
6
  export * from "./use-builtin-capabilities.js";
6
7
  //# sourceMappingURL=index.js.map