@aitne-sh/aitne 0.1.5 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/README.md +16 -0
  2. package/agent-assets/agent-profiles/_safety.md +17 -2
  3. package/agent-assets/agent-profiles/routine-fetch-window.md +75 -40
  4. package/agent-assets/agent-profiles/wiki-agent.md +19 -0
  5. package/agent-assets/docs/features/messaging/bang-commands.md +161 -0
  6. package/agent-assets/docs/features/messaging/overview.md +3 -0
  7. package/agent-assets/docs/features/wiki/commands.md +222 -0
  8. package/agent-assets/docs/features/wiki/overview.md +145 -0
  9. package/agent-assets/docs/getting-started/03-what-can-this-do.md +18 -0
  10. package/agent-assets/docs/glossary.md +34 -0
  11. package/agent-assets/docs/guides/budget-and-cost-for-wiki.md +123 -0
  12. package/agent-assets/docs/guides/build-your-wiki.md +99 -0
  13. package/agent-assets/docs/guides/explore-with-trace-and-connect.md +169 -0
  14. package/agent-assets/docs/guides/maintain-wiki-health.md +168 -0
  15. package/agent-assets/docs/guides/multiple-wikis-for-multiple-domains.md +192 -0
  16. package/agent-assets/docs/guides/pause-the-agent.md +10 -3
  17. package/agent-assets/docs/guides/use-an-existing-obsidian-vault.md +156 -0
  18. package/agent-assets/docs/reference/cli-commands.md +24 -1
  19. package/agent-assets/docs/troubleshooting/wiki-ingest-full-blocked.md +96 -0
  20. package/agent-assets/docs/troubleshooting/wiki-write-failed.md +82 -0
  21. package/agent-assets/skills/context/SKILL.md +288 -17
  22. package/agent-assets/skills/external-services/SKILL.delegated.claude.md +2 -2
  23. package/agent-assets/skills/external-services/SKILL.delegated.codex.md +3 -3
  24. package/agent-assets/skills/external-services/SKILL.delegated.gemini.md +6 -6
  25. package/agent-assets/skills/external-services/SKILL.md +5 -3
  26. package/agent-assets/skills/external-services/SKILL.native.claude.md +49 -58
  27. package/agent-assets/skills/external-services/SKILL.native.codex.md +50 -58
  28. package/agent-assets/skills/external-services/SKILL.native.gemini.md +53 -56
  29. package/agent-assets/skills/mail/SKILL.md +5 -5
  30. package/agent-assets/skills/mail/SKILL.native.claude.md +57 -65
  31. package/agent-assets/skills/mail/SKILL.native.codex.md +73 -75
  32. package/agent-assets/skills/mail/SKILL.native.gemini.md +80 -75
  33. package/agent-assets/skills/management-task-register/SKILL.md +3 -3
  34. package/agent-assets/skills/notion/SKILL.native.claude.md +78 -82
  35. package/agent-assets/skills/notion/SKILL.native.codex.md +78 -80
  36. package/agent-assets/skills/notion/SKILL.native.gemini.md +91 -90
  37. package/agent-assets/skills/observations/SKILL.md +104 -14
  38. package/agent-assets/skills/roadmap/SKILL.md +19 -0
  39. package/agent-assets/skills/schedule/SKILL.md +44 -3
  40. package/agent-assets/skills/today/SKILL.md +25 -5
  41. package/agent-assets/skills/travel-time/SKILL.md +9 -0
  42. package/agent-assets/skills/wiki/wiki-ask/SKILL.md +32 -0
  43. package/agent-assets/skills/wiki/wiki-compile/SKILL.md +126 -0
  44. package/agent-assets/skills/wiki/wiki-connect/SKILL.md +75 -0
  45. package/agent-assets/skills/wiki/wiki-graduate/SKILL.md +45 -0
  46. package/agent-assets/skills/wiki/wiki-ingest/SKILL.md +182 -0
  47. package/agent-assets/skills/wiki/wiki-lint/SKILL.md +90 -0
  48. package/agent-assets/skills/wiki/wiki-trace/SKILL.md +72 -0
  49. package/agent-assets/skills/wiki/wiki-vault-rules/SKILL.md +145 -0
  50. package/agent-assets/task-flows/_partials/calendar-acquire.google_calendar.md +28 -9
  51. package/agent-assets/task-flows/_partials/calendar-acquire.outlook_calendar.md +26 -9
  52. package/agent-assets/task-flows/_partials/mail-acquire.gmail.md +51 -24
  53. package/agent-assets/task-flows/_partials/mail-acquire.outlook_mail.md +46 -16
  54. package/agent-assets/task-flows/_partials/notion-acquire.notion.md +29 -9
  55. package/agent-assets/task-flows/message.received.dm.md +35 -2
  56. package/agent-assets/task-flows/message.received.dm.native.claude.md +25 -26
  57. package/agent-assets/task-flows/message.received.dm.native.codex.md +30 -24
  58. package/agent-assets/task-flows/message.received.dm.native.gemini.md +36 -36
  59. package/agent-assets/task-flows/message.received.dm_first.md +43 -4
  60. package/agent-assets/task-flows/message.received.dm_first.native.claude.md +20 -20
  61. package/agent-assets/task-flows/message.received.dm_first.native.codex.md +22 -19
  62. package/agent-assets/task-flows/message.received.dm_first.native.gemini.md +28 -24
  63. package/agent-assets/task-flows/routine.fetch_window.md +51 -36
  64. package/agent-assets/task-flows/routine.morning_routine.md +12 -3
  65. package/agent-assets/task-flows/routine.morning_routine_initial.md +22 -1
  66. package/agent-assets/task-flows/scheduled.dm.md +477 -0
  67. package/agent-assets/task-flows/wiki.ask.md +11 -0
  68. package/agent-assets/task-flows/wiki.compile.md +28 -0
  69. package/agent-assets/task-flows/wiki.connect.md +12 -0
  70. package/agent-assets/task-flows/wiki.ingest_url.md +35 -0
  71. package/agent-assets/task-flows/wiki.lint.md +13 -0
  72. package/agent-assets/task-flows/wiki.trace.md +13 -0
  73. package/agent-assets/wiki-seeds/schemas/output.md +12 -0
  74. package/agent-assets/wiki-seeds/schemas/raw.md +13 -0
  75. package/agent-assets/wiki-seeds/schemas/wiki.md +12 -0
  76. package/agent-assets/wiki-seeds/taxonomy.md +13 -0
  77. package/package.json +21 -41
