@notis_ai/cli 0.2.0-beta.16.1 → 0.2.0-beta.161.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.
Files changed (161) hide show
  1. package/README.md +435 -133
  2. package/bin/check-runtime.js +15 -0
  3. package/bin/notis.js +2 -0
  4. package/config/notis_app_boundary_rules.json +50 -0
  5. package/config/notis_app_design_rules.json +135 -0
  6. package/dist/agent-hooks/notis-agent-hook.mjs +19008 -0
  7. package/dist/base-skills/notis-apps/SKILL.md +70 -0
  8. package/dist/base-skills/notis-apps/references/architecture.md +164 -0
  9. package/dist/base-skills/notis-apps/references/context.md +81 -0
  10. package/dist/base-skills/notis-apps/references/design.md +165 -0
  11. package/dist/base-skills/notis-apps/references/reading.md +89 -0
  12. package/dist/base-skills/notis-apps/references/release.md +99 -0
  13. package/dist/base-skills/notis-apps/references/sdk.md +62 -0
  14. package/dist/base-skills/notis-apps/references/troubleshooting.md +23 -0
  15. package/dist/base-skills/notis-cli/SKILL.md +140 -0
  16. package/dist/base-skills/notis-cli/references/app-delivery.md +18 -0
  17. package/dist/base-skills/notis-cli/references/native-databases.md +20 -0
  18. package/dist/base-skills/notis-cli/references/tool-examples.md +56 -0
  19. package/dist/base-skills/notis-cli/references/troubleshooting.md +39 -0
  20. package/dist/base-skills/notis-query/SKILL.md +67 -0
  21. package/dist/base-skills/notis-query/references/database-discovery.md +59 -0
  22. package/dist/base-skills/notis-query/references/documents.md +50 -0
  23. package/dist/base-skills/notis-query/references/query.md +543 -0
  24. package/dist/skill-sync/index.js +1626 -0
  25. package/dist/skill-sync/index.js.map +7 -0
  26. package/dist/skill-sync-worker.mjs +2990 -0
  27. package/package.json +18 -7
  28. package/skills/notis-apps/cli.md +313 -0
  29. package/skills/notis-cli/AGENT_INSTRUCTIONS.md +39 -0
  30. package/skills/notis-onboarding/BRIEF.md +129 -0
  31. package/skills/notis-query/cli.md +39 -0
  32. package/src/agent-hook-entry.js +5 -0
  33. package/src/cli.js +294 -25
  34. package/src/command-specs/agents.js +392 -0
  35. package/src/command-specs/apps.js +1470 -202
  36. package/src/command-specs/auth.js +114 -137
  37. package/src/command-specs/diagnostics.js +729 -0
  38. package/src/command-specs/handover.js +374 -0
  39. package/src/command-specs/helpers.js +84 -82
  40. package/src/command-specs/index.js +25 -6
  41. package/src/command-specs/meta.js +150 -18
  42. package/src/command-specs/onboarding.js +290 -0
  43. package/src/command-specs/profile.js +358 -0
  44. package/src/command-specs/reports.js +86 -0
  45. package/src/command-specs/skills.js +75 -0
  46. package/src/command-specs/smoke.js +386 -0
  47. package/src/command-specs/tools.js +455 -139
  48. package/src/runtime/agent-browser.js +632 -0
  49. package/src/runtime/agent-memory-state.js +126 -0
  50. package/src/runtime/agent-setup.js +383 -0
  51. package/src/runtime/app-boundary-validator.js +404 -0
  52. package/src/runtime/app-changelog.js +79 -0
  53. package/src/runtime/app-platform.js +2633 -210
  54. package/src/runtime/app-registry-scaffolds.js +367 -0
  55. package/src/runtime/app-test-server.js +292 -0
  56. package/src/runtime/assets/store-screenshot-dark.png +0 -0
  57. package/src/runtime/auth-recovery.js +110 -0
  58. package/src/runtime/base-skills.d.ts +20 -0
  59. package/src/runtime/base-skills.js +167 -0
  60. package/src/runtime/channel.js +133 -0
  61. package/src/runtime/delegated-context.js +68 -0
  62. package/src/runtime/errors.js +1 -0
  63. package/src/runtime/git.js +233 -0
  64. package/src/runtime/login-listener.js +15 -0
  65. package/src/runtime/oauth.js +2622 -0
  66. package/src/runtime/output.js +37 -5
  67. package/src/runtime/ports.js +31 -0
  68. package/src/runtime/profiles.js +906 -55
  69. package/src/runtime/skill-sync/cloud-client.ts +99 -0
  70. package/src/runtime/skill-sync/index.ts +697 -0
  71. package/src/runtime/skill-sync/local-scanner.ts +1046 -0
  72. package/src/runtime/skill-sync/symlink-manager.ts +433 -0
  73. package/src/runtime/skill-sync/sync-plan.ts +22 -0
  74. package/src/runtime/skill-sync/types.ts +110 -0
  75. package/src/runtime/skill-sync/write-cloud-skill.ts +50 -0
  76. package/src/runtime/skill-sync-service.js +109 -0
  77. package/src/runtime/store-screenshot.js +143 -0
  78. package/src/runtime/sync-skills.d.ts +37 -0
  79. package/src/runtime/sync-skills.js +231 -0
  80. package/src/runtime/telemetry.js +92 -0
  81. package/src/runtime/transport.js +324 -45
  82. package/src/skill-sync-worker-entry.js +2 -0
  83. package/src/skill-sync-worker.js +50 -0
  84. package/template/.harness/index.html.tmpl +430 -0
  85. package/template/CHANGELOG.md +5 -0
  86. package/template/app/globals.css +28 -3
  87. package/template/app/layout.tsx +6 -3
  88. package/template/app/page.tsx +49 -42
  89. package/template/components/page-heading.tsx +23 -0
  90. package/template/components/ui/badge.tsx +7 -4
  91. package/template/components/ui/button.tsx +1 -1
  92. package/template/components/ui/card.tsx +24 -11
  93. package/template/components/ui/native-select.tsx +24 -0
  94. package/template/notis.config.ts +24 -6
  95. package/template/package-lock.json +3642 -0
  96. package/template/package.json +19 -16
  97. package/template/packages/{notis-sdk → sdk}/package.json +14 -4
  98. package/template/packages/sdk/src/agentContext.ts +36 -0
  99. package/template/packages/sdk/src/components/DocumentEditor.tsx +103 -0
  100. package/template/packages/sdk/src/components/Markdown.tsx +60 -0
  101. package/template/packages/sdk/src/components/MarkdownEditor.tsx +121 -0
  102. package/template/packages/sdk/src/components/MultiSelectActionBar.tsx +285 -0
  103. package/template/packages/sdk/src/components/MultiSelectCheckbox.tsx +97 -0
  104. package/template/packages/sdk/src/components/MultiSelectDragOverlay.tsx +39 -0
  105. package/template/packages/sdk/src/components/NotisCommentBoundary.tsx +172 -0
  106. package/template/packages/sdk/src/components/NotisSelectionBoundary.tsx +59 -0
  107. package/template/packages/sdk/src/components/ShortcutHints.tsx +56 -0
  108. package/template/packages/sdk/src/components/Skeleton.tsx +24 -0
  109. package/template/packages/sdk/src/config.ts +257 -0
  110. package/template/packages/sdk/src/documents.ts +256 -0
  111. package/template/packages/sdk/src/hooks/useActiveResource.ts +19 -0
  112. package/template/packages/sdk/src/hooks/useAgentContext.ts +23 -0
  113. package/template/packages/sdk/src/hooks/useCloudComputer.ts +64 -0
  114. package/template/packages/sdk/src/hooks/useCollectionInteractions.ts +836 -0
  115. package/template/packages/sdk/src/hooks/useDatabaseSchema.ts +49 -0
  116. package/template/packages/sdk/src/hooks/useDatabaseSubscription.ts +76 -0
  117. package/template/packages/sdk/src/hooks/useDocument.ts +43 -0
  118. package/template/packages/sdk/src/hooks/useDocuments.ts +84 -0
  119. package/template/packages/sdk/src/hooks/useHandover.ts +78 -0
  120. package/template/packages/sdk/src/hooks/useLongPressSelection.ts +79 -0
  121. package/template/packages/sdk/src/hooks/useMultiSelect.ts +95 -0
  122. package/template/packages/{notis-sdk → sdk}/src/hooks/useNotis.ts +10 -4
  123. package/template/packages/{notis-sdk → sdk}/src/hooks/useNotisNavigation.ts +11 -8
  124. package/template/packages/sdk/src/hooks/useQuery.ts +71 -0
  125. package/template/packages/sdk/src/hooks/useTool.ts +65 -0
  126. package/template/packages/sdk/src/hooks/useToolQuery.ts +12 -0
  127. package/template/packages/sdk/src/hooks/useTopBarSearch.ts +81 -0
  128. package/template/packages/sdk/src/hooks/useUpsertDocument.ts +95 -0
  129. package/template/packages/sdk/src/index.ts +161 -0
  130. package/template/packages/sdk/src/interactions/actions.ts +59 -0
  131. package/template/packages/sdk/src/interactions/shortcuts.tsx +694 -0
  132. package/template/packages/sdk/src/interactions/visibility.ts +13 -0
  133. package/template/packages/sdk/src/interactions.ts +45 -0
  134. package/template/packages/sdk/src/provider.tsx +44 -0
  135. package/template/packages/sdk/src/queryCache.ts +170 -0
  136. package/template/packages/sdk/src/runtime.ts +451 -0
  137. package/template/packages/sdk/src/styles.css +247 -0
  138. package/template/packages/sdk/src/tailwind.ts +66 -0
  139. package/template/packages/sdk/src/vite.ts +73 -0
  140. package/template/packages/{notis-sdk → sdk}/tsconfig.json +1 -0
  141. package/template/postcss.config.mjs +1 -1
  142. package/template/tailwind.config.ts +1 -6
  143. package/template/tsconfig.json +1 -0
  144. package/src/command-specs/db.js +0 -163
  145. package/src/runtime/app-preview-server.js +0 -312
  146. package/template/packages/notis-sdk/src/config.ts +0 -48
  147. package/template/packages/notis-sdk/src/helpers.ts +0 -131
  148. package/template/packages/notis-sdk/src/hooks/useAppState.ts +0 -50
  149. package/template/packages/notis-sdk/src/hooks/useCollectionItem.ts +0 -58
  150. package/template/packages/notis-sdk/src/hooks/useDatabase.ts +0 -87
  151. package/template/packages/notis-sdk/src/hooks/useDocument.ts +0 -61
  152. package/template/packages/notis-sdk/src/hooks/useTool.ts +0 -49
  153. package/template/packages/notis-sdk/src/hooks/useUpsertDocument.ts +0 -57
  154. package/template/packages/notis-sdk/src/index.ts +0 -47
  155. package/template/packages/notis-sdk/src/provider.tsx +0 -44
  156. package/template/packages/notis-sdk/src/runtime.ts +0 -159
  157. package/template/packages/notis-sdk/src/styles.css +0 -123
  158. package/template/packages/notis-sdk/src/vite.ts +0 -54
  159. /package/template/packages/{notis-sdk → sdk}/src/hooks/useBackend.ts +0 -0
  160. /package/template/packages/{notis-sdk → sdk}/src/hooks/useTools.ts +0 -0
  161. /package/template/packages/{notis-sdk → sdk}/src/ui.ts +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.