graphvault-studio 0.1.2

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 (42) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/CONTRIBUTING.md +27 -0
  3. package/LICENSE +21 -0
  4. package/README.md +119 -0
  5. package/assets/graphvault-logo.png +0 -0
  6. package/assets/studio-screenshot.png +0 -0
  7. package/dist/admin-cli.d.ts +12 -0
  8. package/dist/admin-cli.js +132 -0
  9. package/dist/admin-cli.js.map +1 -0
  10. package/dist/admin-client.d.ts +49 -0
  11. package/dist/admin-client.js +352 -0
  12. package/dist/admin-client.js.map +1 -0
  13. package/dist/admin-inspection.d.ts +4 -0
  14. package/dist/admin-inspection.js +70 -0
  15. package/dist/admin-inspection.js.map +1 -0
  16. package/dist/admin-mutation.d.ts +4 -0
  17. package/dist/admin-mutation.js +83 -0
  18. package/dist/admin-mutation.js.map +1 -0
  19. package/dist/admin-parent-index.d.ts +4 -0
  20. package/dist/admin-parent-index.js +72 -0
  21. package/dist/admin-parent-index.js.map +1 -0
  22. package/dist/admin-server.d.ts +14 -0
  23. package/dist/admin-server.js +132 -0
  24. package/dist/admin-server.js.map +1 -0
  25. package/dist/admin-types.d.ts +97 -0
  26. package/dist/admin-types.js +2 -0
  27. package/dist/admin-types.js.map +1 -0
  28. package/dist/admin-ui.d.ts +1 -0
  29. package/dist/admin-ui.js +886 -0
  30. package/dist/admin-ui.js.map +1 -0
  31. package/dist/admin.d.ts +4 -0
  32. package/dist/admin.js +3 -0
  33. package/dist/admin.js.map +1 -0
  34. package/dist/gvql-examples.d.ts +6 -0
  35. package/dist/gvql-examples.js +45 -0
  36. package/dist/gvql-examples.js.map +1 -0
  37. package/docs/GVQL.md +217 -0
  38. package/docs/PUBLISHING.md +46 -0
  39. package/docs/RELEASE_NOTES_0.1.0.md +41 -0
  40. package/docs/REMOTE_STORAGE.md +56 -0
  41. package/examples/create-demo-store.mjs +85 -0
  42. package/package.json +67 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,17 @@
