@aitne-sh/aitne 0.1.6 → 0.1.8

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 (222) hide show
  1. package/README.md +195 -1029
  2. package/agent-assets/agent-profiles/_safety.md +49 -17
  3. package/agent-assets/agent-profiles/profile-importer.md +1 -1
  4. package/agent-assets/agent-profiles/routine.md +4 -3
  5. package/agent-assets/docs/concepts/agent-day.md +6 -1
  6. package/agent-assets/docs/concepts/auth-health.md +10 -1
  7. package/agent-assets/docs/concepts/backends-and-tiers.md +74 -40
  8. package/agent-assets/docs/concepts/costs-and-quotas.md +25 -5
  9. package/agent-assets/docs/concepts/delegated-mode.md +147 -68
  10. package/agent-assets/docs/concepts/memory-model.md +9 -4
  11. package/agent-assets/docs/concepts/observations.md +13 -1
  12. package/agent-assets/docs/concepts/process-keys.md +20 -5
  13. package/agent-assets/docs/concepts/routines.md +38 -20
  14. package/agent-assets/docs/concepts/safety-model.md +30 -13
  15. package/agent-assets/docs/concepts/skills.md +12 -7
  16. package/agent-assets/docs/features/integrations/calendar.md +1 -1
  17. package/agent-assets/docs/features/integrations/git.md +2 -2
  18. package/agent-assets/docs/features/integrations/github.md +9 -2
  19. package/agent-assets/docs/features/integrations/mail.md +1 -1
  20. package/agent-assets/docs/features/integrations/notion.md +34 -6
  21. package/agent-assets/docs/features/integrations/obsidian.md +7 -2
  22. package/agent-assets/docs/features/lifestyle/git.md +4 -7
  23. package/agent-assets/docs/features/lifestyle/receipts.md +17 -2
  24. package/agent-assets/docs/features/lifestyle/travel-bookings.md +15 -0
  25. package/agent-assets/docs/features/lifestyle/travel-time.md +7 -1
  26. package/agent-assets/docs/features/memory-files/agent-journal.md +2 -2
  27. package/agent-assets/docs/features/memory-files/projects.md +6 -0
  28. package/agent-assets/docs/features/memory-files/roadmap.md +5 -0
  29. package/agent-assets/docs/features/memory-files/today.md +1 -0
  30. package/agent-assets/docs/features/memory-files/user-profile.md +6 -0
  31. package/agent-assets/docs/features/messaging/bang-commands.md +20 -10
  32. package/agent-assets/docs/features/messaging/discord.md +12 -1
  33. package/agent-assets/docs/features/messaging/overview.md +10 -7
  34. package/agent-assets/docs/features/messaging/slack.md +13 -1
  35. package/agent-assets/docs/features/messaging/telegram.md +7 -1
  36. package/agent-assets/docs/features/messaging/whatsapp.md +12 -1
  37. package/agent-assets/docs/features/operations/activity-and-conversations.md +2 -2
  38. package/agent-assets/docs/features/operations/approvals.md +6 -0
  39. package/agent-assets/docs/features/operations/backend-routing.md +7 -0
  40. package/agent-assets/docs/features/operations/cost-tracking.md +6 -0
  41. package/agent-assets/docs/features/operations/notifications.md +6 -0
  42. package/agent-assets/docs/features/operations/schedule-approaching.md +22 -9
  43. package/agent-assets/docs/features/routines/custom-routines.md +10 -4
  44. package/agent-assets/docs/features/routines/evening-review.md +1 -1
  45. package/agent-assets/docs/features/routines/hourly-check.md +1 -1
  46. package/agent-assets/docs/features/routines/morning-routine.md +24 -15
  47. package/agent-assets/docs/features/routines/weekly-review.md +38 -12
  48. package/agent-assets/docs/features/wiki/commands.md +11 -0
  49. package/agent-assets/docs/features/wiki/overview.md +13 -3
  50. package/agent-assets/docs/getting-started/01-what-is-this.md +32 -11
  51. package/agent-assets/docs/getting-started/02-first-steps.md +17 -4
  52. package/agent-assets/docs/getting-started/03-what-can-this-do.md +21 -11
  53. package/agent-assets/docs/getting-started/04-first-day.md +14 -0
  54. package/agent-assets/docs/glossary.md +65 -12
  55. package/agent-assets/docs/guides/add-a-custom-routine.md +12 -0
  56. package/agent-assets/docs/guides/backup-and-restore.md +16 -2
  57. package/agent-assets/docs/guides/budget-and-cost-for-wiki.md +6 -0
  58. package/agent-assets/docs/guides/build-your-wiki.md +14 -0
  59. package/agent-assets/docs/guides/change-which-model-handles-x.md +7 -0
  60. package/agent-assets/docs/guides/connect-a-new-mail-account.md +16 -0
  61. package/agent-assets/docs/guides/explore-with-trace-and-connect.md +6 -0
  62. package/agent-assets/docs/guides/import-knowledge-file.md +11 -0
  63. package/agent-assets/docs/guides/install-and-run.md +20 -4
  64. package/agent-assets/docs/guides/maintain-wiki-health.md +6 -0
  65. package/agent-assets/docs/guides/migrate-machines.md +13 -1
  66. package/agent-assets/docs/guides/multiple-wikis-for-multiple-domains.md +9 -0
  67. package/agent-assets/docs/guides/pause-the-agent.md +12 -4
  68. package/agent-assets/docs/guides/reinstall-cleanly.md +19 -4
  69. package/agent-assets/docs/guides/setup-wizard.md +20 -9
  70. package/agent-assets/docs/guides/switch-default-backend.md +10 -1
  71. package/agent-assets/docs/guides/use-an-existing-obsidian-vault.md +5 -0
  72. package/agent-assets/docs/reference/api.md +29 -1
  73. package/agent-assets/docs/reference/cli-commands.md +22 -3
  74. package/agent-assets/docs/reference/config.md +37 -5
  75. package/agent-assets/docs/reference/disallowed-tools.md +13 -0
  76. package/agent-assets/docs/reference/keyboard-shortcuts.md +13 -0
  77. package/agent-assets/docs/reference/process-keys.md +70 -20
  78. package/agent-assets/docs/reference/skills.md +27 -9
  79. package/agent-assets/docs/troubleshooting/auth-failed.md +7 -2
  80. package/agent-assets/docs/troubleshooting/dashboard-shows-degraded.md +13 -1
  81. package/agent-assets/docs/troubleshooting/fallback-keeps-firing.md +10 -0
  82. package/agent-assets/docs/troubleshooting/messaging-not-pairing.md +11 -0
  83. package/agent-assets/docs/troubleshooting/morning-routine-didnt-run.md +9 -4
  84. package/agent-assets/docs/troubleshooting/observation-not-detected.md +12 -0
  85. package/agent-assets/docs/troubleshooting/quota-exhausted.md +7 -1
  86. package/agent-assets/docs/troubleshooting/wiki-ingest-full-blocked.md +5 -0
  87. package/agent-assets/docs/troubleshooting/wiki-write-failed.md +5 -0
  88. package/agent-assets/optimizer-skills/drift-analysis/SKILL.md +1 -1
  89. package/agent-assets/optimizer-skills/skill-curation/SKILL.md +2 -2
  90. package/agent-assets/skills/agent-actions/SKILL.md +122 -0
  91. package/agent-assets/skills/attach/SKILL.md +1 -2
  92. package/agent-assets/skills/context/SKILL.md +36 -454
  93. package/agent-assets/skills/context/references/api.md +220 -0
  94. package/agent-assets/skills/context/references/required-frontmatter.md +73 -0
  95. package/agent-assets/skills/context/references/snapshot-files.md +103 -0
  96. package/agent-assets/skills/context/seeds/file-responsibilities.seed.json +1 -1
  97. package/agent-assets/skills/docs-search/SKILL.md +13 -13
  98. package/agent-assets/skills/external-services/SKILL.delegated.claude.md +5 -7
  99. package/agent-assets/skills/external-services/SKILL.delegated.codex.md +5 -7
  100. package/agent-assets/skills/external-services/SKILL.delegated.gemini.md +5 -7
  101. package/agent-assets/skills/external-services/SKILL.md +6 -259
  102. package/agent-assets/skills/external-services/SKILL.native.claude.md +1 -2
  103. package/agent-assets/skills/external-services/SKILL.native.codex.md +1 -2
  104. package/agent-assets/skills/external-services/SKILL.native.gemini.md +1 -2
  105. package/agent-assets/skills/external-services/references/calendar-apple.md +97 -0
  106. package/agent-assets/skills/external-services/references/calendar-google.md +72 -0
  107. package/agent-assets/skills/external-services/references/calendar-outlook.md +36 -0
  108. package/agent-assets/skills/external-services/references/github.md +17 -0
  109. package/agent-assets/skills/external-services/references/obsidian.md +49 -0
  110. package/agent-assets/skills/external-services/references/skills-crud.md +27 -0
  111. package/agent-assets/skills/gmail-lifestyle/SKILL.md +224 -0
  112. package/agent-assets/skills/gmail-lifestyle/references/receipts-api.md +93 -0
  113. package/agent-assets/skills/gmail-lifestyle/references/travel-bookings-api.md +75 -0
  114. package/agent-assets/skills/gmail-lifestyle/references/travel-time-api.md +59 -0
  115. package/agent-assets/skills/mail/SKILL.delegated.claude.md +1 -1
  116. package/agent-assets/skills/mail/SKILL.delegated.codex.md +1 -1
  117. package/agent-assets/skills/mail/SKILL.delegated.gemini.md +1 -1
  118. package/agent-assets/skills/mail/SKILL.md +9 -114
  119. package/agent-assets/skills/mail/SKILL.native.claude.md +1 -1
  120. package/agent-assets/skills/mail/SKILL.native.codex.md +1 -1
  121. package/agent-assets/skills/mail/SKILL.native.gemini.md +1 -1
  122. package/agent-assets/skills/mail/references/api.md +108 -0
  123. package/agent-assets/skills/mail/references/examples.md +70 -0
  124. package/agent-assets/skills/mail/references/providers.md +8 -8
  125. package/agent-assets/skills/managed-tasks/SKILL.md +472 -0
  126. package/agent-assets/skills/managed-tasks/references/errors.md +70 -0
  127. package/agent-assets/skills/managed-tasks/references/output-path.md +75 -0
  128. package/agent-assets/skills/managed-tasks/references/recurrence-rule.md +86 -0
  129. package/agent-assets/skills/management-policy/SKILL.md +33 -105
  130. package/agent-assets/skills/management-policy/references/policy-workflow.md +101 -0
  131. package/agent-assets/skills/notify/SKILL.md +6 -78
  132. package/agent-assets/skills/notify/references/priority.md +60 -0
  133. package/agent-assets/skills/notion/SKILL.delegated.claude.md +1 -1
  134. package/agent-assets/skills/notion/SKILL.delegated.codex.md +1 -1
  135. package/agent-assets/skills/notion/SKILL.delegated.gemini.md +1 -1
  136. package/agent-assets/skills/notion/SKILL.md +6 -10
  137. package/agent-assets/skills/notion/SKILL.native.claude.md +1 -2
  138. package/agent-assets/skills/notion/SKILL.native.codex.md +1 -2
  139. package/agent-assets/skills/notion/SKILL.native.gemini.md +1 -2
  140. package/agent-assets/skills/observations/SKILL.md +1 -6
  141. package/agent-assets/skills/project-doc/SKILL.md +1 -5
  142. package/agent-assets/skills/reading/SKILL.md +2 -2
  143. package/agent-assets/skills/roadmap/SKILL.md +37 -135
  144. package/agent-assets/skills/roadmap/references/api.md +100 -0
  145. package/agent-assets/skills/roadmap/references/cross-check.md +73 -0
  146. package/agent-assets/skills/roadmap/references/migration.md +56 -0
  147. package/agent-assets/skills/roadmap/references/preparation-timeline.md +2 -2
  148. package/agent-assets/skills/schedule/SKILL.md +52 -88
  149. package/agent-assets/skills/schedule/references/batch.md +93 -0
  150. package/agent-assets/skills/schedule/references/errors.md +214 -0
  151. package/agent-assets/skills/schedule/references/model-selection.md +96 -0
  152. package/agent-assets/skills/schedule/references/recurrence-rule.md +86 -0
  153. package/agent-assets/skills/schedule/references/recurring.md +185 -0
  154. package/agent-assets/skills/scheduled-managed-task/SKILL.md +13 -15
  155. package/agent-assets/skills/today/SKILL.md +27 -57
  156. package/agent-assets/skills/today/references/agent-plan-lifecycle.md +113 -0
  157. package/agent-assets/skills/user-interview/SKILL.md +12 -59
  158. package/agent-assets/skills/user-interview/references/op-briefing.md +51 -0
  159. package/agent-assets/skills/user-interview/references/op-morning.md +59 -0
  160. package/agent-assets/skills/user-interview/references/sweep-and-fallback.md +1 -1
  161. package/agent-assets/skills/user-profile/SKILL.md +43 -63
  162. package/agent-assets/skills/user-profile/references/character-preferences.md +83 -0
  163. package/agent-assets/skills/user-profile/seeds/topic-files.seed.json +28 -0
  164. package/agent-assets/skills/wiki/wiki-ask/SKILL.md +0 -1
  165. package/agent-assets/skills/wiki/wiki-compile/SKILL.md +0 -1
  166. package/agent-assets/skills/wiki/wiki-connect/SKILL.md +0 -1
  167. package/agent-assets/skills/wiki/wiki-graduate/SKILL.md +0 -1
  168. package/agent-assets/skills/wiki/wiki-ingest/SKILL.md +0 -1
  169. package/agent-assets/skills/wiki/wiki-lint/SKILL.md +0 -1
  170. package/agent-assets/skills/wiki/wiki-trace/SKILL.md +0 -1
  171. package/agent-assets/skills/wiki/wiki-vault-rules/SKILL.md +0 -1
  172. package/agent-assets/system-prompts/routine-fetch-window.md +68 -0
  173. package/agent-assets/system-prompts/skill-index-instruction.md +26 -0
  174. package/agent-assets/task-flows/_partials/calendar-acquire.google_calendar.md +18 -11
  175. package/agent-assets/task-flows/_partials/calendar-acquire.outlook_calendar.md +16 -9
  176. package/agent-assets/task-flows/_partials/capture-user-info.md +24 -0
  177. package/agent-assets/task-flows/_partials/confirm-subflow.md +68 -0
  178. package/agent-assets/task-flows/_partials/dm-intent.long-horizon.md +35 -0
  179. package/agent-assets/task-flows/_partials/dm-intent.project.md +391 -0
  180. package/agent-assets/task-flows/_partials/mail-acquire.gmail.md +20 -11
  181. package/agent-assets/task-flows/_partials/mail-acquire.outlook_mail.md +17 -9
  182. package/agent-assets/task-flows/_partials/notion-acquire.notion.md +18 -12
  183. package/agent-assets/task-flows/knowledge.import.md +1 -1
  184. package/agent-assets/task-flows/message.received.dm.md +13 -15
  185. package/agent-assets/task-flows/message.received.dm_first.md +10 -14
  186. package/agent-assets/task-flows/routine.custom.md +3 -1
  187. package/agent-assets/task-flows/routine.evening_review.md +39 -163
  188. package/agent-assets/task-flows/routine.fetch_window.md +17 -12
  189. package/agent-assets/task-flows/routine.hourly_check.md +16 -8
  190. package/agent-assets/task-flows/routine.hourly_check.triage.md +1 -1
  191. package/agent-assets/task-flows/routine.monthly_review.md +46 -4
  192. package/agent-assets/task-flows/routine.morning_routine_journal.md +113 -0
  193. package/agent-assets/task-flows/routine.morning_routine_today.md +673 -0
  194. package/agent-assets/task-flows/routine.roadmap_refresh.md +60 -15
  195. package/agent-assets/task-flows/routine.user_profile_sweep.md +9 -10
  196. package/agent-assets/task-flows/routine.weekly_review.md +285 -70
  197. package/agent-assets/task-flows/scheduled.dm.md +8 -8
  198. package/agent-assets/task-flows/scheduled.task.md +5 -5
  199. package/agent-assets/task-flows/setup.initial.md +165 -245
  200. package/agent-assets/task-flows/wiki.ingest_url.md +1 -1
  201. package/agent-assets/templates/_manifest.json +7 -7
  202. package/agent-assets/templates/dossiers/_index.md +1 -1
  203. package/agent-assets/templates/rules/journal-format.md +145 -38
  204. package/agent-assets/templates/user/expertise.md +4 -2
  205. package/agent-assets/templates/user/goals.md +4 -2
  206. package/agent-assets/templates/user/people.md +8 -2
  207. package/agent-assets/templates/user/personal.md +4 -2
  208. package/agent-assets/templates/user/work.md +4 -2
  209. package/bin/aitne.mjs +8 -1
  210. package/package.json +4 -4
  211. package/scripts/commands/doctor.mjs +52 -0
  212. package/scripts/commands/run-now.mjs +202 -0
  213. package/scripts/commands/verify.mjs +264 -0
  214. package/agent-assets/docs/features/routines/monthly-review.md +0 -65
  215. package/agent-assets/skills/management-task-modify/SKILL.md +0 -203
  216. package/agent-assets/skills/management-task-register/SKILL.md +0 -330
  217. package/agent-assets/skills/management-task-stop/SKILL.md +0 -166
  218. package/agent-assets/skills/receipts/SKILL.md +0 -134
  219. package/agent-assets/skills/travel/SKILL.md +0 -132
  220. package/agent-assets/skills/travel-time/SKILL.md +0 -158
  221. package/agent-assets/task-flows/routine.morning_routine.md +0 -322
  222. package/agent-assets/task-flows/routine.morning_routine_initial.md +0 -204
