@aitne-sh/aitne 0.1.7 → 0.1.9

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 (317) hide show
  1. package/README.md +256 -833
  2. package/agent-assets/agent-profiles/_safety.md +52 -20
  3. package/agent-assets/agent-profiles/browser-task.md +108 -0
  4. package/agent-assets/agent-profiles/conversational.md +3 -3
  5. package/agent-assets/agent-profiles/profile-importer.md +3 -3
  6. package/agent-assets/agent-profiles/routine-fetch-window.md +30 -19
  7. package/agent-assets/agent-profiles/routine.md +4 -3
  8. package/agent-assets/agents/context-index-reconcile/agent.md +52 -0
  9. package/agent-assets/agents/evening-review/agent.md +53 -0
  10. package/agent-assets/agents/hourly-check/agent.md +62 -0
  11. package/agent-assets/agents/monthly-review/agent.md +55 -0
  12. package/agent-assets/agents/morning-routine/agent.md +78 -0
  13. package/agent-assets/agents/roadmap-maintenance/agent.md +52 -0
  14. package/agent-assets/agents/skill-curation/agent.md +52 -0
  15. package/agent-assets/agents/user-profile-sweep-evening/agent.md +48 -0
  16. package/agent-assets/agents/user-profile-sweep-morning/agent.md +53 -0
  17. package/agent-assets/agents/weekly-review/agent.md +51 -0
  18. package/agent-assets/docs/concepts/agent-day.md +18 -11
  19. package/agent-assets/docs/concepts/auth-health.md +56 -10
  20. package/agent-assets/docs/concepts/backends-and-tiers.md +110 -41
  21. package/agent-assets/docs/concepts/costs-and-quotas.md +74 -19
  22. package/agent-assets/docs/concepts/delegated-mode.md +193 -75
  23. package/agent-assets/docs/concepts/memory-model.md +79 -34
  24. package/agent-assets/docs/concepts/observations.md +61 -11
  25. package/agent-assets/docs/concepts/process-keys.md +66 -17
  26. package/agent-assets/docs/concepts/routines.md +77 -32
  27. package/agent-assets/docs/concepts/safety-and-execution.md +50 -21
  28. package/agent-assets/docs/concepts/safety-model.md +62 -37
  29. package/agent-assets/docs/concepts/skills.md +38 -17
  30. package/agent-assets/docs/features/integrations/browser-history.md +195 -0
  31. package/agent-assets/docs/features/integrations/calendar.md +40 -30
  32. package/agent-assets/docs/features/integrations/git.md +20 -9
  33. package/agent-assets/docs/features/integrations/github.md +93 -35
  34. package/agent-assets/docs/features/integrations/mail.md +60 -17
  35. package/agent-assets/docs/features/integrations/notion.md +51 -11
  36. package/agent-assets/docs/features/integrations/obsidian.md +35 -7
  37. package/agent-assets/docs/features/lifestyle/git.md +45 -44
  38. package/agent-assets/docs/features/lifestyle/reading.md +50 -22
  39. package/agent-assets/docs/features/lifestyle/receipts.md +66 -21
  40. package/agent-assets/docs/features/lifestyle/travel-bookings.md +91 -14
  41. package/agent-assets/docs/features/memory-files/agent-journal.md +111 -50
  42. package/agent-assets/docs/features/memory-files/projects.md +75 -15
  43. package/agent-assets/docs/features/memory-files/roadmap.md +55 -10
  44. package/agent-assets/docs/features/memory-files/schedule.md +113 -70
  45. package/agent-assets/docs/features/memory-files/today.md +47 -21
  46. package/agent-assets/docs/features/memory-files/user-profile.md +67 -31
  47. package/agent-assets/docs/features/messaging/bang-commands.md +115 -28
  48. package/agent-assets/docs/features/messaging/dashboard-chat.md +43 -21
  49. package/agent-assets/docs/features/messaging/discord.md +46 -4
  50. package/agent-assets/docs/features/messaging/overview.md +40 -19
  51. package/agent-assets/docs/features/messaging/pairing-and-magic-phrase.md +94 -27
  52. package/agent-assets/docs/features/messaging/slack.md +79 -14
  53. package/agent-assets/docs/features/messaging/telegram.md +25 -6
  54. package/agent-assets/docs/features/messaging/whatsapp.md +79 -14
  55. package/agent-assets/docs/features/operations/activity-and-conversations.md +45 -16
  56. package/agent-assets/docs/features/operations/approvals.md +53 -15
  57. package/agent-assets/docs/features/operations/backend-routing.md +75 -16
  58. package/agent-assets/docs/features/operations/cost-tracking.md +90 -17
  59. package/agent-assets/docs/features/operations/managed-chromium.md +221 -0
  60. package/agent-assets/docs/features/operations/notifications.md +58 -11
  61. package/agent-assets/docs/features/operations/quiet-hours.md +63 -40
  62. package/agent-assets/docs/features/operations/schedule-approaching.md +59 -16
  63. package/agent-assets/docs/features/routines/custom-routines.md +97 -23
  64. package/agent-assets/docs/features/routines/evening-review.md +75 -22
  65. package/agent-assets/docs/features/routines/hourly-check.md +150 -30
  66. package/agent-assets/docs/features/routines/morning-routine.md +60 -33
  67. package/agent-assets/docs/features/routines/weekly-review.md +65 -20
  68. package/agent-assets/docs/features/wiki/commands.md +37 -16
  69. package/agent-assets/docs/features/wiki/cost-and-approval.md +240 -0
  70. package/agent-assets/docs/features/wiki/dashboard.md +255 -0
  71. package/agent-assets/docs/features/wiki/overview.md +80 -12
  72. package/agent-assets/docs/features/wiki/search.md +248 -0
  73. package/agent-assets/docs/features/wiki/workspaces.md +254 -0
  74. package/agent-assets/docs/getting-started/01-what-is-this.md +64 -32
  75. package/agent-assets/docs/getting-started/02-first-steps.md +28 -10
  76. package/agent-assets/docs/getting-started/03-what-can-this-do.md +42 -21
  77. package/agent-assets/docs/getting-started/04-first-day.md +52 -20
  78. package/agent-assets/docs/glossary.md +285 -21
  79. package/agent-assets/docs/guides/add-a-custom-routine.md +74 -22
  80. package/agent-assets/docs/guides/backup-and-restore.md +92 -14
  81. package/agent-assets/docs/guides/budget-and-cost-for-wiki.md +62 -25
  82. package/agent-assets/docs/guides/build-your-wiki.md +33 -6
  83. package/agent-assets/docs/guides/change-which-model-handles-x.md +70 -9
  84. package/agent-assets/docs/guides/connect-a-new-mail-account.md +80 -15
  85. package/agent-assets/docs/guides/explore-with-trace-and-connect.md +32 -9
  86. package/agent-assets/docs/guides/import-knowledge-file.md +60 -39
  87. package/agent-assets/docs/guides/install-and-run.md +64 -19
  88. package/agent-assets/docs/guides/maintain-wiki-health.md +41 -10
  89. package/agent-assets/docs/guides/migrate-machines.md +86 -18
  90. package/agent-assets/docs/guides/multiple-wikis-for-multiple-domains.md +119 -59
  91. package/agent-assets/docs/guides/pause-the-agent.md +71 -22
  92. package/agent-assets/docs/guides/reinstall-cleanly.md +102 -17
  93. package/agent-assets/docs/guides/setup-wizard.md +126 -56
  94. package/agent-assets/docs/guides/switch-default-backend.md +72 -17
  95. package/agent-assets/docs/guides/use-an-existing-obsidian-vault.md +31 -10
  96. package/agent-assets/docs/reference/api.md +162 -23
  97. package/agent-assets/docs/reference/cli-commands.md +55 -15
  98. package/agent-assets/docs/reference/config.md +246 -39
  99. package/agent-assets/docs/reference/disallowed-tools.md +42 -10
  100. package/agent-assets/docs/reference/keyboard-shortcuts.md +47 -10
  101. package/agent-assets/docs/reference/knowledge-layout.md +620 -0
  102. package/agent-assets/docs/reference/process-keys.md +126 -20
  103. package/agent-assets/docs/reference/skills.md +62 -18
  104. package/agent-assets/docs/troubleshooting/auth-failed.md +53 -19
  105. package/agent-assets/docs/troubleshooting/dashboard-shows-degraded.md +96 -22
  106. package/agent-assets/docs/troubleshooting/fallback-keeps-firing.md +94 -20
  107. package/agent-assets/docs/troubleshooting/messaging-not-pairing.md +77 -22
  108. package/agent-assets/docs/troubleshooting/morning-routine-didnt-run.md +87 -22
  109. package/agent-assets/docs/troubleshooting/observation-not-detected.md +85 -21
  110. package/agent-assets/docs/troubleshooting/quota-exhausted.md +36 -6
  111. package/agent-assets/docs/troubleshooting/wiki-ingest-full-blocked.md +128 -51
  112. package/agent-assets/docs/troubleshooting/wiki-write-failed.md +33 -11
  113. package/agent-assets/optimizer-skills/drift-analysis/SKILL.md +1 -1
  114. package/agent-assets/optimizer-skills/knowledge-map/SKILL.md +1 -1
  115. package/agent-assets/optimizer-skills/skill-curation/SKILL.md +2 -2
  116. package/agent-assets/sandbox/linux/aitne-chromium.apparmor +91 -0
  117. package/agent-assets/sandbox/macos/aitne-chromium.sb +156 -0
  118. package/agent-assets/skills/agent-actions/SKILL.md +122 -0
  119. package/agent-assets/skills/agent-create/SKILL.md +149 -0
  120. package/agent-assets/skills/attach/SKILL.md +3 -4
  121. package/agent-assets/skills/browser-history/SKILL.md +198 -0
  122. package/agent-assets/skills/browser-history-respond/SKILL.md +106 -0
  123. package/agent-assets/skills/browser-task/SKILL.md +169 -0
  124. package/agent-assets/skills/context/SKILL.md +45 -463
  125. package/agent-assets/skills/context/curation.json +2 -2
  126. package/agent-assets/skills/context/references/api.md +232 -0
  127. package/agent-assets/skills/context/references/required-frontmatter.md +73 -0
  128. package/agent-assets/skills/context/references/snapshot-files.md +103 -0
  129. package/agent-assets/skills/context/seeds/file-responsibilities.seed.json +4 -4
  130. package/agent-assets/skills/docs-search/SKILL.md +17 -16
  131. package/agent-assets/skills/external-services/SKILL.delegated.claude.md +14 -26
  132. package/agent-assets/skills/external-services/SKILL.delegated.codex.md +14 -26
  133. package/agent-assets/skills/external-services/SKILL.delegated.gemini.md +14 -26
  134. package/agent-assets/skills/external-services/SKILL.md +9 -262
  135. package/agent-assets/skills/external-services/SKILL.native.claude.md +6 -7
  136. package/agent-assets/skills/external-services/SKILL.native.codex.md +8 -9
  137. package/agent-assets/skills/external-services/SKILL.native.gemini.md +5 -6
  138. package/agent-assets/skills/external-services/references/calendar-apple.md +97 -0
  139. package/agent-assets/skills/external-services/references/calendar-google.md +72 -0
  140. package/agent-assets/skills/external-services/references/calendar-outlook.md +36 -0
  141. package/agent-assets/skills/external-services/references/github.md +17 -0
  142. package/agent-assets/skills/external-services/references/obsidian.md +49 -0
  143. package/agent-assets/skills/external-services/references/skills-crud.md +27 -0
  144. package/agent-assets/skills/gmail-lifestyle/SKILL.md +151 -0
  145. package/agent-assets/skills/gmail-lifestyle/references/receipts-api.md +93 -0
  146. package/agent-assets/skills/gmail-lifestyle/references/travel-bookings-api.md +75 -0
  147. package/agent-assets/skills/mail/SKILL.delegated.claude.md +15 -6
  148. package/agent-assets/skills/mail/SKILL.delegated.codex.md +9 -5
  149. package/agent-assets/skills/mail/SKILL.delegated.gemini.md +9 -5
  150. package/agent-assets/skills/mail/SKILL.md +9 -114
  151. package/agent-assets/skills/mail/SKILL.native.claude.md +1 -1
  152. package/agent-assets/skills/mail/SKILL.native.codex.md +1 -1
  153. package/agent-assets/skills/mail/SKILL.native.gemini.md +1 -1
  154. package/agent-assets/skills/mail/references/api.md +110 -0
  155. package/agent-assets/skills/mail/references/examples.md +70 -0
  156. package/agent-assets/skills/mail/references/providers.md +8 -8
  157. package/agent-assets/skills/managed-tasks/SKILL.md +472 -0
  158. package/agent-assets/skills/managed-tasks/references/errors.md +73 -0
  159. package/agent-assets/skills/managed-tasks/references/output-path.md +75 -0
  160. package/agent-assets/skills/managed-tasks/references/recurrence-rule.md +86 -0
  161. package/agent-assets/skills/management-policy/SKILL.md +54 -125
  162. package/agent-assets/skills/management-policy/curation.json +1 -1
  163. package/agent-assets/skills/management-policy/references/policy-workflow.md +101 -0
  164. package/agent-assets/skills/management-policy/seeds/policy-file-shape.seed.json +1 -1
  165. package/agent-assets/skills/notify/SKILL.md +10 -82
  166. package/agent-assets/skills/notify/references/priority.md +65 -0
  167. package/agent-assets/skills/notion/SKILL.delegated.claude.md +2 -2
  168. package/agent-assets/skills/notion/SKILL.delegated.codex.md +2 -2
  169. package/agent-assets/skills/notion/SKILL.delegated.gemini.md +2 -2
  170. package/agent-assets/skills/notion/SKILL.md +6 -10
  171. package/agent-assets/skills/notion/SKILL.native.claude.md +11 -8
  172. package/agent-assets/skills/notion/SKILL.native.codex.md +10 -6
  173. package/agent-assets/skills/notion/SKILL.native.gemini.md +10 -6
  174. package/agent-assets/skills/observations/SKILL.md +25 -14
  175. package/agent-assets/skills/project-doc/SKILL.md +2 -6
  176. package/agent-assets/skills/project-doc/curation.json +3 -3
  177. package/agent-assets/skills/project-doc/seeds/project-shape.seed.json +7 -4
  178. package/agent-assets/skills/project-doc/seeds/slug-grammar.seed.json +3 -3
  179. package/agent-assets/skills/reading/SKILL.md +12 -2
  180. package/agent-assets/skills/reading/references/reading-taste.md +2 -2
  181. package/agent-assets/skills/roadmap/SKILL.md +43 -141
  182. package/agent-assets/skills/roadmap/curation.json +1 -1
  183. package/agent-assets/skills/roadmap/references/api.md +100 -0
  184. package/agent-assets/skills/roadmap/references/cross-check.md +80 -0
  185. package/agent-assets/skills/roadmap/references/migration.md +56 -0
  186. package/agent-assets/skills/roadmap/references/preparation-timeline.md +2 -2
  187. package/agent-assets/skills/roadmap/seeds/entry-types.seed.json +1 -1
  188. package/agent-assets/skills/schedule/SKILL.md +76 -104
  189. package/agent-assets/skills/schedule/references/batch.md +93 -0
  190. package/agent-assets/skills/schedule/references/errors.md +217 -0
  191. package/agent-assets/skills/schedule/references/model-selection.md +96 -0
  192. package/agent-assets/skills/schedule/references/recurrence-rule.md +86 -0
  193. package/agent-assets/skills/scheduled-managed-task/SKILL.md +59 -51
  194. package/agent-assets/skills/today/SKILL.md +32 -62
  195. package/agent-assets/skills/today/curation.json +3 -3
  196. package/agent-assets/skills/today/references/agent-plan-lifecycle.md +114 -0
  197. package/agent-assets/skills/today/seeds/section-shape.seed.json +1 -1
  198. package/agent-assets/skills/user-interview/SKILL.md +23 -67
  199. package/agent-assets/skills/user-interview/references/op-briefing.md +51 -0
  200. package/agent-assets/skills/user-interview/references/op-morning.md +59 -0
  201. package/agent-assets/skills/user-interview/references/sweep-and-fallback.md +9 -1
  202. package/agent-assets/skills/user-profile/SKILL.md +54 -74
  203. package/agent-assets/skills/user-profile/curation.json +2 -2
  204. package/agent-assets/skills/user-profile/references/character-preferences.md +83 -0
  205. package/agent-assets/skills/user-profile/seeds/routing-table.seed.json +8 -8
  206. package/agent-assets/skills/user-profile/seeds/topic-files.seed.json +30 -2
  207. package/agent-assets/skills/wiki/wiki-ask/SKILL.md +0 -1
  208. package/agent-assets/skills/wiki/wiki-compile/SKILL.md +4 -5
  209. package/agent-assets/skills/wiki/wiki-connect/SKILL.md +0 -1
  210. package/agent-assets/skills/wiki/wiki-graduate/SKILL.md +0 -1
  211. package/agent-assets/skills/wiki/wiki-ingest/SKILL.md +0 -1
  212. package/agent-assets/skills/wiki/wiki-lint/SKILL.md +0 -1
  213. package/agent-assets/skills/wiki/wiki-trace/SKILL.md +0 -1
  214. package/agent-assets/skills/wiki/wiki-vault-rules/SKILL.md +0 -1
  215. package/agent-assets/system-prompts/routine-fetch-window.md +78 -0
  216. package/agent-assets/system-prompts/skill-index-instruction.md +26 -0
  217. package/agent-assets/task-flows/_partials/calendar-acquire.google_calendar.md +20 -11
  218. package/agent-assets/task-flows/_partials/calendar-acquire.outlook_calendar.md +18 -9
  219. package/agent-assets/task-flows/_partials/capture-user-info.md +24 -0
  220. package/agent-assets/task-flows/_partials/confirm-subflow.md +68 -0
  221. package/agent-assets/task-flows/_partials/dm-intent.long-horizon.md +35 -0
  222. package/agent-assets/task-flows/_partials/dm-intent.project.md +391 -0
  223. package/agent-assets/task-flows/_partials/mail-acquire.gmail.md +20 -11
  224. package/agent-assets/task-flows/_partials/mail-acquire.outlook_mail.md +18 -9
  225. package/agent-assets/task-flows/_partials/notion-acquire.notion.md +26 -15
  226. package/agent-assets/task-flows/browser_task.md +84 -0
  227. package/agent-assets/task-flows/github.assigned.md +1 -1
  228. package/agent-assets/task-flows/github.pull_request.review_requested.md +2 -2
  229. package/agent-assets/task-flows/github.workflow_run.failed.md +2 -2
  230. package/agent-assets/task-flows/knowledge.import.md +15 -15
  231. package/agent-assets/task-flows/message.received.dm.md +20 -17
  232. package/agent-assets/task-flows/message.received.dm_first.md +11 -15
  233. package/agent-assets/task-flows/routine.custom.md +6 -4
  234. package/agent-assets/task-flows/routine.evening_review.md +46 -170
  235. package/agent-assets/task-flows/routine.fetch_window.md +19 -14
  236. package/agent-assets/task-flows/routine.hourly_check.md +27 -15
  237. package/agent-assets/task-flows/routine.hourly_check.triage.md +1 -1
  238. package/agent-assets/task-flows/routine.monthly_review.md +67 -25
  239. package/agent-assets/task-flows/routine.morning_routine_journal.md +135 -0
  240. package/agent-assets/task-flows/routine.morning_routine_today.md +673 -0
  241. package/agent-assets/task-flows/routine.research_cluster_update.md +35 -0
  242. package/agent-assets/task-flows/routine.research_dispatch.md +38 -0
  243. package/agent-assets/task-flows/routine.research_offer_dm.md +125 -0
  244. package/agent-assets/task-flows/routine.research_wiki_summary.md +53 -0
  245. package/agent-assets/task-flows/routine.roadmap_refresh.md +68 -23
  246. package/agent-assets/task-flows/routine.today_refresh.md +4 -4
  247. package/agent-assets/task-flows/routine.user_profile_sweep.md +19 -20
  248. package/agent-assets/task-flows/routine.weekly_review.md +370 -86
  249. package/agent-assets/task-flows/schedule.approaching.md +0 -1
  250. package/agent-assets/task-flows/scheduled.dm.md +13 -13
  251. package/agent-assets/task-flows/scheduled.task.md +9 -9
  252. package/agent-assets/task-flows/setup.initial.md +171 -251
  253. package/agent-assets/task-flows/setup.update.md +2 -2
  254. package/agent-assets/task-flows/wiki.ingest_url.md +1 -1
  255. package/agent-assets/templates/README.md +27 -20
  256. package/agent-assets/templates/_index.md +42 -26
  257. package/agent-assets/templates/_manifest.json +34 -99
  258. package/agent-assets/templates/{user → identity}/_index.md +1 -1
  259. package/agent-assets/templates/identity/expertise.md +9 -0
  260. package/agent-assets/templates/identity/goals.md +9 -0
  261. package/agent-assets/templates/identity/people.md +13 -0
  262. package/agent-assets/templates/identity/personal.md +9 -0
  263. package/agent-assets/templates/{user → identity}/profile.md +2 -2
  264. package/agent-assets/templates/identity/work.md +9 -0
  265. package/agent-assets/templates/{dossiers → knowledge/dossiers}/_index.md +2 -2
  266. package/agent-assets/templates/{projects → plans/projects}/_active.base +1 -1
  267. package/agent-assets/templates/policies/_index.md +21 -0
  268. package/agent-assets/templates/{rules → policies}/journal-export.md +1 -1
  269. package/agent-assets/templates/policies/journal-format.md +168 -0
  270. package/agent-assets/templates/{rules/policies → policies/management-captures}/_index.md +2 -2
  271. package/agent-assets/templates/{rules → policies}/management.md +3 -3
  272. package/agent-assets/templates/{rules → policies}/mcp.md +1 -1
  273. package/agent-assets/templates/{rules → policies}/redaction.md +1 -1
  274. package/agent-assets/templates/{routines → policies/routines}/_index.md +1 -1
  275. package/agent-assets/templates/{routines → policies/routines}/evening.md +2 -2
  276. package/agent-assets/templates/{routines → policies/routines}/hourly.md +1 -1
  277. package/agent-assets/templates/{routines → policies/routines}/monthly.md +2 -2
  278. package/bin/aitne.mjs +21 -5
  279. package/package.json +5 -4
  280. package/scripts/commands/doctor.mjs +63 -5
  281. package/scripts/commands/run-now.mjs +187 -0
  282. package/scripts/commands/verify.mjs +264 -0
  283. package/scripts/lib/ports.d.mts +27 -0
  284. package/scripts/lib/ports.mjs +36 -0
  285. package/scripts/lib/read-api-token.mjs +176 -0
  286. package/scripts/start.mjs +2 -1
  287. package/agent-assets/docs/features/lifestyle/travel-time.md +0 -52
  288. package/agent-assets/docs/features/routines/monthly-review.md +0 -65
  289. package/agent-assets/skills/management-task-modify/SKILL.md +0 -203
  290. package/agent-assets/skills/management-task-register/SKILL.md +0 -330
  291. package/agent-assets/skills/management-task-stop/SKILL.md +0 -166
  292. package/agent-assets/skills/receipts/SKILL.md +0 -134
  293. package/agent-assets/skills/travel/SKILL.md +0 -132
  294. package/agent-assets/skills/travel-time/SKILL.md +0 -158
  295. package/agent-assets/task-flows/routine.morning_routine.md +0 -322
  296. package/agent-assets/task-flows/routine.morning_routine_initial.md +0 -204
  297. package/agent-assets/templates/context-index.md +0 -42
  298. package/agent-assets/templates/rules/_index.md +0 -19
  299. package/agent-assets/templates/rules/journal-format.md +0 -61
  300. package/agent-assets/templates/user/expertise.md +0 -7
  301. package/agent-assets/templates/user/goals.md +0 -7
  302. package/agent-assets/templates/user/people.md +0 -7
  303. package/agent-assets/templates/user/personal.md +0 -7
  304. package/agent-assets/templates/user/work.md +0 -7
  305. /package/agent-assets/templates/{agent/journal.md → journal/agent.md} +0 -0
  306. /package/agent-assets/templates/{dossiers → knowledge/dossiers}/evening.md +0 -0
  307. /package/agent-assets/templates/{dossiers → knowledge/dossiers}/hourly.md +0 -0
  308. /package/agent-assets/templates/{dossiers → knowledge/dossiers}/monthly.md +0 -0
  309. /package/agent-assets/templates/{dossiers → knowledge/dossiers}/morning.md +0 -0
  310. /package/agent-assets/templates/{dossiers → knowledge/dossiers}/roadmap.md +0 -0
  311. /package/agent-assets/templates/{dossiers → knowledge/dossiers}/weekly.md +0 -0
  312. /package/agent-assets/templates/{projects → plans/projects}/_index.md +0 -0
  313. /package/agent-assets/templates/{roadmap.md → plans/roadmap.md} +0 -0
  314. /package/agent-assets/templates/{routines → policies/routines}/morning.md +0 -0
  315. /package/agent-assets/templates/{routines → policies/routines}/weekly.md +0 -0
  316. /package/agent-assets/templates/{agent → state}/profile-questions.md +0 -0
  317. /package/agent-assets/templates/{today.md → state/today.md} +0 -0
