@aitne-sh/aitne 0.1.8 → 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 (276) hide show
  1. package/README.md +218 -161
  2. package/agent-assets/agent-profiles/_safety.md +3 -3
  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 +2 -2
  6. package/agent-assets/agent-profiles/routine-fetch-window.md +30 -19
  7. package/agent-assets/agents/context-index-reconcile/agent.md +52 -0
  8. package/agent-assets/agents/evening-review/agent.md +53 -0
  9. package/agent-assets/agents/hourly-check/agent.md +62 -0
  10. package/agent-assets/agents/monthly-review/agent.md +55 -0
  11. package/agent-assets/agents/morning-routine/agent.md +78 -0
  12. package/agent-assets/agents/roadmap-maintenance/agent.md +52 -0
  13. package/agent-assets/agents/skill-curation/agent.md +52 -0
  14. package/agent-assets/agents/user-profile-sweep-evening/agent.md +48 -0
  15. package/agent-assets/agents/user-profile-sweep-morning/agent.md +53 -0
  16. package/agent-assets/agents/weekly-review/agent.md +51 -0
  17. package/agent-assets/docs/concepts/agent-day.md +13 -11
  18. package/agent-assets/docs/concepts/auth-health.md +47 -10
  19. package/agent-assets/docs/concepts/backends-and-tiers.md +66 -31
  20. package/agent-assets/docs/concepts/costs-and-quotas.md +50 -15
  21. package/agent-assets/docs/concepts/delegated-mode.md +52 -13
  22. package/agent-assets/docs/concepts/memory-model.md +72 -32
  23. package/agent-assets/docs/concepts/observations.md +49 -11
  24. package/agent-assets/docs/concepts/process-keys.md +56 -22
  25. package/agent-assets/docs/concepts/routines.md +60 -33
  26. package/agent-assets/docs/concepts/safety-and-execution.md +50 -21
  27. package/agent-assets/docs/concepts/safety-model.md +42 -34
  28. package/agent-assets/docs/concepts/skills.md +33 -17
  29. package/agent-assets/docs/features/integrations/browser-history.md +195 -0
  30. package/agent-assets/docs/features/integrations/calendar.md +39 -29
  31. package/agent-assets/docs/features/integrations/git.md +18 -7
  32. package/agent-assets/docs/features/integrations/github.md +84 -33
  33. package/agent-assets/docs/features/integrations/mail.md +59 -16
  34. package/agent-assets/docs/features/integrations/notion.md +18 -6
  35. package/agent-assets/docs/features/integrations/obsidian.md +28 -5
  36. package/agent-assets/docs/features/lifestyle/git.md +42 -38
  37. package/agent-assets/docs/features/lifestyle/reading.md +50 -22
  38. package/agent-assets/docs/features/lifestyle/receipts.md +51 -21
  39. package/agent-assets/docs/features/lifestyle/travel-bookings.md +76 -14
  40. package/agent-assets/docs/features/memory-files/agent-journal.md +111 -50
  41. package/agent-assets/docs/features/memory-files/projects.md +71 -17
  42. package/agent-assets/docs/features/memory-files/roadmap.md +50 -10
  43. package/agent-assets/docs/features/memory-files/schedule.md +113 -70
  44. package/agent-assets/docs/features/memory-files/today.md +46 -21
  45. package/agent-assets/docs/features/memory-files/user-profile.md +63 -33
  46. package/agent-assets/docs/features/messaging/bang-commands.md +113 -36
  47. package/agent-assets/docs/features/messaging/dashboard-chat.md +43 -21
  48. package/agent-assets/docs/features/messaging/discord.md +35 -4
  49. package/agent-assets/docs/features/messaging/overview.md +37 -19
  50. package/agent-assets/docs/features/messaging/pairing-and-magic-phrase.md +94 -27
  51. package/agent-assets/docs/features/messaging/slack.md +67 -14
  52. package/agent-assets/docs/features/messaging/telegram.md +18 -5
  53. package/agent-assets/docs/features/messaging/whatsapp.md +71 -17
  54. package/agent-assets/docs/features/operations/activity-and-conversations.md +44 -15
  55. package/agent-assets/docs/features/operations/approvals.md +48 -16
  56. package/agent-assets/docs/features/operations/backend-routing.md +68 -16
  57. package/agent-assets/docs/features/operations/cost-tracking.md +84 -17
  58. package/agent-assets/docs/features/operations/managed-chromium.md +221 -0
  59. package/agent-assets/docs/features/operations/notifications.md +52 -11
  60. package/agent-assets/docs/features/operations/quiet-hours.md +63 -40
  61. package/agent-assets/docs/features/operations/schedule-approaching.md +54 -24
  62. package/agent-assets/docs/features/routines/custom-routines.md +88 -20
  63. package/agent-assets/docs/features/routines/evening-review.md +74 -21
  64. package/agent-assets/docs/features/routines/hourly-check.md +149 -29
  65. package/agent-assets/docs/features/routines/morning-routine.md +53 -35
  66. package/agent-assets/docs/features/routines/weekly-review.md +40 -21
  67. package/agent-assets/docs/features/wiki/commands.md +26 -16
  68. package/agent-assets/docs/features/wiki/cost-and-approval.md +240 -0
  69. package/agent-assets/docs/features/wiki/dashboard.md +255 -0
  70. package/agent-assets/docs/features/wiki/overview.md +68 -10
  71. package/agent-assets/docs/features/wiki/search.md +248 -0
  72. package/agent-assets/docs/features/wiki/workspaces.md +254 -0
  73. package/agent-assets/docs/getting-started/01-what-is-this.md +34 -23
  74. package/agent-assets/docs/getting-started/02-first-steps.md +13 -8
  75. package/agent-assets/docs/getting-started/03-what-can-this-do.md +25 -14
  76. package/agent-assets/docs/getting-started/04-first-day.md +38 -20
  77. package/agent-assets/docs/glossary.md +235 -24
  78. package/agent-assets/docs/guides/add-a-custom-routine.md +63 -23
  79. package/agent-assets/docs/guides/backup-and-restore.md +80 -16
  80. package/agent-assets/docs/guides/budget-and-cost-for-wiki.md +56 -25
  81. package/agent-assets/docs/guides/build-your-wiki.md +22 -9
  82. package/agent-assets/docs/guides/change-which-model-handles-x.md +64 -10
  83. package/agent-assets/docs/guides/connect-a-new-mail-account.md +64 -15
  84. package/agent-assets/docs/guides/explore-with-trace-and-connect.md +28 -11
  85. package/agent-assets/docs/guides/import-knowledge-file.md +50 -40
  86. package/agent-assets/docs/guides/install-and-run.md +48 -19
  87. package/agent-assets/docs/guides/maintain-wiki-health.md +35 -10
  88. package/agent-assets/docs/guides/migrate-machines.md +74 -18
  89. package/agent-assets/docs/guides/multiple-wikis-for-multiple-domains.md +111 -60
  90. package/agent-assets/docs/guides/pause-the-agent.md +65 -24
  91. package/agent-assets/docs/guides/reinstall-cleanly.md +88 -18
  92. package/agent-assets/docs/guides/setup-wizard.md +113 -54
  93. package/agent-assets/docs/guides/switch-default-backend.md +62 -16
  94. package/agent-assets/docs/guides/use-an-existing-obsidian-vault.md +26 -10
  95. package/agent-assets/docs/reference/api.md +143 -32
  96. package/agent-assets/docs/reference/cli-commands.md +38 -17
  97. package/agent-assets/docs/reference/config.md +224 -49
  98. package/agent-assets/docs/reference/disallowed-tools.md +29 -10
  99. package/agent-assets/docs/reference/keyboard-shortcuts.md +34 -10
  100. package/agent-assets/docs/reference/knowledge-layout.md +620 -0
  101. package/agent-assets/docs/reference/process-keys.md +61 -5
  102. package/agent-assets/docs/reference/skills.md +38 -12
  103. package/agent-assets/docs/troubleshooting/auth-failed.md +48 -19
  104. package/agent-assets/docs/troubleshooting/dashboard-shows-degraded.md +90 -28
  105. package/agent-assets/docs/troubleshooting/fallback-keeps-firing.md +86 -22
  106. package/agent-assets/docs/troubleshooting/messaging-not-pairing.md +68 -24
  107. package/agent-assets/docs/troubleshooting/morning-routine-didnt-run.md +80 -20
  108. package/agent-assets/docs/troubleshooting/observation-not-detected.md +73 -21
  109. package/agent-assets/docs/troubleshooting/quota-exhausted.md +29 -5
  110. package/agent-assets/docs/troubleshooting/wiki-ingest-full-blocked.md +126 -54
  111. package/agent-assets/docs/troubleshooting/wiki-write-failed.md +29 -12
  112. package/agent-assets/optimizer-skills/drift-analysis/SKILL.md +1 -1
  113. package/agent-assets/optimizer-skills/knowledge-map/SKILL.md +1 -1
  114. package/agent-assets/optimizer-skills/skill-curation/SKILL.md +1 -1
  115. package/agent-assets/sandbox/linux/aitne-chromium.apparmor +91 -0
  116. package/agent-assets/sandbox/macos/aitne-chromium.sb +156 -0
  117. package/agent-assets/skills/agent-actions/SKILL.md +2 -2
  118. package/agent-assets/skills/agent-create/SKILL.md +149 -0
  119. package/agent-assets/skills/attach/SKILL.md +2 -2
  120. package/agent-assets/skills/browser-history/SKILL.md +198 -0
  121. package/agent-assets/skills/browser-history-respond/SKILL.md +106 -0
  122. package/agent-assets/skills/browser-task/SKILL.md +169 -0
  123. package/agent-assets/skills/context/SKILL.md +12 -12
  124. package/agent-assets/skills/context/curation.json +2 -2
  125. package/agent-assets/skills/context/references/api.md +43 -31
  126. package/agent-assets/skills/context/references/required-frontmatter.md +3 -3
  127. package/agent-assets/skills/context/references/snapshot-files.md +6 -6
  128. package/agent-assets/skills/context/seeds/file-responsibilities.seed.json +3 -3
  129. package/agent-assets/skills/docs-search/SKILL.md +4 -3
  130. package/agent-assets/skills/external-services/SKILL.delegated.claude.md +11 -21
  131. package/agent-assets/skills/external-services/SKILL.delegated.codex.md +11 -21
  132. package/agent-assets/skills/external-services/SKILL.delegated.gemini.md +11 -21
  133. package/agent-assets/skills/external-services/SKILL.md +3 -3
  134. package/agent-assets/skills/external-services/SKILL.native.claude.md +5 -5
  135. package/agent-assets/skills/external-services/SKILL.native.codex.md +7 -7
  136. package/agent-assets/skills/external-services/SKILL.native.gemini.md +4 -4
  137. package/agent-assets/skills/external-services/references/calendar-apple.md +2 -2
  138. package/agent-assets/skills/external-services/references/calendar-outlook.md +1 -1
  139. package/agent-assets/skills/external-services/references/obsidian.md +2 -2
  140. package/agent-assets/skills/gmail-lifestyle/SKILL.md +9 -82
  141. package/agent-assets/skills/mail/SKILL.delegated.claude.md +14 -5
  142. package/agent-assets/skills/mail/SKILL.delegated.codex.md +8 -4
  143. package/agent-assets/skills/mail/SKILL.delegated.gemini.md +8 -4
  144. package/agent-assets/skills/mail/references/api.md +4 -2
  145. package/agent-assets/skills/mail/references/providers.md +1 -1
  146. package/agent-assets/skills/managed-tasks/SKILL.md +9 -9
  147. package/agent-assets/skills/managed-tasks/references/errors.md +9 -6
  148. package/agent-assets/skills/managed-tasks/references/recurrence-rule.md +1 -1
  149. package/agent-assets/skills/management-policy/SKILL.md +32 -31
  150. package/agent-assets/skills/management-policy/curation.json +1 -1
  151. package/agent-assets/skills/management-policy/references/policy-workflow.md +9 -9
  152. package/agent-assets/skills/management-policy/seeds/policy-file-shape.seed.json +1 -1
  153. package/agent-assets/skills/notify/SKILL.md +4 -4
  154. package/agent-assets/skills/notify/references/priority.md +9 -4
  155. package/agent-assets/skills/notion/SKILL.delegated.claude.md +1 -1
  156. package/agent-assets/skills/notion/SKILL.delegated.codex.md +1 -1
  157. package/agent-assets/skills/notion/SKILL.delegated.gemini.md +1 -1
  158. package/agent-assets/skills/notion/SKILL.native.claude.md +10 -6
  159. package/agent-assets/skills/notion/SKILL.native.codex.md +9 -4
  160. package/agent-assets/skills/notion/SKILL.native.gemini.md +9 -4
  161. package/agent-assets/skills/observations/SKILL.md +24 -8
  162. package/agent-assets/skills/project-doc/SKILL.md +1 -1
  163. package/agent-assets/skills/project-doc/curation.json +3 -3
  164. package/agent-assets/skills/project-doc/seeds/project-shape.seed.json +7 -4
  165. package/agent-assets/skills/project-doc/seeds/slug-grammar.seed.json +3 -3
  166. package/agent-assets/skills/reading/SKILL.md +10 -0
  167. package/agent-assets/skills/reading/references/reading-taste.md +2 -2
  168. package/agent-assets/skills/roadmap/SKILL.md +5 -5
  169. package/agent-assets/skills/roadmap/curation.json +1 -1
  170. package/agent-assets/skills/roadmap/references/api.md +7 -7
  171. package/agent-assets/skills/roadmap/references/cross-check.md +15 -8
  172. package/agent-assets/skills/roadmap/references/migration.md +4 -4
  173. package/agent-assets/skills/roadmap/seeds/entry-types.seed.json +1 -1
  174. package/agent-assets/skills/schedule/SKILL.md +42 -34
  175. package/agent-assets/skills/schedule/references/batch.md +2 -2
  176. package/agent-assets/skills/schedule/references/errors.md +7 -4
  177. package/agent-assets/skills/schedule/references/model-selection.md +3 -3
  178. package/agent-assets/skills/schedule/references/recurrence-rule.md +1 -1
  179. package/agent-assets/skills/scheduled-managed-task/SKILL.md +46 -36
  180. package/agent-assets/skills/today/SKILL.md +9 -9
  181. package/agent-assets/skills/today/curation.json +3 -3
  182. package/agent-assets/skills/today/references/agent-plan-lifecycle.md +6 -5
  183. package/agent-assets/skills/today/seeds/section-shape.seed.json +1 -1
  184. package/agent-assets/skills/user-interview/SKILL.md +12 -9
  185. package/agent-assets/skills/user-interview/references/op-briefing.md +2 -2
  186. package/agent-assets/skills/user-interview/references/sweep-and-fallback.md +8 -0
  187. package/agent-assets/skills/user-profile/SKILL.md +17 -17
  188. package/agent-assets/skills/user-profile/curation.json +2 -2
  189. package/agent-assets/skills/user-profile/references/character-preferences.md +2 -2
  190. package/agent-assets/skills/user-profile/seeds/routing-table.seed.json +8 -8
  191. package/agent-assets/skills/user-profile/seeds/topic-files.seed.json +6 -6
  192. package/agent-assets/skills/wiki/wiki-compile/SKILL.md +4 -4
  193. package/agent-assets/system-prompts/routine-fetch-window.md +22 -12
  194. package/agent-assets/task-flows/_partials/calendar-acquire.google_calendar.md +4 -2
  195. package/agent-assets/task-flows/_partials/calendar-acquire.outlook_calendar.md +4 -2
  196. package/agent-assets/task-flows/_partials/capture-user-info.md +2 -2
  197. package/agent-assets/task-flows/_partials/dm-intent.long-horizon.md +1 -1
  198. package/agent-assets/task-flows/_partials/dm-intent.project.md +9 -9
  199. package/agent-assets/task-flows/_partials/mail-acquire.outlook_mail.md +3 -2
  200. package/agent-assets/task-flows/_partials/notion-acquire.notion.md +10 -5
  201. package/agent-assets/task-flows/browser_task.md +84 -0
  202. package/agent-assets/task-flows/github.assigned.md +1 -1
  203. package/agent-assets/task-flows/github.pull_request.review_requested.md +2 -2
  204. package/agent-assets/task-flows/github.workflow_run.failed.md +2 -2
  205. package/agent-assets/task-flows/knowledge.import.md +14 -14
  206. package/agent-assets/task-flows/message.received.dm.md +9 -4
  207. package/agent-assets/task-flows/message.received.dm_first.md +3 -3
  208. package/agent-assets/task-flows/routine.custom.md +3 -3
  209. package/agent-assets/task-flows/routine.evening_review.md +8 -8
  210. package/agent-assets/task-flows/routine.fetch_window.md +2 -2
  211. package/agent-assets/task-flows/routine.hourly_check.md +16 -12
  212. package/agent-assets/task-flows/routine.monthly_review.md +21 -21
  213. package/agent-assets/task-flows/routine.morning_routine_journal.md +119 -97
  214. package/agent-assets/task-flows/routine.morning_routine_today.md +43 -43
  215. package/agent-assets/task-flows/routine.research_cluster_update.md +35 -0
  216. package/agent-assets/task-flows/routine.research_dispatch.md +38 -0
  217. package/agent-assets/task-flows/routine.research_offer_dm.md +125 -0
  218. package/agent-assets/task-flows/routine.research_wiki_summary.md +53 -0
  219. package/agent-assets/task-flows/routine.roadmap_refresh.md +10 -10
  220. package/agent-assets/task-flows/routine.today_refresh.md +4 -4
  221. package/agent-assets/task-flows/routine.user_profile_sweep.md +10 -10
  222. package/agent-assets/task-flows/routine.weekly_review.md +93 -24
  223. package/agent-assets/task-flows/schedule.approaching.md +0 -1
  224. package/agent-assets/task-flows/scheduled.dm.md +5 -5
  225. package/agent-assets/task-flows/scheduled.task.md +4 -4
  226. package/agent-assets/task-flows/setup.initial.md +21 -21
  227. package/agent-assets/task-flows/setup.update.md +2 -2
  228. package/agent-assets/templates/README.md +27 -20
  229. package/agent-assets/templates/_index.md +42 -26
  230. package/agent-assets/templates/_manifest.json +34 -99
  231. package/agent-assets/templates/{user → identity}/_index.md +1 -1
  232. package/agent-assets/templates/{user → identity}/profile.md +2 -2
  233. package/agent-assets/templates/{dossiers → knowledge/dossiers}/_index.md +1 -1
  234. package/agent-assets/templates/{projects → plans/projects}/_active.base +1 -1
  235. package/agent-assets/templates/policies/_index.md +21 -0
  236. package/agent-assets/templates/{rules → policies}/journal-export.md +1 -1
  237. package/agent-assets/templates/{rules → policies}/journal-format.md +5 -5
  238. package/agent-assets/templates/{rules/policies → policies/management-captures}/_index.md +2 -2
  239. package/agent-assets/templates/{rules → policies}/management.md +3 -3
  240. package/agent-assets/templates/{rules → policies}/mcp.md +1 -1
  241. package/agent-assets/templates/{rules → policies}/redaction.md +1 -1
  242. package/agent-assets/templates/{routines → policies/routines}/_index.md +1 -1
  243. package/agent-assets/templates/{routines → policies/routines}/evening.md +2 -2
  244. package/agent-assets/templates/{routines → policies/routines}/hourly.md +1 -1
  245. package/agent-assets/templates/{routines → policies/routines}/monthly.md +2 -2
  246. package/bin/aitne.mjs +13 -4
  247. package/package.json +5 -4
  248. package/scripts/commands/doctor.mjs +14 -8
  249. package/scripts/commands/run-now.mjs +6 -21
  250. package/scripts/lib/ports.d.mts +27 -0
  251. package/scripts/lib/ports.mjs +36 -0
  252. package/scripts/lib/read-api-token.mjs +176 -0
  253. package/scripts/start.mjs +2 -1
  254. package/agent-assets/docs/features/lifestyle/travel-time.md +0 -58
  255. package/agent-assets/skills/gmail-lifestyle/references/travel-time-api.md +0 -59
  256. package/agent-assets/skills/schedule/references/recurring.md +0 -185
  257. package/agent-assets/templates/context-index.md +0 -42
  258. package/agent-assets/templates/rules/_index.md +0 -19
  259. /package/agent-assets/templates/{user → identity}/expertise.md +0 -0
  260. /package/agent-assets/templates/{user → identity}/goals.md +0 -0
  261. /package/agent-assets/templates/{user → identity}/people.md +0 -0
  262. /package/agent-assets/templates/{user → identity}/personal.md +0 -0
  263. /package/agent-assets/templates/{user → identity}/work.md +0 -0
  264. /package/agent-assets/templates/{agent/journal.md → journal/agent.md} +0 -0
  265. /package/agent-assets/templates/{dossiers → knowledge/dossiers}/evening.md +0 -0
  266. /package/agent-assets/templates/{dossiers → knowledge/dossiers}/hourly.md +0 -0
  267. /package/agent-assets/templates/{dossiers → knowledge/dossiers}/monthly.md +0 -0
  268. /package/agent-assets/templates/{dossiers → knowledge/dossiers}/morning.md +0 -0
  269. /package/agent-assets/templates/{dossiers → knowledge/dossiers}/roadmap.md +0 -0
  270. /package/agent-assets/templates/{dossiers → knowledge/dossiers}/weekly.md +0 -0
  271. /package/agent-assets/templates/{projects → plans/projects}/_index.md +0 -0
  272. /package/agent-assets/templates/{roadmap.md → plans/roadmap.md} +0 -0
  273. /package/agent-assets/templates/{routines → policies/routines}/morning.md +0 -0
  274. /package/agent-assets/templates/{routines → policies/routines}/weekly.md +0 -0
  275. /package/agent-assets/templates/{agent → state}/profile-questions.md +0 -0
  276. /package/agent-assets/templates/{today.md → state/today.md} +0 -0
