@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,9 +1,8 @@
1
1
  ---
2
2
  name: external-services
3
- description: Load when an external-services surface is in scope (Google Calendar / Obsidian / GitHub / Skills CRUD / scheduling) and Google Calendar is in native mode bound to Gemini (`nativeBackend === "gemini"`). Calendar runs through the in-session Calendar connector your Gemini harness exposes directly; the daemon does not proxy Calendar. Other surfaces (Apple/Outlook Calendar, Obsidian, GitHub, scheduling, Skills CRUD) keep their direct routes.
3
+ description: Load when an external-services surface is in scope and Google Calendar is in native mode bound to Gemini (`nativeBackend === "gemini"`). Calendar runs via the Gemini Calendar connector; daemon does not proxy. Obsidian, GitHub, scheduling, Skills CRUD keep direct routes.
4
4
  allowed-tools:
5
5
  - Bash(curl *)
6
- - Bash(jq *)
7
6
  - Read
8
7
  ---
9
8
 
@@ -34,7 +33,7 @@ and the `<integration-routing-table>` block in the session preamble.
34
33
 
35
34
  ## Source of Truth (READ FIRST)
36
35
 
37
- Same files as the direct-mode body — `rules/management.md` →
36
+ Same files as the direct-mode body — `policies/management.md` →
38
37
  `## Source of Truth` and `~/.personal-agent/integrations.md` →
39
38
  `## Note Sources`. If Schedule != Google Calendar, route through the
