@happyvertical/smrt-cli 0.39.11 → 0.39.13
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/AGENTS.md +1 -0
- package/dist/{commands-Bl_ne1Uj.js → commands-DOYdmiAx.js} +2 -4
- package/dist/index.js +23 -11
- package/package.json +7 -7
package/AGENTS.md
CHANGED
|
@@ -33,6 +33,7 @@ migrations are manifest-driven through registered objects and project manifests.
|
|
|
33
33
|
|
|
34
34
|
- **Lazy command loading**: commands loaded on-demand via dynamic import (~100ms overhead on first use)
|
|
35
35
|
- **Manifest discovery**: auto-finds `.smrt/manifest.json` + scans `node_modules/@happyvertical/smrt-*`
|
|
36
|
+
- **Aggregate manifest identity**: preload and schema discovery resolve package ownership per entry (`definition.packageName` before the container), so dependency objects retain their qualified registrations
|
|
36
37
|
- **Class loading order**: config.entryPoint → package.json exports['.'] → package.json main → `./dist/index.js`
|
|
37
38
|
- **Object method exposure**: custom methods on SMRT objects auto-become CLI commands
|
|
38
39
|
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { t as resolveManifestEntryPackageName } from "./index.js";
|
|
1
2
|
import { createRequire } from "node:module";
|
|
2
3
|
import * as fs from "node:fs";
|
|
3
4
|
import { existsSync, lstatSync, mkdirSync, readFileSync, realpathSync, writeFileSync } from "node:fs";
|
|
4
5
|
import * as path from "node:path";
|
|
5
6
|
import { dirname, isAbsolute, join, relative, resolve } from "node:path";
|
|
6
7
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
7
|
-
import { ObjectRegistry, SchemaComparer, createQualifiedName, generateDDLForEngine, getClassName,
|
|
8
|
+
import { ObjectRegistry, SchemaComparer, createQualifiedName, generateDDLForEngine, getClassName, isQualifiedName, parseQualifiedName } from "@happyvertical/smrt-core";
|
|
8
9
|
import { loadExternalManifestSync } from "@happyvertical/smrt-core/manifest";
|
|
9
10
|
import { access, cp, mkdir, readFile, rm, writeFile } from "node:fs/promises";
|
|
10
11
|
import { createLogger } from "@happyvertical/logger";
|
|
@@ -219,9 +220,6 @@ var configExportCommand = {
|
|
|
219
220
|
* - Installed packages in node_modules
|
|
220
221
|
*/
|
|
221
222
|
var logger$2 = createLogger({ level: "info" });
|
|
222
|
-
function resolveManifestEntryPackageName(name, definition, fallback) {
|
|
223
|
-
return definition.packageName || fallback || getPackageFromQualifiedName(name) || (definition.qualifiedName ? getPackageFromQualifiedName(definition.qualifiedName) : void 0);
|
|
224
|
-
}
|
|
225
223
|
/**
|
|
226
224
|
* Tracks all versions found for each @happyvertical/smrt-* package.
|
|
227
225
|
* Used to detect version conflicts that could cause runtime issues.
|
package/dist/index.js
CHANGED
|
@@ -3,9 +3,21 @@ import { readFileSync } from "node:fs";
|
|
|
3
3
|
import { dirname, join } from "node:path";
|
|
4
4
|
import { createInterface } from "node:readline";
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
6
|
-
import { ObjectRegistry } from "@happyvertical/smrt-core";
|
|
6
|
+
import { ObjectRegistry, getPackageFromQualifiedName } from "@happyvertical/smrt-core";
|
|
7
7
|
import { loadLocalTestManifestSync } from "@happyvertical/smrt-core/manifest";
|
|
8
8
|
import { parseCliArgs } from "@happyvertical/utils";
|
|
9
|
+
//#region src/discovery/manifest-identity.ts
|
|
10
|
+
/**
|
|
11
|
+
* Resolve the package that owns one manifest entry.
|
|
12
|
+
*
|
|
13
|
+
* Aggregate consumer manifests contain dependency entries alongside local
|
|
14
|
+
* objects. Entry-level provenance must win over the containing manifest so
|
|
15
|
+
* those dependencies retain their qualified registry identities.
|
|
16
|
+
*/
|
|
17
|
+
function resolveManifestEntryPackageName(name, definition, fallback) {
|
|
18
|
+
return definition.packageName || fallback || getPackageFromQualifiedName(name) || (definition.qualifiedName ? getPackageFromQualifiedName(definition.qualifiedName) : void 0);
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
9
21
|
//#region src/cli-generator.ts
|
|
10
22
|
/**
|
|
11
23
|
* CLI command generator for smrt objects
|
|
@@ -36,56 +48,56 @@ var _docsCommands = null;
|
|
|
36
48
|
var _playgroundCommands = null;
|
|
37
49
|
async function getGnodeCommands() {
|
|
38
50
|
if (!_gnodeCommands) {
|
|
39
|
-
const { gnodeCommands } = await import("./commands-
|
|
51
|
+
const { gnodeCommands } = await import("./commands-DOYdmiAx.js");
|
|
40
52
|
_gnodeCommands = gnodeCommands;
|
|
41
53
|
}
|
|
42
54
|
return _gnodeCommands;
|
|
43
55
|
}
|
|
44
56
|
async function getGitCommands() {
|
|
45
57
|
if (!_gitCommands) {
|
|
46
|
-
const { gitCommands } = await import("./commands-
|
|
58
|
+
const { gitCommands } = await import("./commands-DOYdmiAx.js");
|
|
47
59
|
_gitCommands = gitCommands;
|
|
48
60
|
}
|
|
49
61
|
return _gitCommands;
|
|
50
62
|
}
|
|
51
63
|
async function getGenerateCommands() {
|
|
52
64
|
if (!_generateCommands) {
|
|
53
|
-
const { generateCommands } = await import("./commands-
|
|
65
|
+
const { generateCommands } = await import("./commands-DOYdmiAx.js");
|
|
54
66
|
_generateCommands = generateCommands;
|
|
55
67
|
}
|
|
56
68
|
return _generateCommands;
|
|
57
69
|
}
|
|
58
70
|
async function getInitCommands() {
|
|
59
71
|
if (!_initCommands) {
|
|
60
|
-
const { initCommands } = await import("./commands-
|
|
72
|
+
const { initCommands } = await import("./commands-DOYdmiAx.js");
|
|
61
73
|
_initCommands = initCommands;
|
|
62
74
|
}
|
|
63
75
|
return _initCommands;
|
|
64
76
|
}
|
|
65
77
|
async function getUtilityCommands() {
|
|
66
78
|
if (!_utilityCommands) {
|
|
67
|
-
const { utilityCommands } = await import("./commands-
|
|
79
|
+
const { utilityCommands } = await import("./commands-DOYdmiAx.js");
|
|
68
80
|
_utilityCommands = utilityCommands;
|
|
69
81
|
}
|
|
70
82
|
return _utilityCommands;
|
|
71
83
|
}
|
|
72
84
|
async function getDispatchCommands() {
|
|
73
85
|
if (!_dispatchCommands) {
|
|
74
|
-
const { dispatchCommands } = await import("./commands-
|
|
86
|
+
const { dispatchCommands } = await import("./commands-DOYdmiAx.js");
|
|
75
87
|
_dispatchCommands = dispatchCommands;
|
|
76
88
|
}
|
|
77
89
|
return _dispatchCommands;
|
|
78
90
|
}
|
|
79
91
|
async function getDocsCommands() {
|
|
80
92
|
if (!_docsCommands) {
|
|
81
|
-
const { docsCommands } = await import("./commands-
|
|
93
|
+
const { docsCommands } = await import("./commands-DOYdmiAx.js");
|
|
82
94
|
_docsCommands = docsCommands;
|
|
83
95
|
}
|
|
84
96
|
return _docsCommands;
|
|
85
97
|
}
|
|
86
98
|
async function getPlaygroundCommands() {
|
|
87
99
|
if (!_playgroundCommands) {
|
|
88
|
-
const { playgroundCommands } = await import("./commands-
|
|
100
|
+
const { playgroundCommands } = await import("./commands-DOYdmiAx.js");
|
|
89
101
|
_playgroundCommands = playgroundCommands;
|
|
90
102
|
}
|
|
91
103
|
return _playgroundCommands;
|
|
@@ -300,7 +312,7 @@ var CLIGenerator = class {
|
|
|
300
312
|
const verbose = process.env.SMRT_VERBOSE === "true" || process.env.DEBUG?.includes("smrt");
|
|
301
313
|
const manifest = loadLocalTestManifestSync();
|
|
302
314
|
if (verbose) console.log("[CLI] Manifest loaded:", manifest ? `${Object.keys(manifest.objects || {}).length} objects` : "null");
|
|
303
|
-
if (manifest?.objects) for (const [name, objectDef] of Object.entries(manifest.objects)) ObjectRegistry.registerFromManifest(name, objectDef, manifest.packageName);
|
|
315
|
+
if (manifest?.objects) for (const [name, objectDef] of Object.entries(manifest.objects)) ObjectRegistry.registerFromManifest(name, objectDef, resolveManifestEntryPackageName(name, objectDef, manifest.packageName));
|
|
304
316
|
const classLoadStart = timing ? performance.now() : 0;
|
|
305
317
|
await this.tryLoadUserClasses();
|
|
306
318
|
if (timing) timing.classLoading = performance.now() - classLoadStart;
|
|
@@ -1452,4 +1464,4 @@ if (!cliEntryGlobal.__SMRT_CLI_ENTRY_RUNNING__) {
|
|
|
1452
1464
|
});
|
|
1453
1465
|
}
|
|
1454
1466
|
//#endregion
|
|
1455
|
-
export {};
|
|
1467
|
+
export { resolveManifestEntryPackageName as t };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@happyvertical/smrt-cli",
|
|
3
|
-
"version": "0.39.
|
|
3
|
+
"version": "0.39.13",
|
|
4
4
|
"description": "Developer CLI for SMRT framework - introspection, testing, and project management",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -32,12 +32,12 @@
|
|
|
32
32
|
"acorn": "^8.17.0",
|
|
33
33
|
"fast-glob": "3.3.3",
|
|
34
34
|
"tar": "^7.5.19",
|
|
35
|
-
"@happyvertical/smrt-
|
|
36
|
-
"@happyvertical/smrt-
|
|
37
|
-
"@happyvertical/smrt-
|
|
38
|
-
"@happyvertical/smrt-
|
|
39
|
-
"@happyvertical/smrt-
|
|
40
|
-
"@happyvertical/smrt-
|
|
35
|
+
"@happyvertical/smrt-core": "0.39.13",
|
|
36
|
+
"@happyvertical/smrt-agents": "0.39.13",
|
|
37
|
+
"@happyvertical/smrt-types": "0.39.13",
|
|
38
|
+
"@happyvertical/smrt-dev-mcp": "0.39.13",
|
|
39
|
+
"@happyvertical/smrt-playground": "0.39.13",
|
|
40
|
+
"@happyvertical/smrt-config": "0.39.13"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/node": "24.13.2",
|