@@ -24,28 +24,60 @@
24
24
  - **Read-before-write**: PATCH `mode=replace` replaces the entire section.
25
25
  Always GET first, merge your changes into the existing content, then PATCH.
26
26
  Prefer `mode=append` when simply adding new entries.
27
- - **Every Bash invocation that hits the daemon API MUST begin with the
28
- literal `curl` token.** The session's allow-list is `Bash(curl *)`,
29
- prefix-matched against the FULL command string under `dontAsk`. Any
30
- wrapping shape is silently denied (no tool result, no error — the
31
- call simply does not run):
32
- - `echo '{...}' | curl ...` starts with `echo` denied
33
- - `cat <<JSON | curl -d @-` starts with `cat` → denied
34
- - `bash -c "curl ..."` / `( curl ... )` / `var=x curl ...` → denied
35
- - `curl ... ; curl ...` / `curl ... && curl ...` → chained-curl denied
36
- Write a single, flat curl call. If you see no response from Bash at
37
- all (no stdout, no stderr, no `PA_API_ERROR`), your command was
38
- silently deniedrewrite it to start with literal `curl`.
27
+ - **One shell call = one operation.** Every shell invocation that hits
28
+ the daemon API MUST be a single, flat `curl …` — never combine
29
+ operations in one call. The following shapes are denied by every
30
+ backend's shell policy:
31
+ - Sequencing `... ; ...`, `... && ...`, `... || ...`
32
+ - Pipe — `curl | jq …`, `curl | head`, `curl | tee …`,
33
+ even a single `|`. This includes the very natural-looking
34
+ `curl http://localhost:8321/api/foo | jq .x` denied.
35
+ - Subshell / command substitution `$(...)`, `` `…` ``
36
+ - Wrapper-led starts with `echo`, `cat`, `bash -c`, `sh -c`,
37
+ `(`, or a variable assignment like `VAR=val curl …`
38
+ - Multi-target`curl URL1 URL2 …`, `curl --next …` / `-:`
39
+ When you need to consume a response, parse the JSON body in your own
40
+ response text — do NOT pipe it to `jq` / `sed` / `awk` / `grep`.
41
+ When you need multiple HTTP calls, issue them as **separate** shell
42
+ invocations. When you need a large body, use the heredoc-into-curl
43
+ shape documented below — `curl … -d @- <<'JSON' … JSON` keeps the
44
+ command starting with `curl` (do NOT pipe from `cat <<JSON | curl …`,
45
+ which starts with `cat` and is denied).
46
+ - **The shell surface is intentionally narrow.** Each backend's policy
47
+ permits only `curl http://localhost:${port}/...` and `git …` (no
48
+ `push --force`, `reset --hard`, `clean`). Common utilities — `jq`,
49
+ `sed`, `awk`, `tee`, `echo`, `cat`, `head`, `tail`, `grep`, `find`,
50
+ `ls`, `wc`, `xargs` — are NOT on the shell allow-list. Use the
51
+ daemon API's structured query params (`?fields=`, `?limit=`,
52
+ `?since=`, `?folder=`, …) or your backend's built-in read tools
53
+ (Claude: `Read` / `Grep` / `Glob`; Gemini: `read_file` /
54
+ `grep_search` / `list_directory` / `glob`) instead of trying to
55
+ filter shell output.
56
+ - **How a denial surfaces, by backend** — recognise the shape so you
57
+ rewrite and retry instead of looping on it:
58
+ - **Claude Code** — `Bash` PreToolUse hook. Chained-curl / `--next` /
59
+ multi-URL / wrapper shapes return a visible block decision with a
60
+ reason string. Tools or commands that aren't in the session's
61
+ `Bash(curl *)` allow-list under `dontAsk` are silently denied (no
62
+ stdout, no stderr, no `PA_API_ERROR`) — if a `Bash` call returns
63
+ NOTHING at all, your command was denied; rewrite to a single flat
64
+ `curl …` starting with the literal `curl` token.
65
+ - **Gemini CLI** — `run_shell_command` denial returns a visible
66
+ error of the form `Error executing tool run_shell_command: Tool
67
+ execution denied by policy. <reason>` and ends the turn as a
68
+ decisive failure (no retry, no fallback on resume — the chat just
69
+ fails). Same fix: rewrite as a single flat `curl …` (no `|`, no
70
+ `;`, no `&&`, no `$(…)`, no `jq`/`sed`/`awk`) and try again.
39
71
  - **Daemon-API body submission** (`curl -d` on `/api/context/*`,
40
72
  `/api/observations`, `/api/schedule`, etc.). Two safe shapes:
