@nodetool-ai/server-minimal 0.0.0-stage → 0.8.9-beta.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.
package/README.md CHANGED
@@ -1,3 +1,58 @@
1
- # Temporary Holding Version
1
+ # Minimal execution server
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Install `@nodetool-ai/server-minimal` and run `nodetool-server-minimal`.
4
+ Set `SECRETS_MASTER_KEY` to a secret of at least 32 characters and
5
+ `NODETOOL_TOKENS` to a JSON object mapping bearer tokens of at least 32
6
+ characters to user IDs. `NODETOOL_DATA_DIR` selects the SQLite and assets
7
+ folder. `HOST` and `PORT` select the listening address.
8
+
9
+ The server exposes authenticated workflow, asset, secret and job routes and
10
+ MsgPack execution over `/ws`. Save `OPENAI_API_KEY` through the authenticated
11
+ secrets route before using remote text nodes. `OPENAI_BASE_URL` selects a public
12
+ HTTPS OpenAI-compatible endpoint. Binary assets are stored without decoding.
13
+
14
+ Use `createMinimalServer` for programmatic composition. Features are explicitly
15
+ configured with `{ id, load }` entries and activate against the execution host.
16
+ The executable accepts `NODETOOL_FEATURES` as comma-separated
17
+ `feature-id=installed-package` entries. Packages must already be installed by
18
+ an administrator. Startup rejects incompatible or missing prerequisites and
19
+ retains the cause when loading fails.
20
+
21
+ Optional modules install separately:
22
+
23
+ - `@nodetool-ai/server-feature-sandbox` enables the Code node in QuickJS.
24
+ - `@nodetool-ai/feature-documents` enables PDF text extraction.
25
+ - `@nodetool-ai/provider-anthropic` supplies an Anthropic text adapter.
26
+ - `@nodetool-ai/database-postgres` supplies a PostgreSQL repository adapter.
27
+
28
+ The full server retains its existing installed node packs. The minimal host
29
+ advertises unavailable nodes without changing their stored documents. It does
30
+ not install features while serving.
31
+
32
+ From the repository, run `npm run build:packages` before
33
+ `npm run test:minimal:packed`. The latter packs runtime dependencies and installs
34
+ them outside the workspace with normal install scripts. Its report includes
35
+ logical installed bytes, external package instances, budget results and the
36
+ number of JavaScript and declaration files inspected by the dependency guard.
37
+ Measure the default CLI separately:
38
+
39
+ ```bash
40
+ node scripts/minimal-packed-consumer.mjs @nodetool-ai/cli /tmp/nodetool-cli
41
+ ```
42
+
43
+ Each consumer directory contains its own `measurement.json`. To compare with a
44
+ previously measured installation, pass `--baseline-report <measurement.json>`.
45
+ Do not substitute an unmeasured collection of optional command features for a
46
+ clean-install baseline.
47
+
48
+ Registered execution nodes receive a local `workspace` scoped to authenticated
49
+ user and run. User and job IDs are hashed into directory segments under
50
+ `NODETOOL_DATA_DIR/workspaces`, and files survive restarts. File access uses the
51
+ shared workspace traversal and symlink checks.
52
+
53
+ Programmatic hosts can pass `repository` to `createMinimalServer` instead of
54
+ using SQLite. For example, explicitly install `@nodetool-ai/database-postgres`,
55
+ call `await createPostgresRepository(url)`, and pass the result. The minimal
56
+ package does not depend on PostgreSQL. The server takes ownership of the
57
+ repository and awaits its close on shutdown or startup failure. Assets and
58
+ workspaces still use the configured local directory.
@@ -0,0 +1 @@
1
+ 2026-10-31T09:11:05.327Z
package/dist/auth.d.ts ADDED
@@ -0,0 +1,8 @@
1
+ import { AuthProvider, type AuthResult } from "@nodetool-ai/auth";
2
+ /** Explicit administrator token assignments. There is no trusted-local fallback. */
3
+ export declare class ConfiguredTokenAuth extends AuthProvider {
4
+ private readonly entries;
5
+ constructor(tokens: Readonly<Record<string, string>>);
6
+ verifyToken(token: string): Promise<AuthResult>;
7
+ }
8
+ //# sourceMappingURL=auth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAa,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE7E,oFAAoF;AACpF,qBAAa,mBAAoB,SAAQ,YAAY;IACnD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA+C;IAEvE,YAAY,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAWnD;IAEK,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAQpD;CACF"}
package/dist/auth.js ADDED
@@ -0,0 +1,28 @@
1
+ import { timingSafeEqual } from "node:crypto";
2
+ import { AuthProvider, TokenType } from "@nodetool-ai/auth";
3
+ /** Explicit administrator token assignments. There is no trusted-local fallback. */
4
+ export class ConfiguredTokenAuth extends AuthProvider {
5
+ entries;
6
+ constructor(tokens) {
7
+ super();
8
+ this.entries = Object.entries(tokens).map(([token, userId]) => {
9
+ if (token.length < 32 || !userId) {
10
+ throw new Error("Tokens must contain at least 32 characters and have a user ID");
11
+ }
12
+ return { token: Buffer.from(token), userId };
13
+ });
14
+ if (this.entries.length === 0) {
15
+ throw new Error("At least one authenticated token assignment is required");
16
+ }
17
+ }
18
+ async verifyToken(token) {
19
+ const candidate = Buffer.from(token);
20
+ for (const entry of this.entries) {
21
+ if (candidate.length === entry.token.length && timingSafeEqual(candidate, entry.token)) {
22
+ return { ok: true, userId: entry.userId, tokenType: TokenType.STATIC };
23
+ }
24
+ }
25
+ return { ok: false, error: "Invalid token" };
26
+ }
27
+ }
28
+ //# sourceMappingURL=auth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.js","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,SAAS,EAAmB,MAAM,mBAAmB,CAAC;AAE7E,oFAAoF;AACpF,MAAM,OAAO,mBAAoB,SAAQ,YAAY;IAClC,OAAO,CAA+C;IAEvE,YAAY,MAAwC;QAClD,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,EAAE;YAC5D,IAAI,KAAK,CAAC,MAAM,GAAG,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC;gBACjC,MAAM,IAAI,KAAK,CAAC,+DAA+D,CAAC,CAAC;YACnF,CAAC;YACD,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;QAC/C,CAAC,CAAC,CAAC;QACH,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC9B,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC;QAC7E,CAAC;IACH,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,KAAa;QAC7B,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACrC,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjC,IAAI,SAAS,CAAC,MAAM,KAAK,KAAK,CAAC,KAAK,CAAC,MAAM,IAAI,eAAe,CAAC,SAAS,EAAE,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC;gBACvF,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,CAAC,MAAM,EAAE,CAAC;YACzE,CAAC;QACH,CAAC;QACD,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,eAAe,EAAE,CAAC;IAC/C,CAAC;CACF"}
@@ -0,0 +1,3 @@
1
+ import type { FeatureDescriptor } from "@nodetool-ai/server-features";
2
+ export declare const OPTIONAL_FEATURE_CATALOG: readonly FeatureDescriptor[];
3
+ //# sourceMappingURL=feature-catalog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"feature-catalog.d.ts","sourceRoot":"","sources":["../src/feature-catalog.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEtE,eAAO,MAAM,wBAAwB,EAAE,SAAS,iBAAiB,EAglHhE,CAAC"}