datanotes 3.2.0 → 3.3.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 (63) hide show
  1. package/README.md +1 -0
  2. package/SECURITY.md +12 -0
  3. package/dist/api/client.d.cts +2 -0
  4. package/dist/api/client.d.ts +2 -0
  5. package/dist/api/docs.d.cts +14 -4
  6. package/dist/api/docs.d.ts +14 -4
  7. package/dist/api/extension-files.d.cts +23 -0
  8. package/dist/api/extension-files.d.ts +23 -0
  9. package/dist/api/extension-host.d.cts +108 -0
  10. package/dist/api/extension-host.d.ts +108 -0
  11. package/dist/api/extension-manifest.d.cts +154 -0
  12. package/dist/api/extension-manifest.d.ts +154 -0
  13. package/dist/api/extension-plan.d.cts +174 -0
  14. package/dist/api/extension-plan.d.ts +174 -0
  15. package/dist/api/extension-record.d.cts +65 -0
  16. package/dist/api/extension-record.d.ts +65 -0
  17. package/dist/api/extension-sdk.d.cts +65 -0
  18. package/dist/api/extension-sdk.d.ts +65 -0
  19. package/dist/api/extensions.cjs +19660 -0
  20. package/dist/api/extensions.d.cts +11 -0
  21. package/dist/api/extensions.d.ts +11 -0
  22. package/dist/api/extensions.js +19597 -0
  23. package/dist/api/index.cjs +1568 -375
  24. package/dist/api/index.js +1568 -375
  25. package/dist/api/mcp.cjs +1238 -27
  26. package/dist/api/mcp.js +1238 -27
  27. package/dist/datanotes.cjs +8365 -4335
  28. package/dist/docs/administration/extensions.md +213 -0
  29. package/dist/docs/api/operations/alter_table.md +4 -3
  30. package/dist/docs/api/operations/extensions_delete.md +29 -0
  31. package/dist/docs/api/operations/extensions_list.md +20 -0
  32. package/dist/docs/api/operations/extensions_record.md +44 -0
  33. package/dist/docs/api/operations/tags/extensions.md +9 -0
  34. package/dist/docs/api.md +9 -1
  35. package/dist/docs/develop/write-an-extension.md +369 -0
  36. package/dist/docs/guides/data-quality/check-constraints.md +10 -10
  37. package/dist/docs/guides/data-quality/hand-edits.md +8 -8
  38. package/dist/docs/guides/database-objects/bases.md +11 -11
  39. package/dist/docs/guides/database-objects/catalogs-and-schemas.md +30 -10
  40. package/dist/docs/guides/database-objects/columns.md +38 -38
  41. package/dist/docs/guides/database-objects/relations.md +28 -28
  42. package/dist/docs/guides/database-objects/tables.md +167 -43
  43. package/dist/docs/guides/database-objects/views.md +44 -44
  44. package/dist/docs/guides/history/change-data-feed.md +34 -34
  45. package/dist/docs/guides/history/journal-and-undo.md +12 -12
  46. package/dist/docs/guides/history/restore.md +20 -20
  47. package/dist/docs/guides/history/table-history.md +31 -31
  48. package/dist/docs/guides/read-and-write/automatic-links.md +15 -15
  49. package/dist/docs/guides/read-and-write/import-notes.md +20 -20
  50. package/dist/docs/guides/read-and-write/joins-and-aggregates.md +7 -7
  51. package/dist/docs/guides/read-and-write/read-and-filter.md +10 -10
  52. package/dist/docs/guides/read-and-write/write-rows.md +10 -10
  53. package/dist/docs/guides/search/text.md +1 -1
  54. package/dist/docs/guides/security/security-model.md +12 -0
  55. package/dist/docs/reference/cli.md +32 -1
  56. package/dist/docs/reference/glossary.md +8 -0
  57. package/dist/docs/reference/operations/auxiliary.md +1 -1
  58. package/dist/docs/reference/operations/rows.md +1 -1
  59. package/dist/docs/reference/operations/schema.md +3 -3
  60. package/dist/docs/reference/operations.md +4 -4
  61. package/dist/docs/release-notes.md +49 -0
  62. package/dist/docs/start/connect-agents.md +11 -0
  63. package/package.json +11 -1
@@ -314,7 +314,7 @@ Answer:
314
314
  "op": "create_table",
315
315
  "planned_texts": ["datanotes/metastore.yaml"],
316
316
  "commits": [{ "table": "main.public.film", "version": 0, "operation": "CREATE TABLE" }],
317
- "migration_id": "20261019T040648-create_table-create-table-main-public-film"
317
+ "migration_id": "20261024T053830-create_table-create-table-main-public-film"
318
318
  }
