@notis_ai/cli 0.2.0-beta.156.1 → 0.2.0-beta.158.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 (69) hide show
  1. package/README.md +11 -45
  2. package/config/notis_app_design_rules.json +135 -0
  3. package/dist/agent-hooks/notis-agent-hook.mjs +8893 -10612
  4. package/dist/base-skills/notis-apps/SKILL.md +25 -573
  5. package/dist/base-skills/notis-apps/references/architecture.md +147 -0
  6. package/dist/base-skills/notis-apps/references/design.md +154 -0
  7. package/dist/base-skills/notis-apps/references/release.md +93 -0
  8. package/dist/base-skills/notis-apps/references/sdk.md +60 -0
  9. package/dist/base-skills/notis-apps/references/troubleshooting.md +26 -0
  10. package/dist/base-skills/notis-cli/SKILL.md +19 -267
  11. package/dist/base-skills/notis-cli/references/app-delivery.md +18 -0
  12. package/dist/base-skills/notis-cli/references/native-databases.md +20 -0
  13. package/dist/base-skills/notis-cli/references/tool-examples.md +56 -0
  14. package/dist/base-skills/notis-cli/references/troubleshooting.md +39 -0
  15. package/dist/base-skills/notis-query/SKILL.md +13 -651
  16. package/dist/base-skills/notis-query/references/database-discovery.md +59 -0
  17. package/dist/base-skills/notis-query/references/documents.md +50 -0
  18. package/dist/base-skills/notis-query/references/query.md +543 -0
  19. package/dist/skill-sync/index.js +24 -7
  20. package/dist/skill-sync/index.js.map +4 -4
  21. package/dist/skill-sync-worker.mjs +2989 -0
  22. package/package.json +1 -2
  23. package/skills/notis-apps/cli.md +34 -95
  24. package/skills/notis-cli/AGENT_INSTRUCTIONS.md +1 -1
  25. package/src/cli.js +4 -0
  26. package/src/command-specs/apps.js +322 -1560
  27. package/src/command-specs/diagnostics.js +37 -0
  28. package/src/command-specs/skills.js +23 -5
  29. package/src/runtime/agent-browser.js +169 -1
  30. package/src/runtime/app-boundary-validator.js +221 -0
  31. package/src/runtime/app-platform.js +359 -233
  32. package/src/runtime/app-test-server.js +292 -0
  33. package/src/runtime/profiles.js +5 -2
  34. package/src/runtime/skill-sync/cloud-client.ts +2 -1
  35. package/src/runtime/skill-sync/index.ts +24 -6
  36. package/src/runtime/skill-sync/types.ts +2 -0
  37. package/src/runtime/skill-sync-service.js +109 -0
  38. package/src/skill-sync-worker-entry.js +2 -0
  39. package/src/skill-sync-worker.js +50 -0
  40. package/template/app/page.tsx +45 -44
  41. package/template/components/page-heading.tsx +23 -0
  42. package/template/components/ui/badge.tsx +7 -4
  43. package/template/components/ui/card.tsx +24 -11
  44. package/template/components/ui/native-select.tsx +24 -0
  45. package/template/notis.config.ts +0 -1
  46. package/template/package.json +2 -2
  47. package/template/packages/sdk/package.json +1 -2
  48. package/template/packages/sdk/src/components/MultiSelectActionBar.tsx +55 -13
  49. package/template/packages/sdk/src/components/MultiSelectCheckbox.tsx +3 -1
  50. package/template/packages/sdk/src/config.ts +0 -2
  51. package/template/packages/sdk/src/hooks/useCollectionInteractions.ts +138 -28
  52. package/template/packages/sdk/src/hooks/useLongPressSelection.ts +79 -0
  53. package/template/packages/sdk/src/hooks/useMultiSelect.ts +2 -8
  54. package/template/packages/sdk/src/index.ts +3 -0
  55. package/template/packages/sdk/src/interactions/actions.ts +14 -1
  56. package/template/packages/sdk/src/interactions/shortcuts.tsx +79 -19
  57. package/template/packages/sdk/src/interactions/visibility.ts +13 -0
  58. package/template/packages/sdk/src/interactions.ts +5 -1
  59. package/template/packages/sdk/src/styles.css +28 -1
  60. package/src/runtime/app-dev-build-supervisor.js +0 -47
  61. package/src/runtime/app-dev-build.js +0 -41
  62. package/src/runtime/app-dev-consumers.js +0 -154
  63. package/src/runtime/app-dev-host-lock.js +0 -80
  64. package/src/runtime/app-dev-process-identity.js +0 -111
  65. package/src/runtime/app-dev-roots.js +0 -284
  66. package/src/runtime/app-dev-server.js +0 -1136
  67. package/src/runtime/app-dev-sessions.js +0 -185
  68. package/src/runtime/cli-mode.generated.js +0 -5
  69. package/src/runtime/cli-mode.js +0 -34
