@happyvertical/smrt-cli 0.40.65 → 0.40.66
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/{commands-Bkdk2-S5.js → commands-BMFrPkA-.js} +277 -8
- package/dist/index.js +29 -14
- package/package.json +12 -12
|
@@ -3,7 +3,7 @@ import { createRequire } from "node:module";
|
|
|
3
3
|
import * as fs from "node:fs";
|
|
4
4
|
import { existsSync, lstatSync, mkdirSync, readFileSync, realpathSync, writeFileSync } from "node:fs";
|
|
5
5
|
import * as path from "node:path";
|
|
6
|
-
import { dirname, isAbsolute, join, relative, resolve } from "node:path";
|
|
6
|
+
import { basename, dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
7
7
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
8
8
|
import { ObjectRegistry, SchemaComparer, createQualifiedName, generateDDLForEngine, getClassName, isQualifiedName, migratePostgresSystemTimestamps, parseQualifiedName, planPostgresSystemTimestampMigrations } from "@happyvertical/smrt-core";
|
|
9
9
|
import { loadExternalManifestSync } from "@happyvertical/smrt-core/manifest";
|
|
@@ -15,7 +15,7 @@ import { toSnakeCase } from "@happyvertical/smrt-core/utils";
|
|
|
15
15
|
import { readAgentModuleDocs } from "@happyvertical/smrt-core/knowledge";
|
|
16
16
|
import { MCPGenerator } from "@happyvertical/smrt-core/generators";
|
|
17
17
|
import { generateDeclarationsFromCLI } from "@happyvertical/smrt-core/prebuild";
|
|
18
|
-
import { execSync, spawn, spawnSync } from "node:child_process";
|
|
18
|
+
import { execFileSync, execSync, spawn, spawnSync } from "node:child_process";
|
|
19
19
|
import https from "node:https";
|
|
20
20
|
import { homedir, tmpdir } from "node:os";
|
|
21
21
|
import { extract } from "tar";
|
|
@@ -5132,7 +5132,7 @@ function detectInitTarget(projectRoot) {
|
|
|
5132
5132
|
const packageJson = readJson(packageJsonPath);
|
|
5133
5133
|
return typeof packageJson.name === "string" && packageJson.name.startsWith("@happyvertical/smrt-") && existsSync(resolve(projectRoot, "src/svelte")) ? "package" : "app";
|
|
5134
5134
|
}
|
|
5135
|
-
function detectPackageManager(projectRoot) {
|
|
5135
|
+
function detectPackageManager$1(projectRoot) {
|
|
5136
5136
|
if (existsSync(resolve(projectRoot, "pnpm-lock.yaml"))) return "pnpm";
|
|
5137
5137
|
if (existsSync(resolve(projectRoot, "yarn.lock"))) return "yarn";
|
|
5138
5138
|
return "npm";
|
|
@@ -5159,7 +5159,7 @@ function ensurePlaygroundPlugin(viteConfigPath) {
|
|
|
5159
5159
|
writeFileSync(viteConfigPath, source);
|
|
5160
5160
|
return true;
|
|
5161
5161
|
}
|
|
5162
|
-
function runCommand(command, args, cwd) {
|
|
5162
|
+
function runCommand$1(command, args, cwd) {
|
|
5163
5163
|
return new Promise((resolvePromise, reject) => {
|
|
5164
5164
|
spawn(command, args, {
|
|
5165
5165
|
cwd,
|
|
@@ -5304,16 +5304,16 @@ var playgroundCommands = {
|
|
|
5304
5304
|
const workspaceRoot = findSmrtWorkspaceRoot(projectRoot);
|
|
5305
5305
|
if (!workspaceRoot) throw new Error("Could not determine workspace root");
|
|
5306
5306
|
console.log("\nStarting the shared SMRT playground host...\n");
|
|
5307
|
-
await runCommand("pnpm", [
|
|
5307
|
+
await runCommand$1("pnpm", [
|
|
5308
5308
|
"--dir",
|
|
5309
5309
|
join(workspaceRoot, "packages/smrt-playground/host"),
|
|
5310
5310
|
"dev"
|
|
5311
5311
|
], workspaceRoot);
|
|
5312
5312
|
return;
|
|
5313
5313
|
}
|
|
5314
|
-
const packageManager = detectPackageManager(projectRoot);
|
|
5314
|
+
const packageManager = detectPackageManager$1(projectRoot);
|
|
5315
5315
|
console.log("\nStarting your app dev server with the local playground route...\n");
|
|
5316
|
-
await runCommand(packageManager, packageManager === "npm" ? ["run", "dev"] : ["dev"], projectRoot);
|
|
5316
|
+
await runCommand$1(packageManager, packageManager === "npm" ? ["run", "dev"] : ["dev"], projectRoot);
|
|
5317
5317
|
}
|
|
5318
5318
|
}
|
|
5319
5319
|
};
|
|
@@ -7770,4 +7770,273 @@ export default testManifest;
|
|
|
7770
7770
|
export: exportCommand
|
|
7771
7771
|
};
|
|
7772
7772
|
//#endregion
|
|
7773
|
-
|
|
7773
|
+
//#region src/commands/workbench.ts
|
|
7774
|
+
/**
|
|
7775
|
+
* Workbench Commands
|
|
7776
|
+
*
|
|
7777
|
+
* Shared SMRT package/project workbench host launcher.
|
|
7778
|
+
*/
|
|
7779
|
+
var workbenchRuntimePromise = null;
|
|
7780
|
+
function packageManagerEntryMatches(command, entryPath) {
|
|
7781
|
+
return {
|
|
7782
|
+
npm: [
|
|
7783
|
+
"npm-cli.js",
|
|
7784
|
+
"npm.cjs",
|
|
7785
|
+
"npm.js"
|
|
7786
|
+
],
|
|
7787
|
+
pnpm: ["pnpm.cjs", "pnpm.js"],
|
|
7788
|
+
yarn: ["yarn.cjs", "yarn.js"]
|
|
7789
|
+
}[command]?.includes(basename(entryPath).toLowerCase()) ?? false;
|
|
7790
|
+
}
|
|
7791
|
+
function resolveWindowsCommandShimEntry(command) {
|
|
7792
|
+
let shimPaths;
|
|
7793
|
+
try {
|
|
7794
|
+
shimPaths = execFileSync("where.exe", [`${command}.cmd`], {
|
|
7795
|
+
encoding: "utf8",
|
|
7796
|
+
windowsHide: true
|
|
7797
|
+
});
|
|
7798
|
+
} catch {
|
|
7799
|
+
return null;
|
|
7800
|
+
}
|
|
7801
|
+
const shimPath = shimPaths.split(/\r?\n/).map((entry) => entry.trim()).find(Boolean);
|
|
7802
|
+
if (!shimPath || !existsSync(shimPath)) return null;
|
|
7803
|
+
try {
|
|
7804
|
+
const packageRoot = realpathSync(join(dirname(shimPath), "node_modules", command));
|
|
7805
|
+
const shim = readFileSync(shimPath, "utf8");
|
|
7806
|
+
for (const match of shim.matchAll(/(?:%dp0%|%~dp0)([^"\r\n]*?\.(?:cjs|mjs|js))/gi)) {
|
|
7807
|
+
const relativeEntry = match[1]?.replace(/^[\\/]+/, "").replace(/[\\/]+/g, sep);
|
|
7808
|
+
if (!relativeEntry) continue;
|
|
7809
|
+
const entryPath = resolve(dirname(shimPath), relativeEntry);
|
|
7810
|
+
const realEntryPath = existsSync(entryPath) ? realpathSync(entryPath) : null;
|
|
7811
|
+
if (realEntryPath?.startsWith(`${packageRoot}${sep}`) && packageManagerEntryMatches(command, realEntryPath)) return realEntryPath;
|
|
7812
|
+
}
|
|
7813
|
+
} catch {
|
|
7814
|
+
return null;
|
|
7815
|
+
}
|
|
7816
|
+
return null;
|
|
7817
|
+
}
|
|
7818
|
+
function windowsPackageManagerInvocation(command, args) {
|
|
7819
|
+
const nodeRoot = dirname(process.execPath);
|
|
7820
|
+
const bundledEntry = command === "npm" ? join(nodeRoot, "node_modules", "npm", "bin", "npm-cli.js") : join(nodeRoot, "node_modules", "corepack", "dist", `${command}.js`);
|
|
7821
|
+
if (existsSync(bundledEntry)) return {
|
|
7822
|
+
command: process.execPath,
|
|
7823
|
+
args: [bundledEntry, ...args]
|
|
7824
|
+
};
|
|
7825
|
+
const shimEntry = resolveWindowsCommandShimEntry(command);
|
|
7826
|
+
if (shimEntry) return {
|
|
7827
|
+
command: process.execPath,
|
|
7828
|
+
args: [shimEntry, ...args]
|
|
7829
|
+
};
|
|
7830
|
+
return {
|
|
7831
|
+
command: `${command}.exe`,
|
|
7832
|
+
args
|
|
7833
|
+
};
|
|
7834
|
+
}
|
|
7835
|
+
function findWorkspaceWorkbenchRoot(cwd) {
|
|
7836
|
+
let current = resolve(cwd);
|
|
7837
|
+
while (true) {
|
|
7838
|
+
if (existsSync(join(current, "packages", "smrt-workbench", "host", "package.json"))) return current;
|
|
7839
|
+
const parent = dirname(current);
|
|
7840
|
+
if (parent === current) return null;
|
|
7841
|
+
current = parent;
|
|
7842
|
+
}
|
|
7843
|
+
}
|
|
7844
|
+
function findInstalledWorkbenchPackageRoot(cwd) {
|
|
7845
|
+
let current = resolve(cwd);
|
|
7846
|
+
while (true) {
|
|
7847
|
+
const packageRoot = join(current, "node_modules", "@happyvertical", "smrt-workbench");
|
|
7848
|
+
if (existsSync(join(packageRoot, "package.json"))) return packageRoot;
|
|
7849
|
+
const parent = dirname(current);
|
|
7850
|
+
if (parent === current) return null;
|
|
7851
|
+
current = parent;
|
|
7852
|
+
}
|
|
7853
|
+
}
|
|
7854
|
+
function findYarnPnpRoot(cwd) {
|
|
7855
|
+
let current = resolve(cwd);
|
|
7856
|
+
while (true) {
|
|
7857
|
+
if (existsSync(join(current, ".pnp.cjs")) || existsSync(join(current, ".pnp.js"))) return current;
|
|
7858
|
+
const parent = dirname(current);
|
|
7859
|
+
if (parent === current) return null;
|
|
7860
|
+
current = parent;
|
|
7861
|
+
}
|
|
7862
|
+
}
|
|
7863
|
+
function resolveInstalledWorkbenchEntry(cwd) {
|
|
7864
|
+
const packageRoot = findInstalledWorkbenchPackageRoot(cwd);
|
|
7865
|
+
const entryPath = packageRoot ? join(packageRoot, "dist", "index.js") : null;
|
|
7866
|
+
return entryPath && existsSync(entryPath) ? entryPath : null;
|
|
7867
|
+
}
|
|
7868
|
+
function loadWorkbenchRuntime(cwd) {
|
|
7869
|
+
if (!workbenchRuntimePromise) {
|
|
7870
|
+
const installedEntry = resolveInstalledWorkbenchEntry(cwd);
|
|
7871
|
+
const workspaceRoot = findWorkspaceWorkbenchRoot(cwd);
|
|
7872
|
+
if (!installedEntry && !workspaceRoot && findYarnPnpRoot(cwd)) return Promise.reject(/* @__PURE__ */ new Error("SMRT workbench requires Yarn to use nodeLinker: node-modules; Yarn Plug’n’Play does not expose the browser host as a physical directory."));
|
|
7873
|
+
workbenchRuntimePromise = installedEntry ? import(pathToFileURL(installedEntry).href) : importWorkspaceModule({
|
|
7874
|
+
packageName: "@happyvertical/smrt-workbench",
|
|
7875
|
+
sourceEntry: "packages/smrt-workbench/src/index.ts",
|
|
7876
|
+
distEntry: "packages/smrt-workbench/dist/index.js",
|
|
7877
|
+
purpose: "SMRT workbench CLI commands"
|
|
7878
|
+
});
|
|
7879
|
+
}
|
|
7880
|
+
return workbenchRuntimePromise;
|
|
7881
|
+
}
|
|
7882
|
+
function runCommand(command, args, cwd, env) {
|
|
7883
|
+
return new Promise((resolvePromise, reject) => {
|
|
7884
|
+
const invocation = process.platform === "win32" ? windowsPackageManagerInvocation(command, args) : {
|
|
7885
|
+
command,
|
|
7886
|
+
args
|
|
7887
|
+
};
|
|
7888
|
+
const child = spawn(invocation.command, invocation.args, {
|
|
7889
|
+
cwd,
|
|
7890
|
+
env,
|
|
7891
|
+
stdio: "inherit",
|
|
7892
|
+
shell: false
|
|
7893
|
+
});
|
|
7894
|
+
child.on("error", reject);
|
|
7895
|
+
child.on("exit", (code) => {
|
|
7896
|
+
if (code === 0) {
|
|
7897
|
+
resolvePromise();
|
|
7898
|
+
return;
|
|
7899
|
+
}
|
|
7900
|
+
reject(/* @__PURE__ */ new Error(`${command} exited with code ${code ?? 1}`));
|
|
7901
|
+
});
|
|
7902
|
+
});
|
|
7903
|
+
}
|
|
7904
|
+
function resolveWorkbenchPort(value) {
|
|
7905
|
+
const port = value ?? "5570";
|
|
7906
|
+
if (!/^[1-9]\d*$/.test(port)) throw new Error(`Invalid workbench port "${port}". Expected an integer from 1 to 65535.`);
|
|
7907
|
+
const numericPort = Number(port);
|
|
7908
|
+
if (!Number.isSafeInteger(numericPort) || numericPort > 65535) throw new Error(`Invalid workbench port "${port}". Expected an integer from 1 to 65535.`);
|
|
7909
|
+
return String(numericPort);
|
|
7910
|
+
}
|
|
7911
|
+
function workbenchUrlHost(host) {
|
|
7912
|
+
return host.includes(":") && !host.startsWith("[") ? `[${host}]` : host;
|
|
7913
|
+
}
|
|
7914
|
+
function normalizeWorkbenchHost(host) {
|
|
7915
|
+
return host.startsWith("[") && host.endsWith("]") ? host.slice(1, -1) : host;
|
|
7916
|
+
}
|
|
7917
|
+
function isLoopbackHost(host) {
|
|
7918
|
+
return host === "localhost" || host === "127.0.0.1" || host === "::1" || host === "[::1]";
|
|
7919
|
+
}
|
|
7920
|
+
function resolveInstalledWorkbenchHostDir(cwd) {
|
|
7921
|
+
const packageRoot = findInstalledWorkbenchPackageRoot(cwd);
|
|
7922
|
+
if (!packageRoot) return null;
|
|
7923
|
+
const hostDir = join(packageRoot, "host");
|
|
7924
|
+
return existsSync(join(hostDir, "package.json")) ? hostDir : null;
|
|
7925
|
+
}
|
|
7926
|
+
function resolveWorkspaceWorkbenchHostDir(workspaceRoot) {
|
|
7927
|
+
const hostDir = join(workspaceRoot, "packages", "smrt-workbench", "host");
|
|
7928
|
+
return existsSync(join(hostDir, "package.json")) ? hostDir : null;
|
|
7929
|
+
}
|
|
7930
|
+
function detectPackageManager(projectRoot) {
|
|
7931
|
+
let current = resolve(projectRoot);
|
|
7932
|
+
while (true) {
|
|
7933
|
+
if (existsSync(join(current, "pnpm-lock.yaml"))) return "pnpm";
|
|
7934
|
+
if (existsSync(join(current, "yarn.lock"))) return "yarn";
|
|
7935
|
+
const packageJsonPath = join(current, "package.json");
|
|
7936
|
+
if (existsSync(packageJsonPath)) try {
|
|
7937
|
+
const packageManager = JSON.parse(readFileSync(packageJsonPath, "utf8")).packageManager;
|
|
7938
|
+
if (typeof packageManager === "string") {
|
|
7939
|
+
if (packageManager.startsWith("pnpm@")) return "pnpm";
|
|
7940
|
+
if (packageManager.startsWith("yarn@")) return "yarn";
|
|
7941
|
+
if (packageManager.startsWith("npm@")) return "npm";
|
|
7942
|
+
}
|
|
7943
|
+
} catch {}
|
|
7944
|
+
const parent = dirname(current);
|
|
7945
|
+
if (parent === current) return "npm";
|
|
7946
|
+
current = parent;
|
|
7947
|
+
}
|
|
7948
|
+
}
|
|
7949
|
+
function workbenchDevCommand(packageManager, hostDir, host, port) {
|
|
7950
|
+
if (packageManager === "pnpm") return {
|
|
7951
|
+
command: "pnpm",
|
|
7952
|
+
args: [
|
|
7953
|
+
"--dir",
|
|
7954
|
+
hostDir,
|
|
7955
|
+
"dev",
|
|
7956
|
+
"--host",
|
|
7957
|
+
host,
|
|
7958
|
+
"--port",
|
|
7959
|
+
port,
|
|
7960
|
+
"--strictPort"
|
|
7961
|
+
]
|
|
7962
|
+
};
|
|
7963
|
+
if (packageManager === "yarn") return {
|
|
7964
|
+
command: "yarn",
|
|
7965
|
+
args: [
|
|
7966
|
+
"--cwd",
|
|
7967
|
+
hostDir,
|
|
7968
|
+
"dev",
|
|
7969
|
+
"--host",
|
|
7970
|
+
host,
|
|
7971
|
+
"--port",
|
|
7972
|
+
port,
|
|
7973
|
+
"--strictPort"
|
|
7974
|
+
]
|
|
7975
|
+
};
|
|
7976
|
+
return {
|
|
7977
|
+
command: "npm",
|
|
7978
|
+
args: [
|
|
7979
|
+
"--prefix",
|
|
7980
|
+
hostDir,
|
|
7981
|
+
"run",
|
|
7982
|
+
"dev",
|
|
7983
|
+
"--",
|
|
7984
|
+
"--host",
|
|
7985
|
+
host,
|
|
7986
|
+
"--port",
|
|
7987
|
+
port,
|
|
7988
|
+
"--strictPort"
|
|
7989
|
+
]
|
|
7990
|
+
};
|
|
7991
|
+
}
|
|
7992
|
+
var workbenchCommands = { "workbench:dev": {
|
|
7993
|
+
name: "workbench:dev",
|
|
7994
|
+
description: "Run the shared SMRT workbench host for the current scope",
|
|
7995
|
+
args: [],
|
|
7996
|
+
options: {
|
|
7997
|
+
package: {
|
|
7998
|
+
type: "string",
|
|
7999
|
+
description: "Focus the workbench to a package name"
|
|
8000
|
+
},
|
|
8001
|
+
port: {
|
|
8002
|
+
type: "string",
|
|
8003
|
+
description: "Workbench dev server port",
|
|
8004
|
+
default: "5570"
|
|
8005
|
+
},
|
|
8006
|
+
host: {
|
|
8007
|
+
type: "string",
|
|
8008
|
+
description: "Workbench dev server host",
|
|
8009
|
+
default: "127.0.0.1"
|
|
8010
|
+
},
|
|
8011
|
+
"allow-remote": {
|
|
8012
|
+
type: "boolean",
|
|
8013
|
+
description: "Acknowledge that a non-loopback host exposes local project sources",
|
|
8014
|
+
default: false
|
|
8015
|
+
}
|
|
8016
|
+
},
|
|
8017
|
+
handler: async (_args, options) => {
|
|
8018
|
+
const cwd = process.cwd();
|
|
8019
|
+
const scope = (await loadWorkbenchRuntime(cwd)).resolveWorkbenchScope(cwd, { packageName: options.package });
|
|
8020
|
+
const workspaceRoot = findWorkspaceWorkbenchRoot(cwd);
|
|
8021
|
+
const hostDir = (workspaceRoot ? resolveWorkspaceWorkbenchHostDir(workspaceRoot) : null) || resolveInstalledWorkbenchHostDir(cwd);
|
|
8022
|
+
if (!hostDir) throw new Error("Could not locate @happyvertical/smrt-workbench host files. Install @happyvertical/smrt-workbench or run from the SMRT workspace.");
|
|
8023
|
+
const requestedHost = options.host || "127.0.0.1";
|
|
8024
|
+
const host = normalizeWorkbenchHost(requestedHost);
|
|
8025
|
+
if (!isLoopbackHost(host) && !options["allow-remote"]) throw new Error(`Refusing to expose the workbench on non-loopback host "${requestedHost}". Re-run with --allow-remote only on a trusted network.`);
|
|
8026
|
+
const port = resolveWorkbenchPort(options.port);
|
|
8027
|
+
const url = `http://${workbenchUrlHost(host)}:${port}/`;
|
|
8028
|
+
const env = {
|
|
8029
|
+
...process.env,
|
|
8030
|
+
SMRT_WORKBENCH_CWD: cwd,
|
|
8031
|
+
SMRT_WORKBENCH_PROJECT_ROOT: scope.projectRoot,
|
|
8032
|
+
SMRT_WORKBENCH_PACKAGE: scope.packageName || "",
|
|
8033
|
+
SMRT_WORKBENCH_ALLOW_REMOTE: options["allow-remote"] ? "1" : ""
|
|
8034
|
+
};
|
|
8035
|
+
console.log(`\nStarting SMRT workbench (${scope.mode} scope) at ${url}\n`);
|
|
8036
|
+
if (scope.packageName) console.log(`Focused package: ${scope.packageName}\n`);
|
|
8037
|
+
const devCommand = workbenchDevCommand(workspaceRoot ? "pnpm" : detectPackageManager(scope.projectRoot), resolve(hostDir), host, port);
|
|
8038
|
+
await runCommand(devCommand.command, devCommand.args, scope.projectRoot, env);
|
|
8039
|
+
}
|
|
8040
|
+
} };
|
|
8041
|
+
//#endregion
|
|
8042
|
+
export { dispatchCommands, docsCommands, generateCommands, gitCommands, gnodeCommands, initCommands, playgroundCommands, utilityCommands, workbenchCommands };
|
package/dist/index.js
CHANGED
|
@@ -46,62 +46,70 @@ var _utilityCommands = null;
|
|
|
46
46
|
var _dispatchCommands = null;
|
|
47
47
|
var _docsCommands = null;
|
|
48
48
|
var _playgroundCommands = null;
|
|
49
|
+
var _workbenchCommands = null;
|
|
49
50
|
async function getGnodeCommands() {
|
|
50
51
|
if (!_gnodeCommands) {
|
|
51
|
-
const { gnodeCommands } = await import("./commands-
|
|
52
|
+
const { gnodeCommands } = await import("./commands-BMFrPkA-.js");
|
|
52
53
|
_gnodeCommands = gnodeCommands;
|
|
53
54
|
}
|
|
54
55
|
return _gnodeCommands;
|
|
55
56
|
}
|
|
56
57
|
async function getGitCommands() {
|
|
57
58
|
if (!_gitCommands) {
|
|
58
|
-
const { gitCommands } = await import("./commands-
|
|
59
|
+
const { gitCommands } = await import("./commands-BMFrPkA-.js");
|
|
59
60
|
_gitCommands = gitCommands;
|
|
60
61
|
}
|
|
61
62
|
return _gitCommands;
|
|
62
63
|
}
|
|
63
64
|
async function getGenerateCommands() {
|
|
64
65
|
if (!_generateCommands) {
|
|
65
|
-
const { generateCommands } = await import("./commands-
|
|
66
|
+
const { generateCommands } = await import("./commands-BMFrPkA-.js");
|
|
66
67
|
_generateCommands = generateCommands;
|
|
67
68
|
}
|
|
68
69
|
return _generateCommands;
|
|
69
70
|
}
|
|
70
71
|
async function getInitCommands() {
|
|
71
72
|
if (!_initCommands) {
|
|
72
|
-
const { initCommands } = await import("./commands-
|
|
73
|
+
const { initCommands } = await import("./commands-BMFrPkA-.js");
|
|
73
74
|
_initCommands = initCommands;
|
|
74
75
|
}
|
|
75
76
|
return _initCommands;
|
|
76
77
|
}
|
|
77
78
|
async function getUtilityCommands() {
|
|
78
79
|
if (!_utilityCommands) {
|
|
79
|
-
const { utilityCommands } = await import("./commands-
|
|
80
|
+
const { utilityCommands } = await import("./commands-BMFrPkA-.js");
|
|
80
81
|
_utilityCommands = utilityCommands;
|
|
81
82
|
}
|
|
82
83
|
return _utilityCommands;
|
|
83
84
|
}
|
|
84
85
|
async function getDispatchCommands() {
|
|
85
86
|
if (!_dispatchCommands) {
|
|
86
|
-
const { dispatchCommands } = await import("./commands-
|
|
87
|
+
const { dispatchCommands } = await import("./commands-BMFrPkA-.js");
|
|
87
88
|
_dispatchCommands = dispatchCommands;
|
|
88
89
|
}
|
|
89
90
|
return _dispatchCommands;
|
|
90
91
|
}
|
|
91
92
|
async function getDocsCommands() {
|
|
92
93
|
if (!_docsCommands) {
|
|
93
|
-
const { docsCommands } = await import("./commands-
|
|
94
|
+
const { docsCommands } = await import("./commands-BMFrPkA-.js");
|
|
94
95
|
_docsCommands = docsCommands;
|
|
95
96
|
}
|
|
96
97
|
return _docsCommands;
|
|
97
98
|
}
|
|
98
99
|
async function getPlaygroundCommands() {
|
|
99
100
|
if (!_playgroundCommands) {
|
|
100
|
-
const { playgroundCommands } = await import("./commands-
|
|
101
|
+
const { playgroundCommands } = await import("./commands-BMFrPkA-.js");
|
|
101
102
|
_playgroundCommands = playgroundCommands;
|
|
102
103
|
}
|
|
103
104
|
return _playgroundCommands;
|
|
104
105
|
}
|
|
106
|
+
async function getWorkbenchCommands() {
|
|
107
|
+
if (!_workbenchCommands) {
|
|
108
|
+
const { workbenchCommands } = await import("./commands-BMFrPkA-.js");
|
|
109
|
+
_workbenchCommands = workbenchCommands;
|
|
110
|
+
}
|
|
111
|
+
return _workbenchCommands;
|
|
112
|
+
}
|
|
105
113
|
function collectRepeatableOptionValues(argv, optionName) {
|
|
106
114
|
const flag = `--${optionName}`;
|
|
107
115
|
const inlinePrefix = `${flag}=`;
|
|
@@ -447,7 +455,8 @@ var CLIGenerator = class {
|
|
|
447
455
|
"dispatch",
|
|
448
456
|
"docs",
|
|
449
457
|
"git",
|
|
450
|
-
"playground"
|
|
458
|
+
"playground",
|
|
459
|
+
"workbench"
|
|
451
460
|
])).has(firstArg)) return [combinedCommand, ...argv.slice(2)];
|
|
452
461
|
const registeredClasses = ObjectRegistry.getAllClasses();
|
|
453
462
|
if (Array.from(registeredClasses.values()).some((info) => (info.name || "").toLowerCase() === firstArg.toLowerCase())) return [combinedCommand, ...argv.slice(2)];
|
|
@@ -792,7 +801,7 @@ var CLIGenerator = class {
|
|
|
792
801
|
return;
|
|
793
802
|
}
|
|
794
803
|
}
|
|
795
|
-
const [gnodeCommands, generateCommands, gitCommands, initCommands, utilityCommands, dispatchCommands, docsCommands, playgroundCommands] = await Promise.all([
|
|
804
|
+
const [gnodeCommands, generateCommands, gitCommands, initCommands, utilityCommands, dispatchCommands, docsCommands, playgroundCommands, workbenchCommands] = await Promise.all([
|
|
796
805
|
getGnodeCommands(),
|
|
797
806
|
getGenerateCommands(),
|
|
798
807
|
getGitCommands(),
|
|
@@ -800,7 +809,8 @@ var CLIGenerator = class {
|
|
|
800
809
|
getUtilityCommands(),
|
|
801
810
|
getDispatchCommands(),
|
|
802
811
|
getDocsCommands(),
|
|
803
|
-
getPlaygroundCommands()
|
|
812
|
+
getPlaygroundCommands(),
|
|
813
|
+
getWorkbenchCommands()
|
|
804
814
|
]);
|
|
805
815
|
const builtInCommands = {
|
|
806
816
|
...gnodeCommands,
|
|
@@ -810,7 +820,8 @@ var CLIGenerator = class {
|
|
|
810
820
|
...utilityCommands,
|
|
811
821
|
...dispatchCommands,
|
|
812
822
|
...docsCommands,
|
|
813
|
-
...playgroundCommands
|
|
823
|
+
...playgroundCommands,
|
|
824
|
+
...workbenchCommands
|
|
814
825
|
};
|
|
815
826
|
const builtInCommand = builtInCommands[parsed.command] ?? Object.values(builtInCommands).find((cmd) => cmd.name === parsed.command || cmd.aliases?.includes(parsed.command ?? ""));
|
|
816
827
|
if (builtInCommand) {
|
|
@@ -1030,7 +1041,7 @@ var CLIGenerator = class {
|
|
|
1030
1041
|
console.log(`${this.config.name} v${this.config.version}`);
|
|
1031
1042
|
console.log(this.config.description);
|
|
1032
1043
|
console.log();
|
|
1033
|
-
const [gnodeCommands, generateCommands, gitCommands, initCommands, utilityCommands, dispatchCommands, docsCommands, playgroundCommands] = await Promise.all([
|
|
1044
|
+
const [gnodeCommands, generateCommands, gitCommands, initCommands, utilityCommands, dispatchCommands, docsCommands, playgroundCommands, workbenchCommands] = await Promise.all([
|
|
1034
1045
|
getGnodeCommands(),
|
|
1035
1046
|
getGenerateCommands(),
|
|
1036
1047
|
getGitCommands(),
|
|
@@ -1038,7 +1049,8 @@ var CLIGenerator = class {
|
|
|
1038
1049
|
getUtilityCommands(),
|
|
1039
1050
|
getDispatchCommands(),
|
|
1040
1051
|
getDocsCommands(),
|
|
1041
|
-
getPlaygroundCommands()
|
|
1052
|
+
getPlaygroundCommands(),
|
|
1053
|
+
getWorkbenchCommands()
|
|
1042
1054
|
]);
|
|
1043
1055
|
console.log("Project Setup:");
|
|
1044
1056
|
for (const command of Object.values(initCommands)) this.showCommandHelp(command);
|
|
@@ -1046,6 +1058,9 @@ var CLIGenerator = class {
|
|
|
1046
1058
|
console.log("Playground:");
|
|
1047
1059
|
for (const command of Object.values(playgroundCommands)) this.showCommandHelp(command);
|
|
1048
1060
|
console.log();
|
|
1061
|
+
console.log("Workbench:");
|
|
1062
|
+
for (const command of Object.values(workbenchCommands)) this.showCommandHelp(command);
|
|
1063
|
+
console.log();
|
|
1049
1064
|
console.log("Utility Commands:");
|
|
1050
1065
|
for (const command of Object.values(utilityCommands)) this.showCommandHelp(command);
|
|
1051
1066
|
console.log();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@happyvertical/smrt-cli",
|
|
3
|
-
"version": "0.40.
|
|
3
|
+
"version": "0.40.66",
|
|
4
4
|
"description": "Developer CLI for SMRT framework - introspection, testing, and project management",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -24,20 +24,20 @@
|
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@happyvertical/ai": "^0.86.
|
|
28
|
-
"@happyvertical/files": "^0.86.
|
|
29
|
-
"@happyvertical/logger": "^0.86.
|
|
30
|
-
"@happyvertical/sql": "^0.86.
|
|
31
|
-
"@happyvertical/utils": "^0.86.
|
|
27
|
+
"@happyvertical/ai": "^0.86.3",
|
|
28
|
+
"@happyvertical/files": "^0.86.3",
|
|
29
|
+
"@happyvertical/logger": "^0.86.3",
|
|
30
|
+
"@happyvertical/sql": "^0.86.3",
|
|
31
|
+
"@happyvertical/utils": "^0.86.3",
|
|
32
32
|
"acorn": "^8.17.0",
|
|
33
33
|
"fast-glob": "3.3.3",
|
|
34
34
|
"tar": "^7.5.19",
|
|
35
|
-
"@happyvertical/smrt-agents": "0.40.
|
|
36
|
-
"@happyvertical/smrt-
|
|
37
|
-
"@happyvertical/smrt-
|
|
38
|
-
"@happyvertical/smrt-
|
|
39
|
-
"@happyvertical/smrt-
|
|
40
|
-
"@happyvertical/smrt-
|
|
35
|
+
"@happyvertical/smrt-agents": "0.40.66",
|
|
36
|
+
"@happyvertical/smrt-playground": "0.40.66",
|
|
37
|
+
"@happyvertical/smrt-config": "0.40.66",
|
|
38
|
+
"@happyvertical/smrt-types": "0.40.66",
|
|
39
|
+
"@happyvertical/smrt-dev-mcp": "0.40.66",
|
|
40
|
+
"@happyvertical/smrt-core": "0.40.66"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/node": "24.13.2",
|