1
+ # Changelog
2
+
3
+ ## 0.1.2
4
+
5
+ - Publish the Studio CLI under the unscoped `graphvault-studio` npm package name for a reliable `npx graphvault-studio` install path.
6
+
7
+ ## 0.1.1
8
+
9
+ - Patch npm package metadata so the `graphvault-studio` CLI binary is preserved on publish.
10
+
11
+ ## 0.1.0
12
+
13
+ - Initial GraphVault Studio package.
14
+ - Embedded graphical admin client for GraphVault stores.
15
+ - Root hierarchy browser, parent path lookup, search, graph view, paged object listing, verification, backup, maintenance, transactions, and journal views.
16
+ - Controlled primitive-field editing with mutation preview and optional confirmation token.
17
+ - CLI and programmatic server startup.
@@ -0,0 +1,27 @@
1
+ # Contributing
2
+
3
+ Thanks for helping improve GraphVault Studio.
4
+
5
+ ## Local Development
6
+
7
+ ```bash
8
+ npm ci
9
+ npm test
10
+ ```
11
+
12
+ `npm test` builds the TypeScript sources and runs a smoke test against a generated GraphVault store. It verifies the admin client, search, store verification, and the embedded HTTP API.
13
+
14
+ ## Pull Request Checklist
15
+
16
+ - keep admin modules focused and avoid growing one large UI or server file unnecessarily
17
+ - preserve generic object graph wording rather than app-specific language
18
+ - check narrow and wide layouts when changing the embedded UI
19
+ - add or update a smoke test when API behavior changes
20
+ - run `npm test` before opening the PR
21
+
22
+ ## Release Checklist
23
+
24
+ 1. Update `CHANGELOG.md`.
25
+ 2. Run `npm test`.
26
+ 3. Run `npm run pack:dry-run` and inspect the packaged files.
27
+ 4. Publish with an npm account that owns `graphvault-studio`.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,119 @@
1
+ # GraphVault Studio
2
+
3
+ [![CI](https://github.com/Sprengmeister-dev/graphvault-studio/actions/workflows/ci.yml/badge.svg)](https://github.com/Sprengmeister-dev/graphvault-studio/actions/workflows/ci.yml)
4
+ ![Node](https://img.shields.io/badge/node-%3E%3D20-3c7a52)
5
+ ![TypeScript](https://img.shields.io/badge/TypeScript-first-315c92)
6
+ ![License](https://img.shields.io/badge/license-MIT-2f2f2f)
7
+
8
+ GraphVault Studio is the graphical admin client for [GraphVault](https://github.com/Sprengmeister-dev/graphvault-library) stores. It lets you inspect, search, verify, maintain, back up, and carefully edit object graph data without pretending the store is a table database.
9
+
10
+ ![GraphVault Studio screenshot](./assets/studio-screenshot.png)
11
+
12
+ ```bash
13
+ git clone https://github.com/Sprengmeister-dev/graphvault-studio.git
14
+ cd graphvault-studio
15
+ npm ci
16
+ npm run demo:store
17
+ npx graphvault-studio --dir ./graphvault-studio-demo-store --port 4177 --allow-mutations --confirm-token confirm
18
+ ```
19
+
20
+ Open `http://127.0.0.1:4177` and try the search, hierarchy, parent path, GVQL, verification, and editable-field flows against a real demo object graph.
21
+
22
+ ## Why Not Just Use A Normal Database Admin Tool?
23
+
24
+ Database admin tools are great when your data is records, rows, documents, or key-value entries. GraphVault stores a live object graph: a root object, nested structures, references, shared children, multiple parents, class metadata, transactions, manifests, and object records. A normal SQL or document browser cannot show that shape honestly.
25
+
26
+ Studio is useful when you need to answer questions like:
27
+
28
+ - what object is this reference pointing to?
29
+ - how do I get from this object back to the root?
30
+ - which parents directly reference this object?
31
+ - what did the latest transaction write?
32
+ - does the store verify cleanly?
33
+ - can I make a small controlled data correction without hand-writing field paths and JSON?
34
+
35
+ It is deliberately generic. It does not assume customers, orders, tickets, CMS pages, or any other application domain. It works with object paths, values, types, references, transactions, and graph relationships.
36
+
37
+ ## Features
38
+
39
+ - root-first hierarchy browser
40
+ - search across encoded paths and values
41
+ - parent path lookup from object to root
42
+ - support for objects with multiple direct parents
43
+ - paged object browser for large stores
44
+ - graph edge view
45
+ - GVQL query console for graph queries and batch-update previews
46
+ - editable primitive fields with preview and confirmation-token safety
47
+ - verification, maintenance, backup, transaction and journal views
48
+ - optional bearer-token protection
49
+ - zero frontend build step; the UI is embedded in the TypeScript package
50
+
51
+ ## Install
52
+
53
+ From npm:
54
+
55
+ ```bash
56
+ npm install graphvault-studio
57
+ ```
58
+
59
+ GraphVault Studio requires Node.js 20 or newer. The npm package is scoped, but the executable remains the short `graphvault-studio` command.
60
+
61
+ ## Run
62
+
63
+ ### Demo Store
64
+
65
+ Create a realistic demo store with shared owners, categories, document links, tags, dates, metrics, and multiple parent paths:
66
+
67
+ ```bash
68
+ npm run demo:store
69
+ npx graphvault-studio --dir ./graphvault-studio-demo-store --port 4177 --allow-mutations --confirm-token confirm
70
+ ```
71
+
72
+ ### File-Based Store
73
+
74
+ The CLI reads a local GraphVault storage directory. This is the common setup for a service, desktop app, or local development environment.
75
+
76
+ ```bash
77
+ npx graphvault-studio --dir ./data --port 4177
78
+ ```
79
+
80
+ Mutation APIs are opt-in:
81
+
82
+ ```bash
83
+ npx graphvault-studio \
84
+ --dir ./data \
85
+ --port 4177 \
86
+ --allow-mutations \
87
+ --confirm-token confirm
88
+ ```
89
+
90
+ Optional auth:
91
+
92
+ ```bash
93
+ GRAPHVAULT_ADMIN_TOKEN=secret npx graphvault-studio --dir ./data
94
+ ```
95
+
96
+ Then open:
97
+
98
+ ```text
99
+ http://127.0.0.1:4177
100
+ ```
101
+
102
+ ## Documentation
103
+
104
+ - [GVQL examples](./docs/GVQL.md) - ready-to-run query and mutation-preview examples for Studio.
105
+ - [Remote and custom storage](./docs/REMOTE_STORAGE.md) - programmatic server setup with HTTP, S3-compatible, SQL, or custom targets.
106
+ - [Release notes](./docs/RELEASE_NOTES_0.1.0.md) - package overview for the first public release.
107
+ - [Publishing checklist](./docs/PUBLISHING.md) - local release checks, tagging, npm provenance, and GitHub topics.
108
+
109
+ ## Relationship To GraphVault Library
110
+
111
+ The storage engine lives in [graphvault-library](https://github.com/Sprengmeister-dev/graphvault-library). Studio is intentionally separate so applications can depend on the lightweight persistence library without bundling an admin UI.
112
+
113
+ ## Developer Notes
114
+
115
+ - Studio is a pure TypeScript package with no frontend build toolchain.
116
+ - The UI is served from the embedded admin server, so `npx graphvault-studio --dir ./data` is enough to inspect a store.
117
+ - The package depends on GraphVault Library for storage layout, verification, parent index reading, and storage targets.
118
+ - Run `npm test` to type-check, emit `dist/`, create a real store, exercise the admin client, and verify the embedded HTTP API.
119
+ - CI runs on Node.js 20 and 22.
Binary file
Binary file
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+ export interface ParsedAdminCliArgs {
3
+ storageDirectory?: string;
4
+ host: string;
5
+ port: number;
6
+ allowMutations: boolean;
7
+ authToken?: string;
8
+ mutationConfirmToken?: string;
9
+ help: boolean;
10
+ }
11
+ export declare function parseAdminCliArgs(argv: readonly string[], env?: NodeJS.ProcessEnv): ParsedAdminCliArgs;
12
+ export declare function adminCliHelp(): string;
@@ -0,0 +1,132 @@
1
+ #!/usr/bin/env node
2
+ import { startAdminServer } from "./admin-server.js";
3
+ const DEFAULT_HOST = "127.0.0.1";
4
+ const DEFAULT_PORT = 4177;
5
+ export function parseAdminCliArgs(argv, env = process.env) {
6
+ const parsed = {
7
+ host: DEFAULT_HOST,
8
+ port: DEFAULT_PORT,
9
+ allowMutations: false,
10
+ help: false,
11
+ };
12
+ if (env["GRAPHVAULT_ADMIN_TOKEN"]) {
13
+ parsed.authToken = env["GRAPHVAULT_ADMIN_TOKEN"];
14
+ }
15
+ if (env["GRAPHVAULT_ADMIN_CONFIRM_TOKEN"]) {
16
+ parsed.mutationConfirmToken = env["GRAPHVAULT_ADMIN_CONFIRM_TOKEN"];
17
+ }
18
+ for (let index = 0; index < argv.length; index++) {
19
+ const arg = argv[index];
20
+ if (arg === "--help" || arg === "-h") {
21
+ parsed.help = true;
22
+ continue;
23
+ }
24
+ if (arg === "--allow-mutations") {
25
+ parsed.allowMutations = true;
26
+ continue;
27
+ }
28
+ if (arg === "--dir" || arg === "--storage-directory") {
29
+ parsed.storageDirectory = readValue(argv, ++index, arg);
30
+ continue;
31
+ }
32
+ if (arg === "--host") {
33
+ parsed.host = readValue(argv, ++index, arg);
34
+ continue;
35
+ }
36
+ if (arg === "--port") {
37
+ parsed.port = parsePort(readValue(argv, ++index, arg));
38
+ continue;
39
+ }
40
+ if (arg === "--token" || arg === "--auth-token") {
41
+ parsed.authToken = readValue(argv, ++index, arg);
42
+ continue;
43
+ }
44
+ if (arg === "--confirm-token" || arg === "--mutation-confirm-token") {
45
+ parsed.mutationConfirmToken = readValue(argv, ++index, arg);
46
+ continue;
47
+ }
48
+ throw new Error(`Unknown option: ${arg}`);
49
+ }
50
+ return parsed;
51
+ }
52
+ export function adminCliHelp() {
53
+ return [
54
+ "Usage: graphvault-admin --dir <storage-directory> [options]",
55
+ "",
56
+ "Options:",
57
+ " --dir, --storage-directory <path> Storage directory to inspect.",
58
+ " --host <host> Host to bind. Defaults to 127.0.0.1.",
59
+ " --port <port> Port to bind. Defaults to 4177.",
60
+ " --token, --auth-token <token> Bearer token for UI/API access.",
61
+ " --confirm-token <token> Token required to commit mutations.",
62
+ " --allow-mutations Enable maintenance and data mutation APIs.",
63
+ " -h, --help Show this help.",
64
+ "",
65
+ "Environment:",
66
+ " GRAPHVAULT_ADMIN_TOKEN Default bearer token.",
67
+ " GRAPHVAULT_ADMIN_CONFIRM_TOKEN Default mutation confirmation token.",
68
+ ].join("\n");
69
+ }
70
+ async function main(argv) {
71
+ const options = parseAdminCliArgs(argv);
72
+ if (options.help) {
73
+ console.log(adminCliHelp());
74
+ return;
75
+ }
76
+ if (!options.storageDirectory) {
77
+ throw new Error("Missing required --dir <storage-directory> option.");
78
+ }
79
+ const serverOptions = {
80
+ storageDirectory: options.storageDirectory,
81
+ host: options.host,
82
+ port: options.port,
83
+ allowMutations: options.allowMutations,
84
+ };
85
+ const running = await startAdminServer({
86
+ ...serverOptions,
87
+ ...(options.authToken ? { authToken: options.authToken } : {}),
88
+ ...(options.mutationConfirmToken ? { mutationConfirmToken: options.mutationConfirmToken } : {}),
89
+ });
90
+ console.log(`GraphVault Studio: ${running.url}`);
91
+ console.log(`Storage directory: ${options.storageDirectory}`);
92
+ console.log(`Mutations: ${options.allowMutations ? "enabled" : "disabled"}`);
93
+ if (options.authToken) {
94
+ console.log("Auth: bearer token required");
95
+ }
96
+ if (options.mutationConfirmToken) {
97
+ console.log("Mutation confirmation: required");
98
+ }
99
+ let closing = false;
100
+ const close = () => {
101
+ if (closing) {
102
+ return;
103
+ }
104
+ closing = true;
105
+ void running.close().finally(() => process.exit(0));
106
+ };
107
+ process.once("SIGINT", close);
108
+ process.once("SIGTERM", close);
109
+ }
110
+ function readValue(argv, index, option) {
111
+ const value = argv[index];
112
+ if (!value || value.startsWith("-")) {
113
+ throw new Error(`Missing value for ${option}.`);
114
+ }
115
+ return value;
116
+ }
117
+ function parsePort(value) {
118
+ const port = Number(value);
119
+ if (!Number.isInteger(port) || port < 0 || port > 65535) {
120
+ throw new Error(`Invalid port: ${value}`);
121
+ }
122
+ return port;
123
+ }
124
+ if (import.meta.url === `file://${process.argv[1]}`) {
125
+ main(process.argv.slice(2)).catch((error) => {
126
+ console.error(error instanceof Error ? error.message : String(error));
127
+ console.error("");
128
+ console.error(adminCliHelp());
129
+ process.exit(1);
130
+ });
131
+ }
132
+ //# sourceMappingURL=admin-cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"admin-cli.js","sourceRoot":"","sources":["../src/admin-cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAYrD,MAAM,YAAY,GAAG,WAAW,CAAC;AACjC,MAAM,YAAY,GAAG,IAAI,CAAC;AAE1B,MAAM,UAAU,iBAAiB,CAAC,IAAuB,EAAE,MAAyB,OAAO,CAAC,GAAG;IAC7F,MAAM,MAAM,GAAuB;QACjC,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE,YAAY;QAClB,cAAc,EAAE,KAAK;QACrB,IAAI,EAAE,KAAK;KACZ,CAAC;IACF,IAAI,GAAG,CAAC,wBAAwB,CAAC,EAAE,CAAC;QAClC,MAAM,CAAC,SAAS,GAAG,GAAG,CAAC,wBAAwB,CAAC,CAAC;IACnD,CAAC;IACD,IAAI,GAAG,CAAC,gCAAgC,CAAC,EAAE,CAAC;QAC1C,MAAM,CAAC,oBAAoB,GAAG,GAAG,CAAC,gCAAgC,CAAC,CAAC;IACtE,CAAC;IAED,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC;QACjD,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC;QACxB,IAAI,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;YACrC,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC;YACnB,SAAS;QACX,CAAC;QACD,IAAI,GAAG,KAAK,mBAAmB,EAAE,CAAC;YAChC,MAAM,CAAC,cAAc,GAAG,IAAI,CAAC;YAC7B,SAAS;QACX,CAAC;QACD,IAAI,GAAG,KAAK,OAAO,IAAI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EAAE,CAAC;IACpD,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;QAC1C,OAAO,CAAC,KAAK,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QACtE,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAClB,OAAO,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC,CAAC;QAC9B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,49 @@
1
+ import type { BackupResult, MaintenanceResult, ObjectRecord, StorageTarget, TransactionRecord, TypeDictionary, VerificationResult } from "@sprengmeister/graphvault/internal/core/types";
2
+ import type { GvqlExecutionOptions, GvqlResult } from "@sprengmeister/graphvault/internal/gvql/gvql";
3
+ import type { AdminGraph, AdminHierarchyPath, AdminMutation, AdminMutationPreview, AdminObjectChild, AdminObjectListItem, AdminObjectPage, AdminRootReference, AdminSearchResult, AdminSummary, StorageAdminClientOptions } from "./admin-types.js";
4
+ export type { AdminGraph, AdminGraphEdge, AdminGraphNode, AdminHierarchyPath, AdminHierarchyPathItem, AdminMutation, AdminMutationPreview, GvqlResult, AdminObjectChild, AdminObjectListItem, AdminObjectPage, AdminObjectParent, AdminRootReference, AdminSearchResult, AdminSummary, StorageAdminClientOptions, } from "./admin-types.js";
5
+ export declare class StorageAdminClient {
6
+ private readonly options;
7
+ private readonly target;
8
+ private readonly layout;
9
+ private readonly reader;
10
+ private readonly writer;
11
+ private readonly allowMutations;
12
+ private parentIndex;
13
+ constructor(options: StorageAdminClientOptions);
14
+ summary(options?: {
15
+ verify?: boolean;
16
+ }): Promise<AdminSummary>;
17
+ listObjects(): Promise<AdminObjectListItem[]>;
18
+ listObjectPage(options?: {
19
+ offset?: number;
20
+ limit?: number;
21
+ }): Promise<AdminObjectPage>;
22
+ getObject(objectId: string): Promise<ObjectRecord>;
23
+ rootReference(): Promise<AdminRootReference>;
24
+ listObjectChildren(objectId: string): Promise<AdminObjectChild[]>;
25
+ hierarchyPath(targetObjectId: string): Promise<AdminHierarchyPath>;
26
+ graph(): Promise<AdminGraph>;
27
+ search(query: string, options?: {
28
+ limit?: number;
29
+ }): Promise<AdminSearchResult[]>;
30
+ gvql(query: string, options?: GvqlExecutionOptions): Promise<GvqlResult>;
31
+ listTransactions(): Promise<TransactionRecord[]>;
32
+ readJournal(): Promise<string>;
33
+ readTypeDictionary(): Promise<TypeDictionary | undefined>;
34
+ verify(): Promise<VerificationResult>;
35
+ maintain(options?: {
36
+ keepSnapshots?: number;
37
+ }): Promise<MaintenanceResult>;
38
+ backup(destination: {
39
+ storageDirectory: string;
40
+ storageTarget?: StorageTarget;
41
+ }): Promise<BackupResult>;
42
+ previewMutation(mutation: AdminMutation): Promise<AdminMutationPreview>;
43
+ mutate(mutation: AdminMutation): Promise<TransactionRecord>;
44
+ private requireManifest;
45
+ private compact;
46
+ private collectGarbage;
47
+ private assertMutationsAllowed;
48
+ private parentIndexFor;
49
+ }