datanotes 3.3.0 → 3.4.0

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 (72) hide show
  1. package/SECURITY.md +5 -3
  2. package/dist/api/extensions.cjs +1345 -21
  3. package/dist/api/extensions.js +1345 -21
  4. package/dist/api/index.cjs +1345 -21
  5. package/dist/api/index.js +1345 -21
  6. package/dist/api/mcp.cjs +1345 -21
  7. package/dist/api/mcp.js +1345 -21
  8. package/dist/datanotes.cjs +2927 -609
  9. package/dist/docs/administration/extensions.md +2 -2
  10. package/dist/docs/api/operations/add_column.md +1 -0
  11. package/dist/docs/api/operations/alter_table.md +4 -3
  12. package/dist/docs/api/operations/check_table.md +1 -0
  13. package/dist/docs/api/operations/create_table.md +1 -0
  14. package/dist/docs/api/operations/describe_database.md +2 -0
  15. package/dist/docs/api/operations/describe_history.md +1 -0
  16. package/dist/docs/api/operations/describe_semantic_index.md +1 -0
  17. package/dist/docs/api/operations/describe_table.md +1 -0
  18. package/dist/docs/api/operations/graph_neighbors.md +1 -0
  19. package/dist/docs/api/operations/graph_path.md +1 -0
  20. package/dist/docs/api/operations/graph_traverse.md +1 -0
  21. package/dist/docs/api/operations/infer_table.md +1 -0
  22. package/dist/docs/api/operations/list_changes.md +1 -0
  23. package/dist/docs/api/operations/list_folder.md +1 -0
  24. package/dist/docs/api/operations/list_link_targets.md +1 -0
  25. package/dist/docs/api/operations/list_migrations.md +1 -0
  26. package/dist/docs/api/operations/list_tables.md +2 -0
  27. package/dist/docs/api/operations/list_webhooks.md +1 -0
  28. package/dist/docs/api/operations/read_note.md +1 -0
  29. package/dist/docs/api/operations/search.md +39 -0
  30. package/dist/docs/api/operations/search_notes.md +1 -0
  31. package/dist/docs/api/operations/select_rows.md +1 -0
  32. package/dist/docs/api/operations/semantic_search.md +1 -0
  33. package/dist/docs/api/operations/table_changes.md +1 -0
  34. package/dist/docs/api/operations/tags/queries.md +1 -0
  35. package/dist/docs/api/operations/tags/tokens.md +1 -1
  36. package/dist/docs/api/operations/tokens_create.md +1 -0
  37. package/dist/docs/api/operations/tokens_update.md +2 -1
  38. package/dist/docs/api.md +5 -4
  39. package/dist/docs/develop/build-an-app.md +2 -1
  40. package/dist/docs/develop/change-feed-and-webhooks.md +1 -1
  41. package/dist/docs/develop/http-api.md +1 -1
  42. package/dist/docs/guides/data-quality/check-constraints.md +10 -10
  43. package/dist/docs/guides/data-quality/hand-edits.md +8 -8
  44. package/dist/docs/guides/database-objects/bases.md +11 -11
  45. package/dist/docs/guides/database-objects/catalogs-and-schemas.md +30 -10
  46. package/dist/docs/guides/database-objects/columns.md +243 -40
  47. package/dist/docs/guides/database-objects/relations.md +28 -28
  48. package/dist/docs/guides/database-objects/tables.md +167 -43
  49. package/dist/docs/guides/database-objects/views.md +44 -44
  50. package/dist/docs/guides/history/change-data-feed.md +34 -34
  51. package/dist/docs/guides/history/journal-and-undo.md +12 -12
  52. package/dist/docs/guides/history/restore.md +20 -20
  53. package/dist/docs/guides/history/table-history.md +31 -31
  54. package/dist/docs/guides/read-and-write/automatic-links.md +15 -15
  55. package/dist/docs/guides/read-and-write/import-notes.md +20 -20
  56. package/dist/docs/guides/read-and-write/joins-and-aggregates.md +7 -7
  57. package/dist/docs/guides/read-and-write/read-and-filter.md +10 -10
  58. package/dist/docs/guides/read-and-write/write-rows.md +10 -10
  59. package/dist/docs/guides/search/hybrid.md +162 -0
  60. package/dist/docs/guides/search/text.md +1 -1
  61. package/dist/docs/guides/security/security-model.md +5 -3
  62. package/dist/docs/guides/security/tokens.md +121 -8
  63. package/dist/docs/reference/cli.md +1 -1
  64. package/dist/docs/reference/glossary.md +1 -1
  65. package/dist/docs/reference/operations/auxiliary.md +3 -3
  66. package/dist/docs/reference/operations/queries.md +16 -0
  67. package/dist/docs/reference/operations/rows.md +1 -1
  68. package/dist/docs/reference/operations/schema.md +5 -5
  69. package/dist/docs/reference/operations.md +6 -5
  70. package/dist/docs/release-notes.md +59 -0
  71. package/dist/docs/start/connect-agents.md +10 -3
  72. package/package.json +1 -1
package/SECURITY.md CHANGED
@@ -58,13 +58,15 @@ The owner token is `httpServerToken` in the settings file. It can do everything:
58
58
 
59
59
  The owner creates a named token with `POST /datanotes/tokens/create/`, and the engine stores only its hash, in `tokens.json` in its store, outside the vault. A named token has these permissions:
60
60
 
61
- - **Read**: everything
61
+ - **Read**: only the tables in its `read` patterns; without `read`, every table
62
62
  - **Write rows**: only the tables in its `write` patterns
63
63
  - **Change the schema**: only with `ddl`
64
64
  - **Maintain**: with `maintain`, it may also undo, restore, vacuum, configure the database and rebuild the semantic index; use it for an agent’s own token
65
65
 
66
66
  A named token can’t create webhooks, manage tokens or read the engine’s status, and without `maintain` it can’t undo.
67
67
 
68
+ With `read` patterns, a token reads only the tables they match. It never reads the notes outside tables. Listings, search, the graph and the change feed leave out the rest. A query that names another table gets 403. A token always reads what it writes, and a token with `ddl` or `maintain` reads every table. Listings hide the other tables’ names. A refusal repeats a name the caller gave, so a guessed name isn’t secret. [Limit what a token can read](https://datanotes.dev/guides/security/tokens/#limit-what-a-token-can-read) lists the rules and the known gaps.
69
+
68
70
  ### Extensions
69
71
 
70
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.
@@ -75,7 +77,7 @@ An extension adds tables and Model Context Protocol (MCP) tools from a git repos
75
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.
76
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.
77
79
 
78
- 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.
80
+ Known limits: extension code is not isolated from the MCP server's process. The installer gives its token no `read`, so it reads every table. The owner may limit it with `read` patterns that cover the tables it writes. Migrations are declarative and run no code. [Install extensions](https://datanotes.dev/administration/extensions/) has the details.
79
81
 
80
82
  ### Who made each write
81
83
 
@@ -103,7 +105,7 @@ An agent reads your notes, and a note can hold text written to manipulate it: a
103
105
 
104
106
  Limit what each agent can do:
105
107
 
106
- - **Give it a named token**: grant only the tables it writes, and leave out `ddl` and `maintain` unless it needs them
108
+ - **Give it a named token**: grant only the tables it reads and writes, and leave out `ddl` and `maintain` unless it needs them
107
109
  - **Give it only the tools it needs**: start the MCP server with `datanotes mcp --profile`, `--tools` or `--except`
108
110
  - **Keep the webhook tools off**: they’re off by default, because a webhook sends change events to any URL
109
111