@@ -1,203 +0,0 @@
1
- ---
2
- name: management-task-modify
3
- description: Change cadence, intent, or output path on an existing managed task (`mt_<n>`) from a DM — "move daily Zoom check to 9am", "switch Gmail triage to Mondays". Owns PATCH on §B rows. SKIP for new registrations, stops, or app changes.
4
- when_to_use: User wants to keep a managed task running but adjust its cadence / intent / output path. SKIP for new registrations (`management-task-register`), stops (`management-task-stop`), or one-off run-now (`POST /api/managed-tasks/:id/run-now`).
5
- allowed-tools:
6
- - Bash(curl *)
7
- - Bash(jq *)
8
- - Read
9
- ---
10
-
11
- # Modify a Managed Task
12
-
13
- Changes the cadence, intent, or `Output path` on an existing
14
- `mt_<n>` row in place. The `mt_id` is preserved across modifications
15
- so historical references in `agent_actions` and
16
- `_activity/<source>.md` remain unambiguous (§10.2).
17
-
18
- ## When to use
19
-
20
- The user clearly references an existing recurring commitment and asks
21
- to change its **cadence**, **intent text**, or **output path**:
22
-
23
- - "Move the Zoom check to 9am instead of 10am"
24
- - "Switch the Gmail invoice triage to every Monday"
25
- - "Send Drive receipts to `finance/receipts/` instead of `personal/receipts/`"
26
- - "Rename the intent on `mt_42` to `Zoom recordings → meeting notes`"
27
-
28
- ## When NOT to use
29
-
30
- | Shape | Use instead |
31
- |---|---|
32
- | New recurring commitment | `management-task-register` |
33
- | User wants to stop / pause it | `management-task-stop` (no soft-pause; hard-delete + re-register if they want to resume) |
34
- | User wants to run once off-schedule | `POST /api/managed-tasks/<id>/run-now` |
35
- | User wants to change which **app** an existing task targets | `management-task-stop` then `management-task-register` (different connector ⇒ different commitment) |
36
- | User wants to change the SoT for a category | `PUT /api/sot-bindings` (A-section flow) |
37
-
38
- A change of `app` is a different commitment — stop and re-register
39
- rather than mutating the row, because the connector probe must run
40
- fresh and the entity-mirror associations may differ.
41
-
42
- ## Algorithm (mirror of design 21 §10.2)
43
-
44
- ### Step 1 — Locate the row
45
-
46
- Read the registry and find the row the user means. If the user named
47
- an `mt_<n>` directly, fetch by id; otherwise dedup by `(app, cadence,
48
- intent)` the same way `management-task-register` does.
49
-
50
- ```bash
51
- # By id when the user said "mt_42":
52
- curl -s "http://localhost:8321/api/managed-tasks/mt_42" | jq .item
53
-
54
- # By app fuzzy lookup:
55
- curl -s "http://localhost:8321/api/managed-tasks" | jq '.items[] | select(.app_normalized == "zoom")'
56
- ```
57
-
58
- GET-by-id wraps the row in `{item:<row>}`; the list returns
59
- `{items:[…], count:N}`.
60
-
61
- If no row matches, DM:
62
-
63
- > No managed task for `<app>` is registered. Want me to register one?
64
-
65
- If multiple rows could plausibly match, list them with id + cadence +
66
- intent and ask the user to pick. Stop until they reply.
67
-
68
- ### Step 2 — Diff the requested change
69
-
70
- Map the user's request to one or more of these fields:
71
-
72
- | User request | PATCH field | Notes |
73
- |---|---|---|
74
- | "9am instead of 10am" / "every Monday" | `cadence` + `recurrenceRule` (send both together) | Same `recurrenceRule` shape as `management-task-register` Step 5; only `daily`/`weekly`/`monthly` are representable |
75
- | "Rename intent" / "describe it as `<text>`" | `intent` | ≤ 200 chars, NFC, no `\n`, no `\|` |
76
- | "Send to `<dir>/`" | `output_path` | Validate against §9.3 (`<domain>/<type-plural>/`, trailing `/`, no `..`); send `null` to clear |
77
-
78
- If the request implies **app change**, stop and route the user to
79
- "stop + re-register" (Step 1 disambiguator above).
80
-
81
- ### Step 3 — Confirm with the user before mutating (Notify tier)
82
-
83
- PATCH on a managed task is **Notify tier** (§13.1). DM the user
84
- verbatim with the proposed change and wait for an explicit yes:
85
-
86
- > `mt_42` Zoom check — change cadence from `daily 10:00 (Asia/Tokyo)`
87
- > to `daily 09:00 (Asia/Tokyo)`?
88
-
89
- Only after the user confirms do you issue the PATCH. If they decline
90
- or amend, restart at Step 2 with the new shape.
91
-
92
- When the user's confirmation also implies a different output path
93
- ("…and write into `work/meetings/agendas/`"), include both fields in
94
- one PATCH so the audit row reflects the user's actual intent in a
95
- single transition.
96
-
97
- ### Step 4 — PATCH /api/managed-tasks/:id
98
-
99
- ```bash
100
- curl -sS -X PATCH http://localhost:8321/api/managed-tasks/mt_42 \
101
- -H 'Content-Type: application/json' \
102
- -d @- <<'JSON'
103
- {
104
- "cadence": "daily 09:00 (Asia/Tokyo)",
105
- "recurrenceRule": {
106
- "frequency": "daily",
107
- "time": "09:00",
108
- "timezone": "Asia/Tokyo"
109
- }
110
- }
111
- JSON
112
- ```
113
-
114
- | Field | When to send | Notes |
115
- |---|---|---|
116
- | `cadence` + `recurrenceRule` | Cadence change | Send both together so the rendered §B label matches the executable schedule. PATCH body must include at least one mutable field; an empty body returns `validation_error`. |
117
- | `intent` | Intent rename | ≤ 200 chars; trimmed + NFC at the boundary |
118
- | `output_path` | Output relocation | `<domain>/<type-plural>/` per §9.3; `null` clears it (back to "first run decides") |
119
-
120
- `app` / `app_normalized` / `last_run_at` / `last_result` /
121
- `consecutive_failures` are NOT mutable through this PATCH. Run-result
122
- writes go through the internal `/run-result` route used by
123
- `scheduled-managed-task`; app rename goes through the dedicated
124
- `POST /api/managed-tasks/:id/rename-app` (Step 1 disambiguator above
125
- already routes that case to "stop + re-register" for safety).
126
-
127
- The server-side transaction:
128
-
129
- a. UPDATEs `recurring_schedules` (if `recurrenceRule` changed),
130
- b. UPDATEs `managed_tasks.{intent,cadence,output_path,updated_at}`,
131
- c. re-renders `rules/management.md` from DB (locked + snapshotted),
132
- d. INSERTs `agent_actions` (`action_type='management_task.modified',
133
- detail={changed, from, to}`).
134
-
135
- The response is `{status:"updated", item:<ManagedTask>, render_status}`.
136
-
137
- The `mt_id`, `last_run_at`, `last_result`, and
138
- `consecutive_failures` are preserved across the PATCH — history is
139
- continuous (§10.2).
140
-
141
- A cadence change cancels any in-flight `agent_schedule` row tied to
142
- the old cron; the new cron takes effect from the next eligible slot.
143
- Do not separately DELETE `agent_schedule` items — the daemon owns
144
- that.
145
-
146
- **Output-path relocation does NOT move existing entity files.** Past
147
- entities stay where they were written. If the user wants
148
- re-organization, stop the task, move the entity files manually (or
149
- ask the user to), and re-register.
150
-
151
- ### Step 5 — Confirm to user
152
-
153
- One DM, persona-tone (`notify` skill discipline applies). Read the
154
- resolved fields from the PATCH response — do NOT echo what you sent
155
- in case the daemon normalized something:
156
-
157
- > Updated `mt_42` Zoom check — now daily 09:00 JST. Next run 2026-12-05 09:00 JST.
158
-
159
- If the PATCH only changed `intent` or `output_path` (no cadence
160
- shift), do not announce a "next run" line — the next firing is
161
- unchanged.
162
-
163
- ## Error envelope
164
-
165
- | HTTP | `error` | What to do |
166
- |---|---|---|
167
- | 400 | `invalid_id` | The `:id` segment didn't match `^mt_[1-9]\d*$`; the user typed the id wrong — ask them to repeat |
168
- | 400 | `validation_error` | Body has Zod `details`; pin the failing path (e.g. `recurrenceRule.daysOfWeek` not allowed for `daily`) and ask for a fix |
169
- | 404 | `not_found` | DM "I don't have an `mt_<id>` to modify"; offer to register one |
170
- | 5xx | `internal_error` | Surface `body.message` if present; advise `aitne logs` |
171
-
172
- The daemon does not currently emit `cron_too_tight` (the recurrence
173
- schema only accepts daily/weekly/monthly — sub-daily is impossible),
174
- nor `cadence_partial` (the recurrence rule is one structured field, so
175
- there is no partial-cadence shape to reject). If a future schema gain
176
- adds them, surface them verbatim.
177
-
178
- ## What this skill does NOT do
179
-
180
- - Does NOT mutate `app` — that is a different commitment, stop +
181
- re-register.
182
- - Does NOT pause / disable a task — there is no soft-pause; stop +
183
- re-register if the user wants a hiatus.
184
- - Does NOT touch §A (SoT bindings) or §C (Active Policies).
185
- - Does NOT PUT `rules/management.md` directly. The daemon owns the
186
- file write.
187
- - Does NOT migrate entity files when `output_path` changes; only
188
- future runs honor the new path.
189
- - Does NOT auto-confirm "this looks right" — Notify-tier means a real
190
- user-facing confirmation. Output language: follow
191
- `<output_language_policy>`.
192
-
193
- ## API summary
194
-
195
- | Verb + path | Used in |
196
- |---|---|
197
- | `GET /api/managed-tasks` | Step 1 (lookup by app/cadence) |
198
- | `GET /api/managed-tasks/:id` | Step 1 (lookup by id) |
199
- | `PATCH /api/managed-tasks/:id` | Step 4 (Notify-tier) |
200
- | `POST /api/notify` | Step 5 (user-facing confirmation) |
201
-
202
- The PATCH writes one `agent_actions` row and snapshots the file —
203
- do NOT post a separate audit event yourself.
@@ -1,330 +0,0 @@
1
- ---
2
- name: management-task-register
3
- description: Register a new recurring agent fetch against a third-party app from a DM — "check Zoom recordings daily at 10am", "check Gmail daily for invoices". Owns INSERT on §B "Managed tasks" rows. SKIP for one-off reminders, modify, stop.
4
- when_to_use: User asks to start a recurring external-app fetch / check / sync (Zoom, Gmail, Drive, Notion, custom MCP). SKIP for one-off reminders (`schedule`), durable rules without an external app (`management-policy`), or pure DM cadence (`schedule` recurring).
5
- allowed-tools:
6
- - Bash(curl *)
7
- - Bash(jq *)
8
- - Read
9
- ---
10
-
11
- # Register a Managed Task
12
-
13
- A **managed task** (`mt_<n>`) is a user-delegated commitment: the agent
14
- runs a recurring fetch against a specific App at a user-specified
15
- Cadence and writes the resulting entities into a primary L2 directory
16
- (the `Output path`). Each row lives in `rules/management.md` §B. The
17
- authoritative store is the `managed_tasks` SQLite table; the file is
18
- re-rendered from the table after every mutation, so do **not** PUT the
19
- file yourself — every legal mutation goes through
20
- `/api/managed-tasks` and the daemon owns the file write.
21
-
22
- ## When to use
23
-
24
- The user's DM clearly asks for a **recurring fetch / check / sync
25
- against a third-party app** with a cadence:
26
-
27
- - "Check Zoom recordings every day at 10am"
28
- - "Check Gmail daily and triage invoices into receipts"
29
- - "Every Monday at 9 pull new Drive PDFs into receipts"
30
- - "Check Notion 'Reading' DB every evening and surface unread"
31
-
32
- ## When NOT to use
33
-
34
- | Shape | Use instead |
35
- |---|---|
36
- | One-off "remind me at 3pm to call the bank" | `schedule` (`/api/schedule/dm`) |
37
- | Recurring DM with no external-app fetch ("ping me every Monday at 9") | `schedule` recurring-schedules |
38
- | "From now on, when X happens, do Y" passive rule with no cadence | `management-policy` |
39
- | Tone / style / single fact about the user | `user-profile` |
40
- | Source-of-Truth declaration ("notes live in Obsidian") | A-section binding via `PUT /api/sot-bindings` (separate flow) |
41
- | Modify cadence / output of an existing `mt_<n>` | `management-task-modify` |
42
- | Stop an existing `mt_<n>` | `management-task-stop` |
43
- | Run an existing `mt_<n>` once, off-schedule | `POST /api/managed-tasks/<id>/run-now` |
44
-
45
- If the user already has `mt_<n>` for the same app+cadence, this skill
46
- **refuses** with a DM pointing at the existing row — that is the dedup
47
- contract (FR-2). Do not register a duplicate.
48
-
49
- ## Algorithm (mirror of design 21 §10.1)
50
-
51
- Run the steps in order. Any step's failure DMs the user with the
52
- verbatim reason and ends the flow — never skip, never silently retry,
53
- never hardcode a tool name (FR-4 / ADR §8.4).
54
-
55
- ### Step 1 — Read current state
56
-
57
- ```bash
58
- curl -s "http://localhost:8321/api/context/rules/management" | jq -r .content
59
- ```
60
-
61
- Extract §B (Managed tasks) and §A (Source-of-Truth bindings). §A tells
62
- you which app already owns a category (e.g. `tasks → notion`); a
63
- duplicate-cadence registration against an unrelated app for the same
64
- category is a smell and should be confirmed before registering.
65
-
66
- ### Step 2 — Semantic dedup (LLM judgment)
67
-
68
- For each existing §B row, compare the requested
69
- `(app_normalized, cadence_semantic, intent_semantic)` against the row.
70
- Treat a row as a **high-confidence match** when:
71
-
72
- - `app_normalized` matches case-insensitively (e.g. `zoom` ≡ `Zoom`),
73
- AND
74
- - the cadence resolves to the same structured recurrence, AND
75
- - the intent describes the same fetch shape (e.g. "recordings → meeting
76
- entity" is the same as "new recordings → meeting entity").
77
-
78
- On a match, DM the user verbatim with the existing row's id, cadence
79
- and last result, and stop:
80
-
81
- > Already managed as `mt_42` (daily 10:00 — last run ok 3 new). Modify
82
- > or stop it via DM.
83
-
84
- If multiple plausible matches exist, ask the user which one to update
85
- and end the flow (the user's reply triggers `management-task-modify`).
86
-
87
- If §B already holds the cap (default 100, configurable
88
- `managementMaxActiveTasks`), refuse with a DM pointing at the cap; the
89
- user must stop something first.
90
-
91
- ### Step 3 — Tool selection (LLM judgment, in-session)
92
-
93
- Enumerate the tools available to this session (`mcp__*`, native
94
- backend connectors, custom MCP servers the user installed). Ask
95
- yourself: *"Which of these, if any, lets me read the user-typed app
96
- label?"*
97
-
98
- - **Zero plausible** → DM "I don't see a connected tool for `<app>` on
99
- this backend. Connect one and ask again." Stop.
100
- - **Multiple plausible** → DM the user with the candidates verbatim
101
- and ask which one to use. Stop. (The user's reply re-enters this
102
- flow with the chosen tool as a hint.)
103
- - **One plausible** → continue.
104
-
105
- NEVER hardcode tool names or pattern-match against a specific
106
- namespace prefix. The user may have installed a custom MCP with
107
- non-standard names — you read the tool description and pick by
108
- **capability**, not by name.
109
-
110
- ### Step 4 — Read-only probe
111
-
112
- Invoke the chosen tool with the **smallest** read-only payload that
113
- proves connectivity and authorization (e.g. list the first page with
114
- `limit: 1`, fetch the user's profile / "me" endpoint, search for an
115
- empty string). Do NOT mutate state.
116
-
117
- On any error — auth failure, network error, schema error,
118
- out-of-quota — DM the verbatim error message with one line of context
119
- and stop:
120
-
121
- > Couldn't reach `<app>`: `<verbatim error from tool>`.
122
-
123
- The probe failure must surface the connector's own error string, not a
124
- paraphrase. The user is the one who can fix auth / quota / install.
125
-
126
- ### Step 4a — Decide `Output path` (LLM judgment)
127
-
128
- From the probe sample, infer the primary L2 directory the recurring
129
- fetch will write into. Bias toward existing matches:
130
-
131
- 1. If the entity-mirror already holds entities with `sources.<app>.*`
132
- under one `<domain>/<type-plural>/`, reuse that path. Probe with:
133
- ```bash
134
- curl -s "http://localhost:8321/api/entities?source=<app>&limit=5" | jq .
135
- ```
136
- The response is `{tier:1, mode:"by_source_key", items:[…]}`; each
137
- item's `path` (`<domain>/<type-plural>/<slug>.md`) reveals where
138
- that source already lives. If 1+ rows agree on `<domain>/<type>`,
139
- that path wins.
140
- 2. Otherwise, pick the `(domain, type)` pair whose semantic prior best
141
- fits the data shape. Reference table:
142
-
143
- | Probe sample shape | Likely `<domain>/<type-plural>/` |
144
- |---|---|
145
- | Recording with attendees + duration | `work/meetings/` |
146
- | PDF / image with monetary amount | `finance/receipts/` |
147
- | Task / ticket / issue | one of the project domains' `projects/` (rare — typically the Tasks SoT mirror handles this; only register a managed task if the SoT is *another* app) |
148
- | Travel itinerary / booking | `travel/trips/` |
149
- | Long-form note / article | `<domain>/notes/` (pick by content topic) |
150
- | Book metadata / progress | `learning/books/` |
151
- 3. If the data shape is genuinely ambiguous (e.g. the probe returned
152
- zero rows), set `output_path: null` — the first scheduled run will
153
- populate it from real data.
154
-
155
- **Path validation invariant** (§9.3, §13.3):
156
-
157
- - Format: `<domain>/<type-plural>/` — leading `context/` is implicit
158
- and must NOT be included; the trailing `/` is mandatory.
159
- - `<domain>` ∈ `{work, travel, finance, personal, health, learning}`.
160
- - `<type-plural>` ∈ `{meetings, trips, receipts, projects, books, notes}`.
161
- - No `..` segments. No absolute paths.
162
-
163
- The daemon CHECKs the constraint at INSERT/UPDATE time and rejects with
164
- a 422 — surface that error verbatim if it fires. Pre-validate to avoid
165
- the round-trip when you can.
166
-
167
- ### Step 5 — Resolve cadence to a `recurrenceRule`
168
-
169
- Translate the user's natural-language cadence into:
170
- - a free-text `cadence` string (what gets rendered in §B), AND
171
- - a structured `recurrenceRule` (what the scheduler executes).
172
-
173
- The daemon's recurrence engine accepts only `daily` / `weekly` /
174
- `monthly`. Sub-daily ("every hour", "every 5 minutes") is **not
175
- representable** — refuse those with a DM and ask for a daily-or-coarser
176
- cadence. Times are `HH:MM` 24-hour local; timezone is IANA (auto-fills
177
- from daemon config when omitted, but it's safer to pass it explicitly
178
- so a roaming laptop doesn't surprise the user).
179
-
180
- | User said | `cadence` | `recurrenceRule` |
181
- |---|---|---|
182
- | every day at 10am (Asia/Tokyo) | `daily 10:00 (Asia/Tokyo)` | `{frequency:"daily", time:"10:00", timezone:"Asia/Tokyo"}` |
183
- | every Monday 9am | `weekly Mon 09:00` | `{frequency:"weekly", time:"09:00", timezone:<user tz>, daysOfWeek:[1]}` |
184
- | every weekday at 8am | `weekdays 08:00` | `{frequency:"weekly", time:"08:00", timezone:<user tz>, daysOfWeek:[1,2,3,4,5]}` |
185
- | 1st of every month at noon | `monthly day 1 12:00` | `{frequency:"monthly", time:"12:00", timezone:<user tz>, daysOfMonth:[1]}` |
186
- | every hour | _refuse_ | _refuse_ |
187
- | every 5 minutes | _refuse_ | _refuse_ |
188
-
189
- `daysOfWeek` is `0=Sun..6=Sat`; `daysOfMonth` is `1..31` (29-31 clamp
190
- to last day of short months). `daysOfWeek` is forbidden on `daily` and
191
- `monthly`; `daysOfMonth` is forbidden on `daily` and `weekly` — the
192
- daemon's Zod refinements reject mismatches with a `validation_error`.
193
-
194
- For sub-daily requests, refuse with a DM:
195
-
196
- > The agent's recurrence engine only supports daily, weekly, or monthly
197
- > cadences. `every hour` is too tight — pick `daily` or coarser.
198
-
199
- ### Step 6 — POST /api/managed-tasks
200
-
201
- ```bash
202
- curl -sS -X POST http://localhost:8321/api/managed-tasks \
203
- -H 'Content-Type: application/json' \
204
- -H 'Idempotency-Key: <opaque uuid for this DM>' \
205
- -d @- <<'JSON'
206
- {
207
- "intent": "Zoom recordings → meeting entity",
208
- "app": "zoom",
209
- "cadence": "daily 10:00 (Asia/Tokyo)",
210
- "recurrenceRule": {
211
- "frequency": "daily",
212
- "time": "10:00",
213
- "timezone": "Asia/Tokyo"
214
- },
215
- "output_path": "work/meetings/"
216
- }
217
- JSON
218
- ```
219
-
220
- | Field | Required | Notes |
221
- |---|---|---|
222
- | `intent` | yes | ≤ 200 chars, NFC, no newlines, no pipe chars |
223
- | `app` | yes | ≤ 64 chars, NFC, no newlines, no pipe chars; user-typed label preserved verbatim (case + non-ASCII OK) |
224
- | `cadence` | yes | Human-readable; rendered in §B (≤ 200 chars) |
225
- | `recurrenceRule` | yes | `{frequency:"daily"\|"weekly"\|"monthly", time:"HH:MM", timezone?:<IANA>, daysOfWeek?:[0..6], daysOfMonth?:[1..31]}` — see Step 5 table |
226
- | `output_path` | no | `<domain>/<type-plural>/` per §9.3, ending `/`; omit while undecided (the first scheduled run back-fills it) |
227
-
228
- The response is `{status:"created", item:<ManagedTask>, render_status:"ok"|"lock_contended:..."}`.
229
- On an idempotent replay (same `Idempotency-Key` within 24 h, the row
230
- still exists) you get `{status:"idempotent_replay", item:<ManagedTask>}`
231
- with HTTP 200 — treat that as success, not a duplicate registration.
232
-
233
- **Idempotency-Key.** Generate a stable key per DM (e.g. SHA-256 of the
234
- inbound message id + app). Concurrent retries collapse to the same
235
- `mt_<n>`; a different key with the same `app+cadence` collides at the
236
- `(app_normalized, cadence)` uniqueness check and the second POST returns
237
- `409 conflict` with the existing `mt_id` — DM the user pointing at it
238
- instead of registering twice.
239
-
240
- **Server-side transaction (atomic).** The daemon allocates the next
241
- `mt_<n>` from `managed_task_seq`, INSERTs `recurring_schedules` and
242
- `managed_tasks` linked by FK, and writes one `agent_actions` row
243
- (`action_type='management_task.created'`). On any DB failure the
244
- transaction rolls back and you get a 5xx — surface the body verbatim.
245
-
246
- **File render.** Post-transaction the daemon re-renders
247
- `rules/management.md` from DB (locked, snapshotted into
248
- `md_file_snapshots`). You do NOT touch the file.
249
-
250
- ### Step 7 — Confirm to user
251
-
252
- DM the user once with the assigned id (`item.id` from the POST
253
- response), the resolved output path (`item.output_path`), and the
254
- human cadence label (`item.cadence`). The next firing time is owned by
255
- the scheduler — phrase the confirmation around the cadence rather than
256
- fabricating a clock time.
257
-
258
- > Registered as `mt_43` (Zoom · daily 10:00 JST). Output → `work/meetings/`. Starts at the next 10:00 JST slot.
259
-
260
- Persona / language rules are in `notify` — the message itself follows
261
- the awareness gate and no-ceremony rules. Don't enumerate the steps
262
- ("did probe, did INSERT, did re-render"); the daemon already audited
263
- them.
264
-
265
- ## Validation cheatsheet (§13.3)
266
-
267
- | Field | Rule | Reject example |
268
- |---|---|---|
269
- | `app` | trimmed; NFC; ≤ 64 chars; no `\n`; no `\|` | `\|gmail` |
270
- | `intent` | trimmed; NFC; ≤ 200 chars; no `\n`; no `\|` | `<5×40 chars>` |
271
- | `cadence` | free text, ≤ 200 chars | _any non-empty string_ |
272
- | `recurrenceRule.frequency` | `daily` \| `weekly` \| `monthly` | `hourly`, `every-5-min` |
273
- | `recurrenceRule.time` | `HH:MM` zero-padded | `9:00`, `25:00` |
274
- | `recurrenceRule.timezone` | IANA zone string (auto-fills from daemon when omitted) | `EST+9` |
275
- | `recurrenceRule.daysOfWeek` | required for `weekly`; forbidden otherwise; ints `0..6` | `[7]`, `[]` |
276
- | `recurrenceRule.daysOfMonth` | required for `monthly`; forbidden otherwise; ints `1..31` | `[0]`, `[32]` |
277
- | `output_path` | `<domain>/<type-plural>/`; no `..`; trailing `/` | `work/meetings`, `../foo/`, `random/dir/` |
278
- | `mt_id` | server-allocated; never craft client-side | n/a |
279
-
280
- The daemon also enforces these — but pre-validating saves the user one
281
- round-trip of error chatter.
282
-
283
- ## Error envelope
284
-
285
- | HTTP | `error` | What to do |
286
- |---|---|---|
287
- | 400 | `validation_error` | Body has Zod `details`; pick the offending field's message and ask the user to clarify. The Zod issue path tells you whether `recurrenceRule.*`, `app`, `output_path`, etc. is the culprit. |
288
- | 409 | `duplicate` | Body includes `item` (the existing row); DM "Already managed as `<item.id>`" and stop |
289
- | 409 | `cap_reached` | Surface `body.message` (cap value); user must stop something first |
290
- | 5xx | `internal_error` | DM "Couldn't register; daemon error. Try again, or check `aitne logs`." |
291
-
292
- `body.message` (when present) is intended for the user — preserve it
293
- verbatim. The daemon does not currently emit `cron_too_tight` because
294
- the recurrence schema only accepts daily/weekly/monthly — a sub-daily
295
- ask never reaches POST; refuse it client-side per Step 5.
296
-
297
- ## What this skill does NOT do
298
-
299
- - Does NOT hardcode connector tool names — all tool selection is
300
- LLM-judged (FR-4).
301
- - Does NOT PUT `rules/management.md` directly — the daemon owns that
302
- write (FR-12). The only legal write is `POST /api/managed-tasks`.
303
- - Does NOT INSERT `recurring_schedules` directly. POST
304
- `/api/managed-tasks` is the chokepoint that keeps the FK pair
305
- consistent.
306
- - Does NOT touch §A (SoT bindings). Use `PUT /api/sot-bindings` for
307
- that (separate "sot" flow).
308
- - Does NOT touch §C (Active Policies stub). Owned by
309
- `management-policy`.
310
- - Does NOT silently re-register on retry. Use `Idempotency-Key`
311
- per-DM; conflicts surface the existing `mt_id`.
312
- - Does NOT register a task that has no probe-passing connector. Probe
313
- failure is a hard stop — never "register optimistically and hope".
314
- - Does NOT proceed when the vault is in degraded mode
315
- (`Dispatcher.isAutonomousAllowed()` already filters). Trust that
316
- upstream.
317
-
318
- ## API summary
319
-
320
- | Verb + path | Used in |
321
- |---|---|
322
- | `GET /api/context/rules/management` | Step 1 (read §A + §B) |
323
- | `GET /api/entities?source=<app>` | Step 4a (output-path bias) |
324
- | `GET /api/managed-tasks` | Optional — alternative to parsing the file |
325
- | `POST /api/managed-tasks` | Step 6 (Notify-tier; the daemon DMs confirmation; no Approve gate) |
326
- | `POST /api/notify` | Step 7 (your own DM-to-user reply) — uses the `notify` skill's discipline |
327
-
328
- Every state-changing call is recorded in `agent_actions` and the file
329
- is snapshotted into `md_file_snapshots` — do NOT post a separate audit
330
- event yourself.