@telepath-computer/vault-server 0.4.2 → 0.5.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 +136 -83
- package/dist/src/cli.js +38 -20
- package/dist/src/cli.js.map +1 -1
- package/dist/src/notes.d.ts +12 -8
- package/dist/src/notes.js +76 -85
- package/dist/src/notes.js.map +1 -1
- package/dist/src/server.d.ts +42 -38
- package/dist/src/server.js +563 -411
- package/dist/src/server.js.map +1 -1
- package/package.json +6 -6
- package/skill/SKILL.md +116 -0
- package/dist/src/paths.d.ts +0 -8
- package/dist/src/paths.js +0 -44
- package/dist/src/paths.js.map +0 -1
package/dist/src/server.d.ts
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import { type RecordContent } from "./notes.ts";
|
|
1
|
+
import { type IncomingMessage } from "node:http";
|
|
2
|
+
import type { Duplex } from "node:stream";
|
|
3
|
+
import { FileServer, type ListenOptions } from "@telepath-computer/file-server";
|
|
4
|
+
import { type BodyFormat, type LinkFormat, type RecordContent } from "./notes.ts";
|
|
5
5
|
/** A record in the form it will be stored, offered for approval before it is written. */
|
|
6
6
|
export type ValidatedRecord = RecordContent & {
|
|
7
7
|
path: string;
|
|
8
8
|
};
|
|
9
9
|
export type Validate = (record: ValidatedRecord) => void | Promise<void>;
|
|
10
|
-
export type
|
|
11
|
-
export type BodyFormat = "markdown" | "raw";
|
|
10
|
+
export type { BodyFormat, LinkFormat, ListenOptions };
|
|
12
11
|
export type VaultServerOptions = {
|
|
13
12
|
root: string;
|
|
14
13
|
linkFormat?: LinkFormat;
|
|
@@ -17,48 +16,53 @@ export type VaultServerOptions = {
|
|
|
17
16
|
jsonLimit?: string | number;
|
|
18
17
|
pingIntervalMs?: number;
|
|
19
18
|
};
|
|
19
|
+
/** A file server with cached structured views for visible markdown files. */
|
|
20
20
|
export declare class VaultServer {
|
|
21
|
-
readonly app:
|
|
22
|
-
readonly server:
|
|
23
|
-
/** Resolves once the watcher has indexed the vault and the root is known good. */
|
|
21
|
+
readonly app: FileServer["app"];
|
|
22
|
+
readonly server: FileServer["server"];
|
|
24
23
|
readonly ready: Promise<void>;
|
|
25
|
-
private readonly
|
|
26
|
-
private readonly index;
|
|
24
|
+
private readonly files;
|
|
27
25
|
private readonly validate;
|
|
28
|
-
private readonly
|
|
29
|
-
private readonly
|
|
30
|
-
private readonly
|
|
31
|
-
private readonly
|
|
32
|
-
private readonly
|
|
33
|
-
private readonly
|
|
34
|
-
private
|
|
35
|
-
private
|
|
36
|
-
private
|
|
37
|
-
private
|
|
38
|
-
private
|
|
26
|
+
private readonly maximumJsonBytes;
|
|
27
|
+
private readonly activeChanges;
|
|
28
|
+
private readonly changesByPath;
|
|
29
|
+
private readonly bootstrapPathGenerations;
|
|
30
|
+
private readonly directories;
|
|
31
|
+
private readonly pathView;
|
|
32
|
+
private root;
|
|
33
|
+
private index;
|
|
34
|
+
private linkFormat;
|
|
35
|
+
private bodyFormat;
|
|
36
|
+
private resolveIndex;
|
|
37
|
+
private readonly indexAvailable;
|
|
38
|
+
private changeGeneration;
|
|
39
|
+
private bootstrapComplete;
|
|
39
40
|
constructor(options: VaultServerOptions);
|
|
40
|
-
/** The
|
|
41
|
+
/** The URL currently bound, or undefined before listening and after closing. */
|
|
41
42
|
get url(): string | undefined;
|
|
42
|
-
/** The port
|
|
43
|
+
/** The port currently bound, including an operating-system-selected port. */
|
|
43
44
|
get port(): number | undefined;
|
|
44
|
-
/** Every visible disk path currently held by the live index. */
|
|
45
|
+
/** Every visible regular-file disk path currently held by the live index. */
|
|
45
46
|
get paths(): Iterable<string>;
|
|
46
|
-
/** Replace runtime formatting settings, rebuilding data derived from bodies. */
|
|
47
|
+
/** Replace runtime formatting settings, rebuilding data derived from bodies synchronously. */
|
|
47
48
|
configure(options: {
|
|
48
49
|
linkFormat?: LinkFormat;
|
|
49
50
|
bodyFormat?: BodyFormat | ((path: string) => BodyFormat);
|
|
50
51
|
}): void;
|
|
51
|
-
/**
|
|
52
|
-
listen(options?:
|
|
53
|
-
|
|
54
|
-
port?: number;
|
|
55
|
-
}): Promise<this>;
|
|
52
|
+
/** Start accepting connections after the base watcher and record index are ready. */
|
|
53
|
+
listen(options?: ListenOptions): Promise<this>;
|
|
54
|
+
/** Release the embedded file server resources. */
|
|
56
55
|
close(): Promise<void>;
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
private
|
|
60
|
-
private
|
|
61
|
-
private
|
|
62
|
-
private
|
|
63
|
-
private
|
|
56
|
+
/** Delegate a mount-relative WebSocket upgrade after the record index is ready. */
|
|
57
|
+
handleUpgrade(request: IncomingMessage, socket: Duplex, head: Buffer, requestTarget?: string): Promise<void>;
|
|
58
|
+
private bootstrap;
|
|
59
|
+
private refreshTree;
|
|
60
|
+
private bootstrapGenerationFor;
|
|
61
|
+
private drainBootstrapChanges;
|
|
62
|
+
private handle;
|
|
63
|
+
private mutateRecord;
|
|
64
|
+
private approve;
|
|
65
|
+
private change;
|
|
66
|
+
private refreshChange;
|
|
67
|
+
private forgetDirectoryTree;
|
|
64
68
|
}
|