41
73
  - Inline JSON — `-d '{"key":"value"}'`. Use for small / single-line
42
74
  bodies. Escape internal newlines as `\n`.
43
75
  - Stdin heredoc on the SAME curl line — `curl ... -d @- <<'JSON'`
44
- + body + `JSON`. Note: the heredoc is redirected into `curl`'s
45
- stdin so the command still STARTS with `curl`; do NOT pipe from
46
- `cat <<JSON | curl …` (that starts with `cat` and is silently
47
- denied). `@-` is curl's stdin marker (a literal two-character
48
- token), distinct from the file-read forms below.
76
+ + body + `JSON`. The heredoc is redirected into `curl`'s stdin so
77
+ the command still STARTS with `curl`; do NOT pipe from
78
+ `cat <<JSON | curl …` (that starts with `cat` and is denied).
79
+ `@-` is curl's stdin marker (a literal two-character token),
80
+ distinct from the file-read forms below.
49
81
 
50
82
  Never use `-d @<filepath>` / `--data-raw '@<filepath>'` /
51
83
  `-F field=@<filepath>`. They are file-read shapes — safe mode
@@ -17,7 +17,7 @@ Concrete examples:
17
17
  | Source line | Acceptable target | NOT acceptable |
18
18
  |---|---|---|
19
19
  | `Works at Acme.` | `- Works at Acme.` | `- Employed full-time at Acme Corp.` |