@@ -11,8 +11,8 @@ category: features
11
11
  summary: |
12
12
  Track books and Kindle highlights in a SQLite-backed reading list
13
13
  surfaced at /reading. The schema covers title/author/status plus a
14
- separate reading_highlights table populated from Kindle clipping
15
- imports.
14
+ separate reading_highlights table populated from Kindle imports
15
+ (My Clippings.txt or an Export Notebook email).
16
16
  section: lifestyle
17
17
  tags:
18
18
  - lifestyle
@@ -21,20 +21,27 @@ tags:
21
21
  status: stable
22
22
  ask_examples:
23
23
  - How do I add a book to my reading list?
24
+ - How do I import my Kindle highlights?
24
25
  - Can the agent recommend something from my reading list?
25
26
  - Where do reading-list items get stored?
26
27
  locale: en-US
27
28
  created: 2026-04-25
28
- updated: 2026-04-25
29
+ updated: 2026-05-28
29
30
  keywords:
30
31
  - reading
31
32
  - books
32
- - articles
33
+ - highlights
34
+ - kindle
33
35
  - read later
34
36
  related:
35
37
  - features/memory-files/user-profile
36
38
  - features/lifestyle/receipts
37
39
  - features/lifestyle/travel-bookings
40
+ api_endpoints:
41
+ - GET /api/books
42
+ - PATCH /api/books/:id
43
+ - POST /api/books/import-clippings
44
+ - POST /api/books/import-notebook-html
38
45
  ui_anchors:
