@agent-native/core 0.7.2 → 0.7.6

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 (352) hide show
  1. package/README.md +6 -5
  2. package/dist/agent/engine/anthropic-engine.d.ts.map +1 -1
  3. package/dist/agent/engine/anthropic-engine.js +8 -4
  4. package/dist/agent/engine/anthropic-engine.js.map +1 -1
  5. package/dist/agent/engine/types.d.ts +1 -1
  6. package/dist/agent/engine/types.d.ts.map +1 -1
  7. package/dist/agent/production-agent.d.ts +7 -0
  8. package/dist/agent/production-agent.d.ts.map +1 -1
  9. package/dist/agent/production-agent.js +153 -118
  10. package/dist/agent/production-agent.js.map +1 -1
  11. package/dist/cli/create.d.ts.map +1 -1
  12. package/dist/cli/create.js +8 -1
  13. package/dist/cli/create.js.map +1 -1
  14. package/dist/cli/index.js +8 -0
  15. package/dist/cli/index.js.map +1 -1
  16. package/dist/cli/info.d.ts +2 -0
  17. package/dist/cli/info.d.ts.map +1 -0
  18. package/dist/cli/info.js +103 -0
  19. package/dist/cli/info.js.map +1 -0
  20. package/dist/client/AssistantChat.d.ts.map +1 -1
  21. package/dist/client/AssistantChat.js +171 -68
  22. package/dist/client/AssistantChat.js.map +1 -1
  23. package/dist/client/FeedbackButton.d.ts +3 -1
  24. package/dist/client/FeedbackButton.d.ts.map +1 -1
  25. package/dist/client/FeedbackButton.js +115 -40
  26. package/dist/client/FeedbackButton.js.map +1 -1
  27. package/dist/client/agent-chat-adapter.d.ts.map +1 -1
  28. package/dist/client/agent-chat-adapter.js +12 -1
  29. package/dist/client/agent-chat-adapter.js.map +1 -1
  30. package/dist/client/composer/TiptapComposer.d.ts +3 -1
  31. package/dist/client/composer/TiptapComposer.d.ts.map +1 -1
  32. package/dist/client/composer/TiptapComposer.js +46 -2
  33. package/dist/client/composer/TiptapComposer.js.map +1 -1
  34. package/dist/client/composer/VoiceButton.d.ts +21 -0
  35. package/dist/client/composer/VoiceButton.d.ts.map +1 -0
  36. package/dist/client/composer/VoiceButton.js +51 -0
  37. package/dist/client/composer/VoiceButton.js.map +1 -0
  38. package/dist/client/composer/useVoiceDictation.d.ts +38 -0
  39. package/dist/client/composer/useVoiceDictation.d.ts.map +1 -0
  40. package/dist/client/composer/useVoiceDictation.js +398 -0
  41. package/dist/client/composer/useVoiceDictation.js.map +1 -0
  42. package/dist/client/index.d.ts +1 -0
  43. package/dist/client/index.d.ts.map +1 -1
  44. package/dist/client/index.js +1 -0
  45. package/dist/client/index.js.map +1 -1
  46. package/dist/client/onboarding/OnboardingPanel.js +2 -2
  47. package/dist/client/onboarding/OnboardingPanel.js.map +1 -1
  48. package/dist/client/org/OrgSwitcher.d.ts +5 -4
  49. package/dist/client/org/OrgSwitcher.d.ts.map +1 -1
  50. package/dist/client/org/OrgSwitcher.js +90 -24
  51. package/dist/client/org/OrgSwitcher.js.map +1 -1
  52. package/dist/client/resources/McpServerDetail.d.ts +15 -0
  53. package/dist/client/resources/McpServerDetail.d.ts.map +1 -0
  54. package/dist/client/resources/McpServerDetail.js +65 -0
  55. package/dist/client/resources/McpServerDetail.js.map +1 -0
  56. package/dist/client/resources/ResourceEditor.js +1 -1
  57. package/dist/client/resources/ResourceEditor.js.map +1 -1
  58. package/dist/client/resources/ResourceTree.d.ts +6 -1
  59. package/dist/client/resources/ResourceTree.d.ts.map +1 -1
  60. package/dist/client/resources/ResourceTree.js +18 -7
  61. package/dist/client/resources/ResourceTree.js.map +1 -1
  62. package/dist/client/resources/ResourcesPanel.d.ts.map +1 -1
  63. package/dist/client/resources/ResourcesPanel.js +191 -20
  64. package/dist/client/resources/ResourcesPanel.js.map +1 -1
  65. package/dist/client/resources/use-mcp-servers.d.ts +68 -0
  66. package/dist/client/resources/use-mcp-servers.d.ts.map +1 -0
  67. package/dist/client/resources/use-mcp-servers.js +83 -0
  68. package/dist/client/resources/use-mcp-servers.js.map +1 -0
  69. package/dist/client/resources/use-resources.d.ts +27 -1
  70. package/dist/client/resources/use-resources.d.ts.map +1 -1
  71. package/dist/client/resources/use-resources.js +63 -0
  72. package/dist/client/resources/use-resources.js.map +1 -1
  73. package/dist/client/settings/SecretsSection.d.ts +12 -0
  74. package/dist/client/settings/SecretsSection.d.ts.map +1 -0
  75. package/dist/client/settings/SecretsSection.js +148 -0
  76. package/dist/client/settings/SecretsSection.js.map +1 -0
  77. package/dist/client/settings/SettingsPanel.d.ts.map +1 -1
  78. package/dist/client/settings/SettingsPanel.js +101 -2
  79. package/dist/client/settings/SettingsPanel.js.map +1 -1
  80. package/dist/client/settings/VoiceTranscriptionSection.d.ts +14 -0
  81. package/dist/client/settings/VoiceTranscriptionSection.d.ts.map +1 -0
  82. package/dist/client/settings/VoiceTranscriptionSection.js +111 -0
  83. package/dist/client/settings/VoiceTranscriptionSection.js.map +1 -0
  84. package/dist/client/settings/index.d.ts +1 -0
  85. package/dist/client/settings/index.d.ts.map +1 -1
  86. package/dist/client/settings/index.js +1 -0
  87. package/dist/client/settings/index.js.map +1 -1
  88. package/dist/client/sharing/ShareButton.d.ts +16 -0
  89. package/dist/client/sharing/ShareButton.d.ts.map +1 -0
  90. package/dist/client/sharing/ShareButton.js +308 -0
  91. package/dist/client/sharing/ShareButton.js.map +1 -0
  92. package/dist/client/sharing/ShareDialog.d.ts +33 -0
  93. package/dist/client/sharing/ShareDialog.d.ts.map +1 -0
  94. package/dist/client/sharing/ShareDialog.js +231 -0
  95. package/dist/client/sharing/ShareDialog.js.map +1 -0
  96. package/dist/client/sharing/VisibilityBadge.d.ts +11 -0
  97. package/dist/client/sharing/VisibilityBadge.d.ts.map +1 -0
  98. package/dist/client/sharing/VisibilityBadge.js +19 -0
  99. package/dist/client/sharing/VisibilityBadge.js.map +1 -0
  100. package/dist/client/sharing/index.d.ts +4 -0
  101. package/dist/client/sharing/index.d.ts.map +1 -0
  102. package/dist/client/sharing/index.js +4 -0
  103. package/dist/client/sharing/index.js.map +1 -0
  104. package/dist/client/use-action.d.ts.map +1 -1
  105. package/dist/client/use-action.js +27 -3
  106. package/dist/client/use-action.js.map +1 -1
  107. package/dist/db/migrations.d.ts +18 -3
  108. package/dist/db/migrations.d.ts.map +1 -1
  109. package/dist/db/migrations.js +25 -3
  110. package/dist/db/migrations.js.map +1 -1
  111. package/dist/db/schema.d.ts +1 -0
  112. package/dist/db/schema.d.ts.map +1 -1
  113. package/dist/db/schema.js +4 -0
  114. package/dist/db/schema.js.map +1 -1
  115. package/dist/deploy/build.js +22 -3
  116. package/dist/deploy/build.js.map +1 -1
  117. package/dist/deploy/workspace-core.js +2 -2
  118. package/dist/index.d.ts +1 -0
  119. package/dist/index.d.ts.map +1 -1
  120. package/dist/index.js +4 -0
  121. package/dist/index.js.map +1 -1
  122. package/dist/mcp-client/config.d.ts +20 -1
  123. package/dist/mcp-client/config.d.ts.map +1 -1
  124. package/dist/mcp-client/config.js +28 -11
  125. package/dist/mcp-client/config.js.map +1 -1
  126. package/dist/mcp-client/hub-client.d.ts +38 -0
  127. package/dist/mcp-client/hub-client.d.ts.map +1 -0
  128. package/dist/mcp-client/hub-client.js +147 -0
  129. package/dist/mcp-client/hub-client.js.map +1 -0
  130. package/dist/mcp-client/hub-routes.d.ts +42 -0
  131. package/dist/mcp-client/hub-routes.d.ts.map +1 -0
  132. package/dist/mcp-client/hub-routes.js +114 -0
  133. package/dist/mcp-client/hub-routes.js.map +1 -0
  134. package/dist/mcp-client/index.d.ts +15 -0
  135. package/dist/mcp-client/index.d.ts.map +1 -1
  136. package/dist/mcp-client/index.js +35 -0
  137. package/dist/mcp-client/index.js.map +1 -1
  138. package/dist/mcp-client/manager.d.ts +54 -8
  139. package/dist/mcp-client/manager.d.ts.map +1 -1
  140. package/dist/mcp-client/manager.js +276 -59
  141. package/dist/mcp-client/manager.js.map +1 -1
  142. package/dist/mcp-client/remote-store.d.ts +102 -0
  143. package/dist/mcp-client/remote-store.d.ts.map +1 -0
  144. package/dist/mcp-client/remote-store.js +200 -0
  145. package/dist/mcp-client/remote-store.js.map +1 -0
  146. package/dist/mcp-client/routes.d.ts +55 -0
  147. package/dist/mcp-client/routes.d.ts.map +1 -0
  148. package/dist/mcp-client/routes.js +384 -0
  149. package/dist/mcp-client/routes.js.map +1 -0
  150. package/dist/mcp-client/visibility.d.ts +16 -0
  151. package/dist/mcp-client/visibility.d.ts.map +1 -0
  152. package/dist/mcp-client/visibility.js +45 -0
  153. package/dist/mcp-client/visibility.js.map +1 -0
  154. package/dist/onboarding/default-steps.d.ts.map +1 -1
  155. package/dist/onboarding/default-steps.js +5 -0
  156. package/dist/onboarding/default-steps.js.map +1 -1
  157. package/dist/org/accept-pending.d.ts +22 -0
  158. package/dist/org/accept-pending.d.ts.map +1 -0
  159. package/dist/org/accept-pending.js +75 -0
  160. package/dist/org/accept-pending.js.map +1 -0
  161. package/dist/org/context.js +2 -2
  162. package/dist/org/context.js.map +1 -1
  163. package/dist/org/handlers.d.ts +2 -0
  164. package/dist/org/handlers.d.ts.map +1 -1
  165. package/dist/org/handlers.js +54 -3
  166. package/dist/org/handlers.js.map +1 -1
  167. package/dist/org/index.d.ts +2 -0
  168. package/dist/org/index.d.ts.map +1 -1
  169. package/dist/org/index.js +1 -0
  170. package/dist/org/index.js.map +1 -1
  171. package/dist/resources/handlers.d.ts.map +1 -1
  172. package/dist/resources/handlers.js +30 -0
  173. package/dist/resources/handlers.js.map +1 -1
  174. package/dist/secrets/index.d.ts +15 -0
  175. package/dist/secrets/index.d.ts.map +1 -0
  176. package/dist/secrets/index.js +15 -0
  177. package/dist/secrets/index.js.map +1 -0
  178. package/dist/secrets/onboarding.d.ts +18 -0
  179. package/dist/secrets/onboarding.d.ts.map +1 -0
  180. package/dist/secrets/onboarding.js +87 -0
  181. package/dist/secrets/onboarding.js.map +1 -0
  182. package/dist/secrets/register-framework-secrets.d.ts +13 -0
  183. package/dist/secrets/register-framework-secrets.d.ts.map +1 -0
  184. package/dist/secrets/register-framework-secrets.js +59 -0
  185. package/dist/secrets/register-framework-secrets.js.map +1 -0
  186. package/dist/secrets/register.d.ts +63 -0
  187. package/dist/secrets/register.d.ts.map +1 -0
  188. package/dist/secrets/register.js +62 -0
  189. package/dist/secrets/register.js.map +1 -0
  190. package/dist/secrets/routes.d.ts +67 -0
  191. package/dist/secrets/routes.d.ts.map +1 -0
  192. package/dist/secrets/routes.js +275 -0
  193. package/dist/secrets/routes.js.map +1 -0
  194. package/dist/secrets/schema.d.ts +154 -0
  195. package/dist/secrets/schema.d.ts.map +1 -0
  196. package/dist/secrets/schema.js +41 -0
  197. package/dist/secrets/schema.js.map +1 -0
  198. package/dist/secrets/storage.d.ts +54 -0
  199. package/dist/secrets/storage.d.ts.map +1 -0
  200. package/dist/secrets/storage.js +181 -0
  201. package/dist/secrets/storage.js.map +1 -0
  202. package/dist/server/action-discovery.d.ts +18 -0
  203. package/dist/server/action-discovery.d.ts.map +1 -1
  204. package/dist/server/action-discovery.js +95 -0
  205. package/dist/server/action-discovery.js.map +1 -1
  206. package/dist/server/action-routes.d.ts.map +1 -1
  207. package/dist/server/action-routes.js +22 -2
  208. package/dist/server/action-routes.js.map +1 -1
  209. package/dist/server/agent-chat-plugin.d.ts +16 -0
  210. package/dist/server/agent-chat-plugin.d.ts.map +1 -1
  211. package/dist/server/agent-chat-plugin.js +120 -25
  212. package/dist/server/agent-chat-plugin.js.map +1 -1
  213. package/dist/server/app-name.d.ts +13 -0
  214. package/dist/server/app-name.d.ts.map +1 -0
  215. package/dist/server/app-name.js +41 -0
  216. package/dist/server/app-name.js.map +1 -0
  217. package/dist/server/app-url.d.ts +24 -0
  218. package/dist/server/app-url.d.ts.map +1 -0
  219. package/dist/server/app-url.js +76 -0
  220. package/dist/server/app-url.js.map +1 -0
  221. package/dist/server/auth.d.ts.map +1 -1
  222. package/dist/server/auth.js +50 -0
  223. package/dist/server/auth.js.map +1 -1
  224. package/dist/server/better-auth-instance.d.ts.map +1 -1
  225. package/dist/server/better-auth-instance.js +137 -13
  226. package/dist/server/better-auth-instance.js.map +1 -1
  227. package/dist/server/core-routes-plugin.d.ts.map +1 -1
  228. package/dist/server/core-routes-plugin.js +73 -0
  229. package/dist/server/core-routes-plugin.js.map +1 -1
  230. package/dist/server/create-server.d.ts.map +1 -1
  231. package/dist/server/create-server.js +6 -0
  232. package/dist/server/create-server.js.map +1 -1
  233. package/dist/server/date-utils.d.ts +15 -0
  234. package/dist/server/date-utils.d.ts.map +1 -0
  235. package/dist/server/date-utils.js +41 -0
  236. package/dist/server/date-utils.js.map +1 -0
  237. package/dist/server/email-template.d.ts +51 -0
  238. package/dist/server/email-template.d.ts.map +1 -0
  239. package/dist/server/email-template.js +146 -0
  240. package/dist/server/email-template.js.map +1 -0
  241. package/dist/server/index.d.ts +6 -1
  242. package/dist/server/index.d.ts.map +1 -1
  243. package/dist/server/index.js +6 -1
  244. package/dist/server/index.js.map +1 -1
  245. package/dist/server/onboarding-html.d.ts +3 -0
  246. package/dist/server/onboarding-html.d.ts.map +1 -1
  247. package/dist/server/onboarding-html.js +13 -3
  248. package/dist/server/onboarding-html.js.map +1 -1
  249. package/dist/server/request-context.d.ts +9 -0
  250. package/dist/server/request-context.d.ts.map +1 -1
  251. package/dist/server/request-context.js +10 -0
  252. package/dist/server/request-context.js.map +1 -1
  253. package/dist/server/transcribe-voice.d.ts +26 -0
  254. package/dist/server/transcribe-voice.d.ts.map +1 -0
  255. package/dist/server/transcribe-voice.js +143 -0
  256. package/dist/server/transcribe-voice.js.map +1 -0
  257. package/dist/sharing/access.d.ts +56 -0
  258. package/dist/sharing/access.d.ts.map +1 -0
  259. package/dist/sharing/access.js +149 -0
  260. package/dist/sharing/access.js.map +1 -0
  261. package/dist/sharing/actions/list-resource-shares.d.ts +3 -0
  262. package/dist/sharing/actions/list-resource-shares.d.ts.map +1 -0
  263. package/dist/sharing/actions/list-resource-shares.js +38 -0
  264. package/dist/sharing/actions/list-resource-shares.js.map +1 -0
  265. package/dist/sharing/actions/set-resource-visibility.d.ts +3 -0
  266. package/dist/sharing/actions/set-resource-visibility.d.ts.map +1 -0
  267. package/dist/sharing/actions/set-resource-visibility.js +24 -0
  268. package/dist/sharing/actions/set-resource-visibility.js.map +1 -0
  269. package/dist/sharing/actions/share-resource.d.ts +3 -0
  270. package/dist/sharing/actions/share-resource.d.ts.map +1 -0
  271. package/dist/sharing/actions/share-resource.js +64 -0
  272. package/dist/sharing/actions/share-resource.js.map +1 -0
  273. package/dist/sharing/actions/unshare-resource.d.ts +3 -0
  274. package/dist/sharing/actions/unshare-resource.d.ts.map +1 -0
  275. package/dist/sharing/actions/unshare-resource.js +24 -0
  276. package/dist/sharing/actions/unshare-resource.js.map +1 -0
  277. package/dist/sharing/index.d.ts +11 -0
  278. package/dist/sharing/index.d.ts.map +1 -0
  279. package/dist/sharing/index.js +11 -0
  280. package/dist/sharing/index.js.map +1 -0
  281. package/dist/sharing/registry.d.ts +44 -0
  282. package/dist/sharing/registry.d.ts.map +1 -0
  283. package/dist/sharing/registry.js +54 -0
  284. package/dist/sharing/registry.js.map +1 -0
  285. package/dist/sharing/schema.d.ts +202 -0
  286. package/dist/sharing/schema.d.ts.map +1 -0
  287. package/dist/sharing/schema.js +88 -0
  288. package/dist/sharing/schema.js.map +1 -0
  289. package/dist/styles/agent-native.css +111 -0
  290. package/dist/tailwind.preset.d.ts +2 -2
  291. package/dist/tailwind.preset.d.ts.map +1 -1
  292. package/dist/tailwind.preset.js +27 -7
  293. package/dist/tailwind.preset.js.map +1 -1
  294. package/dist/templates/default/app/global.css +65 -68
  295. package/dist/templates/default/components.json +1 -1
  296. package/dist/templates/default/package.json +2 -4
  297. package/dist/templates/default/vite.config.ts +3 -0
  298. package/dist/templates/workspace-core/package.json +1 -4
  299. package/dist/templates/workspace-core/src/index.ts +1 -1
  300. package/dist/templates/workspace-core/styles/tokens.css +22 -0
  301. package/dist/templates/workspace-core/tsconfig.json +1 -1
  302. package/dist/vite/action-types-plugin.d.ts +5 -0
  303. package/dist/vite/action-types-plugin.d.ts.map +1 -1
  304. package/dist/vite/action-types-plugin.js +129 -28
  305. package/dist/vite/action-types-plugin.js.map +1 -1
  306. package/dist/vite/client.d.ts +6 -0
  307. package/dist/vite/client.d.ts.map +1 -1
  308. package/dist/vite/client.js +18 -1
  309. package/dist/vite/client.js.map +1 -1
  310. package/docs/content/actions.md +169 -74
  311. package/docs/content/agent-teams.md +139 -0
  312. package/docs/content/cloneable-saas.md +98 -0
  313. package/docs/content/creating-templates.md +9 -11
  314. package/docs/content/deployment.md +2 -9
  315. package/docs/content/drop-in-agent.md +200 -0
  316. package/docs/content/enterprise-workspace.md +22 -10
  317. package/docs/content/getting-started.md +34 -19
  318. package/docs/content/integrations.md +3 -3
  319. package/docs/content/key-concepts.md +50 -23
  320. package/docs/content/mcp-clients.md +71 -0
  321. package/docs/content/pure-agent-apps.md +69 -0
  322. package/docs/content/recurring-jobs.md +123 -0
  323. package/docs/content/skills-guide.md +8 -0
  324. package/docs/content/template-analytics.md +190 -0
  325. package/docs/content/template-calendar.md +151 -0
  326. package/docs/content/template-clips.md +55 -0
  327. package/docs/content/template-content.md +141 -0
  328. package/docs/content/template-dispatch.md +58 -0
  329. package/docs/content/template-forms.md +51 -0
  330. package/docs/content/template-mail.md +169 -0
  331. package/docs/content/template-slides.md +218 -0
  332. package/docs/content/template-starter.md +68 -0
  333. package/docs/content/template-video.md +162 -0
  334. package/docs/content/voice-input.md +59 -0
  335. package/docs/content/what-is-agent-native.md +142 -45
  336. package/docs/content/workspace-management.md +1 -0
  337. package/docs/content/{resources.md → workspace.md} +94 -42
  338. package/package.json +20 -19
  339. package/src/templates/default/app/global.css +65 -68
  340. package/src/templates/default/components.json +1 -1
  341. package/src/templates/default/package.json +2 -4
  342. package/src/templates/default/vite.config.ts +3 -0
  343. package/src/templates/workspace-core/package.json +1 -4
  344. package/src/templates/workspace-core/src/index.ts +1 -1
  345. package/src/templates/workspace-core/styles/tokens.css +22 -0
  346. package/src/templates/workspace-core/tsconfig.json +1 -1
  347. package/dist/templates/default/postcss.config.js +0 -6
  348. package/dist/templates/default/tailwind.config.ts +0 -7
  349. package/dist/templates/workspace-core/tailwind.preset.ts +0 -34
  350. package/src/templates/default/postcss.config.js +0 -6
  351. package/src/templates/default/tailwind.config.ts +0 -7
  352. package/src/templates/workspace-core/tailwind.preset.ts +0 -34
