switchroom 0.13.54 → 0.13.55

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "switchroom",
3
- "version": "0.13.54",
3
+ "version": "0.13.55",
4
4
  "description": "Run Claude Code 24/7 on your Claude Pro/Max subscription over Telegram. Open-source alternative to OpenClaw and NanoClaw — no API keys.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -0,0 +1,144 @@
1
+ ---
2
+ name: notion
3
+ version: 0.1.0
4
+ description: |
5
+ Use when the user wants to read, search, write, or update content in
6
+ their Notion workspace. The agent has access via the `notion` MCP
7
+ server (`@notionhq/notion-mcp-server`) configured by the operator
8
+ with a per-database allowlist.
9
+
10
+ Triggers on phrasings including: "add this to Notion", "what's on my
11
+ Notion tasks", "find that page about X in Notion", "create a Notion
12
+ page for this", "update the notion entry for X", "search Notion
13
+ for…", "append this to my Notion notes", "show me what's in the
14
+ essays database", "log this in Notion".
15
+
16
+ Do NOT use to create new Notion databases — that's disabled in v1
17
+ (operators create DBs via Notion's UI). Do NOT use to scan or
18
+ enumerate the operator's whole workspace ad-hoc — the per-database
19
+ allowlist scopes what the agent can see, and brute-forcing past it
20
+ is a defence-in-depth violation.
21
+
22
+ Also do not use this skill to file bugs against a GitHub repo
23
+ (that's `file-bug`) or to search the web (Notion search is workspace-
24
+ scoped only).
25
+ ---
26
+
27
+ # Notion
28
+
29
+ This skill is your interface to the operator's Notion workspace. The
30
+ operator has registered an integration in Notion's settings and
31
+ shared specific pages/databases with it. Your access is gated at two
32
+ layers:
33
+
34
+ 1. **Notion's upstream share-list** — the integration can only see
35
+ pages and databases the operator explicitly shared with it in
36
+ Notion's UI.
37
+ 2. **switchroom's per-agent allowlist** — within what the upstream
38
+ integration can see, the operator can further restrict YOU to a
39
+ subset via `agents.<your-name>.notion_workspace.databases:`.
40
+
41
+ Both layers are enforced at the broker / hook level. You don't have
42
+ to compute the intersection — if you call a tool against a
43
+ disallowed database, you'll get a clean block reason naming the DB.
44
+
45
+ ## Tool surface
46
+
47
+ The Notion MCP exposes the standard set:
48
+
49
+ - **Search.** `search` finds pages or databases by title/content
50
+ across what the integration can see. switchroom's PreToolUse hook
51
+ post-filters results to your allowlist — pages outside it are
52
+ dropped before they reach you. The response's metadata field
53
+ indicates how many were filtered.
54
+ - **Database queries.** `query_database` runs a filter+sort against
55
+ a database. You need the database's UUID (operator gives these
56
+ via friendly names in `notion_workspace.databases` — ask the
57
+ operator for "what's the UUID for X" if needed).
58
+ - **Page reads.** `get_page` and `get_block_children` walk a page's
59
+ structure. Both go through the allowlist gate.
60
+ - **Page writes.** `create_page` (with `parent.database_id`),
61
+ `update_page`, `update_block`, `append_block_children`,
62
+ `delete_block`, `create_comment`. The allowlist gate runs first;
63
+ blocked tool calls return a reason you can surface to the operator.
64
+ - **Database writes.** `update_database` — schema changes,
65
+ rename, etc. Gated.
66
+
67
+ ## Tools NOT available
68
+
69
+ - **`create_database`** — disabled in v1 (operators create
70
+ databases via Notion's UI). If the user asks you to "create a new
71
+ database for X", say so and offer to populate an existing one or
72
+ prompt the operator to make the DB first.
73
+ - **`delete_database`** — same posture.
74
+
75
+ ## Common workflows
76
+
77
+ ### "What's on my tasks?"
78
+
79
+ 1. Ask the operator (or use `config_get` to check your own
80
+ `notion_workspace.databases`) for the friendly name of the tasks
81
+ DB. The friendly name resolves to a UUID via
82
+ `notion_workspace.databases` in switchroom.yaml.
83
+ 2. `query_database` with that UUID. Default filter: `not done`.
84
+ 3. Format results as a brief markdown list. Don't dump the full
85
+ property soup — operators want titles + status, not raw IDs.
86
+
87
+ ### "Add `<thing>` to Notion"
88
+
89
+ 1. Default destination is the database whose friendly name matches
90
+ the user's intent (`tasks`, `notes`, `essays`). Ask if it's
91
+ ambiguous.
92
+ 2. Use `create_page` with `parent.database_id: <uuid>`. The page's
93
+ properties need to match the target DB's schema — call
94
+ `retrieve_database` first if you're unsure of the property
95
+ names.
96
+ 3. After creation, confirm to the user with the page title and
97
+ the Notion URL.
98
+
99
+ ### "Find that thing about X"
100
+
101
+ 1. `search` with the query. Take only the top result unless ambiguous.
102
+ 2. The post-filter has already redacted out-of-allowlist results;
103
+ don't worry about leakage.
104
+ 3. If 0 results: try a `query_database` against the most likely DB
105
+ with a property filter (matches the value).
106
+
107
+ ### "Update the page about X"
108
+
109
+ 1. `search` or `query_database` to find the page.
110
+ 2. `update_page` (for properties — status, tags, dates) or
111
+ `append_block_children` (for body content).
112
+ 3. **Be careful** with `update_block` and `delete_block` — these
113
+ modify the page's body irreversibly. Prefer `append_block_children`
114
+ when the user's intent is "add a note to this page", not
115
+ "replace what's there".
116
+
117
+ ## Limits and behaviours
118
+
119
+ - **Rate limit**: Notion's public API is ~3 rps per integration.
120
+ Multi-step turns with many writes may slow down (the hook makes
121
+ resolver calls per write). If you see "Notion API failed: 429",
122
+ back off and retry once.
123
+ - **No `create_database`**: if the user asks for a new database,
124
+ say "I can write into existing DBs but the operator creates new
125
+ ones in Notion's UI." Then offer the closest existing DB.
126
+ - **Standalone pages denied**: pages without a database parent
127
+ (workspace root pages, personal sub-pages) are hard-denied in
128
+ v1. The block reason names this when it fires; pass it through
129
+ to the user.
130
+
131
+ ## When the allowlist denies you
132
+
133
+ If a tool call returns "DB <uuid> is not in your allowlist", that's
134
+ the operator's intended scope — don't try to work around it. Surface
135
+ the message to the user honestly: "I'm not configured to access that
136
+ database. You can add it to my allowlist with
137
+ `agents.<my-name>.notion_workspace.databases` in switchroom.yaml."
138
+
139
+ ## Authoring small notes vs full pages
140
+
141
+ For one-line "log this thought" intents, prefer `append_block_children`
142
+ to an existing daily-notes / inbox page rather than creating a new
143
+ page per note. Operators usually have an inbox DB; ask if you're
144
+ unsure.