@nodetool-ai/node-catalog 0.8.8 → 0.8.9-bootstrap.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/dist/.nodetool-build-stamp +1 -1
- package/dist/catalog-data.d.ts +1 -4
- package/dist/catalog-data.d.ts.map +1 -1
- package/dist/catalog-data.js +1 -21
- package/dist/catalog-data.js.map +1 -1
- package/dist/errors.d.ts +1 -4
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +1 -51
- package/dist/errors.js.map +1 -1
- package/dist/import-pack.d.ts +1 -10
- package/dist/import-pack.d.ts.map +1 -1
- package/dist/import-pack.js +1 -62
- package/dist/import-pack.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.json +330 -117
- package/dist/installed-resolver.d.ts +1 -4
- package/dist/installed-resolver.d.ts.map +1 -1
- package/dist/installed-resolver.js +1 -35
- package/dist/installed-resolver.js.map +1 -1
- package/dist/loader-context.d.ts +1 -22
- package/dist/loader-context.d.ts.map +1 -1
- package/dist/loader-context.js +1 -31
- package/dist/loader-context.js.map +1 -1
- package/dist/nodes.ndjson.gz +0 -0
- package/dist/register-available-packs.d.ts +6 -0
- package/dist/register-available-packs.d.ts.map +1 -1
- package/dist/register-available-packs.js +13 -1
- package/dist/register-available-packs.js.map +1 -1
- package/dist/types.d.ts +1 -34
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +6 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
2026-10-
|
|
1
|
+
2026-10-30T19:33:51.566Z
|
package/dist/catalog-data.d.ts
CHANGED
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function readCatalogIndex(): NodeCatalogIndex;
|
|
3
|
-
export declare function readCatalogNodes(): readonly CatalogNode[];
|
|
4
|
-
export declare function packForNodeType(nodeType: string): CatalogPack | undefined;
|
|
1
|
+
export * from "@nodetool-ai/pack-core/catalog-data";
|
|
5
2
|
//# sourceMappingURL=catalog-data.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalog-data.d.ts","sourceRoot":"","sources":["../src/catalog-data.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"catalog-data.d.ts","sourceRoot":"","sources":["../src/catalog-data.ts"],"names":[],"mappings":"AAAA,cAAc,qCAAqC,CAAC"}
|
package/dist/catalog-data.js
CHANGED
|
@@ -1,22 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import { loadPackageAssetBytes, loadPackageAssetJson } from "@nodetool-ai/config";
|
|
3
|
-
let catalogIndex;
|
|
4
|
-
let catalogNodes;
|
|
5
|
-
export function readCatalogIndex() {
|
|
6
|
-
catalogIndex ??= loadPackageAssetJson({ pkg: "@nodetool-ai/node-catalog", path: "index.json" }, import.meta.url);
|
|
7
|
-
return catalogIndex;
|
|
8
|
-
}
|
|
9
|
-
export function readCatalogNodes() {
|
|
10
|
-
if (!catalogNodes) {
|
|
11
|
-
const bytes = loadPackageAssetBytes({ pkg: "@nodetool-ai/node-catalog", path: "nodes.ndjson.gz" }, import.meta.url);
|
|
12
|
-
// This registered build asset is generated and checked by check:node-catalog.
|
|
13
|
-
catalogNodes = gunzipSync(bytes).toString("utf8").trimEnd().split("\n").map((line) => JSON.parse(line));
|
|
14
|
-
}
|
|
15
|
-
return catalogNodes;
|
|
16
|
-
}
|
|
17
|
-
export function packForNodeType(nodeType) {
|
|
18
|
-
const index = readCatalogIndex();
|
|
19
|
-
const owner = index.owners[nodeType];
|
|
20
|
-
return owner === undefined ? undefined : index.packs.find((pack) => pack.id === owner);
|
|
21
|
-
}
|
|
1
|
+
export * from "@nodetool-ai/pack-core/catalog-data";
|
|
22
2
|
//# sourceMappingURL=catalog-data.js.map
|
package/dist/catalog-data.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalog-data.js","sourceRoot":"","sources":["../src/catalog-data.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"catalog-data.js","sourceRoot":"","sources":["../src/catalog-data.ts"],"names":[],"mappings":"AAAA,cAAc,qCAAqC,CAAC"}
|
package/dist/errors.d.ts
CHANGED
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import { MissingPackError, type MissingPackInstall } from "@nodetool-ai/protocol";
|
|
3
|
-
export { MissingPackError, type MissingPackDetails, type MissingPackInstall } from "@nodetool-ai/protocol";
|
|
4
|
-
export declare function createMissingPackError(packId: string | readonly string[], nodeTypes?: readonly string[], install?: MissingPackInstall, catalog?: NodeCatalogIndex): MissingPackError;
|
|
1
|
+
export * from "@nodetool-ai/pack-core/errors";
|
|
5
2
|
//# sourceMappingURL=errors.d.ts.map
|
package/dist/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC"}
|
package/dist/errors.js
CHANGED
|
@@ -1,52 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import { MissingPackError } from "@nodetool-ai/protocol";
|
|
3
|
-
import { currentPackInstall } from "./loader-context.js";
|
|
4
|
-
import { isRuntimeNpmPackageId } from "@nodetool-ai/protocol/runtime-npm-packages";
|
|
5
|
-
export { MissingPackError } from "@nodetool-ai/protocol";
|
|
6
|
-
export function createMissingPackError(packId, nodeTypes = [], install = currentPackInstall() ?? { supported: false, reason: "Pack installs are not available in this version.", command: null }, catalog = readCatalogIndex()) {
|
|
7
|
-
const index = catalog;
|
|
8
|
-
const byId = new Map(index.packs.map((pack) => [pack.id, pack]));
|
|
9
|
-
const pending = [packId].flat();
|
|
10
|
-
const ids = new Set();
|
|
11
|
-
const runtimeLibraries = new Set();
|
|
12
|
-
for (let i = 0; i < pending.length; i++) {
|
|
13
|
-
const id = pending[i];
|
|
14
|
-
if (ids.has(id)) {
|
|
15
|
-
continue;
|
|
16
|
-
}
|
|
17
|
-
const pack = byId.get(id);
|
|
18
|
-
if (!pack) {
|
|
19
|
-
throw new Error(`Unknown node catalog pack: ${id}`);
|
|
20
|
-
}
|
|
21
|
-
ids.add(id);
|
|
22
|
-
pending.push(...pack.requires);
|
|
23
|
-
for (const runtimeId of pack.runtimeLibraries) {
|
|
24
|
-
runtimeLibraries.add(runtimeId);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
const commandIds = [...new Set([...ids].filter(id => byId.get(id)?.kind === "node-pack").concat([...runtimeLibraries].filter(isRuntimeNpmPackageId)))].sort();
|
|
28
|
-
const guidance = install.supported && install.command === null
|
|
29
|
-
? { ...install, command: commandIds.length ? `nodetool packs add ${commandIds.join(" ")}` : "nodetool packs doctor --installed" }
|
|
30
|
-
: install;
|
|
31
|
-
return new MissingPackError({
|
|
32
|
-
error: "missing_pack",
|
|
33
|
-
packs: [...ids].sort().map((id) => {
|
|
34
|
-
const pack = byId.get(id);
|
|
35
|
-
if (!pack) {
|
|
36
|
-
throw new Error(`Unknown node catalog pack: ${id}`);
|
|
37
|
-
}
|
|
38
|
-
return {
|
|
39
|
-
id: pack.id,
|
|
40
|
-
npm: pack.npm.name,
|
|
41
|
-
version: pack.npm.version,
|
|
42
|
-
installBytes: pack.installBytes,
|
|
43
|
-
requires: pack.requires
|
|
44
|
-
};
|
|
45
|
-
}),
|
|
46
|
-
runtimeLibraries: [...runtimeLibraries].sort(),
|
|
47
|
-
nodeTypes: [...new Set(nodeTypes)].sort(),
|
|
48
|
-
install: guidance,
|
|
49
|
-
restartRequired: false
|
|
50
|
-
});
|
|
51
|
-
}
|
|
1
|
+
export * from "@nodetool-ai/pack-core/errors";
|
|
52
2
|
//# sourceMappingURL=errors.js.map
|
package/dist/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC"}
|
package/dist/import-pack.d.ts
CHANGED
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* Hosts that compile packs into their own output (the packaged desktop
|
|
4
|
-
* backend inlines every pack into server.mjs) register a loader per module
|
|
5
|
-
* specifier, because those packages cannot be resolved from disk.
|
|
6
|
-
*/
|
|
7
|
-
export declare function setBundledPackModules(loaders: Readonly<Record<string, PackModuleLoader>>): void;
|
|
8
|
-
/** Import only the requested catalog pack, without substituting a runtime root. */
|
|
9
|
-
export declare function importPack<T extends object = object>(packId: string, specifier?: string): Promise<T>;
|
|
10
|
-
export {};
|
|
1
|
+
export * from "@nodetool-ai/pack-core/import-pack";
|
|
11
2
|
//# sourceMappingURL=import-pack.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"import-pack.d.ts","sourceRoot":"","sources":["../src/import-pack.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"import-pack.d.ts","sourceRoot":"","sources":["../src/import-pack.ts"],"names":[],"mappings":"AAAA,cAAc,oCAAoC,CAAC"}
|
package/dist/import-pack.js
CHANGED
|
@@ -1,63 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import { createMissingPackError } from "./errors.js";
|
|
3
|
-
import { loadPackLoaderContext } from "./loader-context.js";
|
|
4
|
-
import { resolveInstalledPack } from "./installed-resolver.js";
|
|
5
|
-
function packSpecifier(pack, specifier) {
|
|
6
|
-
if (specifier === undefined) {
|
|
7
|
-
return pack.npm.name;
|
|
8
|
-
}
|
|
9
|
-
const target = specifier.startsWith("@") ? specifier : `${pack.npm.name}/${specifier}`;
|
|
10
|
-
const names = [pack.npm.name, ...pack.provides];
|
|
11
|
-
if (names.some((name) => target === name || target.startsWith(`${name}/`))) {
|
|
12
|
-
const parts = target.split("/");
|
|
13
|
-
if (parts.some((part) => part === "." || part === ".." || part.includes("\\") || part.includes("?") || part.includes("#") || part.includes(":") || part === "")) {
|
|
14
|
-
throw new Error(`Invalid specifier for pack ${pack.id}: ${specifier}`);
|
|
15
|
-
}
|
|
16
|
-
return target;
|
|
17
|
-
}
|
|
18
|
-
throw new Error(`Pack ${pack.id} does not provide ${specifier}`);
|
|
19
|
-
}
|
|
20
|
-
let bundledModules = new Map();
|
|
21
|
-
/**
|
|
22
|
-
* Hosts that compile packs into their own output (the packaged desktop
|
|
23
|
-
* backend inlines every pack into server.mjs) register a loader per module
|
|
24
|
-
* specifier, because those packages cannot be resolved from disk.
|
|
25
|
-
*/
|
|
26
|
-
export function setBundledPackModules(loaders) {
|
|
27
|
-
bundledModules = new Map(Object.entries(loaders));
|
|
28
|
-
}
|
|
29
|
-
/** Import only the requested catalog pack, without substituting a runtime root. */
|
|
30
|
-
export async function importPack(packId, specifier) {
|
|
31
|
-
const pack = readCatalogIndex().packs.find((entry) => entry.id === packId);
|
|
32
|
-
if (!pack) {
|
|
33
|
-
throw new Error(`Unknown node pack: ${packId}`);
|
|
34
|
-
}
|
|
35
|
-
const target = packSpecifier(pack, specifier);
|
|
36
|
-
const bundled = bundledModules.get(target);
|
|
37
|
-
if (bundled) {
|
|
38
|
-
// SAFETY: the host registered this loader for exactly this specifier, so
|
|
39
|
-
// it returns the module T describes, as the dynamic imports below do.
|
|
40
|
-
const module = (await bundled());
|
|
41
|
-
return module;
|
|
42
|
-
}
|
|
43
|
-
const context = await loadPackLoaderContext();
|
|
44
|
-
if (context) {
|
|
45
|
-
const module = await import(resolveInstalledPack(pack, target, context));
|
|
46
|
-
return module;
|
|
47
|
-
}
|
|
48
|
-
let resolved;
|
|
49
|
-
try {
|
|
50
|
-
resolved = import.meta.resolve(target);
|
|
51
|
-
}
|
|
52
|
-
catch (error) {
|
|
53
|
-
if (error instanceof Error && "code" in error && error.code === "ERR_MODULE_NOT_FOUND") {
|
|
54
|
-
throw createMissingPackError(pack.id);
|
|
55
|
-
}
|
|
56
|
-
throw error;
|
|
57
|
-
}
|
|
58
|
-
// Resolution has established package presence. Initialization failures,
|
|
59
|
-
// including a missing transitive dependency, must keep their original error.
|
|
60
|
-
const module = await import(resolved);
|
|
61
|
-
return module;
|
|
62
|
-
}
|
|
1
|
+
export * from "@nodetool-ai/pack-core/import-pack";
|
|
63
2
|
//# sourceMappingURL=import-pack.js.map
|
package/dist/import-pack.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"import-pack.js","sourceRoot":"","sources":["../src/import-pack.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"import-pack.js","sourceRoot":"","sources":["../src/import-pack.ts"],"names":[],"mappings":"AAAA,cAAc,oCAAoC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export type { CatalogNode, CatalogPack, NodeCatalogIndex, PinnedPackage, InstallPackagePin } from "./types.js";
|
|
2
2
|
export { readCatalogIndex, readCatalogNodes, packForNodeType } from "./catalog-data.js";
|
|
3
3
|
export { importPack, setBundledPackModules } from "./import-pack.js";
|
|
4
|
-
export { registerAvailablePacks, registerCatalogPack, catalogPackIdsForBuiltin } from "./register-available-packs.js";
|
|
4
|
+
export { registerAvailablePacks, registerCatalogPack, catalogPackIdsForBuiltin, NotNodePackError } from "./register-available-packs.js";
|
|
5
5
|
export { setPackLoaderContext, setPackLoaderContextProvider, loadPackLoaderContext, currentPackInstall, type PackLoaderContext, type PackLoaderEntry, type PackLoaderPackage } from "./loader-context.js";
|
|
6
6
|
export { MissingPackError, createMissingPackError, type MissingPackDetails, type MissingPackInstall } from "./errors.js";
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,gBAAgB,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/G,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACxF,OAAO,EAAE,UAAU,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,gBAAgB,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/G,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACxF,OAAO,EAAE,UAAU,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACxI,OAAO,EAAE,oBAAoB,EAAE,4BAA4B,EAAE,qBAAqB,EAAE,kBAAkB,EACpG,KAAK,iBAAiB,EAAE,KAAK,eAAe,EAAE,KAAK,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAEpG,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,KAAK,kBAAkB,EAAE,KAAK,kBAAkB,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { readCatalogIndex, readCatalogNodes, packForNodeType } from "./catalog-data.js";
|
|
2
2
|
export { importPack, setBundledPackModules } from "./import-pack.js";
|
|
3
|
-
export { registerAvailablePacks, registerCatalogPack, catalogPackIdsForBuiltin } from "./register-available-packs.js";
|
|
3
|
+
export { registerAvailablePacks, registerCatalogPack, catalogPackIdsForBuiltin, NotNodePackError } from "./register-available-packs.js";
|
|
4
4
|
export { setPackLoaderContext, setPackLoaderContextProvider, loadPackLoaderContext, currentPackInstall } from "./loader-context.js";
|
|
5
5
|
export { MissingPackError, createMissingPackError } from "./errors.js";
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACxF,OAAO,EAAE,UAAU,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACxF,OAAO,EAAE,UAAU,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACxI,OAAO,EAAE,oBAAoB,EAAE,4BAA4B,EAAE,qBAAqB,EAAE,kBAAkB,EAC9B,MAAM,qBAAqB,CAAC;AAEpG,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAoD,MAAM,aAAa,CAAC"}
|