@happyvertical/smrt-cli 0.43.9 → 0.43.10

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
@@ -146,7 +146,16 @@ layout that means declaring them, not relying on the CLI's own dependencies.
146
146
  |---------|------------|
147
147
  | `smrt config:export` | Export agent config for SSG |
148
148
  | `smrt export` | Export data in various formats |
149
- | `smrt init` | Initialize a new s-m-r-t project |
149
+ | `smrt init` | Initialize s-m-r-t in an existing SvelteKit project |
150
+
151
+ `smrt init` updates an existing SvelteKit application's `package.json` with the
152
+ direct dependencies its generated source and default MCP server require:
153
+ `@happyvertical/smrt-core`, `@happyvertical/smrt-config`, and
154
+ `@modelcontextprotocol/server`. It also adds `@happyvertical/smrt-cli` as a
155
+ development dependency so the generated project can run `smrt generate-mcp`.
156
+ Run the project's package-manager install command after initialization. Existing
157
+ versions are preserved; s-m-r-t workspace projects receive `workspace:*` ranges and
158
+ consumer projects receive the CLI's published release line.
150
159
 
151
160
  ### Dispatch
152
161
 
@@ -5564,6 +5564,74 @@ var gnodeCommands = {
5564
5564
  *
5565
5565
  * Initialize SMRT in an existing SvelteKit project
5566
5566
  */
5567
+ var RUNTIME_DEPENDENCIES = [
5568
+ "@happyvertical/smrt-core",
5569
+ "@happyvertical/smrt-config",
5570
+ "@modelcontextprotocol/server"
5571
+ ];
5572
+ var CLI_DEPENDENCY = "@happyvertical/smrt-cli";
5573
+ var MCP_SERVER_VERSION = "2.0.0";
5574
+ /**
5575
+ * Find the SMRT monorepo root when init runs against one of its workspace
5576
+ * projects. Consumer projects must use the published CLI release line instead.
5577
+ */
5578
+ function findSmrtWorkspaceRoot(startDir) {
5579
+ let current = resolve(startDir);
5580
+ while (true) {
5581
+ if (existsSync(join(current, "pnpm-workspace.yaml")) && existsSync(join(current, "packages", "smrt-playground", "host", "package.json"))) return current;
5582
+ const parent = dirname(current);
5583
+ if (parent === current) return null;
5584
+ current = parent;
5585
+ }
5586
+ }
5587
+ function getSmrtDependencyVersion(projectRoot) {
5588
+ if (findSmrtWorkspaceRoot(projectRoot)) return "workspace:*";
5589
+ let current = dirname(fileURLToPath(import.meta.url));
5590
+ while (true) {
5591
+ const packageJsonPath = join(current, "package.json");
5592
+ if (existsSync(packageJsonPath)) {
5593
+ const cliPackageJson = JSON.parse(readFileSync(packageJsonPath, "utf-8"));
5594
+ if (cliPackageJson.name === CLI_DEPENDENCY && cliPackageJson.version) return `^${cliPackageJson.version}`;
5595
+ }
5596
+ const parent = dirname(current);
5597
+ if (parent === current) break;
5598
+ current = parent;
5599
+ }
5600
+ throw new Error("Could not determine the installed SMRT CLI version");
5601
+ }
5602
+ /**
5603
+ * Declare the packages emitted by init and the default MCP generator. Generated
5604
+ * MCP servers resolve from the host application under pnpm, so the CLI's own
5605
+ * transitive dependencies are not sufficient.
5606
+ */
5607
+ function ensureInitDependencies(packageJsonPath, packageJson, projectRoot) {
5608
+ const smrtVersion = getSmrtDependencyVersion(projectRoot);
5609
+ const added = [];
5610
+ let changed = false;
5611
+ packageJson.dependencies ??= {};
5612
+ packageJson.devDependencies ??= {};
5613
+ for (const dependency of RUNTIME_DEPENDENCIES) {
5614
+ if (packageJson.dependencies[dependency]) {
5615
+ if (dependency in packageJson.devDependencies) {
5616
+ delete packageJson.devDependencies[dependency];
5617
+ changed = true;
5618
+ }
5619
+ continue;
5620
+ }
5621
+ const version = packageJson.devDependencies[dependency] ?? (dependency === "@modelcontextprotocol/server" ? MCP_SERVER_VERSION : smrtVersion);
5622
+ packageJson.dependencies[dependency] = version;
5623
+ delete packageJson.devDependencies[dependency];
5624
+ added.push(`${dependency}@${version}`);
5625
+ changed = true;
5626
+ }
5627
+ if (!packageJson.dependencies[CLI_DEPENDENCY] && !packageJson.devDependencies[CLI_DEPENDENCY]) {
5628
+ packageJson.devDependencies[CLI_DEPENDENCY] = smrtVersion;
5629
+ added.push(`${CLI_DEPENDENCY}@${smrtVersion}`);
5630
+ changed = true;
5631
+ }
5632
+ if (changed) writeFileSync(packageJsonPath, `${JSON.stringify(packageJson, null, 2)}\n`);
5633
+ return added;
5634
+ }
5567
5635
  /**
5568
5636
  * Template for smrt.config.ts
5569
5637
  */
@@ -5789,6 +5857,7 @@ var initCommands = { init: {
5789
5857
  console.warn("⚠️ This does not appear to be a SvelteKit project.");
5790
5858
  console.warn(" SMRT init is designed for SvelteKit. Continuing anyway...\n");
5791
5859
  }
5860
+ const dependenciesAdded = ensureInitDependencies(packageJsonPath, packageJson, cwd);
5792
5861
  const created = [];
5793
5862
  const skipped = [];
5794
5863
  const writeFile = (path, content, description) => {
@@ -5823,7 +5892,6 @@ var initCommands = { init: {
5823
5892
  created.push("data/ - Database directory");
5824
5893
  }
5825
5894
  }
5826
- const hasSmrt = packageJson.dependencies?.["@happyvertical/smrt-core"] || packageJson.devDependencies?.["@happyvertical/smrt-core"];
5827
5895
  console.log("✅ Created files:");
5828
5896
  for (const file of created) console.log(` • ${file}`);
5829
5897
  if (skipped.length > 0) {
@@ -5831,9 +5899,10 @@ var initCommands = { init: {
5831
5899
  for (const file of skipped) console.log(` • ${file}`);
5832
5900
  }
5833
5901
  console.log("\n📋 Next steps:\n");
5834
- if (!hasSmrt) {
5835
- console.log("1. Install SMRT:");
5836
- console.log(" npm install @happyvertical/smrt-core\n");
5902
+ if (dependenciesAdded.length > 0) {
5903
+ console.log("1. Added SMRT dependencies to package.json:");
5904
+ for (const dependency of dependenciesAdded) console.log(` • ${dependency}`);
5905
+ console.log(" Run your package manager install command.\n");
5837
5906
  }
5838
5907
  console.log("2. Update your vite.config.ts to add smrtPlugin:");
5839
5908
  console.log(`
package/dist/index.js CHANGED
@@ -49,63 +49,63 @@ var _playgroundCommands = null;
49
49
  var _workbenchCommands = null;
50
50
  async function getGnodeCommands() {
51
51
  if (!_gnodeCommands) {
52
- const { gnodeCommands } = await import("./commands-BAKZil1v.js");
52
+ const { gnodeCommands } = await import("./commands-BoyqL_79.js");
53
53
  _gnodeCommands = gnodeCommands;
54
54
  }
55
55
  return _gnodeCommands;
56
56
  }
57
57
  async function getGitCommands() {
58
58
  if (!_gitCommands) {
59
- const { gitCommands } = await import("./commands-BAKZil1v.js");
59
+ const { gitCommands } = await import("./commands-BoyqL_79.js");
60
60
  _gitCommands = gitCommands;
61
61
  }
62
62
  return _gitCommands;
63
63
  }
64
64
  async function getGenerateCommands() {
65
65
  if (!_generateCommands) {
66
- const { generateCommands } = await import("./commands-BAKZil1v.js");
66
+ const { generateCommands } = await import("./commands-BoyqL_79.js");
67
67
  _generateCommands = generateCommands;
68
68
  }
69
69
  return _generateCommands;
70
70
  }
71
71
  async function getInitCommands() {
72
72
  if (!_initCommands) {
73
- const { initCommands } = await import("./commands-BAKZil1v.js");
73
+ const { initCommands } = await import("./commands-BoyqL_79.js");
74
74
  _initCommands = initCommands;
75
75
  }
76
76
  return _initCommands;
77
77
  }
78
78
  async function getUtilityCommands() {
79
79
  if (!_utilityCommands) {
80
- const { utilityCommands } = await import("./commands-BAKZil1v.js");
80
+ const { utilityCommands } = await import("./commands-BoyqL_79.js");
81
81
  _utilityCommands = utilityCommands;
82
82
  }
83
83
  return _utilityCommands;
84
84
  }
85
85
  async function getDispatchCommands() {
86
86
  if (!_dispatchCommands) {
87
- const { dispatchCommands } = await import("./commands-BAKZil1v.js");
87
+ const { dispatchCommands } = await import("./commands-BoyqL_79.js");
88
88
  _dispatchCommands = dispatchCommands;
89
89
  }
90
90
  return _dispatchCommands;
91
91
  }
92
92
  async function getDocsCommands() {
93
93
  if (!_docsCommands) {
94
- const { docsCommands } = await import("./commands-BAKZil1v.js");
94
+ const { docsCommands } = await import("./commands-BoyqL_79.js");
95
95
  _docsCommands = docsCommands;
96
96
  }
97
97
  return _docsCommands;
98
98
  }
99
99
  async function getPlaygroundCommands() {
100
100
  if (!_playgroundCommands) {
101
- const { playgroundCommands } = await import("./commands-BAKZil1v.js");
101
+ const { playgroundCommands } = await import("./commands-BoyqL_79.js");
102
102
  _playgroundCommands = playgroundCommands;
103
103
  }
104
104
  return _playgroundCommands;
105
105
  }
106
106
  async function getWorkbenchCommands() {
107
107
  if (!_workbenchCommands) {
108
- const { workbenchCommands } = await import("./commands-BAKZil1v.js");
108
+ const { workbenchCommands } = await import("./commands-BoyqL_79.js");
109
109
  _workbenchCommands = workbenchCommands;
110
110
  }
111
111
  return _workbenchCommands;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@happyvertical/smrt-cli",
3
- "version": "0.43.9",
3
+ "version": "0.43.10",
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-agents": "0.43.9",
36
- "@happyvertical/smrt-config": "0.43.9",
37
- "@happyvertical/smrt-core": "0.43.9",
38
- "@happyvertical/smrt-dev-mcp": "0.43.9",
39
- "@happyvertical/smrt-playground": "0.43.9",
40
- "@happyvertical/smrt-types": "0.43.9"
35
+ "@happyvertical/smrt-core": "0.43.10",
36
+ "@happyvertical/smrt-dev-mcp": "0.43.10",
37
+ "@happyvertical/smrt-playground": "0.43.10",
38
+ "@happyvertical/smrt-config": "0.43.10",
39
+ "@happyvertical/smrt-types": "0.43.10",
40
+ "@happyvertical/smrt-agents": "0.43.10"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@types/node": "24.13.2",