319
319
  ```
320
320
 
@@ -359,7 +359,7 @@ Answer (70 lines)
359
359
  "path": "Films/Charade.md",
360
360
  "set": {
361
361
  "table": "main.public.film",
362
- "id": "01a15257-31b6-75a9-bb7e-06ebf5b385a4",
362
+ "id": "01a16c6a-f3d8-7a71-935b-e3cdd49c2cec",
363
363
  "director": "Stanley Donen",
364
364
  "title": "Charade"
365
365
  },
@@ -369,7 +369,7 @@ Answer (70 lines)
369
369
  "path": "Films/His Girl Friday.md",
370
370
  "set": {
371
371
  "table": "main.public.film",
372
- "id": "01a15257-31b6-7aac-9ba1-16fb7e23aa0a",
372
+ "id": "01a16c6a-f3d8-7b3a-a052-76112f5037b7",
373
373
  "director": "Howard Hawks",
374
374
  "title": "His Girl Friday"
375
375
  },
@@ -379,7 +379,7 @@ Answer (70 lines)
379
379
  "path": "Films/Metropolis.md",
380
380
  "set": {
381
381
  "table": "main.public.film",
382
- "id": "01a15257-31b6-7d6a-998e-fd8f06c27786",
382
+ "id": "01a16c6a-f3d8-7dda-93e2-1ad75dd46ee2",
383
383
  "director": "Fritz Lang",
384
384
  "title": "Metropolis"
385
385
  },
@@ -389,7 +389,7 @@ Answer (70 lines)
389
389
  "path": "Films/Nosferatu.md",
390
390
  "set": {
391
391
  "table": "main.public.film",
392
- "id": "01a15257-31b6-7a33-a502-afc11c66b564",
392
+ "id": "01a16c6a-f3d8-7b11-bdee-5230b4678352",
393
393
  "director": "F. W. Murnau",
394
394
  "title": "Nosferatu"
395
395
  },
@@ -399,7 +399,7 @@ Answer (70 lines)
399
399
  "path": "Films/The Gold Rush.md",
400
400
  "set": {
401
401
  "table": "main.public.film",
402
- "id": "01a15257-31b6-7124-9bc9-40a032066bd3",
402
+ "id": "01a16c6a-f3d8-71bc-a2b9-70a1be84f56f",
403
403
  "director": "Charlie Chaplin",
404
404
  "title": "The Gold Rush"
405
405
  },
@@ -458,7 +458,7 @@ Answer (73 lines)
458
458
  "path": "Films/Charade.md",
459
459
  "set": {
460
460
  "table": "main.public.film",
461
- "id": "01a15257-31bb-7a46-8ac7-181fa5bacea7",
461
+ "id": "01a16c6a-f3db-705d-a092-d386d6b8d680",
462
462
  "director": "Stanley Donen",
463
463
  "title": "Charade"
464
464
  },
@@ -468,7 +468,7 @@ Answer (73 lines)
468
468
  "path": "Films/His Girl Friday.md",
469
469
  "set": {
470
470
  "table": "main.public.film",
471
- "id": "01a15257-31bb-7754-a84c-ada8c44c4f96",
471
+ "id": "01a16c6a-f3db-7ce9-9b15-ffdf1d9e94f9",
472
472
  "director": "Howard Hawks",
473
473
  "title": "His Girl Friday"
474
474
  },
@@ -478,7 +478,7 @@ Answer (73 lines)
478
478
  "path": "Films/Metropolis.md",
479
479
  "set": {
480
480
  "table": "main.public.film",
481
- "id": "01a15257-31bb-7113-b86a-5d6fdca79420",
481
+ "id": "01a16c6a-f3db-73dd-9ca7-c1c2c0456765",
482
482
  "director": "Fritz Lang",
483
483
  "title": "Metropolis"
484
484
  },
@@ -488,7 +488,7 @@ Answer (73 lines)
488
488
  "path": "Films/Nosferatu.md",
489
489
  "set": {
490
490
  "table": "main.public.film",
491
- "id": "01a15257-31bc-7f8b-b4a7-376f074e01cb",
491
+ "id": "01a16c6a-f3db-7a47-8726-24e829d99493",
492
492
  "director": "F. W. Murnau",
493
493
  "title": "Nosferatu"
494
494
  },
@@ -498,7 +498,7 @@ Answer (73 lines)
498
498
  "path": "Films/The Gold Rush.md",
499
499
  "set": {
500
500
  "table": "main.public.film",
501
- "id": "01a15257-31bc-7554-a326-0e8b427aa5c6",
501
+ "id": "01a16c6a-f3db-77f9-a8b3-30bb65a6cc26",
502
502
  "director": "Charlie Chaplin",
503
503
  "title": "The Gold Rush"
504
504
  },
@@ -519,7 +519,7 @@ Answer (73 lines)
519
519
  }
520
520
  ],
521
521
  "commits": [{ "table": "main.public.film", "version": 1, "operation": "ADOPT ROWS" }],
522
- "migration_id": "20261019T040648-adopt_rows-adopt-5-notes-into-film"
522
+ "migration_id": "20261024T053831-adopt_rows-adopt-5-notes-into-film"
523
523
  }
524
524
  ```