39
46
  - /reading
40
47
  ---
@@ -44,22 +51,32 @@ ui_anchors:
44
51
  ## In One Sentence
45
52
 
46
53
  A reading list backed by the `books` and `reading_highlights` SQLite
47
- tables: imports Kindle clippings, tracks status (`reading`/`finished`/etc.),
48
- and surfaces the working set at `/reading`.
54
+ tables: imports your Kindle highlights, tracks each book's status
55
+ (`reading`, `completed`, or `abandoned`), and surfaces the working set
56
+ at `/reading`.
49
57
 
50
58
  ## What It Does
51
59
 
52
- - **Add** items by DM ("agent, add 'The Soul of a New Machine' to my
53
- reading list") the agent inserts into `books` via the daemon
54
- `/api/books` route.
55
- - **Import Kindle highlights** via `POST /api/books/import-clippings`,
56
- which parses a `My Clippings.txt` paste and populates the
57
- `reading_highlights` table linked back to `books.id`.
58
- - **List** what's outstanding on `/reading`.
59
- - **Mark complete** the agent updates the row's `status` and
60
- `completed_at` columns.
61
- - **Recommend** from the list during reactive turns when context
62
- invites it.
60
+ - **Import Kindle highlights** the primary way books enter the list.
61
+ Two pipelines, both of which create any missing `books` rows and link
62
+ every highlight back to `books.id` in the `reading_highlights` table:
63
+ - `POST /api/books/import-clippings` parses a pasted `My Clippings.txt`.
64
+ - `POST /api/books/import-notebook-html` parses the HTML of a Kindle
65
+ "Export Notebook" email.
66
+ - **List** the library on `/reading` or via `GET /api/books`
67
+ (filterable by `status` and `source`, paginated to 200 rows per call).
68
+ - **Mark complete or abandoned** — the agent updates an existing row via
69
+ `PATCH /api/books/:id`. Setting `status` to `completed` stamps
70
+ `completed_at` automatically; you can also set a 1–5 `rating` or
71
+ `notes`.
72
+ - **Recommend** from the list during reactive turns, and refresh the
73
+ reading-taste profile during weekly and monthly reviews.
74
+
75
+ There is **no bare "add a book" endpoint** — new books arrive through the
76
+ two Kindle import pipelines above (or are created internally during an
77
+ import); `PATCH` only edits books that already exist. If you ask the
78
+ agent to "add a book" conversationally, it works from whatever import
79
+ data it has rather than minting a free-form row.
63
80
 
64
81
  There is no Markdown context file for the reading list; the durable
65
82
  record is the SQLite row. If you want a parallel copy in your external
@@ -68,8 +85,13 @@ stays canonical in the database.
68
85
 
69
86
  ## When It Runs / How It Is Triggered
70
87
 
71
- Reactive only. There is no autonomous reading-list routine in the
72
- default install the operator drives the list shape.
88
+ There is no dedicated autonomous reading-list routine the operator
89
+ drives the list shape. The reading skill loads in two situations:
90
+
91
+ - **Reactively**, when you mention a book or highlight in a DM.
92
+ - **From existing routines** — the morning routine can mention what
93
+ you're currently reading, and the weekly and monthly reviews pull
94
+ reading progress and refresh the reading-taste profile.
73
95
 
74
96
  ## What It Outputs
75
97
 
@@ -83,9 +105,15 @@ default install — the operator drives the list shape.
83
105
 
84
106
  ## When Something Goes Wrong
85
107
 
86
- - A **missing add**: check the Activity row's tool calls — the agent
87
- hits `/api/books`, so a network or quota error there will surface in
88
- the audit log even when the chat reply looked fine.
108
+ - **An import that produced no books**: check the Activity row's tool
109
+ calls — the agent hits `/api/books/import-clippings` (or
110
+ `/import-notebook-html`), so a parse failure, oversized payload, or
111
+ network error there surfaces in the audit log even when the chat reply
112
+ looked fine. A common cause is pasting a partial or non-Kindle
113
+ clippings file, which yields zero parsed books.
114
+ - **An edit that didn't stick**: `PATCH /api/books/:id` returns 404 if
115
+ the id doesn't exist and 400 for an invalid `status` (only `reading`,
116
+ `completed`, `abandoned`) or an out-of-range `rating` (must be 1–5).
89
117
 