@@ -102,9 +102,9 @@ label?"*
102
102
  flow with the chosen tool as a hint.)
103
103
  - **One plausible** → continue.
104
104
 
105
- NEVER hardcode tool names or pattern-match against
106
- `mcp__claude_ai_<App>__*`. The user may have installed a custom MCP
107
- with non-standard names — you read the tool description and pick by
105
+ NEVER hardcode tool names or pattern-match against a specific
106
+ namespace prefix. The user may have installed a custom MCP with
107
+ non-standard names — you read the tool description and pick by
108
108
  **capability**, not by name.
109
109
 
110
110
  ### Step 4 — Read-only probe
@@ -1,13 +1,13 @@
1
1
  ---
2
2
  name: notion
3
- description: Load when the task touches Notion and Notion is in native mode bound to Claude (`nativeBackend === "claude"`). Use Claude's hosted Notion connector directly; the daemon does not proxy Notion. `/api/notion/databases` (label → UUID config dump) is the only daemon route still reachable.
3
+ description: Load when the task touches Notion and Notion is in native mode bound to Claude (`nativeBackend === "claude"`). Use the in-session Notion connector your harness exposes directly; the daemon does not proxy Notion. `/api/notion/databases` (label → UUID config dump) is the only daemon route still reachable.
4
4
  allowed-tools:
5
5
  - Bash(curl *)
6
6
  - Bash(jq *)
7
7
  - Read
8
8
  ---
9
9
 
10
- # Notion (native — Claude Notion connector)
10
+ # Notion (native — in-session Notion connector)
11
11
 