525
525
 
@@ -536,7 +536,7 @@ Answer:
536
536
  ```markdown
537
537
  ---
538
538
  table: main.public.film
539
- id: 01a15257-31bb-7a46-8ac7-181fa5bacea7
539
+ id: 01a16c6a-f3db-705d-a092-d386d6b8d680
540
540
  year: 1963
541
541
  minutes: 113
542
542
  status: watched
@@ -623,7 +623,7 @@ Answer:
623
623
  "files_created": 1,
624
624
  "planned_creates": ["datanotes/main/public/film/Battleship Potemkin.md"],
625
625
  "commits": [{ "table": "main.public.film", "version": 2, "operation": "WRITE" }],
626
- "migration_id": "20261019T040648-insert_row-insert-into-film"
626
+ "migration_id": "20261024T053831-insert_row-insert-into-film"
627
627
  }
628
628
  ```
629
629
 
@@ -655,7 +655,7 @@ Answer:
655
655
  "op": "add_column",
656
656
  "planned_texts": ["datanotes/metastore.yaml"],
657
657
  "commits": [{ "table": "main.public.film", "version": 4, "operation": "ADD COLUMNS" }],
658
- "migration_id": "20261019T040650-add_column-add-column-added_by-to-film"
658
+ "migration_id": "20261024T053832-add_column-add-column-added_by-to-film"
659
659
  }
660
660
  ```
661
661
 
@@ -683,7 +683,7 @@ Answer:
683
683
  "files_created": 1,
684
684
  "planned_creates": ["datanotes/main/public/film/Night of the Living Dead.md"],
685
685
  "commits": [{ "table": "main.public.film", "version": 5, "operation": "WRITE" }],
686
- "migration_id": "20261019T040650-insert_row-insert-into-film"
686
+ "migration_id": "20261024T053832-insert_row-insert-into-film"
687
687
  }
688
688
  ```
689
689
 
@@ -692,7 +692,7 @@ Answer:
692
692
  ```markdown
693
693
  ---
694
694
  table: main.public.film
695
- id: 01a15257-37bf-770c-a384-b360bb939197
695
+ id: 01a16c6a-f9d0-7e20-8311-52386a251707
696
696
  director: George A. Romero
697
697
  minutes: 96
698
698
  status: to watch
@@ -734,7 +734,7 @@ Answer:
734
734
  ```markdown
735
735
  ---
736
736
  table: main.public.film
737
- id: 01a15257-3a49-7617-a437-430fcfdc292a
737
+ id: 01a16c6a-fc6c-7872-89fb-d51beace835e
738
738
  year: 1924
739
739
  minutes: 45
740
740
  status: to watch
@@ -762,7 +762,7 @@ Answer:
762
762
  "op": "alter_table",
763
763
  "planned_texts": ["datanotes/metastore.yaml"],
764
764
  "commits": [{ "table": "main.public.film", "version": 7, "operation": "ALTER TABLE" }],
765
- "migration_id": "20261019T040652-alter_table-alter-table-main-public-film"
765
+ "migration_id": "20261024T053835-alter_table-alter-table-main-public-film"
766
766
  }
767
767
  ```
768
768
 
@@ -825,7 +825,7 @@ This is the table as you inferred, corrected and extended it on this page. Its d
825
825
 
826
826
  ```yaml
827
827
  # Metastore (Datanotes): catalogs, schemas, tables, columns, views.
828
- id: 01a15257-319e-7663-863b-41ff43d87deb
828
+ id: 01a16c6a-f3c8-7bd8-8ca7-e31ab9cbc5a7
829
829
  config:
830
830
  history: true
831
831
 
@@ -100,9 +100,9 @@ Answer:
100
100
  "table": "main.public.watch",
101
101
  "total": 3,
102
102
  "rows": [
103
- { "date(occurred_at)": "2026-10-14", "viewings": 1 },
104
- { "date(occurred_at)": "2026-10-17", "viewings": 1 },
105
- { "date(occurred_at)": "2026-10-18", "viewings": 1 }
103
+ { "date(occurred_at)": "2026-10-19", "viewings": 1 },
104
+ { "date(occurred_at)": "2026-10-22", "viewings": 1 },
105
+ { "date(occurred_at)": "2026-10-23", "viewings": 1 }
106
106
  ]
107
107
  }