90
118
  ## Related
91
119
 
@@ -18,14 +18,16 @@ tags:
18
18
  - lifestyle
19
19
  - receipts
20
20
  - mail
21
+ - integrations
21
22
  status: stable
22
23
  ask_examples:
23
24
  - Where are my receipts stored?
24
25
  - How do I save a receipt to my Obsidian vault?
25
26
  - What does the receipts table track?
27
+ - What receipts haven't I saved yet?
26
28
  locale: en-US
27
29
  created: 2026-04-25
28
- updated: 2026-05-17
30
+ updated: 2026-05-28
29
31
  keywords:
30
32
  - receipt
31
33
  - invoice
@@ -33,6 +35,11 @@ keywords:
33
35
  - attachment
34
36
  - PDF
35
37
  - gmail receipts
38
+ api_endpoints:
39
+ - GET /api/receipts
40
+ - GET /api/receipts/summary
41
+ - POST /api/receipts/:id/download
42
+ - PATCH /api/receipts/:id
36
43
  related:
37
44
  - features/lifestyle/reading
38
45
  - features/lifestyle/travel-bookings
@@ -43,41 +50,64 @@ related:
43
50
 
44
51
  ## In One Sentence
45
52
 
46
- Receipts are PDF / image attachments the Gmail observer flags as
47
- receipts or invoices; their metadata lives in the `receipts` SQLite
48
- table, and the agent can export the original file into your external
53
+ Receipts are PDF / image attachments the Gmail observer detects while
54
+ scanning your mail; their metadata lives in the `receipts` SQLite
55
+ table, and the agent can save the original file into your external
49
56
  Obsidian vault on request.
