@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
@@ -34,7 +34,7 @@ ask_examples:
34
34
  - How do I bridge two domains with `!connect`?
35
35
  locale: en-US
36
36
  created: 2026-05-12
37
- updated: 2026-05-12
37
+ updated: 2026-05-28
38
38
  keywords:
39
39
  - !ingest
40
40
  - !compile
@@ -52,18 +52,24 @@ related:
52
52
  - guides/maintain-wiki-health
53
53
  - guides/explore-with-trace-and-connect
54
54
  - troubleshooting/wiki-ingest-full-blocked
55
+ process_keys:
56
+ - wiki.ingest_url
57
+ - wiki.compile
58
+ - wiki.ask
59
+ - wiki.lint
60
+ - wiki.trace
61
+ - wiki.connect
55
62
  ui_anchors:
56
63
  - /wiki
57
64
  - /wiki/timeline
58
65
  - /settings/wiki
59
- - /approvals
60
66
  ---
61
67
 
62
68
  # Wiki Commands
63
69
 
64
- Use these from a paired DM channel after enabling the wiki — open
65
- **Setup → Settings → Wiki** to enable, then browse from **My Life →
66
- Wiki**.
70
+ Use these from a paired DM channel after enabling the wiki. Open
71
+ **Settings → Wiki** (`/settings/wiki`) to enable a workspace, then
72
+ browse the result from **My Life → Wiki** (`/wiki`).
67
73
 
68
74
  | Command | Effect |
69
75
  |---|---|
@@ -125,29 +131,32 @@ Settings → Wiki:
125
131
 
126
132
  - **Parallel** (default): all URLs fan out simultaneously up to the
127
133
  per-URL concurrency cap. Fastest; small risk of bursting rate
128
- limits at the URL host.
134
+ limits at the URL host. Each URL replies on its own completion.
129
135
  - **Serial**: URLs are enqueued in submitted order; each agent
130
136
  session starts only after the previous one completes. Slower but
131
- predictable budget and rate.
137
+ predictable budget and rate. You get a single consolidated reply
138
+ when the whole batch finishes.
132
139
 
133
- The acknowledgement DM tells you which mode ran
134
- (`in parallel` / `serially`).
140
+ The acknowledgement DM names the mode that ran (`in parallel` /
141
+ `serially`).
135
142
 
136
143
  ## `!compile full` — the Cost Gate
137
144
 
138
145
  Full rebuilds touch every wiki note and are the most expensive
139
146
  command in the wiki surface. The flow:
140
147
 
141
- 1. The bang handler estimates the cost (raw count × assumed input
142
- tokens × Sonnet unit cost, bracketed at 0.5× / 1× / 2×).
148
+ 1. The bang handler estimates the cost (raw note count × assumed
149
+ input tokens × Sonnet 4.6 input price, bracketed optimistic 0.5× /
150
+ expected 1× / pessimistic 2×).
143
151
  2. On an external git-tracked vault with **Auto-commit before
144
152
  `!compile full`** enabled and a clean working tree, Aitne runs
145
153
  `git add -A && git commit -m "aitne wiki: pre-compile snapshot <ts>"`
146
154
  before continuing. A dirty tree refuses the operation — commit or
147
155
  stash first.
148
- 3. If the pessimistic estimate exceeds your per-workspace approval
149
- threshold (default $2.00), the run is queued under **Approvals**
150
- in the dashboard. Approve from `/approvals` to start the compile.
156
+ 3. If the pessimistic estimate (expected spend × 2) exceeds your
157
+ per-workspace approval threshold (default $2.00), the run is queued
158
+ for approval. Open **Settings → Wiki** (`/settings/wiki`) and
159
+ confirm it in the Approvals queue there to start the compile.
151
160
  4. Otherwise, the run starts autonomously and you receive a
152
161
  completion DM with actual spend.
153
162
 
@@ -225,9 +234,10 @@ finding is itself useful.
225
234
 