@@ -0,0 +1,59 @@
1
+ ## Native Database Workflow
2
+
3
+ ### Listing databases
4
+
5
+ Use `LOCAL_NOTIS_DATABASE_LIST_DATABASES` (`notis_list_databases` in legacy
6
+ underscore-form references) when:
7
+
8
+ - you need to confirm which native databases exist
9
+ - you need the database ID or slug before querying or choosing an upsert tool
10
+ - you need database metadata such as name, description, or document counts
11
+ - the orchestrator asks what is available in the user's workspace
12
+
13
+ Always inspect the user's native Notis databases before creating schema updates or choosing where to save work.
14
+
15
+ ### Creating databases
16
+
17
+ Use `LOCAL_NOTIS_DATABASE_UPSERT_DATABASE` (`notis_upsert_database` in legacy
18
+ underscore-form references) to create or update native databases.
19
+
20
+ Every native database must belong to a Notis app. When creating a database,
21
+ pass the owning app's slug or id in the `app` field; if the user has no
22
+ suitable app yet, create one first with `LOCAL_NOTIS_CREATE_APP`. Updates do
23
+ not need the `app` field.
24
+
25
+ Define schemas with appropriate property types:
26
+
27
+ - `title`
28
+ - `rich_text`
29
+ - `select`
30
+ - `multi_select`
31
+ - `status`
32
+ - `checkbox`
33
+ - `date`
34
+ - `number`
35
+ - `url`
36
+ - `email`
37
+ - `phone_number`
38
+ - `relation`
39
+
40
+ When adding or updating a `relation` property, always pass the target database explicitly with `database_id`. Do not rely on description text to imply the relation target.
41
+
42
+ Example relation update:
43
+
44
+ ```json
45
+ {
46
+ "operation": "update",
47
+ "database_id": "tasks-db-id",
48
+ "properties": [
49
+ {
50
+ "property_id": "prop_list",
51
+ "name": "List",
52
+ "action": "update",
53
+ "type": "relation",
54
+ "database_id": "lists-db-id",
55
+ "description": "Relation to Lists"
56
+ }
57
+ ]
58
+ }
59
+ ```
@@ -0,0 +1,50 @@
1
+ ### Reading documents
2
+
3
+ Use `LOCAL_NOTIS_DATABASE_GET_DOCUMENT` when:
4
+
5
+ - the task references a specific document by `document_id` or portal URL
6
+ - detailed content from a known document is needed
7
+
8
+ You may pass either a `document_id` or a portal URL such as `https://app.notis.ai/documents/abc123` or `/documents/abc123`.
9
+
10
+ ## Native Document Handling
11
+
12
+ ### Response requirements
13
+
14
+ - Always include the document title, database name, and a markdown portal link for any document you create or update.
15
+ - Never expose a raw `document_id` in your completion summary unless the user explicitly asked for it.
16
+ - Clearly state whether the document was created or updated.
17
+ - For updates, clearly state whether you replaced the original content or appended to the end.
18
+
19
+ ### Upserting with relations
20
+
21
+ When upserting into a database that relates to another database, first query for the related record and use the returned `document_id` for the relation.
22
+
23
+ ### Upserting complex documents
24
+
25
+ For copywriting-style work such as articles or social posts, try to find similar writing by the user and match the user's style and tone.
26
+
27
+ ### Updating a document
28
+
29
+ 1. Retrieve the current content with `LOCAL_NOTIS_DATABASE_GET_DOCUMENT`, `LOCAL_NOTIS_DATABASE_QUERY`, or `LOCAL_NOTIS_SEARCH_MEMORIES` with `memory_kind="native_document"`.
30
+ 2. Use the relevant `LOCAL_NOTIS_DATABASE_UPSERT_<DATABASE_SLUG>` tool with the existing `document_id` so the document is updated instead of recreated.
31
+ 3. For local edits to an existing document such as appending a bullet, inserting a paragraph, changing one section, or preserving structure, use `edit_mode = "block_operations"` instead of rewriting markdown.
32
+ 4. When developer context includes a `<page_context ... resource_type="document" ...>` tag, treat that as the currently open document and fetch it before asking the user for any identifier again.
33
+
34
+ ### Default upsert preferences
35
+
36
+ As long as they do not conflict with the user's intent, the existing document style, or the tool contract:
37
+
38
+ - Prefer updating existing documents over creating new ones when the user asked for a modification.
39
+ - Use `replace = true` to replace content and `replace = false` to append when you are in markdown mode.
40
+ - When the user asked to append, insert, tweak, or preserve the rest of an existing document, prefer `block_operations` with `insert_blocks`, `update_block`, `replace_blocks`, or `remove_blocks`.
41
+ - Do not use markdown rewrite mode for surgical edits unless block operations are genuinely impossible for the requested change.
42
+ - Reorganize messy thoughts into a clearer structure.
43
+ - Highlight essential concepts and extract action items.
44
+ - Format notes with markdown titles, subheadings, bold text, blockquotes, ordered lists, and unordered lists when helpful.
45
+ - Add useful insight, challenge weak reasoning, debunk false claims, or enrich the content when appropriate.
46
+ - Fill in missing information the user asked you to complete when the context supports it.
47
+ - Imitate the user's voice when you can infer it from semantic memory search with `memory_kind="native_document"` or existing document context.
48
+ - Save images in document content using standard markdown and in URL properties when relevant.
49
+ - Do not place videos inside document content. Store them only in media properties.
50
+ - Do not add a custom emoji or cover unless the user requested one.
@@ -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.