12
12
  > **Refusal directive — read first.** Notion is in `native` mode bound
13
13
  > to Claude. Do **NOT** call any of:
@@ -19,8 +19,9 @@ allowed-tools:
19
19
  > `/api/notion/pages/<id>/content` (each route-prefix 410 in native
20
20
  > mode)
21
21
  >
22
- > Reach Notion through the `mcp__claude_ai_Notion__*` MCP tools this
23
- > Claude session already holds.
22
+ > Reach Notion through the in-session Notion connector your harness
23
+ > exposes. Your tool menu lists every available tool at session start
24
+ > — pick the Notion one.
24
25
  >
25
26
  > The one exception: **`GET /api/notion/databases`** remains reachable
26
27
  > in every mode. It is a config dump (label → UUID map) with no Notion
@@ -34,7 +35,7 @@ the `<integration-routing-table>` block in the session preamble.
34
35
  Database UUIDs are unstable; user-facing labels (`"projects"`,
35
36
  `"meeting-notes"`, `"tasks"`) map to UUIDs through the daemon's
36
37
  settings store. Resolve label → UUID BEFORE any Notion call so the
37
- MCP arguments carry concrete UUIDs.
38
+ connector arguments carry concrete UUIDs.
38
39
 
39
40
  ```bash
40
41
  curl -s http://localhost:8321/api/notion/databases
@@ -43,54 +44,50 @@ curl -s http://localhost:8321/api/notion/databases
43
44
 
44
45
  This route is **not** part of the absolute deny set and is intentionally
45
46
  ungated in native mode — the agent reads the same labels in every mode.
46
- The `notion-fetch` tool accepts either a Notion page URL or a UUID;
47
- pass the UUID resolved here.
47
+ Notion page fetch typically accepts either a page URL or a UUID; pass
48
+ the UUID resolved here.
48
49
 
49
- ## 2. Notion — Claude's hosted Notion connector (native MCP)
50
+ ## 2. Notion — in-session connector
50
51
 
51
- Tool namespace: `mcp__claude_ai_Notion__`
52
+ The exact tool names depend on which Notion connector your harness has
53
+ loaded. Inspect your tool menu at session start and pick the matching
54
+ capability.
52
55
 
53
- ### Read-class tools
56
+ ### Read-class capabilities
54
57
 
55
- | Capability | Tool | Use |
56
- |---|---|---|
57
- | `search` | `mcp__claude_ai_Notion__notion-search` | Workspace search (text + Notion query parameters). |
58
- | `read` | `mcp__claude_ai_Notion__notion-fetch` | Retrieve a single page / database / block by URL or UUID; returns content + child block tree. |
59
- | `comments` | `mcp__claude_ai_Notion__notion-get-comments` | Read comments on a page. |
60
- | `users` | `mcp__claude_ai_Notion__notion-get-users` | Enumerate workspace users. |
61
- | `teams` | `mcp__claude_ai_Notion__notion-get-teams` | Enumerate teams / teamspaces. |
58
+ | Capability | What to do |
59
+ |---|---|
60
+ | `search` | Workspace search (text + Notion query parameters), optionally filtered to a specific data source. |
61
+ | `read` | Retrieve a single page / database / block by URL or UUID; returns content + child block tree. |
62
+ | `comments` | Read comments on a page. |
63
+ | `users` | Enumerate workspace users. |
64
+ | `teams` | Enumerate teams / teamspaces. |
62
65
 
63
- Canonical search call:
66
+ Canonical search flow:
64
67
 
65
- ```
66
- mcp__claude_ai_Notion__notion-search(
67
- query="acme proposal",
68
- query_type="internal",
69
- data_source_url="https://www.notion.so/<workspace>/<database-uuid>"
70
- )
71
- ```
68
+ 1. Resolve the database label → UUID via `/api/notion/databases` (§1).
69
+ 2. Invoke your connector's search function with the user's query, the
70
+ data-source URL constructed from the resolved UUID, and the
71
+ `internal` query-type when targeting a known database.
72
72
 
73
- Canonical page read:
73
+ Canonical page read: invoke your connector's fetch / read-page function
74
+ with the page's URL or UUID.
74
75
 
75
- ```
76
- mcp__claude_ai_Notion__notion-fetch(id="<page-url-or-uuid>")
77
- ```
78
-
79
- ### Destructive tools (require explicit user confirmation)
76
+ ### Destructive capabilities (require explicit user confirmation)
80
77
 
81
78
  Per the registry's
82
- `notion.backendConnectors.claude.destructiveTools`:
83
-
84
- - `notion-create-pages` — adds new pages.
85
- - `notion-update-page`mutates properties / content; **also** the
86
- archive workaround (Status="Archived")§3 below.
87
- - `notion-duplicate-page`clones a page.
88
- - `notion-move-pages`relocates pages between databases / parents.
89
- - `notion-create-comment`posts a comment (user-visible).
90
- - `notion-create-database`schema admin (creates new DB).
91
- - `notion-update-data-source` — schema admin (mutates DB columns).
92
- - `notion-create-view` — schema admin (new view on DB).
93
- - `notion-update-view` — schema admin (mutates view config).
79
+ `notion.backendConnectors.claude.destructiveTools`, the following
80
+ capability classes are destructive in native:claude mode:
81
+
82
+ - **Page creation** adds new pages.
83
+ - **Page update**mutates properties / content; **also** the archive
84
+ workaround (Status="Archived")§3 below.
85
+ - **Page duplicate** clones a page.
86
+ - **Page move** relocates pages between databases / parents.
87
+ - **Comment create**posts a comment (user-visible).
88
+ - **Database create** — schema admin (creates new DB).
89
+ - **Data-source update** — schema admin (mutates DB columns).
90
+ - **View create / update** — schema admin (new view / mutates view config).
94
91
 
95
92
  Apply the destructive-confirm contract every time:
96
93
 
@@ -98,10 +95,9 @@ Apply the destructive-confirm contract every time:
98
95
  2. Surface verbatim and wait for explicit user OK.
99
96
  3. On OK, issue the call.
100
97
 
101
- Schema-admin tools (`notion-create-database`, `notion-update-data-source`,
102
- `notion-create-view`, `notion-update-view`) are higher stakes than
103
- page mutations — explicitly name "this is a schema-admin change" in
104
- the plan you surface.
98
+ Schema-admin capability classes (database create, data-source update,
99
+ view create / update) are higher stakes than page mutations — explicitly
100
+ name "this is a schema-admin change" in the plan you surface.
105
101
 
106
102
  The starter `deniedTools` list (typically denies the schema-admin set)
107
103
  is enforced before the call lands. The absolute-block layer continues
@@ -109,18 +105,17 @@ to fire regardless of mode.
109
105
 
110
106
  ## 3. Page archive — workaround only
111
107
 
112
- Claude's hosted Notion connector does **not** expose an archive /
113
- trash tool. `in_trash` is rejected as a property by
114
- `notion-update-page`. To "archive" a page:
108
+ Hosted Notion connectors typically do **not** expose an archive / trash
109
+ tool. `in_trash` is rejected as a property by the page-update function.
110
+ To "archive" a page:
115
111
 
116
112
  1. **Property workaround** (preferred when the page lives in a
117
- database with a Status property): `notion-update-page(id=<uuid>,
118
- properties={Status: {status: {name: "Archived"}}})`. The page
119
- stays addressable but drops out of default views.
120
- 2. **Move to a "Trash" page**: `notion-move-pages(...)` under a
121
- top-level "Trash" page (creating it first via
122
- `notion-create-pages` if absent). Reversible without admin
123
- intervention.
113
+ database with a Status property): update the page's Status property
114
+ to "Archived". The page stays addressable but drops out of default
115
+ views.
116
+ 2. **Move to a "Trash" page**: move the page under a top-level "Trash"
117
+ page (creating it first via page-creation if absent). Reversible
118
+ without admin intervention.
124
119
 
125
120
  Surface either option to the user before issuing — they are
126
121
  explicitly user-visible workarounds, not silent archive equivalents.
@@ -128,11 +123,12 @@ explicitly user-visible workarounds, not silent archive equivalents.
128
123
  ## 4. Structured database filtering
129
124
 
130
125
  For "what tasks are in status X" or any `WHERE <property> = ...`
131
- intent, use `notion-search` with the data-source filter and let the
132
- connector do the matching. Claude's connector does not expose a
133
- SQL-style query primitive (Codex's `notion_query_data_sources`
134
- covers that gap when delegated cross-backend; native-Claude has the
135
- search-with-filter primitive instead).
126
+ intent, use your connector's search function with a data-source filter
127
+ and let the connector do the matching. The hosted Notion connector
128
+ typically does not expose a SQL-style query primitive (Codex's
129
+ `notion_query_data_sources` covers that gap when delegated
130
+ cross-backend; native-Claude has the search-with-filter primitive
131
+ instead).
136
132
 
137
133
  ## 5. Decision rules
138
134
 
@@ -140,42 +136,42 @@ search-with-filter primitive instead).
140
136
  "External services are read-only this hour" constraint from
141
137
  `routine.hourly_check.native.claude.md`. No creates, property
142
138
  updates, content patches, or archives during the hourly pass.
143
- - **Mass-update — ask first.** A `notion-create-pages` call can take
144
- up to 100 pages in one shot, and `notion-move-pages` /
145
- `notion-update-page` batches can touch many rows. Summarise and
146
- confirm any change that would touch more than ~10 pages.
139
+ - **Mass-update — ask first.** A page-creation call can take up to
140
+ 100 pages in one shot, and move / update batches can touch many
141
+ rows. Summarise and confirm any change that would touch more than
142
+ ~10 pages.
147
143
  - **Schema admin — Approve-tier.** Database / view / data-source
148
144
  mutations alter workspace structure. Surface explicitly and ask;
149
145
  do not auto-confirm "this looks right".
150
- - **Comments are user-visible.** `notion-create-comment` posts to a
151
- page comment thread — treat it like a send: confirm before issuing.
146
+ - **Comments are user-visible.** Posting a page comment is treated
147
+ like a send: confirm before issuing.
152
148
 
153
149
  ## 6. Persisting observations from native fetches
154
150
 
155
151
  When `routine.hourly_check.native.claude.md`'s Step 0c fetches recent
156
152
  Notion edits, POST each materialised page to `/api/observations`. The
157
153
  daemon computes `contentHash` server-side via
158
- `@personal-agent/shared/observations-hash.ts`; pass `payload` verbatim:
154
+ `@personal-agent/shared/observations-hash.ts`; pass `payload` verbatim.
155
+
156
+ **Batch when you have more than one page.** Use
157
+ `POST /api/observations/batch` with up to 200 items in one
158
+ `observations[]` array (see the `observations` skill for the envelope).
159
+ The single-item form below is for the rare "one page changed" case.
159
160
 
160
161
  ```bash