20
- | `母 Yoko (1955–)` | `- Yoko (1955–)` | `- Mother: Yoko, born 1955, currently alive` |
20
+ | `Mother Yoko (1955–)` | `- Mother Yoko (1955–)` | `- Mother: Yoko, born 1955, currently alive` |
21
21
  | `Likes coffee, hates morning meetings` | two bullets, one per clause, copied verbatim | `- Prefers coffee over morning meetings` |
22
22
  | `Living in Tokyo since 2019.` | `- Living in Tokyo since 2019.` | `- Resides in Tokyo (5+ years).` |
23
23
 
@@ -7,7 +7,7 @@ You execute autonomous scheduled routines (morning/evening). No direct user inte
7
7
  - Write all state changes via Daemon API. Follow rules/management.md for autonomy levels and source of truth.
8
8
  - On step failure (API error, missing data), log to Agent Log and continue with remaining steps.
9
9
  - Register follow-up wake-ups (POST /api/schedule) before ending.
10
- - User-facing text obeys notify skill § Universal user-facing message discipline. This profile's posture: silent-by-default — user-visible output is only via explicit POST /api/notify. Per-routine wrap-up contracts (evening review, hourly check) own the go/no-go decision and layer on top of the universal section.
10
+ - User-facing text obeys notify skill § Universal user-facing message discipline. This profile's posture: silent-by-default — user-visible output is only via explicit POST /api/notify, either from a per-routine contract (hourly check) or from user-authored `routines/*.md` rules that explicitly invoke it.
11
11
 