226
235
  When no active wiki workspace exists, every `wiki.*`-routed bang
227
236
  command (`!ingest`, `!compile`, `!ask`, `!lint`, `!trace`, `!connect`)
228
- replies with:
237
+ replies with a message like:
229
238
 
230
- > Wiki is not enabled. Open `/settings/wiki` to enable.
239
+ > Wiki is not enabled. Open `/settings/wiki` to enable the internal
240
+ > workspace.
231
241
 
232
242
  `!wiki help` is exempt — it returns the command list regardless of
233
243
  enablement so you can discover the surface before opting in.
@@ -0,0 +1,240 @@
1
+ ---
2
+ schema_version: 1
3
+ slug: features/wiki/cost-and-approval
4
+ title: Wiki Cost Estimation and Approval Flow
5
+ id: wiki-cost-and-approval
6
+ aliases:
7
+ - wiki cost
8
+ - wiki approval
9
+ - !compile full approval
10
+ - wiki cost gate
11
+ - wiki cost estimate
12
+ - wiki budget
13
+ - wiki precompile snapshot
14
+ - git pre-compile
15
+ category: features
16
+ summary: |
17
+ How Aitne predicts the cost of a `!compile full` run, when the cost
18
+ gate escalates to the dashboard approval queue, and how the
19
+ pre-compile git snapshot interacts with both. Also covers the
20
+ `--preview` dry-run and how the same estimator powers the
21
+ per-workspace cost banner in `/settings/wiki`.
22
+ section: wiki
23
+ tags:
24
+ - wiki
25
+ - cost
26
+ - approval
27
+ - safety
28
+ - core
29
+ status: stable
30
+ ask_examples:
31
+ - How does !compile full estimate cost?
32
+ - When does !compile full need approval?
33
+ - How do I change the wiki approval threshold?
34
+ - What happens if my Obsidian vault is dirty before !compile full?
35
+ - Does !compile or !ingest need approval?
36
+ - How accurate is the wiki cost estimate?
37
+ - What is the pre-compile git snapshot?
38
+ - Why is my !compile full sitting in /approvals?
39
+ - Can I see the cost before running !compile full?
40
+ locale: en-US
41
+ created: 2026-05-21
42
+ updated: 2026-05-28
43
+ keywords:
44
+ - cost estimate
45
+ - cost bracket
46
+ - 0.5x
47
+ - 2x
48
+ - bracketed cost
49
+ - approval threshold
50
+ - !compile full
51
+ - approval queue
52
+ - /approvals
53
+ - dashboard approval
54
+ - git pre-compile
55
+ - pre-compile snapshot
56
+ - dirty working tree
57
+ - cost banner
58
+ - compile preview
59
+ - --preview
60
+ - --dry-run
61
+ - char to token
62
+ - token approximation
63
+ - CJK token ratio
64
+ related:
65
+ - features/wiki/overview
66
+ - features/wiki/commands
67
+ - features/wiki/workspaces
68
+ - features/operations/approvals
69
+ - concepts/costs-and-quotas
70
+ - guides/budget-and-cost-for-wiki
71
+ - troubleshooting/wiki-ingest-full-blocked
72
+ ui_anchors:
73
+ - /settings/wiki
74
+ - /
75
+ api_endpoints:
76
+ - /api/wiki/:workspace/estimate
77
+ - /api/wiki/:workspace/compile/preview
78
+ - /api/wiki/:workspace/git/status
79
+ - /api/approvals
80
+ process_keys:
81
+ - wiki.compile
82
+ config_keys:
83
+ - full_compile_approval_threshold_usd
84
+ ---
85
+
86
+ # Wiki Cost Estimation and Approval Flow
87
+
88
+ `!compile full` is the most expensive command in the wiki surface
89
+ because it touches every raw note in the workspace and rewrites the
90
+ canonical wiki pages from scratch. Aitne predicts the cost before
91
+ the run starts and gates the actual execution behind an approval
92
+ threshold you control per workspace.
93
+
94
+ The same estimator backs four surfaces so the numbers cannot drift:
95
+
96
+ - `GET /api/wiki/:workspace/estimate` — the dashboard banner in
97
+ `/settings/wiki` reads from here so you can see what the next
98
+ `!compile full` will cost before running it.
99
+ - `GET /api/wiki/:workspace/compile/preview` — the `--preview`
100
+ dry-run.
101
+ - The `!compile` / `!compile full` bang handler — uses the same
102
+ estimate to decide whether the run starts autonomously or
103
+ escalates to approvals.
104
+ - The DM acknowledgement message — quotes the bracketed estimate
105
+ back to the user.
106
+
107
+ ## How the estimator works
108
+
109
+ Pure JS, no agent session, no SDK call. The estimator
110
+ (`packages/daemon/src/core/wiki/cost-estimate.ts`) opens each raw
111
+ note under `10_raw/`, approximates its token count from on-disk
112
+ content, then multiplies the total by the tier unit cost and
113
+ brackets with 0.5×/2× multipliers.
114
+
115
+ ### Character → token approximation
116
+
117
+ - **Latin / English content** — ~4 chars per token. The well-known
118
+ OpenAI rule-of-thumb; matches Anthropic's tokenizer within ±15%
119
+ for prose; confirmed against the gpt-tokenizer dist.
120
+ - **CJK content** — ~1.5 chars per token. BPE merges short CJK runs
121
+ but not as aggressively as Latin word fragments.
122
+
123
+ The classifier counts Unicode code points whose script is one of
124
+ Han, Hiragana, Katakana, Hangul, Bopomofo. If the document is
125
+ majority-CJK we apply the CJK divisor to the entire file; otherwise
126
+ Latin. A per-script split per file would be marginally more accurate
127
+ but adds 30% code for a sub-percent gain on typical mixed-script
128
+ files.
129
+
130
+ ### The 0.5×/2× bracket
131
+
132
+ The estimator never returns a single number. It always returns three:
133
+
134
+ | Field | Meaning |
135
+ |---|---|
136
+ | `expectedUsd` | The point estimate: total approximated tokens × tier input cost. |
137
+ | `optimisticUsd` | 0.5× `expectedUsd` — the "everything compresses well, the LLM exits early" scenario. |
138
+ | `pessimisticUsd` | 2× `expectedUsd` — the "the LLM rewrites every page from scratch" scenario. **The approval gate compares this against your threshold.** |
139
+
140
+ The bracket is wide on purpose. `!compile` is an LLM and may merge
141
+ or skip pages inside the agent loop in ways the estimator cannot
142
+ predict from on-disk content alone — but the pessimistic bound will
143
+ not undercount the actual touch set.
144
+
145
+ (History: P2 originally shipped a flat `rawCount × 1500` heuristic.
146
+ P4.C upgraded to the per-file char→token approximation above because
147
+ the flat heuristic under-counted on long ingested articles and
148
+ over-counted on one-line stubs.)
149
+
150
+ ## The cost gate
151
+
152
+ The `!compile full` flow:
153
+
154
+ 1. **Estimate** — bang handler calls the estimator.
155
+ 2. **Pre-compile snapshot** — on an external git-tracked vault with
156
+ `git_pre_compile_enabled = 1` (the default) and a clean working
157
+ tree, Aitne runs `git add -A && git commit -m "aitne wiki:
158
+ pre-compile snapshot <ts>"` before continuing. A dirty tree
159
+ refuses the operation — commit or stash first, then re-run.
160
+ 3. **Threshold check** — if `pessimisticUsd` ≤ the workspace's
161
+ `full_compile_approval_threshold_usd` (default $2.00), the run
162
+ starts autonomously.
163
+ 4. **Approval** — if `pessimisticUsd` > the threshold, the run is
164
+ queued under the **Approvals** panel on the dashboard home (`/`).
165
+ The acknowledgement DM links there; approve from the dashboard to
166
+ start the compile.
167
+ 5. **Completion** — a completion DM lands with the actual spend (not
168
+ the estimate). Significant overshoots are flagged in the audit
169
+ row.
170
+
171
+ `!compile` (incremental) does not go through the cost gate — it's
172
+ only invoked when raw notes have changed since the last compile, and
173
+ its budget envelope is bounded by the per-process `maxBudgetUsd`
174
+ (default $5.00). The same applies to `!ingest`, `!ask`, `!lint`,
175
+ `!trace`, `!connect`.
176
+
177
+ ## Changing the threshold
178
+
179
+ Per workspace, in `/settings/wiki` — the **Approval threshold (USD)**
180
+ input. The value lives on `wiki_workspaces.full_compile_approval_threshold_usd`
181
+ with a CHECK constraint `> 0`. Setting it lower escalates more runs
182
+ to manual approval; setting it higher trusts the estimator more.
183
+
184
+ A common pattern: start at $2.00, watch the spend on the next
185
+ `!compile full`, then dial up or down based on how close the
186
+ estimate landed to the actual cost.
187
+
188
+ ## The pre-compile git snapshot
189
+
190
+ Only meaningful on an **external + git-tracked** vault. The gate
191
+ decides:
192
+
193
+ | Workspace state | Outcome |
194
+ |---|---|
195
+ | Internal mode | Skip (`NotApplicable`). The `md_file_snapshots` mechanism is the recovery surface. |
196
+ | External, not a git repo | Skip (`NoBackup`). The approval-gate DM tells you no git backup was taken. |
197
+ | External + git, `git_pre_compile_enabled = 0` | Skip (`Disabled`). |
198
+ | External + git, **dirty** working tree | **Refused.** The bang handler aborts with a DM telling you to commit or stash first; no agent session is spawned. |
199
+ | External + git, clean working tree | Run `git add -A` + `git commit -m "aitne wiki: pre-compile snapshot <ts>"`. Operator git hooks fire as normal (no `--no-verify`). |
200
+
201
+ The snapshot is your rollback target if `!compile full` produces a
202
+ surprise — `git reset --hard <snapshot-commit>` puts the vault back.
203
+
204
+ The pre-compile commit uses no special author identity; it lands
205
+ under whatever git is configured to use. If you co-author with
206
+ Aitne, you'll want to set that up at the git config level.
207
+
208
+ ## The `--preview` dry-run
209
+
210
+ `!compile --preview` (alias: `--dry-run`) calls
211
+ `GET /api/wiki/:workspace/compile/preview` to show what `!compile`
212
+ would do without spending tokens:
213
+
214
+ - **added** — wiki pages that would be created (raws with no
215
+ existing wiki match).
216
+ - **modified** — wiki pages that would be rewritten (raws whose
217
+ slug matches an existing wiki page).
218
+ - **unchanged** — wiki pages the compile is expected to skip.
219
+ - **est. cost** — Optimistic / pessimistic bracket plus expected
220
+ spend.
221
+ - **est. duration** — Rough wall-clock estimate (intentionally
222
+ pessimistic).
223
+
224
+ The preview is an upper bound for the same reason the cost bracket is
225
+ (the compile is an LLM and may merge or skip pages mid-loop), but it
226
+ will not undercount the touch set. Reply `!compile` (or `!compile
227
+ full`) to actually run.
228
+
229
+ The preview is free — no agent session runs, no tokens spent.
230
+
231
+ ## See also
232
+
233
+ - [features/wiki/commands](commands.md) for the user-facing reference
234
+ of every wiki bang command.
235
+ - [features/wiki/workspaces](workspaces.md) for where the per-workspace
236
+ threshold and git toggle live in `/settings/wiki`.
237
+ - [features/operations/approvals](../operations/approvals.md) for the
238
+ general dashboard approval flow.
239
+ - [guides/budget-and-cost-for-wiki](../../guides/budget-and-cost-for-wiki.md)
240
+ for the operator-level "tune the budget" walkthrough.
@@ -0,0 +1,255 @@
1
+ ---
2
+ schema_version: 1
3
+ slug: features/wiki/dashboard
4
+ title: Wiki Dashboard Surfaces
5
+ id: wiki-dashboard
6
+ aliases:
7
+ - wiki dashboard
8
+ - wiki ui
9
+ - wiki page
10
+ - wiki timeline page
11
+ - wiki settings page
12
+ - /wiki
13
+ - /wiki/timeline
14
+ - /settings/wiki
15
+ category: features
16
+ summary: |
17
+ Reference for the three dashboard surfaces the wiki feature renders:
18
+ `/wiki` (workspace summary + index + recent activity), `/wiki/timeline`
19
+ (full chronological log + latest health report), and `/settings/wiki`
20
+ (configuration). Explains what each card shows, where the data comes
21
+ from on disk, and what to do when a card is empty.
22
+ section: wiki
23
+ tags:
24
+ - wiki
25
+ - dashboard
26
+ - reference
27
+ - core
28
+ status: stable
29
+ ask_examples:
30
+ - What does the /wiki page show?
31
+ - Where do I find the wiki health report?
32
+ - Why is the Recent activity card empty?
33
+ - How do I see every !ingest run for a workspace?
34
+ - Where is the wiki configuration page?
35
+ - What is _index.md and where does the wiki page render it?
36
+ - How is /wiki different from /wiki/timeline?
37
+ - What does the Enable Wiki button do?
38
+ locale: en-US
39
+ created: 2026-05-21
40
+ updated: 2026-05-28
41
+ keywords:
42
+ - /wiki
43
+ - /wiki/timeline
44
+ - /settings/wiki
45
+ - wiki dashboard
46
+ - workspace summary card
47
+ - _index.md
48
+ - log.md
49
+ - health report
50
+ - 90_meta/health
51
+ - recent activity
52
+ - timeline filter
53
+ - Enable Wiki CTA
54
+ - vault path picker
55
+ related:
56
+ - features/wiki/overview
57
+ - features/wiki/commands
58
+ - features/wiki/workspaces
59
+ - features/wiki/cost-and-approval
60
+ - guides/build-your-wiki
61
+ - guides/maintain-wiki-health
62
+ - guides/use-an-existing-obsidian-vault
63
+ ui_anchors:
64
+ - /wiki
65
+ - /wiki/timeline
66
+ - /settings/wiki
67
+ api_endpoints:
68
+ - /api/wiki/workspaces
69
+ - /api/wiki/:workspace/index
70
+ - /api/wiki/:workspace/files/log.md
71
+ - /api/wiki/:workspace/health
72
+ - /api/wiki/:workspace/estimate
73
+ - /api/wiki/:workspace/compile/preview
74
+ process_keys:
75
+ - wiki.ask
76
+ - wiki.compile
77
+ - wiki.ingest_url
78
+ - wiki.lint
79
+ - wiki.trace
80
+ - wiki.connect
81
+ ---
82
+
83
+ # Wiki Dashboard Surfaces
84
+
85
+ The wiki has three distinct pages in the dashboard. The split mirrors
86
+ Aitne's broader IA: content browsing lives under **My Life**,
87
+ configuration lives under **Setup → Settings**. The pages share a
88
+ single read path through the daemon's `/api/wiki/*` routes — every
89
+ request carries an `x-process-key: wiki.ask` header so the safety
90
+ layer can attribute reads correctly.
91
+
92
+ ## `/wiki` — workspace home
93
+
94
+ The page you open most often. Three cards stacked top-down:
95
+
96
+ ### 1. Workspace summary
97
+
98
+ A single card with the workspace name, root path, kind badge
99
+ (`Internal` / `External`), language badge, and a stats table:
100
+
101
+ | Stat | Source |
102
+ |---|---|
103
+ | Raw notes | Count of files under `10_raw/` |
104
+ | Wiki pages | Count of files under `20_wiki/` |
105
+ | Outputs | Count of files under `30_outputs/` |
106
+ | Last ingest | `wiki_workspaces.last_ingest_at` |
107
+ | Last compile | `wiki_workspaces.last_compile_at` |
108
+
109
+ Two action buttons at the bottom of the card: **Timeline & health**
110
+ (jumps to `/wiki/timeline`) and **Configuration** (jumps to
111
+ `/settings/wiki`).
112
+
113
+ ### 2. Index
114
+
115
+ Renders the latest `20_wiki/_index.md`, the LLM-maintained catalogue
116
+ of wiki pages. The agent rewrites this file at the end of every
117
+ `!compile` run.
118
+
119
+ States:
120
+ - **Empty** — no `_index.md` yet; the CTA tells you to run `!compile`
121
+ from a DM.
122
+ - **Loaded** — the file is rendered verbatim as a monospaced code
123
+ block (the index uses wikilink syntax, so rendering as markdown
124
+ would lose information).
125
+
126
+ ### 3. Recent activity
127
+
128
+ The last 8 entries from `log.md`, the wiki's append-only operational
129
+ log. Each entry shows the wiki process key (`wiki.ingest_url`,
130
+ `wiki.compile`, `wiki.ask`, `wiki.lint`, `wiki.trace`, `wiki.connect`),
131
+ the operation (`write`, `delete`, …), the affected path, and the
132
+ timestamp. A **View full timeline** button at the top of the card
133
+ opens `/wiki/timeline`.
134
+
135
+ A freshly-enabled wiki has no `log.md` yet — the route returns 404
136
+ and the card shows the "No activity yet" hint instead of a scary
137
+ error toast.
138
+
139
+ ### Disabled state
140
+
141
+ When no `active=1` workspace exists in `wiki_workspaces`, the page
142
+ shows an **Enable Wiki** CTA that jumps to `/settings/wiki`. The
143
+ sidebar entry is always visible (gated only on the workspace
144
+ catalogue being reachable), so this disabled state is reachable via
145
+ the sidebar, a deep link, or browser history.
146
+
147
+ ## `/wiki/timeline` — full chronological history + health
148
+
149
+ Two surfaces stacked on one page:
150
+
151
+ ### 1. Latest health report
152
+
153
+ Renders the newest `90_meta/health/<YYYY-MM-DD>.md` produced by
154
+ `!lint`. The card shows:
155
+
156
+ - A purple date badge and the source file path.
157
+ - A `## Summary` block (bulleted list).
158
+ - An `## Action items` list (the punch-list of orphan notes, broken
159
+ wikilinks, schema drift, taxonomy candidates, and stale-note
160
+ warnings).
161
+ - A collapsible **View full report** button that reveals the raw
162
+ Markdown body of the report.
163
+
164
+ Empty state: "No health reports yet — send `!lint` from a DM to
165
+ generate the first one."
166
+
167
+ ### 2. Activity timeline
168
+
169
+ A reverse-chronological view of `log.md` with a process-key filter.
170
+ The filter dropdown lists every distinct `wiki.*` key found in the
171
+ log plus an **All commands** default. Entries render the same way
172
+ they do in the `/wiki` recent-activity card — process-key badge,
173
+ operation, path, timestamp.
174
+
175
+ Both surfaces read live from the wiki API; the timeline page is a
176
+ pure rendering pass over files the wiki skills already produce — no
177
+ extra daemon-side schema backs them.
178
+
179
+ ## `/settings/wiki` — configuration
180
+
181
+ The configuration surface. Two-state:
182
+
183
+ ### Disabled (no active workspace)
184
+
185
+ A two-card chooser:
186
+
187
+ - **Internal** (recommended) — managed by Aitne in its data directory
188
+ (default `~/.personal-agent/wiki`), schema seeded automatically.
189
+ The **Enable internal wiki** button turns it on with nothing else
190
+ to configure.
191
+ - **Existing Obsidian vault** (external) — point Aitne at a folder you
192
+ already own via the path picker, then confirm with **Use this
193
+ folder**.
194
+
195
+ The path picker opens your OS-native folder dialog (Finder on macOS,
196
+ File Explorer on Windows, the system folder dialog on Linux) and shows
197
+ an inline validation banner once you pick a path:
198
+
199
+ - Path-collision rules — the external root must not overlap
200
+ `dataDir`, your primary Obsidian vault, or another wiki workspace.
201
+ - Existing-Obsidian-vault detection — when the picker finds an
202
+ Obsidian vault at the target, the wiki layout is detected and
203
+ migrated on demand so you can import the vault's content (see
204
+ [guides/use-an-existing-obsidian-vault](../../guides/use-an-existing-obsidian-vault.md)
205
+ and [features/wiki/workspaces](workspaces.md)).
206
+
207
+ ### Enabled
208
+
209
+ The full configuration:
210
+
211
+ - **Workspace** — name, kind (internal / external), root path, language.
212
+ - **Dispatch mode** for `!ingest` (Parallel / Serial) and the
213
+ concurrency cap.
214
+ - **Write strategy** (`fs` / `cli` / `auto`) — internal workspaces
215
+ always use `fs`; external workspaces start in `auto` and probe on
216
+ first write (see [features/wiki/workspaces](workspaces.md)).
217
+ - **Git auto-commit before `!compile full`** toggle (only meaningful
218
+ on a git-tracked external vault).
219
+ - **Approval threshold (USD)** for `!compile full`.
220
+ - **Commands & models** — per-command selectors for the backend,
221
+ model, turn limit, and per-run budget on each `wiki.*` process key
222
+ (`wiki.ingest_url`, `wiki.compile`, `wiki.ask`, `wiki.lint`,
223
+ `wiki.trace`, `wiki.connect`). All six default to the medium tier
224
+ (Claude Sonnet 4.6) with a sensible `maxTurns` / `maxBudgetUsd`; you
225
+ can override per key.
226
+ - **Archive / delete** — archive keeps the row but flips `active=0`;
227
+ delete drops the row (data on disk is untouched on external mode).
228
+
229
+ The top of the enabled page carries a **Browse wiki** link that jumps
230
+ back to `/wiki`.
231
+
232
+ ## Where each surface reads from
233
+
234
+ | Surface | API route | On-disk source |
235
+ |---|---|---|
236
+ | Workspace summary | `GET /api/wiki/workspaces` | `wiki_workspaces` table |
237
+ | Index card | `GET /api/wiki/:ws/index` | `20_wiki/_index.md` |
238
+ | Recent activity | `GET /api/wiki/:ws/files/log.md` | `log.md` |
239
+ | Health report | `GET /api/wiki/:ws/index` + `/files/...` | `90_meta/health/<date>.md` |
240
+ | Activity timeline | `GET /api/wiki/:ws/files/log.md` | `log.md` |
241
+ | Settings | `GET /api/wiki/workspaces`, `PATCH /api/wiki/workspaces/:ws` | `wiki_workspaces` table |
242
+
243
+ Every wiki API request is gated by the `x-process-key` header. The
244
+ dashboard uses `wiki.ask` as the closest read-only intent; the
245
+ auth layer accepts any `wiki.*` key for GETs (see
246
+ `authorizeWikiRequest` in `packages/daemon/src/api/routes/wiki.ts`).
247
+
248
+ ## Contextual help
249
+
250
+ Every wiki page in the dashboard exposes a `?` Help button in the
251
+ top-right action strip. Clicking it opens the relevant wiki doc in a
252
+ slide-over for in-context reading (mirrors the global help pattern
253
+ used everywhere else in the dashboard). `/wiki/timeline` opens this
254
+ doc; `/wiki` opens [features/wiki/overview](overview.md) and
255
+ `/settings/wiki` opens [features/wiki/workspaces](workspaces.md).