161
162
  curl -s -X POST http://localhost:8321/api/observations \
162
163
  -H 'Content-Type: application/json' \
163
164
  -d '{
164
- "source": "notion",
165
- "type": "notion:lifecycle",
165
+ "source": "notion:<workspaceId>",
166
166
  "ref": "<pageId>",
167
- "actor": "user",
168
- "receivedAt": "<ISO-8601 UTC>",
169
- "summary_text": "<title last edited HH:MM>",
170
- "refs": {
171
- "pageId": "<id>",
172
- "parentDatabase": "<db-uuid-or-null>",
173
- "title": "<title>"
174
- },
175
- "payload": <verbatim MCP page object>
167
+ "changeType": "created",
168
+ "actor": "agent",
169
+ "payload": <verbatim connector page object>
176
170
  }'
177
171
  ```
178
172
 
173
+ `actor` MUST be `"agent"` or `"system"` — the server rejects `"user"`.
174
+
179
175
  `/api/observations` is never gated. HTTP 409 indicates a mode-flip
180
176
  race window (§11.3.1); stop and re-read `<integration_modes>`.
181
177
 
@@ -196,7 +192,7 @@ Single page edits and routine reads do not need a notify.
196
192
 
197
193
  ## 8. Cost / audit
198
194
 
199
- Native MCP calls land `agent_actions` rows of type `mcp_call` with
200
- `provider="claude"`, the tool name, and the parent `event_id` /
195
+ Native connector calls land `agent_actions` rows of type `mcp_call`
196
+ with `provider="claude"`, the tool name, and the parent `event_id` /
201
197
  `processKey`. The cost dashboard joins these to the registry by
202
198
  `toolNamespace` prefix for the `nativeAttribution` rollup (§14.4).
@@ -1,13 +1,13 @@
1
1
  ---
2
2
  name: notion
3
- description: Load when the task touches Notion and Notion is in native mode bound to Codex (`nativeBackend === "codex"`). Use Codex's hosted Notion MCP directly; the daemon does not proxy Notion. `/api/notion/databases` (label → UUID config dump) is the only daemon route still reachable.
3
+ description: Load when the task touches Notion and Notion is in native mode bound to Codex (`nativeBackend === "codex"`). Use the in-session Notion connector your Codex harness exposes directly; the daemon does not proxy Notion. `/api/notion/databases` (label → UUID config dump) is the only daemon route still reachable.
4
4
  allowed-tools:
5
5
  - Bash(curl *)
6
6
  - Bash(jq *)
7
7
  - Read
8
8
  ---
9
9
 
10
- # Notion (native — Codex Notion MCP)
10
+ # Notion (native — in-session Notion connector)
11
11
 
12
12
  > **Refusal directive — read first.** Notion is in `native` mode bound
13
13
  > to Codex. Do **NOT** call any of:
@@ -18,8 +18,9 @@ allowed-tools:
18
18
  > - `/api/notion/query`, `/api/notion/search`, `/api/notion/pages`,
19
19
  > `/api/notion/pages/<id>/content` (each route-prefix 410)
20
20
  >
21
- > Reach Notion through the `mcp__codex_apps__notion._*` MCP tools your
22
- > Codex session already holds.
21
+ > Reach Notion through the in-session Notion connector your harness
22
+ > exposes. Your tool menu lists every available tool at session start
23
+ > — pick the Notion one.
23
24
  >
24
25
  > Exception: **`GET /api/notion/databases`** remains reachable in every
25
26
  > mode (it is a config dump with no Notion API side-effect).
@@ -34,118 +35,115 @@ curl -s http://localhost:8321/api/notion/databases
34
35
  # → { "databases": { "<label>": { "id": "<uuid>", "title": "..." }, ... } }
35
36
  ```