12
12
  ## Output discipline
13
13
  - Agent Log entries: max 1 sentence. Action + outcome, no narration.
@@ -27,6 +27,7 @@ rendered fresh per session — trust it over memory.
27
27
  the daemon's `/api/<key>/*` routes and
28
28
  `POST /api/integrations/<key>/exec` both return `410`. Consult the
29
29
  per-integration skill body materialised under `.claude/skills/` /
30
- `.codex/skills/` / `.gemini/skills/` for the exact tool namespace and
31
- the destructive-confirm contract that still applies.
30
+ `.codex/skills/` / `.gemini/skills/` (OpenCode reuses `.claude/skills/`)
31
+ for the exact tool namespace and the destructive-confirm contract that
32
+ still applies.
32
33
 
@@ -17,19 +17,24 @@ tags:
17
17
  - core
18
18
  - timing
19
19
  - memory
20
+ - routines
20
21
  status: stable
21
22
  ask_examples:
22
23
  - When does the agent day actually roll over?
23
24
  - Why is my late-night work showing up under yesterday?
24
25
  - How do I change the day boundary?
26
+ - What is dayBoundaryHour?
25
27
  locale: en-US
26
28
  created: 2026-04-25
27
- updated: 2026-04-25
29
+ updated: 2026-05-15
28
30
  keywords:
29
31
  - day boundary
30
32
  - 04:00
31
33
  - dayBoundaryHour
32
34
  - rollover
