@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,53 @@
|
|
|
1
|
+
---
|
|
2
|
+
schema_version: 1
|
|
3
|
+
slug: troubleshooting/messaging-not-pairing
|
|
4
|
+
title: Messaging Not Pairing
|
|
5
|
+
id: messaging-not-pairing
|
|
6
|
+
category: troubleshooting
|
|
7
|
+
summary: |
|
|
8
|
+
The magic phrase isn't pairing your messaging account. Usually the
|
|
9
|
+
bot can't see DMs, the phrase expired, or the message went to a
|
|
10
|
+
group instead of a direct channel.
|
|
11
|
+
section: messaging-not-pairing
|
|
12
|
+
tags:
|
|
13
|
+
- troubleshooting
|
|
14
|
+
- messaging
|
|
15
|
+
status: stable
|
|
16
|
+
ask_examples:
|
|
17
|
+
- Why isn't my magic phrase pairing?
|
|
18
|
+
- Where do I send the magic phrase?
|
|
19
|
+
locale: en-US
|
|
20
|
+
created: 2026-04-25
|
|
21
|
+
updated: 2026-04-25
|
|
22
|
+
related:
|
|
23
|
+
- features/messaging/pairing-and-magic-phrase
|
|
24
|
+
- features/messaging/overview
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
# Messaging Not Pairing
|
|
28
|
+
|
|
29
|
+
## What You See
|
|
30
|
+
|
|
31
|
+
- After DMing the magic phrase, the dashboard's pairing card stays in
|
|
32
|
+
"waiting" state.
|
|
33
|
+
|
|
34
|
+
## Most Likely Causes
|
|
35
|
+
|
|
36
|
+
1. Phrase expired — generate a new one.
|
|
37
|
+
2. Bot does not have DM permission (Discord, Slack).
|
|
38
|
+
3. DM was sent in a group / channel by mistake.
|
|
39
|
+
4. Bot token wrong — paste it in again.
|
|
40
|
+
|
|
41
|
+
## Diagnostic Steps
|
|
42
|
+
|
|
43
|
+
1. Click "Regenerate phrase" on `/connections/messaging`.
|
|
44
|
+
2. Confirm bot privileges in the messaging app.
|
|
45
|
+
3. Send the phrase from a direct chat with the bot.
|
|
46
|
+
|
|
47
|
+
## Confirming the Fix
|
|
48
|
+
|
|
49
|
+
- The pairing card shows your owner identity.
|
|
50
|
+
|
|
51
|
+
## Related
|
|
52
|
+
|
|
53
|
+
- [Pairing & Magic Phrase](../features/messaging/pairing-and-magic-phrase.md)
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
---
|
|
2
|
+
schema_version: 1
|
|
3
|
+
slug: troubleshooting/morning-routine-didnt-run
|
|
4
|
+
title: Morning Routine Didn't Run
|
|
5
|
+
id: morning-routine-didnt-run
|
|
6
|
+
aliases:
|
|
7
|
+
- morning routine missed
|
|
8
|
+
- empty today
|
|
9
|
+
- no morning briefing
|
|
10
|
+
category: troubleshooting
|
|
11
|
+
summary: |
|
|
12
|
+
The most common operator pain. Causes are ordered by frequency:
|
|
13
|
+
daemon was stopped, fallback failed, quota exhausted, schedule
|
|
14
|
+
configuration mismatch, day-boundary subtlety.
|
|
15
|
+
section: morning-routine-didnt-run
|
|
16
|
+
tags:
|
|
17
|
+
- troubleshooting
|
|
18
|
+
- routine
|
|
19
|
+
status: stable
|
|
20
|
+
ask_examples:
|
|
21
|
+
- Why didn't my morning routine fire?
|
|
22
|
+
- Why is today.md empty?
|
|
23
|
+
locale: en-US
|
|
24
|
+
created: 2026-04-25
|
|
25
|
+
updated: 2026-04-25
|
|
26
|
+
related:
|
|
27
|
+
- features/routines/morning-routine
|
|
28
|
+
- troubleshooting/auth-failed
|
|
29
|
+
- troubleshooting/quota-exhausted
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
# Morning Routine Didn't Run
|
|
33
|
+
|
|
34
|
+
## What You See
|
|
35
|
+
|
|
36
|
+
- An empty or stale `today.md`.
|
|
37
|
+
- No morning notification.
|
|
38
|
+
- Activity has no `routine.morning_routine` row for today.
|
|
39
|
+
|
|
40
|
+
## Most Likely Causes (in probability order)
|
|
41
|
+
|
|
42
|
+
1. **Daemon was stopped at the trigger time.** Check `pa status`.
|
|
43
|
+
2. **Fallback failed too.** Look for a `fallback-failed` notification.
|
|
44
|
+
3. **Heavy-tier quota exhausted on both backends.** See
|
|
45
|
+
[Quota Exhausted](quota-exhausted.md).
|
|
46
|
+
4. **Hourly check skip-gate fired during the trigger window.** The
|
|
47
|
+
morning routine and the hourly check share an atomic flag — if the
|
|
48
|
+
hourly check was already running at the rollover instant, the
|
|
49
|
+
morning routine won't double-fire.
|
|
50
|
+
5. **Day-boundary subtlety.** Before `dayBoundaryHour`, the routine
|
|
51
|
+
still "belongs to" yesterday — see
|
|
52
|
+
[Agent Day](../concepts/agent-day.md).
|
|
53
|
+
|
|
54
|
+
## Diagnostic Steps
|
|
55
|
+
|
|
56
|
+
1. `pa status` — daemon up?
|
|
57
|
+
2. `/activity` — any row for `routine.morning_routine`?
|
|
58
|
+
3. `/settings/routines` — the routine list shows the next scheduled
|
|
59
|
+
fire and recent runs.
|
|
60
|
+
4. `pa logs` — search for `morning_routine`.
|
|
61
|
+
|
|
62
|
+
## Confirming the Fix
|
|
63
|
+
|
|
64
|
+
- The next morning's routine fires within 60 seconds of
|
|
65
|
+
`dayBoundaryHour` (default 04:00).
|
|
66
|
+
- Activity shows the row with a non-error outcome.
|
|
67
|
+
|
|
68
|
+
## When None of the Above Help
|
|
69
|
+
|
|
70
|
+
- Open an issue with a redacted excerpt of the daemon log around the
|
|
71
|
+
expected fire time.
|
|
72
|
+
|
|
73
|
+
## Related
|
|
74
|
+
|
|
75
|
+
- [Morning Routine](../features/routines/morning-routine.md)
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
---
|
|
2
|
+
schema_version: 1
|
|
3
|
+
slug: troubleshooting/observation-not-detected
|
|
4
|
+
title: Observation Not Detected
|
|
5
|
+
id: observation-not-detected
|
|
6
|
+
category: troubleshooting
|
|
7
|
+
summary: |
|
|
8
|
+
An expected change (commit, note, calendar move) didn't surface in
|
|
9
|
+
the hourly check. Most often a polling delay, a vault/repo not
|
|
10
|
+
watched, or the change was authored by the agent itself.
|
|
11
|
+
section: observation-not-detected
|
|
12
|
+
tags:
|
|
13
|
+
- troubleshooting
|
|
14
|
+
- observations
|
|
15
|
+
status: stable
|
|
16
|
+
ask_examples:
|
|
17
|
+
- Why didn't the agent notice my new commit?
|
|
18
|
+
- Why didn't a calendar change show up?
|
|
19
|
+
locale: en-US
|
|
20
|
+
created: 2026-04-25
|
|
21
|
+
updated: 2026-04-25
|
|
22
|
+
related:
|
|
23
|
+
- concepts/observations
|
|
24
|
+
- features/integrations/git
|
|
25
|
+
- features/integrations/obsidian
|
|
26
|
+
- features/routines/hourly-check
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
# Observation Not Detected
|
|
30
|
+
|
|
31
|
+
## What You See
|
|
32
|
+
|
|
33
|
+
- A change you made by hand, not echoed by the hourly check.
|
|
34
|
+
- The hourly check ran but did not mention it.
|
|
35
|
+
|
|
36
|
+
## Most Likely Causes
|
|
37
|
+
|
|
38
|
+
1. Poll has not yet fired since your change.
|
|
39
|
+
2. The repo / vault is not on the watched list.
|
|
40
|
+
3. The change was tagged `actor='agent'` (anti-loop filter).
|
|
41
|
+
4. Below the `hourlyCheckMinObservations` threshold.
|
|
42
|
+
|
|
43
|
+
## Diagnostic Steps
|
|
44
|
+
|
|
45
|
+
1. Confirm the integration's "last polled" timestamp on
|
|
46
|
+
`/connections/...`.
|
|
47
|
+
2. Confirm the observed path is in the watched set.
|
|
48
|
+
3. Lower `hourlyCheckMinObservations` to test.
|
|
49
|
+
|
|
50
|
+
## Confirming the Fix
|
|
51
|
+
|
|
52
|
+
- Future changes record observations and surface in the next
|
|
53
|
+
hourly check.
|
|
54
|
+
|
|
55
|
+
## Related
|
|
56
|
+
|
|
57
|
+
- [Observations](../concepts/observations.md)
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
---
|
|
2
|
+
schema_version: 1
|
|
3
|
+
slug: troubleshooting/quota-exhausted
|
|
4
|
+
title: Quota Exhausted
|
|
5
|
+
id: quota-exhausted
|
|
6
|
+
aliases:
|
|
7
|
+
- max5 limit hit
|
|
8
|
+
- opus window
|
|
9
|
+
- subscription limit
|
|
10
|
+
category: troubleshooting
|
|
11
|
+
summary: |
|
|
12
|
+
A backend reported a quota error and the router fell over to the
|
|
13
|
+
fallback. Either wait for the window to refresh or upgrade the plan.
|
|
14
|
+
section: quota-exhausted
|
|
15
|
+
tags:
|
|
16
|
+
- troubleshooting
|
|
17
|
+
- cost
|
|
18
|
+
- backends
|
|
19
|
+
status: stable
|
|
20
|
+
ask_examples:
|
|
21
|
+
- Why am I seeing "subscription limit reached"?
|
|
22
|
+
- When does the Opus window reset?
|
|
23
|
+
locale: en-US
|
|
24
|
+
created: 2026-04-25
|
|
25
|
+
updated: 2026-04-25
|
|
26
|
+
related:
|
|
27
|
+
- concepts/costs-and-quotas
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
# Quota Exhausted
|
|
31
|
+
|
|
32
|
+
## What You See
|
|
33
|
+
|
|
34
|
+
- A `BackendQuotaError` row in Activity.
|
|
35
|
+
- Fallback ran the next routine instead of main.
|
|
36
|
+
- Analytics shows the budget close to or past the cap.
|
|
37
|
+
|
|
38
|
+
## Most Likely Causes
|
|
39
|
+
|
|
40
|
+
1. **5-hour Opus window** burned by a heavy routine cluster.
|
|
41
|
+
2. **Daily Sonnet bucket** hit on a long-running session.
|
|
42
|
+
3. **Gemini per-day cap** for `gemini-2.5-flash` reached on the free
|
|
43
|
+
tier.
|
|
44
|
+
|
|
45
|
+
## Diagnostic Steps
|
|
46
|
+
|
|
47
|
+
1. Open `/analytics` and look at the by-backend rollup.
|
|
48
|
+
2. The "next reset" timestamp on Claude's card tells you when the
|
|
49
|
+
rolling window refreshes.
|
|
50
|
+
|
|
51
|
+
## Confirming the Fix
|
|
52
|
+
|
|
53
|
+
- The next run after the window resets succeeds on the main backend.
|
|
54
|
+
|
|
55
|
+
## Related
|
|
56
|
+
|
|
57
|
+
- [Costs and Quotas](../concepts/costs-and-quotas.md)
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: drift-analysis
|
|
3
|
+
description: Read signals → decide which to act on, which to ignore, which to defer. Never act on a single signal in isolation; require corroboration.
|
|
4
|
+
allowed-tools:
|
|
5
|
+
- Read
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Drift Analysis
|
|
9
|
+
|
|
10
|
+
Signals live under `data/signals/<skill_slug>.json` in your workdir.
|
|
11
|
+
Each is one row from `skill_curation_signals`:
|
|
12
|
+
|
|
13
|
+
```jsonc
|
|
14
|
+
{
|
|
15
|
+
"id": 42,
|
|
16
|
+
"skill_slug": "user-profile",
|
|
17
|
+
"section_id": "topic-files",
|
|
18
|
+
"signal_type": "structure_diff",
|
|
19
|
+
"payload": { "sub_kind": "heading_add", "target": "user/personal.md#健康記録" },
|
|
20
|
+
"observed_at": 1717000000000
|
|
21
|
+
}
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Corroboration rule
|
|
25
|
+
|
|
26
|
+
A single `structure_diff` signal is suggestive, not actionable. To submit
|
|
27
|
+
a proposal you must EITHER:
|
|
28
|
+
|
|
29
|
+
- cite ≥ 2 distinct signals affecting the same `(skill, section)`, OR
|
|
30
|
+
- cite a single signal of weight ≥ 3 (only `owner_correction` qualifies).
|
|
31
|
+
|
|
32
|
+
Single-signal proposals from `structure_diff` alone are auto-rejected by
|
|
33
|
+
the smoke test (`signal_citations_valid`). Don't try.
|
|
34
|
+
|
|
35
|
+
## Triage taxonomy
|
|
36
|
+
|
|
37
|
+
For each (skill, section) with corroborated signals, classify the change
|
|
38
|
+
shape:
|
|
39
|
+
|
|
40
|
+
- `additive_only` — signals all describe ADD operations (file_add,
|
|
41
|
+
heading_add). Propose with confidence; the worst case is a `revert`.
|
|
42
|
+
- `mixed` — some adds, some modifications. Propose with extra rationale
|
|
43
|
+
citing each signal's contribution.
|
|
44
|
+
- `destructive` — at least one signal cites a removal. Only propose if
|
|
45
|
+
signals explicitly state user intent to remove (`owner_correction`
|
|
46
|
+
with intent="remove"; structure_diff alone is insufficient). When in
|
|
47
|
+
doubt, SKIP.
|
|
48
|
+
|
|
49
|
+
## Skip conditions
|
|
50
|
+
|
|
51
|
+
Do nothing on (skill, section) when ANY of these hold:
|
|
52
|
+
|
|
53
|
+
- Signals contradict (one says add, another says remove the same target).
|
|
54
|
+
- All signals are < 24h old (`structure_diff` low-weight gate hasn't
|
|
55
|
+
matured; the snapshot may be a brief experiment).
|
|
56
|
+
- Section is `frozen` (returns from `/skills/<slug>` as `frozen=true`).
|
|
57
|
+
- Section had a proposal applied or auto-applied within the last 7 days
|
|
58
|
+
(cooldown).
|
|
59
|
+
- Section had a proposal reverted/conflict in the last 14 days.
|
|
60
|
+
|
|
61
|
+
## Self-restraint
|
|
62
|
+
|
|
63
|
+
**It is correct and expected to finish a run with zero proposals.** The
|
|
64
|
+
optimizer's success is measured over weeks, not per run. The owner
|
|
65
|
+
prefers "no action needed" to a low-confidence proposal. If you're
|
|
66
|
+
unsure, skip.
|
|
67
|
+
|
|
68
|
+
## Recording your decisions
|
|
69
|
+
|
|
70
|
+
Use `POST /api/skill-curation/runs/<runId>/finalize`'s `notes` field to
|
|
71
|
+
explain skips. Examples:
|
|
72
|
+
|
|
73
|
+
- "user-profile/routing-table: 3 signals but contradictory (one heading_add for ## Health, two heading_remove for same — likely an in-progress restructure). Skipping until next cadence."
|
|
74
|
+
- "today/section-shape: 1 structure_diff signal — below corroboration threshold."
|
|
75
|
+
- "context/file-responsibilities: section frozen since 2026-04-22 owner revert. Skipping."
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: knowledge-map
|
|
3
|
+
description: Read knowledge-map.json snapshots correctly. Distinguish facts (what exists today) from signals (evidence of recent change).
|
|
4
|
+
allowed-tools:
|
|
5
|
+
- Read
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Knowledge Map
|
|
9
|
+
|
|
10
|
+
The file `data/knowledge-map.json` in your workdir is a structural
|
|
11
|
+
snapshot of `~/.personal-agent/context/` taken at run start. It is the
|
|
12
|
+
ground truth for "what files exist and what headings they contain right
|
|
13
|
+
now." Use it for `paths_resolve` / `sections_resolve` validation BEFORE
|
|
14
|
+
submitting a proposal.
|
|
15
|
+
|
|
16
|
+
## Schema
|
|
17
|
+
|
|
18
|
+
```jsonc
|
|
19
|
+
{
|
|
20
|
+
"context_dir": "/Users/.../personal-agent/context",
|
|
21
|
+
"taken_at": 1717000000000,
|
|
22
|
+
"files": [
|
|
23
|
+
{
|
|
24
|
+
"path": "user/profile.md",
|
|
25
|
+
"headings": ["Identity", "Work Pattern", "Learned Context"],
|
|
26
|
+
"frontmatter": { "type": "profile", "owner": "shared" },
|
|
27
|
+
"last_modified_at": 1716900000000
|
|
28
|
+
},
|
|
29
|
+
...
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
- Globs in skill `scope_paths` (e.g. `user/*.md`) are NOT pre-expanded —
|
|
35
|
+
match yourself.
|
|
36
|
+
- `headings[]` order is document order, leading `## ` / `### ` already
|
|
37
|
+
stripped.
|
|
38
|
+
- `frontmatter` is a flat string→scalar object (no nested YAML).
|
|
39
|
+
|
|
40
|
+
## How to compare snapshot to a current payload
|
|
41
|
+
|
|
42
|
+
A `knowledge_layout` payload's `files[]` SHOULD agree with the snapshot's
|
|
43
|
+
files. When they diverge:
|
|
44
|
+
|
|
45
|
+
- Snapshot has a file the payload doesn't → `additive` opportunity.
|
|
46
|
+
- Snapshot is missing a file the payload claims → likely a `destructive`
|
|
47
|
+
proposal, but ONLY propose if signals corroborate (a `file_remove`
|
|
48
|
+
structure_diff, an owner_correction, etc.).
|
|
49
|
+
- Snapshot has a heading the payload doesn't list → `additive` (heading
|
|
50
|
+
added since last overlay).
|
|
51
|
+
- Payload claims a heading the snapshot doesn't have → `destructive`,
|
|
52
|
+
same corroboration rule.
|
|
53
|
+
|
|
54
|
+
## Anti-patterns
|
|
55
|
+
|
|
56
|
+
- NEVER infer `cross_references` payloads from snapshot adjacency alone.
|
|
57
|
+
"Two files in the same directory" is not evidence of a relationship.
|
|
58
|
+
Cross-references require an explicit citing signal.
|
|
59
|
+
- NEVER propose a `frontmatter_schema` reduction (drop a `required[]`
|
|
60
|
+
entry) — schema reduction is a separate human PR. The smoke test
|
|
61
|
+
rejects this anyway.
|
|
62
|
+
- NEVER propose changes that turn a heading list of length 6 into 3.
|
|
63
|
+
Walked-only signals can be wrong; combine with at least one signal of
|
|
64
|
+
weight ≥ 2 before considering removal.
|
|
65
|
+
|
|
66
|
+
## Time interpretation
|
|
67
|
+
|
|
68
|
+
- `last_modified_at < 7 days ago` → "fresh", may be in flux.
|
|
69
|
+
- `last_modified_at` older than 60 days, unchanged → "stable", safe to
|
|
70
|
+
treat as permanent layout.
|
|
71
|
+
- Frequency-of-change is OUT of scope for the optimizer (no analytics).
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: skill-curation
|
|
3
|
+
description: Submit typed-payload proposals to update knowledge-cartography sections of skills. Read-then-validate-then-submit. Never invent new section ids or kinds.
|
|
4
|
+
allowed-tools:
|
|
5
|
+
- Bash(curl http://localhost:8321/api/skill-curation/*)
|
|
6
|
+
- Read
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Skill Curation
|
|
10
|
+
|
|
11
|
+
You are running inside an isolated optimizer workdir. The ONLY mutation
|
|
12
|
+
surface available to you is the curation API at
|
|
13
|
+
`http://localhost:8321/api/skill-curation/*`. You cannot Edit, Write,
|
|
14
|
+
MultiEdit, NotebookEdit, run shell commands other than the curl glob, or
|
|
15
|
+
read any file outside this workdir's `data/` subtree.
|
|
16
|
+
|
|
17
|
+
## Workflow (in order, every run)
|
|
18
|
+
|
|
19
|
+
1. List candidate skills:
|
|
20
|
+
`curl -s http://localhost:8321/api/skill-curation/skills`
|
|
21
|
+
2. For each skill the run targets, list its current sections:
|
|
22
|
+
`curl -s http://localhost:8321/api/skill-curation/skills/<slug>`
|
|
23
|
+
3. Read the current payload for each candidate section:
|
|
24
|
+
`curl -s http://localhost:8321/api/skill-curation/skills/<slug>/sections/<section_id>`
|
|
25
|
+
4. Compare against the knowledge-map snapshot under `data/knowledge-map.json`.
|
|
26
|
+
5. For each section where signals + snapshot agree on a real change, submit
|
|
27
|
+
ONE proposal at a time, the smallest payload that closes the gap.
|
|
28
|
+
|
|
29
|
+
## Submission shape
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
POST /api/skill-curation/proposals
|
|
33
|
+
Header: X-Optimizer-Token: <runToken from env>
|
|
34
|
+
Body:
|
|
35
|
+
{
|
|
36
|
+
"runId": "<runId>",
|
|
37
|
+
"skill_slug": "user-profile",
|
|
38
|
+
"section_id": "topic-files",
|
|
39
|
+
"payload": { "kind": "knowledge_layout", "files": [...] },
|
|
40
|
+
"rationale": "structure_diff observed `## 健康記録` heading on user/personal.md last week",
|
|
41
|
+
"signal_ids": [42, 47]
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
The API returns `{proposalId, rendered, diff}` on accept. On reject, the
|
|
46
|
+
response body lists `failures[]` — fix the payload and try again.
|
|
47
|
+
|
|
48
|
+
## Hard rules (auto-reject)
|
|
49
|
+
|
|
50
|
+
- Never invent new `section_id` values. If the skill doesn't declare a
|
|
51
|
+
section, you cannot create one.
|
|
52
|
+
- Never POST to a section whose declared `kind` doesn't match your
|
|
53
|
+
payload's `kind`.
|
|
54
|
+
- Never re-submit a `frozen` section (`/skills/<slug>` returns
|
|
55
|
+
`frozen_sections`). The frozen state is a deliberate owner override.
|
|
56
|
+
- ALWAYS cite at least one `signal_id`. A proposal with empty
|
|
57
|
+
`signal_ids[]` is rejected.
|
|
58
|
+
- Never copy a `signal_id` already cited in another proposal in the same
|
|
59
|
+
run (each signal is consumed once).
|
|
60
|
+
|
|
61
|
+
## Decision-language guard
|
|
62
|
+
|
|
63
|
+
Free-text fields (`convention_notes.rule`, `routing_table.note`,
|
|
64
|
+
`search_recipes.note`) MUST describe the convention, not prescribe an
|
|
65
|
+
action. Examples:
|
|
66
|
+
|
|
67
|
+
- ❌ "When the user mentions a doctor visit, write to user/personal.md"
|
|
68
|
+
- ✅ "Doctor visits are recorded under `user/personal.md ## 健康記録`"
|
|
69
|
+
- ❌ "Always include the date with the entry"
|
|
70
|
+
- ✅ "Entries carry a `[YYYY-MM-DD]` prefix"
|
|
71
|
+
- ❌ "Never use spaces in slugs"
|
|
72
|
+
- ✅ "Slugs are kebab-case, no spaces"
|
|
73
|
+
|
|
74
|
+
The API rejects payloads that match `\b(must|always|never)\b` or
|
|
75
|
+
imperative `when X then Y` / `if X do Y` / `before X you should Y`
|
|
76
|
+
constructions. If you find yourself wanting to write a rule, restate it
|
|
77
|
+
as a description.
|
|
78
|
+
|
|
79
|
+
## Dry-run discipline
|
|
80
|
+
|
|
81
|
+
Every proposal MUST be dry-run first to surface smoke-test failures
|
|
82
|
+
without consuming signals:
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
POST /api/skill-curation/proposals/dryrun
|
|
86
|
+
(same body shape; no proposalId returned, only diff + failures)
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
If `dryrun` returns failures, fix the payload — never skip dry-run.
|
|
90
|
+
|
|
91
|
+
## Stop conditions
|
|
92
|
+
|
|
93
|
+
If a section's signals contradict each other (one says "add ## Health",
|
|
94
|
+
another says "## Health was deleted"), submit no proposal and surface the
|
|
95
|
+
conflict in the run summary by including a `notes` field on
|
|
96
|
+
`POST /api/skill-curation/runs/<runId>/finalize`. It is correct and
|
|
97
|
+
expected to finish a run with zero proposals.
|
|
98
|
+
|
|
99
|
+
## Finalization
|
|
100
|
+
|
|
101
|
+
When you've submitted all proposals you intend to:
|
|
102
|
+
|
|
103
|
+
```
|
|
104
|
+
POST /api/skill-curation/runs/<runId>/finalize
|
|
105
|
+
Body: { "notes": "applied 2 additions for user-profile, skipped today (contradictory signals)" }
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
The daemon notifies the owner and tears down your workdir.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: git-repo
|
|
3
|
+
owner: shared
|
|
4
|
+
updated: {updated}
|
|
5
|
+
slug: {repo_slug}
|
|
6
|
+
classification: repo-only
|
|
7
|
+
git_repo: {repo_path}
|
|
8
|
+
default_branch: {default_branch}
|
|
9
|
+
remote: {origin_url}
|
|
10
|
+
account_alias: {account_alias}
|
|
11
|
+
last_activity: {last_commit_date}
|
|
12
|
+
---
|
|
13
|
+
# {repo_name}
|
|
14
|
+
|
|
15
|
+
## Activity
|
|
16
|
+
- Last reviewed: {updated}
|
|
17
|
+
- Default branch: {default_branch}
|
|
18
|
+
- Remote: {origin_url}
|
|
19
|
+
|
|
20
|
+
## Recent Pushes
|
|
21
|
+
- Add notable remote changes here.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: project
|
|
3
|
+
owner: shared
|
|
4
|
+
updated: {updated}
|
|
5
|
+
slug: {repo_slug}
|
|
6
|
+
category: {category}
|
|
7
|
+
status: active
|
|
8
|
+
org: {org}
|
|
9
|
+
git_repo: {repo_path}
|
|
10
|
+
default_branch: {default_branch}
|
|
11
|
+
remote: {origin_url}
|
|
12
|
+
account_alias: {account_alias}
|
|
13
|
+
created: {first_commit_date}
|
|
14
|
+
last_activity: {last_commit_date}
|
|
15
|
+
---
|
|
16
|
+
# {repo_name}
|
|
17
|
+
|
|
18
|
+
## Overview
|
|
19
|
+
- Purpose:
|
|
20
|
+
- Current state:
|
|
21
|
+
- Primary owner:
|
|
22
|
+
|
|
23
|
+
## Git Activity
|
|
24
|
+
- Last reviewed: {updated}
|
|
25
|
+
- Default branch: {default_branch}
|
|
26
|
+
- Remote: {origin_url}
|
|
27
|
+
|
|
28
|
+
## Lifecycle Phases
|
|
29
|
+
- Initial documentation created from Git history.
|
|
30
|
+
|
|
31
|
+
## Notable Changes
|
|
32
|
+
- Add durable project milestones and important merges here.
|
|
33
|
+
|
|
34
|
+
## Open Threads
|
|
35
|
+
- Add follow-ups that should remain visible across sessions.
|
|
36
|
+
|
|
37
|
+
## History (compressed)
|
|
38
|
+
- Summarize older activity here as the file grows.
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: attach
|
|
3
|
+
description: Load when the reply should embed a file (generated md/PDF/CSV, chart image, modified upload) — `Write` to disk alone is not delivery.
|
|
4
|
+
when_to_use: The only channel that delivers a file alongside chat. Skip if the user only needs the path mentioned, not the bytes attached.
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Bash(curl *)
|
|
7
|
+
- Write
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Attach files to your reply
|
|
11
|
+
|
|
12
|
+
You can deliver files alongside your reply by uploading them to the daemon's outbound-attachment endpoint. The daemon collects everything tagged with the current turn's token, pins it to the assistant message it is about to record, and hands the file refs to the originating adapter (dashboard in Phase 1) so the user sees it in the same chat thread.
|
|
13
|
+
|
|
14
|
+
## When to use
|
|
15
|
+
|
|
16
|
+
- User asks for a chart/graph, PDF export, CSV dump, text file, or an image you produced this turn.
|
|
17
|
+
- A file is meaningfully better than a large inline paste (e.g. several-page report).
|
|
18
|
+
- User uploaded a file and asks for a modified / summarized version in return.
|
|
19
|
+
|
|
20
|
+
Do NOT use this for trivial text that fits in a chat reply — pasting inline is faster and easier to skim.
|
|
21
|
+
|
|
22
|
+
## Tools you may use (enforced allowlist)
|
|
23
|
+
|
|
24
|
+
Only the following tools are available inside this skill. Everything else is denied silently in `dontAsk` mode — do not try alternatives, pipes, or shell helpers.
|
|
25
|
+
|
|
26
|
+
| Tool | Purpose |
|
|
27
|
+
|---|---|
|
|
28
|
+
| `Write` | Create the file to upload (text, markdown, CSV, JSON, YAML). |
|
|
29
|
+
| `Bash(curl *)` | Issue exactly one POST to the daemon per file. |
|
|
30
|
+
|
|
31
|
+
### Commands that WILL be denied — do not attempt
|
|
32
|
+
|
|
33
|
+
The Claude Code permission classifier blocks these patterns under `dontAsk`. Attempting them wastes a turn and confuses the user.
|
|
34
|
+
|
|
35
|
+
- **Any shell expansion of an environment variable**: `$PA_TURN_TOKEN`, `$HOME`, `$(date +%Y)`, `` `whoami` `` — all auto-denied. This is why the turn token is injected by the daemon's curl wrapper instead of being passed inline (see below).
|
|
36
|
+
- `ls /tmp/...` / `ls <absolute-path>` — absolute-path listings are auto-denied.
|
|
37
|
+
- `cat <file>`, `head`, `tail`, `stat`, `file`, `test -f`, `echo <anything>` — none are on the allowlist.
|
|
38
|
+
- Chained commands via `&&`, `||`, `;`, `|` — each segment is evaluated separately; any segment outside the allowlist fails the whole line.
|
|
39
|
+
- `python3 ...`, `pandoc`, `node <script>`, `sh -c`, etc. — not on the allowlist. Binary/PDF/chart generation is out of scope for Phase 1; stick to text formats you can `Write`.
|
|
40
|
+
|
|
41
|
+
If you *think* you need one of the above, the answer is to pre-compute the value in your reasoning, write it as a literal, and invoke curl once with no substitutions.
|
|
42
|
+
|
|
43
|
+
## Per-turn capability token
|
|
44
|
+
|
|
45
|
+
The daemon issues a per-turn token and makes the session's curl wrapper (`.pa/bin/curl`) attach it automatically to requests to `/api/chat/outbound-attachments`. **Do not pass `X-Turn-Token` yourself** — inline `$PA_TURN_TOKEN` expansion is blocked by the permission classifier, and the wrapper already handles this for you.
|
|
46
|
+
|
|
47
|
+
If the turn has already ended (or no token was issued), the daemon returns HTTP 403 `missing_turn_token`. Treat that as a terminal signal, not something to retry.
|
|
48
|
+
|
|
49
|
+
## API
|
|
50
|
+
|
|
51
|
+
### POST /api/chat/outbound-attachments
|
|
52
|
+
|
|
53
|
+
Upload a single file (one call per file). Multipart `file` field, optional `X-Filename` + `X-Caption` headers. The wrapper injects `X-Turn-Token` automatically.
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
curl -s -X POST http://localhost:8321/api/chat/outbound-attachments \
|
|
57
|
+
-H "X-Filename: weekly-summary.md" \
|
|
58
|
+
-H "X-Caption: Weekly summary" \
|
|
59
|
+
-F "file=@/tmp/weekly-summary.md"
|
|
60
|
+
# → {"id":"<uuid>"} on success
|
|
61
|
+
# → {"error":"missing_turn_token"} HTTP 403
|
|
62
|
+
# → {"error":"invalid_turn_token"} HTTP 403
|
|
63
|
+
# → {"error":"too_large"} HTTP 400
|
|
64
|
+
# → {"error":"disallowed_mime"} HTTP 400
|
|
65
|
+
# → {"error":"too_many_uploads"} HTTP 429
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
| Header / field | Purpose |
|
|
69
|
+
|---|---|
|
|
70
|
+
| `file` (form field, binary) | The bytes to deliver. Stream from a file you just created with `Write`. |
|
|
71
|
+
| `X-Filename` | Optional. Overrides the filename shown to the user. Literal string — no substitutions. Default: the multipart `filename` parameter. |
|
|
72
|
+
| `X-Caption` | Optional. ≤ 1024 chars. Literal string — no `$(...)` / backticks. |
|
|
73
|
+
|
|
74
|
+
> The wrapper silently adds `X-Turn-Token` from `PA_TURN_TOKEN`. Do not add it yourself. If you *do* pass `X-Turn-Token` explicitly (e.g. during local debugging), the wrapper will respect your value and not overwrite it.
|
|
75
|
+
|
|
76
|
+
### Size and type limits (Phase 1)
|
|
77
|
+
|
|
78
|
+
- Images: **≤ 5 MB** (PNG, JPEG, WebP, GIF, HEIC, SVG).
|
|
79
|
+
- Other files: **≤ 25 MB** (PDF, DOCX/XLSX/PPTX, ODT, TXT, MD, CSV, JSON, YAML, XML, common source types).
|
|
80
|
+
- **Audio/video** uploads are rejected — Phase 3 work.
|
|
81
|
+
- Executables, archives (zip/tar/7z/rar), and unknown binary payloads are rejected.
|
|
82
|
+
|
|
83
|
+
Per-turn total across all attachments is capped at **100 MB**; the endpoint returns 429/`too_many_uploads` if you issue more than 5 concurrent uploads on the same turn.
|
|
84
|
+
|
|
85
|
+
## Workflow
|
|
86
|
+
|
|
87
|
+
1. Decide the filename and caption up front (literal strings — no shell interpolation).
|
|
88
|
+
2. Generate the content and write it with the `Write` tool. Use `/tmp/<name>` as the path; never write into the session workdir or the context dir.
|
|
89
|
+
3. Issue the single curl POST shown above. One file per call.
|
|
90
|
+
4. Branch on the response:
|
|
91
|
+
- Success (`{"id": "..."}`) — mention the attachment in your reply, e.g. `"Attached: weekly-summary.md"`. You may discard the id; the daemon links it to your message automatically.
|
|
92
|
+
- HTTP 403 (`missing_turn_token` / `invalid_turn_token`) — the turn has already been released or the skill was invoked outside a turn. Do not retry. Fall back to inline paste and tell the user the attachment could not be sent.
|
|
93
|
+
- Other errors — follow the table below.
|
|
94
|
+
|
|
95
|
+
Never base-64 embed files into your reply body. Always go through this endpoint.
|
|
96
|
+
|
|
97
|
+
## Errors
|
|
98
|
+
|
|
99
|
+
| Response | Cause | What to do |
|
|
100
|
+
|---|---|---|
|
|
101
|
+
| 403 `missing_turn_token` / `invalid_turn_token` | Turn already ended, or the header was empty at request time | Do not retry. Paste content inline and mention the limitation. |
|
|
102
|
+
| 400 `too_large` | File exceeded the per-type cap | Trim / summarize the content before retrying. |
|
|
103
|
+
| 400 `disallowed_mime` / `undetected_mime` | Format not on the Phase 1 allowlist | Convert to an allowed format (e.g. table → CSV). |
|
|
104
|
+
| 429 `too_many_uploads` | > 5 uploads in flight on this turn | Wait briefly and retry, or batch into fewer files. |
|