108
108
  ```
@@ -138,10 +138,10 @@ Answer:
138
138
  {
139
139
  "path": "datanotes/main/public/film/Night of the Living Dead.md",
140
140
  "title": "Night of the Living Dead",
141
- "watched_on": "2026-10-18",
141
+ "watched_on": "2026-10-23",
142
142
  "viewing": [
143
143
  {
144
- "path": "datanotes/main/public/watch/2026-10-18T2200.md",
144
+ "path": "datanotes/main/public/watch/2026-10-23T2200.md",
145
145
  "where": "cinema",
146
146
  "with": "Oscar"
147
147
  }
@@ -150,10 +150,10 @@ Answer:
150
150
  {
151
151
  "path": "datanotes/main/public/film/The Gold Rush.md",
152
152
  "title": "The Gold Rush",
153
- "watched_on": "2026-10-17",
153
+ "watched_on": "2026-10-22",
154
154
  "viewing": [
155
155
  {
156
- "path": "datanotes/main/public/watch/2026-10-17T2030.md",
156
+ "path": "datanotes/main/public/watch/2026-10-22T2030.md",
157
157
  "where": "home",
158
158
  "with": "my sister"
159
159
  }
@@ -332,23 +332,23 @@ Answer:
332
332
  "total": 3,
333
333
  "rows": [
334
334
  {
335
- "path": "datanotes/main/public/watch/2026-10-14T2115.md",
335
+ "path": "datanotes/main/public/watch/2026-10-19T2115.md",
336
336
  "film": "[[Charade]]",
337
- "occurred_at": "2026-10-14T21:15",
337
+ "occurred_at": "2026-10-19T21:15",
338
338
  "where": "home",
339
339
  "place": "my living room"
340
340
  },
341
341
  {
342
- "path": "datanotes/main/public/watch/2026-10-17T2030.md",
342
+ "path": "datanotes/main/public/watch/2026-10-22T2030.md",
343
343
  "film": "[[The Gold Rush]]",
344
- "occurred_at": "2026-10-17T20:30",
344
+ "occurred_at": "2026-10-22T20:30",
345
345
  "where": "home",
346
346
  "place": "my living room"
347
347
  },
348
348
  {
349
- "path": "datanotes/main/public/watch/2026-10-18T2200.md",
349
+ "path": "datanotes/main/public/watch/2026-10-23T2200.md",
350
350
  "film": "[[Night of the Living Dead]]",
351
- "occurred_at": "2026-10-18T22:00",
351
+ "occurred_at": "2026-10-23T22:00",
352
352
  "where": "cinema",
353
353
  "place": "the film club downtown"
354
354
  }
@@ -459,12 +459,12 @@ Answer:
459
459
  "total": 7,
460
460
  "rows": [
461
461
  {
462
- "path": "datanotes/main/public/watch/2026-10-14T2115.md",
463
- "occurred_at": "2026-10-14T21:15"
462
+ "path": "datanotes/main/public/watch/2026-10-19T2115.md",
463
+ "occurred_at": "2026-10-19T21:15"
464
464
  },
465
465
  {
466
- "path": "datanotes/main/public/watch/2026-10-10T2130.md",
467
- "occurred_at": "2026-10-10T21:30"
466
+ "path": "datanotes/main/public/watch/2026-10-15T2130.md",
467
+ "occurred_at": "2026-10-15T21:30"
468
468
  }
469
469
  ]
470
470
  }
@@ -31,7 +31,7 @@ Answer:
31
31
  "files_created": 1,
32
32
  "planned_creates": ["datanotes/main/public/film/Metropolis.md"],
33
33
  "commits": [{ "table": "main.public.film", "version": 1, "operation": "WRITE" }],
34
- "migration_id": "20261019T040638-insert_row-insert-into-film"
34
+ "migration_id": "20261024T053819-insert_row-insert-into-film"
35
35
  }
36
36
  ```
37
37
 
@@ -40,7 +40,7 @@ Answer:
40
40
  ```markdown
41
41
  ---
42
42
  table: main.public.film
43
- id: 01a15257-0a57-7094-a53c-2ffddb1a5284
43
+ id: 01a16c6a-c7b1-7337-8349-70046fead6ac
44
44
  title: Metropolis
45
45
  year: 1927
46
46
  minutes: 153
@@ -103,7 +103,7 @@ Answer:
103
103
  }
104
104
  ],
105
105
  "commits": [{ "table": "main.public.film", "version": 6, "operation": "UPDATE" }],
106
- "migration_id": "20261019T040643-update_row-update-film"
106
+ "migration_id": "20261024T053823-update_row-update-film"
107
107
  }
108
108
  ```
109
109
 
@@ -174,7 +174,7 @@ Answer:
174
174
  }
175
175
  ],
176
176
  "commits": [{ "table": "main.public.film", "version": 8, "operation": "UPDATE" }],