36
37
 
37
- Resolve label → UUID before any Notion call. Codex's namespace
38
- terminates with `._`; the bare suffix below is what you write after
39
- the namespace (`_search` = `mcp__codex_apps__notion._search`).
38
+ Resolve label → UUID before any Notion call so the connector arguments
39
+ carry concrete UUIDs.
40
40
 
41
- ## 2. Notion — Codex's hosted Notion MCP (native)
41
+ ## 2. Notion — in-session connector
42
42
 
43
- Tool namespace: `mcp__codex_apps__notion._`
43
+ The exact tool names depend on which Notion connector your harness has
44
+ loaded. Inspect your tool menu at session start and pick the matching
45
+ capability. Codex-side hosted Notion connectors typically include a
46
+ structured query primitive that Claude's connector lacks; the table
47
+ below treats it as a capability rather than naming the tool.
44
48
 
45
- ### Read-class tools
49
+ ### Read-class capabilities
46
50
 
47
- | Capability | Tool | Use |
48
- |---|---|---|
49
- | `search` | `_search` | Workspace search. |
50
- | `read` | `_fetch` | Single page / database / block by URL or UUID; returns block tree. |
51
- | `comments` | `_notion_get_comments` | Read page comments. |
52
- | `users` | `_notion_get_users` | Enumerate workspace users. |
53
- | `teams` | `_notion_get_teams` | Enumerate teams. |
54
- | `query_data_sources` | `_notion_query_data_sources` | **SQL-style** structured filter (`WHERE <property> = ?`) — Codex-only capability, not exposed by Claude. Use it for "what tasks are in status X" intents. |
55
- | `query_meeting_notes` | `_notion_query_meeting_notes` | Structured filter over the user's meeting-notes data source (niche). |
51
+ | Capability | What to do |
52
+ |---|---|
53
+ | `search` | Workspace search (text + Notion query parameters), optionally filtered to a specific data source. |
54
+ | `read` | Retrieve a single page / database / block by URL or UUID; returns block tree. |
55
+ | `comments` | Read page comments. |
56
+ | `users` | Enumerate workspace users. |
57
+ | `teams` | Enumerate teams / teamspaces. |
58
+ | `query_data_sources` | **SQL-style** structured filter (`WHERE <property> = ?`) — Codex-side connectors typically expose this; use it for "what tasks are in status X" intents when available. Falls back to `search` + client-side filtering when absent. |
59
+ | `query_meeting_notes` | Structured filter over a meeting-notes data source (niche, only some connectors expose it). |
56
60
 