50
57
 
51
- ## What It Does
58
+ ## How Detection Works
52
59
 
53
- - The Gmail observer auto-detects receipt / invoice attachments while
54
- scanning travel-booking and document mail.
55
- - Each detection inserts a row into the `receipts` table
56
- (`provider_msg_id`, `attachment_id`, `filename`, `mime_type`,
57
- `size_bytes`, `category`, `obsidian_path`, `saved_at`, `account_id`).
58
- - The agent surfaces summaries via the `/api/receipts` and
59
- `/api/receipts/summary` HTTP routes.
60
- - On request, the agent downloads the attachment via
61
- `POST /api/receipts/:id/download`, writes it into the external
62
- Obsidian vault under `receipts/YYYY/MM/<merchant>-<date>.<ext>`, and
63
- patches the row's `obsidian_path` / `saved_at` columns.
60
+ The Gmail observer scans travel-booking emails for PDF / image
61
+ attachments and retains other generic documents it finds. Each detected
62
+ attachment inserts a row into the `receipts` table, keyed uniquely on
63
+ `(account_id, provider_msg_id, attachment_id)` so re-scans are
64
+ idempotent. Columns:
65
+
66
+ - `category` `document` or `travel` (nullable until classified)
67
+ - `provider_msg_id`, `attachment_id`, `account_id` locate the source
68
+ attachment in the unified mail registry
69
+ - `filename`, `mime_type`, `size_bytes` — attachment metadata
70
+ - `obsidian_path`, `saved_at` `NULL` until you save the file to your
71
+ vault (see below)
72
+ - `id`, `created_at` — row identity and detection time
64
73
 