35
+ - agent day
36
+ - getAgentDayBoundsUtc
37
+ - getAgentDayDateStr
33
38
  related:
34
39
  - features/routines/morning-routine
35
40
  - features/memory-files/today
@@ -7,6 +7,8 @@ aliases:
7
7
  - auth probe
8
8
  - auth recovery
9
9
  - credentials
10
+ - auth health monitor
11
+ - subscription auth warning
10
12
  category: concepts
11
13
  summary: |
12
14
  The auth-health monitor probes each backend's credentials at startup
@@ -17,19 +19,26 @@ tags:
17
19
  - core
18
20
  - safety
19
21
  - backends
22
+ - operations
20
23
  status: stable
21
24
  ask_examples:
22
25
  - Why is the dashboard showing a degraded backend?
23
26
  - How does the agent check that I'm still logged in to Claude?
24
27
  - What happens when my Codex token expires?
28
+ - What is the SubscriptionAuthWarning banner?
25
29
  locale: en-US
26
30
  created: 2026-04-25
27
- updated: 2026-05-04
31
+ updated: 2026-05-15
28
32
  keywords:
29
33
  - auth
34
+ - authentication
30
35
  - credentials
31
36
  - probe
32
37
  - degraded
38
+ - auth health monitor
39
+ - auth recovery
40
+ - api-key-probe
41
+ - SubscriptionAuthWarning
33
42
  related:
34
43
  - concepts/backends-and-tiers
35
44
  - concepts/costs-and-quotas
@@ -5,32 +5,38 @@ title: Backends and Tiers
5
5
  id: backends-and-tiers
6
6
  aliases:
7
7
  - models
8
- - claude codex gemini
8
+ - claude codex gemini opencode
9
9
  - heavy tier
10
10
  - light tier
11
+ - main backend
12
+ - fallback backend
11
13
  category: concepts
12
14
  summary: |
13
- Aitne runs on three backends — Claude Code, Codex, Gemini CLI.
14
- Each backend has a heavy and a light tier; the dispatcher picks the
15
- binding for every ProcessKey based on operator configuration.
15
+ Aitne runs on four backends — Claude Code, Codex, Gemini CLI, OpenCode.
16
+ Each backend exposes light, medium, and high model tiers; the dispatcher
17
+ picks the binding for every ProcessKey based on operator configuration.
16
18
  section: backends
17
19
  tags:
18
20
  - core
19
21
  - backends
20
22
  - models
21
23
  - cost
24
+ - routing
22
25
  status: stable
23
26
  ask_examples:
24
27
  - Which model does my morning routine use?
25
28
  - How do I switch from Claude to Codex?
26
29
  - What is the difference between heavy and light tier?
30
+ - What is OpenCode and when should I use it?
31
+ - How does Aitne fail over when a backend hits its quota?
27
32
  locale: en-US
28
33
  created: 2026-04-25
29
- updated: 2026-05-04
34
+ updated: 2026-05-15
30
35
  keywords:
31
36
  - claude
32
37
  - codex
33
38
  - gemini
39
+ - opencode
34
40
  - opus
35
41
  - sonnet
36
42
  - haiku
@@ -40,11 +46,13 @@ keywords:
40
46
  - vertex
41
47
  - foundry
42
48
  - azure-openai
49
+ - openrouter
50
+ - routing
51
+ - fallback
43
52
  related:
44
53
  - concepts/process-keys
45
54
  - concepts/costs-and-quotas
46
55
  - features/operations/backend-routing
47
- - guides/use-cloud-providers
48
56
  ui_anchors:
49
57
  - /settings/models
50
58
  ---
@@ -53,21 +61,28 @@ ui_anchors:
53
61
 
54
62
  ## TL;DR
55
63
 
56
- Three backends are supported: **Claude Code** (default),
57
- **Codex**, and **Gemini CLI**. Each backend exposes three classes of
58
- model used at install time:
59
-
60
- - **Main** (Sonnet 4.6 / GPT-5.4-mini / Gemini 3 Flash) — the default
61
- for owner-facing work (DMs, daily / weekly / monthly review,
62
- morning routine, dashboard chat, scheduled tasks).
63
- - **Delegated** (Haiku 4.5 on Claude; latest light tier on Codex /
64
- Gemini) cheaper model used for "simple" backend surfaces with no
65
- owner in the loop: Gmail classification, GitHub event triage,
66
- git-poll observers, calendar-change handlers, the
67
- `delegated_task` invoker.
68
- - **Heavy** (Opus 4.7 / GPT-5.5 / Gemini 3 Pro) — registered but
69
- *not* auto-selected. Operators opt in per-process from
70
- `/settings/models`.
64
+ Four backends are supported: **Claude Code** (default), **Codex**,
65
+ **Gemini CLI**, and **OpenCode**. Each backend exposes three classes
66
+ of model used at install time:
67
+
68
+ - **Medium / Main** (Sonnet 4.6 / GPT-5.4-mini / Gemini 3 Flash /
69
+ Sonnet 4.6 via OpenCode) — the default for owner-facing work (DMs,
70
+ daily / weekly review, morning routine, dashboard chat, scheduled
71
+ tasks).
72
+ - **Lite / Delegated** (Haiku 4.5 on Claude and OpenCode; latest
73
+ light tier on Codex / Gemini) cheaper model used for "simple"
74
+ backend surfaces with no owner in the loop: Gmail classification,
75
+ GitHub event triage, git-poll observers, calendar-change
76
+ handlers, the routine pre-pass fetcher, the `delegated_task`
77
+ invoker.
78
+ - **High / Heavy** (Opus 4.7 / GPT-5.5 / Gemini 3 Pro / Opus 4.7
79
+ via OpenCode) — registered but *not* auto-selected. Operators opt
80
+ in per-process from `/settings/models`. After morning-routine
81
+ Phase 7 (2026-05-16) the only flows that run heavy by default are
82
+ `setup` (one-shot wizard) and `knowledge.import` (owner-uploaded
83
+ files). The first morning routine after setup runs on medium
84
+ tier with a daemon-prepared `<roadmap_skeleton>` block instead of
85
+ the retired heavy `routine.morning_routine_initial`.
71
86
 