57
- Canonical search call:
61
+ Canonical search flow: invoke your connector's search function with
62
+ the user's text query and the data-source UUID resolved in §1.
58
63
 
59
- ```
60
- mcp__codex_apps__notion._search(
61
- query="acme proposal",
62
- data_source_id="<db-uuid-resolved-from-labels>"
63
- )
64
- ```
65
-
66
- Canonical structured filter (Codex-only):
67
-
68
- ```
69
- mcp__codex_apps__notion._notion_query_data_sources(
70
- data_source_id="<db-uuid>",
71
- filter="Status = 'Active' AND Priority = 'P1'",
72
- limit=20
73
- )
74
- ```
64
+ Canonical structured filter (when the connector exposes it): invoke
65
+ the structured-query function with the data-source UUID, a filter
66
+ expression like `"Status = 'Active' AND Priority = 'P1'"`, and a
67
+ sensible `limit`.
75
68
 
76
- Canonical page read:
69
+ Canonical page read: invoke your connector's fetch / read-page function
70
+ with the page's URL or UUID.
77
71
 
78
- ```
79
- mcp__codex_apps__notion._fetch(id="<page-url-or-uuid>")
80
- ```
81
-
82
- ### Destructive tools (require explicit user confirmation)
72
+ ### Destructive capabilities (require explicit user confirmation)
83
73
 