65
74
  There is no Markdown context file for receipts; the durable record is
66
75
  the SQLite row plus the optional Obsidian copy.
67
76
 
77
+ ## Saving a Receipt to Your Vault
78
+
79
+ Saving is a two-step flow — the download endpoint never writes to the
80
+ vault by itself:
81
+
82
+ 1. The agent downloads the original bytes via
83
+ `POST /api/receipts/:id/download`, which streams the raw attachment
84
+ (resolved through the mail registry by `account_id`; oversized files
85
+ over 100 MB and orphaned rows with a null `account_id` are rejected).
86
+ 2. The agent writes the file into your **external** Obsidian vault — not
87
+ the primary management vault — under the convention
88
+ `receipts/YYYY/MM/<merchant>-<date>.<ext>` (e.g.
89
+ `receipts/2026/04/amazon-2026-04-12.pdf`), then records that path
90
+ with `PATCH /api/receipts/:id` (body `{"obsidianPath": "..."}`),
91
+ which also stamps `saved_at`.
92
+
93
+ To reclassify a receipt, the agent PATCHes `{"category": "travel"}`
94
+ (or `"document"`).
95
+
68
96
  ## Where in the Dashboard
69
97
 
70
98
  There is no dedicated tab today. Receipts surface inline when you ask
71
- for them in chat (e.g. "what receipts haven't I saved yet?"). The
72
- underlying API is documented in
99
+ for them in chat (e.g. "what receipts haven't I saved yet?"). List and
100
+ filter them with `GET /api/receipts` (`category`, `saved`, `limit`
101
+ params) and pull totals from `GET /api/receipts/summary`. The full API
102
+ is documented in
73
103
  `agent-assets/skills/gmail-lifestyle/references/receipts-api.md`
74
104
  (loaded by the `gmail-lifestyle` skill).
75
105
 
76
106
  ## Configuration
77
107
 
78
- The detection runs as part of the Gmail observer; see
79
- [Mail](../integrations/mail.md). The Obsidian save path follows the
80
- external vault convention `receipts/YYYY/MM/<merchant>-<date>.<ext>`.
108
+ Detection runs as part of the Gmail observer; see
109
+ [Mail](../integrations/mail.md). The save target follows the external
110
+ vault convention `receipts/YYYY/MM/<merchant>-<date>.<ext>`.
81
111
 
82
112
  ## Related
83
113
 
@@ -11,20 +11,23 @@ aliases:
11
11
  - trains
12
12
  category: features
13
13
  summary: |
14
- A lightweight log of trips, flights, hotels, and confirmation
15
- numbers. The agent appends to it from confirmation emails or DMs.
14
+ A log of trips, flights, hotels, restaurants, and confirmation
15
+ numbers that the agent builds automatically from booking-confirmation
16
+ emails. The morning routine surfaces upcoming travel.
16
17
  section: lifestyle
17
18
  tags:
18
19
  - lifestyle
19
20
  - travel
20
21
  - mail
22
+ - integrations
21
23
  status: stable
22
24
  ask_examples:
23
- - How do I log a flight?
25
+ - How does the agent track my flights and hotels?
24
26
  - Will the agent remind me about my upcoming trip?
27
+ - Where are my travel bookings stored?
25
28
  locale: en-US
26
29
  created: 2026-04-25
27
- updated: 2026-04-25
30
+ updated: 2026-05-28
28
31
  keywords:
29
32
  - flight
30
33
  - hotel
@@ -33,27 +36,86 @@ keywords:
33
36
  - itinerary
34
37
  - trains
35
38
  - restaurants
39
+ - confirmation number
36
40
  related:
37
- - features/lifestyle/travel-time
41
+ - features/integrations/mail
42
+ - features/lifestyle/receipts
43
+ - features/routines/morning-routine
44
+ api_endpoints:
45
+ - /api/travel-bookings
46
+ - /api/travel-bookings/upcoming
47
+ process_keys:
48
+ - gmail_classify
49
+ - routine.morning_routine
50
+ ui_anchors:
51
+ - /trip
38
52
  ---
39
53
 
40
54
  # Travel Bookings
41
55
 
42
56
  ## In One Sentence
43
57
 
44
- A trip log the agent appends to from confirmation emails and DMs,
45
- referenced by the morning routine on travel days.
58
+ A trip log the agent builds automatically from booking-confirmation
59
+ emails, surfaced by the morning routine on travel days.
46
60
 
47
61
  ## What It Does
48
62
 
49
- - Captures trip dates, modes, and confirmation numbers.
50
- - Surfaces in the morning routine on the day of departure.
51
- - Cross-references the travel-time skill for door-to-airport math.
63
+ The mail observer watches your connected mail accounts for booking
64
+ confirmations from airlines, hotels, online travel agencies, restaurant
65
+ reservation platforms, and rail/bus services. When a message is
66
+ classified as travel, the daemon extracts the details and stores a row
67
+ in the `travel_bookings` SQLite table:
52
68
 