177
- "migration_id": "20261019T040643-update_row-update-film-3",
177
+ "migration_id": "20261024T053823-update_row-update-film-3",
178
178
  "ambiguous_mentions": [
179
179
  {
180
180
  "path": "datanotes/main/public/film/Nosferatu.md",
@@ -193,7 +193,7 @@ Answer:
193
193
  ```markdown
194
194
  ---
195
195
  table: main.public.film
196
- id: 01a15257-1ca9-7d11-a4d0-bc403634a138
196
+ id: 01a16c6a-d656-749e-960a-7aa338a198ae
197
197
  title: Nosferatu
198
198
  year: 1922
199
199
  status: watched
@@ -246,7 +246,7 @@ Answer:
246
246
  }
247
247
  ],
248
248
  "commits": [{ "table": "main.public.film", "version": 9, "operation": "UPDATE" }],
249
- "migration_id": "20261019T040643-update_row-update-film-4"
249
+ "migration_id": "20261024T053823-update_row-update-film-4"
250
250
  }
251
251
  ```
252
252
 
@@ -332,7 +332,7 @@ Answer:
332
332
  }
333
333
  ],
334
334
  "commits": [{ "table": "main.public.film", "version": 10, "operation": "UPDATE" }],
335
- "migration_id": "20261019T040643-update_rows-update-film"
335
+ "migration_id": "20261024T053823-update_rows-update-film"
336
336
  }
337
337
  ```
338
338
 
@@ -370,7 +370,7 @@ Answer:
370
370
  ],
371
371
  "planned_creates": ["datanotes/main/public/film/Battleship Potemkin.md"],
372
372
  "commits": [{ "table": "main.public.film", "version": 11, "operation": "MERGE" }],
373
- "migration_id": "20261019T040643-merge_rows-merge-2-rows-into-film"
373
+ "migration_id": "20261024T053823-merge_rows-merge-2-rows-into-film"
374
374
  }
375
375
  ```
376
376
 
@@ -431,7 +431,7 @@ Answer:
431
431
  }
432
432
  ],
433
433
  "commits": [{ "table": "main.public.film", "version": 12, "operation": "DELETE" }],
434
- "migration_id": "20261019T040643-delete_rows-archive-1-rows-of-film"
434
+ "migration_id": "20261024T053823-delete_rows-archive-1-rows-of-film"
435
435
  }
436
436
  ```
437
437
 
@@ -568,6 +568,6 @@ Answer (51 lines)
568
568
  { "table": "main.public.film", "version": 22, "operation": "MOVE ROWS" },
569
569
  { "table": "main.public.watchlist", "version": 1, "operation": "MOVE ROWS" }
570
570
  ],
571
- "migration_id": "20261019T040643-move_rows-move-4-rows-from-film-to-watch"
571
+ "migration_id": "20261024T053823-move_rows-move-4-rows-from-film-to-watch"
572
572
  }
573
573
  ```
@@ -87,7 +87,7 @@ Answer (62 lines)
87
87
  {
88
88
  "start": 81,
89
89
  "end": 86,
90
- "context": "-a8aa-d00b2c25ad08\nname: Cary Grant\n---\n\n"
90
+ "context": "-9421-e41365b64268\nname: Cary Grant\n---\n\n"
91
91
  }
92
92
  ]
93
93
  },
@@ -67,6 +67,18 @@ The owner creates a named token with `POST /datanotes/tokens/create/`, and the e
67
67
 
68
68
  A named token can’t create webhooks, manage tokens or read the engine’s status, and without `maintain` it can’t undo.
69
69
 
