@notis_ai/cli 0.2.0-beta.16.1 → 0.2.0-beta.160.1
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 +433 -133
- package/config/notis_app_boundary_rules.json +50 -0
- package/config/notis_app_design_rules.json +135 -0
- package/dist/agent-hooks/notis-agent-hook.mjs +18672 -0
- package/dist/base-skills/notis-apps/SKILL.md +70 -0
- package/dist/base-skills/notis-apps/references/architecture.md +164 -0
- package/dist/base-skills/notis-apps/references/context.md +81 -0
- package/dist/base-skills/notis-apps/references/design.md +165 -0
- package/dist/base-skills/notis-apps/references/reading.md +89 -0
- package/dist/base-skills/notis-apps/references/release.md +99 -0
- package/dist/base-skills/notis-apps/references/sdk.md +62 -0
- package/dist/base-skills/notis-apps/references/troubleshooting.md +23 -0
- package/dist/base-skills/notis-cli/SKILL.md +140 -0
- package/dist/base-skills/notis-cli/references/app-delivery.md +18 -0
- package/dist/base-skills/notis-cli/references/native-databases.md +20 -0
- package/dist/base-skills/notis-cli/references/tool-examples.md +56 -0
- package/dist/base-skills/notis-cli/references/troubleshooting.md +39 -0
- package/dist/base-skills/notis-query/SKILL.md +67 -0
- package/dist/base-skills/notis-query/references/database-discovery.md +59 -0
- package/dist/base-skills/notis-query/references/documents.md +50 -0
- package/dist/base-skills/notis-query/references/query.md +543 -0
- package/dist/skill-sync/index.js +1626 -0
- package/dist/skill-sync/index.js.map +7 -0
- package/dist/skill-sync-worker.mjs +2990 -0
- package/package.json +16 -6
- package/skills/notis-apps/cli.md +313 -0
- package/skills/notis-cli/AGENT_INSTRUCTIONS.md +39 -0
- package/skills/notis-onboarding/BRIEF.md +129 -0
- package/skills/notis-query/cli.md +39 -0
- package/src/agent-hook-entry.js +5 -0
- package/src/cli.js +294 -25
- package/src/command-specs/agents.js +392 -0
- package/src/command-specs/apps.js +1470 -202
- package/src/command-specs/auth.js +114 -137
- package/src/command-specs/diagnostics.js +716 -0
- package/src/command-specs/handover.js +374 -0
- package/src/command-specs/helpers.js +84 -82
- package/src/command-specs/index.js +25 -6
- package/src/command-specs/meta.js +150 -18
- package/src/command-specs/onboarding.js +290 -0
- package/src/command-specs/profile.js +358 -0
- package/src/command-specs/reports.js +86 -0
- package/src/command-specs/skills.js +75 -0
- package/src/command-specs/smoke.js +386 -0
- package/src/command-specs/tools.js +455 -139
- package/src/runtime/agent-browser.js +632 -0
- package/src/runtime/agent-memory-state.js +126 -0
- package/src/runtime/agent-setup.js +383 -0
- package/src/runtime/app-boundary-validator.js +404 -0
- package/src/runtime/app-changelog.js +79 -0
- package/src/runtime/app-platform.js +2633 -210
- package/src/runtime/app-registry-scaffolds.js +367 -0
- package/src/runtime/app-test-server.js +292 -0
- package/src/runtime/assets/store-screenshot-dark.png +0 -0
- package/src/runtime/auth-recovery.js +110 -0
- package/src/runtime/base-skills.d.ts +20 -0
- package/src/runtime/base-skills.js +167 -0
- package/src/runtime/channel.js +133 -0
- package/src/runtime/delegated-context.js +68 -0
- package/src/runtime/errors.js +1 -0
- package/src/runtime/git.js +233 -0
- package/src/runtime/login-listener.js +15 -0
- package/src/runtime/oauth.js +2622 -0
- package/src/runtime/output.js +37 -5
- package/src/runtime/ports.js +31 -0
- package/src/runtime/profiles.js +906 -55
- package/src/runtime/skill-sync/cloud-client.ts +99 -0
- package/src/runtime/skill-sync/index.ts +697 -0
- package/src/runtime/skill-sync/local-scanner.ts +1046 -0
- package/src/runtime/skill-sync/symlink-manager.ts +433 -0
- package/src/runtime/skill-sync/sync-plan.ts +22 -0
- package/src/runtime/skill-sync/types.ts +110 -0
- package/src/runtime/skill-sync/write-cloud-skill.ts +50 -0
- package/src/runtime/skill-sync-service.js +109 -0
- package/src/runtime/store-screenshot.js +143 -0
- package/src/runtime/sync-skills.d.ts +37 -0
- package/src/runtime/sync-skills.js +231 -0
- package/src/runtime/telemetry.js +92 -0
- package/src/runtime/transport.js +324 -45
- package/src/skill-sync-worker-entry.js +2 -0
- package/src/skill-sync-worker.js +50 -0
- package/template/.harness/index.html.tmpl +430 -0
- package/template/CHANGELOG.md +5 -0
- package/template/app/layout.tsx +5 -2
- package/template/app/page.tsx +49 -42
- package/template/components/page-heading.tsx +23 -0
- package/template/components/ui/badge.tsx +7 -4
- package/template/components/ui/card.tsx +24 -11
- package/template/components/ui/native-select.tsx +24 -0
- package/template/notis.config.ts +24 -6
- package/template/package-lock.json +4137 -0
- package/template/package.json +5 -5
- package/template/packages/{notis-sdk → sdk}/package.json +13 -3
- package/template/packages/sdk/src/agentContext.ts +36 -0
- package/template/packages/sdk/src/components/DocumentEditor.tsx +103 -0
- package/template/packages/sdk/src/components/Markdown.tsx +60 -0
- package/template/packages/sdk/src/components/MarkdownEditor.tsx +121 -0
- package/template/packages/sdk/src/components/MultiSelectActionBar.tsx +285 -0
- package/template/packages/sdk/src/components/MultiSelectCheckbox.tsx +97 -0
- package/template/packages/sdk/src/components/MultiSelectDragOverlay.tsx +39 -0
- package/template/packages/sdk/src/components/NotisCommentBoundary.tsx +172 -0
- package/template/packages/sdk/src/components/NotisSelectionBoundary.tsx +59 -0
- package/template/packages/sdk/src/components/ShortcutHints.tsx +56 -0
- package/template/packages/sdk/src/components/Skeleton.tsx +24 -0
- package/template/packages/sdk/src/config.ts +257 -0
- package/template/packages/sdk/src/documents.ts +256 -0
- package/template/packages/sdk/src/hooks/useActiveResource.ts +19 -0
- package/template/packages/sdk/src/hooks/useAgentContext.ts +23 -0
- package/template/packages/sdk/src/hooks/useCloudComputer.ts +64 -0
- package/template/packages/sdk/src/hooks/useCollectionInteractions.ts +836 -0
- package/template/packages/sdk/src/hooks/useDatabaseSchema.ts +49 -0
- package/template/packages/sdk/src/hooks/useDatabaseSubscription.ts +76 -0
- package/template/packages/sdk/src/hooks/useDocument.ts +43 -0
- package/template/packages/sdk/src/hooks/useDocuments.ts +84 -0
- package/template/packages/sdk/src/hooks/useHandover.ts +78 -0
- package/template/packages/sdk/src/hooks/useLongPressSelection.ts +79 -0
- package/template/packages/sdk/src/hooks/useMultiSelect.ts +95 -0
- package/template/packages/{notis-sdk → sdk}/src/hooks/useNotis.ts +10 -4
- package/template/packages/{notis-sdk → sdk}/src/hooks/useNotisNavigation.ts +11 -8
- package/template/packages/sdk/src/hooks/useQuery.ts +71 -0
- package/template/packages/sdk/src/hooks/useTool.ts +65 -0
- package/template/packages/sdk/src/hooks/useToolQuery.ts +12 -0
- package/template/packages/sdk/src/hooks/useTopBarSearch.ts +81 -0
- package/template/packages/sdk/src/hooks/useUpsertDocument.ts +95 -0
- package/template/packages/sdk/src/index.ts +161 -0
- package/template/packages/sdk/src/interactions/actions.ts +59 -0
- package/template/packages/sdk/src/interactions/shortcuts.tsx +694 -0
- package/template/packages/sdk/src/interactions/visibility.ts +13 -0
- package/template/packages/sdk/src/interactions.ts +45 -0
- package/template/packages/sdk/src/provider.tsx +44 -0
- package/template/packages/sdk/src/queryCache.ts +170 -0
- package/template/packages/sdk/src/runtime.ts +451 -0
- package/template/packages/sdk/src/styles.css +213 -0
- package/template/packages/sdk/src/tailwind.ts +56 -0
- package/template/packages/{notis-sdk → sdk}/src/vite.ts +5 -1
- package/template/tailwind.config.ts +1 -0
- package/src/command-specs/db.js +0 -163
- package/src/runtime/app-preview-server.js +0 -312
- package/template/packages/notis-sdk/src/config.ts +0 -48
- package/template/packages/notis-sdk/src/helpers.ts +0 -131
- package/template/packages/notis-sdk/src/hooks/useAppState.ts +0 -50
- package/template/packages/notis-sdk/src/hooks/useCollectionItem.ts +0 -58
- package/template/packages/notis-sdk/src/hooks/useDatabase.ts +0 -87
- package/template/packages/notis-sdk/src/hooks/useDocument.ts +0 -61
- package/template/packages/notis-sdk/src/hooks/useTool.ts +0 -49
- package/template/packages/notis-sdk/src/hooks/useUpsertDocument.ts +0 -57
- package/template/packages/notis-sdk/src/index.ts +0 -47
- package/template/packages/notis-sdk/src/provider.tsx +0 -44
- package/template/packages/notis-sdk/src/runtime.ts +0 -159
- package/template/packages/notis-sdk/src/styles.css +0 -123
- /package/template/packages/{notis-sdk → sdk}/src/hooks/useBackend.ts +0 -0
- /package/template/packages/{notis-sdk → sdk}/src/hooks/useTools.ts +0 -0
- /package/template/packages/{notis-sdk → sdk}/src/ui.ts +0 -0
- /package/template/packages/{notis-sdk → sdk}/tsconfig.json +0 -0
|
@@ -0,0 +1,543 @@
|
|
|
1
|
+
## Supported execution mode
|
|
2
|
+
|
|
3
|
+
`LOCAL_NOTIS_DATABASE_QUERY` supports direct structured queries only.
|
|
4
|
+
|
|
5
|
+
Natural-language query generation is retired. Do not send free-form requests like "find overdue tasks from important clients"; build the structured `query` payload yourself.
|
|
6
|
+
|
|
7
|
+
## Request shape
|
|
8
|
+
|
|
9
|
+
```json
|
|
10
|
+
{
|
|
11
|
+
"database_id": "tasks-db-id",
|
|
12
|
+
"database_slug": "tasks",
|
|
13
|
+
"query": {
|
|
14
|
+
"filter": {
|
|
15
|
+
"operator": "and",
|
|
16
|
+
"conditions": [
|
|
17
|
+
{
|
|
18
|
+
"property": "Status",
|
|
19
|
+
"type": "status",
|
|
20
|
+
"operator": "equals",
|
|
21
|
+
"value": "In Progress"
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
"sorts": [
|
|
26
|
+
{
|
|
27
|
+
"property": "Due Date",
|
|
28
|
+
"direction": "ascending"
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
"page_size": 20
|
|
32
|
+
},
|
|
33
|
+
"offset": 0
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Top-level fields:
|
|
38
|
+
|
|
39
|
+
- One of `database_id` or `database_slug` is required.
|
|
40
|
+
- `database_id`: stable native database ID. Prefer this when it is available from database context, `list_databases`, or `get_database`.
|
|
41
|
+
- `database_slug`: native database slug. Use this when `database_id` is not available, or pass it alongside `database_id` as a fallback.
|
|
42
|
+
- `query`: required object
|
|
43
|
+
- `offset`: optional numeric pagination offset
|
|
44
|
+
|
|
45
|
+
When both `database_id` and `database_slug` are provided, they must identify the same database. If the ID is stale and no database is found by ID, the runtime may fall back to the slug.
|
|
46
|
+
|
|
47
|
+
`query` fields:
|
|
48
|
+
|
|
49
|
+
- `filter`: optional rule tree
|
|
50
|
+
- `sorts`: optional array of sort definitions
|
|
51
|
+
- `page_size`: optional integer page size
|
|
52
|
+
|
|
53
|
+
## Filter shape
|
|
54
|
+
|
|
55
|
+
```json
|
|
56
|
+
{
|
|
57
|
+
"operator": "and",
|
|
58
|
+
"conditions": [
|
|
59
|
+
{
|
|
60
|
+
"property": "Status",
|
|
61
|
+
"type": "status",
|
|
62
|
+
"operator": "equals",
|
|
63
|
+
"value": "In Progress"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"property": "Priority",
|
|
67
|
+
"type": "select",
|
|
68
|
+
"operator": "equals",
|
|
69
|
+
"value": "High"
|
|
70
|
+
}
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Use nested groups when needed:
|
|
76
|
+
|
|
77
|
+
```json
|
|
78
|
+
{
|
|
79
|
+
"operator": "or",
|
|
80
|
+
"conditions": [
|
|
81
|
+
{
|
|
82
|
+
"property": "Status",
|
|
83
|
+
"type": "status",
|
|
84
|
+
"operator": "equals",
|
|
85
|
+
"value": "Todo"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"operator": "and",
|
|
89
|
+
"conditions": [
|
|
90
|
+
{
|
|
91
|
+
"property": "Priority",
|
|
92
|
+
"type": "select",
|
|
93
|
+
"operator": "equals",
|
|
94
|
+
"value": "High"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"property": "Archived",
|
|
98
|
+
"type": "checkbox",
|
|
99
|
+
"operator": "equals",
|
|
100
|
+
"value": false
|
|
101
|
+
}
|
|
102
|
+
]
|
|
103
|
+
}
|
|
104
|
+
]
|
|
105
|
+
}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Supported property semantics
|
|
109
|
+
|
|
110
|
+
Use the real Notis property name and the correct property type.
|
|
111
|
+
|
|
112
|
+
### Title and rich text
|
|
113
|
+
|
|
114
|
+
Recommended operators:
|
|
115
|
+
|
|
116
|
+
- `contains`
|
|
117
|
+
- `equals`
|
|
118
|
+
- `not_equals`
|
|
119
|
+
|
|
120
|
+
Example:
|
|
121
|
+
|
|
122
|
+
```json
|
|
123
|
+
{
|
|
124
|
+
"property": "Title",
|
|
125
|
+
"type": "title",
|
|
126
|
+
"operator": "contains",
|
|
127
|
+
"value": "launch"
|
|
128
|
+
}
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Select and status
|
|
132
|
+
|
|
133
|
+
Recommended operators:
|
|
134
|
+
|
|
135
|
+
- `equals`
|
|
136
|
+
- `not_equals`
|
|
137
|
+
- `in`
|
|
138
|
+
|
|
139
|
+
Example:
|
|
140
|
+
|
|
141
|
+
```json
|
|
142
|
+
{
|
|
143
|
+
"property": "Status",
|
|
144
|
+
"type": "status",
|
|
145
|
+
"operator": "equals",
|
|
146
|
+
"value": "Done"
|
|
147
|
+
}
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### Multi-select
|
|
151
|
+
|
|
152
|
+
Recommended operators:
|
|
153
|
+
|
|
154
|
+
- `contains`
|
|
155
|
+
- `not_contains`
|
|
156
|
+
|
|
157
|
+
Example:
|
|
158
|
+
|
|
159
|
+
```json
|
|
160
|
+
{
|
|
161
|
+
"property": "Tags",
|
|
162
|
+
"type": "multi_select",
|
|
163
|
+
"operator": "contains",
|
|
164
|
+
"value": "Urgent"
|
|
165
|
+
}
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### Checkbox
|
|
169
|
+
|
|
170
|
+
Recommended operator:
|
|
171
|
+
|
|
172
|
+
- `equals`
|
|
173
|
+
|
|
174
|
+
Example:
|
|
175
|
+
|
|
176
|
+
```json
|
|
177
|
+
{
|
|
178
|
+
"property": "Archived",
|
|
179
|
+
"type": "checkbox",
|
|
180
|
+
"operator": "equals",
|
|
181
|
+
"value": false
|
|
182
|
+
}
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
### Number
|
|
186
|
+
|
|
187
|
+
Recommended operators:
|
|
188
|
+
|
|
189
|
+
- `equals`
|
|
190
|
+
- `not_equals`
|
|
191
|
+
- `greater_than`
|
|
192
|
+
- `greater_than_or_equal`
|
|
193
|
+
- `less_than`
|
|
194
|
+
- `less_than_or_equal`
|
|
195
|
+
|
|
196
|
+
Example:
|
|
197
|
+
|
|
198
|
+
```json
|
|
199
|
+
{
|
|
200
|
+
"property": "Score",
|
|
201
|
+
"type": "number",
|
|
202
|
+
"operator": "greater_than_or_equal",
|
|
203
|
+
"value": 80
|
|
204
|
+
}
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
### Date
|
|
208
|
+
|
|
209
|
+
Recommended operators:
|
|
210
|
+
|
|
211
|
+
- `equals`
|
|
212
|
+
- `before`
|
|
213
|
+
- `after`
|
|
214
|
+
- `on_or_before`
|
|
215
|
+
- `on_or_after`
|
|
216
|
+
|
|
217
|
+
Use ISO dates or timestamps depending on the property precision.
|
|
218
|
+
|
|
219
|
+
Example:
|
|
220
|
+
|
|
221
|
+
```json
|
|
222
|
+
{
|
|
223
|
+
"property": "Due Date",
|
|
224
|
+
"type": "date",
|
|
225
|
+
"operator": "on_or_before",
|
|
226
|
+
"value": "2026-03-31"
|
|
227
|
+
}
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
### Relation
|
|
231
|
+
|
|
232
|
+
Recommended operators:
|
|
233
|
+
|
|
234
|
+
- `contains`
|
|
235
|
+
- `not_contains`
|
|
236
|
+
|
|
237
|
+
Pass the related `document_id`, not the display title.
|
|
238
|
+
|
|
239
|
+
Example:
|
|
240
|
+
|
|
241
|
+
```json
|
|
242
|
+
{
|
|
243
|
+
"property": "Project",
|
|
244
|
+
"type": "relation",
|
|
245
|
+
"operator": "contains",
|
|
246
|
+
"value": "doc_project_123"
|
|
247
|
+
}
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
### Formula
|
|
251
|
+
|
|
252
|
+
Treat formula values according to the returned data type. In practice, use the matching operator family for the computed result:
|
|
253
|
+
|
|
254
|
+
- text-like formula: `contains` or `equals`
|
|
255
|
+
- number-like formula: numeric comparison operators
|
|
256
|
+
- boolean-like formula: `equals`
|
|
257
|
+
|
|
258
|
+
Only use formula filters when the formula property already exists in the schema.
|
|
259
|
+
|
|
260
|
+
## Sorts
|
|
261
|
+
|
|
262
|
+
Sort objects look like this:
|
|
263
|
+
|
|
264
|
+
```json
|
|
265
|
+
{
|
|
266
|
+
"property": "Created At",
|
|
267
|
+
"direction": "descending"
|
|
268
|
+
}
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
Recommended directions:
|
|
272
|
+
|
|
273
|
+
- `ascending`
|
|
274
|
+
- `descending`
|
|
275
|
+
|
|
276
|
+
Common sorts:
|
|
277
|
+
|
|
278
|
+
- title sorts for alphabetical browsing
|
|
279
|
+
- status then date sorts for workflow queues
|
|
280
|
+
- timestamp sorts such as `Created At`, `Updated At`, or `Last Edited Time`
|
|
281
|
+
|
|
282
|
+
Example:
|
|
283
|
+
|
|
284
|
+
```json
|
|
285
|
+
[
|
|
286
|
+
{
|
|
287
|
+
"property": "Last Edited Time",
|
|
288
|
+
"direction": "descending"
|
|
289
|
+
}
|
|
290
|
+
]
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
## Pagination
|
|
294
|
+
|
|
295
|
+
Use `page_size` to cap the number of results per call.
|
|
296
|
+
|
|
297
|
+
The response returns:
|
|
298
|
+
|
|
299
|
+
- `documents`
|
|
300
|
+
- `results_count`
|
|
301
|
+
- `has_more`
|
|
302
|
+
- `next_offset`
|
|
303
|
+
- `query`
|
|
304
|
+
- `complementary_instructions`
|
|
305
|
+
|
|
306
|
+
Pagination rules:
|
|
307
|
+
|
|
308
|
+
- start with `offset: 0` or omit it
|
|
309
|
+
- if `has_more` is true, call again with `offset: next_offset`
|
|
310
|
+
|
|
311
|
+
Example follow-up call:
|
|
312
|
+
|
|
313
|
+
```json
|
|
314
|
+
{
|
|
315
|
+
"database_id": "tasks-db-id",
|
|
316
|
+
"query": {
|
|
317
|
+
"page_size": 25
|
|
318
|
+
},
|
|
319
|
+
"offset": 25
|
|
320
|
+
}
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
## Response shape
|
|
324
|
+
|
|
325
|
+
The result includes database rows in `documents`. Each document usually contains:
|
|
326
|
+
|
|
327
|
+
- `document_id`
|
|
328
|
+
- title-like display fields
|
|
329
|
+
- matching property values
|
|
330
|
+
- metadata helpful for follow-up reads or updates
|
|
331
|
+
|
|
332
|
+
Use `document_id` from the query response when you need to:
|
|
333
|
+
|
|
334
|
+
- fetch full content with `LOCAL_NOTIS_DATABASE_GET_DOCUMENT`
|
|
335
|
+
- update a record with a generated database upsert tool
|
|
336
|
+
- attach it to a relation field in another upsert
|
|
337
|
+
|
|
338
|
+
## Examples
|
|
339
|
+
|
|
340
|
+
### Title or rich text contains
|
|
341
|
+
|
|
342
|
+
```json
|
|
343
|
+
{
|
|
344
|
+
"database_id": "notes-db-id",
|
|
345
|
+
"query": {
|
|
346
|
+
"filter": {
|
|
347
|
+
"operator": "and",
|
|
348
|
+
"conditions": [
|
|
349
|
+
{
|
|
350
|
+
"property": "Title",
|
|
351
|
+
"type": "title",
|
|
352
|
+
"operator": "contains",
|
|
353
|
+
"value": "pricing"
|
|
354
|
+
}
|
|
355
|
+
]
|
|
356
|
+
},
|
|
357
|
+
"page_size": 10
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
### Select or status equals
|
|
363
|
+
|
|
364
|
+
```json
|
|
365
|
+
{
|
|
366
|
+
"database_id": "tasks-db-id",
|
|
367
|
+
"query": {
|
|
368
|
+
"filter": {
|
|
369
|
+
"operator": "and",
|
|
370
|
+
"conditions": [
|
|
371
|
+
{
|
|
372
|
+
"property": "Status",
|
|
373
|
+
"type": "status",
|
|
374
|
+
"operator": "equals",
|
|
375
|
+
"value": "In Progress"
|
|
376
|
+
}
|
|
377
|
+
]
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
```
|
|
382
|
+
|
|
383
|
+
### Multi-select contains
|
|
384
|
+
|
|
385
|
+
```json
|
|
386
|
+
{
|
|
387
|
+
"database_id": "content-db-id",
|
|
388
|
+
"query": {
|
|
389
|
+
"filter": {
|
|
390
|
+
"operator": "and",
|
|
391
|
+
"conditions": [
|
|
392
|
+
{
|
|
393
|
+
"property": "Tags",
|
|
394
|
+
"type": "multi_select",
|
|
395
|
+
"operator": "contains",
|
|
396
|
+
"value": "Newsletter"
|
|
397
|
+
}
|
|
398
|
+
]
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
```
|
|
403
|
+
|
|
404
|
+
### Checkbox equals
|
|
405
|
+
|
|
406
|
+
```json
|
|
407
|
+
{
|
|
408
|
+
"database_id": "tasks-db-id",
|
|
409
|
+
"query": {
|
|
410
|
+
"filter": {
|
|
411
|
+
"operator": "and",
|
|
412
|
+
"conditions": [
|
|
413
|
+
{
|
|
414
|
+
"property": "Completed",
|
|
415
|
+
"type": "checkbox",
|
|
416
|
+
"operator": "equals",
|
|
417
|
+
"value": true
|
|
418
|
+
}
|
|
419
|
+
]
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
```
|
|
424
|
+
|
|
425
|
+
### Number comparison
|
|
426
|
+
|
|
427
|
+
```json
|
|
428
|
+
{
|
|
429
|
+
"database_id": "deals-db-id",
|
|
430
|
+
"query": {
|
|
431
|
+
"filter": {
|
|
432
|
+
"operator": "and",
|
|
433
|
+
"conditions": [
|
|
434
|
+
{
|
|
435
|
+
"property": "Amount",
|
|
436
|
+
"type": "number",
|
|
437
|
+
"operator": "greater_than",
|
|
438
|
+
"value": 10000
|
|
439
|
+
}
|
|
440
|
+
]
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
```
|
|
445
|
+
|
|
446
|
+
### Date comparison
|
|
447
|
+
|
|
448
|
+
```json
|
|
449
|
+
{
|
|
450
|
+
"database_id": "tasks-db-id",
|
|
451
|
+
"query": {
|
|
452
|
+
"filter": {
|
|
453
|
+
"operator": "and",
|
|
454
|
+
"conditions": [
|
|
455
|
+
{
|
|
456
|
+
"property": "Due Date",
|
|
457
|
+
"type": "date",
|
|
458
|
+
"operator": "on_or_after",
|
|
459
|
+
"value": "2026-03-01"
|
|
460
|
+
}
|
|
461
|
+
]
|
|
462
|
+
},
|
|
463
|
+
"sorts": [
|
|
464
|
+
{
|
|
465
|
+
"property": "Due Date",
|
|
466
|
+
"direction": "ascending"
|
|
467
|
+
}
|
|
468
|
+
]
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
```
|
|
472
|
+
|
|
473
|
+
### Relation contains
|
|
474
|
+
|
|
475
|
+
```json
|
|
476
|
+
{
|
|
477
|
+
"database_id": "tasks-db-id",
|
|
478
|
+
"query": {
|
|
479
|
+
"filter": {
|
|
480
|
+
"operator": "and",
|
|
481
|
+
"conditions": [
|
|
482
|
+
{
|
|
483
|
+
"property": "Project",
|
|
484
|
+
"type": "relation",
|
|
485
|
+
"operator": "contains",
|
|
486
|
+
"value": "doc_project_123"
|
|
487
|
+
}
|
|
488
|
+
]
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
```
|
|
493
|
+
|
|
494
|
+
### Timestamp sort
|
|
495
|
+
|
|
496
|
+
```json
|
|
497
|
+
{
|
|
498
|
+
"database_id": "tasks-db-id",
|
|
499
|
+
"query": {
|
|
500
|
+
"sorts": [
|
|
501
|
+
{
|
|
502
|
+
"property": "Last Edited Time",
|
|
503
|
+
"direction": "descending"
|
|
504
|
+
}
|
|
505
|
+
],
|
|
506
|
+
"page_size": 20
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
```
|
|
510
|
+
|
|
511
|
+
### Pagination follow-up
|
|
512
|
+
|
|
513
|
+
First call:
|
|
514
|
+
|
|
515
|
+
```json
|
|
516
|
+
{
|
|
517
|
+
"database_id": "tasks-db-id",
|
|
518
|
+
"query": {
|
|
519
|
+
"page_size": 20
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
```
|
|
523
|
+
|
|
524
|
+
Second call after a response with `has_more: true` and `next_offset: 20`:
|
|
525
|
+
|
|
526
|
+
```json
|
|
527
|
+
{
|
|
528
|
+
"database_id": "tasks-db-id",
|
|
529
|
+
"query": {
|
|
530
|
+
"page_size": 20
|
|
531
|
+
},
|
|
532
|
+
"offset": 20
|
|
533
|
+
}
|
|
534
|
+
```
|
|
535
|
+
|
|
536
|
+
## Practical workflow
|
|
537
|
+
|
|
538
|
+
1. Call `LOCAL_NOTIS_DATABASE_LIST_DATABASES` if you do not know the database ID yet.
|
|
539
|
+
2. Call `LOCAL_NOTIS_DATABASE_GET_DATABASE` if you need schema detail before building filters or relation payloads.
|
|
540
|
+
3. Call `LOCAL_NOTIS_DATABASE_QUERY` with `database_id` plus structured filters and sorts. Use `database_slug` only when the ID is not available.
|
|
541
|
+
4. If you need the full body of one row, call `LOCAL_NOTIS_DATABASE_GET_DOCUMENT` with the returned `document_id`.
|
|
542
|
+
5. If you need to update one of the matched rows, call the relevant generated database upsert tool with that `document_id`.
|
|
543
|
+
6. If you need a relation value, query the related database first and pass the resulting `document_id` into the upsert.
|