72
87
  Every ProcessKey resolves to a backend + model binding via
73
88
  `BackendRouter`. Aitne **does not store or read subscription-plan
@@ -79,11 +94,12 @@ install time and edited from `/settings/models`.
79
94
  Each backend authenticates via a provider API key registered on
80
95
  `/settings/models`. The provider dropdown picks one of:
81
96
 
82
- | Backend | Direct API key | Cloud provider options |
97
+ | Backend | Direct API key | Cloud / aggregator options |
83
98
  |---|---|---|
84
99
  | `claude` | `anthropic` (`sk-ant-…`) | `bedrock` (Amazon Bedrock), `vertex` (Google Vertex AI), `foundry` (Microsoft Foundry) |
85
100
  | `codex` | `openai` (`sk-…`) | `azure-openai` (Codex CLI on Azure OpenAI; daemon writes a managed `config.toml` under `<dataDir>/codex-home/`) |
86
101
  | `gemini` | `google` (`AIza…`) | `gemini-vertex` (Gemini on Google Vertex AI) |
102
+ | `opencode` | provider key forwarded to the OpenCode server (Anthropic / OpenAI / OpenRouter / …) | "Managed" mode runs a local `opencode` HTTP server on loopback; "Remote" mode points at a baseUrl you operate |
87
103
 
88
104
  API keys are the recommended and provider-supported auth method for
89
105
  headless agent use; if you skip the key the daemon falls back to the
@@ -92,18 +108,35 @@ officially support — Anthropic in particular currently prohibits the
92
108
  Claude Agent SDK on a Claude Pro / Max subscription. The dashboard
93
109
  surfaces a warning whenever a backend is on subscription auth.
94
110
 
95
- Cloud providers (Bedrock / Vertex / Foundry / Azure OpenAI /
96
- Gemini-Vertex) let teams reuse an existing enterprise contract,
97
- keep model traffic inside a private VPC, or take advantage of
98
- provider-side rate-limit pools. Aitne stores the credentials in the
99
- OS keychain and mirrors the corresponding env vars
100
- (`CLAUDE_CODE_USE_BEDROCK=1`, `CLAUDE_CODE_USE_VERTEX=1`,
101
- `CLAUDE_CODE_USE_FOUNDRY=1`, `GOOGLE_GENAI_USE_VERTEXAI=true`, …)
102
- into the backend subprocess. See
103
- [Use cloud providers](../guides/use-cloud-providers.md) for the
104
- end-to-end walkthrough and
105
- [Costs and Quotas](costs-and-quotas.md) for the cost shape of each
106
- path.
111
+ Cloud / aggregator providers (Bedrock / Vertex / Foundry / Azure
112
+ OpenAI / Gemini-Vertex / OpenRouter via OpenCode) let teams reuse
113
+ an existing enterprise contract, keep model traffic inside a private
114
+ VPC, or take advantage of provider-side rate-limit pools. Aitne
115
+ stores the credentials in the OS keychain and mirrors the
116
+ corresponding env vars (`CLAUDE_CODE_USE_BEDROCK=1`,
117
+ `CLAUDE_CODE_USE_VERTEX=1`, `CLAUDE_CODE_USE_FOUNDRY=1`,
118
+ `GOOGLE_GENAI_USE_VERTEXAI=true`, …) into the backend subprocess.
119
+ See [Costs and Quotas](costs-and-quotas.md) for the cost shape of
120
+ each path.
121
+
122
+ ## OpenCode (4th backend)
123
+
124
+ OpenCode joined as a 4th backend in 2026-05. It is implemented on
125
+ top of the `@opencode-ai/sdk` HTTP server and supports the same
126
+ `ProcessKey` set as the other backends. Two operating modes:
127
+
128
+ - **Managed** — the daemon spawns and supervises a local
129
+ `opencode` HTTP server on loopback. Configuration (model,
130
+ permissions, agent dir) is written into a managed `opencode.json`
131
+ under `<dataDir>/opencode-home/`.
132
+ - **Remote** — you point Aitne at an existing OpenCode server
133
+ baseUrl (your own cluster or a managed deployment).
134
+
135
+ OpenCode is a runtime peer of Claude / Codex / Gemini for
136
+ dispatching ProcessKeys, but it intentionally does **not** host
137
+ native-mode integration connectors (Gmail / Calendar / Notion go
138
+ through the daemon's polling path or another backend's MCP). See
139
+ `docs/design/appendices/opencode-backend.md` for the full design.
107
140
 
108
141
  ## Why This Concept Exists
109
142
 
@@ -120,11 +153,13 @@ Claude's quota is exhausted, or use Gemini for cheap polling tasks.
120
153
 
121
154
  ## Definitions
122
155
 