70
+ ### Extensions
71
+
72
+ An extension adds tables and Model Context Protocol (MCP) tools from a git repository. Its code is trusted code that runs inside the MCP server’s process, not in a sandbox. Install only extensions you trust, and read the plan first.
73
+
74
+ * **Pinned code**: the installer takes a version tag or a full commit id, and refuses a branch. It fetches the tag itself, even when a branch has the same name. It records the commit and the SHA-256 hashes of the manifest and the entry file. The server refuses cached code that differs.
75
+ * **No install scripts**: the installer runs no script, no build and no `npm install`. The entry file may import only Node built-ins. The installer reads the imports in the file. Code that builds a module name at run time escapes this check.
76
+ * **One token for each extension**: `ext-<name>` writes only the tables the manifest lists. It cannot change the schema or undo. The installer changes the schema with the owner’s token, after you confirm the plan.
77
+ * **An invoker check**: before a tool that writes runs, the server checks the calling agent’s token. That token must be able to write the tool’s tables. A read-only client cannot write through an extension.
78
+ * **The secret stays on one machine**: the token file sits under the data home with mode 0600. The registry in the engine’s store holds no secret.
79
+
80
+ Known limits: extension code is not isolated from the MCP server’s process. Its token reads every table until read patterns ship. Migrations are declarative and run no code. [Install extensions](https://datanotes.dev/administration/extensions/) has the details.
81
+
70
82
  ### Who made each write
71
83
 
72
84
  The engine journals every write with its actor. The client sends the agent’s name, model and session, so they’re self-reported. The server sets the credential, `auth` (`owner`, or the named token’s name), and no client can claim another one.
@@ -3,7 +3,7 @@
3
3
  > The datanotes command and its options.
4
4
 
5
5
  ```text
6
- datanotes 3.2.0: Markdown notes as database tables, for you and your agents.
6
+ datanotes 3.3.1: Markdown notes as database tables, for you and your agents.
7
7
 
8
8
 
9
9
  Usage:
@@ -15,6 +15,11 @@ Usage:
15
15
  datanotes store backup --database <folder> show or set the store's git backup (--remote <url>, --off)
16
16
  datanotes store restore --from <url> --database <folder> restore the store from its git backup
17
17
  datanotes store convert-log --to <files|segments> --database <folder> rewrite the transaction log in that format
18
+ datanotes extension install <source> --database <folder> install an extension: plan, confirm, write
19
+ (a git URL with #<tag>, owner/repo@<tag>, or a folder)
20
+ datanotes extension update | rollback | remove <name> --database <folder> change an installed one
21
+ datanotes extension list --database <folder> the installed extensions
22
+ datanotes extension check <folder> check an extension's repository (for its authors)
18
23
  Every command takes --vault <folder> instead of --database for a vault holding the database.
19
24
  datanotes mcp --database <folder> MCP server over stdio, on the engine running on the folder
20
25
  (or one it starts for the session)
@@ -103,6 +108,27 @@ Options of store:
103
108
  ~/.local/share/datanotes (Linux); DATANOTES_DATA_HOME moves it.
104
109
 
105
110
 
111
+ Options of extension (every command but check works through the engine running on the database):
112
+ --database <folder> the database folder (or DATANOTES_DATABASE; --vault <folder> for a vault)
113
+ --store <folder> the engine's store, when serve was given one (or DATANOTES_STORE)
114
+ --settings <file> settings file with the owner's token (or DATANOTES_SETTINGS;
115
+ default settings.json in the store)
116
+ --url <url> an engine at an address (or DATANOTES_URL), with
117
+ --token-file <file> a file holding the owner's token (or DATANOTES_TOKEN_FILE)
118
+ --map <list> install, update: role=catalog.schema.table or role.column=column
119
+ --create <roles> install, update: create these tables the extension depends on
120
+ --add <list> install, update: add these role.column columns to matched tables
121
+ --catalog <name> install: the catalog of the tables and views it creates
122
+ --schema <name> install: the schema of the tables and views it creates
123
+ --to <ref> update: the version tag or commit to move to (default: the newest tag)
124
+ --from <source> update: another source, such as the folder you develop in
125
+ --dry-run install, update: print the plan and write nothing
126
+ --yes write without asking (only once the user approved the plan)
127
+ --json print one JSON object (the plan or the result) and never ask
128
+ Lists (--map, --create, --add) are comma-separated. Exit codes: 0 done; 1 error; 2 the plan has
129
+ problems (nothing written); 3 confirmation needed (run again with --yes once the user approved)
130
+
131
+
106
132
  Options of mcp (stdio):
107
133
  --database <folder> the database folder (or DATANOTES_DATABASE); acts with the owner's token,
108
134
  and stops the engine it started when the client closes
@@ -128,6 +154,11 @@ Tools of mcp (both modes; default: every tool except create_webhook and delete_w
128
154
  (or DATANOTES_MCP_OWNER_TOOLS=1)
129
155
 
130
156
 
157
+ Extensions of mcp (both modes): the tools of the extensions installed in the database (datanotes
158
+ extension install) come after the engine's tools; --profile read keeps only their read-only tools
159
+ --no-extensions offer no extension tools (or DATANOTES_MCP_EXTENSIONS=0)
160
+
161
+
131
162
  Logs of mcp (both modes):
132
163
  --otlp-endpoint <url> export logs over OTLP/HTTP, e.g. http://127.0.0.1:4318 (or the standard
133
164
  OTEL_EXPORTER_OTLP_ENDPOINT, OTEL_EXPORTER_OTLP_HEADERS, OTEL_SERVICE_NAME)
@@ -64,6 +64,10 @@ A UUID at the top of `metastore.yaml`, as `id`, that names the database. The eng
64
64
 
65
65
  The process that runs a vault as a database, `datanotes serve`. It checks and journals every write and serves the HTTP API. See [Run the engine as a service](https://datanotes.dev/administration/run-the-service/).
66
66
 
67
+ ## Extension
68
+
69
+ A git repository that adds tables, views, bases, MCP tools and docs to a database. `datanotes extension install` pins and installs it. See [Install extensions](https://datanotes.dev/administration/extensions/).
70
+
67
71
  ## Front matter
68
72
 
69
73
  The YAML block at the top of a note, between two `---` lines. Each key of a row’s front matter holds the value of one column. See [How it works](https://datanotes.dev/start/how-it-works/).
@@ -112,6 +116,10 @@ A call the engine runs, such as `create_table`, `insert_row` or `select_rows`. E
112
116
 
113
117
  The token that can do everything, generated at the engine’s first start and kept in its settings file. See [Tokens and permissions](https://datanotes.dev/guides/security/tokens/).
114
118
 
119
+ ## Role (extension)
120
+
121
+ The short name an extension’s manifest gives a table, such as `book`. The installer binds each role to a table of your database. See [Declare the tables](https://datanotes.dev/develop/write-an-extension/#declare-the-tables).
122
+
115
123
  ## Row
116
124
 
117
125
  A note whose front matter key `table` names a table, wherever it lives in the vault. Its front matter keys are the row’s columns. Each row has an `id` that never changes. See [Tables](https://datanotes.dev/guides/database-objects/tables/).
@@ -68,7 +68,7 @@ Examples: [Catalogs, schemas and the database](https://datanotes.dev/guides/data
68
68
 
69
69
  Validate every row against the table (required, types, ranges, enums, links, unknown columns, CHECK constraints, those that follow links included, filtered link targets (ref_where / ref_by), stale generated/identity values, missing inverse links, cycles of hierarchy and acyclic columns, front matter that cannot be read: code `unreadable`, with no column, for a note whose `table` line names the table but whose YAML is broken, which every other read leaves out). A CHECK violation has code `check` and the CHECK’s name as `constraint` (every other code names its `column`), as in the `violations` of list_changes. Use it to find rows edited by hand that break the schema. Without `table`, every table is checked: each row then names its `table`, `tables_checked` counts the tables checked, and a table that cannot be checked is listed in `errors` ({table, error}) while the others are. The rows with violations are paged: `limit` (default 500, at most 5000) from `offset`; `total` counts them all. (Hand edits are also checked as they happen: see `violations` in list_changes.)
70
70
 
71
- Examples: [Relations and hierarchies](https://datanotes.dev/guides/database-objects/relations/), [Hand edits](https://datanotes.dev/guides/data-quality/hand-edits/), [Find rows that break the schema](https://datanotes.dev/guides/data-quality/check-table/).
71
+ Examples: [Tables](https://datanotes.dev/guides/database-objects/tables/), [Relations and hierarchies](https://datanotes.dev/guides/database-objects/relations/), [Hand edits](https://datanotes.dev/guides/data-quality/hand-edits/), [Find rows that break the schema](https://datanotes.dev/guides/data-quality/check-table/).
72
72
 
73
73
  | Parameter | Type | Required | Default | Description |
74
74
  | --------- | --------- | -------- | ------- | -------------------------------------------- |
@@ -34,7 +34,7 @@ Update exactly ONE row, addressed by its `id` (the system UUID) or its `path`; r
34
34
  * `expect`: compare-and-set — `{"status": "open"}` writes only if the row still has those values (a person may have changed it since you read it); otherwise refused, nothing written.
35
35
  * `autolink`: the text written links the notes it mentions by name, at their first mention (off with `autolink: false` or the database’s setting). `links_added` lists the links made; `ambiguous_mentions` the mentions left as text with the notes they may name: read those, then link the right one with update_row and `autolink: false`, or leave the text.
36
36
 
37
- Examples: [Columns and types](https://datanotes.dev/guides/database-objects/columns/), [Bases](https://datanotes.dev/guides/database-objects/bases/), [Relations and hierarchies](https://datanotes.dev/guides/database-objects/relations/), [CHECK constraints](https://datanotes.dev/guides/data-quality/check-constraints/), [Hand edits](https://datanotes.dev/guides/data-quality/hand-edits/), [Write and move rows](https://datanotes.dev/guides/read-and-write/write-rows/), [Automatic links](https://datanotes.dev/guides/read-and-write/automatic-links/), [Batch writes](https://datanotes.dev/guides/read-and-write/batch/), [Journal and undo](https://datanotes.dev/guides/history/journal-and-undo/), [Table history and time travel](https://datanotes.dev/guides/history/table-history/), [Change data feed](https://datanotes.dev/guides/history/change-data-feed/), [Restore a table or the database](https://datanotes.dev/guides/history/restore/).
37
+ Examples: [Tables](https://datanotes.dev/guides/database-objects/tables/), [Columns and types](https://datanotes.dev/guides/database-objects/columns/), [Bases](https://datanotes.dev/guides/database-objects/bases/), [Relations and hierarchies](https://datanotes.dev/guides/database-objects/relations/), [CHECK constraints](https://datanotes.dev/guides/data-quality/check-constraints/), [Hand edits](https://datanotes.dev/guides/data-quality/hand-edits/), [Write and move rows](https://datanotes.dev/guides/read-and-write/write-rows/), [Automatic links](https://datanotes.dev/guides/read-and-write/automatic-links/), [Batch writes](https://datanotes.dev/guides/read-and-write/batch/), [Journal and undo](https://datanotes.dev/guides/history/journal-and-undo/), [Table history and time travel](https://datanotes.dev/guides/history/table-history/), [Change data feed](https://datanotes.dev/guides/history/change-data-feed/), [Restore a table or the database](https://datanotes.dev/guides/history/restore/).
38
38
 
39
39
  | Parameter | Type | Required | Default | Description |
40
40
  | --------------- | ------------ | -------- | ------- | ----------- |
@@ -65,7 +65,7 @@ Examples: [Tables](https://datanotes.dev/guides/database-objects/tables/).
65
65
 
66
66
  **Alter Table** · destructive write
67
67
 
68
- Alter a table: move it (`catalog`, `schema`), rename it (`name`), change `partition` / `filename` patterns, `description` (changes, never goes: “” is refused), `aliases`, `exclude` folders, `row_template` (“” removes it), `instructions` (how to fill a row, for agents; “” removes them), `history` (true | false | “default”), `autolink_target` (true | false | “default”: may automatic links link its rows? default: yes, unless its rows are named by a date or a time) or `tags` (key/value labels merged into the table’s, e.g. `{"domain": "health"}`; a `null` value removes that tag; `clear_tags: true` removes every tag first, so with `tags` the table keeps exactly those), `archive` (folder name inside the table folder) or `fields` (untyped fields, name → default; a `null` value removes one). Rows, archive and transaction log follow; links are updated; renamed rows keep their old name in `aliases`. A change of metadata only (tags, description, aliases, history, autolink_target, row_template, instructions, fields) rewrites the table entry alone: no row is moved or rewritten. Refused when a row cannot fill a pattern. Renaming or moving the table is refused while a CHECK that follows links, or a `ref_where` / `ref_by`, of another table reads it through a link (link targets are not rewritten): the conflicts name them. Use `dry_run` to see `planned_moves`; undo with undo_migration.
68
+ Alter a table: move it (`catalog`, `schema`), rename it (`name`), change `partition` / `filename` patterns, `description` (changes, never goes: “” is refused), `aliases`, `exclude` folders, `row_template` (“” removes it), `instructions` (how to fill a row, for agents; “” removes them), `history` (true | false | “default”), `autolink_target` (true | false | “default”: may automatic links link its rows? default: yes, unless its rows are named by a date or a time) or `tags` (key/value labels merged into the table’s, e.g. `{"domain": "health"}`; a `null` value removes that tag; `clear_tags: true` removes every tag first, so with `tags` the table keeps exactly those), `archive` (folder name inside the table folder) or `fields` (untyped fields, name → default; a `null` value removes one). Rows, archive and transaction log follow; links are updated; renamed rows keep their old name in `aliases`. A change of metadata only (tags, description, aliases, history, autolink_target, row_template, instructions, fields) rewrites the table entry alone: no row is moved or rewritten. Refused when a row cannot fill a pattern. Renaming or moving the table rewrites what names it in other definitions: the `ref` and `vocabulary` of the columns of other tables and bases (lists of links included) and the tables of views (`table`, `union[].table`, `join.table`); `schema_references` lists them. CHECKs and `ref_where` / `ref_by` that read it through a link follow the new `ref`. Use `dry_run` to see `planned_moves`; undo with undo_migration.
69
69
 
70
70
  The schema changes only through operations like this one: never edit metastore.yaml by hand (no validation, no undo).
71
71
 
@@ -119,7 +119,7 @@ Add a typed column. Sparse by default (written only on rows that have a value
119
119
 
120
120
  The schema changes only through operations like this one: never edit metastore.yaml by hand (no validation, no undo).
121
121
 
122
- Examples: [Columns and types](https://datanotes.dev/guides/database-objects/columns/), [Relations and hierarchies](https://datanotes.dev/guides/database-objects/relations/), [Import existing notes](https://datanotes.dev/guides/read-and-write/import-notes/).
122
+ Examples: [Tables](https://datanotes.dev/guides/database-objects/tables/), [Columns and types](https://datanotes.dev/guides/database-objects/columns/), [Relations and hierarchies](https://datanotes.dev/guides/database-objects/relations/), [Import existing notes](https://datanotes.dev/guides/read-and-write/import-notes/).
123
123
 
124
124
  | Parameter | Type | Required | Default | Description |
125
125
  | --------- | ------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------- |
@@ -290,7 +290,7 @@ Create (or `replace`) a view: a named select stored in metastore.yaml. Name it w
290
290
 
291
291
  The schema changes only through operations like this one: never edit metastore.yaml by hand (no validation, no undo).
292
292
 
293
- Examples: [Views](https://datanotes.dev/guides/database-objects/views/).
293
+ Examples: [Tables](https://datanotes.dev/guides/database-objects/tables/), [Views](https://datanotes.dev/guides/database-objects/views/).
294
294
 
295
295
  | Parameter | Type | Required | Default | Description |
296
296
  | ------------- | ------------ | -------- | ------- | ----------- |