@@ -0,0 +1,123 @@
1
+ ---
2
+ title: "Recurring Jobs"
3
+ description: "Cron-scheduled prompts the agent runs on its own — daily digests, weekly reports, hourly polling."
4
+ ---
5
+
6
+ # Recurring Jobs
7
+
8
+ A **recurring job** is a prompt that runs on a cron schedule. It's how the agent does things on its own: "every morning at 7 summarize my overnight emails," "every Monday post last week's signup numbers to Slack," "every hour sweep for stale drafts and delete them."
9
+
10
+ Jobs live in the [workspace](/docs/workspace) at `jobs/<name>.md` — just a Markdown file with YAML frontmatter. No registration, no wiring. Drop the file in and the framework picks it up.
11
+
12
+ ## A job file {#job-file}
13
+
14
+ ```markdown
15
+ ---
16
+ schedule: "0 7 * * *"
17
+ enabled: true
18
+ runAs: creator
19
+ ---
20
+
21
+ # Morning digest
22
+
23
+ Summarize the emails received overnight. Group by sender domain.
24
+ Pin the top 3 threads that look like they need a reply today to the
25
+ "Needs reply" label. Draft replies for any that are obvious.
26
+ ```
27
+
28
+ That's it. The body is a prompt the agent runs at each scheduled firing. The agent has access to all the same tools and workspace context it has in an interactive chat — actions, skills, memory, connected MCP servers, sub-agents.
29
+
30
+ ## Frontmatter {#frontmatter}
31
+
32
+ | Field | Type | Default | Description |
33
+ | ------------ | ----------------------------- | ------------ | ------------------------------------------------------------------------------------------------------ |
34
+ | `schedule` | cron expression | _(required)_ | Standard 5-field cron. `"0 7 * * *"` = every day at 07:00; `"0 */4 * * *"` = every 4 hours. |
35
+ | `enabled` | boolean | `true` | Flip to `false` to pause without deleting the job. |
36
+ | `runAs` | `"creator"` \| `"shared"` | `"creator"` | `"creator"` runs with the job owner's identity and `ANTHROPIC_API_KEY`. `"shared"` uses the org's key. |
37
+ | `createdBy` | email | _(auto)_ | Populated when the job is created through the workspace UI or by the agent. |
38
+ | `orgId` | string | _(auto)_ | Org scope; inherited from the creator's active org. |
39
+ | `lastRun` | ISO timestamp | _(managed)_ | Written by the scheduler after each run. |
40
+ | `lastStatus` | `"success"` \| `"error"` \| … | _(managed)_ | Latest outcome. |
41
+ | `lastError` | string | _(managed)_ | Error message if the last run failed. |
42
+ | `nextRun` | ISO timestamp | _(managed)_ | Computed from `schedule`; used by the scheduler to decide when to fire next. |
43
+
44
+ The `last*` and `nextRun` fields are written by the scheduler. You can read them to see the history, but don't edit them by hand — the next run will overwrite.
45
+
46
+ ## Cron syntax {#cron}
47
+
48
+ Standard 5-field cron (minute, hour, day-of-month, month, day-of-week):
49
+
50
+ | Cron | Meaning |
51
+ | -------------- | ------------------------ |
52
+ | `*/5 * * * *` | Every 5 minutes |
53
+ | `0 * * * *` | Every hour on the hour |
54
+ | `0 */4 * * *` | Every 4 hours |
55
+ | `0 7 * * *` | Every day at 07:00 |
56
+ | `0 9 * * 1` | Every Monday at 09:00 |
57
+ | `0 17 * * 1-5` | Weekdays at 17:00 |
58
+ | `0 0 1 * *` | First day of every month |
59
+
60
+ The framework exports `isValidCron()` and `describeCron()` from `@agent-native/core/jobs` if you want to validate or render cron strings in the UI.
61
+
62
+ ## Creating a job {#creating}
63
+
64
+ ### From the Workspace tab
65
+
66
+ `+` → **Scheduled Task** in the workspace panel. Fill in the prompt and schedule. Saves as `jobs/<slug>.md` and starts running on the next matching tick.
67
+
68
+ ### By asking the agent
69
+
70
+ > "Create a scheduled task that summarizes my unread emails every morning at 7."
71
+
72
+ The agent writes the file for you.
73
+
74
+ ### By hand
75
+
76
+ Drop a Markdown file in `jobs/` via the framework's resource APIs:
77
+
78
+ ```ts
79
+ import { resourcePut } from "@agent-native/core/resources";
80
+
81
+ await resourcePut(
82
+ ownerEmail,
83
+ "jobs/morning-digest.md",
84
+ `---
85
+ schedule: "0 7 * * *"
86
+ enabled: true
87
+ ---
88
+ Summarize overnight emails.`,
89
+ );
90
+ ```
91
+
92
+ ## How the scheduler runs {#how-scheduler-runs}
93
+
94
+ The scheduler is a framework plugin (`processRecurringJobs()` in `@agent-native/core/jobs`). On each tick it:
95
+
96
+ 1. Lists every enabled `jobs/*.md` resource across all owners.
97
+ 2. Compares `nextRun` to the current time.
98
+ 3. For each due job, spins up a fresh agent thread with the job body as the user message.
99
+ 4. The agent runs its loop — calling actions, writing to SQL, sending A2A messages, emailing, whatever the prompt asks for.
100
+ 5. On completion, writes `lastRun`, `lastStatus`, `lastError`, and recomputes `nextRun` from the cron.
101
+
102
+ If the runtime is serverless/edge, trigger the tick from an external cron (Cloudflare Cron Triggers, Vercel Cron, GitHub Actions on a schedule, etc.) by hitting the framework's scheduler endpoint. If you're on Node, the scheduler can run in-process on a `setInterval`.
103
+
104
+ ## Debugging a job {#debugging}
105
+
106
+ - Open `jobs/<name>.md` in the workspace — the frontmatter shows `lastRun`, `lastStatus`, `lastError`, `nextRun`.
107
+ - **Run it now:** ask the agent to "run the `morning-digest` job right now." The agent will invoke the scheduler tool to force-fire it.
108
+ - **Pause it:** flip `enabled: false`. The file stays put, just stops running.
109
+
110
+ ## Different from the scheduling package {#vs-scheduling-package}
111
+
112
+ Don't confuse recurring jobs with `@agent-native/scheduling`:
113
+
114
+ - **Recurring jobs (this page)** — cron-scheduled _prompts_ the agent runs in the background. Framework-level. Lives in the workspace. Runs on any agent-native app.
115
+ - **`@agent-native/scheduling`** — a reusable domain package for building calendar/booking features (event types, availability windows, bookings). Powers the `calendar` and `scheduling` templates. See the scheduling template for usage.
116
+
117
+ Recurring jobs are "how do I make the agent act on its own?" The scheduling package is "how do I build a calendar app?" Different concerns.
118
+
119
+ ## What's next
120
+
121
+ - [**Workspace**](/docs/workspace) — where jobs live alongside skills, memory, and custom agents
122
+ - [**Actions**](/docs/actions) — the tools a job calls
123
+ - [**Agent Teams**](/docs/agent-teams) — jobs often spawn sub-agents to do parallel work
@@ -105,3 +105,11 @@ Save the file at `.agents/skills/my-skill/SKILL.md`. The directory name should m
105
105
  > **Skills** — Deep dives. Each skill focuses on one pattern with detailed rules, code examples, and do/don't lists. The agent reads these when it needs to follow a specific pattern.