53
- ## Where in the Dashboard
69
+ - **Type** `flight`, `hotel`, `restaurant`, `train`, `bus`, or `other`.
70
+ - **Provider** — e.g. the airline or hotel chain.
71
+ - **Dates** — `start_date` and (where present) `end_date`.
72
+ - **Confirmation number**, **amount**, and **currency**.
54
73
 
55
- Surfaces inline in chat and via the morning briefing on travel days.
74
+ Each booking is keyed by its source message, so re-reading the same
75
+ confirmation email never creates a duplicate row.
56
76
 
57
- ## Related
77
+ ## How Bookings Get Created
58
78
 
59
- - [Travel Time](travel-time.md)
79
+ Bookings are extracted from email only — there is no manual "log a
80
+ flight" command or DM shortcut. To start capturing travel, connect a
81
+ mail account (see [Mail](features/integrations/mail)) and let the
82
+ classifier do the rest. The flow is:
83
+
84
+ 1. The mail poller fetches new messages.
85
+ 2. The classifier (`gmail_classify`, lite tier) tags travel
86
+ confirmations.
87
+ 3. The daemon parses the booking and inserts it into `travel_bookings`.
88
+
89
+ ## Where Bookings Surface
90
+
91
+ - **Morning routine.** On travel days the morning routine
92
+ (`routine.morning_routine`) surfaces upcoming trips in your briefing.
93
+ A booking with a `start_date` within roughly the last 30 days (or in
94
+ the future) keeps the travel-aware briefing helpers active.
95
+ - **Trip page.** The dashboard `/trip` page is the eventual home for an
96
+ itinerary timeline view. It is a placeholder while that view is built
97
+ — the underlying data already lives in the database and is reachable
98
+ via the API below.
99
+
100
+ ## API
101
+
102
+ Read-only and status-update access (read endpoints are autonomous; the
103
+ PATCH endpoint follows the standard write-safety tier):
104
+
105
+ ```bash
106
+ # All bookings (optionally filter by type/status/date range)
107
+ curl -s "http://localhost:8321/api/travel-bookings?type=flight&limit=20"
108
+
109
+ # Upcoming only, sorted by start date
110
+ curl -s "http://localhost:8321/api/travel-bookings/upcoming?limit=10"
111
+
112
+ # Mark a booking completed
113
+ curl -s -X PATCH "http://localhost:8321/api/travel-bookings/1" \
114
+ -H "Content-Type: application/json" \
115
+ -d '{"status": "completed"}'
116
+ ```
117
+
118
+ Filters on `GET /api/travel-bookings`: `type`
119
+ (`flight|hotel|restaurant|train|bus|other`), `status`
120
+ (`upcoming|completed|cancelled|all`), `from` / `to` (ISO date on
121
+ `start_date`), and `limit` (1–200, default 50).
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  schema_version: 1
3
3
  slug: features/memory-files/agent-journal
4
- title: agent/journal.md
4
+ title: journal/agent.md
5
5
  id: agent-journal
6
6
  aliases:
7
7
  - journal
@@ -10,96 +10,157 @@ aliases:
10
10
  category: features
11
11
  summary: |
12
12
  The agent's append-only log of decisions, retros, and judgement
13
- calls. Distinct from Activity (which is action-shaped) — the journal
14
- is reflection-shaped.
13
+ calls, at journal/agent.md. Distinct from Activity (which is
14
+ action-shaped) — the journal is reflection-shaped. Written by the
15
+ morning, evening, and weekly routines; the API enforces append-only.
15
16
  section: memory-files
16
17
  tags:
17
18
  - memory
18
19
  - journal
19
20
  - reflection
21
+ - routines
20
22
  status: stable
21
23
  ask_examples:
22
24
  - What is the agent journal?
23
25
  - Where does the agent log its own decisions?
24
26
  - How is the journal different from Activity?
27
+ - Why did journal/agent.md stop growing?
25
28
  locale: en-US
26
29
  created: 2026-04-25
27
- updated: 2026-04-25
30
+ updated: 2026-05-28
28
31
  keywords:
29
32
  - journal
30
33
  - retros
31
34
  - decisions
32
35
  - reflection
36
+ - append-only
33
37
  related:
38
+ - features/routines/morning-routine
34
39
  - features/routines/evening-review
35
40
  - features/routines/weekly-review
36
41
  - features/operations/activity-and-conversations
42
+ - concepts/memory-model
43
+ process_keys:
44
+ - routine.morning_routine_journal
45
+ - routine.evening_review
46
+ - routine.weekly_review
47
+ context_files:
48
+ - journal/agent.md
37
49
  ui_anchors:
38
50
  - /connections/journal
39
51
  - /settings/journal
40
- context_files:
41
- - agent/journal.md
42
52
  ---
43
53
 
44
- # agent/journal.md
54
+ # journal/agent.md
45
55
 
46
- ## In One Sentence
56
+ ## In one sentence
47
57
 
48
- `agent/journal.md` is the agent's own running diary — what it noticed,
58
+ `journal/agent.md` is the agent's own running diary — what it noticed,
49
59
  what it tried, what it would do differently — appended (never
50
60
  rewritten) so a long timeline accumulates.
51
61
 
52
- ## What It Does
62
+ ## What it is
53
63
 
54
64
  The journal is the place the agent writes about its own work in the
55
- first person. Each entry has:
56
-
57
- - A timestamp.
58
- - A short context line (which routine / conversation prompted it).
59
- - The reflection itself.
60
-
61
- Unlike Activity, the journal is opinion-shaped. The evening review
62
- adds the day's reflections; the weekly retro reads them back to
63
- look for patterns.
65
+ first person. Unlike Activity — which is the action-shaped audit log
66
+ of *what happened* — the journal is reflection-shaped: it captures
67
+ *why*, *what surprised it*, and *what it would change*.
64
68
 
65
- ## When It Runs / How It Is Triggered
69
+ Each entry carries:
66
70
 