84
- Per the registry's `notion.backendConnectors.codex.destructiveTools`:
74
+ Per the registry's `notion.backendConnectors.codex.destructiveTools`,
75
+ the following capability classes are destructive in native:codex mode:
85
76
 
86
- - `_notion_create_pages`
87
- - `_notion_update_page` — properties, content, archive workaround.
88
- - `_notion_duplicate_page`
89
- - `_notion_move_pages`
90
- - `_notion_create_comment`
91
- - `_notion_create_database`schema admin.
92
- - `_notion_update_data_source` — schema admin.
93
- - `_notion_create_view` — schema admin.
94
- - `_notion_update_view` — schema admin.
77
+ - **Page creation** — adds new pages (batch-aware on most connectors).
78
+ - **Page update** mutates properties / content; **also** the archive
79
+ workaround (Status="Archived") — §3 below.
80
+ - **Page duplicate** — clones a page.
81
+ - **Page move** — relocates pages between databases / parents.
82
+ - **Comment create** posts a comment (user-visible).
83
+ - **Database create** — schema admin (creates new DB).
84
+ - **Data-source update** — schema admin (mutates DB columns).
85
+ - **View create / update** — schema admin (new view / mutates view
86
+ config).
95
87
 
96
88
  Apply the destructive-confirm contract: summarise, wait for explicit
97
- OK, then issue. Schema-admin tools warrant an explicit "schema admin"
98
- label on the plan you surface. The starter `deniedTools` list is
99
- enforced before the call lands.
89
+ OK, then issue. Schema-admin capability classes warrant an explicit
90
+ "schema admin" label on the plan you surface. The starter `deniedTools`
91
+ list is enforced before the call lands.
100
92
 