106
106
 
107
107
  `AGENTS.md` tells the agent _what_ the app does. Skills tell the agent _how_ to do specific things correctly. Both are needed — `AGENTS.md` for orientation, skills for execution.
108
+
109
+ ## Skills vs memory {#skills-vs-memory}
110
+
111
+ > **Skills** — Authored, reusable how-to guides. Apply to every user, invoked on demand when the task matches.
112
+ >
113
+ > **Memory (`learnings.md`)** — Per-user notes the agent writes automatically from corrections and preferences. Loaded every turn.
114
+
115
+ If the knowledge applies to _everyone_ working in the app ("always prefer CTEs over subqueries"), it's a skill. If it's about _this particular user_ ("Steve likes concise answers"), it belongs in `learnings.md` — and the agent will put it there itself the next time you correct it. See [Agent Memory (`learnings.md`)](./resources.md#learnings-md) for the full treatment.
@@ -0,0 +1,190 @@
1
+ ---
2
+ title: "Analytics Template"
3
+ description: "AI-native analytics dashboards — connect data sources, prompt for charts, build reusable SQL dashboards and ad-hoc analyses."
4
+ ---
5
+
6
+ # Analytics Template
7
+
8
+ An open-source analytics app where the agent writes the SQL, builds the dashboards, and maintains the metric catalog. Replaces Amplitude, Mixpanel, and Looker for teams that want to own the code and the data.
9
+
10
+ ## Overview {#overview}
11
+
12
+ The Analytics template is a dashboard app built on `@agent-native/core`. You ask a data question in chat, the agent queries the underlying source (BigQuery, GA4, the app database), and the answer appears as a chart, a table, or a saved dashboard panel. The agent sees the same screen the user sees and edits the same dashboards the user edits.
13
+
14
+ Three primary surfaces:
15
+
16
+ - **SQL Dashboards** — reusable panels with filters, saved views, and parametric SQL.
17
+ - **Ad-hoc Analyses** — long-form investigations that pull from multiple sources and save re-run instructions.
18
+ - **Data Dictionary** — a canonical catalog of metrics, tables, columns, and SQL recipes that the agent consults before writing any SQL.
19
+
20
+ ## Quick start {#quick-start}
21
+
22
+ Create a new Analytics app from the CLI:
23
+
24
+ ```bash
25
+ npx @agent-native/cli create analytics
26
+ ```
27
+
28
+ Or try the hosted demo: [analytics.agent-native.com](https://analytics.agent-native.com).
29
+
30
+ Local dev:
31
+
32
+ ```bash
33
+ cd my-analytics-app
34
+ pnpm install
35
+ pnpm dev
36
+ ```
37
+
38
+ The app runs at `http://localhost:3000`. Sign in with Google, then open the **Data Sources** page to connect BigQuery, HubSpot, Jira, and the rest.
39
+
40
+ ## Key features {#key-features}
41
+
42
+ ### Natural-language chart generation
43
+
44
+ Ask the agent in plain English. It picks the right data source, writes the SQL, validates it against the warehouse, and renders the chart inline in chat or as a saved panel. Chart types: `line`, `area`, `bar`, `metric`, `table`, `pie`.
45
+
46
+ ### Reusable SQL dashboards
47
+
48
+ Dashboards are a named config with an array of panels. Each panel has an `id`, `title`, `sql`, `source` (`bigquery` / `app-db` / `ga4`), `chartType`, and `width` (1 or 2 columns). See the full shape in `templates/analytics/app/pages/adhoc/sql-dashboard/types.ts`.
49
+
50
+ Dashboards support:
51
+
52
+ - **Parametric SQL** — declare `variables` and `filters` at the dashboard level; panels reference them with `{{var}}` interpolation.
53
+ - **Saved views** — per-dashboard filter presets stored in the `dashboard_views` table.
54
+ - **Resizable panels** — 1- or 2-column width per panel; the grid fills the rest.
55
+ - **Sharing** — private by default, share with users or orgs (`viewer` / `editor` / `admin`).
56
+
57
+ ### Ad-hoc analyses
58
+
59
+ Long-form investigations that cross-reference sources. An analysis saves the original question, step-by-step re-run instructions, the data sources it touched, and the full findings in Markdown. Anyone with access can re-run it against fresh data.
60
+
61
+ Stored in the `analyses` table (see `templates/analytics/server/db/schema.ts`).
62
+
63
+ ### Living data dictionary
64
+
65
+ The dictionary is the canonical catalog of metrics used by the org — metric name, definition, table, columns, SQL template, known gotchas, owner, and data lag. The agent reads it before writing any SQL, so it uses the real warehouse column names (`hs_is_closed`, not guessed `is_closed`) and knows about caveats like "excludes internal emails".
66
+
67
+ The dictionary is seeded by asking the agent to import definitions from an existing source (dbt descriptions, a Notion page, a team wiki).
68
+
69
+ ### SQL query explorer
70
+
71
+ Direct SQL against BigQuery or the app DB from the **Ad-hoc** view. Useful for iterating on a query before saving it as a dashboard panel.
72
+
73
+ ### Multiple data connectors
74
+
75
+ Built-in actions for common sources:
76
+
77
+ | Category | Actions |
78
+ | ------------- | ------------------------------------------------------------------------ |
79
+ | Warehouse | `bigquery`, `bigquery-table-info`, `ga4-report` |
80
+ | Product | `mixpanel-events`, `amplitude-events`, `posthog-events` |
81
+ | CRM & Revenue | `hubspot-deals`, `hubspot-metrics`, `hubspot-pipelines`, `apollo-search` |
82
+ | Engineering | `github-prs`, `jira-search`, `jira-analytics` |
83
+ | Support | `pylon-issues`, `gong-calls` |
84
+ | Community | `commonroom-members`, `twitter-tweets` |
85
+ | Content & SEO | `seo-top-keywords`, `seo-page-keywords`, `seo-blog-pages` |
86
+
87
+ Full list lives in `templates/analytics/actions/`. New sources are added by dropping a new action file — the agent picks them up automatically.
88
+
89
+ ### Organizations and sharing
90
+
91
+ Multi-org deployments are wired up by default via `@agent-native/core/org`. Dashboards and analyses are scoped to the active org. The `/team` route manages members and invitations. See `templates/analytics/app/routes/team.tsx`.
92
+
93
+ Sharing uses the framework's `share-resource` primitive. Coarse visibility is `private` / `org` / `public`; fine-grained grants are per-principal with `viewer` / `editor` / `admin` roles.
94
+
95
+ ## Working with the agent {#working-with-the-agent}
96
+
97
+ The agent always knows what you're looking at. The current screen state is injected into every message as a `<current-screen>` block — it contains the active view, the open dashboard or analysis, and any selected filters.
98
+
99
+ Useful prompts:
100
+
101
+ - "Build a dashboard showing weekly active users for the past 6 months."
102
+ - "What percent of signups last month converted to paid?"
103
+ - "Add a chart comparing revenue by plan to this dashboard."
104
+ - "Reorder the panels on this dashboard so the MRR metric comes first."
105
+ - "Analyze our closed-lost deals from Q1 and save the analysis."
106
+ - "Re-run the churn analysis with this month's data."
107
+ - "Document this metric in the data dictionary."
108
+
109
+ The agent's system prompt gets an injected `<data-dictionary>` block with the approved metric entries for the active org. When you ask for a dashboard, the agent consults the dictionary first and uses the documented `table` / `columns` / `queryTemplate` verbatim — it does not guess column names.
110
+
111
+ ### Context it has automatically
112
+
113
+ - **Current view** — `overview`, `adhoc` (with `dashboardId`), `analyses` (with `analysisId`), `data-dictionary`, `data-sources`, or `settings`.
114
+ - **Active org** — scopes all queries and writes.
115
+ - **Approved dictionary entries** — for the active workspace.
116
+
117
+ ### Dashboard edits
118
+
119
+ The agent uses the `update-dashboard` action to edit dashboards. It supports two modes:
120
+
121
+ - `ops` — JSON-Pointer patches for surgical edits (move a panel, replace one SQL string, remove a filter).
122
+ - `config` — full replacement of the dashboard config.
123
+
124
+ Every BigQuery panel's SQL is dry-run against the warehouse before the dashboard saves. If a column is wrong, the save is rejected with the BigQuery error — the agent fixes the SQL and retries instead of persisting broken panels.
125
+
126
+ ## Connecting data sources {#connecting-data-sources}
127
+
128
+ Open the **Data Sources** page (`/data-sources`) to connect providers. Each source exposes an env-key list, a walkthrough, and a **Test Connection** button. The page calls `/api/credential-status`, `/api/credentials`, and `/api/test-connection`.
129
+
130
+ Credentials are stored via the framework's settings/env layer — no secrets in git. Production requires:
131
+
132
+ | Variable | Purpose |
133
+ | ---------------------------------------- | ----------------------------- |
134
+ | `DATABASE_URL` | Neon Postgres URL |
135
+ | `BETTER_AUTH_SECRET` / `BETTER_AUTH_URL` | Auth |
136
+ | `GOOGLE_CLIENT_ID` / `_SECRET` | Google sign-in (OAuth 2.0) |
137
+ | `BIGQUERY_PROJECT_ID` | BigQuery project |
138
+ | `GOOGLE_APPLICATION_CREDENTIALS_JSON` | BigQuery service-account JSON |
139
+ | `ANTHROPIC_API_KEY` | Agent chat |
140
+
141
+ Provider-specific keys (HubSpot, Jira, Gong, Pylon, etc.) are documented in each source's walkthrough on the Data Sources page. If you add a new action that needs an API key, it appears as a new source on that page via the template's onboarding registration.
142
+
143
+ Note: the BigQuery OAuth credential for Google sign-in is a **separate** credential from the BigQuery service account JSON. Create the sign-in client at GCP Console → APIs & Services → Credentials → OAuth client ID.
144
+
145
+ ## Data model {#data-model}
146
+
147
+ Core tables (see `templates/analytics/server/db/schema.ts`):
148
+
149
+ - **`dashboards`** — both Explorer and SQL dashboards. `kind` is `"explorer"` or `"sql"`; `config` is a JSON blob matching `SqlDashboardConfig`.
150
+ - **`dashboard_shares`** — per-resource share grants (principal, role).
151
+ - **`dashboard_views`** — saved filter presets per dashboard.
152
+ - **`analyses`** — ad-hoc investigations with `question`, `instructions`, `dataSources`, `resultMarkdown`, and optional `resultData`.
153
+ - **`analysis_shares`** — per-resource share grants for analyses.
154
+ - **`bigquery_cache`** — query result cache keyed by SQL hash with bytes-processed accounting.
155
+
156
+ Plus the org tables (`organizations`, `org_members`, `org_invitations`) provided by `@agent-native/core/org`.
157
+
158
+ The data dictionary lives in the framework's `settings` table under scoped keys; see the `list-data-dictionary` and `save-data-dictionary-entry` actions for the full shape.
159
+
160
+ ## Customizing it {#customizing-it}
161
+
162
+ The Analytics template is meant to be forked and extended. Everything lives in `templates/analytics/`:
163
+
164
+ - **`AGENTS.md`** — the agent's top-level guide. Documents views, actions, and workflows.
165
+ - **`actions/`** — every agent-callable operation. Add a new file to add a new action. Notable ones:
166
+ - `update-dashboard.ts` — dashboard edits (ops + full-replace)
167
+ - `save-analysis.ts` / `list-analyses.ts` — ad-hoc analyses
168
+ - `save-data-dictionary-entry.ts` / `list-data-dictionary.ts` — dictionary
169
+ - `bigquery.ts` — raw BigQuery execution
170
+ - `view-screen.ts` / `navigate.ts` — context awareness
171
+ - **`app/routes/`** — file-based routes. Each route is a thin wrapper around a page in `app/pages/`.
172
+ - **`app/pages/adhoc/sql-dashboard/`** — the SQL dashboard renderer, panel editor, filter bar, saved views.
173
+ - **`app/pages/analyses/`** — analyses list and detail view.
174
+ - **`app/pages/DataSources.tsx`** — the data-source onboarding UI.
175
+ - **`app/pages/DataDictionary.tsx`** — the dictionary browser and editor.
176
+ - **`.agents/skills/`** — pattern guides the agent reads on demand:
177
+ - `dashboard-management` — storage, scope resolution, dashboard config shape
178
+ - `data-querying` — which script to reach for, filtering patterns
179
+ - `adhoc-analysis` — workflow for cross-source investigations
180
+ - `data-querying`, `real-time-sync`, `frontend-design`, `storing-data`, `self-modifying-code`
181
+ - **`.builder/skills/<provider>/SKILL.md`** — provider-specific gotchas (BigQuery, HubSpot, Jira, GA4, etc.). Read before querying; update when you learn something new.
182
+ - **`server/db/schema.ts`** — Drizzle schema for dashboards, shares, views, analyses, BigQuery cache.
183
+ - **`server/lib/dashboards-store.ts`** — dashboard read/write with scope resolution and legacy KV migration.
184
+ - **`server/lib/bigquery.ts`** — BigQuery client, dry-run validator, cache logic.
185
+
186
+ To add a new data source, drop a script in `actions/` that calls the provider and returns results via the `output()` helper. It becomes available to the agent immediately and can be used inside dashboard panels (if you expose the result via a server handler).
187
+
188
+ To add a new chart type, extend the `ChartType` union in `app/pages/adhoc/sql-dashboard/types.ts`, handle it in `SqlChartCard.tsx`, and the agent can use it in any panel.
189
+
190
+ For the broader pattern on extending templates, see the [adding-a-feature skill](/docs/skills-guide) and [actions](/docs/actions).
@@ -0,0 +1,151 @@
1
+ ---
2
+ title: "Calendar Template"
3
+ description: "AI-native calendar with Google Calendar sync and a Calendly-style public booking page."
4
+ ---
5
+
6
+ # Calendar Template
7
+
8
+ The Calendar template is a complete scheduling app: a full calendar UI on top of Google Calendar, plus Calendly-style public booking links, all driven by an agent that can schedule, search, and manage availability on your behalf. It replaces the Google Calendar + Calendly combo with something you own and can extend.
9
+
10
+ ## Overview {#overview}
11
+
12
+ Calendar is for anyone who currently juggles Google Calendar for their own schedule and Calendly (or similar) for letting other people book time. It gives you:
13
+
14
+ - Day, week, and month calendar views backed by the Google Calendar API.
15
+ - Multi-account Google OAuth, so several calendars can overlay in one view.
16
+ - External ICS calendar subscriptions (webcal feeds).
17
+ - Configurable weekly availability with timezone support.
18
+ - Public booking links at `/book/{slug}` or `/meet/{username}/{slug}` with custom durations, custom fields, and meeting-link options.
19
+ - An agent that can answer schedule questions, create events, find free slots, and manage booking links through natural language.
20
+
21
+ Events themselves are not copied into the local database. The app reads them from Google Calendar on every request. Bookings, booking links, and settings live in SQL.
22
+
23
+ ## Quick start {#quick-start}
24
+
25
+ Create a new workspace with the Calendar template:
26
+
27
+ ```bash
28
+ npx @agent-native/core create my-app --template calendar
29
+ cd my-app
30
+ pnpm install
31
+ pnpm dev
32
+ ```
33
+
34
+ Open `http://localhost:8082` (the default Calendar dev port).
35
+
36
+ Live demo: [https://calendar.agent-native.com](https://calendar.agent-native.com).
37
+
38
+ To connect Google Calendar, open the Settings view, paste a `GOOGLE_CLIENT_ID` and `GOOGLE_CLIENT_SECRET` from [Google Cloud Console](https://console.cloud.google.com/), and click "Connect Google Calendar". The OAuth redirect URI is `http://localhost:8082/_agent-native/google/callback` in dev. Tokens are stored in the `oauth_tokens` SQL table and refresh automatically.
39
+
40
+ ## Key features {#key-features}
41
+
42
+ ### Calendar views
43
+
44
+ The main view at `/` (route `app/routes/_app._index.tsx`) renders the calendar in day, week, or month mode. Switch views from the toolbar, or ask the agent to switch for you. Events are fetched live from Google Calendar — no local sync step is required to see the latest state.
45
+
46
+ ### Multi-account Google Calendar sync
47
+
48
+ Connect as many Google accounts as you like. Each connection appears in Settings, and events from every connected calendar overlay in the main view. Sync is pull-based, so no webhooks or background workers are required. The `sync-google-calendar` action refetches a date range on demand.
49
+
50
+ Supporting actions: `list-events`, `search-events`, `get-event`, `create-event`, `sync-google-calendar`.
51
+
52
+ ### External calendars (ICS subscriptions)
53
+
54
+ Subscribe to read-only ICS or `webcal://` feeds — useful for HR time off, conference schedules, or shared team calendars. Feeds are added in Settings and stored per user. Relevant actions: `add-external-calendar`, `list-external-calendars`, `remove-external-calendar`, `update-external-calendars`.
55
+
56
+ ### Availability rules
57
+
58
+ Availability is a weekly schedule of time windows per day, plus a timezone. It is stored in the settings table under the key `calendar-availability`:
59
+
60
+ ```json
61
+ {
62
+ "timezone": "America/Los_Angeles",
63
+ "schedule": {
64
+ "monday": [{ "start": "09:00", "end": "17:00" }],
65
+ "tuesday": [{ "start": "09:00", "end": "17:00" }],
66
+ "wednesday": [
67
+ { "start": "09:00", "end": "12:00" },
68
+ { "start": "13:00", "end": "17:00" }
69
+ ],
70
+ "thursday": [{ "start": "09:00", "end": "17:00" }],
71
+ "friday": [{ "start": "09:00", "end": "16:00" }],
72
+ "saturday": [],
73
+ "sunday": []
74
+ }
75
+ }
76
+ ```
77
+
78
+ Edit it at `/availability` (`app/routes/_app.availability.tsx`) or via the `update-availability` action. The `check-availability` action reads this schedule, subtracts your existing Google Calendar events, and returns free slots of the requested duration.
79
+
80
+ ### Public booking pages
81
+
82
+ Booking links are the Calendly replacement. Create one in the UI at `/booking-links` (`app/routes/_app.booking-links._index.tsx`), configure it in the editor at `/booking-links/{id}`, and share the public URL.
83
+
84
+ Every link has:
85
+
86
+ - A URL slug, so the public page lives at `/book/{slug}`.
87
+ - A primary duration plus an optional list of alternative durations (for example 15, 30, or 60 minutes).
88
+ - Optional custom fields collected at booking time.
89
+ - A conferencing option (Google Meet, Zoom, or a custom meeting link).
90
+ - An `isActive` toggle to pause bookings without deleting the link.
91
+
92
+ Visitors land on the public page, pick a date and time from the available slots, fill in name, email, and any custom fields, and receive a confirmation. Bookings are stored in the `bookings` table with a `cancelToken`, which powers the public cancel/reschedule page at `/booking/manage/{token}`.
93
+
94
+ There is also a per-user public URL at `/meet/{username}/{slug}` for clean personal sharing.
95
+
96
+ ### Sharing booking links with teammates
97
+
98
+ Booking links are private by default — only the creator can edit or delete them. To let a teammate manage a link, either change the link's visibility or grant explicit access. The framework ships these actions, auto-mounted for any `booking-link` resource:
99
+
100
+ - `share-resource` — grant a user or org `viewer`, `editor`, or `admin` access.
101
+ - `unshare-resource` — revoke a grant.
102
+ - `list-resource-shares` — show current visibility plus all grants.
103
+ - `set-resource-visibility` — change the coarse visibility (`private`, `org`, or `public`).
104
+
105
+ Sharing only controls who can manage the link. The public booking URL always accepts bookings from unauthenticated visitors as long as `isActive` is true.
106
+
107
+ ### Inline event previews in chat
108
+
109
+ The `/event` route (`app/routes/event.tsx`) renders a compact, chromeless event card that the agent can embed in chat when you ask about a specific event. Title, time, location, attendees, and a description snippet are shown with a button to jump into the main calendar.
110
+
111
+ ## Working with the agent {#working-with-the-agent}
112
+
113
+ The agent sees what you are looking at. The current calendar view, the selected date, and the selected event are included in every message as a `current-screen` block, so you can say "this event" or "this day" and it resolves correctly.
114
+
115
+ Example prompts:
116
+
117
+ - "What is on my calendar today?"
118
+ - "Am I free Thursday afternoon for 30 minutes?"
119
+ - "Find a 1-hour slot next week and put 'Planning with Alex' on it."
120
+ - "Reschedule this event to Friday at 2pm." (when an event is selected)
121
+ - "Switch to day view and jump to next Monday."
122
+ - "Create a booking link called '15 min intro' at 15 minutes with a note field."
123
+ - "Pause my '30 min demo' booking link."
124
+ - "Block Friday afternoons on my availability."
125
+ - "What meetings do I have about 'launch' this month?"
126
+
127
+ Under the hood the agent calls actions like `list-events`, `check-availability`, `create-event`, `navigate`, and `update-availability`. Because events live in Google Calendar, the agent always queries the API instead of guessing — it will not return empty results without running a script first.
128
+
129
+ ## Data model {#data-model}
130
+
131
+ Defined in `templates/calendar/server/db/schema.ts`. Only non-event data is stored locally:
132
+
133
+ - `bookings` — confirmed appointments from public booking pages. Stores name, email, start, end, slug, optional notes, custom field responses, meeting link, a `cancelToken` for the public manage URL, and a `confirmed` or `cancelled` status.
134
+ - `booking_links` — the Calendly-style link definitions. Slug, title, description, primary `duration`, optional `durations` list, `customFields`, `conferencing`, `color`, and an `isActive` flag. Uses the framework's `ownableColumns` so the sharing system applies.
135
+ - `booking_slug_redirects` — remembers old slugs when a link is renamed so existing public URLs keep working.
136
+ - `booking_link_shares` — share grants for booking links.
137
+
138
+ Availability rules and per-user configuration live in the settings table, keyed by `calendar-availability`. Google OAuth tokens live in the framework `oauth_tokens` table. Ephemeral UI state (current view, date, selected event) lives in `application_state` under the `navigation` key.
139
+
140
+ ## Customizing it {#customizing-it}
141
+
142
+ Every part of the app is editable source. Start here:
143
+
144
+ - `templates/calendar/actions/` — every agent-callable operation. Add a new file with `defineAction` to expose new capability to both the agent and the frontend. Key files: `check-availability.ts`, `create-event.ts`, `list-events.ts`, `create-booking-link.ts`, `update-availability.ts`, `add-external-calendar.ts`, `navigate.ts`, `view-screen.ts`.
145
+ - `templates/calendar/app/routes/` — the UI. `_app._index.tsx` is the calendar, `_app.availability.tsx` is the schedule editor, `_app.booking-links._index.tsx` and `_app.booking-links.$id.tsx` manage booking links, `_app.bookings.tsx` lists bookings, `_app.settings.tsx` is Settings, and `book.$slug.tsx` plus `meet.$username.$slug.tsx` are the public booking pages.
146
+ - `templates/calendar/server/db/schema.ts` — add columns or tables with Drizzle. Keep the code dialect-agnostic so the template runs on SQLite, Postgres, Turso, D1, and Neon.
147
+ - `templates/calendar/AGENTS.md` — agent instructions. Update this when you teach the agent new capabilities or conventions.
148
+ - `templates/calendar/.agents/skills/` — detailed patterns the agent follows. Relevant skills: `event-management`, `availability-booking`, `real-time-sync`, `storing-data`, `delegate-to-agent`, `frontend-design`.
149
+ - `templates/calendar/shared/api.ts` — the shared TypeScript types (`AvailabilityConfig`, `BookingLink`, `ExternalCalendar`, etc.) used by both the server and the client.
150
+
151
+ If you add a feature, remember to update all four areas: UI, action, skill or AGENTS.md entry, and any application state the agent needs to see. That is what keeps the agent and the UI in parity.
@@ -0,0 +1,55 @@
1
+ ---
2
+ title: "Clips Template"
3
+ description: "Agent-native screen recording with AI transcription, auto-titles, summaries, chapter markers, and full-text search across every clip."
4
+ ---
5
+
6
+ # Clips
7
+
8
+ Clips is an agent-native screen-recording app. The user records a video, the app transcribes it, and the agent takes over: suggests titles, writes summaries, builds chapters, finds the exact moment someone said X, opens the right recording, shares it with the right teammate, drafts replies to comments.
9
+
10
+ Think Loom, but the agent is a first-class editor — and the recordings are yours, not a SaaS vendor's.
11
+
12
+ ## What it does {#what-it-does}
13
+
14
+ - **Record your screen.** Built-in recorder with webcam overlay, audio capture, and pause/trim.
15
+ - **Auto-transcribe.** Every recording is transcribed on upload. Speaker turns, timestamps, searchable.
16
+ - **Agent-generated metadata.** Titles, summaries, chapter markers, tags — the agent fills them in and keeps them current.
17
+ - **Full-text search.** Query across every transcript in your library. "Find the clip where we discussed the rollout plan."
18
+ - **Share links.** Per-clip permissions (public, team, private), link tracking, comments threaded with the agent in the loop.
19
+ - **Smart library.** Group by project, filter by speaker, auto-tag based on content.
20
+
21
+ ## Why it's interesting {#why}
22
+
23
+ Three things make the Clips template a good showcase of what agent-native enables:
24
+
25
+ 1. **The agent edits the transcript.** Fix a mis-transcribed word, generate chapter timestamps, pull quotes for a blog post — all in natural language, in the chat, with the UI updating live via polling.
26
+ 2. **Context awareness on recordings.** When you're viewing a clip, the agent knows the clip id, the current playhead, and the selected transcript range. Ask "summarize from here to the end" and it understands what "here" means.
27
+ 3. **Clips you own, not a vendor.** Unlike Loom, the recordings live in your storage, the transcripts live in your SQL, and the agent is yours. Fork the template, change how chapters get built, wire it to your own CDN — it's your code.
28
+
29
+ ## Naming note {#naming-note}
30
+
31
+ In the template, always say **"Clip"** in user-facing strings and agent messages — never "Loom." Internal table / variable names (`recordings`, `recording_transcripts`, etc.) stay as-is.
32
+
33
+ ## Scaffolding {#scaffolding}
34
+
35
+ ```bash
36
+ pnpm dlx @agent-native/core create my-clips --template clips --standalone
37
+ ```
38
+
39
+ Clips is a larger template with a native recorder (it ships a desktop companion for local capture). See the template `README.md` for setup specifics around screen-capture permissions and storage configuration.
40
+
41
+ ## Customize it {#customize}
42
+
43
+ Ask the agent:
44
+
45
+ - "Add a 'filler word removal' button that strips ums and uhs from the transcript and re-stitches the video." It edits the transcript processor and wires the UI.
46
+ - "Auto-post a new clip to Slack #eng-demos when I record one." It adds the hook.
47
+ - "Group the library by project — detect the project from the first words of each transcript." It updates the list view.
48
+
49
+ See [Cloneable SaaS](/docs/cloneable-saas) for the full clone → customize → deploy flow.
50
+
51
+ ## What's next
52
+
53
+ - [**Cloneable SaaS**](/docs/cloneable-saas) — the clone-and-own model
54
+ - [**Context Awareness**](/docs/context-awareness) — how the agent knows the current clip and playhead
55
+ - [**Agent Teams**](/docs/agent-teams) — delegate transcript cleanup to a specialist sub-agent