67
- - **Evening review** adds the largest chunk what worked, what was
68
- surprising, what felt off.
69
- - **Weekly review** appends a retro that quotes prior journal entries
70
- to find a thread.
71
- - **In-the-moment** entries fire when the agent notices something
72
- worth flagging during reactive work.
73
-
74
- ## What It Outputs
75
-
76
- - An ever-growing append-only file at
77
- `~/.personal-agent/context/agent/journal.md`.
78
- - A linked-from-roadmap section when an entry tied a project to a new
79
- decision.
80
-
81
- ## Where in the Dashboard
71
+ - A timestamp (the routine stamps an `Appended at:` line).
72
+ - A short context line — which routine or conversation prompted it.
73
+ - The reflection itself.
82
74
 
83
- - **Connections Journal** is the read view of the file.
84
- - **Settings Journal** controls retention and which routines
85
- contribute (currently always-on for evening / weekly).
75
+ The file lives at `~/.personal-agent/context/journal/agent.md` and
76
+ grows forever. Later routines read it back to look for patterns.
77
+
78
+ ## Who writes it, and when
79
+
80
+ Three routines append to the journal — none ever rewrites it:
81
+
82
+ - **Morning routine** (Stage B, `routine.morning_routine_journal`) is
83
+ the recurring daily writer. After the day's stages settle, the
84
+ daemon appends a one-paragraph audit-trail entry assembled from the
85
+ prior day's `agent_actions` — stage results, retry stats, anomalies.
86
+ This is the entry you'll see most often.
87
+ - **Weekly review** (`routine.weekly_review`) appends the largest
88
+ structured block: a `## Weekly YYYY-Www` retro with *What worked*,
89
+ *What slipped on my side*, *System improvement ideas*, and agent-side
90
+ metrics. It quotes prior entries to find a thread.
91
+ - **Evening review** (`routine.evening_review`) appends short
92
+ bookkeeping lines — for example a one-liner each time it bumps a
93
+ roadmap review forward, or a validation error if a roadmap write was
94
+ rejected. It does not write the bulk of the diary.
95
+
96
+ In-the-moment notes can also land here when the agent flags something
97
+ worth recording during reactive work.
98
+
99
+ ### Example entry
100
+
101
+ ```
102
+ ## Weekly 2026-W21
103
+ > Appended at: 2026-05-25 21:40
104
+
105
+ ### What worked
106
+ - Morning brief landed before the 09:00 standup three days running.
107
+ ### What slipped on my side
108
+ - Missed the Friday PR-review trigger — webhook arrived during quiet hours.
109
+ ### System improvement ideas
110
+ - Add Saturday to the Weekend day-type default so weekend pushes triage.
111
+ ### Metrics (agent side)
112
+ - Agent plan rows completed: 12
113
+ - Did-not-fire / failed rows: 1
114
+ - Observations reviewed / ignored: 18 / 4
115
+ ```
116
+
117
+ ## Append-only — enforced, not just convention
118
+
119
+ The journal is append-only at the API layer, not merely by prompt
120
+ discipline. `journal/agent.md` is the sole entry in `CREATE_ONLY_PUT`:
121
+ a `PUT` only succeeds if the file does not yet exist, and a `PATCH`
122
+ must use `append` or `append_to_file` mode. A `replace` or `clear`
123
+ PATCH is rejected outright, so a misbehaving (or prompt-injected) agent
124
+ cannot destroy history. Writes go through the daemon context API
125
+ (`PATCH /api/context/journal/agent`) — the agent has no direct
126
+ `Edit`/`Write` access to the file.
127
+
128
+ ## Where in the dashboard
129
+
130
+ - **Connections → Journal** (`/connections/journal`) is the read view
131
+ of the file.
132
+ - **Settings → Journal** (`/settings/journal`) controls retention and
133
+ which routines contribute.
86
134
 
87
135
  ## Configuration
88
136
 
89
- There is no per-entry configuration. The file is plain Markdown — you
90
- can hand-edit, prune, or git-version it like any other context file.
137
+ There is no per-entry configuration. The file is plain Markdown, so
138
+ **you** (the human owner) can hand-edit, prune, or git-version it like
139
+ any other context file — the API append-only guard applies only to the
140
+ agent's own writes, not to you editing the file on disk.
91
141
 
92
- ## When Something Goes Wrong
142
+ ## When something goes wrong
93
143
 
94
- - A journal that **stops growing** points at the evening review not
95
- running. See [Evening Review](../routines/evening-review.md).
96
- - A journal that **looks duplicated** usually means a routine retried
97
- after a fallback. The agent's own anti-duplicate check is best-effort,
98
- not bulletproof manual prune is fine.
144
+ - **The journal stops growing.** This usually points at the morning
145
+ routine's Stage B (the daily writer) or the evening/weekly review not
146
+ running. See [Morning Routine](../routines/morning-routine.md) and
147
+ [Evening Review](../routines/evening-review.md).
148
+ - **Entries look duplicated.** This usually means a routine retried
149
+ after a backend fallback. Because writes are append-only, a retry
150
+ can re-append rather than overwrite; the weekly review has an
151
+ idempotency check for its own section, but it is best-effort — a
152
+ manual prune is fine.
99
153
 
100
154
  ## Related
101
155
 
102
- - [Evening Review](../routines/evening-review.md) — the daily writer.
103
- - [Weekly Review](../routines/weekly-review.md) — the consumer.
104
- - [Activity](../operations/activity-and-conversations.md) — the
105
- action-shaped audit log, distinct from the journal.
156
+ - [Morning Routine](../routines/morning-routine.md) — the recurring
157
+ daily writer (Stage B).
158
+ - [Weekly Review](../routines/weekly-review.md) — the largest retro,
159
+ and the main consumer that reads prior entries back.
160
+ - [Evening Review](../routines/evening-review.md) — appends short
161
+ bookkeeping lines.
162
+ - [Activity & Conversations](../operations/activity-and-conversations.md)
163
+ — the action-shaped audit log, distinct from the reflection-shaped
164
+ journal.
165
+ - [Memory model](../../concepts/memory-model.md) — how the journal fits
166
+ the wider context vault.