datanotes 3.0.0 → 3.2.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.
- package/README.md +1 -5
- package/dist/api/client.d.cts +37 -4
- package/dist/api/client.d.ts +37 -4
- package/dist/api/index.cjs +563 -60
- package/dist/api/index.d.cts +3 -2
- package/dist/api/index.d.ts +3 -2
- package/dist/api/index.js +563 -60
- package/dist/api/mcp.cjs +181 -11
- package/dist/api/mcp.js +181 -11
- package/dist/api/otlp.d.cts +63 -15
- package/dist/api/otlp.d.ts +63 -15
- package/dist/api/redact.d.cts +25 -0
- package/dist/api/redact.d.ts +25 -0
- package/dist/api/tokens.d.cts +5 -0
- package/dist/api/tokens.d.ts +5 -0
- package/dist/api/tracing.d.cts +107 -0
- package/dist/api/tracing.d.ts +107 -0
- package/dist/datanotes.cjs +9934 -2656
- package/dist/docs/administration/limits.md +96 -12
- package/dist/docs/administration/run-the-service.md +18 -0
- package/dist/docs/api/operations/add_column.md +1 -0
- package/dist/docs/api/operations/add_constraint.md +2 -0
- package/dist/docs/api/operations/alter_column.md +1 -1
- package/dist/docs/api/operations/alter_table.md +3 -2
- package/dist/docs/api/operations/check_table.md +1 -1
- package/dist/docs/api/operations/create_table.md +3 -1
- package/dist/docs/api/operations/describe_table.md +1 -1
- package/dist/docs/api/operations/graph_neighbors.md +4 -2
- package/dist/docs/api/operations/graph_path.md +3 -3
- package/dist/docs/api/operations/graph_traverse.md +2 -2
- package/dist/docs/api/operations/insert_row.md +2 -2
- package/dist/docs/api/operations/record_tool_call.md +1 -0
- package/dist/docs/api/operations/tags/queries.md +2 -2
- package/dist/docs/api/operations/tags/rows-dml.md +1 -1
- package/dist/docs/api.md +4 -4
- package/dist/docs/develop/concurrency.md +36 -1
- package/dist/docs/develop/http-api.md +11 -1
- package/dist/docs/develop/telemetry.md +224 -25
- package/dist/docs/guides/data-quality/check-constraints.md +14 -13
- package/dist/docs/guides/data-quality/hand-edits.md +10 -10
- package/dist/docs/guides/database-objects/bases.md +11 -11
- package/dist/docs/guides/database-objects/catalogs-and-schemas.md +16 -10
- package/dist/docs/guides/database-objects/columns.md +38 -38
- package/dist/docs/guides/database-objects/relations.md +173 -36
- package/dist/docs/guides/database-objects/tables.md +90 -109
- package/dist/docs/guides/database-objects/views.md +44 -44
- package/dist/docs/guides/history/back-up.md +12 -4
- package/dist/docs/guides/history/change-data-feed.md +34 -34
- package/dist/docs/guides/history/journal-and-undo.md +12 -12
- package/dist/docs/guides/history/restore.md +20 -20
- package/dist/docs/guides/history/table-history.md +31 -31
- package/dist/docs/guides/history/vacuum.md +1 -10
- package/dist/docs/guides/read-and-write/automatic-links.md +15 -15
- package/dist/docs/guides/read-and-write/import-notes.md +21 -21
- package/dist/docs/guides/read-and-write/joins-and-aggregates.md +7 -7
- package/dist/docs/guides/read-and-write/read-and-filter.md +10 -10
- package/dist/docs/guides/read-and-write/write-rows.md +10 -10
- package/dist/docs/guides/search/link-graph.md +95 -0
- package/dist/docs/guides/search/text.md +1 -1
- package/dist/docs/guides/security/who-did-what.md +2 -0
- package/dist/docs/reference/cli.md +10 -3
- package/dist/docs/reference/compatibility.md +33 -13
- package/dist/docs/reference/errors.md +1 -1
- package/dist/docs/reference/operations/auxiliary.md +2 -2
- package/dist/docs/reference/operations/queries.md +3 -3
- package/dist/docs/reference/operations/rows.md +1 -1
- package/dist/docs/reference/operations/schema.md +15 -11
- package/dist/docs/reference/operations.md +39 -39
- package/dist/docs/reference/settings.md +37 -25
- package/dist/docs/release-notes.md +145 -0
- package/dist/docs/start/how-it-works.md +35 -3
- package/dist/docs/start/quick-start.md +2 -0
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -25,7 +25,7 @@ Datanotes keeps every row as a file, so it isn't a replacement for SQLite or Pos
|
|
|
25
25
|
- High write throughput
|
|
26
26
|
- Many concurrent writers on one folder
|
|
27
27
|
|
|
28
|
-
Datanotes is comfortable at 10,000 notes. At 50,000 notes, the engine takes
|
|
28
|
+
Datanotes is comfortable at 10,000 notes. At 50,000 notes, the engine takes about 15 seconds for its first start, and 2 to 3 seconds to restart.
|
|
29
29
|
|
|
30
30
|
## Quick start
|
|
31
31
|
|
|
@@ -214,10 +214,6 @@ console.log(films.value);
|
|
|
214
214
|
|
|
215
215
|
Each film is now a note, `main/public/film/Nosferatu.md`, with the values in its front matter. The [JavaScript client](https://datanotes.dev/develop/client/) page covers the rest of the client.
|
|
216
216
|
|
|
217
|
-
## Stability: Datanotes 3 stays 3
|
|
218
|
-
|
|
219
|
-
Every 3.x version adds to what you use and never takes it away. Operations, arguments, answer fields, routes, commands and settings keep working the same way. [Compatibility](https://datanotes.dev/reference/compatibility/) explains the promise and how the tests enforce it.
|
|
220
|
-
|
|
221
217
|
## Learn more
|
|
222
218
|
|
|
223
219
|
- [Documentation](https://datanotes.dev)
|
package/dist/api/client.d.cts
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { type OperationResult } from "./results.cjs";
|
|
7
7
|
import { type Guidance } from "./guidance.cjs";
|
|
8
|
+
import { type TraceContext, type Tracer } from "./tracing.cjs";
|
|
8
9
|
export interface HttpRequest {
|
|
9
10
|
url: string;
|
|
10
11
|
method: "GET" | "POST";
|
|
@@ -45,7 +46,17 @@ export interface ClientOptions {
|
|
|
45
46
|
/** Recorded with every write unless a call names another actor. */
|
|
46
47
|
actor?: ActorInfo;
|
|
47
48
|
transport?: Transport;
|
|
49
|
+
/**
|
|
50
|
+
* The trace the requests continue (W3C Trace Context): a context, a `traceparent` header, or a
|
|
51
|
+
* function that returns the current one. Sent as `traceparent` (and `tracestate`), so the
|
|
52
|
+
* engine's spans join the caller's trace.
|
|
53
|
+
*/
|
|
54
|
+
trace?: TraceParent | (() => TraceParent | undefined);
|
|
55
|
+
/** Make a CLIENT span for each request (child of `trace`), and send that span as the parent. */
|
|
56
|
+
tracer?: Tracer;
|
|
48
57
|
}
|
|
58
|
+
/** Where a request sits in a trace: a context, or a `traceparent` header value. */
|
|
59
|
+
export type TraceParent = TraceContext | string;
|
|
49
60
|
/** One tool call by an agent (an engine operation, or a tool of the MCP server's own), for the engine's change feed. */
|
|
50
61
|
export interface ToolCallRecord {
|
|
51
62
|
tool: string;
|
|
@@ -58,6 +69,17 @@ export interface ToolCallRecord {
|
|
|
58
69
|
session?: string;
|
|
59
70
|
result_chars?: number;
|
|
60
71
|
result_tokens?: number;
|
|
72
|
+
/**
|
|
73
|
+
* The result's summary, when `value` is sent already cut (redact.ts `cutToolCall`): an engine
|
|
74
|
+
* that answers `takes_summary: true` records it.
|
|
75
|
+
*/
|
|
76
|
+
summary?: Record<string, unknown>;
|
|
77
|
+
}
|
|
78
|
+
/** What the engine answers a recorded tool call. */
|
|
79
|
+
export interface RecordedToolCall {
|
|
80
|
+
ok: boolean;
|
|
81
|
+
/** The engine records a `value` sent cut with its `summary` (engines before 3.1 leave it out). */
|
|
82
|
+
takes_summary?: boolean;
|
|
61
83
|
}
|
|
62
84
|
export declare const fetchTransport: Transport;
|
|
63
85
|
export declare class DatanotesClient {
|
|
@@ -65,10 +87,16 @@ export declare class DatanotesClient {
|
|
|
65
87
|
readonly url: string;
|
|
66
88
|
private readonly send;
|
|
67
89
|
constructor(o: ClientOptions);
|
|
68
|
-
/**
|
|
90
|
+
/** The parent of a request: the call's own `trace`, else the client's. */
|
|
91
|
+
private parentOf;
|
|
92
|
+
/**
|
|
93
|
+
* Send a request; the answer's status, its JSON (when it is JSON) and its text. `trace`: the
|
|
94
|
+
* trace this request continues (over the client's `trace` option).
|
|
95
|
+
*/
|
|
69
96
|
request(method: "GET" | "POST", path: string, body?: unknown, opts?: {
|
|
70
97
|
actor?: ActorInfo;
|
|
71
98
|
accept?: string;
|
|
99
|
+
trace?: TraceParent;
|
|
72
100
|
}): Promise<{
|
|
73
101
|
status: number;
|
|
74
102
|
json: unknown;
|
|
@@ -81,9 +109,14 @@ export declare class DatanotesClient {
|
|
|
81
109
|
* Arguments the operation does not take, or of the wrong type, are refused before anything is sent,
|
|
82
110
|
* with the same message the engine gives.
|
|
83
111
|
*/
|
|
84
|
-
call(name: string, args?: Record<string, unknown>, actor?: ActorInfo
|
|
112
|
+
call(name: string, args?: Record<string, unknown>, actor?: ActorInfo, options?: {
|
|
113
|
+
trace?: TraceParent;
|
|
114
|
+
}): Promise<OperationResult>;
|
|
85
115
|
/** True when the engine answers `GET /` (no token needed). */
|
|
86
116
|
ping(): Promise<boolean>;
|
|
87
|
-
/**
|
|
88
|
-
|
|
117
|
+
/**
|
|
118
|
+
* Record an agent's tool call in the change feed (what MCP servers report). Answers what the
|
|
119
|
+
* engine said: `takes_summary` when it records a `value` sent cut with its `summary`.
|
|
120
|
+
*/
|
|
121
|
+
recordToolCall(call: ToolCallRecord, actor?: ActorInfo): Promise<RecordedToolCall>;
|
|
89
122
|
}
|
package/dist/api/client.d.ts
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { type OperationResult } from "./results.js";
|
|
7
7
|
import { type Guidance } from "./guidance.js";
|
|
8
|
+
import { type TraceContext, type Tracer } from "./tracing.js";
|
|
8
9
|
export interface HttpRequest {
|
|
9
10
|
url: string;
|
|
10
11
|
method: "GET" | "POST";
|
|
@@ -45,7 +46,17 @@ export interface ClientOptions {
|
|
|
45
46
|
/** Recorded with every write unless a call names another actor. */
|
|
46
47
|
actor?: ActorInfo;
|
|
47
48
|
transport?: Transport;
|
|
49
|
+
/**
|
|
50
|
+
* The trace the requests continue (W3C Trace Context): a context, a `traceparent` header, or a
|
|
51
|
+
* function that returns the current one. Sent as `traceparent` (and `tracestate`), so the
|
|
52
|
+
* engine's spans join the caller's trace.
|
|
53
|
+
*/
|
|
54
|
+
trace?: TraceParent | (() => TraceParent | undefined);
|
|
55
|
+
/** Make a CLIENT span for each request (child of `trace`), and send that span as the parent. */
|
|
56
|
+
tracer?: Tracer;
|
|
48
57
|
}
|
|
58
|
+
/** Where a request sits in a trace: a context, or a `traceparent` header value. */
|
|
59
|
+
export type TraceParent = TraceContext | string;
|
|
49
60
|
/** One tool call by an agent (an engine operation, or a tool of the MCP server's own), for the engine's change feed. */
|
|
50
61
|
export interface ToolCallRecord {
|
|
51
62
|
tool: string;
|
|
@@ -58,6 +69,17 @@ export interface ToolCallRecord {
|
|
|
58
69
|
session?: string;
|
|
59
70
|
result_chars?: number;
|
|
60
71
|
result_tokens?: number;
|
|
72
|
+
/**
|
|
73
|
+
* The result's summary, when `value` is sent already cut (redact.ts `cutToolCall`): an engine
|
|
74
|
+
* that answers `takes_summary: true` records it.
|
|
75
|
+
*/
|
|
76
|
+
summary?: Record<string, unknown>;
|
|
77
|
+
}
|
|
78
|
+
/** What the engine answers a recorded tool call. */
|
|
79
|
+
export interface RecordedToolCall {
|
|
80
|
+
ok: boolean;
|
|
81
|
+
/** The engine records a `value` sent cut with its `summary` (engines before 3.1 leave it out). */
|
|
82
|
+
takes_summary?: boolean;
|
|
61
83
|
}
|
|
62
84
|
export declare const fetchTransport: Transport;
|
|
63
85
|
export declare class DatanotesClient {
|
|
@@ -65,10 +87,16 @@ export declare class DatanotesClient {
|
|
|
65
87
|
readonly url: string;
|
|
66
88
|
private readonly send;
|
|
67
89
|
constructor(o: ClientOptions);
|
|
68
|
-
/**
|
|
90
|
+
/** The parent of a request: the call's own `trace`, else the client's. */
|
|
91
|
+
private parentOf;
|
|
92
|
+
/**
|
|
93
|
+
* Send a request; the answer's status, its JSON (when it is JSON) and its text. `trace`: the
|
|
94
|
+
* trace this request continues (over the client's `trace` option).
|
|
95
|
+
*/
|
|
69
96
|
request(method: "GET" | "POST", path: string, body?: unknown, opts?: {
|
|
70
97
|
actor?: ActorInfo;
|
|
71
98
|
accept?: string;
|
|
99
|
+
trace?: TraceParent;
|
|
72
100
|
}): Promise<{
|
|
73
101
|
status: number;
|
|
74
102
|
json: unknown;
|
|
@@ -81,9 +109,14 @@ export declare class DatanotesClient {
|
|
|
81
109
|
* Arguments the operation does not take, or of the wrong type, are refused before anything is sent,
|
|
82
110
|
* with the same message the engine gives.
|
|
83
111
|
*/
|
|
84
|
-
call(name: string, args?: Record<string, unknown>, actor?: ActorInfo
|
|
112
|
+
call(name: string, args?: Record<string, unknown>, actor?: ActorInfo, options?: {
|
|
113
|
+
trace?: TraceParent;
|
|
114
|
+
}): Promise<OperationResult>;
|
|
85
115
|
/** True when the engine answers `GET /` (no token needed). */
|
|
86
116
|
ping(): Promise<boolean>;
|
|
87
|
-
/**
|
|
88
|
-
|
|
117
|
+
/**
|
|
118
|
+
* Record an agent's tool call in the change feed (what MCP servers report). Answers what the
|
|
119
|
+
* engine said: `takes_summary` when it records a `value` sent cut with its `summary`.
|
|
120
|
+
*/
|
|
121
|
+
recordToolCall(call: ToolCallRecord, actor?: ActorInfo): Promise<RecordedToolCall>;
|
|
89
122
|
}
|