@aitne-sh/aitne 0.1.0
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.
- package/LICENSE +21 -0
- package/README.md +464 -0
- package/agent-assets/agent-profiles/_safety.md +26 -0
- package/agent-assets/agent-profiles/conversational.md +33 -0
- package/agent-assets/agent-profiles/docs-qa.md +24 -0
- package/agent-assets/agent-profiles/observer.md +28 -0
- package/agent-assets/agent-profiles/profile-importer.md +63 -0
- package/agent-assets/agent-profiles/proxy.md +28 -0
- package/agent-assets/agent-profiles/routine.md +16 -0
- package/agent-assets/agent-profiles/task.md +18 -0
- package/agent-assets/docs/concepts/agent-day.md +88 -0
- package/agent-assets/docs/concepts/auth-health.md +75 -0
- package/agent-assets/docs/concepts/backends-and-tiers.md +126 -0
- package/agent-assets/docs/concepts/costs-and-quotas.md +103 -0
- package/agent-assets/docs/concepts/delegated-mode.md +223 -0
- package/agent-assets/docs/concepts/memory-model.md +118 -0
- package/agent-assets/docs/concepts/observations.md +80 -0
- package/agent-assets/docs/concepts/process-keys.md +89 -0
- package/agent-assets/docs/concepts/routines.md +108 -0
- package/agent-assets/docs/concepts/safety-and-execution.md +109 -0
- package/agent-assets/docs/concepts/safety-model.md +279 -0
- package/agent-assets/docs/concepts/skills.md +100 -0
- package/agent-assets/docs/features/integrations/calendar.md +92 -0
- package/agent-assets/docs/features/integrations/git.md +95 -0
- package/agent-assets/docs/features/integrations/github.md +170 -0
- package/agent-assets/docs/features/integrations/mail.md +106 -0
- package/agent-assets/docs/features/integrations/notion.md +69 -0
- package/agent-assets/docs/features/integrations/obsidian.md +71 -0
- package/agent-assets/docs/features/lifestyle/git.md +178 -0
- package/agent-assets/docs/features/lifestyle/reading.md +93 -0
- package/agent-assets/docs/features/lifestyle/receipts.md +71 -0
- package/agent-assets/docs/features/lifestyle/travel-bookings.md +44 -0
- package/agent-assets/docs/features/lifestyle/travel-time.md +52 -0
- package/agent-assets/docs/features/memory-files/agent-journal.md +105 -0
- package/agent-assets/docs/features/memory-files/projects.md +56 -0
- package/agent-assets/docs/features/memory-files/roadmap.md +61 -0
- package/agent-assets/docs/features/memory-files/schedule.md +112 -0
- package/agent-assets/docs/features/memory-files/today.md +73 -0
- package/agent-assets/docs/features/memory-files/user-profile.md +81 -0
- package/agent-assets/docs/features/messaging/dashboard-chat.md +93 -0
- package/agent-assets/docs/features/messaging/discord.md +50 -0
- package/agent-assets/docs/features/messaging/overview.md +111 -0
- package/agent-assets/docs/features/messaging/pairing-and-magic-phrase.md +69 -0
- package/agent-assets/docs/features/messaging/slack.md +51 -0
- package/agent-assets/docs/features/messaging/telegram.md +63 -0
- package/agent-assets/docs/features/messaging/whatsapp.md +48 -0
- package/agent-assets/docs/features/operations/activity-and-conversations.md +105 -0
- package/agent-assets/docs/features/operations/approvals.md +58 -0
- package/agent-assets/docs/features/operations/backend-routing.md +62 -0
- package/agent-assets/docs/features/operations/cost-tracking.md +59 -0
- package/agent-assets/docs/features/operations/notifications.md +69 -0
- package/agent-assets/docs/features/operations/quiet-hours.md +106 -0
- package/agent-assets/docs/features/operations/schedule-approaching.md +60 -0
- package/agent-assets/docs/features/routines/custom-routines.md +101 -0
- package/agent-assets/docs/features/routines/evening-review.md +81 -0
- package/agent-assets/docs/features/routines/hourly-check.md +85 -0
- package/agent-assets/docs/features/routines/monthly-review.md +65 -0
- package/agent-assets/docs/features/routines/morning-routine.md +123 -0
- package/agent-assets/docs/features/routines/weekly-review.md +70 -0
- package/agent-assets/docs/getting-started/01-what-is-this.md +192 -0
- package/agent-assets/docs/getting-started/02-first-steps.md +80 -0
- package/agent-assets/docs/getting-started/03-what-can-this-do.md +110 -0
- package/agent-assets/docs/getting-started/04-first-day.md +287 -0
- package/agent-assets/docs/glossary.md +116 -0
- package/agent-assets/docs/guides/add-a-custom-routine.md +71 -0
- package/agent-assets/docs/guides/backup-and-restore.md +54 -0
- package/agent-assets/docs/guides/change-which-model-handles-x.md +47 -0
- package/agent-assets/docs/guides/connect-a-new-mail-account.md +59 -0
- package/agent-assets/docs/guides/import-knowledge-file.md +275 -0
- package/agent-assets/docs/guides/install-and-run.md +72 -0
- package/agent-assets/docs/guides/migrate-machines.md +52 -0
- package/agent-assets/docs/guides/pause-the-agent.md +65 -0
- package/agent-assets/docs/guides/reinstall-cleanly.md +52 -0
- package/agent-assets/docs/guides/setup-wizard.md +107 -0
- package/agent-assets/docs/guides/switch-default-backend.md +60 -0
- package/agent-assets/docs/reference/api.md +51 -0
- package/agent-assets/docs/reference/cli-commands.md +121 -0
- package/agent-assets/docs/reference/config.md +74 -0
- package/agent-assets/docs/reference/disallowed-tools.md +76 -0
- package/agent-assets/docs/reference/keyboard-shortcuts.md +39 -0
- package/agent-assets/docs/reference/process-keys.md +59 -0
- package/agent-assets/docs/reference/skills.md +50 -0
- package/agent-assets/docs/troubleshooting/auth-failed.md +57 -0
- package/agent-assets/docs/troubleshooting/dashboard-shows-degraded.md +55 -0
- package/agent-assets/docs/troubleshooting/fallback-keeps-firing.md +54 -0
- package/agent-assets/docs/troubleshooting/messaging-not-pairing.md +53 -0
- package/agent-assets/docs/troubleshooting/morning-routine-didnt-run.md +75 -0
- package/agent-assets/docs/troubleshooting/observation-not-detected.md +57 -0
- package/agent-assets/docs/troubleshooting/quota-exhausted.md +57 -0
- package/agent-assets/optimizer-skills/drift-analysis/SKILL.md +75 -0
- package/agent-assets/optimizer-skills/knowledge-map/SKILL.md +71 -0
- package/agent-assets/optimizer-skills/skill-curation/SKILL.md +108 -0
- package/agent-assets/project-doc-templates/git-repo.md +21 -0
- package/agent-assets/project-doc-templates/project.md +38 -0
- package/agent-assets/skills/attach/SKILL.md +104 -0
- package/agent-assets/skills/context/SKILL.md +257 -0
- package/agent-assets/skills/context/curation.json +37 -0
- package/agent-assets/skills/context/seeds/file-responsibilities.seed.json +13 -0
- package/agent-assets/skills/context/seeds/frontmatter-requirements.seed.json +40 -0
- package/agent-assets/skills/docs-search/SKILL.md +176 -0
- package/agent-assets/skills/external-services/SKILL.delegated.claude.md +369 -0
- package/agent-assets/skills/external-services/SKILL.delegated.codex.md +349 -0
- package/agent-assets/skills/external-services/SKILL.delegated.gemini.md +347 -0
- package/agent-assets/skills/external-services/SKILL.md +371 -0
- package/agent-assets/skills/mail/SKILL.delegated.claude.md +284 -0
- package/agent-assets/skills/mail/SKILL.delegated.codex.md +261 -0
- package/agent-assets/skills/mail/SKILL.delegated.gemini.md +255 -0
- package/agent-assets/skills/mail/SKILL.md +313 -0
- package/agent-assets/skills/mail/references/errors.md +17 -0
- package/agent-assets/skills/mail/references/providers.md +40 -0
- package/agent-assets/skills/mail/references/query-grammar.md +24 -0
- package/agent-assets/skills/management-policy/SKILL.md +307 -0
- package/agent-assets/skills/management-policy/curation.json +13 -0
- package/agent-assets/skills/management-policy/seeds/policy-file-shape.seed.json +16 -0
- package/agent-assets/skills/management-task-modify/SKILL.md +202 -0
- package/agent-assets/skills/management-task-register/SKILL.md +330 -0
- package/agent-assets/skills/management-task-stop/SKILL.md +166 -0
- package/agent-assets/skills/notify/SKILL.md +196 -0
- package/agent-assets/skills/notion/SKILL.delegated.claude.md +254 -0
- package/agent-assets/skills/notion/SKILL.delegated.codex.md +195 -0
- package/agent-assets/skills/notion/SKILL.delegated.gemini.md +194 -0
- package/agent-assets/skills/notion/SKILL.md +86 -0
- package/agent-assets/skills/observations/SKILL.md +234 -0
- package/agent-assets/skills/observations/curation.json +13 -0
- package/agent-assets/skills/observations/seeds/source-namespacing.seed.json +20 -0
- package/agent-assets/skills/project-doc/SKILL.md +86 -0
- package/agent-assets/skills/project-doc/curation.json +21 -0
- package/agent-assets/skills/project-doc/seeds/project-shape.seed.json +25 -0
- package/agent-assets/skills/project-doc/seeds/slug-grammar.seed.json +20 -0
- package/agent-assets/skills/reading/SKILL.md +198 -0
- package/agent-assets/skills/reading/references/reading-taste.md +197 -0
- package/agent-assets/skills/receipts/SKILL.md +134 -0
- package/agent-assets/skills/roadmap/SKILL.md +276 -0
- package/agent-assets/skills/roadmap/curation.json +13 -0
- package/agent-assets/skills/roadmap/references/horizon-tags.md +40 -0
- package/agent-assets/skills/roadmap/references/preparation-timeline.md +47 -0
- package/agent-assets/skills/roadmap/seeds/entry-types.seed.json +16 -0
- package/agent-assets/skills/schedule/SKILL.md +228 -0
- package/agent-assets/skills/scheduled-managed-task/SKILL.md +392 -0
- package/agent-assets/skills/today/SKILL.md +198 -0
- package/agent-assets/skills/today/curation.json +21 -0
- package/agent-assets/skills/today/seeds/agent-notes-flavors.seed.json +17 -0
- package/agent-assets/skills/today/seeds/section-shape.seed.json +17 -0
- package/agent-assets/skills/travel/SKILL.md +132 -0
- package/agent-assets/skills/travel-time/SKILL.md +149 -0
- package/agent-assets/skills/user-interview/SKILL.md +323 -0
- package/agent-assets/skills/user-interview/references/sweep-and-fallback.md +94 -0
- package/agent-assets/skills/user-profile/SKILL.md +210 -0
- package/agent-assets/skills/user-profile/curation.json +29 -0
- package/agent-assets/skills/user-profile/seeds/learned-context-format.seed.json +14 -0
- package/agent-assets/skills/user-profile/seeds/routing-table.seed.json +53 -0
- package/agent-assets/skills/user-profile/seeds/topic-files.seed.json +27 -0
- package/agent-assets/task-flows/dashboard.docs_qa.md +43 -0
- package/agent-assets/task-flows/default.md +11 -0
- package/agent-assets/task-flows/git.branch.created.md +25 -0
- package/agent-assets/task-flows/git.lifecycle.poll.md +52 -0
- package/agent-assets/task-flows/git.local_ahead.stale.md +34 -0
- package/agent-assets/task-flows/git.merge_to_default.md +30 -0
- package/agent-assets/task-flows/git.project.refresh_architecture.md +100 -0
- package/agent-assets/task-flows/git.project.retemplate.md +73 -0
- package/agent-assets/task-flows/git.push.detected.md +32 -0
- package/agent-assets/task-flows/git.push.force_pushed.md +36 -0
- package/agent-assets/task-flows/git.tag.created.md +24 -0
- package/agent-assets/task-flows/github.assigned.md +43 -0
- package/agent-assets/task-flows/github.pull_request.review_requested.md +57 -0
- package/agent-assets/task-flows/github.security_alert.md +45 -0
- package/agent-assets/task-flows/github.workflow_run.failed.md +57 -0
- package/agent-assets/task-flows/knowledge.import.md +161 -0
- package/agent-assets/task-flows/message.received.dm.md +142 -0
- package/agent-assets/task-flows/message.received.dm_first.md +117 -0
- package/agent-assets/task-flows/message.received.md +14 -0
- package/agent-assets/task-flows/routine.custom.md +38 -0
- package/agent-assets/task-flows/routine.evening_review.md +323 -0
- package/agent-assets/task-flows/routine.hourly_check.delegated.claude.md +405 -0
- package/agent-assets/task-flows/routine.hourly_check.delegated.codex.md +400 -0
- package/agent-assets/task-flows/routine.hourly_check.delegated.gemini.md +404 -0
- package/agent-assets/task-flows/routine.hourly_check.md +184 -0
- package/agent-assets/task-flows/routine.hourly_check.triage.md +93 -0
- package/agent-assets/task-flows/routine.monthly_review.md +250 -0
- package/agent-assets/task-flows/routine.morning_routine.md +300 -0
- package/agent-assets/task-flows/routine.morning_routine_initial.md +184 -0
- package/agent-assets/task-flows/routine.roadmap_refresh.md +275 -0
- package/agent-assets/task-flows/routine.today_refresh.md +172 -0
- package/agent-assets/task-flows/routine.user_profile_sweep.md +242 -0
- package/agent-assets/task-flows/routine.weekly_review.md +247 -0
- package/agent-assets/task-flows/schedule.approaching.md +124 -0
- package/agent-assets/task-flows/scheduled.dm.md +391 -0
- package/agent-assets/task-flows/scheduled.task.md +141 -0
- package/agent-assets/task-flows/setup.initial.md +277 -0
- package/agent-assets/task-flows/setup.update.md +53 -0
- package/agent-assets/templates/README.md +85 -0
- package/agent-assets/templates/_index.md +39 -0
- package/agent-assets/templates/_manifest.json +103 -0
- package/agent-assets/templates/agent/journal.md +10 -0
- package/agent-assets/templates/agent/profile-questions.md +74 -0
- package/agent-assets/templates/context-index.md +42 -0
- package/agent-assets/templates/dossiers/_index.md +22 -0
- package/agent-assets/templates/dossiers/evening.md +23 -0
- package/agent-assets/templates/dossiers/hourly.md +23 -0
- package/agent-assets/templates/dossiers/monthly.md +23 -0
- package/agent-assets/templates/dossiers/morning.md +23 -0
- package/agent-assets/templates/dossiers/roadmap.md +23 -0
- package/agent-assets/templates/dossiers/weekly.md +23 -0
- package/agent-assets/templates/projects/_active.base +14 -0
- package/agent-assets/templates/projects/_index.md +29 -0
- package/agent-assets/templates/roadmap.md +15 -0
- package/agent-assets/templates/routines/_index.md +20 -0
- package/agent-assets/templates/routines/evening.md +22 -0
- package/agent-assets/templates/routines/hourly.md +30 -0
- package/agent-assets/templates/routines/monthly.md +25 -0
- package/agent-assets/templates/routines/morning.md +26 -0
- package/agent-assets/templates/routines/weekly.md +23 -0
- package/agent-assets/templates/rules/_index.md +19 -0
- package/agent-assets/templates/rules/journal-export.md +41 -0
- package/agent-assets/templates/rules/journal-format.md +61 -0
- package/agent-assets/templates/rules/management.md +48 -0
- package/agent-assets/templates/rules/mcp.md +40 -0
- package/agent-assets/templates/rules/policies/_index.md +22 -0
- package/agent-assets/templates/rules/redaction.md +30 -0
- package/agent-assets/templates/today.md +13 -0
- package/agent-assets/templates/user/_index.md +16 -0
- package/agent-assets/templates/user/expertise.md +7 -0
- package/agent-assets/templates/user/goals.md +7 -0
- package/agent-assets/templates/user/people.md +7 -0
- package/agent-assets/templates/user/personal.md +7 -0
- package/agent-assets/templates/user/profile.md +28 -0
- package/agent-assets/templates/user/work.md +7 -0
- package/bin/aitne.mjs +1096 -0
- package/package.json +78 -0
- package/personal-agent.mjs +39 -0
- package/scripts/browser.mjs +99 -0
- package/scripts/check-redaction-coverage.mjs +109 -0
- package/scripts/commands/audit.mjs +309 -0
- package/scripts/commands/doctor.mjs +437 -0
- package/scripts/commands/open.mjs +40 -0
- package/scripts/commands/setup.mjs +21 -0
- package/scripts/commands/uninstall.mjs +114 -0
- package/scripts/commands/update.mjs +96 -0
- package/scripts/commands/version.mjs +62 -0
- package/scripts/commands.md +0 -0
- package/scripts/lib/sqlite-loader.mjs +49 -0
- package/scripts/message-discipline-digest.mjs +535 -0
- package/scripts/poc/google-connector-inheritance/REPORT.md +197 -0
- package/scripts/poc/google-connector-inheritance/claude-sdk-probe.mjs +79 -0
- package/scripts/remint-roadmap-ids.mjs +257 -0
- package/scripts/rm-paths.mjs +22 -0
- package/scripts/run-node.mjs +223 -0
- package/scripts/smoke-obsidian-api.mjs +166 -0
- package/scripts/start.mjs +160 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Delegated Proxy
|
|
2
|
+
|
|
3
|
+
You exist for one purpose: invoke the single MCP tool named in the user
|
|
4
|
+
message and return its raw result. Nothing more.
|
|
5
|
+
|
|
6
|
+
## Hard rules
|
|
7
|
+
|
|
8
|
+
- Call the named tool **exactly once**, with the JSON arguments given verbatim.
|
|
9
|
+
- Do **not** narrate, summarize, paraphrase, or reformat the tool's result.
|
|
10
|
+
The daemon extracts the result from the tool-use stream block directly;
|
|
11
|
+
any prose you generate is discarded and only burns tokens.
|
|
12
|
+
- Do **not** call any tool other than the one named, **with one exception**:
|
|
13
|
+
if the named tool's schema is not yet loaded (Claude Code defers some
|
|
14
|
+
MCP tool schemas when many servers are registered), call `ToolSearch`
|
|
15
|
+
to load it, then immediately call the named tool. Do not browse other
|
|
16
|
+
tools — load only the named one.
|
|
17
|
+
- Do **not** call `curl http://localhost:*/api/*` or any other HTTP path back
|
|
18
|
+
into the daemon. Doing so would loop a proxy invocation into another
|
|
19
|
+
proxy invocation.
|
|
20
|
+
- Do **not** call context-write endpoints (`POST/PUT/PATCH /api/context/*`).
|
|
21
|
+
Context writes are reserved for the parent agent that triggered this proxy.
|
|
22
|
+
- Do **not** invoke `Bash`, `Edit`, `Write`, or filesystem writes of any kind.
|
|
23
|
+
- If the tool returns an error, return it verbatim — no recovery, no retry.
|
|
24
|
+
- If you cannot find the named tool, exit immediately without calling
|
|
25
|
+
anything. The daemon will surface the failure to the parent agent.
|
|
26
|
+
|
|
27
|
+
You have no persona, no memory, no judgement to apply. You are a one-shot
|
|
28
|
+
shim around a single connector tool.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Routine Agent
|
|
2
|
+
|
|
3
|
+
You execute autonomous scheduled routines (morning/evening). No direct user interaction.
|
|
4
|
+
|
|
5
|
+
## Principles
|
|
6
|
+
- Morning routine runs during quiet hours: schedule briefing for after quiet_hours_end, do NOT notify directly.
|
|
7
|
+
- Write all state changes via Daemon API. Follow rules/management.md for autonomy levels and source of truth.
|
|
8
|
+
- On step failure (API error, missing data), log to Agent Log and continue with remaining steps.
|
|
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.
|
|
11
|
+
|
|
12
|
+
## Output discipline
|
|
13
|
+
- Agent Log entries: max 1 sentence. Action + outcome, no narration.
|
|
14
|
+
- Prefer structured output (tables, bullets) over prose.
|
|
15
|
+
- When updating context files: write the minimum viable content that preserves all information.
|
|
16
|
+
- Do not summarize what you just did in your final response — the action log is self-documenting.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Task Agent
|
|
2
|
+
|
|
3
|
+
You execute a pre-scheduled task. The description in your prompt was written by a previous agent session or a user specifically for you.
|
|
4
|
+
|
|
5
|
+
## Principles
|
|
6
|
+
- Execute exactly what the description says — nothing more, nothing less.
|
|
7
|
+
- If the description is ambiguous, log the issue to today.md Agent Log and skip rather than guessing.
|
|
8
|
+
- After completion, register follow-up wake-ups (POST /api/schedule) if needed.
|
|
9
|
+
- User-facing text obeys notify skill § Universal user-facing message discipline. This profile's posture: the final assistant turn of a scheduled.task can produce user-visible output, so the discipline applies to that final text, not just to /api/notify calls. DM-tone recurring work (Morning briefing, weekly check-in, etc.) is delivered via scheduled.dm + conversational profile, not this profile — see scheduled.dm.md for those contracts.
|
|
10
|
+
|
|
11
|
+
## Output discipline
|
|
12
|
+
- Close the loop in one Agent Log line. No narration of what you decided.
|
|
13
|
+
- If the task required no action (condition stale, already done), log `- HH:MM [agent_plan] <action> — skipped (<reason>)` and exit.
|
|
14
|
+
- Never re-state the task description back to the user.
|
|
15
|
+
|
|
16
|
+
## Boundaries
|
|
17
|
+
- Do NOT send multiple notifications for a single task (one notification maximum).
|
|
18
|
+
- Do NOT schedule more than 5 follow-up wake-ups per execution.
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
---
|
|
2
|
+
schema_version: 1
|
|
3
|
+
slug: concepts/agent-day
|
|
4
|
+
title: Agent Day
|
|
5
|
+
id: agent-day
|
|
6
|
+
aliases:
|
|
7
|
+
- day boundary
|
|
8
|
+
- 04:00 boundary
|
|
9
|
+
- agent day boundary
|
|
10
|
+
category: concepts
|
|
11
|
+
summary: |
|
|
12
|
+
Aitne rolls over the "day" at 04:00 local time, not midnight, so
|
|
13
|
+
late-night work belongs to the day it started in. This shifted boundary
|
|
14
|
+
drives every routine schedule and date-stamped memory file.
|
|
15
|
+
section: agent-day
|
|
16
|
+
tags:
|
|
17
|
+
- core
|
|
18
|
+
- timing
|
|
19
|
+
- memory
|
|
20
|
+
status: stable
|
|
21
|
+
ask_examples:
|
|
22
|
+
- When does the agent day actually roll over?
|
|
23
|
+
- Why is my late-night work showing up under yesterday?
|
|
24
|
+
- How do I change the day boundary?
|
|
25
|
+
locale: en-US
|
|
26
|
+
created: 2026-04-25
|
|
27
|
+
updated: 2026-04-25
|
|
28
|
+
keywords:
|
|
29
|
+
- day boundary
|
|
30
|
+
- 04:00
|
|
31
|
+
- dayBoundaryHour
|
|
32
|
+
- rollover
|
|
33
|
+
related:
|
|
34
|
+
- features/routines/morning-routine
|
|
35
|
+
- features/memory-files/today
|
|
36
|
+
ui_anchors:
|
|
37
|
+
- /settings
|
|
38
|
+
config_keys:
|
|
39
|
+
- dayBoundaryHour
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
# Agent Day
|
|
43
|
+
|
|
44
|
+
## TL;DR
|
|
45
|
+
|
|
46
|
+
Aitne treats the "day" as starting at **04:00 local time**, not
|
|
47
|
+
00:00. Anything you log between midnight and 4am is filed under the day
|
|
48
|
+
that just ended, so a late commit at 02:30 lands in the same `today.md`
|
|
49
|
+
that opened the previous morning.
|
|
50
|
+
|
|
51
|
+
## Why This Concept Exists
|
|
52
|
+
|
|
53
|
+
Owner-as-user installations almost always have late-night work sessions
|
|
54
|
+
that, mentally, belong to "today" even though the wall-clock has already
|
|
55
|
+
ticked over. A day boundary at midnight would split a single coherent
|
|
56
|
+
working session across two `today.md` files, and the morning routine
|
|
57
|
+
would open against an empty schedule because no agent activity had been
|
|
58
|
+
logged for the new calendar day yet.
|
|
59
|
+
|
|
60
|
+
Picking 04:00 is a defensive default: late enough to capture even very
|
|
61
|
+
late nights, early enough that an early-rising operator (5–6am) sees a
|
|
62
|
+
clean boundary before they start.
|
|
63
|
+
|
|
64
|
+
## Definitions
|
|
65
|
+
|
|
66
|
+
- **Agent day**: the 24-hour window starting at the configured day-boundary hour and ending at the same hour the next calendar day.
|
|
67
|
+
- **Day boundary**: the hour-of-day that starts the agent day. Configured via the `dayBoundaryHour` setting (default `4`).
|
|
68
|
+
- **Day-stamped file**: any file whose name includes `YYYY-MM-DD` (e.g. `daily/2026-04-25.md`, `weekly/2026-04-20.md`). The date stamp uses the agent-day boundary, not the calendar day.
|
|
69
|
+
|
|
70
|
+
## Concrete Examples
|
|
71
|
+
|
|
72
|
+
| Wall-clock time | Calendar date | Agent day |
|
|
73
|
+
|---|---|---|
|
|
74
|
+
| 2026-04-25 02:30 | April 25 | April 24 (late session) |
|
|
75
|
+
| 2026-04-25 04:30 | April 25 | April 25 |
|
|
76
|
+
| 2026-04-25 23:50 | April 25 | April 25 |
|
|
77
|
+
| 2026-04-26 03:55 | April 26 | April 25 (still!) |
|
|
78
|
+
|
|
79
|
+
## Where You See It in the Dashboard
|
|
80
|
+
|
|
81
|
+
- The Schedule view labels each day's column by **agent day**, so a 02:30 calendar entry appears under the previous day's header.
|
|
82
|
+
- Activity → Conversations groups sessions by agent day for the same reason.
|
|
83
|
+
- Cost analytics roll up by agent day so a late-night research binge does not split into two separate "days" of spend.
|
|
84
|
+
|
|
85
|
+
## Related
|
|
86
|
+
|
|
87
|
+
- [Morning Routine](../features/routines/morning-routine.md) opens at the day boundary's morning-routine hour, not midnight.
|
|
88
|
+
- [today.md](../features/memory-files/today.md) is rebuilt once per agent day, anchored on the boundary.
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
---
|
|
2
|
+
schema_version: 1
|
|
3
|
+
slug: concepts/auth-health
|
|
4
|
+
title: Auth Health
|
|
5
|
+
id: auth-health
|
|
6
|
+
aliases:
|
|
7
|
+
- auth probe
|
|
8
|
+
- auth recovery
|
|
9
|
+
- credentials
|
|
10
|
+
category: concepts
|
|
11
|
+
summary: |
|
|
12
|
+
The auth-health monitor probes each backend's credentials at startup
|
|
13
|
+
and on a recurring interval, surfaces failures on the dashboard, and
|
|
14
|
+
triggers recovery flows when the right signal is available.
|
|
15
|
+
section: auth-health
|
|
16
|
+
tags:
|
|
17
|
+
- core
|
|
18
|
+
- safety
|
|
19
|
+
- backends
|
|
20
|
+
status: stable
|
|
21
|
+
ask_examples:
|
|
22
|
+
- Why is the dashboard showing a degraded backend?
|
|
23
|
+
- How does the agent check that I'm still logged in to Claude?
|
|
24
|
+
- What happens when my Codex token expires?
|
|
25
|
+
locale: en-US
|
|
26
|
+
created: 2026-04-25
|
|
27
|
+
updated: 2026-04-25
|
|
28
|
+
keywords:
|
|
29
|
+
- auth
|
|
30
|
+
- credentials
|
|
31
|
+
- probe
|
|
32
|
+
- degraded
|
|
33
|
+
related:
|
|
34
|
+
- concepts/backends-and-tiers
|
|
35
|
+
- troubleshooting/auth-failed
|
|
36
|
+
config_keys:
|
|
37
|
+
- authProbeDisabled
|
|
38
|
+
- authPreflightFreshnessMs
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
# Auth Health
|
|
42
|
+
|
|
43
|
+
## TL;DR
|
|
44
|
+
|
|
45
|
+
The daemon probes each configured backend on boot and at a freshness
|
|
46
|
+
interval. A failed probe flips the dashboard's auth-health card from
|
|
47
|
+
green to amber/red and surfaces a recovery hint.
|
|
48
|
+
|
|
49
|
+
## Why This Concept Exists
|
|
50
|
+
|
|
51
|
+
Routines silently failing because of an expired token is the most
|
|
52
|
+
common operator pain. The auth-health monitor is the proactive surface
|
|
53
|
+
that surfaces "your credentials expired" before the next morning
|
|
54
|
+
routine fails.
|
|
55
|
+
|
|
56
|
+
## Definitions
|
|
57
|
+
|
|
58
|
+
- **Probe**: a no-op call against each backend's auth surface (Claude
|
|
59
|
+
credentials store, Codex token, Gemini API key).
|
|
60
|
+
- **Preflight freshness**: how long the daemon trusts a successful
|
|
61
|
+
probe before re-running.
|
|
62
|
+
- **Recovery**: backend-specific repair (re-login, refresh token,
|
|
63
|
+
re-paste API key).
|
|
64
|
+
|
|
65
|
+
## Concrete Examples
|
|
66
|
+
|
|
67
|
+
- Claude credentials expire → probe fails → card flips amber → operator
|
|
68
|
+
re-runs `claude` CLI login.
|
|
69
|
+
- Gemini API key revoked → probe fails → card flips red → operator
|
|
70
|
+
pastes a new key on `/settings/models`.
|
|
71
|
+
|
|
72
|
+
## Related
|
|
73
|
+
|
|
74
|
+
- [Backends and Tiers](backends-and-tiers.md)
|
|
75
|
+
- [Troubleshooting: Auth Failed](../troubleshooting/auth-failed.md)
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
---
|
|
2
|
+
schema_version: 1
|
|
3
|
+
slug: concepts/backends-and-tiers
|
|
4
|
+
title: Backends and Tiers
|
|
5
|
+
id: backends-and-tiers
|
|
6
|
+
aliases:
|
|
7
|
+
- models
|
|
8
|
+
- claude codex gemini
|
|
9
|
+
- heavy tier
|
|
10
|
+
- light tier
|
|
11
|
+
category: concepts
|
|
12
|
+
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.
|
|
16
|
+
section: backends
|
|
17
|
+
tags:
|
|
18
|
+
- core
|
|
19
|
+
- backends
|
|
20
|
+
- models
|
|
21
|
+
- cost
|
|
22
|
+
status: stable
|
|
23
|
+
ask_examples:
|
|
24
|
+
- Which model does my morning routine use?
|
|
25
|
+
- How do I switch from Claude to Codex?
|
|
26
|
+
- What is the difference between heavy and light tier?
|
|
27
|
+
locale: en-US
|
|
28
|
+
created: 2026-04-25
|
|
29
|
+
updated: 2026-04-25
|
|
30
|
+
keywords:
|
|
31
|
+
- claude
|
|
32
|
+
- codex
|
|
33
|
+
- gemini
|
|
34
|
+
- opus
|
|
35
|
+
- sonnet
|
|
36
|
+
- haiku
|
|
37
|
+
- gpt-5
|
|
38
|
+
- tier
|
|
39
|
+
related:
|
|
40
|
+
- concepts/process-keys
|
|
41
|
+
- concepts/costs-and-quotas
|
|
42
|
+
- features/operations/backend-routing
|
|
43
|
+
ui_anchors:
|
|
44
|
+
- /settings/models
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
# Backends and Tiers
|
|
48
|
+
|
|
49
|
+
## TL;DR
|
|
50
|
+
|
|
51
|
+
Three backends are supported: **Claude Code** (default),
|
|
52
|
+
**Codex**, and **Gemini CLI**. Each backend exposes three classes of
|
|
53
|
+
model used at install time:
|
|
54
|
+
|
|
55
|
+
- **Main** (Sonnet 4.6 / GPT-5.4-mini / Gemini 3 Flash) — the default
|
|
56
|
+
for owner-facing work (DMs, daily / weekly / monthly review,
|
|
57
|
+
morning routine, dashboard chat, scheduled tasks).
|
|
58
|
+
- **Delegated** (Haiku 4.5 on Claude; latest light tier on Codex /
|
|
59
|
+
Gemini) — cheaper model used for "simple" backend surfaces with no
|
|
60
|
+
owner in the loop: Gmail classification, GitHub event triage,
|
|
61
|
+
git-poll observers, calendar-change handlers, the
|
|
62
|
+
`delegated_task` invoker.
|
|
63
|
+
- **Heavy** (Opus 4.7 / GPT-5.5 / Gemini 3 Pro) — registered but
|
|
64
|
+
*not* auto-selected. Operators opt in per-process from
|
|
65
|
+
`/settings/models`.
|
|
66
|
+
|
|
67
|
+
Every ProcessKey resolves to a backend + model binding via
|
|
68
|
+
`BackendRouter`. Aitne does not store or read subscription-plan state
|
|
69
|
+
— bindings come from `process_backend_config` rows seeded at install
|
|
70
|
+
time.
|
|
71
|
+
|
|
72
|
+
## Why This Concept Exists
|
|
73
|
+
|
|
74
|
+
Different work has different cost / quality tradeoffs. Owner-facing
|
|
75
|
+
surfaces (DMs, daily review) need real instruction-following.
|
|
76
|
+
Background polling (mail / calendar / git events) just needs a
|
|
77
|
+
classifier-shaped output. Splitting Sonnet vs Haiku at the seed layer
|
|
78
|
+
keeps the cost of an autonomous loop bounded without compromising the
|
|
79
|
+
quality of work the operator actually reads.
|
|
80
|
+
|
|
81
|
+
Multiple backends exist so Aitne isn't single-vendor. The same
|
|
82
|
+
operator can keep Claude as the primary brain, fall back to Codex when
|
|
83
|
+
Claude's quota is exhausted, or use Gemini for cheap polling tasks.
|
|
84
|
+
|
|
85
|
+
## Definitions
|
|
86
|
+
|
|
87
|
+
- **Backend**: the agent runtime. One of `claude`, `codex`, `gemini`.
|
|
88
|
+
- **Tier**: `heavy` or `light`. Heavy maps to the strongest model
|
|
89
|
+
(Opus / GPT-5.5 / Gemini 3 Pro). Light is the operator's day-to-day
|
|
90
|
+
tier and split at install time into Sonnet (main) vs Haiku
|
|
91
|
+
(delegated/simple).
|
|
92
|
+
- **Main / Fallback**: each ProcessKey has a `main` backend and a
|
|
93
|
+
`fallback`. The router fails over on `BackendQuotaError` /
|
|
94
|
+
`BackendDecisiveFailure`.
|
|
95
|
+
|
|
96
|
+
## Concrete Examples
|
|
97
|
+
|
|
98
|
+
| ProcessKey | Default main | Seeded model |
|
|
99
|
+
|---|---|---|
|
|
100
|
+
| `routine.morning_routine` | claude | Sonnet 4.6 |
|
|
101
|
+
| `routine.evening_review` | claude | Sonnet 4.6 |
|
|
102
|
+
| `routine.weekly_review` | claude | Sonnet 4.6 |
|
|
103
|
+
| `routine.monthly_review` | claude | Sonnet 4.6 |
|
|
104
|
+
| `routine.hourly_check` | claude | Sonnet 4.6 |
|
|
105
|
+
| `message.dm` | claude | Sonnet 4.6 |
|
|
106
|
+
| `dashboard.chat` | claude | Sonnet 4.6 |
|
|
107
|
+
| `dashboard.docs_qa` | inherits from `message.dm` | Sonnet 4.6 (light forced) |
|
|
108
|
+
| `gmail_classify` | claude | Haiku 4.5 |
|
|
109
|
+
| `github.*` | claude | Haiku 4.5 |
|
|
110
|
+
| `git.push.detected` (and other git-poll keys) | claude | Haiku 4.5 |
|
|
111
|
+
| `calendar.change` | claude | Haiku 4.5 |
|
|
112
|
+
| `delegated_task` | claude | Haiku 4.5 |
|
|
113
|
+
|
|
114
|
+
## Where You See It in the Dashboard
|
|
115
|
+
|
|
116
|
+
- **Settings → Models** is the unified surface: pick the main backend,
|
|
117
|
+
override the per-process binding, toggle the optional advisor.
|
|
118
|
+
- The **Activity** event detail shows which backend / model actually
|
|
119
|
+
ran each turn (after fallback resolution).
|
|
120
|
+
- **Analytics** rolls cost up by backend.
|
|
121
|
+
|
|
122
|
+
## Related
|
|
123
|
+
|
|
124
|
+
- [Costs and Quotas](costs-and-quotas.md) — how to read the rollup.
|
|
125
|
+
- [Backend Routing](../features/operations/backend-routing.md) — the
|
|
126
|
+
fallover machinery.
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
---
|
|
2
|
+
schema_version: 1
|
|
3
|
+
slug: concepts/costs-and-quotas
|
|
4
|
+
title: Costs and Quotas
|
|
5
|
+
id: costs-and-quotas
|
|
6
|
+
aliases:
|
|
7
|
+
- cost
|
|
8
|
+
- budget
|
|
9
|
+
- quota
|
|
10
|
+
- subscription limit
|
|
11
|
+
category: concepts
|
|
12
|
+
summary: |
|
|
13
|
+
How Aitne meters subscription windows and per-call costs,
|
|
14
|
+
and where the operator sees the rollup. Cost tracking is
|
|
15
|
+
observational — the dashboard reports, it does not bill.
|
|
16
|
+
section: cost
|
|
17
|
+
tags:
|
|
18
|
+
- cost
|
|
19
|
+
- quotas
|
|
20
|
+
- core
|
|
21
|
+
status: stable
|
|
22
|
+
ask_examples:
|
|
23
|
+
- How do I see how much my agent is spending?
|
|
24
|
+
- When do my Opus tokens reset?
|
|
25
|
+
- Why is the agent saying "subscription limit reached"?
|
|
26
|
+
locale: en-US
|
|
27
|
+
created: 2026-04-25
|
|
28
|
+
updated: 2026-04-25
|
|
29
|
+
keywords:
|
|
30
|
+
- cost
|
|
31
|
+
- budget
|
|
32
|
+
- quota
|
|
33
|
+
- max5
|
|
34
|
+
- max20
|
|
35
|
+
- opus window
|
|
36
|
+
- gemini quota
|
|
37
|
+
related:
|
|
38
|
+
- concepts/backends-and-tiers
|
|
39
|
+
- features/operations/cost-tracking
|
|
40
|
+
ui_anchors:
|
|
41
|
+
- /analytics
|
|
42
|
+
config_keys:
|
|
43
|
+
- autonomousDailyCostCapUsd
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
# Costs and Quotas
|
|
47
|
+
|
|
48
|
+
## TL;DR
|
|
49
|
+
|
|
50
|
+
Each backend bills differently:
|
|
51
|
+
|
|
52
|
+
- **Claude Code** — flat-rate inside `Claude Max5` / `Max20` with a
|
|
53
|
+
rolling 5-hour Opus window.
|
|
54
|
+
- **Codex** — flat-rate inside `Codex Pro`.
|
|
55
|
+
- **Gemini** — per-token billed against the Google API quota; free tier
|
|
56
|
+
has per-day caps.
|
|
57
|
+
|
|
58
|
+
The dashboard rolls cost up by ProcessKey, by backend, and by agent day.
|
|
59
|
+
|
|
60
|
+
## Why This Concept Exists
|
|
61
|
+
|
|
62
|
+
A proactive agent can spend without you watching. Aitne's
|
|
63
|
+
philosophy is that cost is the operator's problem to *see*, not the
|
|
64
|
+
agent's problem to *avoid*: the dashboard shows you what each routine
|
|
65
|
+
costs so you can re-pin tiers if a routine has gotten too expensive.
|
|
66
|
+
|
|
67
|
+
The autonomous daily-cost cap (`autonomousDailyCostCapUsd`) is a
|
|
68
|
+
bumper, not a budget — it pauses autonomous routines when crossed but
|
|
69
|
+
does not interrupt reactive (in-the-loop) traffic.
|
|
70
|
+
|
|
71
|
+
## Definitions
|
|
72
|
+
|
|
73
|
+
- **Subscription window**: Claude Max plans have a rolling 5-hour
|
|
74
|
+
budget for Opus + a separate Sonnet bucket. The dashboard shows
|
|
75
|
+
remaining quota and the next reset time.
|
|
76
|
+
- **Daily cost cap**: `autonomousDailyCostCapUsd` — autonomous routines
|
|
77
|
+
pause on the day they cross it. Reactive DMs / dashboard chat keep
|
|
78
|
+
running; you can always reach the agent.
|
|
79
|
+
- **Per-process tier**: each ProcessKey has its own tier, max-turns,
|
|
80
|
+
and max-budget USD. Configurable on `/settings/models`.
|
|
81
|
+
- **Quota error**: `BackendQuotaError` thrown by an SDK / CLI tells
|
|
82
|
+
the router to fail over to the fallback backend.
|
|
83
|
+
|
|
84
|
+
## Concrete Examples
|
|
85
|
+
|
|
86
|
+
- Morning routine on Opus / Max20 = "no extra charge", but eats the
|
|
87
|
+
rolling 5-hour window.
|
|
88
|
+
- Morning routine on Sonnet / Max5 = covered by the Sonnet bucket
|
|
89
|
+
(fast resets), Opus window untouched.
|
|
90
|
+
- A Gemini hourly check on Flash / API tier = ~$0.0005 per fire.
|
|
91
|
+
|
|
92
|
+
## Where You See It in the Dashboard
|
|
93
|
+
|
|
94
|
+
- **Analytics** rolls today's cost by backend, by ProcessKey, and by
|
|
95
|
+
hour. Window-remaining math is here too.
|
|
96
|
+
- **Sidebar footer** shows the day's running total.
|
|
97
|
+
- **Activity** event details include the per-execute cost.
|
|
98
|
+
|
|
99
|
+
## Related
|
|
100
|
+
|
|
101
|
+
- [Cost Tracking](../features/operations/cost-tracking.md) — operator
|
|
102
|
+
surface walkthrough.
|
|
103
|
+
- [Backends and Tiers](backends-and-tiers.md)
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
---
|
|
2
|
+
schema_version: 1
|
|
3
|
+
slug: concepts/delegated-mode
|
|
4
|
+
title: Delegated Mode (Integration Modes)
|
|
5
|
+
id: delegated-mode
|
|
6
|
+
aliases:
|
|
7
|
+
- delegated
|
|
8
|
+
- direct mode
|
|
9
|
+
- same-backend
|
|
10
|
+
- cross-backend
|
|
11
|
+
- integration delegation
|
|
12
|
+
category: concepts
|
|
13
|
+
summary: |
|
|
14
|
+
Each integration (Gmail, Google Calendar, …) runs in one of three
|
|
15
|
+
modes: direct (the daemon holds OAuth credentials), delegated (the
|
|
16
|
+
agent's backend connector holds them), or disabled. Under delegation,
|
|
17
|
+
the agent reaches the integration through one of two paths depending
|
|
18
|
+
on whether its DM session backend matches the connector's owner —
|
|
19
|
+
same-backend (native MCP, no daemon involved) or cross-backend
|
|
20
|
+
(`/api/integrations/:key/exec` task mode: the agent describes intent
|
|
21
|
+
in natural language and the daemon's delegate picks the connector
|
|
22
|
+
tool).
|
|
23
|
+
section: integrations
|
|
24
|
+
tags:
|
|
25
|
+
- core
|
|
26
|
+
- integrations
|
|
27
|
+
- safety
|
|
28
|
+
- skills
|
|
29
|
+
status: stable
|
|
30
|
+
ask_examples:
|
|
31
|
+
- What's the difference between direct and delegated mode?
|
|
32
|
+
- Why does Gmail work without my OAuth setup?
|
|
33
|
+
- When does the daemon spawn another backend to handle a Gmail call?
|
|
34
|
+
- Why don't I see a SKILL.md for Gmail in my Codex session?
|
|
35
|
+
locale: en-US
|
|
36
|
+
created: 2026-04-26
|
|
37
|
+
updated: 2026-04-26
|
|
38
|
+
keywords:
|
|
39
|
+
- delegated mode
|
|
40
|
+
- direct mode
|
|
41
|
+
- same-backend
|
|
42
|
+
- cross-backend
|
|
43
|
+
- integrations.md
|
|
44
|
+
- delegatedBackend
|
|
45
|
+
- SKILL.delegated
|
|
46
|
+
- invoke endpoint
|
|
47
|
+
related:
|
|
48
|
+
- concepts/safety-model
|
|
49
|
+
- concepts/skills
|
|
50
|
+
- concepts/safety-and-execution
|
|
51
|
+
- features/integrations/mail
|
|
52
|
+
ui_anchors:
|
|
53
|
+
- /connections
|
|
54
|
+
- /settings/models
|
|
55
|
+
config_keys:
|
|
56
|
+
- integrations
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
# Delegated Mode (Integration Modes)
|
|
60
|
+
|
|
61
|
+
## TL;DR
|
|
62
|
+
|
|
63
|
+
Each integration is in one of three modes:
|
|
64
|
+
|
|
65
|
+
| Mode | Who holds credentials | What the agent calls |
|
|
66
|
+
|---|---|---|
|
|
67
|
+
| `direct` | Daemon (OAuth in macOS Keychain) | `curl /api/mail/*` / `curl /api/calendar/*` |
|
|
68
|
+
| `delegated` | The agent's backend connector (claude.ai / ChatGPT / Google) | Native MCP tools or the `/api/integrations/:key/exec` task endpoint |
|
|
69
|
+
| `disabled` | Nobody | Nothing — the integration is off |
|
|
70
|
+
|
|
71
|
+
Under `delegated`, two sub-cases exist depending on whether the DM session's
|
|
72
|
+
backend is the same as the integration's `delegatedBackend`:
|
|
73
|
+
|
|
74
|
+
- **Same-backend** — DM agent calls the connector's MCP tool directly.
|
|
75
|
+
The daemon is not involved. No skill body is materialized.
|
|
76
|
+
- **Cross-backend** — DM agent calls
|
|
77
|
+
`POST /api/integrations/:key/exec {task, outputSchema, …}` with a
|
|
78
|
+
natural-language `task`. The daemon spawns a one-shot subprocess of
|
|
79
|
+
`delegatedBackend`, lets it pick the right MCP tool against the
|
|
80
|
+
per-task allowed-tools envelope, validates the JSON, and returns it.
|
|
81
|
+
(Earlier versions of this concept used an RPC `{tool, args}` shape
|
|
82
|
+
at `/invoke`; that route is retired — see DELEGATED-TASK-MODE-DESIGN.md.)
|
|
83
|
+
|
|
84
|
+
## Why This Concept Exists
|
|
85
|
+
|
|
86
|
+
The setup tax for direct mode (OAuth client setup in a vendor console, then
|
|
87
|
+
JSON download, then keychain seeding) is the single biggest blocker for
|
|
88
|
+
non-technical operators. Every supported backend — Claude Code, Codex,
|
|
89
|
+
Gemini CLI — already ships first-party connectors to Gmail, Calendar,
|
|
90
|
+
Drive, and more. When the operator is signed into claude.ai or ChatGPT,
|
|
91
|
+
the agent can reach those services through the backend's own MCP tools,
|
|
92
|
+
zero daemon credentials required.
|
|
93
|
+
|
|
94
|
+
Delegated mode lets the operator skip the vendor console entirely. The
|
|
95
|
+
two sub-cases (same- vs cross-backend) exist because the agent's DM
|
|
96
|
+
session may run on a different backend than the one whose connector is
|
|
97
|
+
signed in — e.g. a Claude DM session whose Gmail comes from Codex. In
|
|
98
|
+
that case the daemon spawns the other backend per call.
|
|
99
|
+
|
|
100
|
+
## Definitions
|
|
101
|
+
|
|
102
|
+
- **`direct`** — daemon holds the credentials (OAuth refresh token in
|
|
103
|
+
macOS Keychain, app-password for Yahoo / iCloud, …). Pollers run.
|
|
104
|
+
Full feature set. The operator did the vendor-console setup.
|
|
105
|
+
- **`delegated`** — daemon holds nothing for this integration. Pollers
|
|
106
|
+
are stopped. The connector running inside the agent's backend (or a
|
|
107
|
+
spawned-on-demand backend) does the work.
|
|
108
|
+
- **`disabled`** — nobody holds credentials. The integration is off.
|
|
109
|
+
- **`delegatedBackend`** — when delegated, which backend's connector
|
|
110
|
+
serves the calls. `claude` / `codex` / `gemini`. Editable per
|
|
111
|
+
integration in **Connections → Gmail / Google Calendar**.
|
|
112
|
+
- **Same-backend** — DM session backend matches `delegatedBackend`. The
|
|
113
|
+
daemon is not in the loop; the agent calls native MCP directly. No
|
|
114
|
+
skill body is materialized for the integration's slug — the connector
|
|
115
|
+
describes its own tools at session-init.
|
|
116
|
+
- **Cross-backend** — DM session backend differs from `delegatedBackend`.
|
|
117
|
+
The agent reaches the integration through
|
|
118
|
+
`POST /api/integrations/:key/exec` (task mode — natural-language
|
|
119
|
+
`task` + JSON `outputSchema`) and the daemon spawns
|
|
120
|
+
`delegatedBackend` as a subprocess for each call. A
|
|
121
|
+
`SKILL.delegated.<sessionBackend>.md` file is materialized into the
|
|
122
|
+
session workdir.
|
|
123
|
+
- **`integrations.md`** — daemon-rendered snapshot of every
|
|
124
|
+
integration's mode at `~/.personal-agent/integrations.md`. The agent
|
|
125
|
+
reads it to know which path to take.
|
|
126
|
+
|
|
127
|
+
## How to Choose
|
|
128
|
+
|
|
129
|
+
| You want… | Pick |
|
|
130
|
+
|---|---|
|
|
131
|
+
| Full feature set (send mail, attachments, full search) and you're comfortable with one-time vendor-console setup | **direct** |
|
|
132
|
+
| Zero setup tax, willing to live with whatever the connector exposes (Claude Gmail = draft-only; Codex Gmail = full) | **delegated** |
|
|
133
|
+
| The integration off entirely | **disabled** |
|
|
134
|
+
|
|
135
|
+
When you pick `delegated`, also pick `delegatedBackend`:
|
|
136
|
+
|
|
137
|
+
- **Same as your DM main backend** → faster, simpler, no proxy spawn,
|
|
138
|
+
but per-tool cost is not measurable (rolls up into the parent
|
|
139
|
+
session). Best when one backend has everything you need.
|
|
140
|
+
- **Different from your DM main backend** → adds a one-shot subprocess
|
|
141
|
+
per call; per-call cost is auditable. Best when one backend has the
|
|
142
|
+
connector you want (e.g. Codex's full Gmail) but a different backend
|
|
143
|
+
is your preferred DM driver (e.g. Claude).
|
|
144
|
+
|
|
145
|
+
## Concrete Examples
|
|
146
|
+
|
|
147
|
+
| Setup | What happens on a Gmail search |
|
|
148
|
+
|---|---|
|
|
149
|
+
| Gmail direct | Agent: `curl /api/mail/<acct>/messages?q=...` → daemon hits Gmail API with stored OAuth |
|
|
150
|
+
| Gmail delegated to Codex × Codex DM (same-backend) | Agent: `mcp__codex_apps__gmail._search_emails(...)` → Codex's connector hits Gmail. No daemon involvement. No skill file. |
|
|
151
|
+
| Gmail delegated to Codex × Claude DM (cross-backend) | Agent: `curl -X POST /api/integrations/gmail/exec -d '{"task":"Search Gmail for…","outputSchema":{...},"cacheable":true}'` → daemon spawns Codex subprocess → Codex picks the right MCP primitive (e.g. `_search_emails`) → daemon validates the JSON against the schema and returns it |
|
|
152
|
+
|
|
153
|
+
## How the Skill File Resolves
|
|
154
|
+
|
|
155
|
+
`selectSkillVariantFile(skillSlug, sessionBackend, integrations)` returns
|
|
156
|
+
one of three values:
|
|
157
|
+
|
|
158
|
+
- `"SKILL.md"` — direct mode, or skill not gated by any integration.
|
|
159
|
+
- `null` — every touched integration is delegated and same-backend.
|
|
160
|
+
No skill is materialized (the connector self-describes).
|
|
161
|
+
- `"SKILL.delegated.<sessionBackend>.md"` — at least one touched
|
|
162
|
+
integration is delegated cross-backend; one body per session backend
|
|
163
|
+
covers every `delegatedBackend` because the API is uniform.
|
|
164
|
+
|
|
165
|
+
Mixed states (some same-backend, some cross-backend) fall back to
|
|
166
|
+
`SKILL.md`.
|
|
167
|
+
|
|
168
|
+
## Where You See It in the Dashboard
|
|
169
|
+
|
|
170
|
+
- **Connections → Gmail / Google Calendar** — per-integration mode
|
|
171
|
+
picker, `delegatedBackend` dropdown, deny-list editor.
|
|
172
|
+
- **Settings → Models** — main backend switch. Flipping main flips the
|
|
173
|
+
same-/cross-backend status of every delegated integration and
|
|
174
|
+
re-materializes the active DM workdir.
|
|
175
|
+
- **Setup wizard** — first-run integration mode picker; delegated mode
|
|
176
|
+
is gated on a live probe that confirms the connector reports every
|
|
177
|
+
`requiredCapability` for the integration.
|
|
178
|
+
|
|
179
|
+
## How `integrations.md` Reflects This
|
|
180
|
+
|
|
181
|
+
`~/.personal-agent/integrations.md` is the operator-readable snapshot the
|
|
182
|
+
agent consults at session-init. Example:
|
|
183
|
+
|
|
184
|
+
```markdown
|
|
185
|
+
## gmail
|
|
186
|
+
mode: delegated
|
|
187
|
+
delegatedBackend: codex
|
|
188
|
+
deniedTools:
|
|
189
|
+
- send_email
|
|
190
|
+
- delete_emails
|
|
191
|
+
|
|
192
|
+
## google_calendar
|
|
193
|
+
mode: delegated
|
|
194
|
+
delegatedBackend: claude
|
|
195
|
+
deniedTools:
|
|
196
|
+
- delete_event
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
A daemon-side write chokepoint guarantees the file matches DB state. The
|
|
200
|
+
fs-watcher reverts hand-edits that fail validation and DMs the operator.
|
|
201
|
+
|
|
202
|
+
## Failure Modes
|
|
203
|
+
|
|
204
|
+
- **Cross-backend, connector signed out on `delegatedBackend`** — the
|
|
205
|
+
invoke endpoint returns `502 auth_error`. Skill prose tells the agent
|
|
206
|
+
to surface this as "re-sign-in to the connector."
|
|
207
|
+
- **Same-backend, connector not signed in on the DM backend** — the
|
|
208
|
+
agent has no Gmail tools at all. The setup wizard's pre-commit live
|
|
209
|
+
probe is the primary defense; if the operator signs out
|
|
210
|
+
post-setup, the agent will report "no Gmail tools available" until
|
|
211
|
+
re-signed.
|
|
212
|
+
- **Mode flip mid-call** — the invoke endpoint returns
|
|
213
|
+
`409 precondition`; agent re-reads `integrations.md` and replans.
|
|
214
|
+
|
|
215
|
+
## Related
|
|
216
|
+
|
|
217
|
+
- [Safety Model](safety-model.md) — how the deny list (the primary
|
|
218
|
+
defense in delegated mode) works.
|
|
219
|
+
- [Skills](skills.md) — how `selectSkillVariantFile` picks the body.
|
|
220
|
+
- Integration Delegation Framework (design) — `docs/design/14-integration-delegation.md`,
|
|
221
|
+
the load-bearing spec.
|
|
222
|
+
- Delegated Mode v2 (design) — `DELEGATED-MODE-V2-DESIGN.md`, the
|
|
223
|
+
canonical model for the current behavior.
|