@aitne-sh/aitne 0.1.5 → 0.1.7
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/README.md +295 -479
- package/agent-assets/agent-profiles/_safety.md +17 -2
- package/agent-assets/agent-profiles/routine-fetch-window.md +75 -40
- package/agent-assets/agent-profiles/wiki-agent.md +19 -0
- package/agent-assets/docs/features/messaging/bang-commands.md +161 -0
- package/agent-assets/docs/features/messaging/overview.md +3 -0
- package/agent-assets/docs/features/wiki/commands.md +222 -0
- package/agent-assets/docs/features/wiki/overview.md +145 -0
- package/agent-assets/docs/getting-started/03-what-can-this-do.md +18 -0
- package/agent-assets/docs/glossary.md +34 -0
- package/agent-assets/docs/guides/budget-and-cost-for-wiki.md +123 -0
- package/agent-assets/docs/guides/build-your-wiki.md +99 -0
- package/agent-assets/docs/guides/explore-with-trace-and-connect.md +169 -0
- package/agent-assets/docs/guides/maintain-wiki-health.md +168 -0
- package/agent-assets/docs/guides/multiple-wikis-for-multiple-domains.md +192 -0
- package/agent-assets/docs/guides/pause-the-agent.md +10 -3
- package/agent-assets/docs/guides/use-an-existing-obsidian-vault.md +156 -0
- package/agent-assets/docs/reference/cli-commands.md +24 -1
- package/agent-assets/docs/troubleshooting/wiki-ingest-full-blocked.md +96 -0
- package/agent-assets/docs/troubleshooting/wiki-write-failed.md +82 -0
- package/agent-assets/skills/context/SKILL.md +288 -17
- package/agent-assets/skills/external-services/SKILL.delegated.claude.md +2 -2
- package/agent-assets/skills/external-services/SKILL.delegated.codex.md +3 -3
- package/agent-assets/skills/external-services/SKILL.delegated.gemini.md +6 -6
- package/agent-assets/skills/external-services/SKILL.md +5 -3
- package/agent-assets/skills/external-services/SKILL.native.claude.md +49 -58
- package/agent-assets/skills/external-services/SKILL.native.codex.md +50 -58
- package/agent-assets/skills/external-services/SKILL.native.gemini.md +53 -56
- package/agent-assets/skills/mail/SKILL.md +5 -5
- package/agent-assets/skills/mail/SKILL.native.claude.md +57 -65
- package/agent-assets/skills/mail/SKILL.native.codex.md +73 -75
- package/agent-assets/skills/mail/SKILL.native.gemini.md +80 -75
- package/agent-assets/skills/management-task-register/SKILL.md +3 -3
- package/agent-assets/skills/notion/SKILL.native.claude.md +78 -82
- package/agent-assets/skills/notion/SKILL.native.codex.md +78 -80
- package/agent-assets/skills/notion/SKILL.native.gemini.md +91 -90
- package/agent-assets/skills/observations/SKILL.md +104 -14
- package/agent-assets/skills/roadmap/SKILL.md +19 -0
- package/agent-assets/skills/schedule/SKILL.md +44 -3
- package/agent-assets/skills/today/SKILL.md +25 -5
- package/agent-assets/skills/travel-time/SKILL.md +9 -0
- package/agent-assets/skills/wiki/wiki-ask/SKILL.md +32 -0
- package/agent-assets/skills/wiki/wiki-compile/SKILL.md +126 -0
- package/agent-assets/skills/wiki/wiki-connect/SKILL.md +75 -0
- package/agent-assets/skills/wiki/wiki-graduate/SKILL.md +45 -0
- package/agent-assets/skills/wiki/wiki-ingest/SKILL.md +182 -0
- package/agent-assets/skills/wiki/wiki-lint/SKILL.md +90 -0
- package/agent-assets/skills/wiki/wiki-trace/SKILL.md +72 -0
- package/agent-assets/skills/wiki/wiki-vault-rules/SKILL.md +145 -0
- package/agent-assets/task-flows/_partials/calendar-acquire.google_calendar.md +28 -9
- package/agent-assets/task-flows/_partials/calendar-acquire.outlook_calendar.md +26 -9
- package/agent-assets/task-flows/_partials/mail-acquire.gmail.md +51 -24
- package/agent-assets/task-flows/_partials/mail-acquire.outlook_mail.md +46 -16
- package/agent-assets/task-flows/_partials/notion-acquire.notion.md +29 -9
- package/agent-assets/task-flows/message.received.dm.md +35 -2
- package/agent-assets/task-flows/message.received.dm.native.claude.md +25 -26
- package/agent-assets/task-flows/message.received.dm.native.codex.md +30 -24
- package/agent-assets/task-flows/message.received.dm.native.gemini.md +36 -36
- package/agent-assets/task-flows/message.received.dm_first.md +43 -4
- package/agent-assets/task-flows/message.received.dm_first.native.claude.md +20 -20
- package/agent-assets/task-flows/message.received.dm_first.native.codex.md +22 -19
- package/agent-assets/task-flows/message.received.dm_first.native.gemini.md +28 -24
- package/agent-assets/task-flows/routine.fetch_window.md +51 -36
- package/agent-assets/task-flows/routine.morning_routine.md +12 -3
- package/agent-assets/task-flows/routine.morning_routine_initial.md +22 -1
- package/agent-assets/task-flows/scheduled.dm.md +477 -0
- package/agent-assets/task-flows/wiki.ask.md +11 -0
- package/agent-assets/task-flows/wiki.compile.md +28 -0
- package/agent-assets/task-flows/wiki.connect.md +12 -0
- package/agent-assets/task-flows/wiki.ingest_url.md +35 -0
- package/agent-assets/task-flows/wiki.lint.md +13 -0
- package/agent-assets/task-flows/wiki.trace.md +13 -0
- package/agent-assets/wiki-seeds/schemas/output.md +12 -0
- package/agent-assets/wiki-seeds/schemas/raw.md +13 -0
- package/agent-assets/wiki-seeds/schemas/wiki.md +12 -0
- package/agent-assets/wiki-seeds/taxonomy.md +13 -0
- 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
|
-
|
|
107
|
-
|
|
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
|
|
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 —
|
|
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
|
|
23
|
-
>
|
|
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
|
-
|
|
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
|
-
|
|
47
|
-
|
|
47
|
+
Notion page fetch typically accepts either a page URL or a UUID; pass
|
|
48
|
+
the UUID resolved here.
|
|
48
49
|
|
|
49
|
-
## 2. Notion —
|
|
50
|
+
## 2. Notion — in-session connector
|
|
50
51
|
|
|
51
|
-
|
|
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
|
|
56
|
+
### Read-class capabilities
|
|
54
57
|
|
|
55
|
-
| Capability |
|
|
56
|
-
|
|
57
|
-
| `search` |
|
|
58
|
-
| `read` |
|
|
59
|
-
| `comments` |
|
|
60
|
-
| `users` |
|
|
61
|
-
| `teams` |
|
|
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
|
|
66
|
+
Canonical search flow:
|
|
64
67
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
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
|
-
|
|
85
|
-
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
-
|
|
89
|
-
-
|
|
90
|
-
-
|
|
91
|
-
-
|
|
92
|
-
-
|
|
93
|
-
-
|
|
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
|
|
102
|
-
|
|
103
|
-
|
|
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
|
-
|
|
113
|
-
|
|
114
|
-
|
|
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):
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
2. **Move to a "Trash" page**:
|
|
121
|
-
|
|
122
|
-
|
|
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
|
|
132
|
-
connector do the matching.
|
|
133
|
-
SQL-style query primitive (Codex's
|
|
134
|
-
covers that gap when delegated
|
|
135
|
-
search-with-filter primitive
|
|
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
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
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.**
|
|
151
|
-
|
|
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
|
-
"
|
|
168
|
-
"
|
|
169
|
-
"
|
|
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
|
|
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
|
|
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 —
|
|
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
|
|
22
|
-
>
|
|
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
|
|
38
|
-
|
|
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 —
|
|
41
|
+
## 2. Notion — in-session connector
|
|
42
42
|
|
|
43
|
-
|
|
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
|
|
49
|
+
### Read-class capabilities
|
|
46
50
|
|
|
47
|
-
| Capability |
|
|
48
|
-
|
|
49
|
-
| `search` |
|
|
50
|
-
| `read` |
|
|
51
|
-
| `comments` |
|
|
52
|
-
| `users` |
|
|
53
|
-
| `teams` |
|
|
54
|
-
| `query_data_sources` |
|
|
55
|
-
| `query_meeting_notes` |
|
|
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
|
|
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
|
-
|
|
61
|
-
|
|
62
|
-
|
|
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
|
-
-
|
|
87
|
-
-
|
|
88
|
-
|
|
89
|
-
-
|
|
90
|
-
-
|
|
91
|
-
-
|
|
92
|
-
-
|
|
93
|
-
-
|
|
94
|
-
-
|
|
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
|
|
98
|
-
label on the plan you surface. The starter `deniedTools`
|
|
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 —
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
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.**
|
|
113
|
-
|
|
114
|
-
|
|
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.**
|
|
119
|
-
|
|
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
|
|
122
|
-
|
|
123
|
-
|
|
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
|
-
"
|
|
135
|
-
"
|
|
136
|
-
"
|
|
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.
|
|
148
|
-
|
|
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
|
|