101
93
  ## 3. Page archive — workaround only
102
94
 
103
- Same gap as Claude's connector — no dedicated archive tool. Use the
104
- property-update workaround (Status="Archived") via
105
- `_notion_update_page`, or move the page under a top-level Trash page
106
- via `_notion_move_pages`. Surface the choice to the user.
95
+ Same gap as Claude's connector — hosted Notion connectors typically
96
+ expose no dedicated archive / trash tool. To "archive":
97
+
98
+ 1. **Property workaround** (preferred): update the page's Status
99
+ property to "Archived" via the page-update capability. The page
100
+ stays addressable but drops out of default views.
101
+ 2. **Move to a "Trash" page**: relocate the page under a top-level
102
+ "Trash" page via the page-move capability (create it first via
103
+ page-creation if absent).
104
+
105
+ Surface the choice to the user before issuing.
107
106
 
108
107
  ## 4. Decision rules
109
108
 
110
109
  - **Hourly check is read-only** — inherits the constraint from
111
110
  `routine.hourly_check.native.codex.md`.
112
- - **Mass-update — ask first.** `_notion_create_pages` can take up to
113
- 100 pages; `_notion_move_pages` and `_notion_update_page` batches
114
- can touch many rows. Summarise and confirm anything >~10 pages.
111
+ - **Mass-update — ask first.** Batch page-creation can take up to 100
112
+ pages; page-move and page-update batches can touch many rows.
113
+ Summarise and confirm anything >~10 pages.
115
114
  - **Schema admin — Approve-tier.** Database / view / data-source
116
115
  mutations alter workspace structure. Explicit user confirmation
117
116
  required.
118
- - **Comments are user-visible.** `_notion_create_comment` posts to a
119
- page comment thread treat like a send.
117
+ - **Comments are user-visible.** Posting a page comment is treated
118
+ like a send: confirm before issuing.
120
119
  - **Prefer structured filter over text search** when the user's
121
- intent is property-shaped. `_notion_query_data_sources` is the
122
- Codex-only capability that closes the gap Claude's connector has;
123
- use it.
120
+ intent is property-shaped and the connector exposes a structured
121
+ query primitive. If the connector only exposes text search, fall
122
+ back to search + client-side property filtering.
124
123
 
125
124
  ## 5. Persisting observations from native fetches
126
125
 
126
+ **Batch when you have more than one page.** Use
127
+ `POST /api/observations/batch` with up to 200 items in one
128
+ `observations[]` array (see the `observations` skill for the envelope).
129
+ The single-item form below is for the rare "one page changed" case.
130
+
127
131
  ```bash
128
132
  curl -s -X POST http://localhost:8321/api/observations \
129
133
  -H 'Content-Type: application/json' \
130
134
  -d '{
131
- "source": "notion",
132
- "type": "notion:lifecycle",
135
+ "source": "notion:<workspaceId>",
133
136
  "ref": "<pageId>",
134
- "actor": "user",
135
- "receivedAt": "<ISO-8601 UTC>",
136
- "summary_text": "<title last edited HH:MM>",
137
- "refs": {
138
- "pageId": "<id>",
139
- "parentDatabase": "<db-uuid-or-null>",
140
- "title": "<title>"
141
- },
142
- "payload": <verbatim MCP page object>
137
+ "changeType": "created",
138
+ "actor": "agent",
139
+ "payload": <verbatim connector page object>
143
140
  }'
144
141
  ```
145
142
 
146
143
  The daemon computes `contentHash` server-side. Pass `payload`
147
- verbatim. HTTP 409 mode-flip race window (§11.3.1); stop and re-read
148
- `<integration_modes>`.
144
+ verbatim. `actor` MUST be `"agent"` or `"system"` the server
145
+ rejects `"user"`. HTTP 409 → mode-flip race window (§11.3.1); stop and
146
+ re-read `<integration_modes>`.
149
147
 
150
148
  ## 6. Owner notification (opt-in)
151
149