123
- - **Backend**: the agent runtime. One of `claude`, `codex`, `gemini`.
124
- - **Tier**: `heavy` or `light`. Heavy maps to the strongest model
125
- (Opus / GPT-5.5 / Gemini 3 Pro). Light is the operator's day-to-day
126
- tier and split at install time into Sonnet (main) vs Haiku
127
- (delegated/simple).
156
+ - **Backend**: the agent runtime. One of `claude`, `codex`, `gemini`,
157
+ `opencode`.
158
+ - **Tier**: `lite`, `medium`, or `high`. `high` maps to the strongest
159
+ model (Opus 4.7 / GPT-5.5 / Gemini 3 Pro / Opus 4.7 via OpenCode).
160
+ `medium` (Sonnet 4.6 and equivalents) is the operator's day-to-day
161
+ tier for owner-facing work; `lite` (Haiku 4.5 and equivalents) is
162
+ reserved for mechanical / delegated surfaces.
128
163
  - **Main / Fallback**: each ProcessKey has a `main` backend and a
129
164
  `fallback`. The router fails over on `BackendQuotaError` /
130
165
  `BackendDecisiveFailure`.
@@ -136,7 +171,6 @@ Claude's quota is exhausted, or use Gemini for cheap polling tasks.
136
171
  | `routine.morning_routine` | claude | Sonnet 4.6 |
137
172
  | `routine.evening_review` | claude | Sonnet 4.6 |
138
173
  | `routine.weekly_review` | claude | Sonnet 4.6 |
139
- | `routine.monthly_review` | claude | Sonnet 4.6 |
140
174
  | `routine.hourly_check` | claude | Sonnet 4.6 |
141
175
  | `message.dm` | claude | Sonnet 4.6 |
142
176
  | `dashboard.chat` | claude | Sonnet 4.6 |
@@ -7,6 +7,9 @@ aliases:
7
7
  - cost
8
8
  - budget
9
9
  - quota
10
+ - daily cap
11
+ - cost cap
12
+ - per-token billing
10
13
  category: concepts
11
14
  summary: |
12
15
  How Aitne meters per-call costs and provider quotas, and where the
@@ -14,17 +17,21 @@ summary: |
14
17
  dashboard reports, it does not bill.
15
18
  section: cost
16
19
  tags:
20
+ - core
17
21
  - cost
18
22
  - quotas
19
- - core
23
+ - backends
24
+ - operations
20
25
  status: stable
21
26
  ask_examples:
22
27
  - How do I see how much my agent is spending?
23
28
  - Why did the agent fail over from Claude to Codex?
24
29
  - What does the autonomous daily cost cap do?
30
+ - Does OpenCode billing differ from the other backends?
31
+ - How does Gemini's per-day quota work?
25
32
  locale: en-US
26
33
  created: 2026-04-25
27
- updated: 2026-05-04
34
+ updated: 2026-05-15
28
35
  keywords:
29
36
  - cost
30
37
  - budget
@@ -33,11 +40,14 @@ keywords:
33
40
  - per-token billing
34
41
  - gemini quota
35
42
  - subscription fallback
43
+ - opencode
44
+ - openrouter
45
+ - daily cap
46
+ - autonomous cap
36
47
  related:
37
48
  - concepts/backends-and-tiers
38
49
  - concepts/auth-health
39
50
  - features/operations/cost-tracking
40
- - guides/use-cloud-providers
41
51
  ui_anchors:
42
52
  - /analytics
43
53
  - /settings/models
@@ -58,6 +68,12 @@ per-call against your provider account:
58
68
  - **Codex (via Codex CLI)** — per-token billing on `OPENAI_API_KEY`.
59
69
  - **Gemini (via Gemini CLI)** — per-token billing on `GEMINI_API_KEY`
60
70
  / `GOOGLE_API_KEY`; the free tier has per-day caps.
71
+ - **OpenCode (via `@opencode-ai/sdk`)** — billing follows whichever
72
+ upstream provider the OpenCode server is configured against
73
+ (Anthropic / OpenAI / OpenRouter / …). Aitne reads cost telemetry
74
+ from the SDK's `session.info.cost` + `info.tokens` fields and
75
+ falls back to its local `MODEL_REGISTRY` pricing when the upstream
76
+ reports `cost === 0` against non-zero tokens.
61
77
 
62
78
  If you skip the API key, the daemon falls back to whatever
63
79
  subscription auth the CLI already has on your machine. That fallback
@@ -139,8 +155,12 @@ register an API key on `/settings/models`.
139
155
  cost reduction per fire).
140
156
  - Morning routine on Opus via `ANTHROPIC_API_KEY` = per-token billing
141
157
  on the Opus rate; pin only when Sonnet has failed the task. **No
142
- recurring routine seeds on Opus by default** only the one-shot
143
- `routine.morning_routine_initial` runs heavy out of the box.
158
+ recurring routine seeds on Opus by default**, and after
159
+ morning-routine Phase 7 (2026-05-16) **no one-shot routine seeds
160
+ on Opus either** — `routine.morning_routine_initial` was retired
161
+ and the first-run branch runs on the parent
162
+ `routine.morning_routine` envelope (medium tier) with a
163
+ daemon-prepared `<roadmap_skeleton>` block.
144
164
  - Gemini hourly check on Flash via `GEMINI_API_KEY` = ~$0.0005 per
145
165
  fire on the paid tier; free tier instead consumes a per-day quota
146
166
  slot.