40
39
  provider-specific direct route (`/api/apple-calendar/*` or
@@ -125,7 +124,7 @@ materialised event to `/api/observations` per the section below.
125
124
  ## Apple Calendar (iCloud CalDAV) — direct, unchanged
126
125
 
127
126
  Use `/api/apple-calendar/*` per the direct-mode body if
128
- `rules/management.md` Schedule = Apple Calendar.
127
+ `policies/management.md` Schedule = Apple Calendar.
129
128
  <!-- /service:apple-calendar -->
130
129
 
131
130
  ---
@@ -171,10 +170,10 @@ curl -s -X DELETE http://localhost:8321/api/obsidian/notes/Projects/Old
171
170
 
172
171
  ```bash
173
172
  curl -s http://localhost:8321/api/github/repos
174
- curl -s "http://localhost:8321/api/github/pulls?state=open"
173
+ curl -s "http://localhost:8321/api/github/pulls?owner=user&repo=repo&state=open"
175
174
  curl -s -X POST http://localhost:8321/api/github/pulls/comment \
176
175
  -H 'Content-Type: application/json' \
177
- -d '{"owner": "user", "repo": "repo", "pullNumber": 42, "body": "LGTM"}'
176
+ -d '{"owner": "user", "repo": "repo", "pull_number": 42, "comment": "LGTM"}'
178
177
  ```
179
178
  <!-- /service:github -->
180
179
 
@@ -0,0 +1,97 @@
1
+ ---
2
+ kind: reference
3
+ name: calendar-apple
4
+ description: Apple Calendar (iCloud CalDAV) reference — list/get/create/update/delete with recurring-instance gotchas, app-specific-password setup probe, no proactive notifications. Stripped when `apple_calendar` is not configured.
5
+ ---
6
+
7
+ <!-- service:apple-calendar -->
8
+ ## Apple Calendar (iCloud CalDAV)
9
+
10
+ Use this section **only when `policies/management.md` Schedule = Apple Calendar**. The provider-routing table at the top of this skill is non-negotiable.
11
+
12
+ The route shape mirrors `/api/calendar/*` so prose patterns transfer: list → get → patch / create / delete. Differences are flagged below.
13
+
14
+ ### Probe configuration before first use
15
+ ```bash
16
+ curl -s http://localhost:8321/api/apple-calendar/status
17
+ # → { "configured": bool, "available": bool }
18
+ ```
19
+ - `configured: false` → user has not entered Apple ID + app-specific password yet. Tell the user to open the dashboard's Apple Calendar card (Connections page) and paste a password from `appleid.apple.com` → Sign-In and Security → App-Specific Passwords. **Do not try to read or write events** until `available: true`.
20
+ - `configured: true, available: false` → credentials are stored but iCloud rejected the last connection. Surface verbatim; common cause is the user revoked the app-specific password.
21
+
22
+ ### List events
23
+ ```bash
24
+ curl -s "http://localhost:8321/api/apple-calendar/events?date=today&days=3"
25
+ ```
26
+ Same query params as Google: `date` (`YYYY-MM-DD` or `today`), `days` (max 90). Returns `{ events: [...] }` with the same JSON shape used by the Google route — `id`, `summary`, `start`, `end`, `location`, `description`, `allDay`, `status`, plus two Apple-specific fields:
27
+ - `recurring` (bool) — true for any event in a recurring series.
28
+ - `recurrenceId` (string|null) — populated for an expanded instance of a series.
29
+
30
+ For a recurring instance the `id` is `<UID>__<RECURRENCE-ID>` so you can address a specific occurrence.
31
+
32
+ **Timezones**: dateTime values are emitted in UTC (`Z` suffix). Convert to the user's local timezone before showing them.
33
+
34
+ ### Get event detail
35
+ ```bash
36
+ curl -s "http://localhost:8321/api/apple-calendar/events/<id>"
37
+ ```
38
+ Always GET before PATCH so you see the current summary/start/end.
39
+
40
+ ### Create event (write — Autonomous)
41
+ ```bash
42
+ curl -s -X POST http://localhost:8321/api/apple-calendar/events \
43
+ -H 'Content-Type: application/json' \
44
+ -d '{"summary": "Team meeting", "start": "2026-04-26T14:00:00+09:00", "end": "2026-04-26T15:00:00+09:00"}'
45
+ ```
46
+ Optional: `description`, `location`. **[Apple only]** `attendees`, `reminders`, `recurrence`, `visibility` from the Google shape are **rejected** — the Apple schema is `.strict()`, so including any of them fails the whole request with `400 validation_error` and no event is created (the same applies to PATCH). iCloud invitations and reminder defaults belong to the user's Apple ID and the agent should not author them. If a user asks for those, tell them and stop — do not include the fields in the request.
47
+
48
+ ### Update event (write — Autonomous)
49
+ ```bash
50
+ curl -s -X PATCH http://localhost:8321/api/apple-calendar/events/<id> \
51
+ -H 'Content-Type: application/json' \
52
+ -d '{"start": "2026-04-26T15:00:00+09:00", "end": "2026-04-26T16:00:00+09:00"}'
53
+ ```
54
+
55
+ **[Apple only] Recurring-event editing semantics — read before writing**
56
+ - A composite id (one whose suffix matches `__YYYY-MM-DD…`) addresses **one occurrence** of a series. PATCH/DELETE on it returns `501 recurring_instance_unsupported`. To move a single occurrence the user must edit it from Calendar.app.
57
+ - A bare id whose GET returned `recurring: true` is the **series master**. PATCH on the master shifts the **entire series** (every future occurrence moves), and DELETE removes the entire series. Confirm with the user that they intend a series-level edit before issuing the call — agents have historically read "PATCH this event's start" as a single-instance reschedule, which is wrong here.
58
+ - A bare id with `recurring: false` is a normal one-off event — PATCH/DELETE behave as usual.
59
+ - `summary`, `start`, and `end` may be updated independently. Toggling all-day-ness (`YYYY-MM-DD` ↔ `…T…Z`) requires providing **both** `start` and `end` in the same PATCH; the codec rejects partial all-day toggles with `400 validation_error`.
60
+ - Time strings must include a TZ offset (`Z` or `±HH:MM`); naked ISO without offset returns `400 validation_error` — do not interpret a user-stated time as local without an explicit offset.
61
+
62
+ ### Delete event (write — Autonomous)
63
+ ```bash
64
+ curl -s -X DELETE http://localhost:8321/api/apple-calendar/events/<id>
65
+ ```
66
+ Same recurring semantics as PATCH (see the rules block above).
67
+
68
+ ### List calendars
69
+ ```bash
70
+ curl -s http://localhost:8321/api/apple-calendar/calendars
71
+ # → { "calendars": [{ id, summary, description, primary }, ...] }
72
+ ```
73
+ The `id` is an opaque CalDAV URL. The user's primary calendar is marked `primary: true`. To change which calendar create/list reads, see the dashboard Apple Calendar card.
74
+
75
+ ### Free/busy query
76
+ ```bash
77
+ curl -s -X POST http://localhost:8321/api/apple-calendar/freebusy \
78
+ -H 'Content-Type: application/json' \
79
+ -d '{"timeMin": "2026-04-26T09:00:00Z", "timeMax": "2026-04-26T18:00:00Z"}'
80
+ ```
81
+ **[Apple only]** Free-busy is derived from `listEvents` — events with `status: "cancelled"` are excluded. `calendarIds` is ignored (the primary calendar is the only target).
82
+
83
+ ### Apple Calendar error envelope
84
+
85
+ | HTTP | `error` | What it means / what to do |
86
+ |---|---|---|
87
+ | 400 | `validation_error` | Bad request shape. Fix and retry. |
88
+ | 401 | `auth_failed` | iCloud rejected the credentials. Tell the user to refresh the app-specific password in the dashboard. |
89
+ | 404 | `not_found` | Event id unknown or already deleted. Re-list before retrying. |
90
+ | 501 | `recurring_instance_unsupported` | The id targets a single occurrence of a recurring series — see the PATCH/DELETE notes above. |
91
+ | 502 | `apple_calendar_error` | Upstream iCloud / CalDAV error. `message` carries the wire text. |
92
+ | 503 | `apple_calendar_not_configured` | Credentials missing or last connection failed. Run the status probe above. |
93
+
94
+ ### Known gap: no proactive notifications
95
+
96
+ The hourly polling pivot (`schedule.approaching` events, observation deltas) only fires for Google Calendar today. With Apple Calendar selected, on-demand DM queries work but the agent will not proactively warn about an imminent event — the user's own iOS / macOS Calendar.app notifications fill that gap.
97
+ <!-- /service:apple-calendar -->
@@ -0,0 +1,72 @@
1
+ ---
2
+ kind: reference
3
+ name: calendar-google
4
+ description: Google Calendar direct-mode reference — list/get/create/update/delete events, list calendars, free-busy. ATTENDEES PATCH replaces the whole list. Stripped by the integration-mode filter when `google_calendar !== "direct"`.
5
+ ---
6
+
7
+ <!-- service:calendar -->
8
+ ## Calendar
9
+
10
+ Google Calendar proxy. Operates on the user's primary calendar (configurable via `calendarId` param).
11
+
12
+ **Timezone rule**: Always include a TZ offset in `start`/`end` dateTime values (e.g. `-04:00`). All-day events use `YYYY-MM-DD` (no TZ needed).
13
+
14
+ **Event status**: GET returns deleted events with `status: "cancelled"` (200, not 404). Always check `status` before acting. The list endpoint automatically excludes cancelled events.
15
+
16
+ ### List events
17
+ ```bash
18
+ curl -s "http://localhost:8321/api/calendar/events?date=today&days=3"
19
+ ```
20
+
21
+ ### Get event detail
22
+ ```bash
23
+ curl -s "http://localhost:8321/api/calendar/events/abc123eventid"
24
+ ```
25
+ **Always GET before PATCH** to see current state and attendees.
26
+
27
+ ### Create event (write — Autonomous)
28
+ ```bash
29
+ curl -s -X POST "http://localhost:8321/api/calendar/events" \
30
+ -H 'Content-Type: application/json' \
31
+ -d '{"summary": "Team meeting", "start": "2026-04-02T14:00:00-04:00", "end": "2026-04-02T15:00:00-04:00"}'
32
+ ```
33
+ Optional: `description`, `location`, `reminders`, `recurrence`, `attendees`, `visibility`. All-day: `YYYY-MM-DD`. Attendees: add `?sendUpdates=all` to notify. RRULE: `RRULE:FREQ=WEEKLY;BYDAY=MO,WE,FR`.
34
+
35
+ ### Update event (write — Autonomous; commonly on the starter denylist)
36
+ ```bash
37
+ curl -s -X PATCH "http://localhost:8321/api/calendar/events/abc123" \
38
+ -H 'Content-Type: application/json' \
39
+ -d '{"start": "2026-04-02T15:00:00-04:00", "end": "2026-04-02T16:00:00-04:00"}'
40
+ ```
41
+ For recurring events, use the instance ID to update a single occurrence — never PATCH the master.
42
+
43
+ **ATTENDEES WARNING**: PATCH with `attendees` **replaces the entire list** — it does NOT append. To add one attendee: (1) GET, (2) copy existing, (3) add new, (4) PATCH full list.
44
+
45
+ ### Delete event (write — Autonomous; default starter denylist denies it)
46
+ ```bash
47
+ curl -s -X DELETE "http://localhost:8321/api/calendar/events/abc123"
48
+ ```
49
+ Add `?sendUpdates=all` to notify attendees. Do NOT PATCH a cancelled event.
50
+
51
+ ### List calendars
52
+ ```bash
53
+ curl -s http://localhost:8321/api/calendar/calendars
54
+ ```
55
+
56
+ ### Free/busy query
57
+ ```bash
58
+ curl -s -X POST http://localhost:8321/api/calendar/freebusy \
59
+ -H 'Content-Type: application/json' \
60
+ -d '{"timeMin": "2026-04-11T09:00:00-04:00", "timeMax": "2026-04-11T18:00:00-04:00"}'
61
+ ```
62
+
63
+ ### Calendar error envelope (direct mode)
64
+
65
+ | HTTP | `error` | What it means / what to do |
66
+ |---|---|---|
67
+ | 400 | `validation_error` | Bad request shape (e.g. missing `start`/`end`, malformed RRULE). Fix and retry. |
68
+ | 404 | `not_found` | Event id unknown or already deleted. Re-list before retrying. |
69
+ | 410 | `integration_delegated` | Calendar flipped to delegated mode mid-session. This skill body is direct-only — re-read `integrations.md` and use `POST /api/integrations/google_calendar/exec` (cross-backend task mode) or your session backend's native Calendar MCP (the same-backend variant) instead. |
70
+ | 502 | `calendar_error` | Upstream Google API error — `message` carries the API's text. Surface verbatim; do not retry unless clearly transient. |
71
+ | 503 | `calendar_not_configured` | Direct OAuth credentials are missing or the user has disabled Calendar in settings. Tell the user and stop. |
72
+ <!-- /service:calendar -->
@@ -0,0 +1,36 @@
1
+ ---
2
+ kind: reference
3
+ name: calendar-outlook
4
+ description: Outlook Calendar reference (Microsoft Graph) — read-only on-demand. Same query shape as Google. Stripped when `outlook_calendar` is not configured.
5
+ ---
6
+
7
+ <!-- service:outlook-calendar -->
8
+ ## Outlook Calendar (Microsoft Graph)
9
+
10
+ Use this section **only when `policies/management.md` Schedule = Outlook Calendar**. The provider-routing table at the top of this skill is non-negotiable.
11
+
12
+ v1 is **read-only and on-demand** — there is no Outlook calendar poller, so `schedule.approaching` events do not fire for Outlook calendars (the user's own Outlook clients fill that gap). Write surfaces (create / update / delete) are deferred. If the user asks the agent to schedule or change an Outlook event, tell them you can read the calendar but must defer the write to them.
13
+
14
+ OAuth is **shared with Outlook Mail** via the same MSAL cache row (`mail:outlook:<accountId>`) — if Outlook Mail is configured `direct` and authenticated, calendar reads succeed with no second consent.
15
+
16
+ ### List events
17
+ ```bash
18
+ curl -s "http://localhost:8321/api/calendar/outlook/events?date=today&days=3"
19
+ ```
20
+ Same query params as Google (`date`: `YYYY-MM-DD` or `today`; `days`: 1–90; optional `calendarId`). Returns `{ events: [...], accountId }`.
21
+
22
+ ### List calendars
23
+ ```bash
24
+ curl -s http://localhost:8321/api/calendar/outlook/calendars
25
+ ```
26
+ Returns `{ calendars: [...], accountId }`. The user's primary calendar is marked `primary: true`.
27
+
28
+ ### Outlook Calendar error envelope
29
+
30
+ | HTTP | `error` | What it means / what to do |
31
+ |---|---|---|
32
+ | 400 | bad query | Malformed `date` or `days` value. |
33
+ | 502 | `calendar_error` | Upstream Microsoft Graph error — `message` carries wire text. |
34
+ | 503 | `outlook_not_configured` | No authenticated Outlook account. Direct OAuth credentials missing. |
35
+ | 503 | `outlook_calendar_disabled` | The user toggled Outlook Calendar off in Settings → Calendar. Tell the user and stop. |
36
+ <!-- /service:outlook-calendar -->
@@ -0,0 +1,17 @@
1
+ ---
2
+ kind: reference
3
+ name: github
4
+ description: GitHub direct-mode reference — list repos, list PRs, comment on a PR. Autonomous tier. Stripped when `github` is not configured.
5
+ ---
6
+
7
+ <!-- service:github -->
8
+ ## GitHub
9
+
10
+ ```bash
11
+ curl -s http://localhost:8321/api/github/repos # list watched repos
12
+ curl -s "http://localhost:8321/api/github/pulls?owner=user&repo=repo&state=open" # list PRs
13
+ curl -s -X POST http://localhost:8321/api/github/pulls/comment \
14
+ -H 'Content-Type: application/json' \
15
+ -d '{"owner": "user", "repo": "repo", "pull_number": 42, "comment": "LGTM"}' # comment — Autonomous
16
+ ```
17
+ <!-- /service:github -->
@@ -0,0 +1,49 @@
1
+ ---
2
+ kind: reference
3
+ name: obsidian
4
+ description: External Obsidian vault CRUD — separate from the agent's primary management vault. Routed via /api/obsidian/*. Stripped when `obsidian` is not configured.
5
+ ---
6
+
7
+ <!-- service:obsidian -->
8
+ ## Obsidian (external vault)
9
+
10
+ **Scope**: this skill targets a **separate** Obsidian vault the user maintains
11
+ alongside this app — e.g. a personal knowledge base. It is **not** the agent's
12
+ own primary management store. The agent's primary files (`state/today.md`,
13
+ `plans/roadmap.md`, `projects/`, `rules/`, `routines/`, `user/`, `agent/`, …) live
14
+ in the primary vault and are reached via `/api/context/*` (see the `context`
15
+ skill). **Never** use this skill to read or write the primary vault.
16
+
17
+ Use this skill when the user asks the agent to look up, append to, or create
18
+ notes inside their external knowledge vault — never for the agent's own
19
+ working state.
20
+
21
+ Output language: external-vault writes are Policy C — see `<output_language_policy>`. Preserve verbatim any path / file-name patterns the user has established.
22
+
23
+ Full CRUD over the external vault. Requires the Obsidian app running (the
24
+ CLI proxies through it). Omit `.md` extension from paths. All writes are
25
+ Autonomous; the daemon does not DM the owner before/after the call. Call
26
+ `POST /api/notify` yourself when the user would want to know.
27
+
28
+ ```bash
29
+ curl -s http://localhost:8321/api/obsidian/status # external vault availability
30
+ curl -s "http://localhost:8321/api/obsidian/search?q=meeting+notes&limit=10" # search external vault
31
+ curl -s http://localhost:8321/api/obsidian/notes/Daily%20Notes/2026-04-06 # read external note
32
+ curl -s -X POST http://localhost:8321/api/obsidian/notes \
33
+ -H 'Content-Type: application/json' \
34
+ -d '{"name": "Meeting Notes 2026-04-02", "content": "# Meeting\n..."}' # create external note (fails if exists)
35
+ curl -s -X PUT http://localhost:8321/api/obsidian/notes/Projects/ProjectA \
36
+ -H 'Content-Type: application/json' -d '{"content": "# Full body"}' # create-or-overwrite external note
37
+ curl -s -X PATCH http://localhost:8321/api/obsidian/notes \
38
+ -H 'Content-Type: application/json' \
39
+ -d '{"file": "Meeting Notes 2026-04-02", "content": "\n- Action item"}' # append to external note
40
+ curl -s -X PATCH http://localhost:8321/api/obsidian/daily \
41
+ -H 'Content-Type: application/json' -d '{"content": "- [ ] Follow up"}' # append to external daily note
42
+ curl -s -X DELETE http://localhost:8321/api/obsidian/notes/Projects/Old # delete from external vault (moves to trash)
43
+ ```
44
+ **Endpoint choice**: Read → GET, Create-only → POST, Edit → PUT, Append → PATCH.
45
+
46
+ If the user's request is really about the agent's own state (today, roadmap,
47
+ projects, journal, rules, routines, user profile), switch to the `context`
48
+ skill and the `/api/context/*` endpoints instead.
49
+ <!-- /service:obsidian -->
@@ -0,0 +1,27 @@
1
+ ---
2
+ kind: reference
3
+ name: skills-crud
4
+ description: Dashboard-shaped CRUD for user-authored skills under ~/.personal-agent/skills/. Built-in skills are read-only (403).
5
+ ---
6
+
7
+ ## Skills Management
8
+
9
+ User-authored skills: `~/.personal-agent/skills/{slug}/SKILL.md`. Built-in skills are read-only (403). Slug: lowercase kebab-case `[a-z0-9][a-z0-9-]*`, 1–64 chars.
10
+
11
+ ```bash
12
+ curl -s http://localhost:8321/api/skills # list all
13
+ curl -s http://localhost:8321/api/skills/todo-digest # read one
14
+ curl -s -X POST http://localhost:8321/api/skills \
15
+ -H 'Content-Type: application/json' \
16
+ -d '{"name": "todo-digest", "description": "Summarize today.md", "content": "# TODO Digest\n...", "allowedTools": ["Bash(curl *)", "Read"]}'
17
+ curl -s -X PUT http://localhost:8321/api/skills/todo-digest \
18
+ -H 'Content-Type: application/json' -d '{"description": "New description"}' # update
19
+ curl -s -X DELETE http://localhost:8321/api/skills/todo-digest # delete
20
+ ```
21
+ Always `GET /api/skills` before creating (check name collisions). **Omit frontmatter** from `content` — the API injects it.
22
+
23
+ The description is the **only** routing signal the SDK uses to pick a
24
+ skill — keep it under 280 chars and make the trigger surface
25
+ distinct from every other skill in the manifest. Slug grammar is
26
+ strict: `[a-z0-9][a-z0-9-]*[a-z0-9]` or `[a-z0-9]` (single char),
27
+ 1-64 chars total. PUT rejects collisions with built-in slugs.
@@ -0,0 +1,151 @@
1
+ ---
2
+ name: gmail-lifestyle
3
+ description: Load when the user mentions receipts / expenses / flights / hotels / trains / a booking — Gmail-observer-derived travel bookings and receipt save-to-external-vault both live here.
4
+ allowed-tools:
5
+ - Bash(curl *)
6
+ - Read
7
+ ---
8
+
9
+ # Gmail Lifestyle — travel bookings, receipts
10
+
11
+ This skill merges two closely-related surfaces that both depend on
12
+ data the daemon's **Gmail observer** has scanned: travel bookings and
13
+ receipt attachments saved into the user's external Obsidian vault.
14
+
15
+ It is conditionally loaded — see the manifest predicate
16
+ `gmailLifestyleActive(db)` / `gmailLifestyleActiveForDm(db, msg)`
17
+ in `packages/daemon/src/core/skills-manifest.ts`. Routines load it
18
+ when there is fresh-or-pending data; DM events also load it on
19
+ trigger phrases (`receipt`, `expense`, `flight`, `train`, plus the
20
+ user's primary-language equivalents — the predicate handles both the
21
+ structured triggers and the message-text triggers).
22
+
23
+ Output language: Policy C for user-facing summaries — see
24
+ `<output_language_policy>`. Path patterns and external API field
25
+ names stay verbatim.
26
+
27
+ ---
28
+
29
+ ## Travel bookings
30
+
31
+ The daemon's Gmail observer detects booking confirmation emails from
32
+ airlines, hotels, OTAs, restaurant reservation platforms, and rail
33
+ services. Data is stored in the `travel_bookings` SQLite table.
34
+
35
+ ### When to use
36
+
37
+ - **Morning routine** — surface upcoming travel / bookings within the
38
+ next 7 days inside today.md `## Travel & Reservations`.
39
+ - **Evening review** — report newly detected bookings (today's
40
+ `createdAt`).
41
+ - **User asks about trips / reservations** — query bookings and
42
+ summarize.
43
+ - **Pre-trip reminders** — surface upcoming travel the day before
44
+ departure.
45
+
46
+ ### Workflow
47
+
48
+ 1. Fetch upcoming bookings from `/api/travel-bookings/upcoming`.
49
+ 2. For morning routine, highlight bookings within the next 7 days.
50
+ 3. For evening review, check for newly detected bookings (today's
51
+ `createdAt`).
52
+
53
+ ### API
54
+
55
+ Full `/api/travel-bookings` reference (GET filter + upcoming +
56
+ PATCH status) is in the dedicated reference below.
57
+
58
+ {{> ref:travel-bookings-api }}
59
+
60
+ ### Formatting
61
+
62
+ Morning routine — today.md:
63
+
64
+ ```
65
+ ## Travel & Reservations
66
+ Upcoming flight: United to SFO (May 15) — confirmation ABC123
67
+ Hotel: Marriott SF (May 15-17) — confirmation XYZ789
68
+ Restaurant: OpenTable reservation tonight 19:00
69
+ ```
70
+
71
+ Omit the section when no upcoming bookings within 7 days.
72
+
73
+ Evening review:
74
+
75
+ ```
76
+ ## New Bookings Detected
77
+ - United flight: May 15, confirmation ABC123, $350
78
+ ```
79
+
80
+ Booking type display names: flight → Flight, hotel → Hotel,
81
+ restaurant → Restaurant, train → Train, bus → Bus, other →
82
+ Reservation.
83
+
84
+ ---
85
+
86
+ ## Receipts
87
+
88
+ The daemon's Gmail observer scans travel-booking emails for PDF /
89
+ image attachments and can retain previously detected generic
90
+ documents. Attachment metadata is stored in the `receipts` SQLite
91
+ table. Actual files are downloaded on demand and can be saved to the
92
+ user's **external Obsidian vault**.
93
+
94
+ ### Primary vault vs external vault — read first
95
+
96
+ > **WARNING — do not confuse vaults.** Receipts save into the
97
+ > **external** Obsidian vault (user's personal knowledge base reached
98
+ > via `/api/obsidian/*`), **not** the primary management store
99
+ > reached via `/api/context/*`. The agent's own state files
100
+ > (`state/today.md`, `plans/roadmap.md`, `projects/*`, `user/*`, `rules/*`,
101
+ > `routines/*`, `agent/*`) live in the primary store and must
102
+ > **never** receive receipt attachments. See the
103
+ > `external-services` skill's obsidian reference for the external
104
+ > vault's full CRUD surface.
105
+
106
+ `receipts.obsidianPath` is a path **inside the external vault**.
107
+
108
+ ### When to use
109
+
110
+ - **User asks about receipts** — list detected receipts, check save
111
+ status.
112
+ - **Tax preparation season** — generate annual receipt list, save
113
+ unsaved receipts.
114
+ - **Monthly / yearly review** — report on receipt-collection
115
+ completeness.
116
+
117
+ ### Workflow
118
+
119
+ 1. Fetch the receipt list from `/api/receipts`.
120
+ 2. To save a receipt to the external Obsidian vault:
121
+ a. Download via `POST /api/receipts/:id/download` (binary stream).
122
+ b. Save to the vault via `POST /api/obsidian/notes` (see the
123
+ `external-services` obsidian reference for path conventions).
124
+ c. Update the receipt record with the vault-relative path via
125
+ `PATCH /api/receipts/:id` `{"obsidianPath": "..."}`.
126
+ 3. For tax preparation, filter by date range and category.
127
+
128
+ ### API
129
+
130
+ Full `/api/receipts` reference (GET filter + summary + download +
131
+ PATCH) plus the external-vault save convention
132
+ (`receipts/YYYY/MM/<merchant>-<date>.<ext>`) is in the dedicated
133
+ reference below.
134
+
135
+ {{> ref:receipts-api }}
136
+
137
+ ---
138
+
139
+ ## When NOT to act
140
+
141
+ - If the predicate gates above are false (no fresh bookings, no
142
+ unsaved receipts, no trigger phrase), this skill is not loaded —
143
+ the manifest layer handles that decision. If you see this body
144
+ anyway, it means the predicate matched something concrete; do not
145
+ guess that the user wants travel / commute / receipt work without
146
+ evidence in the conversation or the DB.
147
+ - Do not write receipts to `/api/context/*` — that targets the
148
+ primary management vault. See the §"Primary vault vs external
149
+ vault" warning above.
150
+ - Bulk receipt operations (save-all, reclassify-all) need explicit
151
+ user confirmation; surface the count and criteria first.
@@ -0,0 +1,93 @@
1
+ ---
2
+ kind: reference
3
+ name: receipts-api
4
+ description: /api/receipts reference — list / filter, download, save-to-external-Obsidian-vault, reclassify, and summary endpoints for Gmail-observer-flagged attachments.
5
+ ---
6
+
7
+ # `/api/receipts` reference
8
+
9
+ The daemon's Gmail observer scans travel-booking emails for PDF /
10
+ image attachments and can retain previously detected generic
11
+ documents. Attachment metadata is stored in the `receipts` SQLite
12
+ table. Actual files are downloaded on demand and saved to the user's
13
+ **external Obsidian vault** (NOT the primary management vault — see
14
+ the `## Receipts` section of the parent skill for the vault-routing
15
+ warning).
16
+
17
+ ## GET /api/receipts
18
+
19
+ ```bash
20
+ # All receipts
21
+ curl -s "http://localhost:8321/api/receipts?limit=50"
22
+
23
+ # Unsaved receipts only
24
+ curl -s "http://localhost:8321/api/receipts?saved=false"
25
+
26
+ # Filter by category
27
+ curl -s "http://localhost:8321/api/receipts?category=document"
28
+ ```
29
+
30
+ | Param | Type | Default | Description |
31
+ |-------|------|---------|-------------|
32
+ | `category` | string | — | document, travel |
33
+ | `saved` | boolean | — | true = saved to Obsidian, false = not yet saved |
34
+ | `limit` | number | 50 | Max results (1–200) |
35
+
36
+ Response:
37
+
38
+ ```json
39
+ {
40
+ "receipts": [
41
+ {
42
+ "id": 1,
43
+ "providerMsgId": "18f...",
44
+ "attachmentId": "ANGj...",
45
+ "filename": "receipt.pdf",
46
+ "mimeType": "application/pdf",
47
+ "sizeBytes": 45000,
48
+ "category": "document",
49
+ "obsidianPath": null,
50
+ "savedAt": null,
51
+ "createdAt": "2026-04-12T10:00:00Z"
52
+ }
53
+ ],
54
+ "total": 1
55
+ }
56
+ ```
57
+
58
+ ## GET /api/receipts/summary
59
+
60
+ ```bash
61
+ curl -s "http://localhost:8321/api/receipts/summary"
62
+ ```
63
+
64
+ Returns counts: `{ total, saved, unsaved, byCategory: [{ category, count }] }`.
65
+
66
+ ## POST /api/receipts/:id/download
67
+
68
+ ```bash
69
+ curl -s -X POST "http://localhost:8321/api/receipts/1/download" -o receipt.pdf
70
+ ```
71
+
72
+ Binary stream of the original attachment.
73
+
74
+ ## PATCH /api/receipts/:id
75
+
76
+ ```bash
77
+ # Mark as saved to external Obsidian vault
78
+ curl -s -X PATCH "http://localhost:8321/api/receipts/1" \
79
+ -H "Content-Type: application/json" \
80
+ -d '{"obsidianPath": "receipts/2026/04/amazon-receipt.pdf"}'
81
+
82
+ # Reclassify a receipt
83
+ curl -s -X PATCH "http://localhost:8321/api/receipts/1" \
84
+ -H "Content-Type: application/json" \
85
+ -d '{"category": "travel"}'
86
+ ```
87
+
88
+ ## External-vault save convention
89
+
90
+ Save receipts to `receipts/YYYY/MM/<merchant>-<date>.<ext>` inside
91
+ the external Obsidian vault.
92
+
93
+ Example: `receipts/2026/04/amazon-2026-04-12.pdf`.
@@ -0,0 +1,75 @@
1
+ ---
2
+ kind: reference
3
+ name: travel-bookings-api
4
+ description: /api/travel-bookings reference — filter / upcoming / PATCH status for Gmail-observer-detected flight, hotel, train, restaurant, and bus reservations.
5
+ ---
6
+
7
+ # `/api/travel-bookings` reference
8
+
9
+ The daemon's Gmail observer detects booking confirmation emails from
10
+ airlines, hotels, OTAs, restaurant reservation platforms, and rail
11
+ services. Data is stored in the `travel_bookings` SQLite table.
12
+
13
+ ## GET /api/travel-bookings
14
+
15
+ ```bash
16
+ # All bookings
17
+ curl -s "http://localhost:8321/api/travel-bookings?limit=20"
18
+
19
+ # Filter by type
20
+ curl -s "http://localhost:8321/api/travel-bookings?type=flight"
21
+
22
+ # Upcoming only
23
+ curl -s "http://localhost:8321/api/travel-bookings?status=upcoming"
24
+
25
+ # Date range
26
+ curl -s "http://localhost:8321/api/travel-bookings?from=2026-04-01&to=2026-05-01"
27
+ ```
28
+
29
+ | Param | Type | Default | Description |
30
+ |-------|------|---------|-------------|
31
+ | `type` | string | — | flight, hotel, restaurant, train, bus, other |
32
+ | `status` | string | all | upcoming, completed, cancelled, all |
33
+ | `from` | ISO date | — | Bookings with start_date on or after |
34
+ | `to` | ISO date | — | Bookings with start_date before |
35
+ | `limit` | number | 50 | Max results (1–200) |
36
+
37
+ Response:
38
+
39
+ ```json
40
+ {
41
+ "bookings": [
42
+ {
43
+ "id": 1,
44
+ "type": "flight",
45
+ "provider": "United",
46
+ "destination": null,
47
+ "startDate": "2026-05-15T10:30:00Z",
48
+ "endDate": null,
49
+ "confirmationNumber": "ABC123",
50
+ "amount": 350,
51
+ "currency": "USD",
52
+ "status": "upcoming",
53
+ "providerMsgId": "18f...",
54
+ "createdAt": "2026-04-12T10:00:00Z"
55
+ }
56
+ ],
57
+ "total": 1
58
+ }
59
+ ```
60
+
61
+ ## GET /api/travel-bookings/upcoming
62
+
63
+ Convenience endpoint, sorted by start date.
64
+
65
+ ```bash
66
+ curl -s "http://localhost:8321/api/travel-bookings/upcoming?limit=10"
67
+ ```
68
+
69
+ ## PATCH /api/travel-bookings/:id
70
+
71
+ ```bash
72
+ curl -s -X PATCH "http://localhost:8321/api/travel-bookings/1" \
73
+ -H "Content-Type: application/json" \
74
+ -d '{"status": "completed"}'
75
+ ```